/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 87351: /***/ (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; 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]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issueCommand = issueCommand; exports.issue = issue; const os = __importStar(__nccwpck_require__(22037)); const utils_1 = __nccwpck_require__(5278); /** * Issues a command to the GitHub Actions runner * * @param command - The command name to issue * @param properties - Additional properties for the command (key-value pairs) * @param message - The message to include with the command * @remarks * This function outputs a specially formatted string to stdout that the Actions * runner interprets as a command. These commands can control workflow behavior, * set outputs, create annotations, mask values, and more. * * Command Format: * ::name key=value,key=value::message * * @example * ```typescript * // Issue a warning annotation * issueCommand('warning', {}, 'This is a warning message'); * // Output: ::warning::This is a warning message * * // Set an environment variable * issueCommand('set-env', { name: 'MY_VAR' }, 'some value'); * // Output: ::set-env name=MY_VAR::some value * * // Add a secret mask * issueCommand('add-mask', {}, 'secretValue123'); * // Output: ::add-mask::secretValue123 * ``` * * @internal * This is an internal utility function that powers the public API functions * such as setSecret, warning, error, and exportVariable. */ function issueCommand(command, properties, message) { const cmd = new Command(command, properties, message); process.stdout.write(cmd.toString() + os.EOL); } function issue(name, message = '') { issueCommand(name, {}, message); } const CMD_STRING = '::'; class Command { constructor(command, properties, message) { if (!command) { command = 'missing.command'; } this.command = command; this.properties = properties; this.message = message; } toString() { let cmdStr = CMD_STRING + this.command; if (this.properties && Object.keys(this.properties).length > 0) { cmdStr += ' '; let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { const val = this.properties[key]; if (val) { if (first) { first = false; } else { cmdStr += ','; } cmdStr += `${key}=${escapeProperty(val)}`; } } } } cmdStr += `${CMD_STRING}${escapeData(this.message)}`; return cmdStr; } } function escapeData(s) { return (0, utils_1.toCommandValue)(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A'); } function escapeProperty(s) { return (0, utils_1.toCommandValue)(s) .replace(/%/g, '%25') .replace(/\r/g, '%0D') .replace(/\n/g, '%0A') .replace(/:/g, '%3A') .replace(/,/g, '%2C'); } //# sourceMappingURL=command.js.map /***/ }), /***/ 42186: /***/ (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; 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]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.platform = exports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = exports.markdownSummary = exports.summary = exports.ExitCode = void 0; exports.exportVariable = exportVariable; exports.setSecret = setSecret; exports.addPath = addPath; exports.getInput = getInput; exports.getMultilineInput = getMultilineInput; exports.getBooleanInput = getBooleanInput; exports.setOutput = setOutput; exports.setCommandEcho = setCommandEcho; exports.setFailed = setFailed; exports.isDebug = isDebug; exports.debug = debug; exports.error = error; exports.warning = warning; exports.notice = notice; exports.info = info; exports.startGroup = startGroup; exports.endGroup = endGroup; exports.group = group; exports.saveState = saveState; exports.getState = getState; exports.getIDToken = getIDToken; const command_1 = __nccwpck_require__(87351); const file_command_1 = __nccwpck_require__(717); const utils_1 = __nccwpck_require__(5278); const os = __importStar(__nccwpck_require__(22037)); const path = __importStar(__nccwpck_require__(71017)); const oidc_utils_1 = __nccwpck_require__(98041); /** * The code to exit an action */ var ExitCode; (function (ExitCode) { /** * A code indicating that the action was successful */ ExitCode[ExitCode["Success"] = 0] = "Success"; /** * A code indicating that the action was a failure */ ExitCode[ExitCode["Failure"] = 1] = "Failure"; })(ExitCode || (exports.ExitCode = ExitCode = {})); //----------------------------------------------------------------------- // Variables //----------------------------------------------------------------------- /** * Sets env variable for this action and future actions in the job * @param name the name of the variable to set * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function exportVariable(name, val) { const convertedVal = (0, utils_1.toCommandValue)(val); process.env[name] = convertedVal; const filePath = process.env['GITHUB_ENV'] || ''; if (filePath) { return (0, file_command_1.issueFileCommand)('ENV', (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)('set-env', { name }, convertedVal); } /** * Registers a secret which will get masked from logs * * @param secret - Value of the secret to be masked * @remarks * This function instructs the Actions runner to mask the specified value in any * logs produced during the workflow run. Once registered, the secret value will * be replaced with asterisks (***) whenever it appears in console output, logs, * or error messages. * * This is useful for protecting sensitive information such as: * - API keys * - Access tokens * - Authentication credentials * - URL parameters containing signatures (SAS tokens) * * Note that masking only affects future logs; any previous appearances of the * secret in logs before calling this function will remain unmasked. * * @example * ```typescript * // Register an API token as a secret * const apiToken = "abc123xyz456"; * setSecret(apiToken); * * // Now any logs containing this value will show *** instead * console.log(`Using token: ${apiToken}`); // Outputs: "Using token: ***" * ``` */ function setSecret(secret) { (0, command_1.issueCommand)('add-mask', {}, secret); } /** * Prepends inputPath to the PATH (for this action and future actions) * @param inputPath */ function addPath(inputPath) { const filePath = process.env['GITHUB_PATH'] || ''; if (filePath) { (0, file_command_1.issueFileCommand)('PATH', inputPath); } else { (0, command_1.issueCommand)('add-path', {}, inputPath); } process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; } /** * Gets the value of an input. * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed. * Returns an empty string if the value is not defined. * * @param name name of the input to get * @param options optional. See InputOptions. * @returns string */ function getInput(name, options) { const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || ''; if (options && options.required && !val) { throw new Error(`Input required and not supplied: ${name}`); } if (options && options.trimWhitespace === false) { return val; } return val.trim(); } /** * Gets the values of an multiline input. Each value is also trimmed. * * @param name name of the input to get * @param options optional. See InputOptions. * @returns string[] * */ function getMultilineInput(name, options) { const inputs = getInput(name, options) .split('\n') .filter(x => x !== ''); if (options && options.trimWhitespace === false) { return inputs; } return inputs.map(input => input.trim()); } /** * Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. * Support boolean input list: `true | True | TRUE | false | False | FALSE` . * The return value is also in boolean type. * ref: https://yaml.org/spec/1.2/spec.html#id2804923 * * @param name name of the input to get * @param options optional. See InputOptions. * @returns boolean */ function getBooleanInput(name, options) { const trueValue = ['true', 'True', 'TRUE']; const falseValue = ['false', 'False', 'FALSE']; const val = getInput(name, options); if (trueValue.includes(val)) return true; if (falseValue.includes(val)) return false; throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + `Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } /** * Sets the value of an output. * * @param name name of the output to set * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function setOutput(name, value) { const filePath = process.env['GITHUB_OUTPUT'] || ''; if (filePath) { return (0, file_command_1.issueFileCommand)('OUTPUT', (0, file_command_1.prepareKeyValueMessage)(name, value)); } process.stdout.write(os.EOL); (0, command_1.issueCommand)('set-output', { name }, (0, utils_1.toCommandValue)(value)); } /** * Enables or disables the echoing of commands into stdout for the rest of the step. * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set. * */ function setCommandEcho(enabled) { (0, command_1.issue)('echo', enabled ? 'on' : 'off'); } //----------------------------------------------------------------------- // Results //----------------------------------------------------------------------- /** * Sets the action status to failed. * When the action exits it will be with an exit code of 1 * @param message add error issue message */ function setFailed(message) { process.exitCode = ExitCode.Failure; error(message); } //----------------------------------------------------------------------- // Logging Commands //----------------------------------------------------------------------- /** * Gets whether Actions Step Debug is on or not */ function isDebug() { return process.env['RUNNER_DEBUG'] === '1'; } /** * Writes debug message to user log * @param message debug message */ function debug(message) { (0, command_1.issueCommand)('debug', {}, message); } /** * Adds an error issue * @param message error issue message. Errors will be converted to string via toString() * @param properties optional properties to add to the annotation. */ function error(message, properties = {}) { (0, command_1.issueCommand)('error', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } /** * Adds a warning issue * @param message warning issue message. Errors will be converted to string via toString() * @param properties optional properties to add to the annotation. */ function warning(message, properties = {}) { (0, command_1.issueCommand)('warning', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } /** * Adds a notice issue * @param message notice issue message. Errors will be converted to string via toString() * @param properties optional properties to add to the annotation. */ function notice(message, properties = {}) { (0, command_1.issueCommand)('notice', (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } /** * Writes info to log with console.log. * @param message info message */ function info(message) { process.stdout.write(message + os.EOL); } /** * Begin an output group. * * Output until the next `groupEnd` will be foldable in this group * * @param name The name of the output group */ function startGroup(name) { (0, command_1.issue)('group', name); } /** * End an output group. */ function endGroup() { (0, command_1.issue)('endgroup'); } /** * Wrap an asynchronous function call in a group. * * Returns the same type as the function itself. * * @param name The name of the group * @param fn The function to wrap in the group */ function group(name, fn) { return __awaiter(this, void 0, void 0, function* () { startGroup(name); let result; try { result = yield fn(); } finally { endGroup(); } return result; }); } //----------------------------------------------------------------------- // Wrapper action state //----------------------------------------------------------------------- /** * Saves state for current action, the state can only be retrieved by this action's post job execution. * * @param name name of the state to store * @param value value to store. Non-string values will be converted to a string via JSON.stringify */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function saveState(name, value) { const filePath = process.env['GITHUB_STATE'] || ''; if (filePath) { return (0, file_command_1.issueFileCommand)('STATE', (0, file_command_1.prepareKeyValueMessage)(name, value)); } (0, command_1.issueCommand)('save-state', { name }, (0, utils_1.toCommandValue)(value)); } /** * Gets the value of an state set by this action's main execution. * * @param name name of the state to get * @returns string */ function getState(name) { return process.env[`STATE_${name}`] || ''; } function getIDToken(aud) { return __awaiter(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } /** * Summary exports */ var summary_1 = __nccwpck_require__(81327); Object.defineProperty(exports, "summary", ({ enumerable: true, get: function () { return summary_1.summary; } })); /** * @deprecated use core.summary */ var summary_2 = __nccwpck_require__(81327); Object.defineProperty(exports, "markdownSummary", ({ enumerable: true, get: function () { return summary_2.markdownSummary; } })); /** * Path exports */ var path_utils_1 = __nccwpck_require__(2981); Object.defineProperty(exports, "toPosixPath", ({ enumerable: true, get: function () { return path_utils_1.toPosixPath; } })); Object.defineProperty(exports, "toWin32Path", ({ enumerable: true, get: function () { return path_utils_1.toWin32Path; } })); Object.defineProperty(exports, "toPlatformPath", ({ enumerable: true, get: function () { return path_utils_1.toPlatformPath; } })); /** * Platform utilities exports */ exports.platform = __importStar(__nccwpck_require__(85243)); //# sourceMappingURL=core.js.map /***/ }), /***/ 717: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; // For internal use, subject to change. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = 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]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.issueFileCommand = issueFileCommand; exports.prepareKeyValueMessage = prepareKeyValueMessage; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ const crypto = __importStar(__nccwpck_require__(6113)); const fs = __importStar(__nccwpck_require__(57147)); const os = __importStar(__nccwpck_require__(22037)); const utils_1 = __nccwpck_require__(5278); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; if (!filePath) { throw new Error(`Unable to find environment variable for file command ${command}`); } if (!fs.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { encoding: 'utf8' }); } function prepareKeyValueMessage(key, value) { const delimiter = `ghadelimiter_${crypto.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); // These should realistically never happen, but just in case someone finds a // way to exploit uuid generation let's not allow keys or values that contain // the delimiter. if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; } //# sourceMappingURL=file-command.js.map /***/ }), /***/ 98041: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.OidcClient = void 0; const http_client_1 = __nccwpck_require__(96255); const auth_1 = __nccwpck_require__(35526); const core_1 = __nccwpck_require__(42186); class OidcClient { static createHttpClient(allowRetry = true, maxRetry = 10) { const requestOptions = { allowRetries: allowRetry, maxRetries: maxRetry }; return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions); } static getRequestToken() { const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN']; if (!token) { throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable'); } return token; } static getIDTokenUrl() { const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL']; if (!runtimeUrl) { throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable'); } return runtimeUrl; } static getCall(id_token_url) { return __awaiter(this, void 0, void 0, function* () { var _a; const httpclient = OidcClient.createHttpClient(); const res = yield httpclient .getJson(id_token_url) .catch(error => { throw new Error(`Failed to get ID Token. \n Error Code : ${error.statusCode}\n Error Message: ${error.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { throw new Error('Response json body do not have ID Token field'); } return id_token; }); } static getIDToken(audience) { return __awaiter(this, void 0, void 0, function* () { try { // New ID Token is requested from action service let id_token_url = OidcClient.getIDTokenUrl(); if (audience) { const encodedAudience = encodeURIComponent(audience); id_token_url = `${id_token_url}&audience=${encodedAudience}`; } (0, core_1.debug)(`ID token url is ${id_token_url}`); const id_token = yield OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; } catch (error) { throw new Error(`Error message: ${error.message}`); } }); } } exports.OidcClient = OidcClient; //# sourceMappingURL=oidc-utils.js.map /***/ }), /***/ 2981: /***/ (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; 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]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toPosixPath = toPosixPath; exports.toWin32Path = toWin32Path; exports.toPlatformPath = toPlatformPath; const path = __importStar(__nccwpck_require__(71017)); /** * toPosixPath converts the given path to the posix form. On Windows, \\ will be * replaced with /. * * @param pth. Path to transform. * @return string Posix path. */ function toPosixPath(pth) { return pth.replace(/[\\]/g, '/'); } /** * toWin32Path converts the given path to the win32 form. On Linux, / will be * replaced with \\. * * @param pth. Path to transform. * @return string Win32 path. */ function toWin32Path(pth) { return pth.replace(/[/]/g, '\\'); } /** * toPlatformPath converts the given path to a platform-specific path. It does * this by replacing instances of / and \ with the platform-specific path * separator. * * @param pth The path to platformize. * @return string The platform-specific path. */ function toPlatformPath(pth) { return pth.replace(/[/\\]/g, path.sep); } //# sourceMappingURL=path-utils.js.map /***/ }), /***/ 85243: /***/ (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; 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]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isLinux = exports.isMacOS = exports.isWindows = exports.arch = exports.platform = void 0; exports.getDetails = getDetails; const os_1 = __importDefault(__nccwpck_require__(22037)); const exec = __importStar(__nccwpck_require__(71514)); const getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () { const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', undefined, { silent: true }); const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', undefined, { silent: true }); return { name: name.trim(), version: version.trim() }; }); const getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; const { stdout } = yield exec.getExecOutput('sw_vers', undefined, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ''; const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ''; return { name, version }; }); const getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () { const { stdout } = yield exec.getExecOutput('lsb_release', ['-i', '-r', '-s'], { silent: true }); const [name, version] = stdout.trim().split('\n'); return { name, version }; }); exports.platform = os_1.default.platform(); exports.arch = os_1.default.arch(); exports.isWindows = exports.platform === 'win32'; exports.isMacOS = exports.platform === 'darwin'; exports.isLinux = exports.platform === 'linux'; function getDetails() { return __awaiter(this, void 0, void 0, function* () { return Object.assign(Object.assign({}, (yield (exports.isWindows ? getWindowsInfo() : exports.isMacOS ? getMacOsInfo() : getLinuxInfo()))), { platform: exports.platform, arch: exports.arch, isWindows: exports.isWindows, isMacOS: exports.isMacOS, isLinux: exports.isLinux }); }); } //# sourceMappingURL=platform.js.map /***/ }), /***/ 81327: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0; const os_1 = __nccwpck_require__(22037); const fs_1 = __nccwpck_require__(57147); const { access, appendFile, writeFile } = fs_1.promises; exports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY'; exports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary'; class Summary { constructor() { this._buffer = ''; } /** * Finds the summary file path from the environment, rejects if env var is not found or file does not exist * Also checks r/w permissions. * * @returns step summary file path */ filePath() { return __awaiter(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR]; if (!pathFromEnv) { throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`); } try { yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); } catch (_a) { throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } this._filePath = pathFromEnv; return this._filePath; }); } /** * Wraps content in an HTML tag, adding any HTML attributes * * @param {string} tag HTML tag to wrap * @param {string | null} content content within the tag * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add * * @returns {string} content wrapped in HTML element */ wrap(tag, content, attrs = {}) { const htmlAttrs = Object.entries(attrs) .map(([key, value]) => ` ${key}="${value}"`) .join(''); if (!content) { return `<${tag}${htmlAttrs}>`; } return `<${tag}${htmlAttrs}>${content}`; } /** * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default. * * @param {SummaryWriteOptions} [options] (optional) options for write operation * * @returns {Promise} summary instance */ write(options) { return __awaiter(this, void 0, void 0, function* () { const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite); const filePath = yield this.filePath(); const writeFunc = overwrite ? writeFile : appendFile; yield writeFunc(filePath, this._buffer, { encoding: 'utf8' }); return this.emptyBuffer(); }); } /** * Clears the summary buffer and wipes the summary file * * @returns {Summary} summary instance */ clear() { return __awaiter(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } /** * Returns the current summary buffer as a string * * @returns {string} string of summary buffer */ stringify() { return this._buffer; } /** * If the summary buffer is empty * * @returns {boolen} true if the buffer is empty */ isEmptyBuffer() { return this._buffer.length === 0; } /** * Resets the summary buffer without writing to summary file * * @returns {Summary} summary instance */ emptyBuffer() { this._buffer = ''; return this; } /** * Adds raw text to the summary buffer * * @param {string} text content to add * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false) * * @returns {Summary} summary instance */ addRaw(text, addEOL = false) { this._buffer += text; return addEOL ? this.addEOL() : this; } /** * Adds the operating system-specific end-of-line marker to the buffer * * @returns {Summary} summary instance */ addEOL() { return this.addRaw(os_1.EOL); } /** * Adds an HTML codeblock to the summary buffer * * @param {string} code content to render within fenced code block * @param {string} lang (optional) language to syntax highlight code * * @returns {Summary} summary instance */ addCodeBlock(code, lang) { const attrs = Object.assign({}, (lang && { lang })); const element = this.wrap('pre', this.wrap('code', code), attrs); return this.addRaw(element).addEOL(); } /** * Adds an HTML list to the summary buffer * * @param {string[]} items list of items to render * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false) * * @returns {Summary} summary instance */ addList(items, ordered = false) { const tag = ordered ? 'ol' : 'ul'; const listItems = items.map(item => this.wrap('li', item)).join(''); const element = this.wrap(tag, listItems); return this.addRaw(element).addEOL(); } /** * Adds an HTML table to the summary buffer * * @param {SummaryTableCell[]} rows table rows * * @returns {Summary} summary instance */ addTable(rows) { const tableBody = rows .map(row => { const cells = row .map(cell => { if (typeof cell === 'string') { return this.wrap('td', cell); } const { header, data, colspan, rowspan } = cell; const tag = header ? 'th' : 'td'; const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan })); return this.wrap(tag, data, attrs); }) .join(''); return this.wrap('tr', cells); }) .join(''); const element = this.wrap('table', tableBody); return this.addRaw(element).addEOL(); } /** * Adds a collapsable HTML details element to the summary buffer * * @param {string} label text for the closed state * @param {string} content collapsable content * * @returns {Summary} summary instance */ addDetails(label, content) { const element = this.wrap('details', this.wrap('summary', label) + content); return this.addRaw(element).addEOL(); } /** * Adds an HTML image tag to the summary buffer * * @param {string} src path to the image you to embed * @param {string} alt text description of the image * @param {SummaryImageOptions} options (optional) addition image attributes * * @returns {Summary} summary instance */ addImage(src, alt, options) { const { width, height } = options || {}; const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height })); const element = this.wrap('img', null, Object.assign({ src, alt }, attrs)); return this.addRaw(element).addEOL(); } /** * Adds an HTML section heading element * * @param {string} text heading text * @param {number | string} [level=1] (optional) the heading level, default: 1 * * @returns {Summary} summary instance */ addHeading(text, level) { const tag = `h${level}`; const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag) ? tag : 'h1'; const element = this.wrap(allowedTag, text); return this.addRaw(element).addEOL(); } /** * Adds an HTML thematic break (
) to the summary buffer * * @returns {Summary} summary instance */ addSeparator() { const element = this.wrap('hr', null); return this.addRaw(element).addEOL(); } /** * Adds an HTML line break (
) to the summary buffer * * @returns {Summary} summary instance */ addBreak() { const element = this.wrap('br', null); return this.addRaw(element).addEOL(); } /** * Adds an HTML blockquote to the summary buffer * * @param {string} text quote text * @param {string} cite (optional) citation url * * @returns {Summary} summary instance */ addQuote(text, cite) { const attrs = Object.assign({}, (cite && { cite })); const element = this.wrap('blockquote', text, attrs); return this.addRaw(element).addEOL(); } /** * Adds an HTML anchor tag to the summary buffer * * @param {string} text link text/content * @param {string} href hyperlink * * @returns {Summary} summary instance */ addLink(text, href) { const element = this.wrap('a', text, { href }); return this.addRaw(element).addEOL(); } } const _summary = new Summary(); /** * @deprecated use `core.summary` */ exports.markdownSummary = _summary; exports.summary = _summary; //# sourceMappingURL=summary.js.map /***/ }), /***/ 5278: /***/ ((__unused_webpack_module, exports) => { "use strict"; // We use any as a valid input type /* eslint-disable @typescript-eslint/no-explicit-any */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.toCommandValue = toCommandValue; exports.toCommandProperties = toCommandProperties; /** * Sanitizes an input into a string so it can be passed into issueCommand safely * @param input input to sanitize into a string */ function toCommandValue(input) { if (input === null || input === undefined) { return ''; } else if (typeof input === 'string' || input instanceof String) { return input; } return JSON.stringify(input); } /** * * @param annotationProperties * @returns The command properties to send with the actual annotation command * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646 */ function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; } return { title: annotationProperties.title, file: annotationProperties.file, line: annotationProperties.startLine, endLine: annotationProperties.endLine, col: annotationProperties.startColumn, endColumn: annotationProperties.endColumn }; } //# sourceMappingURL=utils.js.map /***/ }), /***/ 71514: /***/ (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; 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]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.exec = exec; exports.getExecOutput = getExecOutput; const string_decoder_1 = __nccwpck_require__(71576); const tr = __importStar(__nccwpck_require__(88159)); /** * Exec a command. * Output will be streamed to the live console. * Returns promise with return code * * @param commandLine command to execute (can include additional args). Must be correctly escaped. * @param args optional arguments for tool. Escaping is handled by the lib. * @param options optional exec options. See ExecOptions * @returns Promise exit code */ function exec(commandLine, args, options) { return __awaiter(this, void 0, void 0, function* () { const commandArgs = tr.argStringToArray(commandLine); if (commandArgs.length === 0) { throw new Error(`Parameter 'commandLine' cannot be null or empty.`); } // Path to tool to execute should be first arg const toolPath = commandArgs[0]; args = commandArgs.slice(1).concat(args || []); const runner = new tr.ToolRunner(toolPath, args, options); return runner.exec(); }); } /** * Exec a command and get the output. * Output will be streamed to the live console. * Returns promise with the exit code and collected stdout and stderr * * @param commandLine command to execute (can include additional args). Must be correctly escaped. * @param args optional arguments for tool. Escaping is handled by the lib. * @param options optional exec options. See ExecOptions * @returns Promise exit code, stdout, and stderr */ function getExecOutput(commandLine, args, options) { return __awaiter(this, void 0, void 0, function* () { var _a, _b; let stdout = ''; let stderr = ''; //Using string decoder covers the case where a mult-byte character is split const stdoutDecoder = new string_decoder_1.StringDecoder('utf8'); const stderrDecoder = new string_decoder_1.StringDecoder('utf8'); const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout; const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr; const stdErrListener = (data) => { stderr += stderrDecoder.write(data); if (originalStdErrListener) { originalStdErrListener(data); } }; const stdOutListener = (data) => { stdout += stdoutDecoder.write(data); if (originalStdoutListener) { originalStdoutListener(data); } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); //flush any remaining characters stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { exitCode, stdout, stderr }; }); } //# sourceMappingURL=exec.js.map /***/ }), /***/ 88159: /***/ (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; 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]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ToolRunner = void 0; exports.argStringToArray = argStringToArray; const os = __importStar(__nccwpck_require__(22037)); const events = __importStar(__nccwpck_require__(82361)); const child = __importStar(__nccwpck_require__(32081)); const path = __importStar(__nccwpck_require__(71017)); const io = __importStar(__nccwpck_require__(47351)); const ioUtil = __importStar(__nccwpck_require__(81962)); const timers_1 = __nccwpck_require__(39512); /* eslint-disable @typescript-eslint/unbound-method */ const IS_WINDOWS = process.platform === 'win32'; /* * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way. */ class ToolRunner extends events.EventEmitter { constructor(toolPath, args, options) { super(); if (!toolPath) { throw new Error("Parameter 'toolPath' cannot be null or empty."); } this.toolPath = toolPath; this.args = args || []; this.options = options || {}; } _debug(message) { if (this.options.listeners && this.options.listeners.debug) { this.options.listeners.debug(message); } } _getCommandString(options, noPrefix) { const toolPath = this._getSpawnFileName(); const args = this._getSpawnArgs(options); let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool if (IS_WINDOWS) { // Windows + cmd file if (this._isCmdFile()) { cmd += toolPath; for (const a of args) { cmd += ` ${a}`; } } // Windows + verbatim else if (options.windowsVerbatimArguments) { cmd += `"${toolPath}"`; for (const a of args) { cmd += ` ${a}`; } } // Windows (regular) else { cmd += this._windowsQuoteCmdArg(toolPath); for (const a of args) { cmd += ` ${this._windowsQuoteCmdArg(a)}`; } } } else { // OSX/Linux - this can likely be improved with some form of quoting. // creating processes on Unix is fundamentally different than Windows. // on Unix, execvp() takes an arg array. cmd += toolPath; for (const a of args) { cmd += ` ${a}`; } } return cmd; } _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); let n = s.indexOf(os.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); // the rest of the string ... s = s.substring(n + os.EOL.length); n = s.indexOf(os.EOL); } return s; } catch (err) { // streaming lines to console is best effort. Don't fail a build. this._debug(`error processing line. Failed with error ${err}`); return ''; } } _getSpawnFileName() { if (IS_WINDOWS) { if (this._isCmdFile()) { return process.env['COMSPEC'] || 'cmd.exe'; } } return this.toolPath; } _getSpawnArgs(options) { if (IS_WINDOWS) { if (this._isCmdFile()) { let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`; for (const a of this.args) { argline += ' '; argline += options.windowsVerbatimArguments ? a : this._windowsQuoteCmdArg(a); } argline += '"'; return [argline]; } } return this.args; } _endsWith(str, end) { return str.endsWith(end); } _isCmdFile() { const upperToolPath = this.toolPath.toUpperCase(); return (this._endsWith(upperToolPath, '.CMD') || this._endsWith(upperToolPath, '.BAT')); } _windowsQuoteCmdArg(arg) { // for .exe, apply the normal quoting rules that libuv applies if (!this._isCmdFile()) { return this._uvQuoteCmdArg(arg); } // otherwise apply quoting rules specific to the cmd.exe command line parser. // the libuv rules are generic and are not designed specifically for cmd.exe // command line parser. // // for a detailed description of the cmd.exe command line parser, refer to // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912 // need quotes for empty arg if (!arg) { return '""'; } // determine whether the arg needs to be quoted const cmdSpecialChars = [ ' ', '\t', '&', '(', ')', '[', ']', '{', '}', '^', '=', ';', '!', "'", '+', ',', '`', '~', '|', '<', '>', '"' ]; let needsQuotes = false; for (const char of arg) { if (cmdSpecialChars.some(x => x === char)) { needsQuotes = true; break; } } // short-circuit if quotes not needed if (!needsQuotes) { return arg; } // the following quoting rules are very similar to the rules that by libuv applies. // // 1) wrap the string in quotes // // 2) double-up quotes - i.e. " => "" // // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately // doesn't work well with a cmd.exe command line. // // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app. // for example, the command line: // foo.exe "myarg:""my val""" // is parsed by a .NET console app into an arg array: // [ "myarg:\"my val\"" ] // which is the same end result when applying libuv quoting rules. although the actual // command line from libuv quoting rules would look like: // foo.exe "myarg:\"my val\"" // // 3) double-up slashes that precede a quote, // e.g. hello \world => "hello \world" // hello\"world => "hello\\""world" // hello\\"world => "hello\\\\""world" // hello world\ => "hello world\\" // // technically this is not required for a cmd.exe command line, or the batch argument parser. // the reasons for including this as a .cmd quoting rule are: // // a) this is optimized for the scenario where the argument is passed from the .cmd file to an // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule. // // b) it's what we've been doing previously (by deferring to node default behavior) and we // haven't heard any complaints about that aspect. // // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be // escaped when used on the command line directly - even though within a .cmd file % can be escaped // by using %%. // // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing. // // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args // to an external program. // // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file. // % can be escaped within a .cmd file. let reverse = '"'; let quoteHit = true; for (let i = arg.length; i > 0; i--) { // walk the string in reverse reverse += arg[i - 1]; if (quoteHit && arg[i - 1] === '\\') { reverse += '\\'; // double the slash } else if (arg[i - 1] === '"') { quoteHit = true; reverse += '"'; // double the quote } else { quoteHit = false; } } reverse += '"'; return reverse.split('').reverse().join(''); } _uvQuoteCmdArg(arg) { // Tool runner wraps child_process.spawn() and needs to apply the same quoting as // Node in certain cases where the undocumented spawn option windowsVerbatimArguments // is used. // // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV, // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details), // pasting copyright notice from Node within this function: // // Copyright Joyent, Inc. and other Node contributors. All rights reserved. // // 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. if (!arg) { // Need double quotation for empty argument return '""'; } if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) { // No quotation needed return arg; } if (!arg.includes('"') && !arg.includes('\\')) { // No embedded double quotes or backslashes, so I can just wrap // quote marks around the whole thing. return `"${arg}"`; } // Expected input/output: // input : hello"world // output: "hello\"world" // input : hello""world // output: "hello\"\"world" // input : hello\world // output: hello\world // input : hello\\world // output: hello\\world // input : hello\"world // output: "hello\\\"world" // input : hello\\"world // output: "hello\\\\\"world" // input : hello world\ // output: "hello world\\" - note the comment in libuv actually reads "hello world\" // but it appears the comment is wrong, it should be "hello world\\" let reverse = '"'; let quoteHit = true; for (let i = arg.length; i > 0; i--) { // walk the string in reverse reverse += arg[i - 1]; if (quoteHit && arg[i - 1] === '\\') { reverse += '\\'; } else if (arg[i - 1] === '"') { quoteHit = true; reverse += '\\'; } else { quoteHit = false; } } reverse += '"'; return reverse.split('').reverse().join(''); } _cloneExecOptions(options) { options = options || {}; const result = { cwd: options.cwd || process.cwd(), env: options.env || process.env, silent: options.silent || false, windowsVerbatimArguments: options.windowsVerbatimArguments || false, failOnStdErr: options.failOnStdErr || false, ignoreReturnCode: options.ignoreReturnCode || false, delay: options.delay || 10000 }; result.outStream = options.outStream || process.stdout; result.errStream = options.errStream || process.stderr; return result; } _getSpawnOptions(options, toolPath) { options = options || {}; const result = {}; result.cwd = options.cwd; result.env = options.env; result['windowsVerbatimArguments'] = options.windowsVerbatimArguments || this._isCmdFile(); if (options.windowsVerbatimArguments) { result.argv0 = `"${toolPath}"`; } return result; } /** * Exec a tool. * Output will be streamed to the live console. * Returns promise with return code * * @param tool path to tool to exec * @param options optional exec options. See ExecOptions * @returns number */ exec() { return __awaiter(this, void 0, void 0, function* () { // root the tool path if it is unrooted and contains relative pathing if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes('/') || (IS_WINDOWS && this.toolPath.includes('\\')))) { // prefer options.cwd if it is specified, however options.cwd may also need to be rooted this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } // if the tool is only a file name, then resolve it from the PATH // otherwise verify it exists (add extension on Windows if necessary) this.toolPath = yield io.which(this.toolPath, true); return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug('arguments:'); for (const arg of this.args) { this._debug(` ${arg}`); } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on('debug', (message) => { this._debug(message); }); if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) { return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`)); } const fileName = this._getSpawnFileName(); const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName)); let stdbuffer = ''; if (cp.stdout) { cp.stdout.on('data', (data) => { if (this.options.listeners && this.options.listeners.stdout) { this.options.listeners.stdout(data); } if (!optionsNonNull.silent && optionsNonNull.outStream) { optionsNonNull.outStream.write(data); } stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => { if (this.options.listeners && this.options.listeners.stdline) { this.options.listeners.stdline(line); } }); }); } let errbuffer = ''; if (cp.stderr) { cp.stderr.on('data', (data) => { state.processStderr = true; if (this.options.listeners && this.options.listeners.stderr) { this.options.listeners.stderr(data); } if (!optionsNonNull.silent && optionsNonNull.errStream && optionsNonNull.outStream) { const s = optionsNonNull.failOnStdErr ? optionsNonNull.errStream : optionsNonNull.outStream; s.write(data); } errbuffer = this._processLineBuffer(data, errbuffer, (line) => { if (this.options.listeners && this.options.listeners.errline) { this.options.listeners.errline(line); } }); }); } cp.on('error', (err) => { state.processError = err.message; state.processExited = true; state.processClosed = true; state.CheckComplete(); }); cp.on('exit', (code) => { state.processExitCode = code; state.processExited = true; this._debug(`Exit code ${code} received from tool '${this.toolPath}'`); state.CheckComplete(); }); cp.on('close', (code) => { state.processExitCode = code; state.processExited = true; state.processClosed = true; this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); state.on('done', (error, exitCode) => { if (stdbuffer.length > 0) { this.emit('stdline', stdbuffer); } if (errbuffer.length > 0) { this.emit('errline', errbuffer); } cp.removeAllListeners(); if (error) { reject(error); } else { resolve(exitCode); } }); if (this.options.input) { if (!cp.stdin) { throw new Error('child process missing stdin'); } cp.stdin.end(this.options.input); } })); }); } } exports.ToolRunner = ToolRunner; /** * Convert an arg string to an array of args. Handles escaping * * @param argString string of arguments * @returns string[] array of arguments */ function argStringToArray(argString) { const args = []; let inQuotes = false; let escaped = false; let arg = ''; function append(c) { // we only escape double quotes. if (escaped && c !== '"') { arg += '\\'; } arg += c; escaped = false; } for (let i = 0; i < argString.length; i++) { const c = argString.charAt(i); if (c === '"') { if (!escaped) { inQuotes = !inQuotes; } else { append(c); } continue; } if (c === '\\' && escaped) { append(c); continue; } if (c === '\\' && inQuotes) { escaped = true; continue; } if (c === ' ' && !inQuotes) { if (arg.length > 0) { args.push(arg); arg = ''; } continue; } append(c); } if (arg.length > 0) { args.push(arg.trim()); } return args; } class ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); this.processClosed = false; // tracks whether the process has exited and stdio is closed this.processError = ''; this.processExitCode = 0; this.processExited = false; // tracks whether the process has exited this.processStderr = false; // tracks whether stderr was written to this.delay = 10000; // 10 seconds this.done = false; this.timeout = null; if (!toolPath) { throw new Error('toolPath must not be empty'); } this.options = options; this.toolPath = toolPath; if (options.delay) { this.delay = options.delay; } } CheckComplete() { if (this.done) { return; } if (this.processClosed) { this._setResult(); } else if (this.processExited) { this.timeout = (0, timers_1.setTimeout)(ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit('debug', message); } _setResult() { // determine whether there is an error let error; if (this.processExited) { if (this.processError) { error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`); } else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) { error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } // clear the timeout if (this.timeout) { clearTimeout(this.timeout); this.timeout = null; } this.done = true; this.emit('done', error, this.processExitCode); } static HandleTimeout(state) { if (state.done) { return; } if (!state.processClosed && state.processExited) { const message = `The STDIO streams did not close within ${state.delay / 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`; state._debug(message); } state._setResult(); } } //# sourceMappingURL=toolrunner.js.map /***/ }), /***/ 35526: /***/ (function(__unused_webpack_module, exports) { "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0; class BasicCredentialHandler { constructor(username, password) { this.username = username; this.password = password; } prepareRequest(options) { if (!options.headers) { throw Error('The request has no headers'); } options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`; } // This handler cannot handle 401 canHandleAuthentication() { return false; } handleAuthentication() { return __awaiter(this, void 0, void 0, function* () { throw new Error('not implemented'); }); } } exports.BasicCredentialHandler = BasicCredentialHandler; class BearerCredentialHandler { constructor(token) { this.token = token; } // currently implements pre-authorization // TODO: support preAuth = false where it hooks on 401 prepareRequest(options) { if (!options.headers) { throw Error('The request has no headers'); } options.headers['Authorization'] = `Bearer ${this.token}`; } // This handler cannot handle 401 canHandleAuthentication() { return false; } handleAuthentication() { return __awaiter(this, void 0, void 0, function* () { throw new Error('not implemented'); }); } } exports.BearerCredentialHandler = BearerCredentialHandler; class PersonalAccessTokenCredentialHandler { constructor(token) { this.token = token; } // currently implements pre-authorization // TODO: support preAuth = false where it hooks on 401 prepareRequest(options) { if (!options.headers) { throw Error('The request has no headers'); } options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`; } // This handler cannot handle 401 canHandleAuthentication() { return false; } handleAuthentication() { return __awaiter(this, void 0, void 0, function* () { throw new Error('not implemented'); }); } } exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; //# sourceMappingURL=auth.js.map /***/ }), /***/ 96255: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; /* eslint-disable @typescript-eslint/no-explicit-any */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = 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]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HttpClient = exports.HttpClientResponse = exports.HttpClientError = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0; exports.getProxyUrl = getProxyUrl; exports.isHttps = isHttps; const http = __importStar(__nccwpck_require__(13685)); const https = __importStar(__nccwpck_require__(95687)); const pm = __importStar(__nccwpck_require__(19835)); const tunnel = __importStar(__nccwpck_require__(74294)); const undici_1 = __nccwpck_require__(41773); var HttpCodes; (function (HttpCodes) { HttpCodes[HttpCodes["OK"] = 200] = "OK"; HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices"; HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently"; HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved"; HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther"; HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified"; HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy"; HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy"; HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect"; HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect"; HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest"; HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized"; HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired"; HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden"; HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound"; HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed"; HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable"; HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout"; HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict"; HttpCodes[HttpCodes["Gone"] = 410] = "Gone"; HttpCodes[HttpCodes["TooManyRequests"] = 429] = "TooManyRequests"; HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError"; HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented"; HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway"; HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable"; HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout"; })(HttpCodes || (exports.HttpCodes = HttpCodes = {})); var Headers; (function (Headers) { Headers["Accept"] = "accept"; Headers["ContentType"] = "content-type"; })(Headers || (exports.Headers = Headers = {})); var MediaTypes; (function (MediaTypes) { MediaTypes["ApplicationJson"] = "application/json"; })(MediaTypes || (exports.MediaTypes = MediaTypes = {})); /** * Returns the proxy URL, depending upon the supplied url and proxy environment variables. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ function getProxyUrl(serverUrl) { const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ''; } const HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect ]; const HttpResponseRetryCodes = [ HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout ]; const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD']; const ExponentialBackoffCeiling = 10; const ExponentialBackoffTimeSlice = 5; class HttpClientError extends Error { constructor(message, statusCode) { super(message); this.name = 'HttpClientError'; this.statusCode = statusCode; Object.setPrototypeOf(this, HttpClientError.prototype); } } exports.HttpClientError = HttpClientError; class HttpClientResponse { constructor(message) { this.message = message; } readBody() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on('data', (chunk) => { output = Buffer.concat([output, chunk]); }); this.message.on('end', () => { resolve(output.toString()); }); })); }); } readBodyBuffer() { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () { const chunks = []; this.message.on('data', (chunk) => { chunks.push(chunk); }); this.message.on('end', () => { resolve(Buffer.concat(chunks)); }); })); }); } } exports.HttpClientResponse = HttpClientResponse; function isHttps(requestUrl) { const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === 'https:'; } class HttpClient { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; this._allowRedirects = true; this._allowRedirectDowngrade = false; this._maxRedirects = 50; this._allowRetries = false; this._maxRetries = 1; this._keepAlive = false; this._disposed = false; this.userAgent = this._getUserAgentWithOrchestrationId(userAgent); this.handlers = handlers || []; this.requestOptions = requestOptions; if (requestOptions) { if (requestOptions.ignoreSslError != null) { this._ignoreSslError = requestOptions.ignoreSslError; } this._socketTimeout = requestOptions.socketTimeout; if (requestOptions.allowRedirects != null) { this._allowRedirects = requestOptions.allowRedirects; } if (requestOptions.allowRedirectDowngrade != null) { this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; } if (requestOptions.maxRedirects != null) { this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); } if (requestOptions.keepAlive != null) { this._keepAlive = requestOptions.keepAlive; } if (requestOptions.allowRetries != null) { this._allowRetries = requestOptions.allowRetries; } if (requestOptions.maxRetries != null) { this._maxRetries = requestOptions.maxRetries; } } } options(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('OPTIONS', requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('GET', requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('DELETE', requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('POST', requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('PATCH', requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('PUT', requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request('HEAD', requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { return __awaiter(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } /** * Gets a typed object from an endpoint * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl_1) { return __awaiter(this, arguments, void 0, function* (requestUrl, additionalHeaders = {}) { additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); const res = yield this.get(requestUrl, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } postJson(requestUrl_1, obj_1) { return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data = JSON.stringify(obj, null, 2); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.post(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } putJson(requestUrl_1, obj_1) { return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data = JSON.stringify(obj, null, 2); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.put(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } patchJson(requestUrl_1, obj_1) { return __awaiter(this, arguments, void 0, function* (requestUrl, obj, additionalHeaders = {}) { const data = JSON.stringify(obj, null, 2); additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); } /** * Makes a raw http request. * All other methods such as get, post, patch, and request ultimately call this. * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { return __awaiter(this, void 0, void 0, function* () { if (this._disposed) { throw new Error('Client has already been disposed.'); } const parsedUrl = new URL(requestUrl); let info = this._prepareRequest(verb, parsedUrl, headers); // Only perform retries on reads since writes may not be idempotent. const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1; let numTries = 0; let response; do { response = yield this.requestRaw(info, data); // Check if it's an authentication challenge if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { let authenticationHandler; for (const handler of this.handlers) { if (handler.canHandleAuthentication(response)) { authenticationHandler = handler; break; } } if (authenticationHandler) { return authenticationHandler.handleAuthentication(this, info, data); } else { // We have received an unauthorized response but have no handlers to handle it. // Let the response return to the caller. return response; } } let redirectsRemaining = this._maxRedirects; while (response.message.statusCode && HttpRedirectCodes.includes(response.message.statusCode) && this._allowRedirects && redirectsRemaining > 0) { const redirectUrl = response.message.headers['location']; if (!redirectUrl) { // if there's no location to redirect to, we won't break; } const parsedRedirectUrl = new URL(redirectUrl); if (parsedUrl.protocol === 'https:' && parsedUrl.protocol !== parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) { throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.'); } // we need to finish reading the response before reassigning response // which will leak the open socket. yield response.readBody(); // strip authorization header if redirected to a different hostname if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { for (const header in headers) { // header names are case insensitive if (header.toLowerCase() === 'authorization') { delete headers[header]; } } } // let's make the request with the new redirectUrl info = this._prepareRequest(verb, parsedRedirectUrl, headers); response = yield this.requestRaw(info, data); redirectsRemaining--; } if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { // If not a retry code, return immediately instead of retrying return response; } numTries += 1; if (numTries < maxTries) { yield response.readBody(); yield this._performExponentialBackoff(numTries); } } while (numTries < maxTries); return response; }); } /** * Needs to be called if keepAlive is set to true in request options. */ dispose() { if (this._agent) { this._agent.destroy(); } this._disposed = true; } /** * Raw request. * @param info * @param data */ requestRaw(info, data) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => { function callbackForResult(err, res) { if (err) { reject(err); } else if (!res) { // If `err` is not passed, then `res` must be passed. reject(new Error('Unknown error')); } else { resolve(res); } } this.requestRawWithCallback(info, data, callbackForResult); }); }); } /** * Raw request with callback. * @param info * @param data * @param onResult */ requestRawWithCallback(info, data, onResult) { if (typeof data === 'string') { if (!info.options.headers) { info.options.headers = {}; } info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); } let callbackCalled = false; function handleResult(err, res) { if (!callbackCalled) { callbackCalled = true; onResult(err, res); } } const req = info.httpModule.request(info.options, (msg) => { const res = new HttpClientResponse(msg); handleResult(undefined, res); }); let socket; req.on('socket', sock => { socket = sock; }); // If we ever get disconnected, we want the socket to timeout eventually req.setTimeout(this._socketTimeout || 3 * 60000, () => { if (socket) { socket.end(); } handleResult(new Error(`Request timeout: ${info.options.path}`)); }); req.on('error', function (err) { // err has statusCode property // res should have headers handleResult(err); }); if (data && typeof data === 'string') { req.write(data, 'utf8'); } if (data && typeof data !== 'string') { data.on('close', function () { req.end(); }); data.pipe(req); } else { req.end(); } } /** * Gets an http agent. This function is useful when you need an http agent that handles * routing through a proxy server - depending upon the url and proxy environment variables. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com */ getAgent(serverUrl) { const parsedUrl = new URL(serverUrl); return this._getAgent(parsedUrl); } getAgentDispatcher(serverUrl) { const parsedUrl = new URL(serverUrl); const proxyUrl = pm.getProxyUrl(parsedUrl); const useProxy = proxyUrl && proxyUrl.hostname; if (!useProxy) { return; } return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); } _prepareRequest(method, requestUrl, headers) { const info = {}; info.parsedUrl = requestUrl; const usingSsl = info.parsedUrl.protocol === 'https:'; info.httpModule = usingSsl ? https : http; const defaultPort = usingSsl ? 443 : 80; info.options = {}; info.options.host = info.parsedUrl.hostname; info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort; info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || ''); info.options.method = method; info.options.headers = this._mergeHeaders(headers); if (this.userAgent != null) { info.options.headers['user-agent'] = this.userAgent; } info.options.agent = this._getAgent(info.parsedUrl); // gives handlers an opportunity to participate if (this.handlers) { for (const handler of this.handlers) { handler.prepareRequest(info.options); } } return info; } _mergeHeaders(headers) { if (this.requestOptions && this.requestOptions.headers) { return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } return lowercaseKeys(headers || {}); } /** * Gets an existing header value or returns a default. * Handles converting number header values to strings since HTTP headers must be strings. * Note: This returns string | string[] since some headers can have multiple values. * For headers that must always be a single string (like Content-Type), use the * specialized _getExistingOrDefaultContentTypeHeader method instead. */ _getExistingOrDefaultHeader(additionalHeaders, header, _default) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; if (headerValue) { clientHeader = typeof headerValue === 'number' ? headerValue.toString() : headerValue; } } const additionalValue = additionalHeaders[header]; if (additionalValue !== undefined) { return typeof additionalValue === 'number' ? additionalValue.toString() : additionalValue; } if (clientHeader !== undefined) { return clientHeader; } return _default; } /** * Specialized version of _getExistingOrDefaultHeader for Content-Type header. * Always returns a single string (not an array) since Content-Type should be a single value. * Converts arrays to comma-separated strings and numbers to strings to ensure type safety. * This was split from _getExistingOrDefaultHeader to provide stricter typing for callers * that assign the result to places expecting a string (e.g., additionalHeaders[Headers.ContentType]). */ _getExistingOrDefaultContentTypeHeader(additionalHeaders, _default) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { const headerValue = lowercaseKeys(this.requestOptions.headers)[Headers.ContentType]; if (headerValue) { if (typeof headerValue === 'number') { clientHeader = String(headerValue); } else if (Array.isArray(headerValue)) { clientHeader = headerValue.join(', '); } else { clientHeader = headerValue; } } } const additionalValue = additionalHeaders[Headers.ContentType]; // Return the first non-undefined value, converting numbers or arrays to strings if necessary if (additionalValue !== undefined) { if (typeof additionalValue === 'number') { return String(additionalValue); } else if (Array.isArray(additionalValue)) { return additionalValue.join(', '); } else { return additionalValue; } } if (clientHeader !== undefined) { return clientHeader; } return _default; } _getAgent(parsedUrl) { let agent; const proxyUrl = pm.getProxyUrl(parsedUrl); const useProxy = proxyUrl && proxyUrl.hostname; if (this._keepAlive && useProxy) { agent = this._proxyAgent; } if (!useProxy) { agent = this._agent; } // if agent is already assigned use that agent. if (agent) { return agent; } const usingSsl = parsedUrl.protocol === 'https:'; let maxSockets = 100; if (this.requestOptions) { maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis. if (proxyUrl && proxyUrl.hostname) { const agentOptions = { maxSockets, keepAlive: this._keepAlive, proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && { proxyAuth: `${proxyUrl.username}:${proxyUrl.password}` })), { host: proxyUrl.hostname, port: proxyUrl.port }) }; let tunnelAgent; const overHttps = proxyUrl.protocol === 'https:'; if (usingSsl) { tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp; } else { tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } agent = tunnelAgent(agentOptions); this._proxyAgent = agent; } // if tunneling agent isn't assigned create a new agent if (!agent) { const options = { keepAlive: this._keepAlive, maxSockets }; agent = usingSsl ? new https.Agent(options) : new http.Agent(options); this._agent = agent; } if (usingSsl && this._ignoreSslError) { // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options // we have to cast it to any and change it directly agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false }); } return agent; } _getProxyAgentDispatcher(parsedUrl, proxyUrl) { let proxyAgent; if (this._keepAlive) { proxyAgent = this._proxyAgentDispatcher; } // if agent is already assigned use that agent. if (proxyAgent) { return proxyAgent; } const usingSsl = parsedUrl.protocol === 'https:'; proxyAgent = new undici_1.ProxyAgent(Object.assign({ uri: proxyUrl.href, pipelining: !this._keepAlive ? 0 : 1 }, ((proxyUrl.username || proxyUrl.password) && { token: `Basic ${Buffer.from(`${proxyUrl.username}:${proxyUrl.password}`).toString('base64')}` }))); this._proxyAgentDispatcher = proxyAgent; if (usingSsl && this._ignoreSslError) { // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options // we have to cast it to any and change it directly proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { rejectUnauthorized: false }); } return proxyAgent; } _getUserAgentWithOrchestrationId(userAgent) { const baseUserAgent = userAgent || 'actions/http-client'; const orchId = process.env['ACTIONS_ORCHESTRATION_ID']; if (orchId) { // Sanitize the orchestration ID to ensure it contains only valid characters // Valid characters: 0-9, a-z, _, -, . const sanitizedId = orchId.replace(/[^a-z0-9_.-]/gi, '_'); return `${baseUserAgent} actions_orchestration_id/${sanitizedId}`; } return baseUserAgent; } _performExponentialBackoff(retryNumber) { return __awaiter(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise(resolve => setTimeout(() => resolve(), ms)); }); } _processResponse(res, options) { return __awaiter(this, void 0, void 0, function* () { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, result: null, headers: {} }; // not found leads to null obj returned if (statusCode === HttpCodes.NotFound) { resolve(response); } // get the result from the body function dateTimeDeserializer(key, value) { if (typeof value === 'string') { const a = new Date(value); if (!isNaN(a.valueOf())) { return a; } } return value; } let obj; let contents; try { contents = yield res.readBody(); if (contents && contents.length > 0) { if (options && options.deserializeDates) { obj = JSON.parse(contents, dateTimeDeserializer); } else { obj = JSON.parse(contents); } response.result = obj; } response.headers = res.message.headers; } catch (err) { // Invalid resource (contents not json); leaving result obj null } // note that 3xx redirects are handled by the http layer. if (statusCode > 299) { let msg; // if exception/error in body, attempt to get better error if (obj && obj.message) { msg = obj.message; } else if (contents && contents.length > 0) { // it may be the case that the exception is in the body message as string msg = contents; } else { msg = `Failed request: (${statusCode})`; } const err = new HttpClientError(msg, statusCode); err.result = response.result; reject(err); } else { resolve(response); } })); }); } } exports.HttpClient = HttpClient; const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {}); //# sourceMappingURL=index.js.map /***/ }), /***/ 19835: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getProxyUrl = getProxyUrl; exports.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === 'https:'; if (checkBypass(reqUrl)) { return undefined; } const proxyVar = (() => { if (usingSsl) { return process.env['https_proxy'] || process.env['HTTPS_PROXY']; } else { return process.env['http_proxy'] || process.env['HTTP_PROXY']; } })(); if (proxyVar) { try { return new DecodedURL(proxyVar); } catch (_a) { if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://')) return new DecodedURL(`http://${proxyVar}`); } } else { return undefined; } } function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; } const reqHost = reqUrl.hostname; if (isLoopbackAddress(reqHost)) { return true; } const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || ''; if (!noProxy) { return false; } // Determine the request port let reqPort; if (reqUrl.port) { reqPort = Number(reqUrl.port); } else if (reqUrl.protocol === 'http:') { reqPort = 80; } else if (reqUrl.protocol === 'https:') { reqPort = 443; } // Format the request hostname and hostname with port const upperReqHosts = [reqUrl.hostname.toUpperCase()]; if (typeof reqPort === 'number') { upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } // Compare request host against noproxy for (const upperNoProxyItem of noProxy .split(',') .map(x => x.trim().toUpperCase()) .filter(x => x)) { if (upperNoProxyItem === '*' || upperReqHosts.some(x => x === upperNoProxyItem || x.endsWith(`.${upperNoProxyItem}`) || (upperNoProxyItem.startsWith('.') && x.endsWith(`${upperNoProxyItem}`)))) { return true; } } return false; } function isLoopbackAddress(host) { const hostLower = host.toLowerCase(); return (hostLower === 'localhost' || hostLower.startsWith('127.') || hostLower.startsWith('[::1]') || hostLower.startsWith('[0:0:0:0:0:0:0:1]')); } class DecodedURL extends URL { constructor(url, base) { super(url, base); this._decodedUsername = decodeURIComponent(super.username); this._decodedPassword = decodeURIComponent(super.password); } get username() { return this._decodedUsername; } get password() { return this._decodedPassword; } } //# sourceMappingURL=proxy.js.map /***/ }), /***/ 81962: /***/ (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; 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]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.READONLY = exports.UV_FS_O_EXLOCK = exports.IS_WINDOWS = exports.unlink = exports.symlink = exports.stat = exports.rmdir = exports.rm = exports.rename = exports.readdir = exports.open = exports.mkdir = exports.lstat = exports.copyFile = exports.chmod = void 0; exports.readlink = readlink; exports.exists = exists; exports.isDirectory = isDirectory; exports.isRooted = isRooted; exports.tryGetExecutablePath = tryGetExecutablePath; exports.getCmdPath = getCmdPath; const fs = __importStar(__nccwpck_require__(57147)); const path = __importStar(__nccwpck_require__(71017)); _a = fs.promises // export const {open} = 'fs' , exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.open = _a.open, exports.readdir = _a.readdir, exports.rename = _a.rename, exports.rm = _a.rm, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink; // export const {open} = 'fs' exports.IS_WINDOWS = process.platform === 'win32'; /** * Custom implementation of readlink to ensure Windows junctions * maintain trailing backslash for backward compatibility with Node.js < 24 * * In Node.js 20, Windows junctions (directory symlinks) always returned paths * with trailing backslashes. Node.js 24 removed this behavior, which breaks * code that relied on this format for path operations. * * This implementation restores the Node 20 behavior by adding a trailing * backslash to all junction results on Windows. */ function readlink(fsPath) { return __awaiter(this, void 0, void 0, function* () { const result = yield fs.promises.readlink(fsPath); // On Windows, restore Node 20 behavior: add trailing backslash to all results // since junctions on Windows are always directory links if (exports.IS_WINDOWS && !result.endsWith('\\')) { return `${result}\\`; } return result; }); } // See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691 exports.UV_FS_O_EXLOCK = 0x10000000; exports.READONLY = fs.constants.O_RDONLY; function exists(fsPath) { return __awaiter(this, void 0, void 0, function* () { try { yield (0, exports.stat)(fsPath); } catch (err) { if (err.code === 'ENOENT') { return false; } throw err; } return true; }); } function isDirectory(fsPath_1) { return __awaiter(this, arguments, void 0, function* (fsPath, useStat = false) { const stats = useStat ? yield (0, exports.stat)(fsPath) : yield (0, exports.lstat)(fsPath); return stats.isDirectory(); }); } /** * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like: * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases). */ function isRooted(p) { p = normalizeSeparators(p); if (!p) { throw new Error('isRooted() parameter "p" cannot be empty'); } if (exports.IS_WINDOWS) { return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello ); // e.g. C: or C:\hello } return p.startsWith('/'); } /** * Best effort attempt to determine whether a file exists and is executable. * @param filePath file path to check * @param extensions additional file extensions to try * @return if file exists and is executable, returns the file path. otherwise empty string. */ function tryGetExecutablePath(filePath, extensions) { return __awaiter(this, void 0, void 0, function* () { let stats = undefined; try { // test file exists stats = yield (0, exports.stat)(filePath); } catch (err) { if (err.code !== 'ENOENT') { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { // on Windows, test for valid extension const upperExt = path.extname(filePath).toUpperCase(); if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) { return filePath; } } else { if (isUnixExecutable(stats)) { return filePath; } } } // try each extension const originalFilePath = filePath; for (const extension of extensions) { filePath = originalFilePath + extension; stats = undefined; try { stats = yield (0, exports.stat)(filePath); } catch (err) { if (err.code !== 'ENOENT') { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); } } if (stats && stats.isFile()) { if (exports.IS_WINDOWS) { // preserve the case of the actual file (since an extension was appended) try { const directory = path.dirname(filePath); const upperName = path.basename(filePath).toUpperCase(); for (const actualName of yield (0, exports.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path.join(directory, actualName); break; } } } catch (err) { // eslint-disable-next-line no-console console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); } return filePath; } else { if (isUnixExecutable(stats)) { return filePath; } } } } return ''; }); } function normalizeSeparators(p) { p = p || ''; if (exports.IS_WINDOWS) { // convert slashes on Windows p = p.replace(/\//g, '\\'); // remove redundant slashes return p.replace(/\\\\+/g, '\\'); } // remove redundant slashes return p.replace(/\/\/+/g, '/'); } // on Mac/Linux, test the execute bit // R W X R W X R W X // 256 128 64 32 16 8 4 2 1 function isUnixExecutable(stats) { return ((stats.mode & 1) > 0 || ((stats.mode & 8) > 0 && process.getgid !== undefined && stats.gid === process.getgid()) || ((stats.mode & 64) > 0 && process.getuid !== undefined && stats.uid === process.getuid())); } // Get the path of cmd.exe in windows function getCmdPath() { var _a; return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`; } //# sourceMappingURL=io-util.js.map /***/ }), /***/ 47351: /***/ (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; 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]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.cp = cp; exports.mv = mv; exports.rmRF = rmRF; exports.mkdirP = mkdirP; exports.which = which; exports.findInPath = findInPath; const assert_1 = __nccwpck_require__(39491); const path = __importStar(__nccwpck_require__(71017)); const ioUtil = __importStar(__nccwpck_require__(81962)); /** * Copies a file or folder. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js * * @param source source path * @param dest destination path * @param options optional. See CopyOptions. */ function cp(source_1, dest_1) { return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) { const { force, recursive, copySourceDirectory } = readCopyOptions(options); const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null; // Dest is an existing file, but not forcing if (destStat && destStat.isFile() && !force) { return; } // If dest is an existing directory, should copy inside. const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path.join(dest, path.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } const sourceStat = yield ioUtil.stat(source); if (sourceStat.isDirectory()) { if (!recursive) { throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`); } else { yield cpDirRecursive(source, newDest, 0, force); } } else { if (path.relative(source, newDest) === '') { // a file cannot be copied to itself throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); } }); } /** * Moves a path. * * @param source source path * @param dest destination path * @param options optional. See MoveOptions. */ function mv(source_1, dest_1) { return __awaiter(this, arguments, void 0, function* (source, dest, options = {}) { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { // If dest is directory copy src into dest dest = path.join(dest, path.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { if (options.force == null || options.force) { yield rmRF(dest); } else { throw new Error('Destination already exists'); } } } yield mkdirP(path.dirname(dest)); yield ioUtil.rename(source, dest); }); } /** * Remove a path recursively with force * * @param inputPath path to remove */ function rmRF(inputPath) { return __awaiter(this, void 0, void 0, function* () { if (ioUtil.IS_WINDOWS) { // Check for invalid characters // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file if (/[*"<>|]/.test(inputPath)) { throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); } } try { // note if path does not exist, error is silent yield ioUtil.rm(inputPath, { force: true, maxRetries: 3, recursive: true, retryDelay: 300 }); } catch (err) { throw new Error(`File was unable to be removed ${err}`); } }); } /** * Make a directory. Creates the full path with folders in between * Will throw if it fails * * @param fsPath path to create * @returns Promise */ function mkdirP(fsPath) { return __awaiter(this, void 0, void 0, function* () { (0, assert_1.ok)(fsPath, 'a path argument must be provided'); yield ioUtil.mkdir(fsPath, { recursive: true }); }); } /** * Returns path of a tool had the tool actually been invoked. Resolves via paths. * If you check and the tool does not exist, it will throw. * * @param tool name of the tool * @param check whether to check if tool exists * @returns Promise path to tool */ function which(tool, check) { return __awaiter(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } // recursive when check=true if (check) { const result = yield which(tool, false); if (!result) { if (ioUtil.IS_WINDOWS) { throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`); } else { throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`); } } return result; } const matches = yield findInPath(tool); if (matches && matches.length > 0) { return matches[0]; } return ''; }); } /** * Returns a list of all occurrences of the given tool on the system path. * * @returns Promise the paths of the tool */ function findInPath(tool) { return __awaiter(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } // build the list of extensions to try const extensions = []; if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) { for (const extension of process.env['PATHEXT'].split(path.delimiter)) { if (extension) { extensions.push(extension); } } } // if it's rooted, return it if exists. otherwise return empty. if (ioUtil.isRooted(tool)) { const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); if (filePath) { return [filePath]; } return []; } // if any path separators, return empty if (tool.includes(path.sep)) { return []; } // build the list of directories // // Note, technically "where" checks the current directory on Windows. From a toolkit perspective, // it feels like we should not do this. Checking the current directory seems like more of a use // case of a shell, and the which() function exposed by the toolkit should strive for consistency // across platforms. const directories = []; if (process.env.PATH) { for (const p of process.env.PATH.split(path.delimiter)) { if (p) { directories.push(p); } } } // find all matches const matches = []; for (const directory of directories) { const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } } return matches; }); } function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); const copySourceDirectory = options.copySourceDirectory == null ? true : Boolean(options.copySourceDirectory); return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { return __awaiter(this, void 0, void 0, function* () { // Ensure there is not a run away recursive copy if (currentDepth >= 255) return; currentDepth++; yield mkdirP(destDir); const files = yield ioUtil.readdir(sourceDir); for (const fileName of files) { const srcFile = `${sourceDir}/${fileName}`; const destFile = `${destDir}/${fileName}`; const srcFileStat = yield ioUtil.lstat(srcFile); if (srcFileStat.isDirectory()) { // Recurse yield cpDirRecursive(srcFile, destFile, currentDepth, force); } else { yield copyFile(srcFile, destFile, force); } } // Change the mode for the newly created directory yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); }); } // Buffered file copy function copyFile(srcFile, destFile, force) { return __awaiter(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { // unlink/re-link it try { yield ioUtil.lstat(destFile); yield ioUtil.unlink(destFile); } catch (e) { // Try to override file permission if (e.code === 'EPERM') { yield ioUtil.chmod(destFile, '0666'); yield ioUtil.unlink(destFile); } // other errors = it doesn't exist, no work to do } // Copy over symlink const symlinkFull = yield ioUtil.readlink(srcFile); yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null); } else if (!(yield ioUtil.exists(destFile)) || force) { yield ioUtil.copyFile(srcFile, destFile); } }); } //# sourceMappingURL=io.js.map /***/ }), /***/ 81771: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); 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 /***/ }), /***/ 13070: /***/ ((__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.NOOP_LOGGER_PROVIDER = exports.NoopLoggerProvider = void 0; const NoopLogger_1 = __nccwpck_require__(81771); class NoopLoggerProvider { getLogger(_name, _version, _options) { return new NoopLogger_1.NoopLogger(); } } exports.NoopLoggerProvider = NoopLoggerProvider; exports.NOOP_LOGGER_PROVIDER = new NoopLoggerProvider(); //# sourceMappingURL=NoopLoggerProvider.js.map /***/ }), /***/ 59538: /***/ ((__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.ProxyLogger = void 0; const NoopLogger_1 = __nccwpck_require__(81771); class ProxyLogger { constructor(provider, name, version, options) { this._provider = provider; this.name = name; this.version = version; this.options = options; } /** * Emit a log record. This method should only be used by log appenders. * * @param logRecord */ emit(logRecord) { this._getLogger().emit(logRecord); } enabled(options) { return this._getLogger().enabled(options); } /** * Try to get a logger from the proxy logger provider. * If the proxy logger provider has no delegate, return a noop logger. */ _getLogger() { if (this._delegate) { return this._delegate; } const logger = this._provider._getDelegateLogger(this.name, this.version, this.options); if (!logger) { return NoopLogger_1.NOOP_LOGGER; } this._delegate = logger; return this._delegate; } } exports.ProxyLogger = ProxyLogger; //# sourceMappingURL=ProxyLogger.js.map /***/ }), /***/ 66927: /***/ ((__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.ProxyLoggerProvider = void 0; const NoopLoggerProvider_1 = __nccwpck_require__(13070); 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)); } /** * Get the delegate logger provider. * Used by tests only. * @internal */ _getDelegate() { var _a; return (_a = this._delegate) !== null && _a !== void 0 ? _a : NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER; } /** * Set the delegate logger provider * @internal */ _setDelegate(delegate) { this._delegate = delegate; } /** * @internal */ _getDelegateLogger(name, version, options) { var _a; return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getLogger(name, version, options); } } exports.ProxyLoggerProvider = ProxyLoggerProvider; //# sourceMappingURL=ProxyLoggerProvider.js.map /***/ }), /***/ 93091: /***/ ((__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.LogsAPI = void 0; const global_utils_1 = __nccwpck_require__(39295); const NoopLoggerProvider_1 = __nccwpck_require__(13070); const ProxyLoggerProvider_1 = __nccwpck_require__(66927); class LogsAPI { constructor() { this._proxyLoggerProvider = new ProxyLoggerProvider_1.ProxyLoggerProvider(); } static getInstance() { if (!this._instance) { this._instance = new LogsAPI(); } return this._instance; } setGlobalLoggerProvider(provider) { if (global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) { return this.getLoggerProvider(); } global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY] = (0, global_utils_1.makeGetter)(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER); this._proxyLoggerProvider._setDelegate(provider); return provider; } /** * Returns the global logger provider. * * @returns LoggerProvider */ getLoggerProvider() { var _a, _b; return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : this._proxyLoggerProvider); } /** * Returns a Logger, creating one if one with the given name, version, * schemaUrl, and attributes is not already created. * * Getting a Logger may be expensive, especially when `attributes` are * provided. Reuse Logger instances where possible instead of calling * `getLogger()` on hot paths. * * @param name The name of the logger or instrumentation library. * @param version The version of the logger or instrumentation library. * @param options The options of the logger or instrumentation library. * @returns {@link Logger} */ getLogger(name, version, options) { return this.getLoggerProvider().getLogger(name, version, options); } /** Remove the global logger provider */ disable() { delete global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]; this._proxyLoggerProvider = new ProxyLoggerProvider_1.ProxyLoggerProvider(); } } exports.LogsAPI = LogsAPI; //# sourceMappingURL=logs.js.map /***/ }), /***/ 32832: /***/ ((__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.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, "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 /***/ }), /***/ 39295: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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; exports.GLOBAL_LOGS_API_KEY = Symbol.for('io.opentelemetry.js.api.logs'); exports._global = globalThis; /** * Make a function which accepts a version integer and returns the instance of an API if the version * is compatible, or a fallback version (usually NOOP) if it is not. * * @param requiredVersion Backwards compatibility version which is required to return the instance * @param instance Instance which should be returned if the required version is compatible * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible */ function makeGetter(requiredVersion, instance, fallback) { return (version) => version === requiredVersion ? instance : fallback; } exports.makeGetter = makeGetter; /** * A number which should be incremented each time a backwards incompatible * change is made to the API. This number is used when an API package * attempts to access the global API to ensure it is getting a compatible * version. If the global API is not compatible with the API package * attempting to get it, a NOOP API implementation will be returned. */ exports.API_BACKWARDS_COMPATIBILITY_VERSION = 1; //# sourceMappingURL=global-utils.js.map /***/ }), /***/ 57440: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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 /***/ }), /***/ 57171: /***/ ((__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.ContextAPI = void 0; const NoopContextManager_1 = __nccwpck_require__(54118); const global_utils_1 = __nccwpck_require__(85135); const diag_1 = __nccwpck_require__(11877); 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 */ constructor() { } /** Get the singleton instance of the Context API */ static getInstance() { if (!this._instance) { this._instance = new ContextAPI(); } return this._instance; } /** * Set the current context manager. * * @returns true if the context manager was successfully registered, else false */ setGlobalContextManager(contextManager) { return (0, global_utils_1.registerGlobal)(API_NAME, contextManager, diag_1.DiagAPI.instance()); } /** * Get the currently active context */ active() { return this._getContextManager().active(); } /** * Execute a function with an active context * * @param context context to be active during function execution * @param fn function to execute in a context * @param thisArg optional receiver to be used for calling fn * @param args optional arguments forwarded to fn */ with(context, fn, thisArg, ...args) { return this._getContextManager().with(context, fn, thisArg, ...args); } /** * Bind a context to a target function or event emitter * * @param context context to bind to the event emitter or function. Defaults to the currently active context * @param target function or event emitter to bind */ bind(context, target) { return this._getContextManager().bind(context, target); } _getContextManager() { return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_CONTEXT_MANAGER; } /** Disable and remove the global context manager */ disable() { this._getContextManager().disable(); (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); } } exports.ContextAPI = ContextAPI; //# sourceMappingURL=context.js.map /***/ }), /***/ 11877: /***/ ((__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.DiagAPI = void 0; const ComponentLogger_1 = __nccwpck_require__(17978); const logLevelLogger_1 = __nccwpck_require__(99639); const types_1 = __nccwpck_require__(78077); const global_utils_1 = __nccwpck_require__(85135); 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 */ constructor() { function _logProxy(funcName) { return function (...args) { const logger = (0, global_utils_1.getGlobal)('diag'); // shortcut if logger not set if (!logger) return; return logger[funcName](...args); }; } // Using self local variable for minification purposes as 'this' cannot be minified const self = this; // DiagAPI specific functions const setLogger = (logger, optionsOrLogLevel = { logLevel: types_1.DiagLogLevel.INFO }) => { var _a, _b, _c; if (logger === self) { // There isn't much we can do here. // Logging to the console might break the user application. // Try to log to self. If a logger was previously registered it will receive the log. const err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'); self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message); return false; } if (typeof optionsOrLogLevel === 'number') { optionsOrLogLevel = { logLevel: optionsOrLogLevel, }; } const oldLogger = (0, global_utils_1.getGlobal)('diag'); const newLogger = (0, logLevelLogger_1.createLogLevelDiagLogger)((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : types_1.DiagLogLevel.INFO, logger); // There already is an logger registered. We'll let it know before overwriting it. if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) { const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : ''; oldLogger.warn(`Current logger will be overwritten from ${stack}`); newLogger.warn(`Current logger will overwrite one already registered from ${stack}`); } return (0, global_utils_1.registerGlobal)('diag', newLogger, self, true); }; self.setLogger = setLogger; self.disable = () => { (0, global_utils_1.unregisterGlobal)(API_NAME, self); }; self.createComponentLogger = (options) => { return new ComponentLogger_1.DiagComponentLogger(options); }; self.verbose = _logProxy('verbose'); self.debug = _logProxy('debug'); self.info = _logProxy('info'); self.warn = _logProxy('warn'); self.error = _logProxy('error'); } } exports.DiagAPI = DiagAPI; //# sourceMappingURL=diag.js.map /***/ }), /***/ 17696: /***/ ((__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.MetricsAPI = void 0; const NoopMeterProvider_1 = __nccwpck_require__(72647); const global_utils_1 = __nccwpck_require__(85135); const diag_1 = __nccwpck_require__(11877); const API_NAME = 'metrics'; /** * Singleton object which represents the entry point to the OpenTelemetry Metrics API */ class MetricsAPI { /** Empty private constructor prevents end users from constructing a new instance of the API */ constructor() { } /** Get the singleton instance of the Metrics API */ static getInstance() { if (!this._instance) { this._instance = new MetricsAPI(); } return this._instance; } /** * Set the current global meter provider. * Returns true if the meter provider was successfully registered, else false. */ setGlobalMeterProvider(provider) { return (0, global_utils_1.registerGlobal)(API_NAME, provider, diag_1.DiagAPI.instance()); } /** * Returns the global meter provider. */ getMeterProvider() { return (0, global_utils_1.getGlobal)(API_NAME) || NoopMeterProvider_1.NOOP_METER_PROVIDER; } /** * Returns a meter from the global meter provider. */ getMeter(name, version, options) { return this.getMeterProvider().getMeter(name, version, options); } /** Remove the global meter provider */ disable() { (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); } } exports.MetricsAPI = MetricsAPI; //# sourceMappingURL=metrics.js.map /***/ }), /***/ 89909: /***/ ((__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.PropagationAPI = void 0; const global_utils_1 = __nccwpck_require__(85135); const NoopTextMapPropagator_1 = __nccwpck_require__(72368); const TextMapPropagator_1 = __nccwpck_require__(80865); const context_helpers_1 = __nccwpck_require__(37682); const utils_1 = __nccwpck_require__(28136); const diag_1 = __nccwpck_require__(11877); 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 */ constructor() { this.createBaggage = utils_1.createBaggage; this.getBaggage = context_helpers_1.getBaggage; this.getActiveBaggage = context_helpers_1.getActiveBaggage; this.setBaggage = context_helpers_1.setBaggage; this.deleteBaggage = context_helpers_1.deleteBaggage; } /** Get the singleton instance of the Propagator API */ static getInstance() { if (!this._instance) { this._instance = new PropagationAPI(); } return this._instance; } /** * Set the current propagator. * * @returns true if the propagator was successfully registered, else false */ setGlobalPropagator(propagator) { return (0, global_utils_1.registerGlobal)(API_NAME, propagator, diag_1.DiagAPI.instance()); } /** * Inject context into a carrier to be propagated inter-process * * @param context Context carrying tracing data to inject * @param carrier carrier to inject context into * @param setter Function used to set values on the carrier */ inject(context, carrier, setter = TextMapPropagator_1.defaultTextMapSetter) { return this._getGlobalPropagator().inject(context, carrier, setter); } /** * Extract context from a carrier * * @param context Context which the newly created context will inherit from * @param carrier Carrier to extract context from * @param getter Function used to extract keys from a carrier */ extract(context, carrier, getter = TextMapPropagator_1.defaultTextMapGetter) { return this._getGlobalPropagator().extract(context, carrier, getter); } /** * Return a list of all fields which may be used by the propagator. */ fields() { return this._getGlobalPropagator().fields(); } /** Remove the global propagator */ disable() { (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); } _getGlobalPropagator() { return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR; } } exports.PropagationAPI = PropagationAPI; //# sourceMappingURL=propagation.js.map /***/ }), /***/ 81539: /***/ ((__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.TraceAPI = void 0; const global_utils_1 = __nccwpck_require__(85135); const ProxyTracerProvider_1 = __nccwpck_require__(2285); const spancontext_utils_1 = __nccwpck_require__(49745); const context_utils_1 = __nccwpck_require__(23326); 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 */ constructor() { this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); this.wrapSpanContext = spancontext_utils_1.wrapSpanContext; this.isSpanContextValid = spancontext_utils_1.isSpanContextValid; this.deleteSpan = context_utils_1.deleteSpan; this.getSpan = context_utils_1.getSpan; this.getActiveSpan = context_utils_1.getActiveSpan; this.getSpanContext = context_utils_1.getSpanContext; this.setSpan = context_utils_1.setSpan; this.setSpanContext = context_utils_1.setSpanContext; } /** Get the singleton instance of the Trace API */ static getInstance() { if (!this._instance) { this._instance = new TraceAPI(); } return this._instance; } /** * Set the current global tracer. * * @returns true if the tracer provider was successfully registered, else false */ setGlobalTracerProvider(provider) { const success = (0, global_utils_1.registerGlobal)(API_NAME, this._proxyTracerProvider, diag_1.DiagAPI.instance()); if (success) { this._proxyTracerProvider.setDelegate(provider); } return success; } /** * Returns the global tracer provider. */ getTracerProvider() { return (0, global_utils_1.getGlobal)(API_NAME) || this._proxyTracerProvider; } /** * Returns a tracer from the global tracer provider. */ getTracer(name, version) { return this.getTracerProvider().getTracer(name, version); } /** Remove the global tracer provider */ disable() { (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance()); this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider(); } } exports.TraceAPI = TraceAPI; //# sourceMappingURL=trace.js.map /***/ }), /***/ 37682: /***/ ((__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.deleteBaggage = exports.setBaggage = exports.getActiveBaggage = exports.getBaggage = void 0; const context_1 = __nccwpck_require__(57171); const context_2 = __nccwpck_require__(78242); /** * Baggage key */ const BAGGAGE_KEY = (0, context_2.createContextKey)('OpenTelemetry Baggage Key'); /** * Retrieve the current baggage from the given context * * @param {Context} Context that manage all context values * @returns {Baggage} Extracted baggage from the context */ function getBaggage(context) { return context.getValue(BAGGAGE_KEY) || undefined; } exports.getBaggage = getBaggage; /** * Retrieve the current baggage from the active/current context * * @returns {Baggage} Extracted baggage from the context */ function getActiveBaggage() { return getBaggage(context_1.ContextAPI.getInstance().active()); } exports.getActiveBaggage = getActiveBaggage; /** * Store a baggage in the given context * * @param {Context} Context that manage all context values * @param {Baggage} baggage that will be set in the actual context */ function setBaggage(context, baggage) { return context.setValue(BAGGAGE_KEY, baggage); } exports.setBaggage = setBaggage; /** * Delete the baggage stored in the given context * * @param {Context} Context that manage all context values */ function deleteBaggage(context) { return context.deleteValue(BAGGAGE_KEY); } exports.deleteBaggage = deleteBaggage; //# sourceMappingURL=context-helpers.js.map /***/ }), /***/ 84811: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.BaggageImpl = void 0; class BaggageImpl { constructor(entries) { this._entries = entries ? new Map(entries) : new Map(); } getEntry(key) { const entry = this._entries.get(key); if (!entry) { return undefined; } return Object.assign({}, entry); } getAllEntries() { return Array.from(this._entries.entries()); } setEntry(key, entry) { const newBaggage = new BaggageImpl(this._entries); newBaggage._entries.set(key, entry); return newBaggage; } removeEntry(key) { const newBaggage = new BaggageImpl(this._entries); newBaggage._entries.delete(key); return newBaggage; } removeEntries(...keys) { const newBaggage = new BaggageImpl(this._entries); for (const key of keys) { newBaggage._entries.delete(key); } return newBaggage; } clear() { return new BaggageImpl(); } } exports.BaggageImpl = BaggageImpl; //# sourceMappingURL=baggage-impl.js.map /***/ }), /***/ 23542: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.baggageEntryMetadataSymbol = void 0; /** * Symbol used to make BaggageEntryMetadata an opaque type */ exports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata'); //# sourceMappingURL=symbol.js.map /***/ }), /***/ 28136: /***/ ((__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.baggageEntryMetadataFromString = exports.createBaggage = void 0; const diag_1 = __nccwpck_require__(11877); const baggage_impl_1 = __nccwpck_require__(84811); const symbol_1 = __nccwpck_require__(23542); const diag = diag_1.DiagAPI.instance(); /** * Create a new Baggage with optional entries * * @param entries An array of baggage entries the new baggage should contain */ function createBaggage(entries = {}) { return new baggage_impl_1.BaggageImpl(new Map(Object.entries(entries))); } exports.createBaggage = createBaggage; /** * Create a serializable BaggageEntryMetadata object from a string. * * @param str string metadata. Format is currently not defined by the spec and has no special meaning. * * @since 1.0.0 */ function baggageEntryMetadataFromString(str) { if (typeof str !== 'string') { diag.error(`Cannot create baggage metadata from unknown type: ${typeof str}`); str = ''; } return { __TYPE__: symbol_1.baggageEntryMetadataSymbol, toString() { return str; }, }; } exports.baggageEntryMetadataFromString = baggageEntryMetadataFromString; //# sourceMappingURL=utils.js.map /***/ }), /***/ 7393: /***/ ((__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.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 * @since 1.0.0 */ exports.context = context_1.ContextAPI.getInstance(); //# sourceMappingURL=context-api.js.map /***/ }), /***/ 54118: /***/ ((__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.NoopContextManager = void 0; const context_1 = __nccwpck_require__(78242); class NoopContextManager { active() { return context_1.ROOT_CONTEXT; } with(_context, fn, thisArg, ...args) { return fn.call(thisArg, ...args); } bind(_context, target) { return target; } enable() { return this; } disable() { return this; } } exports.NoopContextManager = NoopContextManager; //# sourceMappingURL=NoopContextManager.js.map /***/ }), /***/ 78242: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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 * * @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 // system, this creates problems where multiple versions of some package // could hold different keys for the same property. // // Therefore, we use Symbol.for which returns the same key for the same input. return Symbol.for(description); } exports.createContextKey = createContextKey; class BaseContext { /** * Construct a new context which inherits values from an optional parent context. * * @param parentContext a context from which to inherit values */ constructor(parentContext) { // for minification const self = this; self._currentContext = parentContext ? new Map(parentContext) : new Map(); self.getValue = (key) => self._currentContext.get(key); self.setValue = (key, value) => { const context = new BaseContext(self._currentContext); context._currentContext.set(key, value); return context; }; self.deleteValue = (key) => { const context = new BaseContext(self._currentContext); context._currentContext.delete(key); return 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 /***/ }), /***/ 39721: /***/ ((__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.diag = void 0; // Split module-level variable definition into separate files to allow // tree-shaking on each api instance. const diag_1 = __nccwpck_require__(11877); /** * Entrypoint for Diag API. * 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 /***/ }), /***/ 17978: /***/ ((__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.DiagComponentLogger = void 0; const global_utils_1 = __nccwpck_require__(85135); /** * Component Logger which is meant to be used as part of any component which * will add automatically additional namespace in front of the log message. * It will then forward all message to global diag logger * @example * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' }); * cLogger.debug('test'); * // @opentelemetry/instrumentation-http test */ class DiagComponentLogger { constructor(props) { this._namespace = props.namespace || 'DiagComponentLogger'; } debug(...args) { return logProxy('debug', this._namespace, args); } error(...args) { return logProxy('error', this._namespace, args); } info(...args) { return logProxy('info', this._namespace, args); } warn(...args) { return logProxy('warn', this._namespace, args); } verbose(...args) { return logProxy('verbose', this._namespace, args); } } exports.DiagComponentLogger = DiagComponentLogger; function logProxy(funcName, namespace, args) { const logger = (0, global_utils_1.getGlobal)('diag'); // shortcut if logger not set if (!logger) { return; } return logger[funcName](namespace, ...args); } //# sourceMappingURL=ComponentLogger.js.map /***/ }), /***/ 3041: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DiagConsoleLogger = exports._originalConsoleMethods = void 0; const consoleMap = [ { n: 'error', c: 'error' }, { n: 'warn', c: 'warn' }, { n: 'info', c: 'info' }, { 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) { // 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 theFunc = console[funcName]; if (typeof theFunc !== 'function') { // eslint-disable-next-line no-console theFunc = console.log; } } if (typeof theFunc === 'function') { return theFunc.apply(console, args); } }; } for (let i = 0; i < consoleMap.length; i++) { this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c); } } } exports.DiagConsoleLogger = DiagConsoleLogger; //# sourceMappingURL=consoleLogger.js.map /***/ }), /***/ 99639: /***/ ((__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.createLogLevelDiagLogger = void 0; const types_1 = __nccwpck_require__(78077); function createLogLevelDiagLogger(maxLevel, logger) { if (maxLevel < types_1.DiagLogLevel.NONE) { maxLevel = types_1.DiagLogLevel.NONE; } else if (maxLevel > types_1.DiagLogLevel.ALL) { maxLevel = types_1.DiagLogLevel.ALL; } // In case the logger is null or undefined logger = logger || {}; function _filterFunc(funcName, theLevel) { const theFunc = logger[funcName]; if (typeof theFunc === 'function' && maxLevel >= theLevel) { return theFunc.bind(logger); } return function () { }; } return { error: _filterFunc('error', types_1.DiagLogLevel.ERROR), warn: _filterFunc('warn', types_1.DiagLogLevel.WARN), info: _filterFunc('info', types_1.DiagLogLevel.INFO), debug: _filterFunc('debug', types_1.DiagLogLevel.DEBUG), verbose: _filterFunc('verbose', types_1.DiagLogLevel.VERBOSE), }; } exports.createLogLevelDiagLogger = createLogLevelDiagLogger; //# sourceMappingURL=logLevelLogger.js.map /***/ }), /***/ 78077: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DiagLogLevel = void 0; /** * Defines the available internal logging levels for the diagnostic logger, the numeric values * of the levels are defined to match the original values from the initial LogLevel to avoid * compatibility/migration issues for any implementation that assume the numeric ordering. */ var DiagLogLevel; (function (DiagLogLevel) { /** Diagnostic Logging level setting to disable all logging (except and forced logs) */ DiagLogLevel[DiagLogLevel["NONE"] = 0] = "NONE"; /** Identifies an error scenario */ DiagLogLevel[DiagLogLevel["ERROR"] = 30] = "ERROR"; /** Identifies a warning scenario */ DiagLogLevel[DiagLogLevel["WARN"] = 50] = "WARN"; /** General informational log message */ DiagLogLevel[DiagLogLevel["INFO"] = 60] = "INFO"; /** General debug log message */ DiagLogLevel[DiagLogLevel["DEBUG"] = 70] = "DEBUG"; /** * Detailed trace level logging should only be used for development, should only be set * in a development environment. */ DiagLogLevel[DiagLogLevel["VERBOSE"] = 80] = "VERBOSE"; /** Used to set the logging level to include all logging */ DiagLogLevel[DiagLogLevel["ALL"] = 9999] = "ALL"; })(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {})); //# sourceMappingURL=types.js.map /***/ }), /***/ 65163: /***/ ((__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.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; var utils_1 = __nccwpck_require__(28136); Object.defineProperty(exports, "baggageEntryMetadataFromString", ({ enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } })); // Context APIs var context_1 = __nccwpck_require__(78242); Object.defineProperty(exports, "createContextKey", ({ enumerable: true, get: function () { return context_1.createContextKey; } })); Object.defineProperty(exports, "ROOT_CONTEXT", ({ enumerable: true, get: function () { return context_1.ROOT_CONTEXT; } })); // Diag APIs var consoleLogger_1 = __nccwpck_require__(3041); Object.defineProperty(exports, "DiagConsoleLogger", ({ enumerable: true, get: function () { return consoleLogger_1.DiagConsoleLogger; } })); var types_1 = __nccwpck_require__(78077); Object.defineProperty(exports, "DiagLogLevel", ({ enumerable: true, get: function () { return types_1.DiagLogLevel; } })); // Metrics APIs var NoopMeter_1 = __nccwpck_require__(4837); Object.defineProperty(exports, "createNoopMeter", ({ enumerable: true, get: function () { return NoopMeter_1.createNoopMeter; } })); var Metric_1 = __nccwpck_require__(89999); Object.defineProperty(exports, "ValueType", ({ enumerable: true, get: function () { return Metric_1.ValueType; } })); // Propagation APIs var TextMapPropagator_1 = __nccwpck_require__(80865); Object.defineProperty(exports, "defaultTextMapGetter", ({ enumerable: true, get: function () { return TextMapPropagator_1.defaultTextMapGetter; } })); 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); Object.defineProperty(exports, "SamplingDecision", ({ enumerable: true, get: function () { return SamplingResult_1.SamplingDecision; } })); var span_kind_1 = __nccwpck_require__(31424); Object.defineProperty(exports, "SpanKind", ({ enumerable: true, get: function () { return span_kind_1.SpanKind; } })); var status_1 = __nccwpck_require__(48845); Object.defineProperty(exports, "SpanStatusCode", ({ enumerable: true, get: function () { return status_1.SpanStatusCode; } })); var trace_flags_1 = __nccwpck_require__(26905); Object.defineProperty(exports, "TraceFlags", ({ enumerable: true, get: function () { return trace_flags_1.TraceFlags; } })); var utils_2 = __nccwpck_require__(32615); Object.defineProperty(exports, "createTraceState", ({ enumerable: true, get: function () { return utils_2.createTraceState; } })); var spancontext_utils_1 = __nccwpck_require__(49745); Object.defineProperty(exports, "isSpanContextValid", ({ enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } })); Object.defineProperty(exports, "isValidTraceId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } })); Object.defineProperty(exports, "isValidSpanId", ({ enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } })); var invalid_span_constants_1 = __nccwpck_require__(91760); Object.defineProperty(exports, "INVALID_SPANID", ({ enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPANID; } })); Object.defineProperty(exports, "INVALID_TRACEID", ({ enumerable: true, get: function () { return invalid_span_constants_1.INVALID_TRACEID; } })); Object.defineProperty(exports, "INVALID_SPAN_CONTEXT", ({ enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPAN_CONTEXT; } })); // Split module-level variable definition into separate files to allow // tree-shaking on each api instance. const context_api_1 = __nccwpck_require__(7393); Object.defineProperty(exports, "context", ({ enumerable: true, get: function () { return context_api_1.context; } })); const diag_api_1 = __nccwpck_require__(39721); Object.defineProperty(exports, "diag", ({ enumerable: true, get: function () { return diag_api_1.diag; } })); const metrics_api_1 = __nccwpck_require__(72601); Object.defineProperty(exports, "metrics", ({ enumerable: true, get: function () { return metrics_api_1.metrics; } })); const propagation_api_1 = __nccwpck_require__(17591); Object.defineProperty(exports, "propagation", ({ enumerable: true, get: function () { return propagation_api_1.propagation; } })); const trace_api_1 = __nccwpck_require__(98989); Object.defineProperty(exports, "trace", ({ enumerable: true, get: function () { return trace_api_1.trace; } })); // Default export. exports["default"] = { context: context_api_1.context, diag: diag_api_1.diag, metrics: metrics_api_1.metrics, propagation: propagation_api_1.propagation, trace: trace_api_1.trace, }; //# sourceMappingURL=index.js.map /***/ }), /***/ 85135: /***/ ((__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.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0; 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 = (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 : { version: version_1.VERSION, }); if (!allowOverride && api[type]) { // already registered an API of this type const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`); diag.error(err.stack || err.message); return false; } if (api.version !== version_1.VERSION) { // All registered APIs must be of the same version exactly const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${version_1.VERSION}`); diag.error(err.stack || err.message); return false; } api[type] = instance; diag.debug(`@opentelemetry/api: Registered a global for ${type} v${version_1.VERSION}.`); return true; } exports.registerGlobal = registerGlobal; function getGlobal(type) { var _a, _b; const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version; if (!globalVersion || !(0, semver_1.isCompatible)(globalVersion)) { return; } return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type]; } exports.getGlobal = getGlobal; function unregisterGlobal(type, diag) { diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${version_1.VERSION}.`); const api = _global[GLOBAL_OPENTELEMETRY_API_KEY]; if (api) { delete api[type]; } } exports.unregisterGlobal = unregisterGlobal; //# sourceMappingURL=global-utils.js.map /***/ }), /***/ 81522: /***/ ((__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.isCompatible = exports._makeCompatibilityCheck = void 0; const version_1 = __nccwpck_require__(98996); const re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/; /** * Create a function to test an API version to see if it is compatible with the provided ownVersion. * * The returned function has the following semantics: * - Exact match is always compatible * - Major versions must match exactly * - 1.x package cannot use global 2.x package * - 2.x package cannot use global 1.x package * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor * - Patch and build tag differences are not considered at this time * * @param ownVersion version which should be checked against */ function _makeCompatibilityCheck(ownVersion) { const acceptedVersions = new Set([ownVersion]); const rejectedVersions = new Set(); const myVersionMatch = ownVersion.match(re); if (!myVersionMatch) { // we cannot guarantee compatibility so we always return noop return () => false; } const ownVersionParsed = { major: +myVersionMatch[1], minor: +myVersionMatch[2], patch: +myVersionMatch[3], prerelease: myVersionMatch[4], }; // if ownVersion has a prerelease tag, versions must match exactly if (ownVersionParsed.prerelease != null) { return function isExactmatch(globalVersion) { return globalVersion === ownVersion; }; } function _reject(v) { rejectedVersions.add(v); return false; } function _accept(v) { acceptedVersions.add(v); return true; } return function isCompatible(globalVersion) { if (acceptedVersions.has(globalVersion)) { return true; } if (rejectedVersions.has(globalVersion)) { return false; } const globalVersionMatch = globalVersion.match(re); if (!globalVersionMatch) { // cannot parse other version // we cannot guarantee compatibility so we always noop return _reject(globalVersion); } const globalVersionParsed = { major: +globalVersionMatch[1], minor: +globalVersionMatch[2], patch: +globalVersionMatch[3], prerelease: globalVersionMatch[4], }; // if globalVersion has a prerelease tag, versions must match exactly if (globalVersionParsed.prerelease != null) { return _reject(globalVersion); } // major versions must match if (ownVersionParsed.major !== globalVersionParsed.major) { return _reject(globalVersion); } if (ownVersionParsed.major === 0) { if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) { return _accept(globalVersion); } return _reject(globalVersion); } if (ownVersionParsed.minor <= globalVersionParsed.minor) { return _accept(globalVersion); } return _reject(globalVersion); }; } exports._makeCompatibilityCheck = _makeCompatibilityCheck; /** * Test an API version to see if it is compatible with this API. * * - Exact match is always compatible * - Major versions must match exactly * - 1.x package cannot use global 2.x package * - 2.x package cannot use global 1.x package * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3 * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor * - Patch and build tag differences are not considered at this time * * @param version version of the API requesting an instance of the global API */ exports.isCompatible = _makeCompatibilityCheck(version_1.VERSION); //# sourceMappingURL=semver.js.map /***/ }), /***/ 72601: /***/ ((__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.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 * * @since 1.3.0 */ exports.metrics = metrics_1.MetricsAPI.getInstance(); //# sourceMappingURL=metrics-api.js.map /***/ }), /***/ 89999: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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. * * @since 1.3.0 */ var ValueType; (function (ValueType) { ValueType[ValueType["INT"] = 0] = "INT"; ValueType[ValueType["DOUBLE"] = 1] = "DOUBLE"; })(ValueType = exports.ValueType || (exports.ValueType = {})); //# sourceMappingURL=Metric.js.map /***/ }), /***/ 4837: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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; /** * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses * constant NoopMetrics for all of its methods. */ class NoopMeter { constructor() { } /** * @see {@link Meter.createGauge} */ createGauge(_name, _options) { return exports.NOOP_GAUGE_METRIC; } /** * @see {@link Meter.createHistogram} */ createHistogram(_name, _options) { return exports.NOOP_HISTOGRAM_METRIC; } /** * @see {@link Meter.createCounter} */ createCounter(_name, _options) { return exports.NOOP_COUNTER_METRIC; } /** * @see {@link Meter.createUpDownCounter} */ createUpDownCounter(_name, _options) { return exports.NOOP_UP_DOWN_COUNTER_METRIC; } /** * @see {@link Meter.createObservableGauge} */ createObservableGauge(_name, _options) { return exports.NOOP_OBSERVABLE_GAUGE_METRIC; } /** * @see {@link Meter.createObservableCounter} */ createObservableCounter(_name, _options) { return exports.NOOP_OBSERVABLE_COUNTER_METRIC; } /** * @see {@link Meter.createObservableUpDownCounter} */ createObservableUpDownCounter(_name, _options) { return exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; } /** * @see {@link Meter.addBatchObservableCallback} */ addBatchObservableCallback(_callback, _observables) { } /** * @see {@link Meter.removeBatchObservableCallback} */ removeBatchObservableCallback(_callback) { } } exports.NoopMeter = NoopMeter; class NoopMetric { } exports.NoopMetric = NoopMetric; class NoopCounterMetric extends NoopMetric { add(_value, _attributes) { } } exports.NoopCounterMetric = NoopCounterMetric; class NoopUpDownCounterMetric extends NoopMetric { add(_value, _attributes) { } } exports.NoopUpDownCounterMetric = NoopUpDownCounterMetric; class NoopGaugeMetric extends NoopMetric { record(_value, _attributes) { } } exports.NoopGaugeMetric = NoopGaugeMetric; class NoopHistogramMetric extends NoopMetric { record(_value, _attributes) { } } exports.NoopHistogramMetric = NoopHistogramMetric; class NoopObservableMetric { addCallback(_callback) { } removeCallback(_callback) { } } exports.NoopObservableMetric = NoopObservableMetric; class NoopObservableCounterMetric extends NoopObservableMetric { } exports.NoopObservableCounterMetric = NoopObservableCounterMetric; class NoopObservableGaugeMetric extends NoopObservableMetric { } exports.NoopObservableGaugeMetric = NoopObservableGaugeMetric; class NoopObservableUpDownCounterMetric extends NoopObservableMetric { } exports.NoopObservableUpDownCounterMetric = NoopObservableUpDownCounterMetric; exports.NOOP_METER = new NoopMeter(); // Synchronous instruments exports.NOOP_COUNTER_METRIC = new NoopCounterMetric(); exports.NOOP_GAUGE_METRIC = new NoopGaugeMetric(); exports.NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric(); exports.NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric(); // Asynchronous instruments exports.NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric(); 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; } exports.createNoopMeter = createNoopMeter; //# sourceMappingURL=NoopMeter.js.map /***/ }), /***/ 72647: /***/ ((__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.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0; const NoopMeter_1 = __nccwpck_require__(4837); /** * An implementation of the {@link MeterProvider} which returns an impotent Meter * for all calls to `getMeter` */ class NoopMeterProvider { getMeter(_name, _version, _options) { return NoopMeter_1.NOOP_METER; } } exports.NoopMeterProvider = NoopMeterProvider; exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); //# sourceMappingURL=NoopMeterProvider.js.map /***/ }), /***/ 17591: /***/ ((__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.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 * * @since 1.0.0 */ exports.propagation = propagation_1.PropagationAPI.getInstance(); //# sourceMappingURL=propagation-api.js.map /***/ }), /***/ 72368: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NoopTextMapPropagator = void 0; /** * No-op implementations of {@link TextMapPropagator}. */ class NoopTextMapPropagator { /** Noop inject function does nothing */ inject(_context, _carrier) { } /** Noop extract function does nothing and returns the input context */ extract(context, _carrier) { return context; } fields() { return []; } } exports.NoopTextMapPropagator = NoopTextMapPropagator; //# sourceMappingURL=NoopTextMapPropagator.js.map /***/ }), /***/ 80865: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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) { return undefined; } return carrier[key]; }, keys(carrier) { if (carrier == null) { return []; } return Object.keys(carrier); }, }; /** * @since 1.0.0 */ exports.defaultTextMapSetter = { set(carrier, key, value) { if (carrier == null) { return; } carrier[key] = value; }, }; //# sourceMappingURL=TextMapPropagator.js.map /***/ }), /***/ 98989: /***/ ((__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.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 * * @since 1.0.0 */ exports.trace = trace_1.TraceAPI.getInstance(); //# sourceMappingURL=trace-api.js.map /***/ }), /***/ 81462: /***/ ((__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.NonRecordingSpan = void 0; const invalid_span_constants_1 = __nccwpck_require__(91760); /** * The NonRecordingSpan is the default {@link Span} that is used when no Span * implementation is available. All operations are no-op including context * propagation. */ class NonRecordingSpan { constructor(spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT) { this._spanContext = spanContext; } // Returns a SpanContext. spanContext() { return this._spanContext; } // By default does nothing setAttribute(_key, _value) { return this; } // By default does nothing setAttributes(_attributes) { return this; } // By default does nothing addEvent(_name, _attributes) { return this; } addLink(_link) { return this; } addLinks(_links) { return this; } // By default does nothing setStatus(_status) { return this; } // By default does nothing updateName(_name) { return this; } // By default does nothing end(_endTime) { } // isRecording always returns false for NonRecordingSpan. isRecording() { return false; } // By default does nothing recordException(_exception, _time) { } } exports.NonRecordingSpan = NonRecordingSpan; //# sourceMappingURL=NonRecordingSpan.js.map /***/ }), /***/ 17606: /***/ ((__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.NoopTracer = void 0; const context_1 = __nccwpck_require__(57171); const context_utils_1 = __nccwpck_require__(23326); const NonRecordingSpan_1 = __nccwpck_require__(81462); const spancontext_utils_1 = __nccwpck_require__(49745); const contextApi = context_1.ContextAPI.getInstance(); /** * No-op implementations of {@link Tracer}. */ class NoopTracer { // startSpan starts a noop span. startSpan(name, options, context = contextApi.active()) { const root = Boolean(options === null || options === void 0 ? void 0 : options.root); if (root) { return new NonRecordingSpan_1.NonRecordingSpan(); } const parentFromContext = context && (0, context_utils_1.getSpanContext)(context); if (isSpanContext(parentFromContext) && (0, spancontext_utils_1.isSpanContextValid)(parentFromContext)) { return new NonRecordingSpan_1.NonRecordingSpan(parentFromContext); } else { return new NonRecordingSpan_1.NonRecordingSpan(); } } startActiveSpan(name, arg2, arg3, arg4) { let opts; let ctx; let fn; if (arguments.length < 2) { return; } else if (arguments.length === 2) { fn = arg2; } else if (arguments.length === 3) { opts = arg2; fn = arg3; } else { opts = arg2; ctx = arg3; fn = arg4; } const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active(); const span = this.startSpan(name, opts, parentContext); const contextWithSpanSet = (0, context_utils_1.setSpan)(parentContext, span); return contextApi.with(contextWithSpanSet, fn, undefined, span); } } exports.NoopTracer = NoopTracer; function isSpanContext(spanContext) { return (spanContext !== null && typeof spanContext === 'object' && 'spanId' in spanContext && typeof spanContext['spanId'] === 'string' && 'traceId' in spanContext && typeof spanContext['traceId'] === 'string' && 'traceFlags' in spanContext && typeof spanContext['traceFlags'] === 'number'); } //# sourceMappingURL=NoopTracer.js.map /***/ }), /***/ 23259: /***/ ((__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.NoopTracerProvider = void 0; const NoopTracer_1 = __nccwpck_require__(17606); /** * An implementation of the {@link TracerProvider} which returns an impotent * Tracer for all calls to `getTracer`. * * All operations are no-op. */ class NoopTracerProvider { getTracer(_name, _version, _options) { return new NoopTracer_1.NoopTracer(); } } exports.NoopTracerProvider = NoopTracerProvider; //# sourceMappingURL=NoopTracerProvider.js.map /***/ }), /***/ 43503: /***/ ((__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.ProxyTracer = void 0; 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; this.name = name; this.version = version; this.options = options; } startSpan(name, options, context) { return this._getTracer().startSpan(name, options, context); } startActiveSpan(_name, _options, _context, _fn) { const tracer = this._getTracer(); return Reflect.apply(tracer.startActiveSpan, tracer, arguments); } /** * Try to get a tracer from the proxy tracer provider. * If the proxy tracer provider has no delegate, return a noop tracer. */ _getTracer() { if (this._delegate) { return this._delegate; } const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options); if (!tracer) { return NOOP_TRACER; } this._delegate = tracer; return this._delegate; } } exports.ProxyTracer = ProxyTracer; //# sourceMappingURL=ProxyTracer.js.map /***/ }), /***/ 2285: /***/ ((__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.ProxyTracerProvider = void 0; const ProxyTracer_1 = __nccwpck_require__(43503); const NoopTracerProvider_1 = __nccwpck_require__(23259); const NOOP_TRACER_PROVIDER = new NoopTracerProvider_1.NoopTracerProvider(); /** * Tracer provider which provides {@link ProxyTracer}s. * * Before a delegate is set, tracers provided are NoOp. * 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 { /** * Get a {@link ProxyTracer} */ getTracer(name, version, options) { var _a; return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version, options)); } getDelegate() { var _a; return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER; } /** * Set the delegate tracer provider */ setDelegate(delegate) { this._delegate = delegate; } getDelegateTracer(name, version, options) { var _a; return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options); } } exports.ProxyTracerProvider = ProxyTracerProvider; //# sourceMappingURL=ProxyTracerProvider.js.map /***/ }), /***/ 33209: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); 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) { /** * `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=SamplingResult.js.map /***/ }), /***/ 23326: /***/ ((__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.getSpanContext = exports.setSpanContext = exports.deleteSpan = exports.setSpan = exports.getActiveSpan = exports.getSpan = void 0; const context_1 = __nccwpck_require__(78242); const NonRecordingSpan_1 = __nccwpck_require__(81462); const context_2 = __nccwpck_require__(57171); /** * span key */ const SPAN_KEY = (0, context_1.createContextKey)('OpenTelemetry Context Key SPAN'); /** * Return the span if one exists * * @param context context to get span from */ function getSpan(context) { return context.getValue(SPAN_KEY) || undefined; } exports.getSpan = getSpan; /** * Gets the span from the current context, if one exists. */ function getActiveSpan() { return getSpan(context_2.ContextAPI.getInstance().active()); } exports.getActiveSpan = getActiveSpan; /** * Set the span on a context * * @param context context to use as parent * @param span span to set active */ function setSpan(context, span) { return context.setValue(SPAN_KEY, span); } exports.setSpan = setSpan; /** * Remove current span stored in the context * * @param context context to delete span from */ function deleteSpan(context) { return context.deleteValue(SPAN_KEY); } exports.deleteSpan = deleteSpan; /** * Wrap span context in a NoopSpan and set as span in a new * context * * @param context context to set active span on * @param spanContext span context to be wrapped */ function setSpanContext(context, spanContext) { return setSpan(context, new NonRecordingSpan_1.NonRecordingSpan(spanContext)); } exports.setSpanContext = setSpanContext; /** * Get the span context of the span if it exists. * * @param context context to get values from */ function getSpanContext(context) { var _a; return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext(); } exports.getSpanContext = getSpanContext; //# sourceMappingURL=context-utils.js.map /***/ }), /***/ 62110: /***/ ((__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.TraceStateImpl = void 0; const tracestate_validators_1 = __nccwpck_require__(54864); 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 TraceStateImpl { 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 (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)); } _parse(rawTraceState) { if (rawTraceState.length > MAX_TRACE_STATE_LEN) return; this._internalState = rawTraceState .split(LIST_MEMBERS_SEPARATOR) // 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) { const key = listMember.slice(0, i); const value = listMember.slice(i + 1, part.length); if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_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)); } } // @ts-expect-error TS6133 Accessed in tests only. _keys() { return Array.from(this._internalState.keys()).reverse(); } _clone() { const traceState = new TraceStateImpl(); traceState._internalState = new Map(this._internalState); return traceState; } } exports.TraceStateImpl = TraceStateImpl; //# sourceMappingURL=tracestate-impl.js.map /***/ }), /***/ 54864: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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=tracestate-validators.js.map /***/ }), /***/ 32615: /***/ ((__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.createTraceState = void 0; const tracestate_impl_1 = __nccwpck_require__(62110); /** * @since 1.1.0 */ function createTraceState(rawTraceState) { return new tracestate_impl_1.TraceStateImpl(rawTraceState); } exports.createTraceState = createTraceState; //# sourceMappingURL=utils.js.map /***/ }), /***/ 91760: /***/ ((__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.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, traceFlags: trace_flags_1.TraceFlags.NONE, }; //# sourceMappingURL=invalid-span-constants.js.map /***/ }), /***/ 31424: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SpanKind = void 0; /** * @since 1.0.0 */ var SpanKind; (function (SpanKind) { /** Default value. Indicates that the span is used internally. */ SpanKind[SpanKind["INTERNAL"] = 0] = "INTERNAL"; /** * Indicates that the span covers server-side handling of an RPC or other * remote request. */ SpanKind[SpanKind["SERVER"] = 1] = "SERVER"; /** * Indicates that the span covers the client-side wrapper around an RPC or * other remote request. */ SpanKind[SpanKind["CLIENT"] = 2] = "CLIENT"; /** * Indicates that the span describes producer sending a message to a * broker. Unlike client and server, there is no direct critical path latency * relationship between producer and consumer spans. */ SpanKind[SpanKind["PRODUCER"] = 3] = "PRODUCER"; /** * Indicates that the span describes consumer receiving a message from a * broker. Unlike client and server, there is no direct critical path latency * relationship between producer and consumer spans. */ SpanKind[SpanKind["CONSUMER"] = 4] = "CONSUMER"; })(SpanKind = exports.SpanKind || (exports.SpanKind = {})); //# sourceMappingURL=span_kind.js.map /***/ }), /***/ 49745: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.wrapSpanContext = exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = void 0; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ const invalid_span_constants_1 = __nccwpck_require__(91760); const NonRecordingSpan_1 = __nccwpck_require__(81462); // 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 isValidHex(traceId, 32) && traceId !== invalid_span_constants_1.INVALID_TRACEID; } exports.isValidTraceId = isValidTraceId; /** * @since 1.0.0 */ function isValidSpanId(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)); } exports.isSpanContextValid = isSpanContextValid; /** * Wrap the given {@link SpanContext} in a new non-recording {@link Span} * * @param spanContext span context to be wrapped * @returns a new non-recording {@link Span} with the provided context */ function wrapSpanContext(spanContext) { return new NonRecordingSpan_1.NonRecordingSpan(spanContext); } exports.wrapSpanContext = wrapSpanContext; //# sourceMappingURL=spancontext-utils.js.map /***/ }), /***/ 48845: /***/ ((__unused_webpack_module, exports) => { "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) { /** * The default status. */ SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET"; /** * The operation has been validated by an Application developer or * Operator to have completed successfully. */ SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK"; /** * The operation contains an error. */ SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR"; })(SpanStatusCode = exports.SpanStatusCode || (exports.SpanStatusCode = {})); //# sourceMappingURL=status.js.map /***/ }), /***/ 26905: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TraceFlags = void 0; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ /** * @since 1.0.0 */ var TraceFlags; (function (TraceFlags) { /** Represents no flag set. */ TraceFlags[TraceFlags["NONE"] = 0] = "NONE"; /** Bit to represent whether trace is sampled in trace flags. */ TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED"; })(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {})); //# sourceMappingURL=trace_flags.js.map /***/ }), /***/ 98996: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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.1'; //# sourceMappingURL=version.js.map /***/ }), /***/ 67959: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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 = ExportResultCode = {})); //# sourceMappingURL=ExportResult.js.map /***/ }), /***/ 36178: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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; 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 /***/ }), /***/ 61476: /***/ ((__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.W3CBaggagePropagator = void 0; const api_1 = __nccwpck_require__(65163); const suppress_tracing_1 = __nccwpck_require__(54463); const constants_1 = __nccwpck_require__(36178); const utils_1 = __nccwpck_require__(49884); /** * 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); if (!headerValue) { return context; } const baggage = {}; let count = 0; let totalSize = 0; if (Array.isArray(headerValue)) { for (let i = 0; i < headerValue.length; i++) { [count, totalSize] = (0, utils_1.parseBaggageHeaderString)(headerValue[i], baggage, count, totalSize); } } else { [count] = (0, utils_1.parseBaggageHeaderString)(headerValue, baggage, count, totalSize); } if (count === 0) { return context; } return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); } fields() { return [constants_1.BAGGAGE_HEADER]; } } exports.W3CBaggagePropagator = W3CBaggagePropagator; //# sourceMappingURL=W3CBaggagePropagator.js.map /***/ }), /***/ 49884: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); 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) { 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) { if (!entry) return; const metadataSeparatorIndex = entry.indexOf(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); const keyPairPart = metadataSeparatorIndex === -1 ? entry : entry.substring(0, metadataSeparatorIndex); const separatorIndex = keyPairPart.indexOf(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); if (separatorIndex <= 0) return; const rawKey = keyPairPart.substring(0, separatorIndex).trim(); const rawValue = keyPairPart.substring(separatorIndex + 1).trim(); if (!rawKey || !rawValue) return; let key; let value; try { key = decodeURIComponent(rawKey); value = decodeURIComponent(rawValue); } catch { return; } let metadata; if (metadataSeparatorIndex !== -1 && metadataSeparatorIndex < entry.length - 1) { const metadataString = entry.substring(metadataSeparatorIndex + 1); metadata = (0, api_1.baggageEntryMetadataFromString)(metadataString); } return { key, value, metadata }; } exports.parsePairKeyValue = parsePairKeyValue; /** * Parses a single baggage header string into the provided record, applying limits defined in this package. * Uses indexOf/substring in a while loop to avoid allocating a full array of split entries. * Returns the updated pair count so callers can track totals across multiple header values. */ function parseBaggageHeaderString(value, baggage, count, totalSize) { let start = 0; while (start < value.length && count < constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS) { const end = value.indexOf(constants_1.BAGGAGE_ITEMS_SEPARATOR, start); const entryEnd = end === -1 ? value.length : end; const entryLength = entryEnd - start; if (entryLength <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS) { const keyPair = parsePairKeyValue(value.substring(start, entryEnd)); if (keyPair) { // 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) { 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 /***/ }), /***/ 54848: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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 { _monotonicClock; _epochMillis; _performanceMillis; /** * Create a new AnchoredClock anchored to the current time returned by systemClock. * * @param systemClock should be a clock that returns the number of milliseconds since January 1 1970 such as Date * @param monotonicClock should be a clock that counts milliseconds monotonically such as window.performance or perf_hooks.performance */ constructor(systemClock, monotonicClock) { this._monotonicClock = monotonicClock; this._epochMillis = systemClock.now(); this._performanceMillis = monotonicClock.now(); } /** * Returns the current time by adding the number of milliseconds since the * AnchoredClock was created to the creation epoch time */ now() { const delta = this._monotonicClock.now() - this._performanceMillis; return this._epochMillis + delta; } } exports.AnchoredClock = AnchoredClock; //# sourceMappingURL=anchored-clock.js.map /***/ }), /***/ 82807: /***/ ((__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.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 in attributes) { if (!Object.prototype.hasOwnProperty.call(attributes, key)) { continue; } if (!isAttributeKey(key)) { api_1.diag.warn(`Invalid attribute key: ${key}`); continue; } const val = attributes[key]; if (!isAttributeValue(val)) { api_1.diag.warn(`Invalid attribute value set for key: ${key}`); continue; } if (Array.isArray(val)) { out[key] = val.slice(); } else { out[key] = val; } } return out; } exports.sanitizeAttributes = sanitizeAttributes; function isAttributeKey(key) { return typeof key === 'string' && key !== ''; } exports.isAttributeKey = isAttributeKey; function isAttributeValue(val) { if (val == null) { return true; } if (Array.isArray(val)) { return isHomogeneousAttributeValueArray(val); } return isValidPrimitiveAttributeValueType(typeof val); } exports.isAttributeValue = isAttributeValue; function isHomogeneousAttributeValueArray(arr) { let type; for (const element of arr) { // null/undefined elements are allowed if (element == null) continue; const elementType = typeof element; if (elementType === type) { continue; } if (!type) { if (isValidPrimitiveAttributeValueType(elementType)) { type = elementType; continue; } // encountered an invalid primitive return false; } return false; } return true; } function isValidPrimitiveAttributeValueType(valType) { switch (valType) { case 'number': case 'boolean': case 'string': return true; } return false; } //# sourceMappingURL=attributes.js.map /***/ }), /***/ 69246: /***/ ((__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.globalErrorHandler = exports.setGlobalErrorHandler = void 0; const logging_error_handler_1 = __nccwpck_require__(32882); /** 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 { } // eslint-disable-line no-empty } exports.globalErrorHandler = globalErrorHandler; //# sourceMappingURL=global-error-handler.js.map /***/ }), /***/ 46128: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports._globalThis = void 0; /** * @deprecated Use globalThis directly instead. */ exports._globalThis = globalThis; //# sourceMappingURL=globalThis.js.map /***/ }), /***/ 32882: /***/ ((__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.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 /***/ }), /***/ 86161: /***/ ((__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.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; 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; /** * @deprecated Use `performance.timeOrigin` directly. */ function getTimeOrigin() { return platform_1.otperformance.timeOrigin; } exports.getTimeOrigin = getTimeOrigin; /** * Returns an hrtime calculated via performance component. * @param performanceNow */ function hrTime(performanceNow) { const timeOrigin = millisToHrTime(platform_1.otperformance.timeOrigin); 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') { // 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 { // 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 microseconds. * @param time */ function hrTimeToMicroseconds(time) { return time[0] * 1e6 + time[1] / 1e3; } exports.hrTimeToMicroseconds = hrTimeToMicroseconds; /** * Convert hrTime to milliseconds. * @param time */ function hrTimeToMilliseconds(time) { return time[0] * 1e3 + time[1] / 1e6; } exports.hrTimeToMilliseconds = hrTimeToMilliseconds; /** * Convert hrTime to seconds. * @param time */ function hrTimeToSeconds(time) { return time[0] + time[1] / SECOND_TO_NANOSECONDS; } exports.hrTimeToSeconds = hrTimeToSeconds; /** * check if time is HrTime * @param value */ function isTimeInputHrTime(value) { return (Array.isArray(value) && value.length === 2 && typeof value[0] === 'number' && typeof value[1] === 'number'); } exports.isTimeInputHrTime = isTimeInputHrTime; /** * check if input value is a correct types.TimeInput * @param value */ function isTimeInput(value) { return (isTimeInputHrTime(value) || typeof value === 'number' || value instanceof Date); } exports.isTimeInput = isTimeInput; /** * Given 2 HrTime formatted times, return their sum as an HrTime. */ function addHrTimes(time1, time2) { const out = [time1[0] + time2[0], time1[1] + time2[1]]; // Nanoseconds if (out[1] >= SECOND_TO_NANOSECONDS) { out[1] -= SECOND_TO_NANOSECONDS; out[0] += 1; } return out; } exports.addHrTimes = addHrTimes; //# sourceMappingURL=time.js.map /***/ }), /***/ 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__) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.diagLogLevelFromString = exports.BindOnceFuture = exports.urlMatches = exports.isUrlIgnored = exports.callWithTimeout = exports.TimeoutError = exports.merge = exports.TraceState = exports.unsuppressTracing = exports.suppressTracing = exports.isTracingSuppressed = exports.setRPCMetadata = exports.getRPCMetadata = exports.deleteRPCMetadata = exports.RPCType = exports.parseTraceParent = exports.W3CTraceContextPropagator = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = exports.CompositePropagator = exports.otperformance = exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports._globalThis = exports.SDK_INFO = exports.parseKeyPairsIntoRecord = exports.ExportResultCode = exports.unrefTimer = exports.timeInputToHrTime = exports.millisToHrTime = exports.isTimeInputHrTime = exports.isTimeInput = exports.hrTimeToTimeStamp = exports.hrTimeToSeconds = exports.hrTimeToNanoseconds = exports.hrTimeToMilliseconds = exports.hrTimeToMicroseconds = exports.hrTimeDuration = exports.hrTime = exports.getTimeOrigin = exports.addHrTimes = exports.loggingErrorHandler = exports.setGlobalErrorHandler = exports.globalErrorHandler = exports.sanitizeAttributes = exports.isAttributeValue = exports.AnchoredClock = exports.W3CBaggagePropagator = void 0; exports.internal = void 0; var W3CBaggagePropagator_1 = __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, "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); 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__(32882); Object.defineProperty(exports, "loggingErrorHandler", ({ enumerable: true, get: function () { return logging_error_handler_1.loggingErrorHandler; } })); var time_1 = __nccwpck_require__(86161); Object.defineProperty(exports, "addHrTimes", ({ enumerable: true, get: function () { return time_1.addHrTimes; } })); Object.defineProperty(exports, "getTimeOrigin", ({ enumerable: true, get: function () { return time_1.getTimeOrigin; } })); Object.defineProperty(exports, "hrTime", ({ enumerable: true, get: function () { return time_1.hrTime; } })); Object.defineProperty(exports, "hrTimeDuration", ({ enumerable: true, get: function () { return time_1.hrTimeDuration; } })); Object.defineProperty(exports, "hrTimeToMicroseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMicroseconds; } })); Object.defineProperty(exports, "hrTimeToMilliseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToMilliseconds; } })); Object.defineProperty(exports, "hrTimeToNanoseconds", ({ enumerable: true, get: function () { return time_1.hrTimeToNanoseconds; } })); Object.defineProperty(exports, "hrTimeToSeconds", ({ enumerable: true, get: function () { return time_1.hrTimeToSeconds; } })); Object.defineProperty(exports, "hrTimeToTimeStamp", ({ enumerable: true, get: function () { return time_1.hrTimeToTimeStamp; } })); Object.defineProperty(exports, "isTimeInput", ({ enumerable: true, get: function () { return time_1.isTimeInput; } })); Object.defineProperty(exports, "isTimeInputHrTime", ({ enumerable: true, get: function () { return time_1.isTimeInputHrTime; } })); Object.defineProperty(exports, "millisToHrTime", ({ enumerable: true, get: function () { return time_1.millisToHrTime; } })); Object.defineProperty(exports, "timeInputToHrTime", ({ enumerable: true, get: function () { return time_1.timeInputToHrTime; } })); var timer_util_1 = __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; } })); 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, "SDK_INFO", ({ enumerable: true, get: function () { return platform_1.SDK_INFO; } })); Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return platform_1._globalThis; } })); Object.defineProperty(exports, "getStringFromEnv", ({ enumerable: true, get: function () { return platform_1.getStringFromEnv; } })); Object.defineProperty(exports, "getBooleanFromEnv", ({ enumerable: true, get: function () { return platform_1.getBooleanFromEnv; } })); Object.defineProperty(exports, "getNumberFromEnv", ({ enumerable: true, get: function () { return platform_1.getNumberFromEnv; } })); Object.defineProperty(exports, "getStringListFromEnv", ({ enumerable: true, get: function () { return platform_1.getStringListFromEnv; } })); Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return platform_1.otperformance; } })); var composite_1 = __nccwpck_require__(57785); Object.defineProperty(exports, "CompositePropagator", ({ enumerable: true, get: function () { return composite_1.CompositePropagator; } })); var W3CTraceContextPropagator_1 = __nccwpck_require__(61463); 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__(52992); Object.defineProperty(exports, "RPCType", ({ enumerable: true, get: function () { return rpc_metadata_1.RPCType; } })); Object.defineProperty(exports, "deleteRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.deleteRPCMetadata; } })); Object.defineProperty(exports, "getRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.getRPCMetadata; } })); Object.defineProperty(exports, "setRPCMetadata", ({ enumerable: true, get: function () { return rpc_metadata_1.setRPCMetadata; } })); var suppress_tracing_1 = __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 merge_1 = __nccwpck_require__(65387); Object.defineProperty(exports, "merge", ({ enumerable: true, get: function () { return merge_1.merge; } })); 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 callback_1 = __nccwpck_require__(12408); Object.defineProperty(exports, "BindOnceFuture", ({ enumerable: true, get: function () { return callback_1.BindOnceFuture; } })); 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, }; //# sourceMappingURL=index.js.map /***/ }), /***/ 87795: /***/ ((__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._export = void 0; const api_1 = __nccwpck_require__(65163); const suppress_tracing_1 = __nccwpck_require__(54463); /** * @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, resolve); }); }); } exports._export = _export; //# sourceMappingURL=exporter.js.map /***/ }), /***/ 96242: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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 /***/ }), /***/ 6730: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getStringListFromEnv = exports.getNumberFromEnv = exports.getStringFromEnv = exports.getBooleanFromEnv = exports.otperformance = exports._globalThis = exports.SDK_INFO = void 0; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ var node_1 = __nccwpck_require__(9340); Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return node_1.SDK_INFO; } })); Object.defineProperty(exports, "_globalThis", ({ enumerable: true, get: function () { return node_1._globalThis; } })); Object.defineProperty(exports, "otperformance", ({ enumerable: true, get: function () { return node_1.otperformance; } })); Object.defineProperty(exports, "getBooleanFromEnv", ({ enumerable: true, get: function () { return node_1.getBooleanFromEnv; } })); Object.defineProperty(exports, "getStringFromEnv", ({ enumerable: true, get: function () { return node_1.getStringFromEnv; } })); Object.defineProperty(exports, "getNumberFromEnv", ({ enumerable: true, get: function () { return node_1.getNumberFromEnv; } })); Object.defineProperty(exports, "getStringListFromEnv", ({ enumerable: true, get: function () { return node_1.getStringListFromEnv; } })); //# sourceMappingURL=index.js.map /***/ }), /***/ 76494: /***/ ((__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.getStringListFromEnv = exports.getBooleanFromEnv = exports.getStringFromEnv = exports.getNumberFromEnv = void 0; const api_1 = __nccwpck_require__(65163); const util_1 = __nccwpck_require__(73837); /** * Retrieves a number from an environment variable. * - Returns `undefined` if the environment variable is empty, unset, contains only whitespace, or is not a number. * - Returns a number in all other cases. * * @param {string} key - The name of the environment variable to retrieve. * @returns {number | undefined} - The number value or `undefined`. */ function getNumberFromEnv(key) { const raw = process.env[key]; if (raw == null || raw.trim() === '') { return 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.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.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 /***/ }), /***/ 9340: /***/ ((__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.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, "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 sdk_info_1 = __nccwpck_require__(10265); Object.defineProperty(exports, "SDK_INFO", ({ enumerable: true, get: function () { return sdk_info_1.SDK_INFO; } })); /** * @deprecated Use performance directly. */ exports.otperformance = performance; //# sourceMappingURL=index.js.map /***/ }), /***/ 10265: /***/ ((__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.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.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 /***/ }), /***/ 57785: /***/ ((__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.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 = {}) { 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 const propagatorFields = typeof propagator.fields === 'function' ? propagator.fields() : []; for (const field of propagatorFields) { fields.add(field); } } this._fields = Array.from(fields); } /** * Run each of the configured propagators with the given context and carrier. * Propagators are run in the order they are configured, so if multiple * propagators write the same carrier key, the propagator later in the list * will "win". * * @param context Context to inject * @param carrier Carrier into which context will be injected */ inject(context, 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 /***/ }), /***/ 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__) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TraceState = void 0; const validators_1 = __nccwpck_require__(96242); 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 { _length; _rawTraceState; _internalState; constructor(rawTraceState) { this._rawTraceState = typeof rawTraceState === 'string' ? rawTraceState : ''; this._length = this._rawTraceState.length; } set(key, value) { if (!(0, validators_1.validateKey)(key) || !(0, validators_1.validateValue)(value)) { return this; } const currState = this._getState(); const currValue = currState.get(key); // 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 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) { const currState = this._getState(); return currState.get(key); } serialize() { // 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; } serialized = `${entry[0]}${LIST_MEMBER_KEY_VALUE_SPLITTER}${entry[1]}` + serialized; index++; } return serialized; } _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; } _fromState(state, length) { const traceState = Object.create(TraceState.prototype); traceState._internalState = state; traceState._length = length; return traceState; } } exports.TraceState = TraceState; //# sourceMappingURL=TraceState.js.map /***/ }), /***/ 61463: /***/ ((__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.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__(54463); const TraceState_1 = __nccwpck_require__(1914); 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 /***/ }), /***/ 52992: /***/ ((__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.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 = 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 /***/ }), /***/ 54463: /***/ ((__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.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 /***/ }), /***/ 12408: /***/ ((__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.BindOnceFuture = void 0; 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 { _isCalled = false; _deferred = new promise_1.Deferred(); _callback; _that; constructor(callback, that) { this._callback = callback; this._that = that; } get isCalled() { return this._isCalled; } get promise() { return this._deferred.promise; } call(...args) { if (!this._isCalled) { this._isCalled = true; try { Promise.resolve(this._callback.call(this._that, ...args)).then(val => this._deferred.resolve(val), err => this._deferred.reject(err)); } catch (err) { this._deferred.reject(err); } } return this._deferred.promise; } } exports.BindOnceFuture = BindOnceFuture; //# sourceMappingURL=callback.js.map /***/ }), /***/ 28002: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.diagLogLevelFromString = void 0; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ const api_1 = __nccwpck_require__(65163); const logLevelMap = { ALL: api_1.DiagLogLevel.ALL, VERBOSE: api_1.DiagLogLevel.VERBOSE, DEBUG: api_1.DiagLogLevel.DEBUG, INFO: api_1.DiagLogLevel.INFO, WARN: api_1.DiagLogLevel.WARN, ERROR: api_1.DiagLogLevel.ERROR, NONE: api_1.DiagLogLevel.NONE, }; /** * Convert a string to a {@link DiagLogLevel}, defaults to {@link DiagLogLevel} if the log level does not exist or undefined if the input is undefined. * @param value */ function diagLogLevelFromString(value) { if (value == null) { // 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; } const resolvedLogLevel = logLevelMap[value.toUpperCase()]; if (resolvedLogLevel == null) { api_1.diag.warn(`Unknown log level "${value}", expected one of ${Object.keys(logLevelMap)}, using default`); return api_1.DiagLogLevel.INFO; } return resolvedLogLevel; } exports.diagLogLevelFromString = diagLogLevelFromString; //# sourceMappingURL=configuration.js.map /***/ }), /***/ 71780: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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 getPrototypeOf = Object.getPrototypeOf; const objectProto = Object.prototype; const hasOwnProperty = objectProto.hasOwnProperty; const symToStringTag = Symbol ? Symbol.toStringTag : undefined; const nativeObjectToString = objectProto.toString; /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { return false; } const proto = getPrototypeOf(value); if (proto === null) { return true; } const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return (typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) === objectCtorString); } exports.isPlainObject = isPlainObject; /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === 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 { // 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 /***/ }), /***/ 65387: /***/ ((__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.merge = void 0; /* eslint-disable @typescript-eslint/no-explicit-any */ const lodash_merge_1 = __nccwpck_require__(71780); 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]; if (key === '__proto__' || key === 'constructor' || key === 'prototype') { continue; } result[key] = takeValue(two[key]); } } } else if (isObject(one)) { if (isObject(two)) { if (!shouldMerge(one, two)) { return two; } result = Object.assign({}, one); const keys = Object.keys(two); for (let i = 0, j = keys.length; i < j; i++) { const key = keys[i]; if (key === '__proto__' || key === 'constructor' || key === 'prototype') { continue; } const twoValue = two[key]; if (isPrimitive(twoValue)) { if (typeof twoValue === 'undefined') { delete result[key]; } else { // result[key] = 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 /***/ }), /***/ 28329: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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; 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 /***/ }), /***/ 48400: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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 /***/ }), /***/ 90839: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isUrlIgnored = exports.urlMatches = void 0; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ function urlMatches(url, urlToMatch) { if (typeof urlToMatch === 'string') { return url === urlToMatch; } else { return !!url.match(urlToMatch); } } exports.urlMatches = urlMatches; /** * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} * @param url * @param ignoredUrls */ function isUrlIgnored(url, ignoredUrls) { if (!ignoredUrls) { return false; } for (const ignoreUrl of ignoredUrls) { if (urlMatches(url, ignoreUrl)) { return true; } } return false; } exports.isUrlIgnored = isUrlIgnored; //# sourceMappingURL=url.js.map /***/ }), /***/ 55687: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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 = '2.10.0'; //# sourceMappingURL=version.js.map /***/ }), /***/ 7507: /***/ ((__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.registerInstrumentations = void 0; const api_1 = __nccwpck_require__(65163); const api_logs_1 = __nccwpck_require__(32832); const autoLoaderUtils_1 = __nccwpck_require__(16307); /** * It will register instrumentations and plugins * @param options * @return returns function to unload instrumentation and plugins that were * registered */ function registerInstrumentations(options) { 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 = options.instrumentations?.flat() ?? []; (0, autoLoaderUtils_1.enableInstrumentations)(instrumentations, tracerProvider, meterProvider, loggerProvider); return () => { (0, autoLoaderUtils_1.disableInstrumentations)(instrumentations); }; } exports.registerInstrumentations = registerInstrumentations; //# sourceMappingURL=autoLoader.js.map /***/ }), /***/ 16307: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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 /***/ }), /***/ 65584: /***/ ((__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.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); Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return index_1.InstrumentationBase; } })); var instrumentationNodeModuleDefinition_1 = __nccwpck_require__(1317); Object.defineProperty(exports, "InstrumentationNodeModuleDefinition", ({ enumerable: true, get: function () { return instrumentationNodeModuleDefinition_1.InstrumentationNodeModuleDefinition; } })); var instrumentationNodeModuleFile_1 = __nccwpck_require__(16633); Object.defineProperty(exports, "InstrumentationNodeModuleFile", ({ enumerable: true, get: function () { return instrumentationNodeModuleFile_1.InstrumentationNodeModuleFile; } })); 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 /***/ }), /***/ 9216: /***/ ((__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.InstrumentationAbstract = void 0; const api_1 = __nccwpck_require__(65163); const api_logs_1 = __nccwpck_require__(32832); 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.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(); } /* 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; } /** * 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() { const initResult = this.init() ?? []; 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 = { enabled: true, ...config, }; } /** * Sets TracerProvider 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 /***/ }), /***/ 1317: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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; } } exports.InstrumentationNodeModuleDefinition = InstrumentationNodeModuleDefinition; //# sourceMappingURL=instrumentationNodeModuleDefinition.js.map /***/ }), /***/ 16633: /***/ ((__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.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; } } exports.InstrumentationNodeModuleFile = InstrumentationNodeModuleFile; //# sourceMappingURL=instrumentationNodeModuleFile.js.map /***/ }), /***/ 20997: /***/ ((__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.normalize = exports.InstrumentationBase = void 0; var node_1 = __nccwpck_require__(9674); 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 /***/ }), /***/ 52986: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ModuleNameTrie = exports.ModuleNameSeparator = void 0; exports.ModuleNameSeparator = '/'; /** * Node in a `ModuleNameTrie` */ class ModuleNameTrieNode { 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 { _trie = new ModuleNameTrieNode(); _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 /***/ }), /***/ 77404: /***/ ((__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.RequireInTheMiddleSingleton = void 0; const require_in_the_middle_1 = __nccwpck_require__(62009); const path = __nccwpck_require__(71017); const ModuleNameTrie_1 = __nccwpck_require__(52986); /** * 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 { _moduleNameTrie = new ModuleNameTrie_1.ModuleNameTrie(); static _instance; constructor() { 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() { // 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 = this._instance ?? 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 /***/ }), /***/ 9674: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.normalize = exports.InstrumentationBase = void 0; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ var instrumentation_1 = __nccwpck_require__(93608); Object.defineProperty(exports, "InstrumentationBase", ({ enumerable: true, get: function () { return instrumentation_1.InstrumentationBase; } })); var normalize_1 = __nccwpck_require__(8974); Object.defineProperty(exports, "normalize", ({ enumerable: true, get: function () { return normalize_1.normalize; } })); //# sourceMappingURL=index.js.map /***/ }), /***/ 93608: /***/ ((__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.InstrumentationBase = void 0; const path = __nccwpck_require__(71017); const util_1 = __nccwpck_require__(73837); 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); 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__(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); let modules = this.init(); if (modules && !Array.isArray(modules)) { modules = [modules]; } this._modules = modules || []; if (this._config.enabled) { 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 = 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 { // 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 { api_1.diag.warn('Failed extracting version', baseDir); } return undefined; } _onRequire(module, exports, name, baseDir) { 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 = module.files ?? []; const normalizedName = path.normalize(name); 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) { 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) => { 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; } 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: true }, 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 /***/ }), /***/ 8974: /***/ ((__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.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 /***/ }), /***/ 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) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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 { await 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 /***/ }), /***/ 22153: /***/ ((__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.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 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. */ 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); } get asyncAttributesPending() { return this._asyncAttributesPending; } async waitForAsyncAttributes() { if (!this.asyncAttributesPending) { return; } for (let i = 0; i < this._rawAttributes.length; i++) { const [k, v] = this._rawAttributes[i]; this._rawAttributes[i] = [k, (0, utils_1.isPromiseLike)(v) ? await v : v]; } this._asyncAttributesPending = false; } get attributes() { if (this.asyncAttributesPending) { api_1.diag.error('Accessing resource attributes before async attributes settled'); } if (this._memoizedAttributes) { return this._memoizedAttributes; } const attrs = {}; for (const [k, v] of this._rawAttributes) { if ((0, utils_1.isPromiseLike)(v)) { api_1.diag.debug(`Unsettled resource attribute ${k} skipped`); continue; } if (v != null) { attrs[k] ??= v; } } // only memoize output if all attributes are settled if (!this._asyncAttributesPending) { this._memoizedAttributes = attrs; } return attrs; } getRawAttributes() { return this._rawAttributes; } get schemaUrl() { return this._schemaUrl; } merge(resource) { if (resource == null) return this; // 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); } } 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 /***/ }), /***/ 990: /***/ ((__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.detectResources = void 0; const api_1 = __nccwpck_require__(65163); const ResourceImpl_1 = __nccwpck_require__(22153); /** * Runs all resource detectors and returns the results merged into a single Resource. * * @param config Configuration for resource detection */ const detectResources = (config = {}) => { const resources = (config.detectors || []).map(d => { try { const resource = (0, ResourceImpl_1.resourceFromDetectedResource)(d.detect(config)); api_1.diag.debug(`${d.constructor.name} found resource.`, resource); return resource; } catch (e) { api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); return (0, ResourceImpl_1.emptyResource)(); } }); return resources.reduce((acc, resource) => acc.merge(resource), (0, ResourceImpl_1.emptyResource)()); }; exports.detectResources = detectResources; //# sourceMappingURL=detect-resources.js.map /***/ }), /***/ 22474: /***/ ((__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.envDetector = void 0; 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 { // 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 * function to conform to the Detector interface. * * @param config The resource detection config */ detect(_config) { const attributes = {}; const rawAttributes = (0, core_1.getStringFromEnv)('OTEL_RESOURCE_ATTRIBUTES'); const serviceName = (0, core_1.getStringFromEnv)('OTEL_SERVICE_NAME'); if (rawAttributes) { try { const parsedAttributes = this._parseResourceAttributes(rawAttributes); Object.assign(attributes, parsedAttributes); } catch (e) { api_1.diag.debug(`EnvDetector failed: ${e instanceof Error ? e.message : e}`); } } if (serviceName) { attributes[semantic_conventions_1.ATTR_SERVICE_NAME] = serviceName; } return { attributes }; } /** * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment * variable. * * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes in the * format "key1=value1,key2=value2". The ',' and '=' characters in keys * and values MUST be percent-encoded. Other characters MAY be percent-encoded. * * Per the spec, on any error (e.g., decoding failure), the entire environment * variable value is discarded. * * @param rawEnvAttributes The resource attributes as a comma-separated list * of key/value pairs. * @returns The parsed resource attributes. * @throws Error if parsing fails (caller handles by discarding all attributes) */ _parseResourceAttributes(rawEnvAttributes) { if (!rawEnvAttributes) return {}; const attributes = {}; const rawAttributes = rawEnvAttributes .split(this._COMMA_SEPARATOR) .filter(attr => attr.trim() !== ''); // Filter out empty entries for (const rawAttribute of rawAttributes) { 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) { throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${rawAttribute}". ` + "Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values."); } const [rawKey, rawValue] = keyValuePair; const key = rawKey.trim(); const value = rawValue.trim(); if (key.length === 0) { throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${rawAttribute}".`); } let decodedKey; let decodedValue; try { decodedKey = decodeURIComponent(key); decodedValue = decodeURIComponent(value); } catch (e) { throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${rawAttribute}": ${e instanceof Error ? e.message : e}`, { cause: e }); } if (decodedKey.length > this._MAX_LENGTH) { throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${decodedKey}".`); } if (decodedValue.length > this._MAX_LENGTH) { throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${decodedKey}".`); } attributes[decodedKey] = decodedValue; } return attributes; } } exports.envDetector = new EnvDetector(); //# 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.NoopDetector = NoopDetector; exports.noopDetector = new NoopDetector(); //# sourceMappingURL=NoopDetector.js.map /***/ }), /***/ 24918: /***/ ((__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.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 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 /***/ }), /***/ 3098: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = void 0; /* * Copyright The OpenTelemetry Authors * 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, "osDetector", ({ enumerable: true, get: function () { return node_1.osDetector; } })); Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return node_1.processDetector; } })); Object.defineProperty(exports, "serviceInstanceIdDetector", ({ enumerable: true, get: function () { return node_1.serviceInstanceIdDetector; } })); //# sourceMappingURL=index.js.map /***/ }), /***/ 59251: /***/ ((__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.hostDetector = void 0; 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) { 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(); //# sourceMappingURL=HostDetector.js.map /***/ }), /***/ 58102: /***/ ((__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.osDetector = void 0; 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) { 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(); //# sourceMappingURL=OSDetector.js.map /***/ }), /***/ 62471: /***/ ((__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.processDetector = void 0; 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) { 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(); //# sourceMappingURL=ProcessDetector.js.map /***/ }), /***/ 4663: /***/ ((__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.serviceInstanceIdDetector = void 0; const semconv_1 = __nccwpck_require__(24466); const crypto_1 = __nccwpck_require__(6113); /** * ServiceInstanceIdDetector detects the resources related to the service instance ID. */ class ServiceInstanceIdDetector { detect(_config) { return { attributes: { [semconv_1.ATTR_SERVICE_INSTANCE_ID]: (0, crypto_1.randomUUID)(), }, }; } } /** * @experimental */ exports.serviceInstanceIdDetector = new ServiceInstanceIdDetector(); //# sourceMappingURL=ServiceInstanceIdDetector.js.map /***/ }), /***/ 29920: /***/ ((__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.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 OSDetector_1 = __nccwpck_require__(58102); Object.defineProperty(exports, "osDetector", ({ enumerable: true, get: function () { return OSDetector_1.osDetector; } })); var ProcessDetector_1 = __nccwpck_require__(62471); Object.defineProperty(exports, "processDetector", ({ enumerable: true, get: function () { return ProcessDetector_1.processDetector; } })); var ServiceInstanceIdDetector_1 = __nccwpck_require__(4663); Object.defineProperty(exports, "serviceInstanceIdDetector", ({ enumerable: true, get: function () { return ServiceInstanceIdDetector_1.serviceInstanceIdDetector; } })); //# sourceMappingURL=index.js.map /***/ }), /***/ 11804: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getMachineId = void 0; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ const process = __nccwpck_require__(77282); 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 /***/ }), /***/ 88227: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.normalizeType = exports.normalizeArch = void 0; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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 /***/ }), /***/ 3871: /***/ ((__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.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, "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 /***/ }), /***/ 24466: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ATTR_WEBENGINE_VERSION = exports.ATTR_WEBENGINE_NAME = exports.ATTR_WEBENGINE_DESCRIPTION = exports.ATTR_SERVICE_NAMESPACE = exports.ATTR_SERVICE_INSTANCE_ID = exports.ATTR_PROCESS_RUNTIME_VERSION = exports.ATTR_PROCESS_RUNTIME_NAME = exports.ATTR_PROCESS_RUNTIME_DESCRIPTION = exports.ATTR_PROCESS_PID = exports.ATTR_PROCESS_OWNER = exports.ATTR_PROCESS_EXECUTABLE_PATH = exports.ATTR_PROCESS_EXECUTABLE_NAME = exports.ATTR_PROCESS_COMMAND_ARGS = exports.ATTR_PROCESS_COMMAND = exports.ATTR_OS_VERSION = exports.ATTR_OS_TYPE = exports.ATTR_K8S_POD_NAME = exports.ATTR_K8S_NAMESPACE_NAME = exports.ATTR_K8S_DEPLOYMENT_NAME = exports.ATTR_K8S_CLUSTER_NAME = exports.ATTR_HOST_TYPE = exports.ATTR_HOST_NAME = exports.ATTR_HOST_IMAGE_VERSION = exports.ATTR_HOST_IMAGE_NAME = exports.ATTR_HOST_IMAGE_ID = exports.ATTR_HOST_ID = exports.ATTR_HOST_ARCH = exports.ATTR_CONTAINER_NAME = exports.ATTR_CONTAINER_IMAGE_TAGS = exports.ATTR_CONTAINER_IMAGE_NAME = exports.ATTR_CONTAINER_ID = exports.ATTR_CLOUD_REGION = exports.ATTR_CLOUD_PROVIDER = exports.ATTR_CLOUD_AVAILABILITY_ZONE = exports.ATTR_CLOUD_ACCOUNT_ID = void 0; /* * 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 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 /***/ }), /***/ 44298: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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'); }; exports.isPromiseLike = isPromiseLike; //# sourceMappingURL=utils.js.map /***/ }), /***/ 69453: /***/ ((__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.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); /** * A TracerProvider implementation that reads configuration defaults from * OTEL_* environment variables per * https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ */ class BasicTracerProvider extends sdk_trace_1.TracerProvider { constructor(config = {}) { const mergedConfig = (0, core_1.merge)({}, (0, config_1.loadDefaultConfig)(), (0, utility_1.reconfigureLimits)(config)); delete mergedConfig.generalLimits; super(mergedConfig); } } exports.BasicTracerProvider = BasicTracerProvider; //# sourceMappingURL=BasicTracerProvider-shim.js.map /***/ }), /***/ 19560: /***/ ((__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.BatchSpanProcessor = void 0; const core_1 = __nccwpck_require__(89736); const sdk_trace_1 = __nccwpck_require__(1516); /** * A BatchSpanProcessor that applies `OTEL_*` environment variable fallbacks per * https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ */ class BatchSpanProcessor extends sdk_trace_1.BatchSpanProcessor { constructor(exporter, config) { if (!config) { config = {}; } 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; } } } super({ exporter, ...config }); } } 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); /** * 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. */ class SimpleSpanProcessor extends sdk_trace_1.SimpleSpanProcessor { constructor(exporter) { super({ exporter }); } } exports.SimpleSpanProcessor = SimpleSpanProcessor; //# sourceMappingURL=SimpleSpanProcessor-shim.js.map /***/ }), /***/ 91: /***/ ((__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.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"; TracesSamplerValues["AlwaysOn"] = "always_on"; TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; TracesSamplerValues["TraceIdRatio"] = "traceidratio"; })(TracesSamplerValues || (TracesSamplerValues = {})); const DEFAULT_RATIO = 1; /** * Load default configuration. For fields with primitive values, any user-provided * value will override the corresponding default value. For fields with * non-primitive values (like `spanLimits`), the user-provided value will be * used to extend the default value. */ // 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.loadDefaultConfig = loadDefaultConfig; /** * Based on environment, builds a sampler, complies with specification. */ function buildSamplerFromEnv() { const sampler = (0, core_1.getStringFromEnv)('OTEL_TRACES_SAMPLER') ?? TracesSamplerValues.ParentBasedAlwaysOn; switch (sampler) { case TracesSamplerValues.AlwaysOn: return new sdk_trace_1.AlwaysOnSampler(); case TracesSamplerValues.AlwaysOff: return new sdk_trace_1.AlwaysOffSampler(); case TracesSamplerValues.ParentBasedAlwaysOn: return new sdk_trace_1.ParentBasedSampler({ root: new sdk_trace_1.AlwaysOnSampler(), }); case TracesSamplerValues.ParentBasedAlwaysOff: return new sdk_trace_1.ParentBasedSampler({ root: new sdk_trace_1.AlwaysOffSampler(), }); case TracesSamplerValues.TraceIdRatio: return new sdk_trace_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()); case TracesSamplerValues.ParentBasedTraceIdRatio: return new sdk_trace_1.ParentBasedSampler({ root: new sdk_trace_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()), }); default: api_1.diag.error(`OTEL_TRACES_SAMPLER value "${sampler}" invalid, defaulting to "${TracesSamplerValues.ParentBasedAlwaysOn}".`); return new sdk_trace_1.ParentBasedSampler({ root: new sdk_trace_1.AlwaysOnSampler(), }); } } exports.buildSamplerFromEnv = buildSamplerFromEnv; function getSamplerProbabilityFromEnv() { const probability = (0, core_1.getNumberFromEnv)('OTEL_TRACES_SAMPLER_ARG'); if (probability == null) { api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); return DEFAULT_RATIO; } if (probability < 0 || probability > 1) { api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${probability} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); return DEFAULT_RATIO; } return probability; } //# sourceMappingURL=config.js.map /***/ }), /***/ 88266: /***/ ((__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.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 /***/ }), /***/ 54324: /***/ ((__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.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__(89736); /** * Implementation of the {@link SpanProcessor} that simply forwards all * received events to a list of {@link SpanProcessor}s. */ class MultiSpanProcessor { _spanProcessors; constructor(spanProcessors) { this._spanProcessors = spanProcessors; } forceFlush() { const promises = []; for (const spanProcessor of this._spanProcessors) { promises.push(spanProcessor.forceFlush()); } return new Promise(resolve => { Promise.all(promises) .then(() => { resolve(); }) .catch(error => { (0, core_1.globalErrorHandler)(error || new Error('MultiSpanProcessor: forceFlush failed')); resolve(); }); }); } onStart(span, context) { for (const spanProcessor of this._spanProcessors) { 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); } } 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 /***/ }), /***/ 41584: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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 = SamplingDecision = {})); //# sourceMappingURL=Sampler.js.map /***/ }), /***/ 91816: /***/ ((__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.SpanImpl = 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__(83539); const inspect_1 = __nccwpck_require__(83691); /** * This class represents a 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 SpanImpl instance. */ constructor(opts) { const now = Date.now(); this._spanContext = opts.spanContext; this._performanceStartTime = core_1.otperformance.now(); this._performanceOffset = now - (this._performanceStartTime + core_1.otperformance.timeOrigin); this._startTimeProvided = opts.startTime != null; this._spanLimits = opts.spanLimits; this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit ?? 0; this._spanProcessor = opts.spanProcessor; this.name = opts.name; this.parentSpanContext = opts.parentSpanContext; this.kind = opts.kind; if (opts.links) { for (const link of opts.links) { this.addLink(link); } } this.startTime = this._getTime(opts.startTime ?? now); this.resource = opts.resource; this.instrumentationScope = opts.scope; this._recordEndMetrics = opts.recordEndMetrics; if (opts.attributes != null) { this.setAttributes(opts.attributes); } this._spanProcessor.onStart(this, opts.context); } spanContext() { return this._spanContext; } setAttribute(key, value) { if (value == null || this._isSpanEnded()) return this; if (key.length === 0) { api_1.diag.warn(`Invalid attribute key: ${key}`); return this; } if (!(0, core_1.isAttributeValue)(value)) { api_1.diag.warn(`Invalid attribute value set for key: ${key}`); return this; } const { attributeCountLimit } = this._spanLimits; const isNewKey = !Object.prototype.hasOwnProperty.call(this.attributes, key); if (attributeCountLimit !== 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 key in attributes) { if (Object.prototype.hasOwnProperty.call(attributes, key)) { this.setAttribute(key, attributes[key]); } } return this; } /** * * @param name Span Name * @param [attributesOrStartTime] Span attributes or start time * if type is {@type TimeInput} and 3rd param is undefined * @param [timeStamp] Specified time stamp for the event */ addEvent(name, attributesOrStartTime, timeStamp) { if (this._isSpanEnded()) return this; const { eventCountLimit } = this._spanLimits; if (eventCountLimit === 0) { api_1.diag.warn('No events allowed.'); this._droppedEventsCount++; return this; } if (eventCountLimit !== undefined && this.events.length >= eventCountLimit) { if (this._droppedEventsCount === 0) { api_1.diag.debug('Dropping extra events.'); } this.events.shift(); this._droppedEventsCount++; } if ((0, core_1.isTimeInput)(attributesOrStartTime)) { if (!(0, core_1.isTimeInput)(timeStamp)) { timeStamp = attributesOrStartTime; } attributesOrStartTime = undefined; } 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, }); return this; } addLink(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) { for (const link of links) { this.addLink(link); } return this; } setStatus(status) { if (this._isSpanEnded()) return this; if (status.code === api_1.SpanStatusCode.UNSET) return this; if (this.status.code === api_1.SpanStatusCode.OK) return this; const newStatus = { code: status.code }; // 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 (status.code === api_1.SpanStatusCode.ERROR) { if (typeof status.message === 'string') { newStatus.message = status.message; } else if (status.message != null) { api_1.diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`); } } this.status = newStatus; return this; } updateName(name) { if (this._isSpanEnded()) return this; this.name = name; return this; } end(endTime) { if (this._isSpanEnded()) { api_1.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`); return; } this.endTime = this._getTime(endTime); this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime); if (this._duration[0] < 0) { api_1.diag.warn('Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.', this.startTime, this.endTime); this.endTime = this.startTime.slice(); this._duration = [0, 0]; } if (this._droppedEventsCount > 0) { api_1.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`); } if (this._droppedLinksCount > 0) { api_1.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`); } if (this._spanProcessor.onEnding) { this._spanProcessor.onEnding(this); } this._recordEndMetrics?.(); this._ended = true; this._spanProcessor.onEnd(this); } _getTime(inp) { if (typeof inp === 'number' && inp <= core_1.otperformance.now()) { // 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.ATTR_EXCEPTION_MESSAGE] = exception; } else if (exception) { if (exception.code) { attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.code.toString(); } else if (exception.name) { attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] = exception.name; } if (exception.message) { attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE] = exception.message; } if (exception.stack) { attributes[semantic_conventions_1.ATTR_EXCEPTION_STACKTRACE] = exception.stack; } } // these are minimum requirements from spec if (attributes[semantic_conventions_1.ATTR_EXCEPTION_TYPE] || attributes[semantic_conventions_1.ATTR_EXCEPTION_MESSAGE]) { this.addEvent(enums_1.ExceptionEventName, attributes, time); } else { api_1.diag.warn(`Failed to record an exception ${exception}`); } } get duration() { return this._duration; } get ended() { return this._ended; } get droppedAttributesCount() { return this._droppedAttributesCount; } get droppedEventsCount() { return this._droppedEventsCount; } get droppedLinksCount() { return this._droppedLinksCount; } _isSpanEnded() { if (this._ended) { const error = 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; } // 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; } [inspect_1.inspectCustom](depth, options, inspect) { const payload = { name: this.name, kind: this.kind, spanContext: this._spanContext, parentSpanContext: this.parentSpanContext, status: this.status, startTime: this.startTime, endTime: this.endTime, duration: this._duration, ended: this._ended, attributes: this.attributes, events: this.events, links: this.links, droppedAttributesCount: this._droppedAttributesCount, droppedEventsCount: this._droppedEventsCount, droppedLinksCount: this._droppedLinksCount, instrumentationScope: this.instrumentationScope, resource: { attributes: (0, inspect_1.settledResourceAttributes)(this.resource) }, }; return (0, inspect_1.formatInspect)('SpanImpl', payload, depth, options, inspect); } } exports.SpanImpl = SpanImpl; //# sourceMappingURL=Span.js.map /***/ }), /***/ 80984: /***/ ((__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.Tracer = void 0; const api = __nccwpck_require__(65163); 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(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()) { // 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?.spanContext(); const spanId = this._idGenerator.generateSpanId(); let validParentSpanContext; let traceId; let traceState; if (!parentSpanContext || !api.trace.isSpanContextValid(parentSpanContext)) { // New root span. traceId = this._idGenerator.generateTraceId(); } else { // New child span. traceId = parentSpanContext.traceId; traceState = parentSpanContext.traceState; validParentSpanContext = parentSpanContext; } const spanKind = options.kind ?? api.SpanKind.INTERNAL; const links = (options.links ?? []).map(link => { return { context: link.context, attributes: (0, core_1.sanitizeAttributes)(link.attributes), }; }); const attributes = (0, core_1.sanitizeAttributes)(options.attributes); // make sampling decision const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links); const recordEndMetrics = this._tracerMetrics.startSpan(parentSpanContext, samplingResult.decision); traceState = samplingResult.traceState ?? traceState; const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE; const spanContext = { traceId, spanId, traceFlags, traceState }; if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) { api.diag.debug('Recording is off, propagating context in a non-recording span'); 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.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) { let opts; let ctx; let fn; if (arguments.length < 2) { return; } else if (arguments.length === 2) { fn = arg2; } else if (arguments.length === 3) { opts = arg2; fn = arg3; } else { opts = arg2; ctx = arg3; fn = arg4; } const parentContext = ctx ?? api.context.active(); const span = this.startSpan(name, opts, parentContext); const contextWithSpanSet = api.trace.setSpan(parentContext, span); return api.context.with(contextWithSpanSet, fn, undefined, span); } [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; //# sourceMappingURL=Tracer.js.map /***/ }), /***/ 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 * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.TracerProvider = void 0; const api_1 = __nccwpck_require__(65163); 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 = {})); /** * This class represents a basic tracer provider which platform libraries can extend */ 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); }); }); }); 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.TracerProvider = TracerProvider; //# sourceMappingURL=TracerProvider.js.map /***/ }), /***/ 83539: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ExceptionEventName = void 0; // Event name definitions exports.ExceptionEventName = 'exception'; //# sourceMappingURL=enums.js.map /***/ }), /***/ 32908: /***/ ((__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.BatchSpanProcessorBase = void 0; const api_1 = __nccwpck_require__(65163); 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 { _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) { 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(() => { this._metrics.shutdown(); 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++; this._metrics.dropSpans(1); 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 => { clearTimeout(timer); this._metrics.finishSpans(spans.length, result.error); if (result.code === core_1.ExportResultCode.SUCCESS) { resolve(); } else { reject(result.error ?? new Error('BatchSpanProcessor: span export failed')); } }); let pendingResources = null; for (let i = 0, len = spans.length; i < len; i++) { const span = spans[i]; if (span.resource.asyncAttributesPending && span.resource.waitForAsyncAttributes) { pendingResources ??= []; pendingResources.push(span.resource.waitForAsyncAttributes()); } } // 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); // depending on runtime, this may be a 'number' or NodeJS.Timeout if (typeof this._timer !== 'number') { this._timer.unref(); } } _clearTimer() { if (this._timer !== undefined) { clearTimeout(this._timer); this._timer = undefined; } } } exports.BatchSpanProcessorBase = BatchSpanProcessorBase; //# sourceMappingURL=BatchSpanProcessorBase.js.map /***/ }), /***/ 90599: /***/ ((__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.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) { return { resource: { attributes: span.resource.attributes, }, instrumentationScope: span.instrumentationScope, traceId: span.spanContext().traceId, parentSpanContext: span.parentSpanContext, traceState: span.spanContext().traceState?.serialize(), name: span.name, id: span.spanContext().spanId, kind: span.kind, timestamp: (0, core_1.hrTimeToMicroseconds)(span.startTime), duration: (0, core_1.hrTimeToMicroseconds)(span.duration), attributes: span.attributes, status: span.status, events: span.events, links: span.links, }; } /** * Showing spans in console * @param spans * @param done */ _sendSpans(spans, done) { for (const span of spans) { console.dir(this._exportInfo(span), { depth: 3 }); } if (done) { return done({ code: core_1.ExportResultCode.SUCCESS }); } } } exports.ConsoleSpanExporter = ConsoleSpanExporter; //# sourceMappingURL=ConsoleSpanExporter.js.map /***/ }), /***/ 81231: /***/ ((__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.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 { _finishedSpans = []; /** * Indicates if the exporter has been "shutdown." * When false, exported spans will not be stored in-memory. */ _stopped = false; export(spans, resultCallback) { if (this._stopped) return resultCallback({ code: core_1.ExportResultCode.FAILED, error: 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 /***/ }), /***/ 58929: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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 /***/ }), /***/ 40107: /***/ ((__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 api_1 = __nccwpck_require__(65163); 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. * * 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 { _exporter; _metrics; _shutdownOnce; _pendingExports; constructor(options) { this._exporter = options.exporter; this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); 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() { let pendingExportError; let pendingExportRejected = false; try { await Promise.all(Array.from(this._pendingExports)); } catch (err) { pendingExportError = err; pendingExportRejected = true; } if (this._exporter.forceFlush) { await this._exporter.forceFlush(); } if (pendingExportRejected) { throw pendingExportError; } } onStart(_span, _parentContext) { } onEnd(span) { if (this._shutdownOnce.isCalled) { return; } if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { return; } const pendingExport = this._doExport(span); // 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); }); } async _doExport(span) { if (span.resource.asyncAttributesPending) { // Ensure resource is fully resolved before exporting. await span.resource.waitForAsyncAttributes?.(); } const result = await core_1.internal._export(this._exporter, [span]); this._metrics.finishSpans(1, result.error); if (result.code !== core_1.ExportResultCode.SUCCESS) { throw (result.error ?? new Error(`SimpleSpanProcessor: span export failed (status ${result})`)); } } shutdown() { return this._shutdownOnce.call(); } _shutdown() { this._metrics.shutdown(); return this._exporter.shutdown(); } } exports.SimpleSpanProcessor = SimpleSpanProcessor; //# sourceMappingURL=SimpleSpanProcessor.js.map /***/ }), /***/ 24592: /***/ ((__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.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__(90599); Object.defineProperty(exports, "ConsoleSpanExporter", ({ enumerable: true, get: function () { return ConsoleSpanExporter_1.ConsoleSpanExporter; } })); var InMemorySpanExporter_1 = __nccwpck_require__(81231); Object.defineProperty(exports, "InMemorySpanExporter", ({ enumerable: true, get: function () { return InMemorySpanExporter_1.InMemorySpanExporter; } })); var SimpleSpanProcessor_1 = __nccwpck_require__(40107); Object.defineProperty(exports, "SimpleSpanProcessor", ({ enumerable: true, get: function () { return SimpleSpanProcessor_1.SimpleSpanProcessor; } })); var NoopSpanProcessor_1 = __nccwpck_require__(58929); Object.defineProperty(exports, "NoopSpanProcessor", ({ enumerable: true, get: function () { return NoopSpanProcessor_1.NoopSpanProcessor; } })); var AlwaysOffSampler_1 = __nccwpck_require__(13951); Object.defineProperty(exports, "AlwaysOffSampler", ({ enumerable: true, get: function () { return AlwaysOffSampler_1.AlwaysOffSampler; } })); var AlwaysOnSampler_1 = __nccwpck_require__(43632); Object.defineProperty(exports, "AlwaysOnSampler", ({ enumerable: true, get: function () { return AlwaysOnSampler_1.AlwaysOnSampler; } })); 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__(81419); Object.defineProperty(exports, "TraceIdRatioBasedSampler", ({ enumerable: true, get: function () { return TraceIdRatioBasedSampler_1.TraceIdRatioBasedSampler; } })); var Sampler_1 = __nccwpck_require__(41584); Object.defineProperty(exports, "SamplingDecision", ({ enumerable: true, get: function () { return Sampler_1.SamplingDecision; } })); //# sourceMappingURL=index.js.map /***/ }), /***/ 83691: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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 { /** * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex * characters corresponding to 128 bits. */ generateTraceId = getIdGenerator(TRACE_ID_BYTES); /** * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex * characters corresponding to 64 bits. */ generateSpanId = getIdGenerator(SPAN_ID_BYTES); } exports.RandomIdGenerator = RandomIdGenerator; const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); function getIdGenerator(bytes) { return function generateId() { for (let i = 0; i < bytes / 4; i++) { // 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 /***/ }), /***/ 37085: /***/ ((__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.BatchSpanProcessor = void 0; const BatchSpanProcessorBase_1 = __nccwpck_require__(32908); class BatchSpanProcessor extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { onShutdown() { } } exports.BatchSpanProcessor = BatchSpanProcessor; //# sourceMappingURL=BatchSpanProcessor.js.map /***/ }), /***/ 19921: /***/ ((__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 BatchSpanProcessor_1 = __nccwpck_require__(37085); Object.defineProperty(exports, "BatchSpanProcessor", ({ enumerable: true, get: function () { return BatchSpanProcessor_1.BatchSpanProcessor; } })); var RandomIdGenerator_1 = __nccwpck_require__(94332); Object.defineProperty(exports, "RandomIdGenerator", ({ enumerable: true, get: function () { return RandomIdGenerator_1.RandomIdGenerator; } })); //# sourceMappingURL=index.js.map /***/ }), /***/ 13951: /***/ ((__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.AlwaysOffSampler = void 0; const Sampler_1 = __nccwpck_require__(41584); /** 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 /***/ }), /***/ 43632: /***/ ((__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.AlwaysOnSampler = void 0; const Sampler_1 = __nccwpck_require__(41584); /** 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 /***/ }), /***/ 31841: /***/ ((__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.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__(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) { 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 = config.remoteParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); this._remoteParentNotSampled = config.remoteParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); this._localParentSampled = config.localParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler(); this._localParentNotSampled = config.localParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler(); } shouldSample(context, traceId, spanName, spanKind, attributes, links) { const parentContext = api_1.trace.getSpanContext(context); if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) { return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); } if (parentContext.isRemote) { if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); } return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); } if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); } return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); } toString() { return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; } } exports.ParentBasedSampler = ParentBasedSampler; //# sourceMappingURL=ParentBasedSampler.js.map /***/ }), /***/ 81419: /***/ ((__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.TraceIdRatioBasedSampler = void 0; const api_1 = __nccwpck_require__(65163); const Sampler_1 = __nccwpck_require__(41584); /** Sampler that samples a given fraction of traces based of trace id deterministically. */ class TraceIdRatioBasedSampler { _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 { decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound ? Sampler_1.SamplingDecision.RECORD_AND_SAMPLED : Sampler_1.SamplingDecision.NOT_RECORD, }; } toString() { return `TraceIdRatioBased{${this._ratio}}`; } _normalize(ratio) { if (typeof ratio !== 'number' || isNaN(ratio)) return 0; return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; } _accumulate(traceId) { let accumulation = 0; for (let i = 0; i < 32; i += 8) { let part = 0; for (let j = 0; j < 8; j++) { const c = traceId.charCodeAt(i + j); // 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; } } exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; //# sourceMappingURL=TraceIdRatioBasedSampler.js.map /***/ }), /***/ 89064: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); 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 /***/ }), /***/ 93195: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * 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 = '2.10.0'; //# sourceMappingURL=version.js.map /***/ }), /***/ 67275: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = 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]; })); 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__(45836), exports); __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 /***/ }), /***/ 749: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ 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 /***/ }), /***/ 85003: /***/ ((__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.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__(749); //---------------------------------------------------------------------------------------------------------- // 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_CLOUD_PROVIDER = TMP_CLOUD_PROVIDER; /** * The cloud account ID the resource is assigned to. * * @deprecated Use ATTR_CLOUD_ACCOUNT_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_AWS_ECS_TASK_FAMILY = TMP_AWS_ECS_TASK_FAMILY; /** * The revision for this task definition. * * @deprecated Use ATTR_AWS_ECS_TASK_REVISION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_AWS_ECS_TASK_REVISION = TMP_AWS_ECS_TASK_REVISION; /** * The ARN of an EKS cluster. * * @deprecated Use ATTR_AWS_EKS_CLUSTER_ARN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_AWS_LOG_STREAM_ARNS = TMP_AWS_LOG_STREAM_ARNS; /** * Container name. * * @deprecated Use ATTR_CONTAINER_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_CONTAINER_ID = TMP_CONTAINER_ID; /** * The container runtime managing this container. * * @deprecated Use ATTR_CONTAINER_RUNTIME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_CONTAINER_RUNTIME = TMP_CONTAINER_RUNTIME; /** * Name of the image the container was built on. * * @deprecated Use ATTR_CONTAINER_IMAGE_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_CONTAINER_IMAGE_NAME = TMP_CONTAINER_IMAGE_NAME; /** * Container image tag. * * @deprecated Use ATTR_CONTAINER_IMAGE_TAGS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_CLOUD_RESOURCE_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_HOST_NAME = TMP_HOST_NAME; /** * Type of host. For Cloud, this must be the machine type. * * @deprecated Use ATTR_HOST_TYPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_HOST_TYPE = TMP_HOST_TYPE; /** * The CPU architecture the host system is running on. * * @deprecated Use ATTR_HOST_ARCH in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_HOST_IMAGE_VERSION = TMP_HOST_IMAGE_VERSION; /** * The name of the cluster. * * @deprecated Use ATTR_K8S_CLUSTER_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_CLUSTER_NAME = TMP_K8S_CLUSTER_NAME; /** * The name of the Node. * * @deprecated Use ATTR_K8S_NODE_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_NODE_NAME = TMP_K8S_NODE_NAME; /** * The UID of the Node. * * @deprecated Use ATTR_K8S_NODE_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_NAMESPACE_NAME = TMP_K8S_NAMESPACE_NAME; /** * The UID of the Pod. * * @deprecated Use ATTR_K8S_POD_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_POD_UID = TMP_K8S_POD_UID; /** * The name of the Pod. * * @deprecated Use ATTR_K8S_POD_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_POD_NAME = TMP_K8S_POD_NAME; /** * The name of the Container in a Pod template. * * @deprecated Use ATTR_K8S_CONTAINER_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_CONTAINER_NAME = TMP_K8S_CONTAINER_NAME; /** * The UID of the ReplicaSet. * * @deprecated Use ATTR_K8S_REPLICASET_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_REPLICASET_UID = TMP_K8S_REPLICASET_UID; /** * The name of the ReplicaSet. * * @deprecated Use ATTR_K8S_REPLICASET_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_REPLICASET_NAME = TMP_K8S_REPLICASET_NAME; /** * The UID of the Deployment. * * @deprecated Use ATTR_K8S_DEPLOYMENT_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_DEPLOYMENT_UID = TMP_K8S_DEPLOYMENT_UID; /** * The name of the Deployment. * * @deprecated Use ATTR_K8S_DEPLOYMENT_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_DEPLOYMENT_NAME = TMP_K8S_DEPLOYMENT_NAME; /** * The UID of the StatefulSet. * * @deprecated Use ATTR_K8S_STATEFULSET_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_STATEFULSET_UID = TMP_K8S_STATEFULSET_UID; /** * The name of the StatefulSet. * * @deprecated Use ATTR_K8S_STATEFULSET_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_STATEFULSET_NAME = TMP_K8S_STATEFULSET_NAME; /** * The UID of the DaemonSet. * * @deprecated Use ATTR_K8S_DAEMONSET_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_DAEMONSET_UID = TMP_K8S_DAEMONSET_UID; /** * The name of the DaemonSet. * * @deprecated Use ATTR_K8S_DAEMONSET_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_DAEMONSET_NAME = TMP_K8S_DAEMONSET_NAME; /** * The UID of the Job. * * @deprecated Use ATTR_K8S_JOB_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_JOB_UID = TMP_K8S_JOB_UID; /** * The name of the Job. * * @deprecated Use ATTR_K8S_JOB_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_JOB_NAME = TMP_K8S_JOB_NAME; /** * The UID of the CronJob. * * @deprecated Use ATTR_K8S_CRONJOB_UID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_CRONJOB_UID = TMP_K8S_CRONJOB_UID; /** * The name of the CronJob. * * @deprecated Use ATTR_K8S_CRONJOB_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_K8S_CRONJOB_NAME = TMP_K8S_CRONJOB_NAME; /** * The operating system type. * * @deprecated Use ATTR_OS_TYPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_OS_DESCRIPTION = TMP_OS_DESCRIPTION; /** * Human readable operating system name. * * @deprecated Use ATTR_OS_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_OS_VERSION = TMP_OS_VERSION; /** * Process identifier (PID). * * @deprecated Use ATTR_PROCESS_PID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_PROCESS_COMMAND_ARGS = TMP_PROCESS_COMMAND_ARGS; /** * The username of the user that owns the process. * * @deprecated Use ATTR_PROCESS_OWNER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_DISTRO_VERSION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_TELEMETRY_AUTO_VERSION = TMP_TELEMETRY_AUTO_VERSION; /** * The name of the web engine. * * @deprecated Use ATTR_WEBENGINE_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMRESATTRS_WEBENGINE_NAME = TMP_WEBENGINE_NAME; /** * The version of the web engine. * * @deprecated Use ATTR_WEBENGINE_VERSION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.CLOUDPROVIDERVALUES_ALIBABA_CLOUD = TMP_CLOUDPROVIDERVALUES_ALIBABA_CLOUD; /** * Name of the cloud provider. * * @deprecated Use CLOUD_PROVIDER_VALUE_AWS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.CLOUDPROVIDERVALUES_AWS = TMP_CLOUDPROVIDERVALUES_AWS; /** * Name of the cloud provider. * * @deprecated Use CLOUD_PROVIDER_VALUE_AZURE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.CLOUDPROVIDERVALUES_AZURE = TMP_CLOUDPROVIDERVALUES_AZURE; /** * Name of the cloud provider. * * @deprecated Use CLOUD_PROVIDER_VALUE_GCP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.HOSTARCHVALUES_AMD64 = TMP_HOSTARCHVALUES_AMD64; /** * The CPU architecture the host system is running on. * * @deprecated Use HOST_ARCH_VALUE_ARM32 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.HOSTARCHVALUES_ARM32 = TMP_HOSTARCHVALUES_ARM32; /** * The CPU architecture the host system is running on. * * @deprecated Use HOST_ARCH_VALUE_ARM64 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.HOSTARCHVALUES_ARM64 = TMP_HOSTARCHVALUES_ARM64; /** * The CPU architecture the host system is running on. * * @deprecated Use HOST_ARCH_VALUE_IA64 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.HOSTARCHVALUES_IA64 = TMP_HOSTARCHVALUES_IA64; /** * The CPU architecture the host system is running on. * * @deprecated Use HOST_ARCH_VALUE_PPC32 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.HOSTARCHVALUES_PPC32 = TMP_HOSTARCHVALUES_PPC32; /** * The CPU architecture the host system is running on. * * @deprecated Use HOST_ARCH_VALUE_PPC64 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.HOSTARCHVALUES_PPC64 = TMP_HOSTARCHVALUES_PPC64; /** * The CPU architecture the host system is running on. * * @deprecated Use HOST_ARCH_VALUE_X86 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.OSTYPEVALUES_WINDOWS = TMP_OSTYPEVALUES_WINDOWS; /** * The operating system type. * * @deprecated Use OS_TYPE_VALUE_LINUX in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.OSTYPEVALUES_LINUX = TMP_OSTYPEVALUES_LINUX; /** * The operating system type. * * @deprecated Use OS_TYPE_VALUE_DARWIN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.OSTYPEVALUES_DARWIN = TMP_OSTYPEVALUES_DARWIN; /** * The operating system type. * * @deprecated Use OS_TYPE_VALUE_FREEBSD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.OSTYPEVALUES_FREEBSD = TMP_OSTYPEVALUES_FREEBSD; /** * The operating system type. * * @deprecated Use OS_TYPE_VALUE_NETBSD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.OSTYPEVALUES_NETBSD = TMP_OSTYPEVALUES_NETBSD; /** * The operating system type. * * @deprecated Use OS_TYPE_VALUE_OPENBSD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.OSTYPEVALUES_OPENBSD = TMP_OSTYPEVALUES_OPENBSD; /** * The operating system type. * * @deprecated Use OS_TYPE_VALUE_DRAGONFLYBSD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.OSTYPEVALUES_DRAGONFLYBSD = TMP_OSTYPEVALUES_DRAGONFLYBSD; /** * The operating system type. * * @deprecated Use OS_TYPE_VALUE_HPUX in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.OSTYPEVALUES_HPUX = TMP_OSTYPEVALUES_HPUX; /** * The operating system type. * * @deprecated Use OS_TYPE_VALUE_AIX in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.OSTYPEVALUES_AIX = TMP_OSTYPEVALUES_AIX; /** * The operating system type. * * @deprecated Use OS_TYPE_VALUE_SOLARIS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.OSTYPEVALUES_SOLARIS = TMP_OSTYPEVALUES_SOLARIS; /** * The operating system type. * * @deprecated Use OS_TYPE_VALUE_Z_OS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 /***/ }), /***/ 2834: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = 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]; })); 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__(85003), exports); //# sourceMappingURL=index.js.map /***/ }), /***/ 69301: /***/ ((__unused_webpack_module, exports) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); 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 //---------------------------------------------------------------------------------------------------------- /** * 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}. * * 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}. * * 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}. * * 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}. * * 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. * * @example fixed * @example sliding * @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. * * @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}. * * Match failed */ exports.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = "failure"; /** * 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. * * @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'; /** * 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. * * @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. * * 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. * 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 RPC 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}. * * A fallback error value to be used when the instrumentation doesn't define a custom value. */ exports.ERROR_TYPE_VALUE_OTHER = "_OTHER"; /** * Indicates that the exception is escaping the scope of the span. * * @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'; /** * The exception message. * * @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'; /** * 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)\\n" */ 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 * * @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 ["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. * * 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; /** * 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), * 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. * * * 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. * 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}. * * 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}. * * CONNECT method. */ exports.HTTP_REQUEST_METHOD_VALUE_CONNECT = "CONNECT"; /** * 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}. * * GET method. */ exports.HTTP_REQUEST_METHOD_VALUE_GET = "GET"; /** * 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}. * * OPTIONS method. */ exports.HTTP_REQUEST_METHOD_VALUE_OPTIONS = "OPTIONS"; /** * 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}. * * POST method. */ exports.HTTP_REQUEST_METHOD_VALUE_POST = "POST"; /** * 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}. * * TRACE 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 ["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. * * 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` 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; /** * [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 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 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'; /** * 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}. * * Heap memory. */ exports.JVM_MEMORY_TYPE_VALUE_HEAP = "heap"; /** * 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. */ 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}. * * 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}. * * 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}. * * 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}. * * 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}. * * 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}. * * 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. * * @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://wikipedia.org/wiki/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://wikipedia.org/wiki/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}. * * Named or anonymous pipe. */ exports.NETWORK_TRANSPORT_VALUE_PIPE = "pipe"; /** * 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}. * * TCP */ exports.NETWORK_TRANSPORT_VALUE_TCP = "tcp"; /** * 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}. * * Unix domain socket */ exports.NETWORK_TRANSPORT_VALUE_UNIX = "unix"; /** * [OSI network layer](https://wikipedia.org/wiki/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}. * * IPv4 */ exports.NETWORK_TYPE_VALUE_IPV4 = "ipv4"; /** * 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). * * @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}. * * The operation contains an error. */ exports.OTEL_STATUS_CODE_VALUE_ERROR = "ERROR"; /** * 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. * * @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'; /** * 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 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'; /** * 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 */ 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}. * * 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}. * * The connection was closed normally. */ exports.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = "normal_closure"; /** * 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) * * @example web_sockets * @example long_polling */ exports.ATTR_SIGNALR_TRANSPORT = '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}. * * ServerSentEvents protocol */ exports.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = "server_sent_events"; /** * 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 * * @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. * * * 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'; /** * 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. * * * 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'; /** * 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 /***/ }), /***/ 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) => { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ Object.defineProperty(exports, "__esModule", ({ value: true })); 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 //---------------------------------------------------------------------------------------------------------- /** * 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 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. */ 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 /***/ }), /***/ 89943: /***/ ((__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.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__(749); //---------------------------------------------------------------------------------------------------------- // 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_DB_CONNECTION_STRING = TMP_DB_CONNECTION_STRING; /** * Username for accessing the database. * * @deprecated Use ATTR_DB_USER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_DB_CASSANDRA_TABLE = TMP_DB_CASSANDRA_TABLE; /** * Whether or not the query is idempotent. * * @deprecated Use ATTR_DB_CASSANDRA_IDEMPOTENCE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_FAAS_TRIGGER = TMP_FAAS_TRIGGER; /** * The execution ID of the current function execution. * * @deprecated Use ATTR_FAAS_INVOCATION_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_FAAS_INVOKED_REGION = TMP_FAAS_INVOKED_REGION; /** * Transport protocol used. See note below. * * @deprecated Use ATTR_NET_TRANSPORT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_NET_PEER_IP = TMP_NET_PEER_IP; /** * Remote port number. * * @deprecated Use ATTR_NET_PEER_PORT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_NET_PEER_PORT = TMP_NET_PEER_PORT; /** * Remote hostname or similar, see note below. * * @deprecated Use ATTR_NET_PEER_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_NET_HOST_IP = TMP_NET_HOST_IP; /** * Like `net.peer.port` but for the host port. * * @deprecated Use ATTR_NET_HOST_PORT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_NET_HOST_PORT = TMP_NET_HOST_PORT; /** * Local hostname or similar, see note below. * * @deprecated Use ATTR_NET_HOST_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_NET_HOST_NAME = TMP_NET_HOST_NAME; /** * The internet connection type currently being used by the host. * * @deprecated Use ATTR_NETWORK_CONNECTION_TYPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_NETWORK_CONNECTION_SUBTYPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE = TMP_NET_HOST_CONNECTION_SUBTYPE; /** * The name of the mobile carrier. * * @deprecated Use ATTR_NETWORK_CARRIER_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_NET_HOST_CARRIER_NAME = TMP_NET_HOST_CARRIER_NAME; /** * The mobile carrier country code. * * @deprecated Use ATTR_NETWORK_CARRIER_MCC in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_NET_HOST_CARRIER_MCC = TMP_NET_HOST_CARRIER_MCC; /** * The mobile carrier network code. * * @deprecated Use ATTR_NETWORK_CARRIER_MNC in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_NETWORK_CARRIER_ICC in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_ENDUSER_SCOPE = TMP_ENDUSER_SCOPE; /** * Current "managed" thread ID (as opposed to OS thread ID). * * @deprecated Use ATTR_THREAD_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_THREAD_ID = TMP_THREAD_ID; /** * Current thread name. * * @deprecated Use ATTR_THREAD_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_CODE_LINENO = TMP_CODE_LINENO; /** * HTTP request method. * * @deprecated Use ATTR_HTTP_METHOD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_HTTP_HOST = TMP_HTTP_HOST; /** * The URI scheme identifying the used protocol. * * @deprecated Use ATTR_HTTP_SCHEME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_HTTP_CLIENT_IP = TMP_HTTP_CLIENT_IP; /** * The keys in the `RequestItems` object field. * * @deprecated Use ATTR_AWS_DYNAMODB_TABLE_NAMES in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ = TMP_AWS_DYNAMODB_CONSISTENT_READ; /** * The value of the `ProjectionExpression` request parameter. * * @deprecated Use ATTR_AWS_DYNAMODB_PROJECTION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_AWS_DYNAMODB_PROJECTION = TMP_AWS_DYNAMODB_PROJECTION; /** * The value of the `Limit` request parameter. * * @deprecated Use ATTR_AWS_DYNAMODB_LIMIT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_AWS_DYNAMODB_LIMIT = TMP_AWS_DYNAMODB_LIMIT; /** * The value of the `AttributesToGet` request parameter. * * @deprecated Use ATTR_AWS_DYNAMODB_ATTRIBUTES_TO_GET in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_AWS_DYNAMODB_INDEX_NAME = TMP_AWS_DYNAMODB_INDEX_NAME; /** * The value of the `Select` request parameter. * * @deprecated Use ATTR_AWS_DYNAMODB_SELECT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD = TMP_AWS_DYNAMODB_SCAN_FORWARD; /** * The value of the `Segment` request parameter. * * @deprecated Use ATTR_AWS_DYNAMODB_SEGMENT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_AWS_DYNAMODB_SEGMENT = TMP_AWS_DYNAMODB_SEGMENT; /** * The value of the `TotalSegments` request parameter. * * @deprecated Use ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS = TMP_AWS_DYNAMODB_TOTAL_SEGMENTS; /** * The value of the `Count` response parameter. * * @deprecated Use ATTR_AWS_DYNAMODB_COUNT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_AWS_DYNAMODB_COUNT = TMP_AWS_DYNAMODB_COUNT; /** * The value of the `ScannedCount` response parameter. * * @deprecated Use ATTR_AWS_DYNAMODB_SCANNED_COUNT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_MESSAGING_DESTINATION = TMP_MESSAGING_DESTINATION; /** * The kind of message destination. * * @deprecated Removed in semconv v1.20.0. */ exports.SEMATTRS_MESSAGING_DESTINATION_KIND = TMP_MESSAGING_DESTINATION_KIND; /** * A boolean that is true if the message destination is temporary. * * @deprecated Use ATTR_MESSAGING_DESTINATION_TEMPORARY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_MESSAGING_TEMP_DESTINATION = TMP_MESSAGING_TEMP_DESTINATION; /** * The name of the transport protocol. * * @deprecated Use ATTR_NETWORK_PROTOCOL_NAME. */ exports.SEMATTRS_MESSAGING_PROTOCOL = TMP_MESSAGING_PROTOCOL; /** * The version of the transport protocol. * * @deprecated Use ATTR_NETWORK_PROTOCOL_VERSION. */ exports.SEMATTRS_MESSAGING_PROTOCOL_VERSION = TMP_MESSAGING_PROTOCOL_VERSION; /** * Connection string. * * @deprecated Removed in semconv v1.17.0. */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_MESSAGE_CONVERSATION_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_BODY_SIZE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES = TMP_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES; /** * The compressed size of the message payload in bytes. * * @deprecated Removed in semconv v1.22.0. */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 Removed in semconv v1.21.0. */ exports.SEMATTRS_MESSAGING_CONSUMER_ID = TMP_MESSAGING_CONSUMER_ID; /** * RabbitMQ message routing key. * * @deprecated Use ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_CLIENT_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID = TMP_MESSAGING_KAFKA_CLIENT_ID; /** * Partition the message is sent to. * * @deprecated Use ATTR_MESSAGING_KAFKA_DESTINATION_PARTITION in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_MESSAGE_TOMBSTONE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE = TMP_MESSAGING_KAFKA_TOMBSTONE; /** * A string identifying the remoting system. * * @deprecated Use ATTR_RPC_SYSTEM in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE = TMP_RPC_JSONRPC_ERROR_MESSAGE; /** * Whether this is a received or sent message. * * @deprecated Use ATTR_MESSAGE_TYPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_MESSAGE_ID = TMP_MESSAGE_ID; /** * Compressed size of the message in bytes. * * @deprecated Use ATTR_MESSAGE_COMPRESSED_SIZE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.SEMATTRS_MESSAGE_COMPRESSED_SIZE = TMP_MESSAGE_COMPRESSED_SIZE; /** * Uncompressed size of the message in bytes. * * @deprecated Use ATTR_MESSAGE_UNCOMPRESSED_SIZE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.FAASTRIGGERVALUES_DATASOURCE = TMP_FAASTRIGGERVALUES_DATASOURCE; /** * Type of the trigger on which the function is executed. * * @deprecated Use FAAS_TRIGGER_VALUE_HTTP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.FAASTRIGGERVALUES_HTTP = TMP_FAASTRIGGERVALUES_HTTP; /** * Type of the trigger on which the function is executed. * * @deprecated Use FAAS_TRIGGER_VALUE_PUBSUB in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.FAASTRIGGERVALUES_PUBSUB = TMP_FAASTRIGGERVALUES_PUBSUB; /** * Type of the trigger on which the function is executed. * * @deprecated Use FAAS_TRIGGER_VALUE_TIMER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.FAASTRIGGERVALUES_TIMER = TMP_FAASTRIGGERVALUES_TIMER; /** * Type of the trigger on which the function is executed. * * @deprecated Use FAAS_TRIGGER_VALUE_OTHER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.NETTRANSPORTVALUES_IP_TCP = TMP_NETTRANSPORTVALUES_IP_TCP; /** * Transport protocol used. See note below. * * @deprecated Use NET_TRANSPORT_VALUE_IP_UDP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.NETTRANSPORTVALUES_IP_UDP = TMP_NETTRANSPORTVALUES_IP_UDP; /** * Transport protocol used. See note below. * * @deprecated Removed in v1.21.0. */ exports.NETTRANSPORTVALUES_IP = TMP_NETTRANSPORTVALUES_IP; /** * Transport protocol used. See note below. * * @deprecated Removed in v1.21.0. */ exports.NETTRANSPORTVALUES_UNIX = TMP_NETTRANSPORTVALUES_UNIX; /** * Transport protocol used. See note below. * * @deprecated Use NET_TRANSPORT_VALUE_PIPE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.NETTRANSPORTVALUES_PIPE = TMP_NETTRANSPORTVALUES_PIPE; /** * Transport protocol used. See note below. * * @deprecated Use NET_TRANSPORT_VALUE_INPROC in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.NETTRANSPORTVALUES_INPROC = TMP_NETTRANSPORTVALUES_INPROC; /** * Transport protocol used. See note below. * * @deprecated Use NET_TRANSPORT_VALUE_OTHER in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_TYPE_VALUE_WIFI in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.NETHOSTCONNECTIONTYPEVALUES_WIFI = TMP_NETHOSTCONNECTIONTYPEVALUES_WIFI; /** * The internet connection type currently being used by the host. * * @deprecated Use NETWORK_CONNECTION_TYPE_VALUE_WIRED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.NETHOSTCONNECTIONTYPEVALUES_WIRED = TMP_NETHOSTCONNECTIONTYPEVALUES_WIRED; /** * The internet connection type currently being used by the host. * * @deprecated Use NETWORK_CONNECTION_TYPE_VALUE_CELL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.NETHOSTCONNECTIONTYPEVALUES_CELL = TMP_NETHOSTCONNECTIONTYPEVALUES_CELL; /** * The internet connection type currently being used by the host. * * @deprecated Use NETWORK_CONNECTION_TYPE_VALUE_UNAVAILABLE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE = TMP_NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE; /** * The internet connection type currently being used by the host. * * @deprecated Use NETWORK_CONNECTION_TYPE_VALUE_UNKNOWN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_GPRS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_EDGE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_UMTS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_0 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_A in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_CDMA2000_1XRTT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_HSDPA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_HSUPA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_HSPA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_IDEN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_EVDO_B in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_LTE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_EHRPD in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_HSPAP in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_GSM in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_TD_SCDMA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_IWLAN in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_NR in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_NRNSA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 NETWORK_CONNECTION_SUBTYPE_VALUE_LTE_CA in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 Removed in semconv v1.20.0. */ exports.MESSAGINGDESTINATIONKINDVALUES_QUEUE = TMP_MESSAGINGDESTINATIONKINDVALUES_QUEUE; /** * The kind of message destination. * * @deprecated Removed in semconv v1.20.0. */ 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_TYPE_VALUE_RECEIVE in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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_TYPE_VALUE_PROCESS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ exports.MESSAGETYPEVALUES_SENT = TMP_MESSAGETYPEVALUES_SENT; /** * Whether this is a received or sent message. * * @deprecated Use MESSAGE_TYPE_VALUE_RECEIVED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}). */ 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 /***/ }), /***/ 45836: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = 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]; })); 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__(89943), exports); //# sourceMappingURL=index.js.map /***/ }), /***/ 88563: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const dsn = __nccwpck_require__(91582); 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/`; } function _getIngestEndpoint(dsn) { return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`; } function _encodedAuth(dsn, sdkInfo) { const params = { sentry_version: SENTRY_API_VERSION }; if (dsn.publicKey) { params.sentry_key = dsn.publicKey; } if (sdkInfo) { params.sentry_client = `${sdkInfo.name}/${sdkInfo.version}`; } return new URLSearchParams(params).toString(); } function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) { return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`; } function getReportDialogEndpoint(dsnLike, dialogOptions) { const dsn$1 = dsn.makeDsn(dsnLike); if (!dsn$1) { return ""; } const endpoint = `${getBaseApiEndpoint(dsn$1)}embed/error-page/`; let encodedOptions = `dsn=${dsn.dsnToString(dsn$1)}`; for (const key in dialogOptions) { if (key === "dsn") { continue; } if (key === "onClose") { continue; } if (key === "user") { const user = dialogOptions.user; if (!user) { continue; } if (user.name) { encodedOptions += `&name=${encodeURIComponent(user.name)}`; } if (user.email) { encodedOptions += `&email=${encodeURIComponent(user.email)}`; } } else { 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 /***/ }), /***/ 29878: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const carrier = __nccwpck_require__(38080); const stackStrategy = __nccwpck_require__(88484); function setAsyncContextStrategy(strategy) { const registry = carrier.getMainCarrier(); const sentry = carrier.getSentryCarrier(registry); sentry.acs = strategy; } function getAsyncContextStrategy(carrier$1) { const sentry = carrier.getSentryCarrier(carrier$1); if (sentry.acs) { return sentry.acs; } return stackStrategy.getStackAsyncContextStrategy(); } exports.getAsyncContextStrategy = getAsyncContextStrategy; exports.setAsyncContextStrategy = setAsyncContextStrategy; //# sourceMappingURL=index.js.map /***/ }), /***/ 88484: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const defaultScopes = __nccwpck_require__(80496); const scope = __nccwpck_require__(49417); const chainAndCopyPromiselike = __nccwpck_require__(8438); const is = __nccwpck_require__(68370); const carrier = __nccwpck_require__(38080); class AsyncContextStack { 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; } this._stack = [{ scope: assignedScope }]; this._isolationScope = assignedIsolationScope; } /** * Fork a scope for the stack. */ withScope(callback) { const scope = this._pushScope(); let maybePromiseResult; try { maybePromiseResult = callback(scope); } catch (e) { this._popScope(); throw e; } if (is.isThenable(maybePromiseResult)) { return chainAndCopyPromiselike.chainAndCopyPromiseLike( maybePromiseResult, () => this._popScope(), () => this._popScope() ); } this._popScope(); return maybePromiseResult; } /** * Get the client of the stack. */ getClient() { return this.getStackTop().client; } /** * Returns the scope of the top stack. */ getScope() { return this.getStackTop().scope; } /** * Get the isolation scope for the stack. */ getIsolationScope() { return this._isolationScope; } /** * Returns the topmost scope layer in the order domain > local > process. */ getStackTop() { return this._stack[this._stack.length - 1]; } /** * Push a scope to the stack. */ _pushScope() { const scope = this.getScope().clone(); this._stack.push({ client: this.getClient(), scope }); return scope; } /** * Pop a scope from the stack. */ _popScope() { if (this._stack.length <= 1) return false; return !!this._stack.pop(); } } function getAsyncContextStack() { const registry = carrier.getMainCarrier(); const sentry = carrier.getSentryCarrier(registry); 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(); return stack.withScope(() => { stack.getStackTop().scope = scope; return callback(scope); }); } function withIsolationScope(callback) { return getAsyncContextStack().withScope(() => { return callback(getAsyncContextStack().getIsolationScope()); }); } function getStackAsyncContextStrategy() { return { withIsolationScope, withScope, withSetScope, withSetIsolationScope: (_isolationScope, callback) => { return withIsolationScope(callback); }, getCurrentScope: () => getAsyncContextStack().getScope(), getIsolationScope: () => getAsyncContextStack().getIsolationScope() }; } exports.AsyncContextStack = AsyncContextStack; exports.getStackAsyncContextStrategy = getStackAsyncContextStrategy; //# sourceMappingURL=stackStrategy.js.map /***/ }), /***/ 50098: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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 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."; 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) { 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 && 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 : void 0 ); this._transport = options.transport({ tunnel: this._options.tunnel, recordDroppedEvent: this.recordDroppedEvent.bind(this), ...options.transportOptions, url }); } 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 ); } } /** * 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) { const eventId = misc.uuid4(); if (misc.checkOrSetAlreadyCaught(exception)) { debugBuild.DEBUG_BUILD && debugLogger.debug.log(ALREADY_SEEN_ERROR); return eventId; } const hintWithEventId = { event_id: eventId, ...hint }; this._process( () => this.eventFromException(exception, hintWithEventId).then((event) => this._captureEvent(event, hintWithEventId, scope)).then((res) => res), "error" ); return hintWithEventId.event_id; } /** * 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) { const hintWithEventId = { event_id: misc.uuid4(), ...hint }; const eventMessage = is.isParameterizedString(message) ? message : String(message); 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; } /** * 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) { const eventId = misc.uuid4(); if (hint?.originalException && misc.checkOrSetAlreadyCaught(hint.originalException)) { debugBuild.DEBUG_BUILD && debugLogger.debug.log(ALREADY_SEEN_ERROR); return eventId; } const hintWithEventId = { event_id: eventId, ...hint }; const sdkProcessingMetadata = event.sdkProcessingMetadata || {}; const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope; const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope; const dataCategory = getDataCategoryByType(event.type); this._process( () => this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope, capturedSpanIsolationScope), dataCategory ); return hintWithEventId.event_id; } /** * Captures a session. */ captureSession(session$1) { this.sendSession(session$1); session.updateSession(session$1, { init: false }); } /** * Get the current Dsn. */ getDsn() { return this._dsn; } /** * Get the current options. */ getOptions() { return this._options; } /** * Get the resolved data collection configuration. */ getDataCollectionOptions() { return this._dataCollection; } /** * Get the SDK metadata. * @see SdkMetadata */ getSdkMetadata() { return this._options._metadata; } /** * 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() { return this._transport; } /** * 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. */ // @ts-expect-error - PromiseLike is a subset of Promise async flush(timeout) { const transport = this._transport; this.emit("flush"); if (!transport) { return true; } const clientFinished = await this._isClientDoneProcessing(timeout); const transportFlushed = await transport.flush(timeout); return clientFinished && transportFlushed; } /** * 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. */ // @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() { return this._eventProcessors; } /** * Adds an event processor that applies to any event processed by this client. */ addEventProcessor(eventProcessor) { this._eventProcessors.push(eventProcessor); } /** * 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 {Integration|undefined} The installed integration or `undefined` if no integration with that `name` was installed. */ getIntegrationByName(integrationName) { return this._integrations[integrationName]; } /** * Returns the names of all installed integrations. */ 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]; if (!isAlreadyInstalled && integration$1.beforeSetup) { integration$1.beforeSetup(this); } integration.setupIntegration(this, integration$1, this._integrations); if (!isAlreadyInstalled) { integration.afterSetupIntegrations(this, [integration$1]); } } /** * Send a fully prepared event to Sentry. */ 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)); } if (genAiSpanItem) { env = envelope$1.addItemToEnvelope(env, genAiSpanItem); } this.sendEnvelope(env).then((sendResponse) => this.emit("afterSendEvent", event, sendResponse)); } /** * Send a session or session aggregrates to Sentry. */ 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); this.sendEnvelope(env); } /** * Record on the client that an event got dropped (ie, an event that will not be sent to Sentry). */ recordDroppedEvent(reason, category, count = 1) { if (this._options.sendClientReports) { const key = `${reason}:${category}`; debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Recording outcome: "${key}"${count > 1 ? ` (${count} times)` : ""}`); this._outcomes[key] = (this._outcomes[key] || 0) + count; } } /** * 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 () => { hookCallbacks.delete(uniqueCallback); }; } /** * Emit a hook that was previously registered via `on()`. */ emit(hook, ...rest) { const callbacks = this._hooks[hook]; if (callbacks) { callbacks.forEach((callback) => callback(...rest)); } } /** * Send an envelope to Sentry. */ // @ts-expect-error - PromiseLike is a subset of Promise async sendEnvelope(envelope) { this.emit("beforeEnvelope", envelope); if (this._isEnabled() && this._transport) { try { return await this._transport.send(envelope); } catch (reason) { debugBuild.DEBUG_BUILD && debugLogger.debug.error("Error while sending envelope:", reason); return {}; } } 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() { 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"; let errored = false; const exceptions = event.exception?.values; if (exceptions) { errored = true; crashed = false; for (const ex of exceptions) { if (ex.mechanism?.handled === false) { crashed = true; break; } } } 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) }); 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. * * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to * `true`. * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and * `false` otherwise */ 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 !== void 0; } /** * 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 currentScope A scope containing event metadata. * @returns A new event with more information. */ _prepareEvent(event, hint, currentScope, isolationScope) { const options = this.getOptions(); const integrations = this.getIntegrationNames(); if (!hint.integrations && integrations.length) { hint.integrations = integrations; } 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) => { if (evt === null) { return evt; } this.emit("postprocessEvent", evt, hint); 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 }; return evt; }); } /** * Processes the event and logs an error in case of rejection * @param event * @param hint * @param scope */ _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) => { if (debugBuild.DEBUG_BUILD) { if (_isDoNotSendEventError(reason)) { debugLogger.debug.log(reason.message); } else if (_isInternalError(reason)) { debugLogger.debug.warn(reason.message); } else { debugLogger.debug.warn(reason); } } return void 0; } ); } /** * Processes an event (either error or message) and sends it to Sentry. * * This also adds breadcrumbs and context information to the event. However, * platform specific meta data (such as the User's IP address) must be added * by the SDK implementor. * * * @param event The event to send to Sentry. * @param hint May contain additional information about the original exception. * @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, isolationScope) { const options = this.getOptions(); const { sampleRate } = options; const isTransaction = isTransactionEvent(event); const isError = isErrorEvent(event); const eventType = event.type || "error"; const beforeSendLabel = `before send for type \`${eventType}\``; 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 spans = event.spans || []; const spanCount = 1 + spans.length; this.recordDroppedEvent("before_send", "span", spanCount); } 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(taskProducer, dataCategory) { this._numProcessing++; void this._promiseBuffer.add(taskProducer).then( (value) => { this._numProcessing--; return value; }, (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() { const outcomes = this._outcomes; this._outcomes = {}; return Object.entries(outcomes).map(([key, quantity]) => { const [reason, category] = key.split(":"); return { reason, category, quantity }; }); } /** * Sends client reports as an envelope. */ _flushOutcomes() { debugBuild.DEBUG_BUILD && debugLogger.debug.log("Flushing outcomes..."); const outcomes = this._clearOutcomes(); if (outcomes.length === 0) { debugBuild.DEBUG_BUILD && debugLogger.debug.log("No outcomes to send"); return; } if (!this._dsn) { debugBuild.DEBUG_BUILD && debugLogger.debug.log("No dsn provided, will not send outcomes"); return; } debugBuild.DEBUG_BUILD && debugLogger.debug.log("Sending outcomes:", outcomes); const envelope = clientreport.createClientReportEnvelope(outcomes, this._options.tunnel && dsn.dsnToString(this._dsn)); this.sendEnvelope(envelope); } } 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) => { if (!is.isPlainObject(event) && event !== null) { throw _makeInternalError(invalidValueError); } return event; }, (e) => { throw _makeInternalError(`${beforeSendLabel} rejected with ${e}`); } ); } else if (!is.isPlainObject(beforeSendResult) && beforeSendResult !== null) { throw _makeInternalError(invalidValueError); } return beforeSendResult; } 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(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(); } else { processedEvent = merge.merge(event, transactionEvent.convertSpanJsonToTransactionEvent(processedRootSpanJson)); } } 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 (processedEvent.spans) { const spanCountBefore = processedEvent.spans.length; processedEvent.sdkProcessingMetadata = { ...event.sdkProcessingMetadata, spanCountBeforeProcessing: spanCountBefore }; } return beforeSendTransaction(processedEvent, hint); } } return processedEvent; } function isErrorEvent(event) { return event.type === void 0; } function isTransactionEvent(event) { return event.type === "transaction"; } function estimateMetricSizeInBytes(metric) { let weight = 0; if (metric.name) { weight += metric.name.length * 2; } weight += 8; return weight + estimateAttributesSizeInBytes(metric.attributes); } function estimateLogSizeInBytes(log) { let weight = 0; if (log.message) { weight += log.message.length * 2; } return weight + estimateAttributesSizeInBytes(log.attributes); } function estimateAttributesSizeInBytes(attributes) { if (!attributes) { return 0; } 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; } return 0; } exports.Client = Client; //# sourceMappingURL=client.js.map /***/ }), /***/ 5958: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const DEFAULT_ENVIRONMENT = "production"; const DEV_ENVIRONMENT = "development"; exports.DEFAULT_ENVIRONMENT = DEFAULT_ENVIRONMENT; exports.DEV_ENVIRONMENT = DEV_ENVIRONMENT; //# sourceMappingURL=constants.js.map /***/ }), /***/ 8131: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const index = __nccwpck_require__(29878); const carrier = __nccwpck_require__(38080); const scope = __nccwpck_require__(49417); const propagationContext = __nccwpck_require__(95102); 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(); } function getIsolationScope() { const carrier$1 = carrier.getMainCarrier(); const acs = index.getAsyncContextStrategy(carrier$1); return acs.getIsolationScope(); } function getGlobalScope() { return carrier.getGlobalSingleton("globalScope", () => new scope.Scope()); } function withScope(...rest) { const carrier$1 = carrier.getMainCarrier(); const acs = index.getAsyncContextStrategy(carrier$1); if (rest.length === 2) { const [scope, callback] = rest; if (!scope) { return acs.withScope(callback); } return acs.withSetScope(scope, callback); } return acs.withScope(rest[0]); } function withIsolationScope(...rest) { const carrier$1 = carrier.getMainCarrier(); const acs = index.getAsyncContextStrategy(carrier$1); if (rest.length === 2) { const [isolationScope, callback] = rest; if (!isolationScope) { return acs.withIsolationScope(callback); } return acs.withSetIsolationScope(isolationScope, callback); } return acs.withIsolationScope(rest[0]); } function getClient() { return getCurrentScope().getClient(); } function getTraceContextFromScope(scope) { 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: 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 /***/ }), /***/ 14488: /***/ ((__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 /***/ }), /***/ 80496: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const carrier = __nccwpck_require__(38080); const scope = __nccwpck_require__(49417); function getDefaultCurrentScope() { return carrier.getGlobalSingleton("defaultCurrentScope", () => new scope.Scope()); } function getDefaultIsolationScope() { return carrier.getGlobalSingleton("defaultIsolationScope", () => new scope.Scope()); } exports.getDefaultCurrentScope = getDefaultCurrentScope; exports.getDefaultIsolationScope = getDefaultIsolationScope; //# sourceMappingURL=defaultScopes.js.map /***/ }), /***/ 58784: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const dynamicSamplingContext = __nccwpck_require__(29724); 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); function _enhanceEventWithSdkInfo(event, newSdkInfo) { if (!newSdkInfo) { return event; } 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; } function createSessionEnvelope(session, dsn$1, metadata, tunnel) { const sdkInfo = envelope.getSdkMetadataForEnvelopeHeader(metadata); const envelopeHeaders = { 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()]; return envelope.createEnvelope(envelopeHeaders, [envelopeItem]); } function createEventEnvelope(event, dsn, metadata, tunnel) { const sdkInfo = envelope.getSdkMetadataForEnvelopeHeader(metadata); const eventType = event.type && event.type !== "replay_event" ? event.type : "event"; _enhanceEventWithSdkInfo(event, metadata?.sdk); const envelopeHeaders = envelope.createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn); delete event.sdkProcessingMetadata; const eventItem = [{ type: eventType }, event]; return envelope.createEnvelope(envelopeHeaders, [eventItem]); } function createSpanEnvelope(spans, client) { function dscHasRequiredProps(dsc2) { return !!dsc2.trace_id && !!dsc2.public_key; } const dsc = dynamicSamplingContext.getDynamicSamplingContextFromSpan(spans[0]); const dsn$1 = client?.getDsn(); const tunnel = client?.getOptions().tunnel; const headers = { sent_at: new Date(randomSafeContext.safeDateNow()).toISOString(), ...dscHasRequiredProps(dsc) && { trace: dsc }, ...!!tunnel && dsn$1 && { dsn: dsn.dsnToString(dsn$1) } }; 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 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; //# sourceMappingURL=envelope.js.map /***/ }), /***/ 45796: /***/ ((__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 syncpromise = __nccwpck_require__(56291); 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; //# sourceMappingURL=eventProcessors.js.map /***/ }), /***/ 10779: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); const session = __nccwpck_require__(60233); 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); function captureException(exception, hint) { return currentScopes.getCurrentScope().captureException(exception, prepareEvent.parseEventHintOrCaptureContext(hint)); } function captureMessage(message, captureContext) { const level = typeof captureContext === "string" ? captureContext : void 0; const hint = typeof captureContext !== "string" ? { captureContext } : void 0; return currentScopes.getCurrentScope().captureMessage(message, level, hint); } function captureEvent(event, hint) { return currentScopes.getCurrentScope().captureEvent(event, hint); } function setContext(name, context) { currentScopes.getIsolationScope().setContext(name, context); } function setExtras(extras) { currentScopes.getIsolationScope().setExtras(extras); } function setExtra(key, extra) { currentScopes.getIsolationScope().setExtra(key, extra); } function setTags(tags) { currentScopes.getIsolationScope().setTags(tags); } function setTag(key, value) { currentScopes.getIsolationScope().setTag(key, value); } function setAttributes(attributes) { currentScopes.getIsolationScope().setAttributes(attributes); } function setAttribute(key, value) { currentScopes.getIsolationScope().setAttribute(key, value); } function setUser(user) { currentScopes.getIsolationScope().setUser(user); } function setConversationId(conversationId) { currentScopes.getIsolationScope().setConversationId(conversationId); } function lastEventId() { return currentScopes.getIsolationScope().lastEventId(); } function captureCheckIn(checkIn, upsertMonitorConfig) { const scope = currentScopes.getCurrentScope(); const client = currentScopes.getClient(); if (!client) { debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Cannot capture check-in. No client defined."); } else if (!client.captureCheckIn) { 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(); } 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"); throw e; } if (is.isThenable(maybePromiseResult)) { return maybePromiseResult.then( (r) => { finishCheckIn("ok"); return r; }, (e) => { finishCheckIn("error"); throw e; } ); } finishCheckIn("ok"); return maybePromiseResult; } return currentScopes.withIsolationScope(() => upsertMonitorConfig?.isolateTrace ? trace.startNewTrace(runCallback) : runCallback()); } async function flush(timeout) { const client = currentScopes.getClient(); if (client) { return client.flush(timeout); } debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Cannot flush events. No client defined."); return Promise.resolve(false); } async function close(timeout) { const client = currentScopes.getClient(); if (client) { return client.close(timeout); } debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Cannot flush events and disable SDK. No client defined."); return Promise.resolve(false); } function isInitialized() { return !!currentScopes.getClient(); } function isEnabled() { const client = currentScopes.getClient(); return client?.getOptions().enabled !== false && !!client?.getTransport(); } function addEventProcessor(callback) { currentScopes.getIsolationScope().addEventProcessor(callback); } function startSession(context) { const isolationScope = currentScopes.getIsolationScope(); const { user } = scopeData.getCombinedScopeData(isolationScope, currentScopes.getCurrentScope()); const { userAgent } = worldwide.GLOBAL_OBJ.navigator || {}; const session$1 = session.makeSession({ user, ...userAgent && { userAgent }, ...context }); const currentSession = isolationScope.getSession(); if (currentSession?.status === "ok") { session.updateSession(currentSession, { status: "exited" }); } endSession(); isolationScope.setSession(session$1); return session$1; } 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(); isolationScope.setSession(); } function _sendSessionUpdate() { const isolationScope = currentScopes.getIsolationScope(); const client = currentScopes.getClient(); const session = isolationScope.getSession(); if (session && client) { client.captureSession(session); } } function captureSession(end = false) { if (end) { endSession(); return; } _sendSessionUpdate(); } exports.addEventProcessor = addEventProcessor; exports.captureCheckIn = captureCheckIn; exports.captureEvent = captureEvent; exports.captureException = captureException; exports.captureMessage = captureMessage; exports.captureSession = captureSession; exports.close = close; exports.endSession = endSession; 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; exports.setTags = setTags; exports.setUser = setUser; exports.startSession = startSession; exports.withMonitor = withMonitor; //# sourceMappingURL=exports.js.map /***/ }), /***/ 66883: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); function captureFeedback(params, hint = {}, scope = currentScopes.getCurrentScope()) { const { message, name, email, url, source, associatedEventId, tags } = params; const feedbackEvent = { contexts: { feedback: { contact_email: email, name, message, url, source, associated_event_id: associatedEventId } }, type: "feedback", level: "info", tags }; const client = scope?.getClient() || currentScopes.getClient(); if (client) { client.emit("beforeSendFeedback", feedbackEvent, hint); } const eventId = scope.captureEvent(feedbackEvent, hint); return eventId; } exports.captureFeedback = captureFeedback; //# sourceMappingURL=feedback.js.map /***/ }), /***/ 17808: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const attributes = __nccwpck_require__(88264); const currentScopes = __nccwpck_require__(8131); const semanticAttributes = __nccwpck_require__(36827); const spanUtils = __nccwpck_require__(47569); 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); function instrumentFetchRequest(handlerData, shouldCreateSpan, shouldAttachHeaders, spans, spanOriginOrOptions) { if (!handlerData.fetchData) { return void 0; } const { method, url } = handlerData.fetchData; const shouldCreateSpanResult = hasSpansEnabled.hasSpansEnabled() && shouldCreateSpan(url); if (handlerData.endTimestamp) { const spanId = handlerData.fetchData.__span; if (!spanId) return; const span2 = spans[spanId]; if (span2) { if (shouldCreateSpanResult) { endSpan(span2, handlerData); _callOnRequestSpanEnd(span2, handlerData, spanOriginOrOptions); } delete spans[spanId]; } return void 0; } const { spanOrigin = "auto.http.browser", propagateTraceparent = false } = typeof spanOriginOrOptions === "object" ? spanOriginOrOptions : { spanOrigin: spanOriginOrOptions }; const client = currentScopes.getClient(); const hasParent = !!spanUtils.getActiveSpan(); 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 = _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 hasSpansEnabled.hasSpansEnabled() && shouldEmitSpan ? spanForTraceHeaders : void 0, propagateTraceparent ); if (headers) { 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; } 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; const traceparent = traceHeaders.traceparent; if (!sentryTrace) { return void 0; } 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) { newHeaders.set("baggage", baggage); } else if (!baggageHeaderHasSentryBaggageValues(prevBaggageHeader)) { newHeaders.set("baggage", `${prevBaggageHeader},${baggage}`); } } return newHeaders; } else if (isHeadersInitTupleArray(originalHeaders)) { const newHeaders = [...originalHeaders]; if (!newHeaders.find((header) => header[0] === "sentry-trace")) { newHeaders.push(["sentry-trace", sentryTrace]); } 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 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); } const newHeaders = Object.assign({}, originalHeaders, { "sentry-trace": existingSentryTraceHeader ?? sentryTrace, ...newBaggageHeaders.length > 0 && { baggage: newBaggageHeaders.join(",") } }); if (propagateTraceparent && traceparent && !existingTraceparentHeader) { newHeaders.traceparent = traceparent; } return newHeaders; } } function endSpan(span, handlerData) { if (handlerData.response) { spanstatus.setHttpStatus(span, handlerData.response.status); const contentLength = handlerData.response?.headers?.get("content-length"); if (contentLength) { const contentLengthNum = parseInt(contentLength); if (contentLengthNum > 0) { span.setAttribute("http.response_content_length", contentLengthNum); } } } else if (handlerData.error) { span.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); } span.end(); } 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 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 { name: `${method} ${sanitizedUrl}`, attributes: getFetchSpanAttributes(url$1, parsedUrl, method, spanOrigin) }; } 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._INTERNAL_getTracingHeadersForFetchRequest = _INTERNAL_getTracingHeadersForFetchRequest; exports._callOnRequestSpanEnd = _callOnRequestSpanEnd; exports.instrumentFetchRequest = instrumentFetchRequest; //# sourceMappingURL=fetch.js.map /***/ }), /***/ 84466: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const errors = __nccwpck_require__(21834); 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$1 = __nccwpck_require__(58784); const exports$1 = __nccwpck_require__(10779); const currentScopes = __nccwpck_require__(8131); const defaultScopes = __nccwpck_require__(80496); const index$7 = __nccwpck_require__(29878); const tracingChannelBinding = __nccwpck_require__(50098); const carrier = __nccwpck_require__(38080); const session = __nccwpck_require__(60233); const scope = __nccwpck_require__(49417); const eventProcessors = __nccwpck_require__(45796); const api = __nccwpck_require__(88563); 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 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 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 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 eventFilters = __nccwpck_require__(34568); const linkederrors = __nccwpck_require__(90529); const moduleMetadata = __nccwpck_require__(3390); const requestdata = __nccwpck_require__(71679); const captureconsole = __nccwpck_require__(25821); const dedupe = __nccwpck_require__(96514); const extraerrordata = __nccwpck_require__(88764); const rewriteframes = __nccwpck_require__(94102); const supabase = __nccwpck_require__(98283); const zoderrors = __nccwpck_require__(55472); const thirdPartyErrorsFilter = __nccwpck_require__(86140); 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 fetch = __nccwpck_require__(17808); const feedback = __nccwpck_require__(66883); 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$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; exports.spanToBaggageHeader = dynamicSamplingContext.spanToBaggageHeader; exports.setMeasurement = measurement.setMeasurement; 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; exports.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = semanticAttributes.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME; 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.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; exports.captureException = exports$1.captureException; exports.captureMessage = exports$1.captureMessage; exports.captureSession = exports$1.captureSession; exports.close = exports$1.close; exports.endSession = exports$1.endSession; 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; exports.setTags = exports$1.setTags; exports.setUser = exports$1.setUser; 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.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.Scope = scope.Scope; exports.notifyEventProcessors = eventProcessors.notifyEventProcessors; exports.SENTRY_API_VERSION = api.SENTRY_API_VERSION; exports.getEnvelopeEndpointWithUrlEncodedAuth = api.getEnvelopeEndpointWithUrlEncodedAuth; exports.getReportDialogEndpoint = api.getReportDialogEndpoint; 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.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.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.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.eventFiltersIntegration = eventFilters.eventFiltersIntegration; exports.inboundFiltersIntegration = eventFilters.inboundFiltersIntegration; exports.linkedErrorsIntegration = linkederrors.linkedErrorsIntegration; exports.moduleMetadataIntegration = moduleMetadata.moduleMetadataIntegration; exports.requestDataIntegration = requestdata.requestDataIntegration; exports.captureConsoleIntegration = captureconsole.captureConsoleIntegration; exports.dedupeIntegration = dedupe.dedupeIntegration; exports.extraErrorDataIntegration = extraerrordata.extraErrorDataIntegration; exports.rewriteFramesIntegration = rewriteframes.rewriteFramesIntegration; exports.instrumentSupabaseClient = supabase.instrumentSupabaseClient; exports.supabaseIntegration = supabase.supabaseIntegration; exports.zodErrorsIntegration = zoderrors.zodErrorsIntegration; exports.thirdPartyErrorFilterIntegration = thirdPartyErrorsFilter.thirdPartyErrorFilterIntegration; exports.consoleIntegration = console$1.consoleIntegration; exports.featureFlagsIntegration = featureFlagsIntegration.featureFlagsIntegration; exports.growthbookIntegration = growthbook.growthbookIntegration; exports.conversationIdIntegration = conversationId.conversationIdIntegration; exports.profiler = profiling.profiler; exports._INTERNAL_getTracingHeadersForFetchRequest = fetch._INTERNAL_getTracingHeadersForFetchRequest; exports.instrumentFetchRequest = fetch.instrumentFetchRequest; exports.captureFeedback = feedback.captureFeedback; 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.getBreadcrumbLogLevelFromHttpStatusCode = breadcrumbLogLevel.getBreadcrumbLogLevelFromHttpStatusCode; exports.dsnFromString = dsn.dsnFromString; exports.dsnToString = dsn.dsnToString; exports.makeDsn = dsn.makeDsn; exports.SentryError = error.SentryError; exports.GLOBAL_OBJ = worldwide.GLOBAL_OBJ; exports.addConsoleInstrumentationFilter = console.addConsoleInstrumentationFilter; exports.addConsoleInstrumentationHandler = console.addConsoleInstrumentationHandler; exports.addFetchEndInstrumentationHandler = fetch$1.addFetchEndInstrumentationHandler; exports.addFetchInstrumentationHandler = fetch$1.addFetchInstrumentationHandler; exports.addGlobalErrorInstrumentationHandler = globalError.addGlobalErrorInstrumentationHandler; exports.addGlobalUnhandledRejectionInstrumentationHandler = globalUnhandledRejection.addGlobalUnhandledRejectionInstrumentationHandler; exports.addHandler = handlers.addHandler; exports.maybeInstrument = handlers.maybeInstrument; exports.resetInstrumentationHandlers = handlers.resetInstrumentationHandlers; exports.triggerHandlers = handlers.triggerHandlers; exports.isDOMError = is.isDOMError; exports.isDOMException = is.isDOMException; exports.isElement = is.isElement; 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; exports.isRegExp = is.isRegExp; exports.isString = is.isString; exports.isSyntheticEvent = is.isSyntheticEvent; exports.isThenable = is.isThenable; exports.isVueViewModel = is.isVueViewModel; exports.isBrowser = isBrowser.isBrowser; 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.checkOrSetAlreadyCaught = misc.checkOrSetAlreadyCaught; exports.getEventDescription = misc.getEventDescription; exports.isAlreadyCaptured = misc.isAlreadyCaptured; exports.parseSemver = misc.parseSemver; exports.uuid4 = misc.uuid4; 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; exports.extractExceptionKeysForMessage = object.extractExceptionKeysForMessage; exports.fill = object.fill; exports.getOriginalFunction = object.getOriginalFunction; exports.markFunctionWrapped = object.markFunctionWrapped; exports.objectify = object.objectify; exports.basename = path.basename; exports.dirname = path.dirname; exports.isAbsolute = path.isAbsolute; 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.severityLevelFromString = severity.severityLevelFromString; 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.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; 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.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.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.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._INTERNAL_enhanceErrorWithSentryInfo = eventbuilder._enhanceErrorWithSentryInfo; exports.eventFromMessage = eventbuilder.eventFromMessage; exports.eventFromUnknownInput = eventbuilder.eventFromUnknownInput; exports.exceptionFromError = eventbuilder.exceptionFromError; exports.parseStackFrames = eventbuilder.parseStackFrames; exports.LRUMap = lru.LRUMap; exports.generateSpanId = propagationContext.generateSpanId; exports.generateTraceId = propagationContext.generateTraceId; exports.SDK_VERSION = version.SDK_VERSION; exports.getDebugImagesForResources = debugIds.getDebugImagesForResources; exports.getFilenameToDebugIdMap = debugIds.getFilenameToDebugIdMap; exports.getFilenameToMetadataMap = metadata.getFilenameToMetadataMap; exports.escapeStringForRegex = escapeStringForRegex.escapeStringForRegex; 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, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); const debugLogger = __nccwpck_require__(41772); const installedIntegrations = []; function filterDuplicates(integrations) { const integrationsByName = {}; integrations.forEach((currentInstance) => { const { name } = currentInstance; const existingInstance = integrationsByName[name]; if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) { return; } integrationsByName[name] = currentInstance; }); return Object.values(integrationsByName); } function getIntegrationsToSetup(options) { const defaultIntegrations = options.defaultIntegrations || []; const userIntegrations = options.integrations; defaultIntegrations.forEach((integration) => { integration.isDefaultInstance = true; }); let integrations; if (Array.isArray(userIntegrations)) { integrations = [...defaultIntegrations, ...userIntegrations]; } else if (typeof userIntegrations === "function") { const resolvedUserIntegrations = userIntegrations(defaultIntegrations); integrations = Array.isArray(resolvedUserIntegrations) ? resolvedUserIntegrations : [resolvedUserIntegrations]; } else { integrations = defaultIntegrations; } return filterDuplicates(integrations); } function setupIntegrations(client, integrations) { const integrationIndex = {}; integrations.forEach((integration) => { if (integration?.beforeSetup) { integration.beforeSetup(client); } }); integrations.forEach((integration) => { if (integration) { setupIntegration(client, integration, integrationIndex); } }); return integrationIndex; } function afterSetupIntegrations(client, integrations) { for (const integration of integrations) { if (integration?.afterAllSetup) { integration.afterAllSetup(client); } } } function setupIntegration(client, integration, integrationIndex) { if (integrationIndex[integration.name]) { debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Integration skipped because it was already installed: ${integration.name}`); return; } integrationIndex[integration.name] = integration; if (!installedIntegrations.includes(integration.name) && typeof integration.setupOnce === "function") { integration.setupOnce(); installedIntegrations.push(integration.name); } 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.processEvent === "function") { const callback = integration.processEvent.bind(integration); const processor = Object.assign((event, hint) => callback(event, hint, client), { id: integration.name }); client.addEventProcessor(processor); } ["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}`); } function addIntegration(integration) { const client = currentScopes.getClient(); if (!client) { debugBuild.DEBUG_BUILD && debugLogger.debug.warn(`Cannot add integration "${integration.name}" because no SDK Client is available.`); return; } client.addIntegration(integration); } 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; exports.setupIntegrations = setupIntegrations; //# sourceMappingURL=integration.js.map /***/ }), /***/ 25821: /***/ ((__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 console = __nccwpck_require__(98510); const integration = __nccwpck_require__(67428); 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 || debugLogger.CONSOLE_LEVELS; const handled = options.handled ?? true; return { name: INTEGRATION_NAME, setup(client) { if (!("console" in worldwide.GLOBAL_OBJ)) { return; } console.addConsoleInstrumentationHandler(({ args, level }) => { if (currentScopes.getClient() !== client || !levels.includes(level)) { return; } consoleHandler(args, level, handled); }); } }; }); 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 } }; currentScopes.withScope((scope) => { scope.addEventProcessor((event) => { event.logger = "console"; misc.addExceptionMechanism(event, { handled, type: "auto.core.capture_console" }); return event; }); if (level === "assert") { if (!args[0]) { 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); if (error) { exports$1.captureException(error, captureContext); return; } const message = string.safeJoin(args, " "); scope.captureMessage(message, severityLevel, { captureContext, syntheticException }); }); } exports.captureConsoleIntegration = captureConsoleIntegration; //# sourceMappingURL=captureconsole.js.map /***/ }), /***/ 25173: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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 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) { const unsubscribe = console.addConsoleInstrumentationHandler(({ args, level }) => { if (currentScopes.getClient() !== client || !levels.has(level)) { return; } 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, " "); } exports.addConsoleBreadcrumb = addConsoleBreadcrumb; exports.consoleIntegration = consoleIntegration; //# sourceMappingURL=console.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 /***/ }), /***/ 96514: /***/ ((__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 stacktrace = __nccwpck_require__(22902); const INTEGRATION_NAME = "Dedupe"; const _dedupeIntegration = (() => { let previousEvent; return { name: INTEGRATION_NAME, processEvent(currentEvent) { if (currentEvent.type) { return currentEvent; } try { if (_shouldDropEvent(currentEvent, previousEvent)) { debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Event dropped due to being a duplicate of previously captured event."); return null; } } catch { } return previousEvent = currentEvent; } }; }); const dedupeIntegration = integration.defineIntegration(_dedupeIntegration); 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 (!currentMessage && !previousMessage) { return false; } 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 (!currentFrames && !previousFrames) { return true; } if (currentFrames && !previousFrames || !currentFrames && previousFrames) { return false; } currentFrames = currentFrames; previousFrames = previousFrames; if (previousFrames.length !== currentFrames.length) { return false; } for (let i = 0; i < previousFrames.length; i++) { const frameA = previousFrames[i]; const frameB = currentFrames[i]; 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 (!currentFingerprint && !previousFingerprint) { return true; } if (currentFingerprint && !previousFingerprint || !currentFingerprint && previousFingerprint) { return false; } currentFingerprint = currentFingerprint; previousFingerprint = previousFingerprint; try { return !!(currentFingerprint.join("") === previousFingerprint.join("")); } catch { return false; } } function _getExceptionFromEvent(event) { return event.exception?.values?.[0]; } exports._shouldDropEvent = _shouldDropEvent; 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, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); 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"; const _extraErrorDataIntegration = ((options = {}) => { const { depth = 3, captureErrorCause = true } = options; return { name: INTEGRATION_NAME, processEvent(event, hint, client) { const { maxValueLength } = client.getOptions(); return _enhanceEventWithErrorData(event, hint, depth, captureErrorCause, maxValueLength); } }; }); const extraErrorDataIntegration = integration.defineIntegration(_extraErrorDataIntegration); 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); if (errorData) { const contexts = { ...event.contexts }; const normalizedErrorData = normalize.normalize(errorData, depth); if (is.isPlainObject(normalizedErrorData)) { normalizationHints.setSkipNormalizationHint(normalizedErrorData); contexts[exceptionName] = normalizedErrorData; } return { ...event, contexts }; } return event; } function _extractErrorData(error, captureErrorCause, maxValueLength) { try { const nativeKeys = [ "name", "message", "stack", "line", "column", "fileName", "lineNumber", "columnNumber", "toJSON" ]; const extraErrorInfo = {}; 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" ? maxValueLength ? string.truncate(`${value}`, maxValueLength) : `${value}` : value; } 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; } } 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 && debugLogger.debug.error("Unable to extract extra data from the Error object:", oO); } return null; } 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, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const integration = __nccwpck_require__(67428); const object = __nccwpck_require__(5906); const INTEGRATION_NAME = "FunctionToString"; const SETUP_CLIENTS = /* @__PURE__ */ new WeakMap(); const _functionToStringIntegration = (() => { return { name: INTEGRATION_NAME, setupOnce() { const originalFunctionToString = Function.prototype.toString; try { Function.prototype.toString = function(...args) { const originalFunction = object.getOriginalFunction(this); let unwrappedFunction; try { if (SETUP_CLIENTS.has(currentScopes.getClient()) && originalFunction !== void 0) { unwrappedFunction = originalFunction; } } catch { } return originalFunctionToString.apply(unwrappedFunction ?? this, args); }; } catch { } }, setup(client) { SETUP_CLIENTS.set(client, true); } }; }); const functionToStringIntegration = integration.defineIntegration(_functionToStringIntegration); exports.functionToStringIntegration = functionToStringIntegration; //# sourceMappingURL=functiontostring.js.map /***/ }), /***/ 2492: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const breadcrumbs = __nccwpck_require__(5608); const breadcrumbLogLevel = __nccwpck_require__(12297); const url = __nccwpck_require__(78253); const getRequestUrl = __nccwpck_require__(51462); 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 }, { event: "response", request, response } ); } 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 /***/ }), /***/ 90529: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const integration = __nccwpck_require__(67428); const aggregateErrors = __nccwpck_require__(70277); const eventbuilder = __nccwpck_require__(16273); const DEFAULT_KEY = "cause"; const DEFAULT_LIMIT = 5; 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 options2 = client.getOptions(); aggregateErrors.applyAggregateErrorsToEvent(eventbuilder.exceptionFromError, options2.stackParser, key, limit, event, hint); } }; }); const linkedErrorsIntegration = integration.defineIntegration(_linkedErrorsIntegration); exports.linkedErrorsIntegration = linkedErrorsIntegration; //# sourceMappingURL=linkederrors.js.map /***/ }), /***/ 27940: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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__(56987); const moduleMetadataIntegration = integration.defineIntegration(() => { return { name: "ModuleMetadata", setup(client) { client.on("beforeEnvelope", (envelope$1) => { envelope.forEachEnvelopeItem(envelope$1, (item, type) => { if (type === "event") { const event = Array.isArray(item) ? item[1] : void 0; if (event) { metadata.stripMetadataFromStackFrames(event); item[1] = event; } } }); }); client.on("applyFrameMetadata", (event) => { if (event.type) { return; } const stackParser = client.getOptions().stackParser; metadata.addMetadataToStackFrames(stackParser, event); }); } }; }); exports.moduleMetadataIntegration = moduleMetadataIntegration; //# 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, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const integration = __nccwpck_require__(67428); 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 = {}) => { 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, _hint, client) { const { sdkProcessingMetadata = {} } = event; const { normalizedRequest, ipAddress } = sdkProcessingMetadata; const { include } = resolveIncludeAndDataCollection(client); if (normalizedRequest) { addNormalizedRequestDataToEvent(event, normalizedRequest, { ipAddress }, include); } 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); } }; }); const requestDataIntegration = integration.defineIntegration(_requestDataIntegration); 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 }; } } } 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]; } } } } 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; //# sourceMappingURL=requestdata.js.map /***/ }), /***/ 94102: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const integration = __nccwpck_require__(67428); const path = __nccwpck_require__(82426); const worldwide = __nccwpck_require__(90935); 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; const iteratee = options.iteratee || generateIteratee({ isBrowser, root, prefix }); function _processExceptionsEvent(event) { try { return { ...event, exception: { ...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) => ({ ...value, ...value.stacktrace && { stacktrace: _processStacktrace(value.stacktrace) } })) } }; } catch { return event; } } function _processStacktrace(stacktrace) { return { ...stacktrace, 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; } }; }); function generateIteratee({ isBrowser, root, prefix }) { return (frame) => { if (!frame.filename) { return frame; } 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; if (oldFilename.indexOf(root) === 0) { frame.filename = oldFilename.replace(root, prefix); } } } else { if (isWindowsFrame || startsWithSlash) { 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; }; } exports.generateIteratee = generateIteratee; exports.rewriteFramesIntegration = rewriteFramesIntegration; //# sourceMappingURL=rewriteframes.js.map /***/ }), /***/ 9869: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); const integration = __nccwpck_require__(67428); 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: "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)); }); } }; }); exports.spanStreamingIntegration = spanStreamingIntegration; //# sourceMappingURL=spanStreaming.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 /***/ }), /***/ 86140: /***/ ((__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__(56987); const stacktrace = __nccwpck_require__(22902); const worldwide = __nccwpck_require__(90935); const thirdPartyErrorFilterIntegration = integration.defineIntegration((options) => { return { name: "ThirdPartyErrorsFilter", setup(client) { client.on("beforeEnvelope", (envelope$1) => { envelope.forEachEnvelopeItem(envelope$1, (item, type) => { if (type === "event") { const event = Array.isArray(item) ? item[1] : void 0; if (event) { metadata.stripMetadataFromStackFrames(event); item[1] = event; } } }); }); 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 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))); if (behaviourApplies) { 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 }; } } } return event; } }; }); function isSentryInternalFrame(frame, frameIndex, insideSentryWrapped) { if (frameIndex !== 0) { return false; } 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; } 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 /***/ }), /***/ 55472: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const integration = __nccwpck_require__(67428); const is = __nccwpck_require__(68370); const string = __nccwpck_require__(77673); const DEFAULT_LIMIT = 10; const INTEGRATION_NAME = "ZodErrors"; function originalExceptionIsZodError(originalException) { return is.isError(originalException) && originalException.name === "ZodError" && Array.isArray(originalException.issues); } function flattenIssue(issue) { return { ...issue, 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 }; } function flattenIssuePath(path) { return path.map((p) => { if (typeof p === "number") { return ""; } else { return p; } }).join("."); } function formatIssueMessage(zodError) { 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) { let rootExpectedType = "variable"; if (zodError.issues.length > 0) { const iss = zodError.issues[0]; 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)}`; } 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 flattenedIssues = issuesToFlatten.map(flattenIssue); if (saveZodIssuesAsAttachment) { if (!Array.isArray(hint.attachments)) { hint.attachments = []; } hint.attachments.push({ filename: "zod_issues.json", data: JSON.stringify({ issues: flattenedIssues }) }); } return { ...event, exception: { ...event.exception, values: [ { ...event.exception.values[0], value: formatIssueMessage(hint.originalException) }, ...event.exception.values.slice(1) ] }, extra: { ...event.extra, "zoderror.issues": flattenedIssues.slice(0, limit) } }; } catch (e) { 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} ${e.stack}` : "unknown" } } }; } } const _zodErrorsIntegration = ((options = {}) => { const limit = options.limit ?? DEFAULT_LIMIT; return { name: INTEGRATION_NAME, processEvent(originalEvent, hint) { const processedEvent = applyZodErrorsToEvent(limit, options.saveZodIssuesAsAttachment, originalEvent, hint); return processedEvent; } }; }); const zodErrorsIntegration = integration.defineIntegration(_zodErrorsIntegration); exports.applyZodErrorsToEvent = applyZodErrorsToEvent; exports.flattenIssue = flattenIssue; exports.flattenIssuePath = flattenIssuePath; exports.formatIssueMessage = formatIssueMessage; 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, Symbol.toStringTag, { value: 'Module' }); 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; } parsedStacks.add(stack); const frames = parser(stack); for (const frame of frames.reverse()) { if (frame.filename) { filenameMetadataMap.set(frame.filename, metadata); break; } } } } function getMetadataForUrl(parser, filename) { ensureMetadataStacksAreParsed(parser); return filenameMetadataMap.get(filename); } function addMetadataToStackFrames(parser, event) { event.exception?.values?.forEach((exception) => { exception.stacktrace?.frames?.forEach((frame) => { if (!frame.filename || frame.module_metadata) { return; } const metadata = getMetadataForUrl(parser, frame.filename); if (metadata) { frame.module_metadata = metadata; } }); }); } function stripMetadataFromStackFrames(event) { event.exception?.values?.forEach((exception) => { exception.stacktrace?.frames?.forEach((frame) => { delete frame.module_metadata; }); }); } exports.addMetadataToStackFrames = addMetadataToStackFrames; exports.getFilenameToMetadataMap = getFilenameToMetadataMap; exports.getMetadataForUrl = getMetadataForUrl; exports.stripMetadataFromStackFrames = stripMetadataFromStackFrames; //# sourceMappingURL=metadata.js.map /***/ }), /***/ 61993: /***/ ((__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 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 } ]; } function createMetricEnvelope(metrics, 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, [createMetricContainerEnvelopeItem(metrics, inferUserData)]); } exports.createMetricContainerEnvelopeItem = createMetricContainerEnvelopeItem; exports.createMetricEnvelope = createMetricEnvelope; //# sourceMappingURL=envelope.js.map /***/ }), /***/ 48803: /***/ ((__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 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); const MAX_METRIC_BUFFER_SIZE = 1e3; function setMetricAttribute(metricAttributes, key, value, setEvenIfPresent = true) { if (value && (setEvenIfPresent || !(key in metricAttributes))) { metricAttributes[key] = value; } } 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 { _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; } 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; } 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; } 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()); } exports._INTERNAL_captureMetric = _INTERNAL_captureMetric; exports._INTERNAL_captureSerializedMetric = _INTERNAL_captureSerializedMetric; exports._INTERNAL_flushMetricsBuffer = _INTERNAL_flushMetricsBuffer; exports._INTERNAL_getMetricBuffer = _INTERNAL_getMetricBuffer; //# sourceMappingURL=internal.js.map /***/ }), /***/ 64701: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const internal = __nccwpck_require__(48803); 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); } exports.count = count; exports.distribution = distribution; exports.gauge = gauge; //# sourceMappingURL=public-api.js.map /***/ }), /***/ 25750: /***/ ((__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); function isProfilingIntegrationWithProfiler(integration) { return !!integration && typeof integration["_profiler"] !== "undefined" && typeof integration["_profiler"]["start"] === "function" && typeof integration["_profiler"]["stop"] === "function"; } function startProfiler() { const client = currentScopes.getClient(); if (!client) { debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No Sentry client available, profiling is not started"); return; } const integration = client.getIntegrationByName("ProfilingIntegration"); if (!integration) { debugBuild.DEBUG_BUILD && debugLogger.debug.warn("ProfilingIntegration is not available"); return; } if (!isProfilingIntegrationWithProfiler(integration)) { debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Profiler is not available on profiling integration."); return; } integration._profiler.start(); } function stopProfiler() { const client = currentScopes.getClient(); if (!client) { debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No Sentry client available, profiling is not started"); return; } const integration = client.getIntegrationByName("ProfilingIntegration"); if (!integration) { debugBuild.DEBUG_BUILD && debugLogger.debug.warn("ProfilingIntegration is not available"); return; } if (!isProfilingIntegrationWithProfiler(integration)) { debugBuild.DEBUG_BUILD && debugLogger.debug.warn("Profiler is not available on profiling integration."); return; } integration._profiler.stop(); } const profiler = { startProfiler, stopProfiler }; exports.profiler = profiler; //# sourceMappingURL=profiling.js.map /***/ }), /***/ 49417: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); const session = __nccwpck_require__(60233); 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); const DEFAULT_MAX_BREADCRUMBS = 100; class Scope { // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method. constructor() { this._notifyingListeners = false; this._scopeListeners = []; this._eventProcessors = []; this._breadcrumbs = []; this._attachments = []; this._user = {}; this._tags = {}; this._attributes = {}; this._extra = {}; this._contexts = {}; this._sdkProcessingMetadata = {}; this._propagationContext = { traceId: propagationContext.generateTraceId(), sampleRand: randomSafeContext.safeMathRandom() }; } /** * Clone all data from this scope into a new scope. */ 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) { newScope._contexts.flags = { 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._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; } /** * 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) { this._client = client; } /** * Set the ID of the last captured error event. * This is generally only captured on the isolation scope. */ setLastEventId(lastEventId) { this._lastEventId = lastEventId; } /** * Get the client assigned to this scope. */ getClient() { return this._client; } /** * Get the ID of the last captured error event. * This is generally only available on the isolation scope. */ lastEventId() { return this._lastEventId; } /** * @inheritDoc */ addScopeListener(callback) { this._scopeListeners.push(callback); } /** * Add an event processor that will be called before an event is sent. */ addEventProcessor(callback) { this._eventProcessors.push(callback); return this; } /** * Set the user for this scope. * Set to `null` to unset the user. */ setUser(user) { this._user = user || { 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; } /** * Get the user from this scope. */ getUser() { return this._user; } /** * Set the conversation ID for this scope. * Set to `null` to unset the conversation ID. */ setConversationId(conversationId) { this._conversationId = conversationId || void 0; this._notifyScopeListeners(); return this; } /** * 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) { this._tags = { ...this._tags, ...tags }; this._notifyScopeListeners(); return this; } /** * Set a single tag that will be sent as tags data with the event. */ 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; } /** * 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); * ``` */ // 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 }; this._notifyScopeListeners(); return this; } /** * Set a single key:value extra entry that will be sent as extra data with the event. */ setExtra(key, extra) { this._extra = { ...this._extra, [key]: extra }; this._notifyScopeListeners(); return this; } /** * Sets the fingerprint on the scope to send with the events. * @param {string[]} fingerprint Fingerprint to group events in Sentry. */ setFingerprint(fingerprint) { this._fingerprint = fingerprint; this._notifyScopeListeners(); return this; } /** * Sets the level on the scope for future events. */ 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. * * IMPORTANT: Calling this function does NOT change the name of the currently active * root span. If you want to change the name of the active root span, use * `Sentry.updateSpanName(rootSpan, 'new name')` instead. * * 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) { this._transactionName = name; this._notifyScopeListeners(); return this; } /** * 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) { if (context === null) { delete this._contexts[key]; } else { this._contexts[key] = context; } this._notifyScopeListeners(); return this; } /** * Set the session for the scope. */ setSession(session) { if (!session) { delete this._session; } else { this._session = session; } this._notifyScopeListeners(); return this; } /** * Get the session from the scope. */ getSession() { return this._session; } /** * 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) { if (!captureContext) { return this; } 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 (conversationId) { this._conversationId = conversationId; } return this; } /** * 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() { this._breadcrumbs = []; this._tags = {}; this._attributes = {}; this._extra = {}; this._user = {}; this._contexts = {}; 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(), sampleRand: randomSafeContext.safeMathRandom() }); this._notifyScopeListeners(); return this; } /** * 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; 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); this._client?.recordDroppedEvent("buffer_overflow", "log_item"); } this._notifyScopeListeners(); return this; } /** * Get the last breadcrumb of the scope. */ getLastBreadcrumb() { return this._breadcrumbs[this._breadcrumbs.length - 1]; } /** * Clear all breadcrumbs from the scope. */ clearBreadcrumbs() { this._breadcrumbs = []; this._notifyScopeListeners(); return this; } /** * Add an attachment to the scope. */ addAttachment(attachment) { this._attachments.push(attachment); return this; } /** * Clear all attachments from the scope. */ clearAttachments() { this._attachments = []; return this; } /** * 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, fingerprint: this._fingerprint || [], eventProcessors: this._eventProcessors, propagationContext: this._propagationContext, sdkProcessingMetadata: this._sdkProcessingMetadata, transactionName: this._transactionName, span: spanOnScope._getSpanForScope(this), conversationId: this._conversationId }; } /** * Add data which will be accessible during event processing but won't get sent to Sentry. */ setSDKProcessingMetadata(newData) { this._sdkProcessingMetadata = merge.merge(this._sdkProcessingMetadata, newData, 2); return this; } /** * Add propagation context to the scope, used for distributed tracing */ setPropagationContext(context) { this._propagationContext = context; return this; } /** * Get propagation context from the scope, used for distributed tracing */ getPropagationContext() { return this._propagationContext; } /** * Capture an exception for this scope. * * @returns {string} The id of the captured Sentry event. */ captureException(exception, hint) { const eventId = hint?.event_id || misc.uuid4(); if (!this._client) { debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No client configured on scope - will not capture exception!"); return eventId; } const syntheticException = new Error("Sentry syntheticException"); this._client.captureException( exception, { originalException: exception, syntheticException, ...hint, event_id: eventId }, this ); return eventId; } /** * Capture a message for this scope. * * @returns {string} The id of the captured message. */ captureMessage(message, level, hint) { const eventId = hint?.event_id || misc.uuid4(); if (!this._client) { debugBuild.DEBUG_BUILD && debugLogger.debug.warn("No client configured on scope - will not capture message!"); return eventId; } const syntheticException = hint?.syntheticException ?? new Error(message); this._client.captureMessage( message, level, { originalException: message, syntheticException, ...hint, event_id: eventId }, this ); return eventId; } /** * Capture a Sentry event for this scope. * * @returns {string} The id of the captured event. */ captureEvent(event, hint) { const eventId = event.event_id || hint?.event_id || misc.uuid4(); if (!this._client) { 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() { if (!this._notifyingListeners) { this._notifyingListeners = true; this._scopeListeners.forEach((callback) => { callback(this); }); this._notifyingListeners = false; } } } exports.Scope = Scope; //# sourceMappingURL=scope.js.map /***/ }), /***/ 6183: /***/ ((__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); function initAndBind(clientClass, options) { if (options.debug === true) { if (debugBuild.DEBUG_BUILD) { debugLogger.debug.enable(); } else { 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; } function setCurrentClient(client) { currentScopes.getCurrentScope().setClient(client); } exports.initAndBind = initAndBind; exports.setCurrentClient = setCurrentClient; //# sourceMappingURL=sdk.js.map /***/ }), /***/ 36827: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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; 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 /***/ }), /***/ 37238: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const checkin = __nccwpck_require__(54413); const client = __nccwpck_require__(36316); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); 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) { 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) { const event = eventbuilder.eventFromUnknownInput(this, this._options.stackParser, exception, hint); event.level = "error"; return syncpromise.resolvedSyncPromise(event); } /** * @inheritDoc */ eventFromMessage(message, level = "info", hint) { return syncpromise.resolvedSyncPromise( eventbuilder.eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace) ); } /** * @inheritDoc */ captureException(exception, hint, scope) { setCurrentRequestSessionErroredOrCrashed(hint); return super.captureException(exception, hint, scope); } /** * @inheritDoc */ 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); } /** * 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. */ captureCheckIn(checkIn, monitorConfig, scope) { const id = "checkInId" in checkIn && checkIn.checkInId ? checkIn.checkInId : misc.uuid4(); if (!this._isEnabled()) { 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 }; if ("duration" in checkIn) { serializedCheckIn.duration = checkIn.duration; } if (monitorConfig) { serializedCheckIn.monitor_config = { schedule: monitorConfig.schedule, checkin_margin: monitorConfig.checkinMargin, max_runtime: monitorConfig.maxRuntime, timezone: monitorConfig.timezone, failure_issue_threshold: monitorConfig.failureIssueThreshold, recovery_threshold: monitorConfig.recoveryThreshold }; } const [dynamicSamplingContext, traceContext] = traceInfo._getTraceInfoFromScope(this, scope); if (traceContext) { serializedCheckIn.contexts = { trace: traceContext }; } const envelope = checkin.createCheckInEnvelope( serializedCheckIn, dynamicSamplingContext, this.getSdkMetadata(), tunnel, this.getDsn() ); debugBuild.DEBUG_BUILD && debugLogger.debug.log("Sending checkin:", checkIn.monitorSlug, checkIn.status); this.sendEnvelope(envelope); return id; } /** * @inheritDoc */ 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 }; } if (this._options.serverName) { event.server_name = event.server_name || this._options.serverName; } return super._prepareEvent(event, hint, currentScope, isolationScope); } /** * 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"; } } } exports.ServerRuntimeClient = ServerRuntimeClient; //# sourceMappingURL=server-runtime-client.js.map /***/ }), /***/ 60233: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const misc = __nccwpck_require__(52619); const time = __nccwpck_require__(66690); function makeSession(context) { const startingTime = time.timestampInSeconds(); const session = { sid: misc.uuid4(), init: true, timestamp: startingTime, started: startingTime, duration: 0, status: "ok", errors: 0, ignoreDuration: false, toJSON: () => sessionToJSON(session) }; if (context) { updateSession(session, context); } return session; } 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) { session.sid = context.sid.length === 32 ? context.sid : misc.uuid4(); } if (context.init !== void 0) { session.init = context.init; } if (!session.did && context.did) { session.did = `${context.did}`; } if (typeof context.started === "number") { session.started = context.started; } if (session.ignoreDuration) { session.duration = void 0; } else if (typeof context.duration === "number") { session.duration = context.duration; } else { const duration = session.timestamp - session.started; session.duration = duration >= 0 ? duration : 0; } if (context.release) { session.release = context.release; } if (context.environment) { session.environment = context.environment; } if (!session.ipAddress && context.ipAddress) { session.ipAddress = context.ipAddress; } if (!session.userAgent && context.userAgent) { session.userAgent = context.userAgent; } if (typeof context.errors === "number") { session.errors = context.errors; } if (context.status) { session.status = context.status; } } function closeSession(session, status) { let context = {}; if (status) { context = { status }; } else if (session.status === "ok") { context = { status: "exited" }; } updateSession(session, context); } function sessionToJSON(session) { return { sid: `${session.sid}`, init: session.init, // Make sure that sec is converted to ms for date constructor 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}` : 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 } }; } exports.closeSession = closeSession; exports.makeSession = makeSession; exports.updateSession = updateSession; //# sourceMappingURL=session.js.map /***/ }), /***/ 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, 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 hasSpanStreamingEnabled = __nccwpck_require__(73642); const is = __nccwpck_require__(68370); const genAiAttributes = __nccwpck_require__(53989); const messageTruncation = __nccwpck_require__(18368); 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; } const client = currentScopes.getClient(); if (!client) { return true; } 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 instrumentedResult; } function wrapPromiseWithMethods(originalPromiseLike, instrumentedPromise, mechanismType) { if (!is.isThenable(originalPromiseLike)) { return instrumentedPromise; } 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; } }); } 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"; } } 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) }); } } } 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.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 /***/ }), /***/ 29724: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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__(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); const FROZEN_DSC_FIELD = "_frozenDsc"; function freezeDscOnSpan(span, dsc) { const spanWithMaybeDsc = span; object.addNonEnumerableProperty(spanWithMaybeDsc, FROZEN_DSC_FIELD, dsc); } function getDynamicSamplingContextFromClient(trace_id, client) { const options = client.getOptions(); const { publicKey: public_key } = client.getDsn() || {}; const dsc = { environment: options.environment || constants.DEFAULT_ENVIRONMENT, release: options.release, public_key, trace_id, org_id: dsn.extractOrgIdFromClient(client) }; client.emit("createDsc", dsc); return dsc; } function getDynamicSamplingContextFromScope(client, scope) { const propagationContext = scope.getPropagationContext(); return propagationContext.dsc || getDynamicSamplingContextFromClient(propagationContext.traceId, client); } function getDynamicSamplingContextFromSpan(span) { const client = currentScopes.getClient(); if (!client) { return {}; } const rootSpan = spanUtils.getRootSpan(span); const rootSpanJson = spanUtils.spanToJSON(rootSpan); const rootSpanAttributes = rootSpanJson.data; const traceState = rootSpan.spanContext().traceState; 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 applyLocalSampleRateToDsc(dscOnTraceState); } const dsc = getDynamicSamplingContextFromClient(span.spanContext().traceId, client); const source = rootSpanAttributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] ?? rootSpanAttributes["sentry.segment.name.source"]; const name = rootSpanJson.description; if (source !== "url" && name) { dsc.transaction = name; } 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(); } applyLocalSampleRateToDsc(dsc); client.emit("createDsc", dsc, rootSpan); return dsc; } function spanToBaggageHeader(span) { const dsc = getDynamicSamplingContextFromSpan(span); return baggage.dynamicSamplingContextToSentryBaggageHeader(dsc); } exports.freezeDscOnSpan = freezeDscOnSpan; exports.getDynamicSamplingContextFromClient = getDynamicSamplingContextFromClient; exports.getDynamicSamplingContextFromScope = getDynamicSamplingContextFromScope; exports.getDynamicSamplingContextFromSpan = getDynamicSamplingContextFromSpan; exports.spanToBaggageHeader = spanToBaggageHeader; //# sourceMappingURL=dynamicSamplingContext.js.map /***/ }), /***/ 21834: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); 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; 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); } exports.registerSpanErrorInstrumentation = registerSpanErrorInstrumentation; //# sourceMappingURL=errors.js.map /***/ }), /***/ 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, 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 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); 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.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 /***/ }), /***/ 89709: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); const semanticAttributes = __nccwpck_require__(36827); 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: 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"; function startIdleSpan(startSpanOptions, options = {}) { const activities = /* @__PURE__ */ new Map(); let _finished = false; let _idleTimeoutID; 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(); 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); span.end = new Proxy(span.end, { apply(target, thisArg, args) { if (beforeSpanEnd) { beforeSpanEnd(span); } if (sentryNonRecordingSpan.spanIsNonRecordingSpan(thisArg)) { return; } const [definedEndTimestamp, ...rest] = args; const timestamp = definedEndTimestamp || time.timestampInSeconds(); const spanEndTimestamp = spanUtils.spanTimeInputToSeconds(timestamp); 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 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 / 1e3 : Infinity, Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity)) ); onIdleSpanEnded(endTimestamp); return Reflect.apply(target, thisArg, [endTimestamp, ...rest]); } }); function _cancelIdleTimeout() { if (_idleTimeoutID) { clearTimeout(_idleTimeoutID); _idleTimeoutID = void 0; } } function _restartIdleTimeout(endTimestamp) { _cancelIdleTimeout(); _idleTimeoutID = setTimeout(() => { if (!_finished && activities.size === 0 && _autoFinishAllowed) { _finishReason = FINISH_REASON_IDLE_TIMEOUT; span.end(endTimestamp); } }, idleTimeout); } function _restartChildSpanTimeout(endTimestamp) { _idleTimeoutID = setTimeout(() => { if (!_finished && _autoFinishAllowed) { _finishReason = FINISH_REASON_HEARTBEAT_FAILED; span.end(endTimestamp); } }, childSpanTimeout); } function _pushActivity(spanId) { _cancelIdleTimeout(); activities.set(spanId, true); const endTimestamp = time.timestampInSeconds(); _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1e3); } function _popActivity(spanId) { if (activities.has(spanId)) { activities.delete(spanId); } if (activities.size === 0) { const endTimestamp = time.timestampInSeconds(); _restartIdleTimeout(endTimestamp + idleTimeout / 1e3); } } function onIdleSpanEnded(endTimestamp) { _finished = true; activities.clear(); _cleanupHooks.forEach((cleanup) => cleanup()); spanOnScope._setSpanForScope(scope, previousActiveSpan); const spanJSON = spanUtils.spanToJSON(span); const { start_timestamp: startTimestamp } = spanJSON; if (!startTimestamp) { return; } 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); } 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) => { if (childSpan.isRecording()) { childSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "cancelled" }); childSpan.end(endTimestamp); 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; const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1e3; const spanEndedBeforeFinalTimeout = childEndTimestamp - childStartTimestamp <= timeoutWithMarginOfError; if (debugBuild.DEBUG_BUILD) { const stringifiedSpan = JSON.stringify(childSpan, void 0, 2); if (!spanStartedBeforeIdleSpanEnd) { debugLogger.debug.log("[Tracing] Discarding span since it happened after idle span was finished", stringifiedSpan); } else if (!spanEndedBeforeFinalTimeout) { 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); } } _cleanupHooks.push( 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 (allSpans.includes(startedSpan)) { _pushActivity(startedSpan.spanContext().spanId); } }) ); _cleanupHooks.push( client.on("spanEnd", (endedSpan) => { if (_finished) { return; } _popActivity(endedSpan.spanContext().spanId); }) ); _cleanupHooks.push( client.on("idleSpanEnableAutoFinish", (spanToAllowAutoFinish) => { if (spanToAllowAutoFinish === span) { _autoFinishAllowed = true; _restartIdleTimeout(); if (activities.size) { _restartChildSpanTimeout(); } } }) ); if (!options.disableAutoFinish) { _restartIdleTimeout(); } setTimeout(() => { if (!_finished) { 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 && debugLogger.debug.log("[Tracing] Started span is an idle span"); return span; } exports.TRACING_DEFAULTS = TRACING_DEFAULTS; 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, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); const debugLogger = __nccwpck_require__(41772); const spanUtils = __nccwpck_require__(47569); function logSpanStart(span) { if (!debugBuild.DEBUG_BUILD) return; 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 infoParts = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`]; if (parentSpanId) { infoParts.push(`parent ID: ${parentSpanId}`); } if (!isRootSpan) { const { op: op2, description: description2 } = spanUtils.spanToJSON(rootSpan); infoParts.push(`root ID: ${rootSpan.spanContext().spanId}`); if (op2) { infoParts.push(`root op: ${op2}`); } if (description2) { infoParts.push(`root description: ${description2}`); } } debugLogger.debug.log(`${header} ${infoParts.join("\n ")}`); } function logSpanEnd(span) { if (!debugBuild.DEBUG_BUILD) return; 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}`; debugLogger.debug.log(msg); } exports.logSpanEnd = logSpanEnd; exports.logSpanStart = logSpanStart; //# sourceMappingURL=logSpans.js.map /***/ }), /***/ 50722: /***/ ((__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); function setMeasurement(name, value, unit, activeSpan = spanUtils.getActiveSpan()) { const rootSpan = activeSpan && spanUtils.getRootSpan(activeSpan); if (rootSpan) { 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 }); } } function timedEventsToMeasurements(events) { if (!events || events.length === 0) { return void 0; } const measurements = {}; 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") { measurements[event.name] = { value, unit }; } }); return measurements; } exports.setMeasurement = setMeasurement; 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, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); const debugLogger = __nccwpck_require__(41772); const hasSpansEnabled = __nccwpck_require__(42982); const parseSampleRate = __nccwpck_require__(54078); function sampleSpan(options, samplingContext, sampleRand) { if (!hasSpansEnabled.hasSpansEnabled(options)) { return [false]; } let localSampleRateWasApplied = void 0; let sampleRate; 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; localSampleRateWasApplied = true; } const parsedSampleRate = parseSampleRate.parseSampleRate(sampleRate); 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 (!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]; } const shouldSample = sampleRand < parsedSampleRate; if (!shouldSample) { debugBuild.DEBUG_BUILD && debugLogger.debug.log( `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number( sampleRate )})` ); } 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, Symbol.toStringTag, { value: 'Module' }); const object = __nccwpck_require__(5906); const propagationContext = __nccwpck_require__(95102); const spanUtils = __nccwpck_require__(47569); 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() { return { spanId: this._spanId, traceId: this._traceId, traceFlags: spanUtils.TRACE_FLAG_NONE }; } /** @inheritdoc */ end(_timestamp) { } /** @inheritdoc */ setAttribute(_key, _value) { return this; } /** @inheritdoc */ setAttributes(_values) { return this; } /** @inheritdoc */ setStatus(_status) { return this; } /** @inheritdoc */ updateName(_name) { return this; } /** @inheritdoc */ isRecording() { return false; } /** @inheritdoc */ 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. * * @hidden * @internal */ recordException(_exception, _time) { } } function spanIsNonRecordingSpan(span) { return !!span && span[NON_RECORDING_SPAN_FIELD] === true; } exports.SentryNonRecordingSpan = SentryNonRecordingSpan; exports.spanIsNonRecordingSpan = spanIsNonRecordingSpan; //# sourceMappingURL=sentryNonRecordingSpan.js.map /***/ }), /***/ 53263: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); const envelope = __nccwpck_require__(58784); const semanticAttributes = __nccwpck_require__(36827); 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 = 1e3; class SentrySpan { /** * You should never call the constructor manually, always use `Sentry.startSpan()` * or other span methods. * @internal * @hideconstructor * @hidden */ 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_OP]: spanContext.op, ...spanContext.attributes }); this._name = spanContext.name; if (spanContext.parentSpanId) { this._parentSpanId = spanContext.parentSpanId; } if ("sampled" in spanContext) { this._sampled = spanContext.sampled; } if (spanContext.endTimestamp) { this._endTime = spanContext.endTimestamp; } this._events = []; this._isStandaloneSpan = spanContext.isStandalone; if (this._endTime) { this._onSpanEnded(); } } /** @inheritDoc */ addLink(link) { if (this._frozen) { return this; } if (this._links) { this._links.push(link); } else { this._links = [link]; } return this; } /** @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. * * @hidden * @internal */ recordException(_exception, _time) { } /** @inheritdoc */ spanContext() { const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this; return { spanId, traceId, traceFlags: sampled ? spanUtils.TRACE_FLAG_SAMPLED : spanUtils.TRACE_FLAG_NONE }; } /** @inheritdoc */ 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])); return this; } /** * This should generally not be used, * but we need it for browser tracing where we want to adjust the start time afterwards. * USE THIS WITH CAUTION! * * @hidden * @internal */ updateStartTime(timeInput) { if (this._frozen) { return; } this._startTime = spanUtils.spanTimeInputToSeconds(timeInput); } /** * @inheritDoc */ setStatus(value) { if (this._frozen) { return this; } this._status = value; return this; } /** * @inheritDoc */ updateName(name) { if (this._frozen) { return this; } this._name = name; if (!utils.spanShouldInferOtelSource(this)) { this.setAttribute(semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, "custom"); } return this; } /** @inheritdoc */ 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. * * @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 `spanToJSON(span)` instead. */ getSpanJSON() { return { data: this._attributes, description: this._name, op: this._attributes[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_OP], parent_span_id: this._parentSpanId, span_id: this._spanId, start_timestamp: this._startTime, status: spanUtils.getStatusMessage(this._status), timestamp: this._endTime, trace_id: this._traceId, 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 || 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() { return !this._endTime && !!this._sampled; } /** * @inheritdoc */ 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 }; 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. * USE THIS WITH CAUTION! * @internal * @hidden * @experimental */ isStandaloneSpan() { return !!this._isStandaloneSpan; } /** Emit `spanEnd` when the span is ended. */ _onSpanEnded() { const client = currentScopes.getClient(); if (client) { client.emit("spanEnd", this); if (!this._isStandaloneSpan) { client.emit("afterSpanEnd", this); } } 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 && debugLogger.debug.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."); if (client) { client.recordDroppedEvent("sample_rate", "span"); } } return; } 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(options = {}) { if (!isFullFinishedSpan(spanUtils.spanToJSON(this))) { return void 0; } if (!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 normalizedRequest = capturedSpanScope?.getScopeData().sdkProcessingMetadata?.normalizedRequest; if (this._sampled !== true) { return void 0; } 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]; let hasGenAiSpans = false; spans.forEach((span) => { delete span.data[semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; if (span.op?.startsWith("gen_ai.")) { hasGenAiSpans = true; } }); const transaction = { contexts: { trace: spanUtils.spanToTransactionTraceContext(this) }, 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 ), start_timestamp: this._startTime, timestamp: this._endTime, transaction: this._name, type: "transaction", sdkProcessingMetadata: { capturedSpanScope, capturedSpanIsolationScope, dynamicSamplingContext: dynamicSamplingContext.getDynamicSamplingContextFromSpan(this), hasGenAiSpans }, request: normalizedRequest, ...source && { transaction_info: { source } } }; const measurements = measurement.timedEventsToMeasurements(this._events); const hasMeasurements = measurements && Object.keys(measurements).length; if (hasMeasurements) { 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); } function isFullFinishedSpan(input) { return !!input.start_timestamp && !!input.timestamp && !!input.span_id && !!input.trace_id; } function isStandaloneSpan(span) { return span instanceof SentrySpan && span.isStandaloneSpan(); } function sendSpanEnvelope(envelope) { const client = currentScopes.getClient(); if (!client) { return; } const spanItems = envelope[1]; if (!spanItems || spanItems.length === 0) { client.recordDroppedEvent("before_send", "span"); return; } client.sendEnvelope(envelope); } 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, Symbol.toStringTag, { value: 'Module' }); const SPAN_STATUS_UNSET = 0; const SPAN_STATUS_OK = 1; const SPAN_STATUS_ERROR = 2; 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" }; case 403: return { code: SPAN_STATUS_ERROR, message: "permission_denied" }; case 404: return { code: SPAN_STATUS_ERROR, message: "not_found" }; case 409: return { code: SPAN_STATUS_ERROR, message: "already_exists" }; case 413: return { code: SPAN_STATUS_ERROR, message: "failed_precondition" }; case 429: return { code: SPAN_STATUS_ERROR, message: "resource_exhausted" }; case 499: return { code: SPAN_STATUS_ERROR, message: "cancelled" }; default: return { code: SPAN_STATUS_ERROR, message: "invalid_argument" }; } } if (httpStatus >= 500 && httpStatus < 600) { switch (httpStatus) { case 501: return { code: SPAN_STATUS_ERROR, message: "unimplemented" }; case 503: return { code: SPAN_STATUS_ERROR, message: "unavailable" }; case 504: 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" }; } function setHttpStatus(span, httpStatus) { span.setAttribute("http.response.status_code", httpStatus); const spanStatus = getSpanStatusFromHttpCode(httpStatus); if (spanStatus.message !== "unknown_error") { span.setStatus(spanStatus); } } exports.SPAN_STATUS_ERROR = SPAN_STATUS_ERROR; exports.SPAN_STATUS_OK = SPAN_STATUS_OK; exports.SPAN_STATUS_UNSET = SPAN_STATUS_UNSET; exports.getSpanStatusFromHttpCode = getSpanStatusFromHttpCode; exports.setHttpStatus = setHttpStatus; //# sourceMappingURL=spanstatus.js.map /***/ }), /***/ 97956: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const index = __nccwpck_require__(29878); const carrier = __nccwpck_require__(38080); const currentScopes = __nccwpck_require__(8131); const debugBuild = __nccwpck_require__(14488); const semanticAttributes = __nccwpck_require__(36827); const baggage = __nccwpck_require__(2135); const debugLogger = __nccwpck_require__(41772); const handleCallbackErrors = __nccwpck_require__(77864); 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); const sentryNonRecordingSpan = __nccwpck_require__(36854); const sentrySpan = __nccwpck_require__(53263); const spanstatus = __nccwpck_require__(21119); const utils = __nccwpck_require__(77989); 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, 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, 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), () => { const { status } = spanUtils.spanToJSON(activeSpan); if (activeSpan.isRecording() && (!status || status === "ok")) { activeSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); } }, () => { activeSpan.end(); } ); }); }); } function startSpanManual(options, callback) { const acs = getAcs(); if (acs.startSpanManual) { return acs.startSpanManual(options, callback); } const spanArguments = parseSentrySpanArguments(options); 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, 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( // 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()), () => { const { status } = spanUtils.spanToJSON(activeSpan); if (activeSpan.isRecording() && (!status || status === "ok")) { activeSpan.setStatus({ code: spanstatus.SPAN_STATUS_ERROR, message: "internal_error" }); } } ); }); }); } 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; 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, customParentSpan); const client = currentScopes.getClient(); const missingRequiredParent = options.onlyIfParent && !parentSpan; if (missingRequiredParent) { return startMissingRequiredParentSpan(scope, client); } return createChildOrRootSpan({ parentSpan, spanArguments, forceTransaction, scope }); }); } 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: 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(); }); }; function withActiveSpan(span, callback) { const acs = getAcs(); if (acs.withActiveSpan) { return acs.withActiveSpan(span, callback); } return currentScopes.withScope((scope) => { spanOnScope._setSpanForScope(scope, span || void 0); return callback(scope); }); } function suppressTracing(callback) { const acs = getAcs(); if (acs.suppressTracing) { return acs.suppressTracing(callback); } return currentScopes.withScope((scope) => { scope.setSDKProcessingMetadata({ [SUPPRESS_TRACING_KEY]: true }); const res = callback(); scope.setSDKProcessingMetadata({ [SUPPRESS_TRACING_KEY]: void 0 }); return res; }); } 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) { 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 }) { 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, isolationScope); spanUtils.addChildSpanToSpan(parentSpan, span); } else if (parentSpan) { const dsc = dynamicSamplingContext.getDynamicSamplingContextFromSpan(parentSpan); const { traceId, spanId: parentSpanId } = parentSpan.spanContext(); const parentSampled = spanUtils.spanIsSampled(parentSpan); span = _startRootSpan( { traceId, parentSpanId, ...spanArguments }, scope, isolationScope, parentSampled ); dynamicSamplingContext.freezeDscOnSpan(span, dsc); } else { const { traceId, dsc, parentSpanId, sampled: parentSampled } = { ...isolationScope.getPropagationContext(), ...scope.getPropagationContext() }; span = _startRootSpan( { traceId, parentSpanId, ...spanArguments }, scope, isolationScope, parentSampled ); if (dsc) { dynamicSamplingContext.freezeDscOnSpan(span, dsc); } } logSpans.logSpanStart(span); return span; } function parseSentrySpanArguments(options) { const exp = options.experimental || {}; const initialCtx = { isStandalone: exp.standalone, ...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, isolationScope, parentSampled) { const client = currentScopes.getClient(); 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", [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: sampleRate !== void 0 && localSampleRateWasApplied ? sampleRate : void 0, ...finalAttributes }, sampled }); 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); } return rootSpan; } function _startChildSpan(parentSpan, scope, spanArguments, isolationScope) { const { spanId, traceId } = parentSpan.spanContext(); 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) { 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, customParentSpan) { if (customParentSpan) { return customParentSpan; } if (customParentSpan === null) { return void 0; } const span = spanOnScope._getSpanForScope(scope); if (!span) { return void 0; } const client = currentScopes.getClient(); const options = client ? client.getOptions() : {}; if (options.parentSpanIsAlwaysRootSpan) { return spanUtils.getRootSpan(span); } return span; } function getActiveSpanWrapper(parentSpan) { 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; exports.startSpanManual = startSpanManual; exports.suppressTracing = suppressTracing; exports.withActiveSpan = withActiveSpan; //# sourceMappingURL=trace.js.map /***/ }), /***/ 77989: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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"; 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, weakRef.makeWeakRef(isolationScope)); object.addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope); } } function getCapturedScopesOnSpan(span) { const spanWithScopes = span; return { 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 /***/ }), /***/ 24899: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); 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; 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 = []; envelope.forEachEnvelopeItem(envelope$1, (item, type) => { const dataCategory = envelope.envelopeItemTypeToDataCategory(type); if (ratelimit.isRateLimited(rateLimits, dataCategory)) { options.recordDroppedEvent("ratelimit_backoff", dataCategory); } else { filteredEnvelopeItems.push(item); } }); if (filteredEnvelopeItems.length === 0) { return Promise.resolve({}); } 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) => { options.recordDroppedEvent(reason, envelope.envelopeItemTypeToDataCategory(type)); }); }; 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; } 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 }; } exports.DEFAULT_TRANSPORT_BUFFER_SIZE = DEFAULT_TRANSPORT_BUFFER_SIZE; exports.createTransport = createTransport; //# sourceMappingURL=base.js.map /***/ }), /***/ 97281: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const api = __nccwpck_require__(88563); const dsn = __nccwpck_require__(91582); const envelope = __nccwpck_require__(56987); 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] : void 0; } return !!event; }); return event; } function makeOverrideReleaseTransport(createTransport, release) { return (options) => { const transport = createTransport(options); return { ...transport, send: async (envelope) => { const event = eventFromEnvelope(envelope, ["event", "transaction", "profile", "replay_event"]); if (event) { event.release = release; } return transport.send(envelope); } }; }; } function overrideDsn(envelope$1, dsn) { return envelope.createEnvelope( dsn ? { ...envelope$1[0], dsn } : envelope$1[0], envelope$1[1] ); } function makeMultiplexedTransport(createTransport, matcher) { return (options) => { const fallbackTransport = createTransport(options); 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) { const key = release ? `${dsn$1}:${release}` : dsn$1; let transport = otherTransports.get(key); if (!transport) { const validatedDsn = dsn.dsnFromString(dsn$1); if (!validatedDsn) { return void 0; } const url = api.getEnvelopeEndpointWithUrlEncodedAuth(validatedDsn, options.tunnel); 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?.length ? types : ["event"]; return eventFromEnvelope(envelope, eventTypes); } 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); } return { send, flush }; }; } exports.MULTIPLEXED_TRANSPORT_EXTRA_KEY = MULTIPLEXED_TRANSPORT_EXTRA_KEY; exports.eventFromEnvelope = eventFromEnvelope; exports.makeMultiplexedTransport = makeMultiplexedTransport; //# sourceMappingURL=multiplexed.js.map /***/ }), /***/ 52419: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); 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; const START_DELAY = 5e3; const MAX_DELAY = 36e5; function makeOfflineTransport(createTransport) { function log(...args) { debugBuild.DEBUG_BUILD && debugLogger.debug.log("[Offline]:", ...args); } return (options) => { const transport = createTransport(options); if (!options.createStore) { throw new Error("No `createStore` function was provided"); } const store = options.createStore(options); let retryDelay = START_DELAY; let flushTimer; function shouldQueue(env, error, retryDelay2) { if (envelope.envelopeContainsItemType(env, ["client_report"])) { return false; } if (options.shouldStore) { return options.shouldStore(env, error, retryDelay2); } return true; } function flushIn(delay) { if (flushTimer) { 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) { 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 (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 (isRetry) { await store.unshift(envelope$1); } else { await store.push(envelope$1); } flushWithBackOff(); log("Error sending. Event queued.", e); return {}; } else { throw e; } } } if (options.flushAtStartup) { flushWithBackOff(); } return { send, flush: (timeout) => { if (timeout === void 0) { retryDelay = START_DELAY; flushIn(MIN_DELAY); } return transport.flush(timeout); } }; }; } exports.MIN_DELAY = MIN_DELAY; exports.START_DELAY = START_DELAY; 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, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const exports$1 = __nccwpck_require__(10779); const semanticAttributes = __nccwpck_require__(36827); const normalize = __nccwpck_require__(68446); const trace = __nccwpck_require__(97956); const normalizationHints = __nccwpck_require__(1477); const trpcCaptureContext = { mechanism: { handled: false, type: "auto.rpc.trpc.middleware" } }; function captureIfError(nextResult) { if (typeof nextResult === "object" && nextResult !== null && "ok" in nextResult && !nextResult.ok && "error" in nextResult) { exports$1.captureException(nextResult.error, trpcCaptureContext); } } function trpcMiddleware(options = {}) { return async function(opts) { const { path, type, next, rawInput, getRawInput } = opts; const client = currentScopes.getClient(); const clientOptions = client?.getOptions(); const dataCollection = client?.getDataCollectionOptions(); const trpcContext = { procedure_path: path, procedure_type: type }; 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 !== void 0 && typeof getRawInput === "function") { try { const rawRes = await getRawInput(); trpcContext.input = normalize.normalize(rawRes); } catch { } } } return currentScopes.withIsolationScope((scope) => { scope.setContext("trpc", trpcContext); return trace.startSpanManual( { name: `trpc/${path}`, op: "rpc.server", attributes: { [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "route", [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.rpc.trpc" }, forceTransaction: !!options.forceTransaction }, async (span) => { try { const nextResult = await next(); captureIfError(nextResult); span.end(); return nextResult; } catch (e) { exports$1.captureException(e, trpcCaptureContext); span.end(); throw e; } } ); }); }; } exports.trpcMiddleware = trpcMiddleware; //# sourceMappingURL=trpc.js.map /***/ }), /***/ 70277: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const is = __nccwpck_require__(68370); function applyAggregateErrorsToEvent(exceptionFromErrorImplementation, parser, key, limit, event, hint) { if (!event.exception?.values || !hint || !is.isError(hint.originalException)) { return; } const originalException = event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : void 0; if (originalException) { 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) { if (prevExceptions.length >= limit + 1) { return prevExceptions; } let newExceptions = [...prevExceptions]; if (is.isError(error[key])) { applyExceptionGroupFieldsForParentException(exception, exceptionId, error); const newException = exceptionFromErrorImplementation(parser, error[key]); const newExceptionId = newExceptions.length; applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId); newExceptions = aggregateExceptionsFromError( exceptionFromErrorImplementation, parser, limit, error[key], key, [newException, ...newExceptions], newException, newExceptionId ); } if (isExceptionGroup(error)) { error.errors.forEach((childError, i) => { if (is.isError(childError)) { applyExceptionGroupFieldsForParentException(exception, exceptionId, error); const newException = exceptionFromErrorImplementation(parser, childError); const newExceptionId = newExceptions.length; applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId); newExceptions = aggregateExceptionsFromError( exceptionFromErrorImplementation, parser, limit, childError, key, [newException, ...newExceptions], newException, newExceptionId ); } }); } return newExceptions; } 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_id: exceptionId }; } function applyExceptionGroupFieldsForChildException(exception, source, exceptionId, parentId) { exception.mechanism = { handled: true, ...exception.mechanism, type: "chained", source, exception_id: exceptionId, parent_id: parentId }; } exports.applyAggregateErrorsToEvent = applyAggregateErrorsToEvent; //# sourceMappingURL=aggregate-errors.js.map /***/ }), /***/ 32397: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debugBuild = __nccwpck_require__(14488); const debugLogger = __nccwpck_require__(41772); 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; } }; } 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) : void 0 }; } exports.callFrameToStackFrame = callFrameToStackFrame; exports.watchdogTimer = watchdogTimer; //# sourceMappingURL=anr.js.map /***/ }), /***/ 65064: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); function uniq(input) { return Array.from(new Set(input)); } exports.uniq = uniq; //# sourceMappingURL=array.js.map /***/ }), /***/ 2135: /***/ ((__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 SENTRY_BAGGAGE_KEY_PREFIX = "sentry-"; const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/; const MAX_BAGGAGE_STRING_LENGTH = 8192; function baggageHeaderToDynamicSamplingContext(baggageHeader) { const baggageObject = parseBaggageHeader(baggageHeader); if (!baggageObject) { return void 0; } const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value]) => { if (key.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)) { const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length); acc[nonPrefixedKey] = value; } return acc; }, {}); if (Object.keys(dynamicSamplingContext).length > 0) { return dynamicSamplingContext; } else { return void 0; } } function dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext) { if (!dynamicSamplingContext) { return void 0; } const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce( (acc, [dscKey, dscValue]) => { if (dscValue) { acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue; } return acc; }, {} ); return objectToBaggageHeader(sentryPrefixedDSC); } function parseBaggageHeader(baggageHeader) { if (!baggageHeader || !is.isString(baggageHeader) && !Array.isArray(baggageHeader)) { return void 0; } if (Array.isArray(baggageHeader)) { return baggageHeader.reduce((acc, curr) => { const currBaggageObject = baggageHeaderToObject(curr); Object.entries(currBaggageObject).forEach(([key, value]) => { acc[key] = value; }); return acc; }, {}); } return baggageHeaderToObject(baggageHeader); } function baggageHeaderToObject(baggageHeader) { 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; } }); }).reduce((acc, [key, value]) => { if (key && value) { acc[key] = value; } return acc; }, {}); } function objectToBaggageHeader(object) { if (Object.keys(object).length === 0) { 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 && 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.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 /***/ }), /***/ 12297: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); function getBreadcrumbLogLevelFromHttpStatusCode(statusCode) { if (statusCode === void 0) { return void 0; } else if (statusCode >= 400 && statusCode < 500) { return "warning"; } else if (statusCode >= 500) { return "error"; } else { return void 0; } } exports.getBreadcrumbLogLevelFromHttpStatusCode = getBreadcrumbLogLevelFromHttpStatusCode; //# sourceMappingURL=breadcrumb-log-level.js.map /***/ }), /***/ 77387: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const is = __nccwpck_require__(68370); const worldwide = __nccwpck_require__(90935); const WINDOW = worldwide.GLOBAL_OBJ; const DEFAULT_MAX_STRING_LENGTH = 80; function htmlTreeAsString(elem, options = {}) { if (!elem) { return ""; } try { let currentElem = elem; const MAX_TRAVERSE_HEIGHT = 5; const out = []; let height = 0; let len = 0; 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; while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { nextStr = _htmlElementAsString(currentElem, keyAttrs); 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 { return ""; } } function _htmlElementAsString(el, keyAttrs) { const elem = el; const out = []; if (!elem?.tagName) { return ""; } if (WINDOW.HTMLElement) { if (elem instanceof HTMLElement && elem.dataset) { if (elem.dataset["sentryComponent"]) { return elem.dataset["sentryComponent"]; } if (elem.dataset["sentryElement"]) { return elem.dataset["sentryElement"]; } } } out.push(elem.tagName.toLowerCase()); 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+/); for (const c of classes) { out.push(`.${c}`); } } } for (const k of ["aria-label", "type", "name", "title", "alt"]) { const attr = elem.getAttribute(k); if (attr) { out.push(`[${k}="${attr}"]`); } } return out.join(""); } function getLocationHref() { try { return WINDOW.document.location.href; } catch { return ""; } } function getComponentName(elem, maxTraverseHeight = 5) { if (!WINDOW.HTMLElement) { return null; } 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["sentryElement"]) { return currentElem.dataset["sentryElement"]; } } currentElem = currentElem.parentNode; } return null; } exports.getComponentName = getComponentName; exports.getLocationHref = getLocationHref; exports.htmlTreeAsString = htmlTreeAsString; //# sourceMappingURL=browser.js.map /***/ }), /***/ 8438: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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; } ); 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; } } if (mutated) Object.assign(chained, { [kChainedCopy]: true }); return chained; }; exports.chainAndCopyPromiseLike = chainAndCopyPromiseLike; //# sourceMappingURL=chain-and-copy-promiselike.js.map /***/ }), /***/ 96472: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const envelope = __nccwpck_require__(56987); const time = __nccwpck_require__(66690); function createClientReportEnvelope(discarded_events, dsn, timestamp) { const clientReportItem = [ { type: "client_report" }, { timestamp: timestamp || time.dateTimestampInSeconds(), discarded_events } ]; return envelope.createEnvelope(dsn ? { dsn } : {}, [clientReportItem]); } exports.createClientReportEnvelope = createClientReportEnvelope; //# sourceMappingURL=clientreport.js.map /***/ }), /***/ 34724: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); function parseCookie(str) { const obj = {}; let index = 0; while (index < str.length) { const eqIdx = str.indexOf("=", index); if (eqIdx === -1) { break; } let endIdx = str.indexOf(";", index); if (endIdx === -1) { endIdx = str.length; } else if (endIdx < eqIdx) { index = str.lastIndexOf(";", eqIdx - 1) + 1; continue; } const key = str.slice(index, eqIdx).trim(); if (void 0 === obj[key]) { let val = str.slice(eqIdx + 1, endIdx).trim(); if (val.charCodeAt(0) === 34) { val = val.slice(1, -1); } try { obj[key] = val.indexOf("%") !== -1 ? decodeURIComponent(val) : val; } catch { obj[key] = val; } } index = endIdx + 1; } return obj; } exports.parseCookie = parseCookie; //# sourceMappingURL=cookie.js.map /***/ }), /***/ 21340: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const filteringSnippets = __nccwpck_require__(25681); 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 /***/ }), /***/ 48482: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const cookie = __nccwpck_require__(34724); const filteringSnippets = __nccwpck_require__(25681); const filterKeyValueData = __nccwpck_require__(88468); 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; } } exports.filterCookies = filterCookies; //# sourceMappingURL=filterCookies.js.map /***/ }), /***/ 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; } 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; } } } } }; if (sentryDebugIdMap) { processDebugIds(sentryDebugIdKeys, sentryDebugIdMap); } if (nativeDebugIdMap) { processDebugIds(nativeDebugIdKeys, nativeDebugIdMap); } return cachedFilenameDebugIds; } function getDebugImagesForResources(stackParser, resource_paths) { const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser); if (!filenameDebugIdMap) { return []; } const images = []; for (const path of resource_paths) { const normalizedPath = stacktrace.normalizeStackTracePath(path); if (normalizedPath && filenameDebugIdMap[normalizedPath]) { images.push({ type: "sourcemap", code_file: path, debug_id: filenameDebugIdMap[normalizedPath] }); } } return images; } exports.getDebugImagesForResources = getDebugImagesForResources; exports.getFilenameToDebugIdMap = getFilenameToDebugIdMap; //# sourceMappingURL=debug-ids.js.map /***/ }), /***/ 41772: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const carrier = __nccwpck_require__(38080); const debugBuild = __nccwpck_require__(14488); const worldwide = __nccwpck_require__(90935); 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 }; 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}`; } function dsnFromString(str) { const match = DSN_REGEX.exec(str); if (!match) { debugLogger.consoleSandbox(() => { console.error(`Invalid Sentry Dsn: ${str}`); }); return void 0; } const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match.slice(1); let path = ""; let projectId = lastPath; const split = projectId.split("/"); if (split.length > 1) { 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, publicKey }); } function dsnFromComponents(components) { return { protocol: components.protocol, publicKey: components.publicKey || "", pass: components.pass || "", host: components.host, 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) => { if (!dsn[component]) { debugLogger.debug.error(`Invalid Sentry Dsn: ${component} missing`); return true; } return false; }); if (hasMissingRequiredComponent) { return false; } if (!projectId.match(/^\d+$/)) { debugLogger.debug.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); return false; } if (!isValidProtocol(protocol)) { debugLogger.debug.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); return false; } if (port && isNaN(parseInt(port, 10))) { debugLogger.debug.error(`Invalid Sentry Dsn: Invalid port ${port}`); return false; } return true; } 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); if (!components || !validateDsn(components)) { return void 0; } return components; } exports.dsnFromString = dsnFromString; exports.dsnToString = dsnToString; exports.extractOrgIdFromClient = extractOrgIdFromClient; exports.extractOrgIdFromDsnHost = extractOrgIdFromDsnHost; exports.makeDsn = makeDsn; //# sourceMappingURL=dsn.js.map /***/ }), /***/ 582: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); function isBrowserBundle() { return typeof __SENTRY_BROWSER_BUNDLE__ !== "undefined" && !!__SENTRY_BROWSER_BUNDLE__; } function getSDKSource() { /*! __SENTRY_SDK_SOURCE__ */ return "npm"; } exports.getSDKSource = getSDKSource; exports.isBrowserBundle = isBrowserBundle; //# sourceMappingURL=env.js.map /***/ }), /***/ 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, Symbol.toStringTag, { value: 'Module' }); 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); function createEnvelope(headers, items = []) { return [headers, items]; } function addItemToEnvelope(envelope, newItem) { const [headers, items] = envelope; return [headers, [...items, newItem]]; } 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; } function envelopeContainsItemType(envelope, types) { return forEachEnvelopeItem(envelope, (_, type) => types.includes(type)); } function encodeUTF8(input) { const carrier$1 = carrier.getSentryCarrier(worldwide.GLOBAL_OBJ); return carrier$1.encodePolyfill ? carrier$1.encodePolyfill(input) : new TextEncoder().encode(input); } function decodeUTF8(input) { const carrier$1 = carrier.getSentryCarrier(worldwide.GLOBAL_OBJ); return carrier$1.decodePolyfill ? carrier$1.decodePolyfill(input) : new TextDecoder().decode(input); } function serializeEnvelope(envelope) { const [envHeaders, items] = envelope; let parts = JSON.stringify(envHeaders); function append(next) { if (typeof parts === "string") { parts = typeof next === "string" ? parts + next : [encodeUTF8(parts), next]; } else { parts.push(typeof next === "string" ? encodeUTF8(next) : next); } } for (const item of items) { const [itemHeaders, payload] = item; append(` ${JSON.stringify(itemHeaders)} `); if (typeof payload === "string" || payload instanceof Uint8Array) { append(payload); } else { let stringifiedPayload; try { stringifiedPayload = JSON.stringify(payload); } catch { stringifiedPayload = JSON.stringify(normalize.normalize(payload)); } append(stringifiedPayload); } } 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; } function parseEnvelope(env) { let buffer = typeof env === "string" ? encodeUTF8(env) : env; function readBinary(length) { const bin = buffer.subarray(0, length); buffer = buffer.subarray(length + 1); return bin; } function readJson() { let i = buffer.indexOf(10); if (i < 0) { i = buffer.length; } return JSON.parse(decodeUTF8(readBinary(i))); } const envelopeHeader = readJson(); const items = []; while (buffer.length) { const itemHeader = readJson(); const binaryLength = typeof itemHeader.length === "number" ? itemHeader.length : void 0; items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]); } return [envelopeHeader, items]; } function createSpanEnvelopeItem(spanJson) { const spanHeaders = { type: "span" }; return [spanHeaders, spanJson]; } function createAttachmentEnvelopeItem(attachment) { const buffer = typeof attachment.data === "string" ? encodeUTF8(attachment.data) : attachment.data; return [ { type: "attachment", length: buffer.length, filename: attachment.filename, content_type: attachment.contentType, attachment_type: attachment.attachmentType }, buffer ]; } 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" }; function _isOverriddenType(type) { return type in DATA_CATEGORY_OVERRIDES; } function envelopeItemTypeToDataCategory(type) { return _isOverriddenType(type) ? DATA_CATEGORY_OVERRIDES[type] : type; } function getSdkMetadataForEnvelopeHeader(metadataOrEvent) { if (!metadataOrEvent?.sdk) { return; } const { name, version } = metadataOrEvent.sdk; return { name, version }; } function createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn$1) { const dynamicSamplingContext = event.sdkProcessingMetadata?.dynamicSamplingContext; return { 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 } }; } exports.addItemToEnvelope = addItemToEnvelope; exports.createAttachmentEnvelopeItem = createAttachmentEnvelopeItem; exports.createEnvelope = createEnvelope; exports.createEventEnvelopeHeaders = createEventEnvelopeHeaders; exports.createSpanEnvelopeItem = createSpanEnvelopeItem; exports.envelopeContainsItemType = envelopeContainsItemType; exports.envelopeItemTypeToDataCategory = envelopeItemTypeToDataCategory; exports.forEachEnvelopeItem = forEachEnvelopeItem; exports.getSdkMetadataForEnvelopeHeader = getSdkMetadataForEnvelopeHeader; exports.parseEnvelope = parseEnvelope; exports.serializeEnvelope = serializeEnvelope; //# sourceMappingURL=envelope.js.map /***/ }), /***/ 20816: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); class SentryError extends Error { constructor(message, logLevel = "warn") { super(message); this.message = message; this.logLevel = logLevel; } } exports.SentryError = SentryError; //# sourceMappingURL=error.js.map /***/ }), /***/ 26667: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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; } 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: _enhanceErrorWithSentryInfo(error) }; const frames = parseStackFrames(stackParser, error); if (frames.length) { exception.stacktrace = { frames }; } return exception; } function getErrorPropertyFromObject(obj) { for (const prop in obj) { if (Object.prototype.hasOwnProperty.call(obj, prop)) { const value = obj[prop]; if (is.isError(value)) { return value; } } } return void 0; } function getMessageForObject(exception) { if ("name" in exception && typeof exception.name === "string") { let message = `'${exception.name}' captured as exception`; if ("message" in exception && typeof exception.message === "string") { message += ` with message '${exception.message}'`; } return message; } else if ("message" in exception && typeof exception.message === "string") { return exception.message; } const keys = object.extractExceptionKeysForMessage(exception); 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}`; } function getObjectClassName(obj) { try { const prototype = Object.getPrototypeOf(obj); return prototype ? prototype.constructor.name : void 0; } catch { } } function getException(client, mechanism, exception, hint) { if (is.isError(exception)) { return [exception, void 0]; } mechanism.synthetic = true; if (is.isPlainObject(exception)) { 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 ex2 = hint?.syntheticException || new Error(message); ex2.message = message; return [ex2, extras]; } const ex = hint?.syntheticException || new Error(exception); ex.message = `${exception}`; return [ex, void 0]; } function eventFromUnknownInput(client, stackParser, exception, hint) { const providedMechanism = hint?.data && hint.data.mechanism; const mechanism = providedMechanism || { handled: true, type: "generic" }; const [ex, extras] = getException(client, mechanism, exception, hint); const event = { exception: { values: [exceptionFromError(stackParser, ex)] } }; if (extras) { event.extra = extras; } misc.addExceptionTypeValue(event, void 0, void 0); misc.addExceptionMechanism(event, mechanism); return { ...event, event_id: hint?.event_id }; } function eventFromMessage(stackParser, message, level = "info", hint, attachStacktrace) { const event = { event_id: hint?.event_id, level }; if (attachStacktrace && hint?.syntheticException) { const frames = parseStackFrames(stackParser, hint.syntheticException); if (frames.length) { event.exception = { values: [ { value: message, 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__ }; return event; } event.message = message; return event; } exports._enhanceErrorWithSentryInfo = _enhanceErrorWithSentryInfo; exports.eventFromMessage = eventFromMessage; exports.eventFromUnknownInput = eventFromUnknownInput; exports.exceptionFromError = exceptionFromError; exports.parseStackFrames = parseStackFrames; //# sourceMappingURL=eventbuilder.js.map /***/ }), /***/ 26006: /***/ ((__unused_webpack_module, exports) => { 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' }); const objectToString = Object.prototype.toString; function isError(wat) { switch (objectToString.call(wat)) { case "[object Error]": case "[object Exception]": case "[object DOMException]": case "[object WebAssembly.Exception]": return true; default: return isInstanceOf(wat, Error); } } function isBuiltin(wat, className) { return objectToString.call(wat) === `[object ${className}]`; } function isErrorEvent(wat) { return isBuiltin(wat, "ErrorEvent"); } function isDOMError(wat) { return isBuiltin(wat, "DOMError"); } function isDOMException(wat) { return isBuiltin(wat, "DOMException"); } function isString(wat) { return isBuiltin(wat, "String"); } function isParameterizedString(wat) { return typeof wat === "object" && wat !== null && "__sentry_template_string__" in wat && "__sentry_template_values__" in wat; } function isPrimitive(wat) { return wat === null || isParameterizedString(wat) || typeof wat !== "object" && typeof wat !== "function"; } function isPlainObject(wat) { return isBuiltin(wat, "Object"); } function isObjectLike(wat) { return typeof wat === "object" && wat !== null; } function isEvent(wat) { return typeof Event !== "undefined" && isInstanceOf(wat, Event); } function isElement(wat) { return typeof Element !== "undefined" && isInstanceOf(wat, Element); } function isRegExp(wat) { return isBuiltin(wat, "RegExp"); } function isThenable(wat) { return Boolean(wat?.then && typeof wat.then === "function"); } function isSyntheticEvent(wat) { return isPlainObject(wat) && "nativeEvent" in wat && "preventDefault" in wat && "stopPropagation" in wat; } function isInstanceOf(wat, base) { try { return wat instanceof base; } catch { return false; } } function isVueViewModel(wat) { 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; exports.isDOMException = isDOMException; exports.isElement = isElement; 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; exports.isVueViewModel = isVueViewModel; //# sourceMappingURL=is.js.map /***/ }), /***/ 71287: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const node = __nccwpck_require__(84934); const worldwide = __nccwpck_require__(90935); function isBrowser() { return typeof window !== "undefined" && (!node.isNodeEnv() || isElectronNodeRenderer()); } function isElectronNodeRenderer() { const process = worldwide.GLOBAL_OBJ.process; return process?.type === "renderer"; } exports.isBrowser = isBrowser; //# sourceMappingURL=isBrowser.js.map /***/ }), /***/ 2554: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const url = __nccwpck_require__(78253); 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; } 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; } exports.isSentryRequestUrl = isSentryRequestUrl; //# sourceMappingURL=isSentryRequestUrl.js.map /***/ }), /***/ 67080: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); class LRUMap { constructor(_maxSize) { this._maxSize = _maxSize; this._cache = /* @__PURE__ */ new Map(); } /** Get the current size of the cache */ 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) { const value = this._cache.get(key); if (value === void 0) { return void 0; } 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) { if (this._cache.size >= this._maxSize) { 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) { const value = this._cache.get(key); if (value) { this._cache.delete(key); } return value; } /** Clear all entries */ clear() { this._cache.clear(); } /** Get all the keys */ keys() { return Array.from(this._cache.keys()); } /** Get all the values */ values() { const values = []; this._cache.forEach((value) => values.push(value)); return values; } } exports.LRUMap = LRUMap; //# sourceMappingURL=lru.js.map /***/ }), /***/ 32003: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); function merge(initialObj, mergeObj, levels = 2) { if (!mergeObj || typeof mergeObj !== "object" || levels <= 0) { return mergeObj; } 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 output; } exports.merge = merge; //# sourceMappingURL=merge.js.map /***/ }), /***/ 34314: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const traceData = __nccwpck_require__(7522); function getTraceMetaTags(traceData$1) { return Object.entries(traceData$1 || traceData.getTraceData()).map(([key, value]) => ``).join(""); } 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?.randomUUID) { return randomSafeContext.withRandomSafeContext(() => crypto.randomUUID()).replace(/-/g, ""); } } catch { } 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?.values?.[0]; } 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 eventId || ""; } function addExceptionTypeValue(event, value, type) { const exception = event.exception = event.exception || {}; const values = exception.values = exception.values || []; const firstException = values[0] = values[0] || {}; if (!firstException.value) { firstException.value = value || ""; } if (!firstException.type) { firstException.type = type || "Error"; } } function addExceptionMechanism(event, newMechanism) { const firstException = getFirstException(event); if (!firstException) { return; } const defaultMechanism = { type: "generic", handled: true }; const currentMechanism = firstException.mechanism; firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism }; if (newMechanism && "data" in newMechanism) { const mergedData = { ...currentMechanism?.data, ...newMechanism.data }; firstException.mechanism.data = mergedData; } } 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); } function parseSemver(input) { const match = input.match(SEMVER_REGEXP) || []; const major = _parseInt(match[1]); const minor = _parseInt(match[2]); const patch = _parseInt(match[3]); return { buildmetadata: match[5], major: isNaN(major) ? void 0 : major, minor: isNaN(minor) ? void 0 : minor, patch: isNaN(patch) ? void 0 : patch, prerelease: match[4] }; } function addContextToFrame(lines, frame, linesOfContext = 5) { 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)); const lineIndex = Math.min(maxLines - 1, sourceLine); 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)); } function checkOrSetAlreadyCaught(exception) { if (isAlreadyCaptured(exception)) { return true; } try { object.addNonEnumerableProperty(exception, "__sentry_captured__", true); } catch { } return false; } function isAlreadyCaptured(exception) { try { return exception.__sentry_captured__; } catch { } } exports.addContextToFrame = addContextToFrame; exports.addExceptionMechanism = addExceptionMechanism; exports.addExceptionTypeValue = addExceptionTypeValue; exports.checkOrSetAlreadyCaught = checkOrSetAlreadyCaught; exports.getEventDescription = getEventDescription; exports.isAlreadyCaptured = isAlreadyCaptured; exports.parseSemver = parseSemver; exports.uuid4 = uuid4; //# sourceMappingURL=misc.js.map /***/ }), /***/ 27068: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const stacktrace = __nccwpck_require__(22902); 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.\-+])*:\/\//); return !isInternal && filename !== void 0 && !filename.includes("node_modules/"); } function node(getModule) { const FILENAME_MATCH = /^\s*[-]{4,}$/; const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/; 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] === ".") { methodStart--; } if (methodStart > 0) { object = functionName.slice(0, methodStart); method = functionName.slice(methodStart + 1); const objectEnd = object.indexOf(".Module"); if (objectEnd > 0) { functionName = functionName.slice(objectEnd + 1); object = object.slice(0, objectEnd); } } typeName = void 0; } if (method) { typeName = object; methodName = method; } if (method === "") { methodName = void 0; functionName = void 0; } if (functionName === void 0) { methodName = methodName || stacktrace.UNKNOWN_FUNCTION; functionName = typeName ? `${typeName}.${methodName}` : methodName; } 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: maybeDecodedFilename ?? filename, module: maybeDecodedFilename && getModule?.(maybeDecodedFilename), function: functionName, lineno: _parseIntOrUndefined(lineMatch[3]), colno: _parseIntOrUndefined(lineMatch[4]), in_app: filenameIsInApp(filename || "", isNative) }; } if (line.match(FILENAME_MATCH)) { return { filename: line }; } return void 0; }; } function nodeStackLineParser(getModule) { return [90, node(getModule)]; } function _parseIntOrUndefined(input) { return parseInt(input || "", 10) || void 0; } function _safeDecodeURI(filename) { try { return decodeURI(filename); } catch { return void 0; } } exports.filenameIsInApp = filenameIsInApp; exports.node = node; exports.nodeStackLineParser = nodeStackLineParser; //# sourceMappingURL=node-stack-trace.js.map /***/ }), /***/ 84934: /***/ ((module, exports, __nccwpck_require__) => { /* module decorator */ module = __nccwpck_require__.nmd(module); Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const env = __nccwpck_require__(582); function isNodeEnv() { return !env.isBrowserBundle() && Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]"; } function dynamicRequire(mod, request) { return mod.require(request); } function loadModule(moduleName, existingModule = module) { let mod; try { mod = dynamicRequire(existingModule, moduleName); } catch { } if (!mod) { try { const { cwd } = dynamicRequire(existingModule, "process"); mod = dynamicRequire(existingModule, `${cwd()}/node_modules/${moduleName}`); } catch { } } return mod; } exports.isNodeEnv = isNodeEnv; exports.loadModule = loadModule; //# sourceMappingURL=node.js.map /***/ }), /***/ 1477: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const object = __nccwpck_require__(5906); 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 { return visit("", input, depth, maxProperties); } catch (err) { return { ERROR: `**non-serializable** (${err})` }; } } 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; } 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); if (!stringified.startsWith("[object ")) { return stringified; } if (normalizationHints.hasSkipNormalizationHint(value)) { return value; } const overrideDepth = normalizationHints.getNormalizationDepthOverrideHint(value); const remainingDepth = overrideDepth !== void 0 ? overrideDepth : depth; if (remainingDepth === 0) { return stringified.replace("object ", ""); } if (memoize(value)) { return "[Circular ~]"; } const valueWithToJSON = value; if (valueWithToJSON && typeof valueWithToJSON.toJSON === "function") { try { const jsonValue = valueWithToJSON.toJSON(); return visit("", jsonValue, remainingDepth - 1, maxProperties, memo); } catch { } } const normalized = Array.isArray(value) ? [] : {}; let numAdded = 0; const visitable = object.convertToPlainObject(value); for (const visitKey in visitable) { if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { continue; } if (numAdded >= maxProperties) { normalized[visitKey] = "[MaxProperties ~]"; break; } const visitValue = visitable[visitKey]; normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo); numAdded++; } unmemoize(value); return normalized; } function stringifyValue(key, value) { try { if (stringifier) { const stringified = stringifier(value); if (stringified) { return stringified; } } if (typeof global !== "undefined" && value === global) { return "[Global]"; } if (typeof value === "number" && !Number.isFinite(value)) { return `[${value}]`; } if (typeof value === "function") { return `[Function: ${stacktrace.getFunctionName(value)}]`; } if (typeof value === "symbol") { return `[${String(value)}]`; } if (typeof value === "bigint") { return `[BigInt: ${String(value)}]`; } const objName = getConstructorName(value); return `[object ${objName}]`; } catch (err) { return `**non-serializable** (${err})`; } } function getConstructorName(value) { const prototype = Object.getPrototypeOf(value); return prototype?.constructor ? prototype.constructor.name : "null prototype"; } function utf8Length(value) { return ~-encodeURI(value).split(/%..|./).length; } function jsonSize(value) { return utf8Length(JSON.stringify(value)); } function normalizeUrlToBase(url, basePath) { const escapedBase = basePath.replace(/\\/g, "/").replace(/[|\\{}()[\]^$+*?.]/g, "\\$&"); let newUrl = url; try { newUrl = decodeURI(url); } catch { } 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 /***/ }), /***/ 5906: /***/ ((__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 fill(source, name, replacementFactory) { if (!(name in source)) { return; } 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 { debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Failed to replace method "${name}" in object`, source); } } 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, writable: true, configurable: true }); } catch { debugBuild.DEBUG_BUILD && debugLogger.debug.log(`Failed to add non-enumerable property "${String(name)}" to object`, obj); } } function markFunctionWrapped(wrapped, original) { try { const proto = original.prototype || {}; wrapped.prototype = original.prototype = proto; 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 }); } function getOriginalFunction(func) { return func.__sentry_original__; } function convertToPlainObject(value) { if (is.isError(value)) { return { message: value.message, name: value.name, stack: value.stack, ...getOwnProperties(value) }; } if (is.isEvent(value)) { const { type, target, currentTarget, detail } = value; return { type, target, currentTarget, ...detail ? { detail } : {}, ...getOwnProperties(value) }; } return value; } function getOwnProperties(obj) { if (is.isObjectLike(obj)) { return Object.fromEntries(Object.entries(obj)); } return {}; } function extractExceptionKeysForMessage(exception) { const keys = Object.keys(convertToPlainObject(exception)); keys.sort(); return !keys[0] ? "[object has no keys]" : keys.join(", "); } function dropUndefinedKeys(inputValue) { const memoizationMap = /* @__PURE__ */ new Map(); return _dropUndefinedKeys(inputValue, memoizationMap); } function _dropUndefinedKeys(inputValue, memoizationMap) { if (inputValue === null || typeof inputValue !== "object") { return inputValue; } const memoVal = memoizationMap.get(inputValue); if (memoVal !== void 0) { return memoVal; } if (Array.isArray(inputValue)) { const returnValue = []; memoizationMap.set(inputValue, returnValue); inputValue.forEach((value) => { returnValue.push(_dropUndefinedKeys(value, memoizationMap)); }); 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) { const constructor = input.constructor; return constructor === Object || constructor === void 0; } function objectify(wat) { let objectified; switch (true) { // this will catch both undefined and null 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"): objectified = Object(wat); break; // this will catch the remaining primitives: `String`, `Number`, and `Boolean` case is.isPrimitive(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; break; } return objectified; } exports.addNonEnumerableProperty = addNonEnumerableProperty; exports.convertToPlainObject = convertToPlainObject; exports.dropUndefinedKeys = dropUndefinedKeys; exports.extractExceptionKeysForMessage = extractExceptionKeysForMessage; exports.fill = fill; exports.getOriginalFunction = getOriginalFunction; exports.markFunctionWrapped = markFunctionWrapped; exports.objectify = objectify; exports.wrapMethod = wrapMethod; //# sourceMappingURL=object.js.map /***/ }), /***/ 32957: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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' }); function normalizeArray(parts, allowAboveRoot) { let up = 0; for (let i = parts.length - 1; i >= 0; i--) { const last = parts[i]; if (last === ".") { parts.splice(i, 1); } else if (last === "..") { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } if (allowAboveRoot) { for (; up--; up) { parts.unshift(".."); } } return parts; } const splitPathRe = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/; function splitPath(filename) { const truncated = filename.length > 1024 ? `${filename.slice(-1024)}` : filename; const parts = splitPathRe.exec(truncated); return parts ? parts.slice(1) : []; } function resolve(...args) { let resolvedPath = ""; let resolvedAbsolute = false; for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { const path = i >= 0 ? args[i] : "/"; if (!path) { continue; } resolvedPath = `${path}/${resolvedPath}`; resolvedAbsolute = path.charAt(0) === "/"; } resolvedPath = normalizeArray( resolvedPath.split("/").filter((p) => !!p), !resolvedAbsolute ).join("/"); return (resolvedAbsolute ? "/" : "") + resolvedPath || "."; } function trim(arr) { let start = 0; for (; start < arr.length; start++) { if (arr[start] !== "") { break; } } let end = arr.length - 1; for (; end >= 0; end--) { if (arr[end] !== "") { break; } } if (start > end) { return []; } return arr.slice(start, end - start + 1); } function relative(from, to) { from = resolve(from).slice(1); to = resolve(to).slice(1); 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++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } let outputParts = []; for (let i = samePartsLength; i < fromParts.length; i++) { outputParts.push(".."); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join("/"); } function normalizePath(path) { const isPathAbsolute = isAbsolute(path); const trailingSlash = path.slice(-1) === "/"; let normalizedPath = normalizeArray( path.split("/").filter((p) => !!p), !isPathAbsolute ).join("/"); if (!normalizedPath && !isPathAbsolute) { normalizedPath = "."; } if (normalizedPath && trailingSlash) { normalizedPath += "/"; } return (isPathAbsolute ? "/" : "") + normalizedPath; } function isAbsolute(path) { return path.charAt(0) === "/"; } function join(...args) { return normalizePath(args.join("/")); } function dirname(path) { const result = splitPath(path); const root = result[0] || ""; let dir = result[1]; if (!root && !dir) { return "."; } if (dir) { dir = dir.slice(0, dir.length - 1); } return root + dir; } function basename(path, ext) { let f = splitPath(path)[2] || ""; if (ext && f.slice(ext.length * -1) === ext) { f = f.slice(0, f.length - ext.length); } return f; } exports.basename = basename; exports.dirname = dirname; exports.isAbsolute = isAbsolute; exports.join = join; exports.normalizePath = normalizePath; exports.relative = relative; exports.resolve = resolve; //# sourceMappingURL=path.js.map /***/ }), /***/ 22264: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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); 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); } if (event.type === void 0) { applyDebugIds(prepared, options.stackParser); } 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); } if (typeof normalizeDepth === "number" && normalizeDepth > 0) { return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth); } 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; } 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); } }); } } 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 { get $() { return Array.from(buffer); }, add, drain }; } exports.SENTRY_BUFFER_FULL_ERROR = SENTRY_BUFFER_FULL_ERROR; exports.makePromiseBuffer = makePromiseBuffer; //# sourceMappingURL=promisebuffer.js.map /***/ }), /***/ 95102: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const misc = __nccwpck_require__(52619); function generateTraceId() { return misc.uuid4(); } function generateSpanId() { return misc.uuid4().substring(16); } exports.generateSpanId = generateSpanId; exports.generateTraceId = generateTraceId; //# sourceMappingURL=propagationContext.js.map /***/ }), /***/ 28695: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const worldwide = __nccwpck_require__(90935); 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()); } 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 * 1e3; } const headerDate = Date.parse(`${header}`); if (!isNaN(headerDate)) { return headerDate - now; } return DEFAULT_RETRY_AFTER; } function disabledUntil(limits, dataCategory) { return limits[dataCategory] || limits.all || 0; } function isRateLimited(limits, dataCategory, now = randomSafeContext.safeDateNow()) { return disabledUntil(limits, dataCategory) > now; } function updateRateLimits(limits, { statusCode, headers }, now = randomSafeContext.safeDateNow()) { const updatedRateLimits = { ...limits }; const rateLimitHeader = headers?.["x-sentry-rate-limits"]; const retryAfterHeader = headers?.["retry-after"]; if (rateLimitHeader) { 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) * 1e3; if (!categories) { updatedRateLimits.all = now + delay; } else { for (const category of categories.split(";")) { if (category === "metric_bucket") { if (!namespaces || namespaces.split(";").includes("custom")) { updatedRateLimits[category] = now + delay; } } else { updatedRateLimits[category] = now + delay; } } } } } else if (retryAfterHeader) { updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now); } else if (statusCode === 429) { updatedRateLimits.all = now + 60 * 1e3; } return updatedRateLimits; } exports.DEFAULT_RETRY_AFTER = DEFAULT_RETRY_AFTER; exports.disabledUntil = disabledUntil; exports.isRateLimited = isRateLimited; exports.parseRetryAfterHeader = parseRetryAfterHeader; exports.updateRateLimits = updateRateLimits; //# sourceMappingURL=ratelimit.js.map /***/ }), /***/ 82141: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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 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 winterCGHeadersToDict(winterCGHeaders) { const headers = {}; try { winterCGHeaders.forEach((value, key) => { if (typeof value === "string") { headers[key] = value; } }); } catch { } return headers; } function headersToDict(reqHeaders) { const headers = /* @__PURE__ */ Object.create(null); try { Object.entries(reqHeaders).forEach(([key, value]) => { if (typeof value === "string") { headers[key] = value; } else if (typeof value === "number") { headers[key] = String(value); } }); } catch { } return headers; } function winterCGRequestToRequestData(req) { const headers = winterCGHeadersToDict(req.headers); return { method: req.method, url: req.url, query_string: extractQueryParamsFromUrl(req.url), headers // TODO: Can we extract body data from the 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 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(url), headers: headersToDict(headers), cookies, 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; } function extractQueryParamsFromUrl(url) { if (!url) { return; } try { const queryParams = new URL(url, "http://s.io").search.slice(1); return queryParams.length ? queryParams : void 0; } catch { return void 0; } } exports.MAX_BODY_BYTE_LENGTH = MAX_BODY_BYTE_LENGTH; exports.captureBodyFromWinterCGRequest = captureBodyFromWinterCGRequest; exports.extractQueryParamsFromUrl = extractQueryParamsFromUrl; exports.getMaxBodyByteLength = getMaxBodyByteLength; exports.headersToDict = headersToDict; exports.httpHeadersToSpanAttributes = httpHeadersToSpanAttributes; exports.httpRequestToRequestData = httpRequestToRequestData; exports.winterCGHeadersToDict = winterCGHeadersToDict; exports.winterCGRequestToRequestData = winterCGRequestToRequestData; //# sourceMappingURL=request.js.map /***/ }), /***/ 72332: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const currentScopes = __nccwpck_require__(8131); const dynamicSamplingContext = __nccwpck_require__(29724); const merge = __nccwpck_require__(32003); const spanUtils = __nccwpck_require__(47569); function applyScopeDataToEvent(event, data) { const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data; applyDataToEvent(event, data); if (span) { applySpanToEvent(event, span); } applyFingerprintToEvent(event, fingerprint); applyBreadcrumbsToEvent(event, breadcrumbs); applySdkMetadataToEvent(event, sdkProcessingMetadata); } function mergeScopeData(data, mergeData) { const { extra, tags, attributes, user, contexts, level, sdkProcessingMetadata, breadcrumbs, fingerprint, eventProcessors, attachments, propagationContext, transactionName, span } = mergeData; 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 }; } 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; if (Object.keys(extra).length) { event.extra = { ...extra, ...event.extra }; } if (Object.keys(tags).length) { event.tags = { ...tags, ...event.tags }; } if (Object.keys(user).length) { event.user = { ...user, ...event.user }; } if (Object.keys(contexts).length) { event.contexts = { ...contexts, ...event.contexts }; } if (level) { event.level = level; } if (transactionName && event.type !== "transaction") { event.transaction = transactionName; } } function applyBreadcrumbsToEvent(event, breadcrumbs) { const mergedBreadcrumbs = [...event.breadcrumbs || [], ...breadcrumbs]; event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : void 0; } function applySdkMetadataToEvent(event, sdkProcessingMetadata) { event.sdkProcessingMetadata = { ...event.sdkProcessingMetadata, ...sdkProcessingMetadata }; } function applySpanToEvent(event, span) { event.contexts = { trace: spanUtils.spanToTraceContext(span), ...event.contexts }; event.sdkProcessingMetadata = { dynamicSamplingContext: dynamicSamplingContext.getDynamicSamplingContextFromSpan(span), ...event.sdkProcessingMetadata }; const rootSpan = spanUtils.getRootSpan(span); const transactionName = spanUtils.spanToJSON(rootSpan).description; if (transactionName && !event.transaction && event.type === "transaction") { event.transaction = transactionName; } } function applyFingerprintToEvent(event, fingerprint) { event.fingerprint = event.fingerprint ? Array.isArray(event.fingerprint) ? event.fingerprint : [event.fingerprint] : []; if (fingerprint) { event.fingerprint = event.fingerprint.concat(fingerprint); } if (!event.fingerprint.length) { delete event.fingerprint; } } exports.applyScopeDataToEvent = applyScopeDataToEvent; exports.getCombinedScopeData = getCombinedScopeData; exports.mergeAndOverwriteScopeData = mergeAndOverwriteScopeData; exports.mergeScopeData = mergeScopeData; //# sourceMappingURL=scopeData.js.map /***/ }), /***/ 24054: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const version = __nccwpck_require__(71795); 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; } } 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, Symbol.toStringTag, { value: 'Module' }); const object = __nccwpck_require__(5906); const weakRef = __nccwpck_require__(98981); const SCOPE_SPAN_FIELD = "_sentrySpan"; function _setSpanForScope(scope, span) { if (span) { object.addNonEnumerableProperty(scope, SCOPE_SPAN_FIELD, weakRef.makeWeakRef(span)); } else { delete scope[SCOPE_SPAN_FIELD]; } } function _getSpanForScope(scope) { return weakRef.derefWeakRef(scope[SCOPE_SPAN_FIELD]); } exports._getSpanForScope = _getSpanForScope; exports._setSpanForScope = _setSpanForScope; //# sourceMappingURL=spanOnScope.js.map /***/ }), /***/ 47569: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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 semanticAttributes = __nccwpck_require__(36827); const spanstatus = __nccwpck_require__(21119); 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); const TRACE_FLAG_NONE = 0; const TRACE_FLAG_SAMPLED = 1; let hasShownSpanDropWarning = false; function spanToTransactionTraceContext(span) { const { spanId: span_id, traceId: trace_id } = span.spanContext(); const { data, op, parent_span_id, status, origin, links } = spanToJSON(span); return { parent_span_id, span_id, trace_id, data, op, status, origin, links }; } function spanToTraceContext(span) { const { spanId, traceId: trace_id, isRemote } = span.spanContext(); const parent_span_id = isRemote ? spanId : spanToJSON(span).parent_span_id; const scope = utils.getCapturedScopesOnSpan(span).scope; const span_id = isRemote ? scope?.getPropagationContext().propagationSpanId || propagationContext.generateSpanId() : spanId; return { parent_span_id, span_id, trace_id }; } function spanToTraceHeader(span) { const { traceId, spanId } = span.spanContext(); const sampled = spanIsSampled(span); return tracing.generateSentryTraceHeader(traceId, spanId, sampled); } 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") { return ensureTimestampInSeconds(input); } if (Array.isArray(input)) { return input[0] + input[1] / 1e9; } if (input instanceof Date) { return ensureTimestampInSeconds(input.getTime()); } return time.timestampInSeconds(); } function ensureTimestampInSeconds(timestamp) { const isMs = timestamp > 9999999999; return isMs ? timestamp / 1e3 : timestamp; } function spanToJSON(span) { if (spanIsSentrySpan(span)) { return span.getSpanJSON(); } 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) }; } 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; return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status; } function spanIsSentrySpan(span) { return typeof span.getSpanJSON === "function"; } function spanIsSampled(span) { const { traceFlags } = span.spanContext(); return traceFlags === TRACE_FLAG_SAMPLED; } function getStatusMessage(status) { if (!status || status.code === spanstatus.SPAN_STATUS_UNSET) { return void 0; } if (status.code === spanstatus.SPAN_STATUS_OK) { return "ok"; } return status.message || "internal_error"; } 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) { const rootSpan = span[ROOT_SPAN_FIELD] || span; 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, /* @__PURE__ */ new Set([childSpan])); } } function removeChildSpanFromSpan(span, childSpan) { if (span[CHILD_SPANS_FIELD]) { span[CHILD_SPANS_FIELD].delete(childSpan); } } function getSpanDescendants(span) { const resultSet = /* @__PURE__ */ new Set(); function addSpanChildren(span2) { if (resultSet.has(span2)) { return; } 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); } const getRootSpan = INTERNAL_getSegmentSpan; function INTERNAL_getSegmentSpan(span) { return span[ROOT_SPAN_FIELD] || 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()); } function showSpanDropWarning() { if (!hasShownSpanDropWarning) { debugLogger.consoleSandbox(() => { console.warn( "[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`." ); }); hasShownSpanDropWarning = true; } } function updateSpanName(span, name) { span.updateName(name); span.setAttributes({ [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.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, 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); const debugLogger = __nccwpck_require__(41772); const spanUtils = __nccwpck_require__(47569); const hasSpansEnabled = __nccwpck_require__(42982); const sentryNonRecordingSpan = __nccwpck_require__(36854); const dynamicSamplingContext = __nccwpck_require__(29724); const baggage = __nccwpck_require__(2135); const tracing = __nccwpck_require__(35606); function getTraceData(options = {}) { 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 = options.scope || currentScopes.getCurrentScope(); const span = options.span || spanUtils.getActiveSpan(); const isTwpPlaceholder = sentryNonRecordingSpan.spanIsNonRecordingSpan(span) && !hasSpansEnabled.hasSpansEnabled(client.getOptions()); if (!span && currentScopes.hasExternalPropagationContext()) { return {}; } 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; } function scopeToTraceHeader(scope) { 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; //# sourceMappingURL=traceData.js.map /***/ }), /***/ 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, 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"] ]; function replaceCronNames(cronExpression) { return replacements.reduce( // oxlint-disable-next-line sdk/no-regexp-constructor (acc, [name, replacement]) => acc.replace(new RegExp(name, "gi"), replacement), cronExpression ); } exports.replaceCronNames = replaceCronNames; //# sourceMappingURL=common.js.map /***/ }), /***/ 69480: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); const common = __nccwpck_require__(40639); 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") { 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, onComplete2) { return core.withMonitor( monitorSlug, async () => { try { await onTick(context, onComplete2); } catch (e) { core.captureException(e, { mechanism: { handled: false, type: "auto.function.cron.instrumentCron" } }); throw e; } }, { schedule: { type: "crontab", value: cronString }, timezone: timeZone || void 0 } ); } return new target(cronTime, monitoredTick, onComplete, start, timeZone, ...rest); }, get(target, prop) { if (prop === "from") { return (param) => { const { cronTime, onTick, timeZone } = param; 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, async () => { try { await onTick(context, onComplete); } catch (e) { core.captureException(e, { mechanism: { handled: false, type: "auto.function.cron.instrumentCron" } }); throw e; } }, { schedule: { type: "crontab", value: cronString }, timezone: timeZone || void 0 } ); }; return target.from(param); }; } else { return target[prop]; } } }); } exports.instrumentCron = instrumentCron; //# sourceMappingURL=cron.js.map /***/ }), /***/ 28607: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const cron$1 = __nccwpck_require__(69480); const nodeCron = __nccwpck_require__(26063); const nodeSchedule = __nccwpck_require__(32235); const cron = { instrumentCron: cron$1.instrumentCron, instrumentNodeCron: nodeCron.instrumentNodeCron, instrumentNodeSchedule: nodeSchedule.instrumentNodeSchedule }; exports.cron = cron; //# sourceMappingURL=index.js.map /***/ }), /***/ 26063: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); const common = __nccwpck_require__(40639); function instrumentNodeCron(lib, monitorConfig = {}) { return new Proxy(lib, { get(target, prop) { if (prop === "schedule" && target.schedule) { return new Proxy(target.schedule, { apply(target2, thisArg, argArray) { const [expression, callback, options] = argArray; 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.'); } const monitoredCallback = async (...args) => { return core.withMonitor( name, async () => { try { return await callback(...args); } catch (e) { core.captureException(e, { mechanism: { handled: false, type: "auto.function.node-cron.instrumentNodeCron" } }); throw e; } }, { schedule: { type: "crontab", value: common.replaceCronNames(expression) }, timezone, ...monitorConfig } ); }; return target2.apply(thisArg, [expression, monitoredCallback, options]); } }); } else { return target[prop]; } } }); } exports.instrumentNodeCron = instrumentNodeCron; //# sourceMappingURL=node-cron.js.map /***/ }), /***/ 32235: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); const common = __nccwpck_require__(40639); function instrumentNodeSchedule(lib) { return new Proxy(lib, { get(target, prop) { if (prop === "scheduleJob") { return new Proxy(target.scheduleJob, { apply(target2, thisArg, argArray) { const [nameOrExpression, expressionOrCallback, callback] = argArray; 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" ); } const monitorSlug = nameOrExpression; const expression = expressionOrCallback; async function monitoredCallback() { return core.withMonitor( monitorSlug, async () => { await callback?.(); }, { schedule: { type: "crontab", value: common.replaceCronNames(expression) } } ); } return target2.apply(thisArg, [monitorSlug, expression, monitoredCallback]); } }); } return target[prop]; } }); } exports.instrumentNodeSchedule = instrumentNodeSchedule; //# sourceMappingURL=node-schedule.js.map /***/ }), /***/ 20624: /***/ ((__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 /***/ }), /***/ 28648: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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 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$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.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.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; 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.createTransport = core.createTransport; exports.dedupeIntegration = core.dedupeIntegration; exports.endSession = core.endSession; exports.envToBool = core.envToBool; exports.eventFiltersIntegration = core.eventFiltersIntegration; 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.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.metrics; 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.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.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.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 /***/ }), /***/ 88270: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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__(61523); const debug = __nccwpck_require__(10992); const { isPromise } = util.types; const base64WorkerScript = "LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjcxLjAgKDlmY2IwNjMpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyB0fWZyb20ibm9kZTppbnNwZWN0b3IiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIG4scGFyZW50UG9ydCBhcyBlfWZyb20ibm9kZTp3b3JrZXJfdGhyZWFkcyI7aW1wb3J0e3Bvc2l4IGFzIHIsc2VwIGFzIG99ZnJvbSJub2RlOnBhdGgiO2ltcG9ydCphcyBpIGZyb20ibm9kZTpodHRwIjtpbXBvcnQqYXMgcyBmcm9tIm5vZGU6aHR0cHMiO2ltcG9ydHtSZWFkYWJsZSBhcyBjfWZyb20ibm9kZTpzdHJlYW0iO2ltcG9ydHtjcmVhdGVHemlwIGFzIHV9ZnJvbSJub2RlOnpsaWIiO2ltcG9ydCphcyBhIGZyb20ibm9kZTpuZXQiO2ltcG9ydCphcyBmIGZyb20ibm9kZTp0bHMiO2NvbnN0IGg9InVuZGVmaW5lZCI9PXR5cGVvZiBfX1NFTlRSWV9ERUJVR19ffHxfX1NFTlRSWV9ERUJVR19fLHA9Z2xvYmFsVGhpcyxkPSIxMC43MS4wIjtmdW5jdGlvbiBsKCl7cmV0dXJuIGcocCkscH1mdW5jdGlvbiBnKHQpe2NvbnN0IG49dC5fX1NFTlRSWV9fPXQuX19TRU5UUllfX3x8e307cmV0dXJuIG4udmVyc2lvbj1uLnZlcnNpb258fGQsbltkXT1uW2RdfHx7fX1mdW5jdGlvbiBtKHQsbixlPXApe2NvbnN0IHI9ZS5fX1NFTlRSWV9fPWUuX19TRU5UUllfX3x8e30sbz1yW2RdPXJbZF18fHt9O3JldHVybiBvW3RdfHwob1t0XT1uKCkpfWNvbnN0IHk9e307ZnVuY3Rpb24gYih0KXtpZighKCJjb25zb2xlImluI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JihpPSExKX0sMjApLHtwb2xsOigpPT57by5yZXNldCgpfSxlbmFibGVkOnQ9PntzPXR9fX0oZnVuY3Rpb24oKXtsZXQgdD1wcm9jZXNzLmhydGltZSgpO3JldHVybntnZXRUaW1lTXM6KCk9Pntjb25zdFtuLGVdPXByb2Nlc3MuaHJ0aW1lKHQpO3JldHVybiBNYXRoLmZsb29yKDFlMypuK2UvMWU2KX0scmVzZXQ6KCk9Pnt0PXByb2Nlc3MuaHJ0aW1lKCl9fX0sYW4ucG9sbEludGVydmFsLGFuLmFuclRocmVzaG9sZCxmdW5jdGlvbigpe2RuKCJXYXRjaGRvZyB0aW1lb3V0IiksU24/KGRuKCJQYXVzaW5nIGRlYnVnZ2VyIHRvIGNhcHR1cmUgc3RhY2sgdHJhY2UiKSxTbigpKTooZG4oIkNhcHR1cmluZyBldmVudCB3aXRob3V0IGEgc3RhY2sgdHJhY2UiKSxfbigpLnRoZW4obnVsbCwoKT0+e2RuKCJTZW5kaW5nIEFOUiBldmVudCBmYWlsZWQgb24gd2F0Y2hkb2cgdGltZW91dC4iKX0pKX0pO2U/Lm9uKCJtZXNzYWdlIix0PT57dC5zZXNzaW9uJiYoZm49SCh0LnNlc3Npb24pKSx0LmRlYnVnSW1hZ2VzJiYocG49dC5kZWJ1Z0ltYWdlcyksd24oKX0pOw=="; const DEFAULT_INTERVAL = 50; const DEFAULT_HANG_THRESHOLD = 5e3; function log(message, ...args) { core.debug.log(`[ANR] ${message}`, ...args); } function globalWithScopeFetchFn() { return core.GLOBAL_OBJ; } function getScopeData() { const scope = core.getCombinedScopeData(core.getIsolationScope(), core.getCurrentScope()); scope.attachments = []; scope.eventProcessors = []; return scope; } async function getContexts(client) { let event = { message: "ANR" }; const eventHint = {}; for (const processor of client.getEventProcessors()) { if (event === null) break; event = await processor(event, eventHint); } return event?.contexts || {}; } 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"); } let worker; let client; 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) { worker.then((stop) => { stop(); worker = void 0; }); } }, async setup(initClient) { client = initClient; if (options.captureStackTrace && await debug.isDebuggerEnabled()) { core.debug.warn("ANR captureStackTrace has been disabled because the debugger was already enabled"); options.captureStackTrace = false; } setImmediate(() => this.startWorker()); } }; }); const anrIntegration = core.defineIntegration(_anrIntegration); async function _startWorker(client, integrationOptions) { const dsn = client.getDsn(); if (!dsn) { return () => { }; } const contexts = await getContexts(client); 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); } const options = { debug: core.debug.isEnabled(), dsn, tunnel: initOptions.tunnel, environment: initOptions.environment || "production", release: initOptions.release, dist: initOptions.dist, sdkMetadata, appRootPath: integrationOptions.appRootPath, pollInterval: integrationOptions.pollInterval || DEFAULT_INTERVAL, anrThreshold: integrationOptions.anrThreshold || DEFAULT_HANG_THRESHOLD, captureStackTrace: !!integrationOptions.captureStackTrace, maxAnrEvents: integrationOptions.maxAnrEvents || 1, staticTags: integrationOptions.staticTags || {}, 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: void 0 } }); process.on("exit", () => { worker.terminate(); }); const timer = setInterval(() => { try { const currentSession = core.getIsolationScope().getSession(); const session = currentSession ? { ...currentSession, toJSON: void 0 } : void 0; worker.postMessage({ session, debugImages: core.getFilenameToDebugIdMap(initOptions.stackParser) }); } catch { } }, options.pollInterval); timer.unref(); 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) => { clearInterval(timer); log("ANR worker error", err); }); worker.once("exit", (code) => { clearInterval(timer); log("ANR worker exit", code); }); worker.unref(); return () => { worker.terminate(); clearInterval(timer); }; } function disableAnrDetectionForCallback(callback) { 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; } exports.anrIntegration = anrIntegration; exports.base64WorkerScript = base64WorkerScript; exports.disableAnrDetectionForCallback = disableAnrDetectionForCallback; //# sourceMappingURL=index.js.map /***/ }), /***/ 57342: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const diagnosticsChannel = __nccwpck_require__(65714); const core = __nccwpck_require__(84466); const INTEGRATION_NAME = "ChildProcess"; const childProcessIntegration = core.defineIntegration((options = {}) => { return { name: INTEGRATION_NAME, setup() { diagnosticsChannel.channel("child_process").subscribe((event) => { if (core.isObjectLike(event) && "process" in event) { captureChildProcessEvents(event.process, options); } }); diagnosticsChannel.channel("worker_threads").subscribe((event) => { if (core.isObjectLike(event) && "worker" in event) { captureWorkerThreadEvents(event.worker, options); } }); } }; }); function captureChildProcessEvents(child, options) { let hasExited = false; let data; 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 exited with code '${code}'`, level: code === 0 ? "info" : "warning", data }); } } }).on("error", (error) => { if (!hasExited) { hasExited = true; core.addBreadcrumb({ 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; //# sourceMappingURL=childProcess.js.map /***/ }), /***/ 48597: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); const consoleIntegration = core.defineIntegration((options = {}) => { return { name: "Console", setup(client) { 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 /***/ }), /***/ 33141: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const node_child_process = __nccwpck_require__(17718); const node_fs = __nccwpck_require__(87561); const os = __nccwpck_require__(70612); const node_path = __nccwpck_require__(49411); const util = __nccwpck_require__(47261); const core = __nccwpck_require__(84466); const readFileAsync = util.promisify(node_fs.readFile); const readDirAsync = util.promisify(node_fs.readdir); const INTEGRATION_NAME = "Context"; const _nodeContextIntegration = ((options = {}) => { const _options = { app: true, os: true, device: true, culture: true, cloudResource: true, ...options }; 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; } 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, ...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; } return { name: INTEGRATION_NAME, processEvent(event) { return addContext(event); }, processSegmentSpan(span) { core.safeSetSpanJSONAttributes(span, cachedSpanAttributes); core.safeSetSpanJSONAttributes(span, getDynamicSpanAttributes(appContext, deviceContext)); } }; }); const nodeContextIntegration = core.defineIntegration(_nodeContextIntegration); function _updateContext(contexts) { if (contexts.app?.app_memory) { contexts.app.app_memory = process.memoryUsage().rss; } if (contexts.app?.free_memory && typeof process.availableMemory === "function") { const freeMemory = process.availableMemory?.(); if (freeMemory != null) { contexts.app.free_memory = freeMemory; } } if (contexts.device?.free_memory) { contexts.device.free_memory = os.freemem(); } return contexts; } 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": return getDarwinInfo(); case "linux": return getLinuxInfo(); default: return { name: PLATFORM_NAMES[platformId] || platformId, version: os.release() }; } } function getCultureContext() { try { if (typeof process.versions.icu !== "string") { return; } 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 }; } } catch { } return; } function getAppContext() { const app_memory = process.memoryUsage().rss; 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 = process.availableMemory?.(); if (freeMemory != null) { appContext.free_memory = freeMemory; } } return appContext; } function getDeviceContext(deviceOpt) { const device = {}; let uptime; try { uptime = os.uptime(); } catch { } 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?.[0]; if (firstCpu) { device.processor_count = cpuInfo.length; device.cpu_description = firstCpu.model; device.processor_frequency = firstCpu.speed; } } return device; } const PLATFORM_NAMES = { aix: "IBM AIX", freebsd: "FreeBSD", openbsd: "OpenBSD", sunos: "SunOS", win32: "Windows", ohos: "OpenHarmony", android: "Android" }; 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"] } ]; 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) }; function matchFirst(regex, text) { const match = regex.exec(text); return match ? match[1] : void 0; } async function getDarwinInfo() { const darwinInfo = { kernel_version: os.release(), name: "Mac OS X", version: `10.${Number(os.release().split(".")[0]) - 4}` }; try { const output = await new Promise((resolve, reject) => { node_child_process.execFile("/usr/bin/sw_vers", (error, stdout) => { if (error) { reject(error); return; } resolve(stdout); }); }); darwinInfo.name = matchFirst(/^ProductName:\s+(.*)$/m, output); darwinInfo.version = matchFirst(/^ProductVersion:\s+(.*)$/m, output); darwinInfo.build = matchFirst(/^BuildVersion:\s+(.*)$/m, output); } catch { } return darwinInfo; } function getLinuxDistroId(name) { return name.split(" ")[0].toLowerCase(); } async function getLinuxInfo() { const linuxInfo = { kernel_version: os.release(), name: "Linux" }; try { const etcFiles = await readDirAsync("/etc"); const distroFile = LINUX_DISTROS.find((file) => etcFiles.includes(file.name)); if (!distroFile) { return linuxInfo; } 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]; const id = getLinuxDistroId(linuxInfo.name); linuxInfo.version = LINUX_VERSIONS[id]?.(contents); } catch { } return linuxInfo; } function getCloudResourceContext() { if (process.env.VERCEL) { return { "cloud.provider": "vercel", "cloud.region": process.env.VERCEL_REGION }; } else if (process.env.AWS_REGION) { return { "cloud.provider": "aws", "cloud.region": process.env.AWS_REGION, "cloud.platform": process.env.AWS_EXECUTION_ENV }; } else if (process.env.GCP_PROJECT) { return { "cloud.provider": "gcp" }; } else if (process.env.ALIYUN_REGION_ID) { return { "cloud.provider": "alibaba_cloud", "cloud.region": process.env.ALIYUN_REGION_ID }; } else if (process.env.WEBSITE_SITE_NAME && process.env.REGION_NAME) { return { "cloud.provider": "azure", "cloud.region": process.env.REGION_NAME }; } else if (process.env.IBM_CLOUD_REGION) { return { "cloud.provider": "ibm_cloud", "cloud.region": process.env.IBM_CLOUD_REGION }; } else if (process.env.TENCENTCLOUD_REGION) { 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 }; } else if (process.env.NETLIFY) { return { "cloud.provider": "netlify" }; } else if (process.env.FLY_REGION) { return { "cloud.provider": "fly.io", "cloud.region": process.env.FLY_REGION }; } else if (process.env.DYNO) { return { "cloud.provider": "heroku" }; } else { return void 0; } } exports.contextsToSpanAttributes = contextsToSpanAttributes; exports.getAppContext = getAppContext; exports.getDeviceContext = getDeviceContext; exports.getDynamicSpanAttributes = getDynamicSpanAttributes; exports.nodeContextIntegration = nodeContextIntegration; exports.readDirAsync = readDirAsync; exports.readFileAsync = readFileAsync; //# sourceMappingURL=context.js.map /***/ }), /***/ 23751: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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__(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"; const MAX_CONTEXTLINES_COLNO = 1e3; const MAX_CONTEXTLINES_LINENO = 1e4; function emplace(map, key, contents) { const value = map.get(key); if (value === void 0) { map.set(key, contents); return contents; } return value; } function shouldSkipContextLinesForFile(path) { 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; } function shouldSkipContextLinesForFrame(frame) { 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; } function rangeExistsInContentCache(file, range) { const contents = LRU_FILE_CONTENTS_CACHE.get(file); if (contents === void 0) return false; for (let i = range[0]; i <= range[1]; i++) { if (contents[i] === void 0) { return false; } } return true; } function makeLineReaderRanges(lines, linecontext) { if (!lines.length) { return []; } let i = 0; const line = lines[0]; if (typeof line !== "number") { return []; } let current = makeContextRange(line, linecontext); const out = []; while (true) { if (i === lines.length - 1) { out.push(current); break; } const next = lines[i + 1]; if (typeof next !== "number") { break; } if (next <= current[1]) { current[1] = next + linecontext; } else { out.push(current); current = makeContextRange(next, linecontext); } i++; } return out; } function getContextLinesFromFile(path, ranges, output) { return new Promise((resolve, _reject) => { const stream = node_fs.createReadStream(path); const lineReaded = node_readline.createInterface({ input: stream }); function destroyStreamAndResolve() { stream.destroy(); resolve(); } let lineNumber = 0; let currentRangeIndex = 0; const range = ranges[currentRangeIndex]; if (range === void 0) { destroyStreamAndResolve(); return; } let rangeStart = range[0]; let rangeEnd = range[1]; function onStreamError(e) { LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1); debugBuild.DEBUG_BUILD && core.debug.error(`Failed to read file: ${path}. Error: ${e}`); lineReaded.close(); lineReaded.removeAllListeners(); destroyStreamAndResolve(); } stream.on("error", onStreamError); lineReaded.on("error", onStreamError); lineReaded.on("close", destroyStreamAndResolve); lineReaded.on("line", (line) => { lineNumber++; if (lineNumber < rangeStart) return; output[lineNumber] = core.snipLine(line, 0); if (lineNumber >= rangeEnd) { if (currentRangeIndex === ranges.length - 1) { lineReaded.close(); lineReaded.removeAllListeners(); return; } currentRangeIndex++; const range2 = ranges[currentRangeIndex]; if (range2 === void 0) { lineReaded.close(); lineReaded.removeAllListeners(); return; } rangeStart = range2[0]; rangeEnd = range2[1]; } }); }); } async function addSourceContext(event, contextLines) { const filesToLines = {}; if (contextLines > 0 && event.exception?.values) { for (const exception of event.exception.values) { if (!exception.stacktrace?.frames?.length) { continue; } for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) { const frame = exception.stacktrace.frames[i]; 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] = []; filesToLines[filename].push(frame.lineno); } } } const files = Object.keys(filesToLines); if (files.length == 0) { return event; } const readlinePromises = []; for (const file of files) { if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) { continue; } const filesToLineRanges = filesToLines[file]; if (!filesToLineRanges) { continue; } filesToLineRanges.sort((a, b) => a - b); const ranges = makeLineReaderRanges(filesToLineRanges, contextLines); if (ranges.every((r) => rangeExistsInContentCache(file, r))) { continue; } const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {}); readlinePromises.push(getContextLinesFromFile(file, ranges, cache)); } await Promise.all(readlinePromises).catch(() => { debugBuild.DEBUG_BUILD && core.debug.log("Failed to read one or more source files and resolve context lines"); }); if (contextLines > 0 && event.exception?.values) { for (const exception of event.exception.values) { if (exception.stacktrace?.frames && exception.stacktrace.frames.length > 0) { addSourceContextToFrames(exception.stacktrace.frames, contextLines, LRU_FILE_CONTENTS_CACHE); } } } return event; } function addSourceContextToFrames(frames, contextLines, cache) { for (const frame of frames) { if (frame.filename && frame.context_line === void 0 && typeof frame.lineno === "number") { const contents = cache.get(frame.filename); if (contents === void 0) { continue; } addContextToFrame(frame.lineno, frame, contextLines, contents); } } } function clearLineContext(frame) { delete frame.pre_context; delete frame.context_line; delete frame.post_context; } 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++) { const line = contents[i]; if (line === void 0) { clearLineContext(frame); debugBuild.DEBUG_BUILD && core.debug.error(`Could not find line ${i} in file ${frame.filename}`); return; } frame.pre_context.push(line); } if (contents[lineno] === void 0) { clearLineContext(frame); 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++) { const line = contents[i]; if (line === void 0) { break; } frame.post_context.push(line); } } function makeRangeStart(line, linecontext) { return Math.max(1, line - linecontext); } function makeRangeEnd(line, linecontext) { return line + linecontext; } function makeContextRange(line, linecontext) { return [makeRangeStart(line, linecontext), makeRangeEnd(line, linecontext)]; } const _contextLinesIntegration = ((options = {}) => { return { name: INTEGRATION_NAME, processEvent(event, _hint, client) { const contextLines = options.frameContextLines ?? client?.getDataCollectionOptions().frameContextLines ?? DEFAULT_LINES_OF_CONTEXT; return addSourceContext(event, contextLines); } }; }); const contextLinesIntegration = core.defineIntegration(_contextLinesIntegration); exports.MAX_CONTEXTLINES_COLNO = MAX_CONTEXTLINES_COLNO; exports.MAX_CONTEXTLINES_LINENO = MAX_CONTEXTLINES_LINENO; exports._contextLinesIntegration = _contextLinesIntegration; exports.addContextToFrame = addContextToFrame; exports.contextLinesIntegration = contextLinesIntegration; //# sourceMappingURL=contextlines.js.map /***/ }), /***/ 17075: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const diagnosticsChannel = __nccwpck_require__(65714); const api = __nccwpck_require__(65163); const instrumentation = __nccwpck_require__(65584); 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); 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); } const parentContext = api.context.active(); const requestContext = api.trace.setSpan(parentContext, span); return api.context.with(requestContext, () => { return target.apply(thisArg, args); }); } }); 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 /***/ }), /***/ 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__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const diagnosticsChannel = __nccwpck_require__(65714); const api = __nccwpck_require__(65163); const core = __nccwpck_require__(84466); const debugBuild = __nccwpck_require__(20624); 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() { 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); } }; }); exports.httpIntegration = httpIntegration; //# sourceMappingURL=index.js.map /***/ }), /***/ 97988: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); function filterFrameVariables(vars, behavior) { return core._INTERNAL_filterKeyValueData(vars, behavior); } 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); if (retrySeconds > 86400) { retrySeconds = 86400; } disabledTimeout = retrySeconds; } } else { disabledTimeout -= 1; if (disabledTimeout === 0) { enable(); } } count = 0; }, 1e3).unref(); return () => { count += 1; }; } function isAnonymous(name) { return name !== void 0 && (name.length === 0 || name === "?" || name === ""); } function functionNamesMatch(a, 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 /***/ }), /***/ 43482: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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); }; exports.localVariablesIntegration = localVariablesIntegration; //# sourceMappingURL=index.js.map /***/ }), /***/ 26793: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const node_worker_threads = __nccwpck_require__(24086); const core = __nccwpck_require__(84466); const debug = __nccwpck_require__(10992); const common = __nccwpck_require__(97988); const base64WorkerScript = "LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjcxLjAgKDlmY2IwNjMpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9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Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs="; function log(...args) { core.debug.log("[LocalVariables]", ...args); } 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++) { const frameIndex = frames.length - i - 1; const frameLocalVariables = localVariables[i]; const frame = frames[frameIndex]; if (!frame || !frameLocalVariables) { break; } if ( // We need to have vars to add 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 = 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])) { 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] = void 0; } return event; } async function startInspector() { 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: void 0 } }); process.on("exit", () => { worker.terminate(); }); worker.once("error", (err) => { log("Worker error", err); }); worker.once("exit", (code) => { log("Worker exit", code); }); worker.unref(); } return { name: "LocalVariablesAsync", async setup(client) { const clientOptions = client.getOptions(); if (!clientOptions.includeLocalVariables) { return; } if (await debug.isDebuggerEnabled()) { core.debug.warn("Local variables capture has been disabled because the debugger was already enabled"); return; } const options = { ...integrationOptions, debug: core.debug.isEnabled() }; startInspector().then( () => { try { startWorker(options); } catch (e) { core.debug.error("Failed to start worker", e); } }, (e) => { core.debug.error("Failed to start inspector", e); } ); }, processEvent(event, hint) { return addLocalVariablesToEvent(event, hint); } }; })); exports.base64WorkerScript = base64WorkerScript; exports.localVariablesAsyncIntegration = localVariablesAsyncIntegration; //# sourceMappingURL=local-variables-async.js.map /***/ }), /***/ 82866: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); const nodeVersion = __nccwpck_require__(61523); const debug = __nccwpck_require__(10992); const common = __nccwpck_require__(97988); function hashFrames(frames) { if (frames === void 0) { return; } return frames.slice(-10).reduce((acc, frame) => `${acc},${frame.function},${frame.lineno},${frame.colno}`, ""); } function hashFromStack(stackParser, stack) { if (stack === void 0) { return void 0; } return hashFrames(stackParser(stack, 1)); } function createCallbackList(complete) { let callbacks = []; let completedCalled = false; function checkedComplete(result) { callbacks = []; if (completedCalled) { return; } completedCalled = true; complete(result); } callbacks.push(checkedComplete); function add(fn) { callbacks.push(fn); } function next(result) { const popped = callbacks.pop() || checkedComplete; try { popped(result); } catch { checkedComplete(result); } } return { add, next }; } class AsyncSession { /** Throws if inspector API is not available */ constructor(_session) { this._session = _session; } 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) { this._session.connect(); this._session.on("Debugger.paused", (event) => { onPause(event, () => { this._session.post("Debugger.resume"); }); }); 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" }); } /** @inheritdoc */ getLocalVariables(objectId, complete) { this._getProperties(objectId, (props) => { const { add, next } = createCallbackList(complete); for (const prop of props) { if (prop.value?.objectId && prop.value.className === "Array") { const id = prop.value.objectId; 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 (prop.value) { add((vars) => this._unrollOther(prop, vars, next)); } } next({}); }); } /** * Gets all the PropertyDescriptors of an object */ _getProperties(objectId, next) { this._session.post( "Runtime.getProperties", { objectId, ownProperties: true }, (err, params) => { if (err) { next([]); } 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) => 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, v.value?.value]).reduce((obj, [key, val]) => { obj[key] = val; return obj; }, {}); next(vars); }); } /** * Unrolls other properties */ _unrollOther(prop, vars, next) { if (prop.value) { 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") { vars[prop.name] = `<${prop.value.description}>`; } else if (prop.value.type === "undefined") { vars[prop.name] = ""; } } next(vars); } } const INTEGRATION_NAME = "LocalVariables"; const _localVariablesSyncIntegration = ((options = {}, sessionOverride) => { const cachedFrames = new core.LRUMap(20); let rateLimiter; let shouldProcessEvent = false; function addLocalVariablesToException(exception, behavior) { const hash = hashFrames(exception.stacktrace?.frames); if (hash === void 0) { return; } const cachedFrame = cachedFrames.remove(hash); if (cachedFrame === void 0 || behavior === false) { return; } const frames = (exception.stacktrace?.frames || []).filter((frame) => frame.function !== "new Promise"); for (let i = 0; i < frames.length; i++) { const frameIndex = frames.length - i - 1; const cachedFrameVariable = cachedFrame[i]; const frameVariable = frames[frameIndex]; if (!frameVariable || !cachedFrameVariable) { break; } if ( // We need to have vars to add 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 = common.filterFrameVariables(cachedFrameVariable.vars, behavior); } } function addLocalVariablesToEvent(event) { for (const exception of event.exception?.values || []) { addLocalVariablesToException(exception, core.getClient()?.getDataCollectionOptions().stackFrameVariables ?? true); } return event; } 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); }); } else { const id = localScope.object.objectId; add( (frames) => session.getLocalVariables(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.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(); }, async processEvent(event) { await setupPromise; if (shouldProcessEvent) { return addLocalVariablesToEvent(event); } return event; }, // These are entirely for testing _getCachedFramesCount() { return cachedFrames.size; }, _getFirstCachedFrame() { return cachedFrames.values()[0]; } }; }); const localVariablesSyncIntegration = core.defineIntegration(_localVariablesSyncIntegration); exports.createCallbackList = createCallbackList; exports.hashFrames = hashFrames; exports.hashFromStack = hashFromStack; exports.localVariablesSyncIntegration = localVariablesSyncIntegration; //# sourceMappingURL=local-variables-sync.js.map /***/ }), /***/ 82516: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const node_fs = __nccwpck_require__(87561); const node_path = __nccwpck_require__(49411); const core = __nccwpck_require__(84466); let moduleCache; 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() }; return event; }, getModules: _getModules }; }); const modulesIntegration = _modulesIntegration; function getRequireCachePaths() { try { return require.cache ? Object.keys(require.cache) : []; } catch { return []; } } 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; const updir = () => { const orig = dir; dir = node_path.dirname(orig); 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.add(orig); if (!node_fs.existsSync(pkgfile)) { return updir(); } try { const info = JSON.parse(node_fs.readFileSync(pkgfile, "utf8")); infos[info.name] = info.version; } catch { } }; updir(); }); return infos; } 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 /***/ }), /***/ 61611: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const instrumentation = __nccwpck_require__(65584); const core = __nccwpck_require__(84466); const diagch = __nccwpck_require__(67643); const nodeVersion = __nccwpck_require__(61523); const outgoingFetchRequest = __nccwpck_require__(28847); 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; } 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; } 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); } } exports.SentryNodeFetchInstrumentation = SentryNodeFetchInstrumentation; //# sourceMappingURL=SentryNodeFetchInstrumentation.js.map /***/ }), /***/ 18285: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); const undiciInstrumentation = __nccwpck_require__(84948); 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() { 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)); } }; }); 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 = 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; } 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) { firstError = error; caughtFirstError = true; if (core.getClient() === client) { core.captureException(error, { originalException: error, captureContext: { level: "fatal" }, mechanism: { handled: false, type: "auto.node.onuncaughtexception" } }); } if (!calledFatalError && shouldApplyFatalHandlingLogic) { calledFatalError = true; onFatalError(error); } } else { if (shouldApplyFatalHandlingLogic) { if (calledFatalError) { 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) { caughtSecondError = true; setTimeout(() => { if (!calledFatalError) { calledFatalError = true; onFatalError(firstError, error); } }, timeout); } } } }, { _errorHandler: true } ); } exports.makeErrorHandler = makeErrorHandler; exports.onUncaughtExceptionIntegration = onUncaughtExceptionIntegration; //# sourceMappingURL=onuncaughtexception.js.map /***/ }), /***/ 68319: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); 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 opts = { mode: options.mode ?? "warn", ignore: [...DEFAULT_IGNORES, ...options.ignore ?? []] }; return { name: INTEGRATION_NAME, setup(client) { global.process.on("unhandledRejection", makeUnhandledPromiseHandler(client, opts)); } }; }); const onUnhandledRejectionIntegration = core.defineIntegration(_onUnhandledRejectionIntegration); 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; } 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.mode); }; } 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(core.isObjectLike(reason) && "stack" in reason ? reason.stack : reason); }); } else if (mode === "strict") { core.consoleSandbox(() => { console.warn(rejectionWarning); }); errorhandling.logAndExitProcess(reason); } } exports.makeUnhandledPromiseHandler = makeUnhandledPromiseHandler; exports.onUnhandledRejectionIntegration = onUnhandledRejectionIntegration; //# sourceMappingURL=onunhandledrejection.js.map /***/ }), /***/ 44906: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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 _spotlightIntegration = ((options = {}) => { const _options = { sidecarUrl: options.sidecarUrl || "http://localhost:8969/stream" }; return { name: INTEGRATION_NAME, setup(client) { 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); } }; }); const spotlightIntegration = core.defineIntegration(_spotlightIntegration); function connectToSpotlight(client, options) { const spotlightUrl = parseSidecarUrl(options.sidecarUrl); if (!spotlightUrl) { return; } let failedRequests = 0; client.on("beforeEnvelope", (envelope) => { if (failedRequests > 3) { core.debug.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests"); return; } const serializedEnvelope = core.serializeEnvelope(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) { failedRequests = 0; } res.on("data", () => { }); res.on("end", () => { }); res.setEncoding("utf8"); } ); req.on("error", () => { failedRequests++; core.debug.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar"); }); req.write(serializedEnvelope); req.end(); }); }); } function parseSidecarUrl(url) { try { return new URL(`${url}`); } catch { core.debug.warn(`[Spotlight] Invalid sidecar URL: ${url}`); return void 0; } } exports.INTEGRATION_NAME = INTEGRATION_NAME; exports.spotlightIntegration = spotlightIntegration; //# sourceMappingURL=spotlight.js.map /***/ }), /***/ 8651: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const util = __nccwpck_require__(47261); const core = __nccwpck_require__(84466); 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); } const systemErrorIntegration = core.defineIntegration((options = {}) => { return { name: INTEGRATION_NAME, processEvent: (event, hint, client) => { if (!isSystemError(hint.originalException)) { return event; } const error = hint.originalException; const errorContext = { ...error }; if (!client.getDataCollectionOptions().userInfo && options.includePaths !== true) { delete errorContext.path; delete errorContext.dest; } event.contexts = { ...event.contexts, node_system_error: errorContext }; 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(); } if (error.dest && exception.value.includes(error.dest)) { exception.value = exception.value.replace(`'${error.dest}'`, "").trim(); } } } return event; } }; }); exports.systemErrorIntegration = systemErrorIntegration; //# sourceMappingURL=systemError.js.map /***/ }), /***/ 52453: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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); 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.captureLog = captureLog; //# sourceMappingURL=capture.js.map /***/ }), /***/ 31344: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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_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 /***/ }), /***/ 10402: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const opentelemetry = __nccwpck_require__(90157); const SentryContextManager = opentelemetry.SentryAsyncLocalStorageContextManager; exports.SentryContextManager = SentryContextManager; //# sourceMappingURL=contextManager.js.map /***/ }), /***/ 17547: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const instrumentation = __nccwpck_require__(65584); const INSTRUMENTED = {}; 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) { instrumented.setConfig(options); } return instrumented; } const instrumentation$1 = creator(options); INSTRUMENTED[name] = instrumentation$1; instrumentation.registerInstrumentations({ instrumentations: [instrumentation$1] }); return instrumentation$1; }, { 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 /***/ }), /***/ 48811: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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); 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) { if (typeof options.secureEndpoint === "boolean") { return options.secureEndpoint; } if (typeof options.protocol === "string") { return options.protocol === "https:"; } } 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); } createSocket(req, options, cb) { const connectOpts = { ...options, secureEndpoint: this.isSecureEndpoint(options) }; 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 = void 0; if (!socket) { throw new Error("No socket was returned in the `connect()` function"); } return socket; } get defaultPort() { return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); } set defaultPort(v) { if (this[INTERNAL]) { this[INTERNAL].defaultPort = v; } } get protocol() { return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); } set protocol(v) { if (this[INTERNAL]) { this[INTERNAL].protocol = v; } } } exports.Agent = Agent; //# sourceMappingURL=base.js.map /***/ }), /***/ 82063: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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__(15337); const parseProxyResponse = __nccwpck_require__(60286); function debugLog(...args) { core.debug.log("[https-proxy-agent]", ...args); } class HttpsProxyAgent extends base.Agent { constructor(proxy, opts) { super(opts); this.options = {}; 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, host, 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'); } let socket; 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) ? void 0 : servername }); } else { debugLog("Creating `net.Socket`: %o", this.connectOpts); socket = net.connect(this.connectOpts); } 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 `; if (proxy.username || proxy.password) { const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; 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"; } for (const name of Object.keys(headers)) { payload += `${name}: ${headers[name]}\r `; } const proxyResponsePromise = parseProxyResponse.parseProxyResponse(socket); socket.write(`${payload}\r `); const { connect, buffered } = await proxyResponsePromise; req.emit("proxyConnect", connect); this.emit("proxyConnect", connect, req); if (connect.statusCode === 200) { req.once("socket", resume); if (opts.secureEndpoint) { debugLog("Upgrading socket connection to TLS"); const servername = opts.servername || opts.host; return tls.connect({ ...omit(opts, "host", "path", "port"), socket, servername: net.isIP(servername) ? void 0 : servername }); } return socket; } socket.destroy(); const fakeSocket = new net.Socket({ writable: false }); fakeSocket.readable = true; req.once("socket", (s) => { debugLog("Replaying proxy buffer for failed request"); s.push(buffered); s.push(null); }); return fakeSocket; } } HttpsProxyAgent.protocols = ["http", "https"]; function resume(socket) { socket.resume(); } function omit(obj, ...keys) { const ret = {}; let key; for (key in obj) { if (!keys.includes(key)) { ret[key] = obj[key]; } } return ret; } exports.HttpsProxyAgent = HttpsProxyAgent; //# sourceMappingURL=index.js.map /***/ }), /***/ 60286: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); function debugLog(...args) { core.debug.log("[https-proxy-agent:parse-proxy-response]", ...args); } function parseProxyResponse(socket) { return new Promise((resolve, reject) => { let buffersLength = 0; const buffers = []; function read() { const b = socket.read(); if (b) ondata(b); else socket.once("readable", read); } function cleanup() { socket.removeListener("end", onend); socket.removeListener("error", onerror); socket.removeListener("readable", read); } function onend() { cleanup(); debugLog("onend"); reject(new Error("Proxy connection ended before receiving CONNECT response")); } function onerror(err) { cleanup(); 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"); if (endOfHeaders === -1) { debugLog("have not received end of HTTP headers yet..."); read(); return; } 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")); } const firstLineParts = firstLine.split(" "); const statusCode = +(firstLineParts[1] || 0); const statusText = firstLineParts.slice(2).join(" "); const headers = {}; for (const header of headerParts) { if (!header) continue; const firstColon = header.indexOf(":"); if (firstColon === -1) { socket.destroy(); return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`)); } const key = header.slice(0, firstColon).toLowerCase(); const value = header.slice(firstColon + 1).trimStart(); const current = headers[key]; if (typeof current === "string") { headers[key] = [current, value]; } else if (Array.isArray(current)) { current.push(value); } else { headers[key] = value; } } debugLog("got proxy server response: %o %o", firstLine, headers); cleanup(); resolve({ connect: { statusCode, statusText, headers }, buffered }); } socket.on("error", onerror); socket.on("end", onend); read(); }); } exports.parseProxyResponse = parseProxyResponse; //# sourceMappingURL=parse-proxy-response.js.map /***/ }), /***/ 50320: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); const module$1 = __nccwpck_require__(53376); function getSentryRelease(fallback) { if (process.env.SENTRY_RELEASE) { return process.env.SENTRY_RELEASE; } if (core.GLOBAL_OBJ.SENTRY_RELEASE?.id) { return core.GLOBAL_OBJ.SENTRY_RELEASE.id; } 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://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; } const defaultStackParser = core.createStackParser(core.nodeStackLineParser(module$1.createGetModuleFromFilename())); exports.defaultStackParser = defaultStackParser; exports.getSentryRelease = getSentryRelease; //# sourceMappingURL=api.js.map /***/ }), /***/ 5789: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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__(90157); const worker_threads = __nccwpck_require__(71267); const debugBuild = __nccwpck_require__(20624); const DEFAULT_CLIENT_REPORT_FLUSH_INTERVAL_MS = 6e4; class NodeClient extends core.ServerRuntimeClient { constructor(options) { const serverName = options.includeServerName === false ? void 0 : options.serverName || global.process.env.SENTRY_NAME || os.hostname(); const clientOptions = { ...options, 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 }); } 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() { if (this._tracer) { return this._tracer; } const name = "@sentry/node"; const version = core.SDK_VERSION; const tracer = api.trace.getTracer(name, version); this._tracer = tracer; return tracer; } /** @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); } /** @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); } 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. * * NOTICE: This method will create an interval that is periodically called and attach a `process.on('beforeExit')` * hook. To clean up these resources, call `.close()` when you no longer intend to use the client. Not doing so will * result in a memory leak. */ // The reason client reports need to be manually activated with this method instead of just enabling them in a // constructor, is that if users periodically and unboundedly create new clients, we will create more and more // intervals and beforeExit listeners, thus leaking memory. In these situations, users are required to call // `client.close()` in order to dispose of the acquired resources. // We assume that calling this method in Sentry.init() is a sensible default, because calling Sentry.init() over and // 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() { const clientOptions = this.getOptions(); if (clientOptions.sendClientReports) { this._clientReportOnExitFlushListener = () => { this._flushOutcomes(); }; this._clientReportInterval = setInterval(() => { debugBuild.DEBUG_BUILD && core.debug.log("Flushing client reports based on interval."); this._flushOutcomes(); }, 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) { if (!scope) { return [void 0, void 0]; } return opentelemetry.getTraceContextForScope(this, scope); } } exports.NodeClient = NodeClient; //# sourceMappingURL=client.js.map /***/ }), /***/ 91196: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); const importInTheMiddle = __nccwpck_require__(36151); const moduleModule = __nccwpck_require__(98188); const detection = __nccwpck_require__(63992); 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); } } } 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(), index$1.nativeNodeFetchIntegration(), // Global Handlers onuncaughtexception.onUncaughtExceptionIntegration(), onunhandledrejection.onUnhandledRejectionIntegration(), // Event Info contextlines.contextLinesIntegration(), index$2.localVariablesIntegration(), context.nodeContextIntegration(), childProcess.childProcessIntegration(), processSession.processSessionIntegration(), modules.modulesIntegration() ]; } function init(options = {}) { return _init(options, getDefaultIntegrations); } function initWithoutDefaultIntegrations(options = {}) { return _init(options, () => []); } function _init(_options = {}, getDefaultIntegrationsImpl) { const options = getClientOptions(_options, getDefaultIntegrationsImpl); if (options.debug === true) { if (debugBuild.DEBUG_BUILD) { core.debug.enable(); } else { core.consoleSandbox(() => { console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."); }); } } if (options.registerEsmLoaderHooks !== false) { esmLoader.initializeEsmLoader(); } 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 : void 0 }) ); } core.applySdkMetadata(options, "node-core"); const client$1 = new client.NodeClient(options); core.getCurrentScope().setClient(client$1); client$1.init(); core.debug.log(`SDK initialized from CommonJS`); client$1.startClientReportTracking(); updateScopeFromEnvVariables(); opentelemetry.enhanceDscWithOpenTelemetryRootSpanName(client$1); opentelemetry.setupEventContextTrace(client$1); if (process.env.VERCEL) { process.on("SIGTERM", async () => { await client$1.flush(200); }); } return client$1; } function validateOpenTelemetrySetup() { if (!debugBuild.DEBUG_BUILD) { return; } const setup = opentelemetry.openTelemetrySetupCheck(); 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.debug.error( `You have to set up the ${k}. Without this, the OpenTelemetry & Sentry integration will not work properly.` ); } } 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) { const release = getRelease(options.release); const spotlight = spotlight$1.getSpotlightConfig(options.spotlight); const tracesSampleRate = getTracesSampleRate(options.tracesSampleRate); const mergedOptions = { ...options, 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), 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 }; } function getRelease(release) { if (release !== void 0) { return release; } const detectedRelease = api.getSentryRelease(); if (detectedRelease !== void 0) { return detectedRelease; } return void 0; } function getTracesSampleRate(tracesSampleRate) { if (tracesSampleRate !== void 0) { return tracesSampleRate; } const sampleRateFromEnv = process.env.SENTRY_TRACES_SAMPLE_RATE; if (!sampleRateFromEnv) { return void 0; } const parsed = parseFloat(sampleRateFromEnv); return isFinite(parsed) ? parsed : void 0; } function updateScopeFromEnvVariables() { 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); core.getCurrentScope().setPropagationContext(propagationContext); } } exports.getDefaultIntegrations = getDefaultIntegrations; exports.init = init; exports.initWithoutDefaultIntegrations = initWithoutDefaultIntegrations; exports.validateOpenTelemetrySetup = validateOpenTelemetrySetup; //# sourceMappingURL=index.js.map /***/ }), /***/ 62177: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const api = __nccwpck_require__(65163); const opentelemetry = __nccwpck_require__(90157); function setIsolationScope(isolationScope) { const scopes = opentelemetry.getScopesFromContext(api.context.active()); if (scopes) { scopes.isolationScope = isolationScope; } } exports.setIsolationScope = setIsolationScope; //# sourceMappingURL=scope.js.map /***/ }), /***/ 87973: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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__(82063); const GZIP_THRESHOLD = 1024 * 32; function streamFromBody(body) { return new node_stream.Readable({ read() { this.push(body); this.push(null); } }); } function makeNodeTransport(options) { let urlSegments; try { urlSegments = new URL(options.url); } catch (_e) { core.consoleSandbox(() => { console.warn( "[@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:"; const proxy = applyNoProxyOption( urlSegments, options.proxy || (isHttps ? process.env.https_proxy : void 0) || process.env.http_proxy ); const nativeHttpModule = isHttps ? https : http; 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); } function applyNoProxyOption(transportUrlSegments, proxy) { const { no_proxy } = process.env; const urlIsExemptFromProxy = no_proxy?.split(",").some( (exemption) => transportUrlSegments.host.endsWith(exemption) || transportUrlSegments.hostname.endsWith(exemption) ); if (urlIsExemptFromProxy) { return void 0; } else { return proxy; } } function createRequestExecutor(options, httpModule, agent) { const { hostname, pathname, port, protocol, search } = new URL(options.url); return function makeRequest(request) { return new Promise((resolve, reject) => { core.suppressTracing(() => { let body = streamFromBody(request.body); const headers = { ...options.headers }; if (request.body.length > GZIP_THRESHOLD) { headers["content-encoding"] = "gzip"; body = body.pipe(node_zlib.createGzip()); } const hostnameIsIPv6 = hostname.startsWith("["); const req = httpModule.request( { method: "POST", agent, headers, // Remove "[" and "]" from IPv6 hostnames hostname: hostnameIsIPv6 ? hostname.slice(1, -1) : hostname, path: `${pathname}${search}`, port, protocol, ca: options.caCerts }, (res) => { res.on("data", () => { }); res.on("end", () => { }); 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 } }); } ); req.on("error", reject); body.pipe(req); }); }); }; } exports.makeNodeTransport = makeNodeTransport; //# sourceMappingURL=http.js.map /***/ }), /***/ 59528: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); function addOriginToSpan(span, origin) { span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, origin); } exports.addOriginToSpan = addOriginToSpan; //# sourceMappingURL=addOriginToSpan.js.map /***/ }), /***/ 94192: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const createMissingInstrumentationContext = (pkg) => { let isCjs; isCjs = true; return { package: pkg, "javascript.is_cjs": isCjs }; }; exports.createMissingInstrumentationContext = createMissingInstrumentationContext; //# sourceMappingURL=createMissingInstrumentationContext.js.map /***/ }), /***/ 10992: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); let cachedDebuggerEnabled; async function isDebuggerEnabled() { if (cachedDebuggerEnabled === void 0) { try { const inspector = await Promise.resolve(/* import() */).then(__nccwpck_require__.t.bind(__nccwpck_require__, 85690, 23)); cachedDebuggerEnabled = !!inspector.url(); } catch { cachedDebuggerEnabled = false; } } return cachedDebuggerEnabled; } exports.isDebuggerEnabled = isDebuggerEnabled; //# sourceMappingURL=debug.js.map /***/ }), /***/ 63992: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); __nccwpck_require__(84466); __nccwpck_require__(61523); 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 createMissingInstrumentationContext = __nccwpck_require__(94192); 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(() => { 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)); } } exports.ensureIsWrapped = ensureIsWrapped; //# sourceMappingURL=ensureIsWrapped.js.map /***/ }), /***/ 61138: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); const debugBuild = __nccwpck_require__(20624); const DEFAULT_SHUTDOWN_TIMEOUT = 2e3; function logAndExitProcess(error) { core.consoleSandbox(() => { console.error(error); }); const client = core.getClient(); 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?.shutdownTimeout && options.shutdownTimeout > 0 ? options.shutdownTimeout : DEFAULT_SHUTDOWN_TIMEOUT; client.close(timeout).then( (result) => { if (!result) { debugBuild.DEBUG_BUILD && core.debug.warn("We reached the timeout for emptying the request buffer, still exiting now!"); } global.process.exit(1); }, (error2) => { debugBuild.DEBUG_BUILD && core.debug.error(error2); } ); } exports.logAndExitProcess = logAndExitProcess; //# sourceMappingURL=errorhandling.js.map /***/ }), /***/ 53376: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const node_path = __nccwpck_require__(49411); const core = __nccwpck_require__(84466); function normalizeWindowsPath(path) { return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/"); } 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; let { dir, base: file, ext } = node_path.posix.parse(normalizedFilename); if (ext === ".js" || ext === ".mjs" || ext === ".cjs") { file = file.slice(0, ext.length * -1); } const decodedFile = decodeURIComponent(file); if (!dir) { dir = "."; } const n = dir.lastIndexOf("/node_modules"); if (n > -1) { return `${dir.slice(n + 14).replace(/\//g, ".")}:${decodedFile}`; } if (dir.startsWith(normalizedBase)) { const moduleName = dir.slice(normalizedBase.length + 1).replace(/\//g, "."); return moduleName ? `${moduleName}:${decodedFile}` : decodedFile; } return decodedFile; }; } exports.createGetModuleFromFilename = createGetModuleFromFilename; //# sourceMappingURL=module.js.map /***/ }), /***/ 28847: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const core = __nccwpck_require__(84466); 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 { 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}`; } } 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; } 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 void 0; } const processArg = (arg) => { if (typeof arg === "string" || typeof arg === "number" || Buffer.isBuffer(arg)) { return [arg.toString()]; } else if (Array.isArray(arg)) { return flatten(arg.map((arg2) => processArg(arg2))); } else { return [""]; } }; const firstArg = cmdArgs[0]; if (isInCommands(SINGLE_ARG_COMMANDS, redisCommand) && firstArg != null) { return processArg(firstArg); } return flatten(cmdArgs.map((arg) => processArg(arg))); } catch { return void 0; } } function shouldConsiderForCache(redisCommand, keys, prefixes) { if (!getCacheOperation(redisCommand)) { return false; } for (const key of keys) { if (keyHasPrefix(key, prefixes)) { return true; } } return false; } 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 === void 0) return 0; return JSON.stringify(value).length; } catch { return void 0; } }; 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); } function flatten(input) { const result = []; const flattenHelper = (input2) => { input2.forEach((el) => { if (Array.isArray(el)) { flattenHelper(el); } else { 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; exports.getCacheOperation = getCacheOperation; exports.isInCommands = isInCommands; exports.shouldConsiderForCache = shouldConsiderForCache; //# sourceMappingURL=redisCache.js.map /***/ }), /***/ 63790: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 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 = __nccwpck_require__(84466); const attributes = __nccwpck_require__(88264); const sdkTraceBase = __nccwpck_require__(88266); const core$1 = __nccwpck_require__(89736); const SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE = "sentry.parentIsRemote"; const SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION = "sentry.graphql.operation"; function getParentSpanId(span) { if ("parentSpanId" in span) { return span.parentSpanId; } else if ("parentSpanContext" in span) { return span.parentSpanContext?.spanId; } return void 0; } function spanHasAttributes(span) { const castSpan = span; return core.isObjectLike(castSpan.attributes); } function spanHasKind(span) { const castSpan = span; return typeof castSpan.kind === "number"; } function spanHasStatus(span) { const castSpan = span; return !!castSpan.status; } function spanHasName(span) { const castSpan = span; return !!castSpan.name; } function spanHasParentId(span) { const castSpan = span; return !!getParentSpanId(castSpan); } function spanHasEvents(span) { const castSpan = span; return Array.isArray(castSpan.events); } function getRequestSpanData(span) { if (!spanHasAttributes(span)) { return {}; } const maybeUrlAttribute = span.attributes[attributes.URL_FULL] || span.attributes[attributes.HTTP_URL]; const data = { url: maybeUrlAttribute, // eslint-disable-next-line typescript/no-deprecated "http.method": span.attributes[attributes.HTTP_REQUEST_METHOD] || span.attributes[attributes.HTTP_METHOD] }; if (!data["http.method"] && data.url) { data["http.method"] = "GET"; } try { if (typeof maybeUrlAttribute === "string") { const url = core.parseUrl(maybeUrlAttribute); data.url = core.getSanitizedUrlString(url); if (url.search) { data["http.query"] = url.search; } if (url.hash) { data["http.fragment"] = url.hash; } } } catch { } return data; } function wrapClientClass(ClientClass) { class OpenTelemetryClient extends ClientClass { constructor(...args) { super(...args); } /** Get the OTEL tracer. */ get tracer() { if (this._tracer) { return this._tracer; } 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) { const provider = this.traceProvider; await provider?.forceFlush(); return super.flush(timeout); } } return OpenTelemetryClient; } 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_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 SCOPE_CONTEXT_FIELD = "_scopeContext"; function getScopesFromContext(context) { return context.getValue(SENTRY_SCOPES_CONTEXT_KEY); } function setScopesOnContext(context, scopes) { return context.setValue(SENTRY_SCOPES_CONTEXT_KEY, scopes); } function setContextOnScope(scope, context) { core.addNonEnumerableProperty(scope, SCOPE_CONTEXT_FIELD, core.makeWeakRef(context)); } function getContextFromScope(scope) { return core.derefWeakRef(scope[SCOPE_CONTEXT_FIELD]); } function isSentryRequestSpan(span) { if (!spanHasAttributes(span)) { return false; } 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 getSamplingDecision(spanContext) { const { traceFlags, traceState } = spanContext; const sampledNotRecording = traceState ? traceState.get(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING) === "1" : false; if (traceFlags === api.TraceFlags.SAMPLED) { return true; } if (sampledNotRecording) { return false; } 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 (dsc?.sampled === "false") { return false; } 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); } function inferSpanData(spanName, attributes$1, kind) { const httpMethod = attributes$1[attributes.HTTP_REQUEST_METHOD] || attributes$1[attributes.HTTP_METHOD]; if (httpMethod) { return descriptionForHttpMethod({ attributes: attributes$1, name: spanName, kind }, httpMethod); } 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: attributes$1, name: spanName }); } 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$1, "route"), op: "rpc" }; } const messagingSystem = attributes$1[attributes.MESSAGING_SYSTEM]; if (messagingSystem) { return { ...getUserUpdatedNameAndSource(spanName, attributes$1, customSourceOrRoute), op: "message" }; } const faasTrigger = attributes$1[attributes.FAAS_TRIGGER]; if (faasTrigger) { return { ...getUserUpdatedNameAndSource(spanName, attributes$1, customSourceOrRoute), op: faasTrigger.toString() }; } return { op: void 0, description: spanName, source: "custom" }; } function parseSpanDescription(span) { 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: attributes$1, name }) { const userDefinedName = attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]; if (typeof userDefinedName === "string") { return { op: "db", description: userDefinedName, source: attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] || "custom" }; } if (attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === "custom") { return { op: "db", description: name, source: "custom" }; } const statement = attributes$1[attributes.DB_STATEMENT]; const description = statement ? statement.toString() : name; return { op: "db", description, source: "task" }; } function descriptionForHttpMethod({ name, kind, attributes }, httpMethod) { const opParts = ["http"]; switch (kind) { case api.SpanKind.CLIENT: opParts.push("client"); break; case api.SpanKind.SERVER: opParts.push("server"); break; } 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(".") }; } const graphqlOperationsAttribute = attributes[SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION]; const baseDescription = `${httpMethod} ${urlPath}`; 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.slice(1); } if (fragment) { data["http.fragment"] = fragment.slice(1); } const isClientOrServerKind = kind === api.SpanKind.CLIENT || kind === api.SpanKind.SERVER; 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); return { op: opParts.join("."), description, source, data }; } 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}`; } 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") { return { urlPath: core.stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false }; } if (parsedUrl) { return { urlPath: url, url, query, fragment, hasRoute: false }; } if (typeof httpTarget === "string") { return { urlPath: core.stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false }; } return { urlPath: void 0, url, query, fragment, hasRoute: false }; } 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") { return { description, source }; } return { description: originalName, source }; } function enhanceDscWithOpenTelemetryRootSpanName(client) { client.on("createDsc", (dsc, rootSpan) => { if (!rootSpan) { return; } const jsonSpan = core.spanToJSON(rootSpan); const attributes = jsonSpan.data; const source = attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]; 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; } } if (core.hasSpansEnabled()) { dsc.sampled = sampled == void 0 ? void 0 : String(sampled); } }); } function getActiveSpan() { return api.trace.getActiveSpan(); } const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__); 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; } } 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); } function setIsSetup(element) { setupElements.add(element); } class SentryPropagator extends core$1.W3CBaggagePropagator { constructor() { super(); setIsSetup("SentryPropagator"); this._urlMatchesTargetsMap = new core.LRUMap(100); } /** * @inheritDoc */ 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(context2); const url = activeSpan && getCurrentURL(activeSpan); 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); 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 (!existingSentryTraceHeader && dynamicSamplingContext) { baggage = Object.entries(dynamicSamplingContext).reduce((b, [dscKey, dscValue]) => { if (dscValue) { return b.setEntry(`${core.SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`, { value: dscValue }); } return b; }, baggage); } 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(context2, baggage), carrier, setter); } /** * @inheritDoc */ 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 : void 0; return ensureScopesOnContext(getContextWithRemoteActiveSpan(context2, { sentryTrace, baggage })); } /** * @inheritDoc */ fields() { return [SENTRY_TRACE_HEADER, SENTRY_BAGGAGE_HEADER, "traceparent"]; } } function getInjectionData(context2, options = {}) { const span = api.trace.getSpan(context2); if (span?.spanContext().isRemote) { const spanContext = span.spanContext(); const dynamicSamplingContext2 = core.getDynamicSamplingContextFromSpan(span); return { dynamicSamplingContext: dynamicSamplingContext2, traceId: spanContext.traceId, spanId: void 0, sampled: getSamplingDecision(spanContext) // TODO: Do we need to change something here? }; } if (span) { const spanContext = span.spanContext(); const dynamicSamplingContext2 = core.getDynamicSamplingContextFromSpan(span); return { dynamicSamplingContext: dynamicSamplingContext2, traceId: spanContext.traceId, spanId: spanContext.spanId, sampled: getSampledForPropagation(span, options.client) }; } 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) : void 0; return { dynamicSamplingContext, traceId: propagationContext.traceId, spanId: propagationContext.propagationSpanId, sampled: propagationContext.sampled }; } function getContextWithRemoteActiveSpan(ctx, { sentryTrace, baggage }) { const propagationContext = core.propagationContextFromHeaders(sentryTrace, baggage); const { traceId, parentSpanId, sampled, dsc } = propagationContext; 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 }); return api.trace.setSpanContext(ctx, spanContext); } function continueTraceAsRemoteSpan(ctx, options, callback) { const ctxWithSpanContext = ensureScopesOnContext(getContextWithRemoteActiveSpan(ctx, options)); return api.context.with(ctxWithSpanContext, callback); } function ensureScopesOnContext(ctx) { 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() }; return setScopesOnContext(ctx, newScopes); } function getExistingBaggage(carrier) { try { 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; } } function getCurrentURL(span) { const spanData = core.spanToJSON(span).data; const urlAttribute = spanData[attributes.HTTP_URL] || spanData[attributes.URL_FULL]; if (typeof urlAttribute === "string") { return urlAttribute; } const urlTraceState = span.spanContext().traceState?.get(SENTRY_TRACE_STATE_URL); if (urlTraceState) { return urlTraceState; } return void 0; } function generateRemoteSpanContext({ spanId, traceId, sampled, dsc }) { const traceState = makeTraceState({ dsc, sampled }); const spanContext = { traceId, spanId, isRemote: true, traceFlags: sampled ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE, traceState }; return spanContext; } function _startSpan(options, callback, autoEnd) { const tracer = getTracer(); const { name, parentSpan: customParentSpan } = options; const wrapper = getActiveSpanWrapper(customParentSpan); return wrapper(() => { const activeCtx = getContext(options.scope, options.forceTransaction); 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); 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), () => { if (core.spanToJSON(span).status === void 0) { span.setStatus({ code: api.SpanStatusCode.ERROR }); } }, autoEnd ? () => span.end() : void 0 ); }); }); } function startSpan(options, callback) { return _startSpan(options, callback, true); } function startSpanManual(options, callback) { return _startSpan(options, (span) => callback(span, () => span.end()), false); } function startInactiveSpan(options) { const tracer = getTracer(); const { name, parentSpan: customParentSpan } = options; const wrapper = getActiveSpanWrapper(customParentSpan); return wrapper(() => { const activeCtx = getContext(options.scope, options.forceTransaction); 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; }); } 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?.tracer || api.trace.getTracer("@sentry/opentelemetry", core.SDK_VERSION); } function getSpanOptions(options) { 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, kind, links, startTime: fixedStartTime }; } function ensureTimestampInMilliseconds(timestamp) { const isMs = timestamp < 9999999999; 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); if (!parentSpan) { return ctx; } if (!forceTransaction) { return ctx; } const ctxWithoutSpan = api.trace.deleteSpan(ctx); const { spanId, traceId } = parentSpan.spanContext(); const sampled = getSamplingDecision(parentSpan.spanContext()); const rootSpan = core.getRootSpan(parentSpan); const dsc = core.getDynamicSamplingContextFromSpan(rootSpan); const traceState = makeTraceState({ dsc, sampled }); const spanOptions = { traceId, spanId, isRemote: true, traceFlags: sampled ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE, traceState }; const ctxWithSpanContext = api.trace.setSpanContext(ctxWithoutSpan, spanOptions); return ctxWithSpanContext; } function getContextForScope(scope) { if (scope) { const ctx = getContextFromScope(scope); if (ctx) { return ctx; } } return api.context.active(); } function continueTrace(options, callback) { return continueTraceAsRemoteSpan(api.context.active(), options, callback); } 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); return [dynamicSamplingContext, traceContext]; } function getActiveSpanWrapper(parentSpan) { return parentSpan !== void 0 ? (callback) => { return withActiveSpan(parentSpan, callback); } : (callback) => callback(); } 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; } function setupEventContextTrace(client) { client.on("preprocessEvent", (event) => { const span = getActiveSpan(); if (!span || event.type === "transaction") { return; } event.contexts = { trace: core.spanToTraceContext(span), ...event.contexts }; const rootSpan = core.getRootSpan(span); event.sdkProcessingMetadata = { dynamicSamplingContext: core.getDynamicSamplingContextFromSpan(rootSpan), ...event.sdkProcessingMetadata }; return event; }); } 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 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; } 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; } return { scope: core.getDefaultCurrentScope(), isolationScope: core.getDefaultIsolationScope() }; } function withScope(callback) { const ctx = api.context.active(); return api.context.with(ctx, () => { return callback(getCurrentScope()); }); } function withSetScope(scope, callback) { 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(); 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(); 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, withSetIsolationScope, withIsolationScope, getCurrentScope, getIsolationScope, startSpan, startSpanManual, 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, getTracingChannelBinding: options?.getTracingChannelBinding }); } 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.SentryTracerProvider = SentryTracerProvider; exports.applyOtelSpanData = applyOtelSpanData; exports.backfillStreamedSpanDataFromOtel = backfillStreamedSpanDataFromOtel; exports.buildContextWithSentryScopes = buildContextWithSentryScopes; exports.continueTrace = continueTrace; exports.enhanceDscWithOpenTelemetryRootSpanName = enhanceDscWithOpenTelemetryRootSpanName; exports.getActiveSpan = getActiveSpan; 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.spanHasAttributes = spanHasAttributes; exports.spanHasEvents = spanHasEvents; exports.spanHasKind = spanHasKind; exports.spanHasName = spanHasName; exports.spanHasParentId = spanHasParentId; exports.spanHasStatus = spanHasStatus; exports.startInactiveSpan = startInactiveSpan; exports.startSpan = startSpan; exports.startSpanManual = startSpanManual; exports.suppressTracing = suppressTracing; 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 /***/ }), /***/ 64112: /***/ ((__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 /***/ }), /***/ 91837: /***/ ((__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 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 } }); }); } 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" } }) ); } exports.genericPoolChannelIntegration = genericPoolChannelIntegration; //# sourceMappingURL=generic-pool.js.map /***/ }), /***/ 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; } 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 }; if (options.active === false) { const span = core.startInactiveSpan(spanOptions); registerPrismaSpan(span.spanContext().spanId, span); return endSpan(span, () => callback(span, parentSpan)); } 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)); } exports.ActiveTracingHelper = ActiveTracingHelper; //# sourceMappingURL=tracing-helper.js.map /***/ }), /***/ 82500: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { 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 /***/ }), /***/ 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 /***/ }), /***/ 31621: /***/ ((module) => { "use strict"; module.exports = (flag, argv = process.argv) => { const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--'); const position = argv.indexOf(prefix + flag); const terminatorPosition = argv.indexOf('--'); return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); }; /***/ }), /***/ 36151: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License. // // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. const path = __nccwpck_require__(71017) 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, specifier]) => hook(name, namespace, specifier)) } function removeHook (hook) { const index = importHooks.indexOf(hook) if (index > -1) { importHooks.splice(index, 1) } } function callHookFn (hookFn, namespace, name, baseDir) { const newDefault = hookFn(namespace, name, baseDir) if (newDefault && newDefault !== namespace) { // 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 } } } let sendModulesToLoader /** * EXPERIMENTAL * This feature is experimental and may change in minor versions. * **NOTE** This feature is incompatible with the {internals: true} Hook option. * * Creates a message channel with a port that can be used to add hooks to the * list of exclusively included modules. * * This can be used to only wrap modules that are Hook'ed, however modules need * to be hooked before they are imported. * * ```ts * import { register } from 'module' * import { Hook, createAddHookMessageChannel } from 'import-in-the-middle' * * const { registerOptions, waitForAllMessagesAcknowledged } = createAddHookMessageChannel() * * register('import-in-the-middle/hook.mjs', import.meta.url, registerOptions) * * Hook(['fs'], (exported, name, baseDir) => { * // Instrument the fs module * }) * * // Ensure that the loader has acknowledged all the modules * // before we allow execution to continue * await waitForAllMessagesAcknowledged() * ``` */ function createAddHookMessageChannel () { const { port1, port2 } = new MessageChannel() let pendingAckCount = 0 let resolveFn sendModulesToLoader = (modules) => { pendingAckCount++ port1.postMessage(modules) } port1.on('message', () => { pendingAckCount-- if (resolveFn && pendingAckCount <= 0) { resolveFn() } }).unref() function waitForAllMessagesAcknowledged () { // This timer is to prevent the process from exiting with code 13: // 13: Unsettled Top-Level Await. const timer = setInterval(() => { }, 1000) const promise = new Promise((resolve) => { resolveFn = resolve }).then(() => { clearInterval(timer) }) if (pendingAckCount === 0) { resolveFn() } return promise } const addHookMessagePort = port2 const registerOptions = { data: { addHookMessagePort, include: [] }, transferList: [addHookMessagePort] } return { registerOptions, addHookMessagePort, waitForAllMessagesAcknowledged } } function Hook (modules, options, hookFn) { if ((this instanceof Hook) === false) return new Hook(modules, options, hookFn) if (typeof modules === 'function') { hookFn = modules modules = null options = null } else if (typeof options === 'function') { hookFn = options options = null } const internals = options ? options.internals === true : false if (sendModulesToLoader && Array.isArray(modules)) { sendModulesToLoader(modules) } this._iitmHook = (name, namespace, specifier) => { const loadUrl = name const isNodeUrl = loadUrl.startsWith('node:') let filePath, baseDir 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 } } 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 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) } } else if (matchArg === specifier) { callHookFn(hookFn, namespace, specifier, baseDir) } } } else { callHookFn(hookFn, namespace, name, baseDir) } } addHook(this._iitmHook) } Hook.prototype.unhook = function () { removeHook(this._iitmHook) } module.exports = Hook module.exports.Hook = Hook module.exports.addHook = addHook module.exports.removeHook = removeHook module.exports.createAddHookMessageChannel = createAddHookMessageChannel /***/ }), /***/ 37174: /***/ ((__unused_webpack_module, exports) => { // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License. // // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc. const importHooks = [] // TODO should this be a Set? const setters = new WeakMap() const getters = new WeakMap() const specifiers = new Map() const toHook = [] const proxyHandler = { set (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) { if (name === Symbol.toStringTag) { return 'Module' } const getter = getters.get(target)[name] if (typeof getter === 'function') { return getter() } }, defineProperty (target, property, descriptor) { if ((!('value' in descriptor))) { throw new Error('Getters/setters are not supported for exports property descriptors.') } const set = setters.get(target) const setter = set && set[property] if (typeof setter === 'function') { return setter(descriptor.value) } return true } } function register (name, namespace, set, get, specifier) { specifiers.set(name, specifier) setters.set(namespace, set) getters.set(namespace, get) const proxy = new Proxy(namespace, proxyHandler) 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 /***/ }), /***/ 97751: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; var sep = (__nccwpck_require__(71017).sep) module.exports = function (file) { 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: basedir, path: path } } /***/ }), /***/ 80900: /***/ ((module) => { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } /***/ }), /***/ 62009: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const path = __nccwpck_require__(71017) const Module = __nccwpck_require__(98188) const debug = __nccwpck_require__(82949)('require-in-the-middle') const moduleDetailsFromPath = __nccwpck_require__(32752) // Using the default export is discouraged, but kept for backward compatibility. // Use this instead: // const { Hook } = require('require-in-the-middle') 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 * * @type {(moduleName: string) => boolean} */ let isCore if (Module.isBuiltin) { // Added in node v18.6.0, v16.17.0 isCore = Module.isBuiltin } else if (Module.builtinModules) { // Added in node v9.3.0, v8.10.0, v6.13.0 isCore = moduleName => { if (moduleName.startsWith('node:')) { return true } 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' const normalize = /([/\\]index)?(\.js)?$/ // Cache `onrequire`-patched exports for modules. // // Exports for built-in (a.k.a. "core") modules are stored in an internal Map. // // Exports for non-core modules are stored on a private field on the `Module` // object in `require.cache`. This allows users to delete from `require.cache` // to trigger a re-load (and re-run of the hook's `onrequire`) of a module the // next time it is required. // https://nodejs.org/docs/latest/api/all.html#all_modules_requirecache // // In some special cases -- e.g. some other `require()` hook swapping out // `Module._cache` like `@babel/register` -- a non-core module won't be in // `require.cache`. In that case this falls back to caching on the internal Map. class ExportsCache { constructor () { this._localCache = new Map() // -> this._kRitmExports = Symbol('RitmExports') } has (filename, isBuiltin) { if (this._localCache.has(filename)) { return true } else if (!isBuiltin) { const mod = require.cache[filename] return !!(mod && this._kRitmExports in mod) } else { return false } } get (filename, isBuiltin) { const cachedExports = this._localCache.get(filename) if (cachedExports !== undefined) { return cachedExports } else if (!isBuiltin) { const mod = require.cache[filename] return (mod && mod[this._kRitmExports]) } } set (filename, exports, isBuiltin) { if (isBuiltin) { this._localCache.set(filename, exports) } else if (filename in require.cache) { require.cache[filename][this._kRitmExports] = exports } else { debug('non-core module is unexpectedly not in require.cache: "%s"', filename) this._localCache.set(filename, exports) } } } function Hook (modules, options, onrequire) { if ((this instanceof Hook) === false) return new Hook(modules, options, onrequire) if (typeof modules === 'function') { onrequire = modules modules = null options = null } else if (typeof options === 'function') { onrequire = options options = null } 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 https://github.com/nodejs/require-in-the-middle/issues', process.version) return } this._cache = new ExportsCache() this._unhooked = false this._origRequire = Module.prototype.require const self = this const patching = new Set() const internals = options ? options.internals === true : false const hasWhitelist = Array.isArray(modules) debug('registering require hook') this._require = Module.prototype.require = function (id) { if (self._unhooked === true) { // if the patched require function could not be removed because // someone else patched it after it was patched here, we just // abort and pass the request onwards to the original require debug('ignoring require call - module is soft-unhooked') return self._origRequire.apply(this, arguments) } return patchedRequire.call(this, arguments, false) } if (typeof process.getBuiltinModule === 'function') { this._origGetBuiltinModule = process.getBuiltinModule this._getBuiltinModule = process.getBuiltinModule = function (id) { if (self._unhooked === true) { // if the patched process.getBuiltinModule function could not be removed because // someone else patched it after it was patched here, we just abort and pass the // request onwards to the original process.getBuiltinModule debug('ignoring process.getBuiltinModule call - module is soft-unhooked') return self._origGetBuiltinModule.apply(this, arguments) } return patchedRequire.call(this, arguments, true) } } // Preserve the original require/process.getBuiltinModule arguments in `args` function patchedRequire (args, coreOnly) { const id = args[0] const core = isCore(id) let filename // the string used for caching if (core) { filename = id // If this is a builtin module that can be identified both as 'foo' and // 'node:foo', then prefer 'foo' as the caching key. if (id.startsWith('node:')) { const idWithoutPrefix = id.slice(5) if (isCore(idWithoutPrefix)) { filename = idWithoutPrefix } } } else if (coreOnly) { // `coreOnly` is `true` if this was a call to `process.getBuiltinModule`, in which case // we don't want to return anything if the requested `id` isn't a core module. Falling // back to default behaviour, which at the time of this wrting is simply returning `undefined` debug('call to process.getBuiltinModule with unknown built-in id') return self._origGetBuiltinModule.apply(this, args) } else { try { filename = Module._resolveFilename(id, this) } catch (resolveErr) { // If someone *else* monkey-patches before this monkey-patch, then that // code might expect `require(someId)` to get through so it can be // handled, even if `someId` cannot be resolved to a filename. In this // case, instead of throwing we defer to the underlying `require`. // // For example the Azure Functions Node.js worker module does this, // where `@azure/functions-core` resolves to an internal object. // https://github.com/Azure/azure-functions-nodejs-worker/blob/v3.5.2/src/setupCoreModule.ts#L46-L54 debug('Module._resolveFilename("%s") threw %j, calling original Module.require', id, resolveErr.message) return self._origRequire.apply(this, args) } } let moduleName, basedir debug('processing %s module require(\'%s\'): %s', core === true ? 'core' : 'non-core', id, filename) // return known patched modules immediately if (self._cache.has(filename, core) === true) { debug('returning already patched cached module: %s', filename) return self._cache.get(filename, core) } // Check if this module has a patcher in-progress already. // Otherwise, mark this module as patching in-progress. const isPatching = patching.has(filename) if (isPatching === false) { patching.add(filename) } const exports = coreOnly ? self._origGetBuiltinModule.apply(this, args) : self._origRequire.apply(this, args) // If it's already patched, just return it as-is. if (isPatching === true) { debug('module is in the process of being patched already - ignoring: %s', filename) return exports } // The module has already been loaded, // so the patching mark can be cleaned up. patching.delete(filename) if (core === true) { if (hasWhitelist === true && modules.includes(filename) === false) { debug('ignoring core module not on whitelist: %s', filename) return exports // abort if module name isn't on whitelist } moduleName = filename } else if (hasWhitelist === true && modules.includes(filename)) { // whitelist includes the absolute path to the file including extension const parsedPath = path.parse(filename) moduleName = parsedPath.name basedir = parsedPath.dir } else { const stat = moduleDetailsFromPath(filename) if (stat === undefined) { debug('could not parse filename: %s', filename) return exports // abort if filename could not be parsed } moduleName = stat.name basedir = stat.basedir // Ex: require('foo/lib/../bar.js') // moduleName = 'foo' // fullModuleName = 'foo/bar' const fullModuleName = resolveModuleName(stat) debug('resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)', moduleName, id, fullModuleName, basedir) let matchFound = false if (hasWhitelist) { if (!id.startsWith('.') && modules.includes(id)) { // Not starting with '.' means `id` is identifying a module path, // as opposed to a local file path. (Note: I'm not sure about // absolute paths, but those are handled above.) // If this `id` is in `modules`, then this could be a match to an // package "exports" entry point that wouldn't otherwise match below. moduleName = id matchFound = true } // abort if module name isn't on whitelist if (!modules.includes(moduleName) && !modules.includes(fullModuleName)) { return exports } if (modules.includes(fullModuleName) && fullModuleName !== moduleName) { // if we get to this point, it means that we're requiring a whitelisted sub-module moduleName = fullModuleName matchFound = true } } if (!matchFound) { // figure out if this is the main module file, or a file inside the module let res try { res = require.resolve(moduleName, { paths: [basedir] }) } catch (e) { debug('could not resolve module: %s', moduleName) self._cache.set(filename, exports, core) return exports // abort if module could not be resolved (e.g. no main in package.json and no index.js file) } if (res !== filename) { // this is a module-internal file if (internals === true) { // use the module-relative path to the file, prefixed by original module name moduleName = moduleName + path.sep + path.relative(basedir, filename) debug('preparing to process require of internal file: %s', moduleName) } else { debug('ignoring require of non-main module file: %s', res) self._cache.set(filename, exports, core) return exports // abort if not main module file } } } } // ensure that the cache entry is assigned a value before calling // onrequire, in case calling onrequire requires the same module. self._cache.set(filename, exports, core) debug('calling require hook: %s', moduleName) const patchedExports = onrequire(exports, moduleName, basedir) self._cache.set(filename, patchedExports, core) debug('returning module: %s', moduleName) return patchedExports } } Hook.prototype.unhook = function () { this._unhooked = true if (this._require === Module.prototype.require) { Module.prototype.require = this._origRequire debug('require unhook successful') } else { debug('require unhook unsuccessful') } if (process.getBuiltinModule !== undefined) { if (this._getBuiltinModule === process.getBuiltinModule) { process.getBuiltinModule = this._origGetBuiltinModule debug('process.getBuiltinModule unhook successful') } else { debug('process.getBuiltinModule unhook unsuccessful') } } } function resolveModuleName (stat) { const normalizedPath = path.sep !== '/' ? stat.path.split(path.sep).join('/') : stat.path return path.posix.join(stat.name, normalizedPath).replace(normalize, '') } /***/ }), /***/ 85407: /***/ ((module, exports, __nccwpck_require__) => { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); exports.destroy = (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } }; })(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } let m; // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 // eslint-disable-next-line no-return-assign return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.debug()` when available. * No-op when `console.debug` is not a "function". * If `console.debug` is not available, falls back * to `console.log`. * * @api public */ exports.log = console.debug || console.log || (() => {}); /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = __nccwpck_require__(33532)(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /***/ }), /***/ 33532: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = __nccwpck_require__(80900); createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return '%'; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. Object.defineProperty(debug, 'enabled', { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: v => { enableOverride = v; } }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; const split = (typeof namespaces === 'string' ? namespaces : '') .trim() .replace(' ', ',') .split(',') .filter(Boolean); for (const ns of split) { if (ns[0] === '-') { createDebug.skips.push(ns.slice(1)); } else { createDebug.names.push(ns); } } } /** * Checks if the given string matches a namespace template, honoring * asterisks as wildcards. * * @param {String} search * @param {String} template * @return {Boolean} */ function matchesTemplate(search, template) { let searchIndex = 0; let templateIndex = 0; let starIndex = -1; let matchIndex = 0; while (searchIndex < search.length) { if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { // Match character or proceed with wildcard if (template[templateIndex] === '*') { starIndex = templateIndex; matchIndex = searchIndex; templateIndex++; // Skip the '*' } else { searchIndex++; templateIndex++; } } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition // Backtrack to the last '*' and try to match more characters templateIndex = starIndex + 1; matchIndex++; searchIndex = matchIndex; } else { return false; // No match } } // Handle trailing '*' in template while (templateIndex < template.length && template[templateIndex] === '*') { templateIndex++; } return templateIndex === template.length; } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names, ...createDebug.skips.map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { for (const skip of createDebug.skips) { if (matchesTemplate(name, skip)) { return false; } } for (const ns of createDebug.names) { if (matchesTemplate(name, ns)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } /** * XXX DO NOT USE. This is a temporary stub function. * XXX It WILL be removed in the next major release. */ function destroy() { console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /***/ }), /***/ 82949: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /** * Detect Electron renderer / nwjs process, which is node, but we should * treat as a browser. */ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { module.exports = __nccwpck_require__(85407); } else { module.exports = __nccwpck_require__(64737); } /***/ }), /***/ 64737: /***/ ((module, exports, __nccwpck_require__) => { /** * Module dependencies. */ const tty = __nccwpck_require__(76224); const util = __nccwpck_require__(73837); /** * This is the Node.js implementation of `debug()`. */ exports.init = init; exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.destroy = util.deprecate( () => {}, 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.' ); /** * Colors. */ exports.colors = [6, 2, 3, 4, 5, 1]; try { // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) // eslint-disable-next-line import/no-extraneous-dependencies const supportsColor = __nccwpck_require__(59318); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports.colors = [ 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221 ]; } } catch (error) { // Swallow - we only care if `supports-color` is available; it doesn't have to be. } /** * Build up the default `inspectOpts` object from the environment variables. * * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js */ exports.inspectOpts = Object.keys(process.env).filter(key => { return /^debug_/i.test(key); }).reduce((obj, key) => { // Camel-case const prop = key .substring(6) .toLowerCase() .replace(/_([a-z])/g, (_, k) => { return k.toUpperCase(); }); // Coerce string value into JS value let val = process.env[key]; if (/^(yes|on|true|enabled)$/i.test(val)) { val = true; } else if (/^(no|off|false|disabled)$/i.test(val)) { val = false; } else if (val === 'null') { val = null; } else { val = Number(val); } obj[prop] = val; return obj; }, {}); /** * Is stdout a TTY? Colored output is enabled when `true`. */ function useColors() { return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); } /** * Adds ANSI color escape codes if enabled. * * @api public */ function formatArgs(args) { const {namespace: name, useColors} = this; if (useColors) { const c = this.color; const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); const prefix = ` ${colorCode};1m${name} \u001B[0m`; args[0] = prefix + args[0].split('\n').join('\n' + prefix); args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); } else { args[0] = getDate() + name + ' ' + args[0]; } } function getDate() { if (exports.inspectOpts.hideDate) { return ''; } return new Date().toISOString() + ' '; } /** * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr. */ function log(...args) { return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n'); } /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { if (namespaces) { process.env.DEBUG = namespaces; } else { // If you set a process.env field to null or undefined, it gets cast to the // string 'null' or 'undefined'. Just delete instead. delete process.env.DEBUG; } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { return process.env.DEBUG; } /** * Init logic for `debug` instances. * * Create a new `inspectOpts` object in case `useColors` is set * differently for a particular `debug` instance. */ function init(debug) { debug.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); for (let i = 0; i < keys.length; i++) { debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; } } module.exports = __nccwpck_require__(33532)(exports); const {formatters} = module.exports; /** * Map %o to `util.inspect()`, all on a single line. */ formatters.o = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts) .split('\n') .map(str => str.trim()) .join(' '); }; /** * Map %O to `util.inspect()`, allowing multiple lines if needed. */ formatters.O = function (v) { this.inspectOpts.colors = this.useColors; return util.inspect(v, this.inspectOpts); }; /***/ }), /***/ 32752: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; 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) } } /***/ }), /***/ 59318: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const os = __nccwpck_require__(22037); const tty = __nccwpck_require__(76224); const hasFlag = __nccwpck_require__(31621); const {env} = process; let forceColor; if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) { forceColor = 0; } else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) { forceColor = 1; } if ('FORCE_COLOR' in env) { if (env.FORCE_COLOR === 'true') { forceColor = 1; } else if (env.FORCE_COLOR === 'false') { forceColor = 0; } else { forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); } } function translateLevel(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } function supportsColor(haveStream, streamIsTTY) { if (forceColor === 0) { return 0; } if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) { return 3; } if (hasFlag('color=256')) { return 2; } if (haveStream && !streamIsTTY && forceColor === undefined) { return 0; } const min = forceColor || 0; if (env.TERM === 'dumb') { return min; } if (process.platform === 'win32') { // Windows 10 build 10586 is the first Windows release that supports 256 colors. // Windows 10 build 14931 is the first release that supports 16m/TrueColor. const osRelease = os.release().split('.'); if ( Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586 ) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ('CI' in env) { if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { return 1; } return min; } if ('TEAMCITY_VERSION' in env) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } if (env.COLORTERM === 'truecolor') { return 3; } if ('TERM_PROGRAM' in env) { const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); switch (env.TERM_PROGRAM) { case 'iTerm.app': return version >= 3 ? 3 : 2; case 'Apple_Terminal': return 2; // No default } } if (/-256(color)?$/i.test(env.TERM)) { return 2; } if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { return 1; } if ('COLORTERM' in env) { return 1; } return min; } function getSupportLevel(stream) { const level = supportsColor(stream, stream && stream.isTTY); return translateLevel(level); } module.exports = { supportsColor: getSupportLevel, stdout: translateLevel(supportsColor(true, tty.isatty(1))), stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; /***/ }), /***/ 74294: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = __nccwpck_require__(54219); /***/ }), /***/ 54219: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; var net = __nccwpck_require__(41808); var tls = __nccwpck_require__(24404); var http = __nccwpck_require__(13685); var https = __nccwpck_require__(95687); var events = __nccwpck_require__(82361); var assert = __nccwpck_require__(39491); var util = __nccwpck_require__(73837); exports.httpOverHttp = httpOverHttp; exports.httpsOverHttp = httpsOverHttp; exports.httpOverHttps = httpOverHttps; exports.httpsOverHttps = httpsOverHttps; function httpOverHttp(options) { var agent = new TunnelingAgent(options); agent.request = http.request; return agent; } function httpsOverHttp(options) { var agent = new TunnelingAgent(options); agent.request = http.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function httpOverHttps(options) { var agent = new TunnelingAgent(options); agent.request = https.request; return agent; } function httpsOverHttps(options) { var agent = new TunnelingAgent(options); agent.request = https.request; agent.createSocket = createSecureSocket; agent.defaultPort = 443; return agent; } function TunnelingAgent(options) { var self = this; self.options = options || {}; self.proxyOptions = self.options.proxy || {}; self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets; self.requests = []; self.sockets = []; self.on('free', function onFree(socket, host, port, localAddress) { var options = toOptions(host, port, localAddress); for (var i = 0, len = self.requests.length; i < len; ++i) { var pending = self.requests[i]; if (pending.host === options.host && pending.port === options.port) { // Detect the request to connect same origin server, // reuse the connection. self.requests.splice(i, 1); pending.request.onSocket(socket); return; } } socket.destroy(); self.removeSocket(socket); }); } util.inherits(TunnelingAgent, events.EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self = this; var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress)); if (self.sockets.length >= this.maxSockets) { // We are over limit so we'll add it to the queue. self.requests.push(options); return; } // If we are under maxSockets create a new one. self.createSocket(options, function(socket) { socket.on('free', onFree); socket.on('close', onCloseOrRemove); socket.on('agentRemove', onCloseOrRemove); req.onSocket(socket); function onFree() { self.emit('free', socket, options); } function onCloseOrRemove(err) { self.removeSocket(socket); socket.removeListener('free', onFree); socket.removeListener('close', onCloseOrRemove); socket.removeListener('agentRemove', onCloseOrRemove); } }); }; TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var self = this; var placeholder = {}; self.sockets.push(placeholder); var connectOptions = mergeOptions({}, self.proxyOptions, { method: 'CONNECT', path: options.host + ':' + options.port, agent: false, headers: { host: options.host + ':' + options.port } }); if (options.localAddress) { connectOptions.localAddress = options.localAddress; } if (connectOptions.proxyAuth) { connectOptions.headers = connectOptions.headers || {}; connectOptions.headers['Proxy-Authorization'] = 'Basic ' + new Buffer(connectOptions.proxyAuth).toString('base64'); } debug('making CONNECT request'); var connectReq = self.request(connectOptions); connectReq.useChunkedEncodingByDefault = false; // for v0.6 connectReq.once('response', onResponse); // for v0.6 connectReq.once('upgrade', onUpgrade); // for v0.6 connectReq.once('connect', onConnect); // for v0.7 or later connectReq.once('error', onError); connectReq.end(); function onResponse(res) { // Very hacky. This is necessary to avoid http-parser leaks. res.upgrade = true; } function onUpgrade(res, socket, head) { // Hacky. process.nextTick(function() { onConnect(res, socket, head); }); } function onConnect(res, socket, head) { connectReq.removeAllListeners(); socket.removeAllListeners(); if (res.statusCode !== 200) { debug('tunneling socket could not be established, statusCode=%d', res.statusCode); socket.destroy(); var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode); error.code = 'ECONNRESET'; options.request.emit('error', error); self.removeSocket(placeholder); return; } if (head.length > 0) { debug('got illegal response body from proxy'); socket.destroy(); var error = new Error('got illegal response body from proxy'); error.code = 'ECONNRESET'; options.request.emit('error', error); self.removeSocket(placeholder); return; } debug('tunneling connection has established'); self.sockets[self.sockets.indexOf(placeholder)] = socket; return cb(socket); } function onError(cause) { connectReq.removeAllListeners(); debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack); var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message); error.code = 'ECONNRESET'; options.request.emit('error', error); self.removeSocket(placeholder); } }; TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket) if (pos === -1) { return; } this.sockets.splice(pos, 1); var pending = this.requests.shift(); if (pending) { // If we have pending requests and a socket gets closed a new one // needs to be created to take over in the pool for the one that closed. this.createSocket(pending, function(socket) { pending.request.onSocket(socket); }); } }; function createSecureSocket(options, cb) { var self = this; TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { var hostHeader = options.request.getHeader('host'); var tlsOptions = mergeOptions({}, self.options, { socket: socket, servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host }); // 0 is dummy port for v0.6 var secureSocket = tls.connect(0, tlsOptions); self.sockets[self.sockets.indexOf(socket)] = secureSocket; cb(secureSocket); }); } function toOptions(host, port, localAddress) { if (typeof host === 'string') { // since v0.10 return { host: host, port: port, localAddress: localAddress }; } return host; // for v0.11 or later } function mergeOptions(target) { for (var i = 1, len = arguments.length; i < len; ++i) { var overrides = arguments[i]; if (typeof overrides === 'object') { var keys = Object.keys(overrides); for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { var k = keys[j]; if (overrides[k] !== undefined) { target[k] = overrides[k]; } } } } return target; } var debug; if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { debug = function() { var args = Array.prototype.slice.call(arguments); if (typeof args[0] === 'string') { args[0] = 'TUNNEL: ' + args[0]; } else { args.unshift('TUNNEL:'); } console.error.apply(console, args); } } else { debug = function() {}; } exports.debug = debug; // for test /***/ }), /***/ 41773: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const Client = __nccwpck_require__(8176) const Dispatcher = __nccwpck_require__(87781) const Pool = __nccwpck_require__(20177) const BalancedPool = __nccwpck_require__(46232) const Agent = __nccwpck_require__(71208) const ProxyAgent = __nccwpck_require__(15657) const EnvHttpProxyAgent = __nccwpck_require__(88374) const RetryAgent = __nccwpck_require__(94411) const errors = __nccwpck_require__(48045) const util = __nccwpck_require__(83983) const { InvalidArgumentError } = errors const api = __nccwpck_require__(44059) const buildConnector = __nccwpck_require__(82067) const MockClient = __nccwpck_require__(58687) const MockAgent = __nccwpck_require__(66771) const MockPool = __nccwpck_require__(26193) const mockErrors = __nccwpck_require__(50888) const RetryHandler = __nccwpck_require__(86242) const { getGlobalDispatcher, setGlobalDispatcher } = __nccwpck_require__(21892) const DecoratorHandler = __nccwpck_require__(4117) const RedirectHandler = __nccwpck_require__(30649) const createRedirectInterceptor = __nccwpck_require__(99099) Object.assign(Dispatcher.prototype, api) module.exports.Dispatcher = Dispatcher module.exports.Client = Client module.exports.Pool = Pool module.exports.BalancedPool = BalancedPool module.exports.Agent = Agent module.exports.ProxyAgent = ProxyAgent module.exports.EnvHttpProxyAgent = EnvHttpProxyAgent module.exports.RetryAgent = RetryAgent module.exports.RetryHandler = RetryHandler module.exports.DecoratorHandler = DecoratorHandler module.exports.RedirectHandler = RedirectHandler module.exports.createRedirectInterceptor = createRedirectInterceptor module.exports.interceptors = { redirect: __nccwpck_require__(87773), retry: __nccwpck_require__(55558), dump: __nccwpck_require__(66090), dns: __nccwpck_require__(97334) } module.exports.buildConnector = buildConnector module.exports.errors = errors module.exports.util = { parseHeaders: util.parseHeaders, headerNameToString: util.headerNameToString } function makeDispatcher (fn) { return (url, opts, handler) => { if (typeof opts === 'function') { handler = opts opts = null } if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) { throw new InvalidArgumentError('invalid url') } if (opts != null && typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } if (opts && opts.path != null) { if (typeof opts.path !== 'string') { throw new InvalidArgumentError('invalid opts.path') } let path = opts.path if (!opts.path.startsWith('/')) { path = `/${path}` } url = new URL(util.parseOrigin(url).origin + path) } else { if (!opts) { opts = typeof url === 'object' ? url : {} } url = util.parseURL(url) } const { agent, dispatcher = getGlobalDispatcher() } = opts if (agent) { throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?') } return fn.call(dispatcher, { ...opts, origin: url.origin, path: url.search ? `${url.pathname}${url.search}` : url.pathname, method: opts.method || (opts.body ? 'PUT' : 'GET') }, handler) } } module.exports.setGlobalDispatcher = setGlobalDispatcher module.exports.getGlobalDispatcher = getGlobalDispatcher const fetchImpl = (__nccwpck_require__(85170).fetch) module.exports.fetch = async function fetch (init, options = undefined) { try { return await fetchImpl(init, options) } catch (err) { if (err && typeof err === 'object') { Error.captureStackTrace(err) } throw err } } module.exports.Headers = __nccwpck_require__(52991).Headers module.exports.Response = __nccwpck_require__(12583).Response module.exports.Request = __nccwpck_require__(20610).Request module.exports.FormData = __nccwpck_require__(73162).FormData module.exports.File = globalThis.File ?? (__nccwpck_require__(72254).File) module.exports.FileReader = __nccwpck_require__(35658).FileReader const { setGlobalOrigin, getGlobalOrigin } = __nccwpck_require__(52850) module.exports.setGlobalOrigin = setGlobalOrigin module.exports.getGlobalOrigin = getGlobalOrigin const { CacheStorage } = __nccwpck_require__(76847) const { kConstruct } = __nccwpck_require__(92562) // Cache & CacheStorage are tightly coupled with fetch. Even if it may run // in an older version of Node, it doesn't have any use without fetch. module.exports.caches = new CacheStorage(kConstruct) const { deleteCookie, getCookies, getSetCookies, setCookie } = __nccwpck_require__(42193) module.exports.deleteCookie = deleteCookie module.exports.getCookies = getCookies module.exports.getSetCookies = getSetCookies module.exports.setCookie = setCookie const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(17704) module.exports.parseMIMEType = parseMIMEType module.exports.serializeAMimeType = serializeAMimeType const { CloseEvent, ErrorEvent, MessageEvent } = __nccwpck_require__(55033) module.exports.WebSocket = __nccwpck_require__(92846).WebSocket module.exports.CloseEvent = CloseEvent module.exports.ErrorEvent = ErrorEvent module.exports.MessageEvent = MessageEvent module.exports.request = makeDispatcher(api.request) module.exports.stream = makeDispatcher(api.stream) module.exports.pipeline = makeDispatcher(api.pipeline) module.exports.connect = makeDispatcher(api.connect) module.exports.upgrade = makeDispatcher(api.upgrade) module.exports.MockClient = MockClient module.exports.MockPool = MockPool module.exports.MockAgent = MockAgent module.exports.mockErrors = mockErrors const { EventSource } = __nccwpck_require__(36127) module.exports.EventSource = EventSource /***/ }), /***/ 7032: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { addAbortListener } = __nccwpck_require__(83983) const { RequestAbortedError } = __nccwpck_require__(48045) const kListener = Symbol('kListener') const kSignal = Symbol('kSignal') function abort (self) { if (self.abort) { self.abort(self[kSignal]?.reason) } else { self.reason = self[kSignal]?.reason ?? new RequestAbortedError() } removeSignal(self) } function addSignal (self, signal) { self.reason = null self[kSignal] = null self[kListener] = null if (!signal) { return } if (signal.aborted) { abort(self) return } self[kSignal] = signal self[kListener] = () => { abort(self) } addAbortListener(self[kSignal], self[kListener]) } function removeSignal (self) { if (!self[kSignal]) { return } if ('removeEventListener' in self[kSignal]) { self[kSignal].removeEventListener('abort', self[kListener]) } else { self[kSignal].removeListener('abort', self[kListener]) } self[kSignal] = null self[kListener] = null } module.exports = { addSignal, removeSignal } /***/ }), /***/ 29744: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(98061) const { AsyncResource } = __nccwpck_require__(92761) const { InvalidArgumentError, SocketError } = __nccwpck_require__(48045) const util = __nccwpck_require__(83983) const { addSignal, removeSignal } = __nccwpck_require__(7032) class ConnectHandler extends AsyncResource { constructor (opts, callback) { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } const { signal, opaque, responseHeaders } = opts if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') } super('UNDICI_CONNECT') this.opaque = opaque || null this.responseHeaders = responseHeaders || null this.callback = callback this.abort = null addSignal(this, signal) } onConnect (abort, context) { if (this.reason) { abort(this.reason) return } assert(this.callback) this.abort = abort this.context = context } onHeaders () { throw new SocketError('bad connect', null) } onUpgrade (statusCode, rawHeaders, socket) { const { callback, opaque, context } = this removeSignal(this) this.callback = null let headers = rawHeaders // Indicates is an HTTP2Session if (headers != null) { headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) } this.runInAsyncScope(callback, null, null, { statusCode, headers, socket, opaque, context }) } onError (err) { const { callback, opaque } = this removeSignal(this) if (callback) { this.callback = null queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }) }) } } } function connect (opts, callback) { if (callback === undefined) { return new Promise((resolve, reject) => { connect.call(this, opts, (err, data) => { return err ? reject(err) : resolve(data) }) }) } try { const connectHandler = new ConnectHandler(opts, callback) this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler) } catch (err) { if (typeof callback !== 'function') { throw err } const opaque = opts?.opaque queueMicrotask(() => callback(err, { opaque })) } } module.exports = connect /***/ }), /***/ 28752: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Readable, Duplex, PassThrough } = __nccwpck_require__(84492) const { InvalidArgumentError, InvalidReturnValueError, RequestAbortedError } = __nccwpck_require__(48045) const util = __nccwpck_require__(83983) const { AsyncResource } = __nccwpck_require__(92761) const { addSignal, removeSignal } = __nccwpck_require__(7032) const assert = __nccwpck_require__(98061) const kResume = Symbol('resume') class PipelineRequest extends Readable { constructor () { super({ autoDestroy: true }) this[kResume] = null } _read () { const { [kResume]: resume } = this if (resume) { this[kResume] = null resume() } } _destroy (err, callback) { this._read() callback(err) } } class PipelineResponse extends Readable { constructor (resume) { super({ autoDestroy: true }) this[kResume] = resume } _read () { this[kResume]() } _destroy (err, callback) { if (!err && !this._readableState.endEmitted) { err = new RequestAbortedError() } callback(err) } } class PipelineHandler extends AsyncResource { constructor (opts, handler) { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } if (typeof handler !== 'function') { throw new InvalidArgumentError('invalid handler') } const { signal, method, opaque, onInfo, responseHeaders } = opts if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') } if (method === 'CONNECT') { throw new InvalidArgumentError('invalid method') } if (onInfo && typeof onInfo !== 'function') { throw new InvalidArgumentError('invalid onInfo callback') } super('UNDICI_PIPELINE') this.opaque = opaque || null this.responseHeaders = responseHeaders || null this.handler = handler this.abort = null this.context = null this.onInfo = onInfo || null this.req = new PipelineRequest().on('error', util.nop) this.ret = new Duplex({ readableObjectMode: opts.objectMode, autoDestroy: true, read: () => { const { body } = this if (body?.resume) { body.resume() } }, write: (chunk, encoding, callback) => { const { req } = this if (req.push(chunk, encoding) || req._readableState.destroyed) { callback() } else { req[kResume] = callback } }, destroy: (err, callback) => { const { body, req, res, ret, abort } = this if (!err && !ret._readableState.endEmitted) { err = new RequestAbortedError() } if (abort && err) { abort() } util.destroy(body, err) util.destroy(req, err) util.destroy(res, err) removeSignal(this) callback(err) } }).on('prefinish', () => { const { req } = this // Node < 15 does not call _final in same tick. req.push(null) }) this.res = null addSignal(this, signal) } onConnect (abort, context) { const { ret, res } = this if (this.reason) { abort(this.reason) return } assert(!res, 'pipeline cannot be retried') assert(!ret.destroyed) this.abort = abort this.context = context } onHeaders (statusCode, rawHeaders, resume) { const { opaque, handler, context } = this if (statusCode < 200) { if (this.onInfo) { const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) this.onInfo({ statusCode, headers }) } return } this.res = new PipelineResponse(resume) let body try { this.handler = null const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) body = this.runInAsyncScope(handler, null, { statusCode, headers, opaque, body: this.res, context }) } catch (err) { this.res.on('error', util.nop) throw err } if (!body || typeof body.on !== 'function') { throw new InvalidReturnValueError('expected Readable') } body .on('data', (chunk) => { const { ret, body } = this if (!ret.push(chunk) && body.pause) { body.pause() } }) .on('error', (err) => { const { ret } = this util.destroy(ret, err) }) .on('end', () => { const { ret } = this ret.push(null) }) .on('close', () => { const { ret } = this if (!ret._readableState.ended) { util.destroy(ret, new RequestAbortedError()) } }) this.body = body } onData (chunk) { const { res } = this return res.push(chunk) } onComplete (trailers) { const { res } = this res.push(null) } onError (err) { const { ret } = this this.handler = null util.destroy(ret, err) } } function pipeline (opts, handler) { try { const pipelineHandler = new PipelineHandler(opts, handler) this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler) return pipelineHandler.ret } catch (err) { return new PassThrough().destroy(err) } } module.exports = pipeline /***/ }), /***/ 55448: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(98061) const { Readable } = __nccwpck_require__(73858) const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(48045) const util = __nccwpck_require__(83983) const { getResolveErrorBodyCallback } = __nccwpck_require__(77474) const { AsyncResource } = __nccwpck_require__(92761) class RequestHandler extends AsyncResource { constructor (opts, callback) { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts try { if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) { throw new InvalidArgumentError('invalid highWaterMark') } if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') } if (method === 'CONNECT') { throw new InvalidArgumentError('invalid method') } if (onInfo && typeof onInfo !== 'function') { throw new InvalidArgumentError('invalid onInfo callback') } super('UNDICI_REQUEST') } catch (err) { if (util.isStream(body)) { util.destroy(body.on('error', util.nop), err) } throw err } this.method = method this.responseHeaders = responseHeaders || null this.opaque = opaque || null this.callback = callback this.res = null this.abort = null this.body = body this.trailers = {} this.context = null this.onInfo = onInfo || null this.throwOnError = throwOnError this.highWaterMark = highWaterMark this.signal = signal this.reason = null this.removeAbortListener = null if (util.isStream(body)) { body.on('error', (err) => { this.onError(err) }) } if (this.signal) { if (this.signal.aborted) { this.reason = this.signal.reason ?? new RequestAbortedError() } else { this.removeAbortListener = util.addAbortListener(this.signal, () => { this.reason = this.signal.reason ?? new RequestAbortedError() if (this.res) { util.destroy(this.res.on('error', util.nop), this.reason) } else if (this.abort) { this.abort(this.reason) } if (this.removeAbortListener) { this.res?.off('close', this.removeAbortListener) this.removeAbortListener() this.removeAbortListener = null } }) } } } onConnect (abort, context) { if (this.reason) { abort(this.reason) return } assert(this.callback) this.abort = abort this.context = context } onHeaders (statusCode, rawHeaders, resume, statusMessage) { const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }) } return } const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers const contentType = parsedHeaders['content-type'] const contentLength = parsedHeaders['content-length'] const res = new Readable({ resume, abort, contentType, contentLength: this.method !== 'HEAD' && contentLength ? Number(contentLength) : null, highWaterMark }) if (this.removeAbortListener) { res.on('close', this.removeAbortListener) } this.callback = null this.res = res if (callback !== null) { if (this.throwOnError && statusCode >= 400) { this.runInAsyncScope(getResolveErrorBodyCallback, null, { callback, body: res, contentType, statusCode, statusMessage, headers } ) } else { this.runInAsyncScope(callback, null, null, { statusCode, headers, trailers: this.trailers, opaque, body: res, context }) } } } onData (chunk) { return this.res.push(chunk) } onComplete (trailers) { util.parseHeaders(trailers, this.trailers) this.res.push(null) } onError (err) { const { res, callback, body, opaque } = this if (callback) { // TODO: Does this need queueMicrotask? this.callback = null queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }) }) } if (res) { this.res = null // Ensure all queued handlers are invoked before destroying res. queueMicrotask(() => { util.destroy(res, err) }) } if (body) { this.body = null util.destroy(body, err) } if (this.removeAbortListener) { res?.off('close', this.removeAbortListener) this.removeAbortListener() this.removeAbortListener = null } } } function request (opts, callback) { if (callback === undefined) { return new Promise((resolve, reject) => { request.call(this, opts, (err, data) => { return err ? reject(err) : resolve(data) }) }) } try { this.dispatch(opts, new RequestHandler(opts, callback)) } catch (err) { if (typeof callback !== 'function') { throw err } const opaque = opts?.opaque queueMicrotask(() => callback(err, { opaque })) } } module.exports = request module.exports.RequestHandler = RequestHandler /***/ }), /***/ 75395: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(98061) const { finished, PassThrough } = __nccwpck_require__(84492) const { InvalidArgumentError, InvalidReturnValueError } = __nccwpck_require__(48045) const util = __nccwpck_require__(83983) const { getResolveErrorBodyCallback } = __nccwpck_require__(77474) const { AsyncResource } = __nccwpck_require__(92761) const { addSignal, removeSignal } = __nccwpck_require__(7032) class StreamHandler extends AsyncResource { constructor (opts, factory, callback) { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts try { if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } if (typeof factory !== 'function') { throw new InvalidArgumentError('invalid factory') } if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') } if (method === 'CONNECT') { throw new InvalidArgumentError('invalid method') } if (onInfo && typeof onInfo !== 'function') { throw new InvalidArgumentError('invalid onInfo callback') } super('UNDICI_STREAM') } catch (err) { if (util.isStream(body)) { util.destroy(body.on('error', util.nop), err) } throw err } this.responseHeaders = responseHeaders || null this.opaque = opaque || null this.factory = factory this.callback = callback this.res = null this.abort = null this.context = null this.trailers = null this.body = body this.onInfo = onInfo || null this.throwOnError = throwOnError || false if (util.isStream(body)) { body.on('error', (err) => { this.onError(err) }) } addSignal(this, signal) } onConnect (abort, context) { if (this.reason) { abort(this.reason) return } assert(this.callback) this.abort = abort this.context = context } onHeaders (statusCode, rawHeaders, resume, statusMessage) { const { factory, opaque, context, callback, responseHeaders } = this const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }) } return } this.factory = null let res if (this.throwOnError && statusCode >= 400) { const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers const contentType = parsedHeaders['content-type'] res = new PassThrough() this.callback = null this.runInAsyncScope(getResolveErrorBodyCallback, null, { callback, body: res, contentType, statusCode, statusMessage, headers } ) } else { if (factory === null) { return } res = this.runInAsyncScope(factory, null, { statusCode, headers, opaque, context }) if ( !res || typeof res.write !== 'function' || typeof res.end !== 'function' || typeof res.on !== 'function' ) { throw new InvalidReturnValueError('expected Writable') } // TODO: Avoid finished. It registers an unnecessary amount of listeners. finished(res, { readable: false }, (err) => { const { callback, res, opaque, trailers, abort } = this this.res = null if (err || !res.readable) { util.destroy(res, err) } this.callback = null this.runInAsyncScope(callback, null, err || null, { opaque, trailers }) if (err) { abort() } }) } res.on('drain', resume) this.res = res const needDrain = res.writableNeedDrain !== undefined ? res.writableNeedDrain : res._writableState?.needDrain return needDrain !== true } onData (chunk) { const { res } = this return res ? res.write(chunk) : true } onComplete (trailers) { const { res } = this removeSignal(this) if (!res) { return } this.trailers = util.parseHeaders(trailers) res.end() } onError (err) { const { res, callback, opaque, body } = this removeSignal(this) this.factory = null if (res) { this.res = null util.destroy(res, err) } else if (callback) { this.callback = null queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }) }) } if (body) { this.body = null util.destroy(body, err) } } } function stream (opts, factory, callback) { if (callback === undefined) { return new Promise((resolve, reject) => { stream.call(this, opts, factory, (err, data) => { return err ? reject(err) : resolve(data) }) }) } try { this.dispatch(opts, new StreamHandler(opts, factory, callback)) } catch (err) { if (typeof callback !== 'function') { throw err } const opaque = opts?.opaque queueMicrotask(() => callback(err, { opaque })) } } module.exports = stream /***/ }), /***/ 36923: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { InvalidArgumentError, SocketError } = __nccwpck_require__(48045) const { AsyncResource } = __nccwpck_require__(92761) const util = __nccwpck_require__(83983) const { addSignal, removeSignal } = __nccwpck_require__(7032) const assert = __nccwpck_require__(98061) class UpgradeHandler extends AsyncResource { constructor (opts, callback) { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('invalid opts') } if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } const { signal, opaque, responseHeaders } = opts if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') { throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget') } super('UNDICI_UPGRADE') this.responseHeaders = responseHeaders || null this.opaque = opaque || null this.callback = callback this.abort = null this.context = null addSignal(this, signal) } onConnect (abort, context) { if (this.reason) { abort(this.reason) return } assert(this.callback) this.abort = abort this.context = null } onHeaders () { throw new SocketError('bad upgrade', null) } onUpgrade (statusCode, rawHeaders, socket) { assert(statusCode === 101) const { callback, opaque, context } = this removeSignal(this) this.callback = null const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders) this.runInAsyncScope(callback, null, null, { headers, socket, opaque, context }) } onError (err) { const { callback, opaque } = this removeSignal(this) if (callback) { this.callback = null queueMicrotask(() => { this.runInAsyncScope(callback, null, err, { opaque }) }) } } } function upgrade (opts, callback) { if (callback === undefined) { return new Promise((resolve, reject) => { upgrade.call(this, opts, (err, data) => { return err ? reject(err) : resolve(data) }) }) } try { const upgradeHandler = new UpgradeHandler(opts, callback) this.dispatch({ ...opts, method: opts.method || 'GET', upgrade: opts.protocol || 'Websocket' }, upgradeHandler) } catch (err) { if (typeof callback !== 'function') { throw err } const opaque = opts?.opaque queueMicrotask(() => callback(err, { opaque })) } } module.exports = upgrade /***/ }), /***/ 44059: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports.request = __nccwpck_require__(55448) module.exports.stream = __nccwpck_require__(75395) module.exports.pipeline = __nccwpck_require__(28752) module.exports.upgrade = __nccwpck_require__(36923) module.exports.connect = __nccwpck_require__(29744) /***/ }), /***/ 73858: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; // Ported from https://github.com/nodejs/undici/pull/907 const assert = __nccwpck_require__(98061) const { Readable } = __nccwpck_require__(84492) const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = __nccwpck_require__(48045) const util = __nccwpck_require__(83983) const { ReadableStreamFrom } = __nccwpck_require__(83983) const kConsume = Symbol('kConsume') const kReading = Symbol('kReading') const kBody = Symbol('kBody') const kAbort = Symbol('kAbort') const kContentType = Symbol('kContentType') const kContentLength = Symbol('kContentLength') const noop = () => {} class BodyReadable extends Readable { constructor ({ resume, abort, contentType = '', contentLength, highWaterMark = 64 * 1024 // Same as nodejs fs streams. }) { super({ autoDestroy: true, read: resume, highWaterMark }) this._readableState.dataEmitted = false this[kAbort] = abort this[kConsume] = null this[kBody] = null this[kContentType] = contentType this[kContentLength] = contentLength // Is stream being consumed through Readable API? // This is an optimization so that we avoid checking // for 'data' and 'readable' listeners in the hot path // inside push(). this[kReading] = false } destroy (err) { if (!err && !this._readableState.endEmitted) { err = new RequestAbortedError() } if (err) { this[kAbort]() } return super.destroy(err) } _destroy (err, callback) { // Workaround for Node "bug". If the stream is destroyed in same // tick as it is created, then a user who is waiting for a // promise (i.e micro tick) for installing a 'error' listener will // never get a chance and will always encounter an unhandled exception. if (!this[kReading]) { setImmediate(() => { callback(err) }) } else { callback(err) } } on (ev, ...args) { if (ev === 'data' || ev === 'readable') { this[kReading] = true } return super.on(ev, ...args) } addListener (ev, ...args) { return this.on(ev, ...args) } off (ev, ...args) { const ret = super.off(ev, ...args) if (ev === 'data' || ev === 'readable') { this[kReading] = ( this.listenerCount('data') > 0 || this.listenerCount('readable') > 0 ) } return ret } removeListener (ev, ...args) { return this.off(ev, ...args) } push (chunk) { if (this[kConsume] && chunk !== null) { consumePush(this[kConsume], chunk) return this[kReading] ? super.push(chunk) : true } return super.push(chunk) } // https://fetch.spec.whatwg.org/#dom-body-text async text () { return consume(this, 'text') } // https://fetch.spec.whatwg.org/#dom-body-json async json () { return consume(this, 'json') } // https://fetch.spec.whatwg.org/#dom-body-blob async blob () { return consume(this, 'blob') } // https://fetch.spec.whatwg.org/#dom-body-bytes async bytes () { return consume(this, 'bytes') } // https://fetch.spec.whatwg.org/#dom-body-arraybuffer async arrayBuffer () { return consume(this, 'arrayBuffer') } // https://fetch.spec.whatwg.org/#dom-body-formdata async formData () { // TODO: Implement. throw new NotSupportedError() } // https://fetch.spec.whatwg.org/#dom-body-bodyused get bodyUsed () { return util.isDisturbed(this) } // https://fetch.spec.whatwg.org/#dom-body-body get body () { if (!this[kBody]) { this[kBody] = ReadableStreamFrom(this) if (this[kConsume]) { // TODO: Is this the best way to force a lock? this[kBody].getReader() // Ensure stream is locked. assert(this[kBody].locked) } } return this[kBody] } async dump (opts) { let limit = Number.isFinite(opts?.limit) ? opts.limit : 128 * 1024 const signal = opts?.signal if (signal != null && (typeof signal !== 'object' || !('aborted' in signal))) { throw new InvalidArgumentError('signal must be an AbortSignal') } signal?.throwIfAborted() if (this._readableState.closeEmitted) { return null } return await new Promise((resolve, reject) => { if (this[kContentLength] > limit) { this.destroy(new AbortError()) } const onAbort = () => { this.destroy(signal.reason ?? new AbortError()) } signal?.addEventListener('abort', onAbort) this .on('close', function () { signal?.removeEventListener('abort', onAbort) if (signal?.aborted) { reject(signal.reason ?? new AbortError()) } else { resolve(null) } }) .on('error', noop) .on('data', function (chunk) { limit -= chunk.length if (limit <= 0) { this.destroy() } }) .resume() }) } } // https://streams.spec.whatwg.org/#readablestream-locked function isLocked (self) { // Consume is an implicit lock. return (self[kBody] && self[kBody].locked === true) || self[kConsume] } // https://fetch.spec.whatwg.org/#body-unusable function isUnusable (self) { return util.isDisturbed(self) || isLocked(self) } async function consume (stream, type) { assert(!stream[kConsume]) return new Promise((resolve, reject) => { if (isUnusable(stream)) { const rState = stream._readableState if (rState.destroyed && rState.closeEmitted === false) { stream .on('error', err => { reject(err) }) .on('close', () => { reject(new TypeError('unusable')) }) } else { reject(rState.errored ?? new TypeError('unusable')) } } else { queueMicrotask(() => { stream[kConsume] = { type, stream, resolve, reject, length: 0, body: [] } stream .on('error', function (err) { consumeFinish(this[kConsume], err) }) .on('close', function () { if (this[kConsume].body !== null) { consumeFinish(this[kConsume], new RequestAbortedError()) } }) consumeStart(stream[kConsume]) }) } }) } function consumeStart (consume) { if (consume.body === null) { return } const { _readableState: state } = consume.stream if (state.bufferIndex) { const start = state.bufferIndex const end = state.buffer.length for (let n = start; n < end; n++) { consumePush(consume, state.buffer[n]) } } else { for (const chunk of state.buffer) { consumePush(consume, chunk) } } if (state.endEmitted) { consumeEnd(this[kConsume]) } else { consume.stream.on('end', function () { consumeEnd(this[kConsume]) }) } consume.stream.resume() while (consume.stream.read() != null) { // Loop } } /** * @param {Buffer[]} chunks * @param {number} length */ function chunksDecode (chunks, length) { if (chunks.length === 0 || length === 0) { return '' } const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length) const bufferLength = buffer.length // Skip BOM. const start = bufferLength > 2 && buffer[0] === 0xef && buffer[1] === 0xbb && buffer[2] === 0xbf ? 3 : 0 return buffer.utf8Slice(start, bufferLength) } /** * @param {Buffer[]} chunks * @param {number} length * @returns {Uint8Array} */ function chunksConcat (chunks, length) { if (chunks.length === 0 || length === 0) { return new Uint8Array(0) } if (chunks.length === 1) { // fast-path return new Uint8Array(chunks[0]) } const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer) let offset = 0 for (let i = 0; i < chunks.length; ++i) { const chunk = chunks[i] buffer.set(chunk, offset) offset += chunk.length } return buffer } function consumeEnd (consume) { const { type, body, resolve, stream, length } = consume try { if (type === 'text') { resolve(chunksDecode(body, length)) } else if (type === 'json') { resolve(JSON.parse(chunksDecode(body, length))) } else if (type === 'arrayBuffer') { resolve(chunksConcat(body, length).buffer) } else if (type === 'blob') { resolve(new Blob(body, { type: stream[kContentType] })) } else if (type === 'bytes') { resolve(chunksConcat(body, length)) } consumeFinish(consume) } catch (err) { stream.destroy(err) } } function consumePush (consume, chunk) { consume.length += chunk.length consume.body.push(chunk) } function consumeFinish (consume, err) { if (consume.body === null) { return } if (err) { consume.reject(err) } else { consume.resolve() } consume.type = null consume.stream = null consume.resolve = null consume.reject = null consume.length = 0 consume.body = null } module.exports = { Readable: BodyReadable, chunksDecode } /***/ }), /***/ 77474: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const assert = __nccwpck_require__(98061) const { ResponseStatusCodeError } = __nccwpck_require__(48045) const { chunksDecode } = __nccwpck_require__(73858) const CHUNK_LIMIT = 128 * 1024 async function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) { assert(body) let chunks = [] let length = 0 try { for await (const chunk of body) { chunks.push(chunk) length += chunk.length if (length > CHUNK_LIMIT) { chunks = [] length = 0 break } } } catch { chunks = [] length = 0 // Do nothing.... } const message = `Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}` if (statusCode === 204 || !contentType || !length) { queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers))) return } const stackTraceLimit = Error.stackTraceLimit Error.stackTraceLimit = 0 let payload try { if (isContentTypeApplicationJson(contentType)) { payload = JSON.parse(chunksDecode(chunks, length)) } else if (isContentTypeText(contentType)) { payload = chunksDecode(chunks, length) } } catch { // process in a callback to avoid throwing in the microtask queue } finally { Error.stackTraceLimit = stackTraceLimit } queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers, payload))) } const isContentTypeApplicationJson = (contentType) => { return ( contentType.length > 15 && contentType[11] === '/' && contentType[0] === 'a' && contentType[1] === 'p' && contentType[2] === 'p' && contentType[3] === 'l' && contentType[4] === 'i' && contentType[5] === 'c' && contentType[6] === 'a' && contentType[7] === 't' && contentType[8] === 'i' && contentType[9] === 'o' && contentType[10] === 'n' && contentType[12] === 'j' && contentType[13] === 's' && contentType[14] === 'o' && contentType[15] === 'n' ) } const isContentTypeText = (contentType) => { return ( contentType.length > 4 && contentType[4] === '/' && contentType[0] === 't' && contentType[1] === 'e' && contentType[2] === 'x' && contentType[3] === 't' ) } module.exports = { getResolveErrorBodyCallback, isContentTypeApplicationJson, isContentTypeText } /***/ }), /***/ 82067: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const net = __nccwpck_require__(87503) const assert = __nccwpck_require__(98061) const util = __nccwpck_require__(83983) const { InvalidArgumentError, ConnectTimeoutError } = __nccwpck_require__(48045) const timers = __nccwpck_require__(85194) function noop () {} let tls // include tls conditionally since it is not always available // TODO: session re-use does not wait for the first // connection to resolve the session and might therefore // resolve the same servername multiple times even when // re-use is enabled. let SessionCache // FIXME: remove workaround when the Node bug is fixed // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308 if (global.FinalizationRegistry && !(process.env.NODE_V8_COVERAGE || process.env.UNDICI_NO_FG)) { SessionCache = class WeakSessionCache { constructor (maxCachedSessions) { this._maxCachedSessions = maxCachedSessions this._sessionCache = new Map() this._sessionRegistry = new global.FinalizationRegistry((key) => { if (this._sessionCache.size < this._maxCachedSessions) { return } const ref = this._sessionCache.get(key) if (ref !== undefined && ref.deref() === undefined) { this._sessionCache.delete(key) } }) } get (sessionKey) { const ref = this._sessionCache.get(sessionKey) return ref ? ref.deref() : null } set (sessionKey, session) { if (this._maxCachedSessions === 0) { return } this._sessionCache.set(sessionKey, new WeakRef(session)) this._sessionRegistry.register(session, sessionKey) } } } else { SessionCache = class SimpleSessionCache { constructor (maxCachedSessions) { this._maxCachedSessions = maxCachedSessions this._sessionCache = new Map() } get (sessionKey) { return this._sessionCache.get(sessionKey) } set (sessionKey, session) { if (this._maxCachedSessions === 0) { return } if (this._sessionCache.size >= this._maxCachedSessions) { // remove the oldest session const { value: oldestKey } = this._sessionCache.keys().next() this._sessionCache.delete(oldestKey) } this._sessionCache.set(sessionKey, session) } } } function buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, session: customSession, ...opts }) { if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) { throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero') } const options = { path: socketPath, ...opts } const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions) timeout = timeout == null ? 10e3 : timeout allowH2 = allowH2 != null ? allowH2 : false return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { let socket if (protocol === 'https:') { if (!tls) { tls = __nccwpck_require__(31764) } servername = servername || options.servername || util.getServerName(host) || null const sessionKey = servername || hostname assert(sessionKey) const session = customSession || sessionCache.get(sessionKey) || null port = port || 443 socket = tls.connect({ highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... ...options, servername, session, localAddress, // TODO(HTTP/2): Add support for h2c ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'], socket: httpSocket, // upgrade socket connection port, host: hostname }) socket .on('session', function (session) { // TODO (fix): Can a session become invalid once established? Don't think so? sessionCache.set(sessionKey, session) }) } else { assert(!httpSocket, 'httpSocket can only be sent on TLS update') port = port || 80 socket = net.connect({ highWaterMark: 64 * 1024, // Same as nodejs fs streams. ...options, localAddress, port, host: hostname }) } // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket if (options.keepAlive == null || options.keepAlive) { const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay socket.setKeepAlive(true, keepAliveInitialDelay) } const clearConnectTimeout = setupConnectTimeout(new WeakRef(socket), { timeout, hostname, port }) socket .setNoDelay(true) .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () { queueMicrotask(clearConnectTimeout) if (callback) { const cb = callback callback = null cb(null, this) } }) .on('error', function (err) { queueMicrotask(clearConnectTimeout) if (callback) { const cb = callback callback = null cb(err) } }) return socket } } /** * @param {WeakRef} socketWeakRef * @param {object} opts * @param {number} opts.timeout * @param {string} opts.hostname * @param {number} opts.port * @returns {() => void} */ const setupConnectTimeout = process.platform === 'win32' ? (socketWeakRef, opts) => { if (!opts.timeout) { return noop } let s1 = null let s2 = null const fastTimer = timers.setFastTimeout(() => { // setImmediate is added to make sure that we prioritize socket error events over timeouts s1 = setImmediate(() => { // Windows needs an extra setImmediate probably due to implementation differences in the socket logic s2 = setImmediate(() => onConnectTimeout(socketWeakRef.deref(), opts)) }) }, opts.timeout) return () => { timers.clearFastTimeout(fastTimer) clearImmediate(s1) clearImmediate(s2) } } : (socketWeakRef, opts) => { if (!opts.timeout) { return noop } let s1 = null const fastTimer = timers.setFastTimeout(() => { // setImmediate is added to make sure that we prioritize socket error events over timeouts s1 = setImmediate(() => { onConnectTimeout(socketWeakRef.deref(), opts) }) }, opts.timeout) return () => { timers.clearFastTimeout(fastTimer) clearImmediate(s1) } } /** * @param {net.Socket} socket * @param {object} opts * @param {number} opts.timeout * @param {string} opts.hostname * @param {number} opts.port */ function onConnectTimeout (socket, opts) { // The socket could be already garbage collected if (socket == null) { return } let message = 'Connect Timeout Error' if (Array.isArray(socket.autoSelectFamilyAttemptedAddresses)) { message += ` (attempted addresses: ${socket.autoSelectFamilyAttemptedAddresses.join(', ')},` } else { message += ` (attempted address: ${opts.hostname}:${opts.port},` } message += ` timeout: ${opts.timeout}ms)` util.destroy(socket, new ConnectTimeoutError(message)) } module.exports = buildConnector /***/ }), /***/ 14462: /***/ ((module) => { "use strict"; /** @type {Record} */ const headerNameLowerCasedRecord = {} // https://developer.mozilla.org/docs/Web/HTTP/Headers const wellknownHeaderNames = [ 'Accept', 'Accept-Encoding', 'Accept-Language', 'Accept-Ranges', 'Access-Control-Allow-Credentials', 'Access-Control-Allow-Headers', 'Access-Control-Allow-Methods', 'Access-Control-Allow-Origin', 'Access-Control-Expose-Headers', 'Access-Control-Max-Age', 'Access-Control-Request-Headers', 'Access-Control-Request-Method', 'Age', 'Allow', 'Alt-Svc', 'Alt-Used', 'Authorization', 'Cache-Control', 'Clear-Site-Data', 'Connection', 'Content-Disposition', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-Location', 'Content-Range', 'Content-Security-Policy', 'Content-Security-Policy-Report-Only', 'Content-Type', 'Cookie', 'Cross-Origin-Embedder-Policy', 'Cross-Origin-Opener-Policy', 'Cross-Origin-Resource-Policy', 'Date', 'Device-Memory', 'Downlink', 'ECT', 'ETag', 'Expect', 'Expect-CT', 'Expires', 'Forwarded', 'From', 'Host', 'If-Match', 'If-Modified-Since', 'If-None-Match', 'If-Range', 'If-Unmodified-Since', 'Keep-Alive', 'Last-Modified', 'Link', 'Location', 'Max-Forwards', 'Origin', 'Permissions-Policy', 'Pragma', 'Proxy-Authenticate', 'Proxy-Authorization', 'RTT', 'Range', 'Referer', 'Referrer-Policy', 'Refresh', 'Retry-After', 'Sec-WebSocket-Accept', 'Sec-WebSocket-Extensions', 'Sec-WebSocket-Key', 'Sec-WebSocket-Protocol', 'Sec-WebSocket-Version', 'Server', 'Server-Timing', 'Service-Worker-Allowed', 'Service-Worker-Navigation-Preload', 'Set-Cookie', 'SourceMap', 'Strict-Transport-Security', 'Supports-Loading-Mode', 'TE', 'Timing-Allow-Origin', 'Trailer', 'Transfer-Encoding', 'Upgrade', 'Upgrade-Insecure-Requests', 'User-Agent', 'Vary', 'Via', 'WWW-Authenticate', 'X-Content-Type-Options', 'X-DNS-Prefetch-Control', 'X-Frame-Options', 'X-Permitted-Cross-Domain-Policies', 'X-Powered-By', 'X-Requested-With', 'X-XSS-Protection' ] for (let i = 0; i < wellknownHeaderNames.length; ++i) { const key = wellknownHeaderNames[i] const lowerCasedKey = key.toLowerCase() headerNameLowerCasedRecord[key] = headerNameLowerCasedRecord[lowerCasedKey] = lowerCasedKey } // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. Object.setPrototypeOf(headerNameLowerCasedRecord, null) module.exports = { wellknownHeaderNames, headerNameLowerCasedRecord } /***/ }), /***/ 58438: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const diagnosticsChannel = __nccwpck_require__(65714) const util = __nccwpck_require__(47261) const undiciDebugLog = util.debuglog('undici') const fetchDebuglog = util.debuglog('fetch') const websocketDebuglog = util.debuglog('websocket') let isClientSet = false const channels = { // Client beforeConnect: diagnosticsChannel.channel('undici:client:beforeConnect'), connected: diagnosticsChannel.channel('undici:client:connected'), connectError: diagnosticsChannel.channel('undici:client:connectError'), sendHeaders: diagnosticsChannel.channel('undici:client:sendHeaders'), // Request create: diagnosticsChannel.channel('undici:request:create'), bodySent: diagnosticsChannel.channel('undici:request:bodySent'), headers: diagnosticsChannel.channel('undici:request:headers'), trailers: diagnosticsChannel.channel('undici:request:trailers'), error: diagnosticsChannel.channel('undici:request:error'), // WebSocket open: diagnosticsChannel.channel('undici:websocket:open'), close: diagnosticsChannel.channel('undici:websocket:close'), socketError: diagnosticsChannel.channel('undici:websocket:socket_error'), ping: diagnosticsChannel.channel('undici:websocket:ping'), pong: diagnosticsChannel.channel('undici:websocket:pong') } if (undiciDebugLog.enabled || fetchDebuglog.enabled) { const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog // Track all Client events diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => { const { connectParams: { version, protocol, port, host } } = evt debuglog( 'connecting to %s using %s%s', `${host}${port ? `:${port}` : ''}`, protocol, version ) }) diagnosticsChannel.channel('undici:client:connected').subscribe(evt => { const { connectParams: { version, protocol, port, host } } = evt debuglog( 'connected to %s using %s%s', `${host}${port ? `:${port}` : ''}`, protocol, version ) }) diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => { const { connectParams: { version, protocol, port, host }, error } = evt debuglog( 'connection to %s using %s%s errored - %s', `${host}${port ? `:${port}` : ''}`, protocol, version, error.message ) }) diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => { const { request: { method, path, origin } } = evt debuglog('sending request to %s %s/%s', method, origin, path) }) // Track Request events diagnosticsChannel.channel('undici:request:headers').subscribe(evt => { const { request: { method, path, origin }, response: { statusCode } } = evt debuglog( 'received response to %s %s/%s - HTTP %d', method, origin, path, statusCode ) }) diagnosticsChannel.channel('undici:request:trailers').subscribe(evt => { const { request: { method, path, origin } } = evt debuglog('trailers received from %s %s/%s', method, origin, path) }) diagnosticsChannel.channel('undici:request:error').subscribe(evt => { const { request: { method, path, origin }, error } = evt debuglog( 'request to %s %s/%s errored - %s', method, origin, path, error.message ) }) isClientSet = true } if (websocketDebuglog.enabled) { if (!isClientSet) { const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog diagnosticsChannel.channel('undici:client:beforeConnect').subscribe(evt => { const { connectParams: { version, protocol, port, host } } = evt debuglog( 'connecting to %s%s using %s%s', host, port ? `:${port}` : '', protocol, version ) }) diagnosticsChannel.channel('undici:client:connected').subscribe(evt => { const { connectParams: { version, protocol, port, host } } = evt debuglog( 'connected to %s%s using %s%s', host, port ? `:${port}` : '', protocol, version ) }) diagnosticsChannel.channel('undici:client:connectError').subscribe(evt => { const { connectParams: { version, protocol, port, host }, error } = evt debuglog( 'connection to %s%s using %s%s errored - %s', host, port ? `:${port}` : '', protocol, version, error.message ) }) diagnosticsChannel.channel('undici:client:sendHeaders').subscribe(evt => { const { request: { method, path, origin } } = evt debuglog('sending request to %s %s/%s', method, origin, path) }) } // Track all WebSocket events diagnosticsChannel.channel('undici:websocket:open').subscribe(evt => { const { address: { address, port } } = evt websocketDebuglog('connection opened %s%s', address, port ? `:${port}` : '') }) diagnosticsChannel.channel('undici:websocket:close').subscribe(evt => { const { websocket, code, reason } = evt websocketDebuglog( 'closed connection to %s - %s %s', websocket.url, code, reason ) }) diagnosticsChannel.channel('undici:websocket:socket_error').subscribe(err => { websocketDebuglog('connection errored - %s', err.message) }) diagnosticsChannel.channel('undici:websocket:ping').subscribe(evt => { websocketDebuglog('ping received') }) diagnosticsChannel.channel('undici:websocket:pong').subscribe(evt => { websocketDebuglog('pong received') }) } module.exports = { channels } /***/ }), /***/ 48045: /***/ ((module) => { "use strict"; const kUndiciError = Symbol.for('undici.error.UND_ERR') class UndiciError extends Error { constructor (message) { super(message) this.name = 'UndiciError' this.code = 'UND_ERR' } static [Symbol.hasInstance] (instance) { return instance && instance[kUndiciError] === true } [kUndiciError] = true } const kConnectTimeoutError = Symbol.for('undici.error.UND_ERR_CONNECT_TIMEOUT') class ConnectTimeoutError extends UndiciError { constructor (message) { super(message) this.name = 'ConnectTimeoutError' this.message = message || 'Connect Timeout Error' this.code = 'UND_ERR_CONNECT_TIMEOUT' } static [Symbol.hasInstance] (instance) { return instance && instance[kConnectTimeoutError] === true } [kConnectTimeoutError] = true } const kHeadersTimeoutError = Symbol.for('undici.error.UND_ERR_HEADERS_TIMEOUT') class HeadersTimeoutError extends UndiciError { constructor (message) { super(message) this.name = 'HeadersTimeoutError' this.message = message || 'Headers Timeout Error' this.code = 'UND_ERR_HEADERS_TIMEOUT' } static [Symbol.hasInstance] (instance) { return instance && instance[kHeadersTimeoutError] === true } [kHeadersTimeoutError] = true } const kHeadersOverflowError = Symbol.for('undici.error.UND_ERR_HEADERS_OVERFLOW') class HeadersOverflowError extends UndiciError { constructor (message) { super(message) this.name = 'HeadersOverflowError' this.message = message || 'Headers Overflow Error' this.code = 'UND_ERR_HEADERS_OVERFLOW' } static [Symbol.hasInstance] (instance) { return instance && instance[kHeadersOverflowError] === true } [kHeadersOverflowError] = true } const kBodyTimeoutError = Symbol.for('undici.error.UND_ERR_BODY_TIMEOUT') class BodyTimeoutError extends UndiciError { constructor (message) { super(message) this.name = 'BodyTimeoutError' this.message = message || 'Body Timeout Error' this.code = 'UND_ERR_BODY_TIMEOUT' } static [Symbol.hasInstance] (instance) { return instance && instance[kBodyTimeoutError] === true } [kBodyTimeoutError] = true } const kResponseStatusCodeError = Symbol.for('undici.error.UND_ERR_RESPONSE_STATUS_CODE') class ResponseStatusCodeError extends UndiciError { constructor (message, statusCode, headers, body) { super(message) this.name = 'ResponseStatusCodeError' this.message = message || 'Response Status Code Error' this.code = 'UND_ERR_RESPONSE_STATUS_CODE' this.body = body this.status = statusCode this.statusCode = statusCode this.headers = headers } static [Symbol.hasInstance] (instance) { return instance && instance[kResponseStatusCodeError] === true } [kResponseStatusCodeError] = true } const kInvalidArgumentError = Symbol.for('undici.error.UND_ERR_INVALID_ARG') class InvalidArgumentError extends UndiciError { constructor (message) { super(message) this.name = 'InvalidArgumentError' this.message = message || 'Invalid Argument Error' this.code = 'UND_ERR_INVALID_ARG' } static [Symbol.hasInstance] (instance) { return instance && instance[kInvalidArgumentError] === true } [kInvalidArgumentError] = true } const kInvalidReturnValueError = Symbol.for('undici.error.UND_ERR_INVALID_RETURN_VALUE') class InvalidReturnValueError extends UndiciError { constructor (message) { super(message) this.name = 'InvalidReturnValueError' this.message = message || 'Invalid Return Value Error' this.code = 'UND_ERR_INVALID_RETURN_VALUE' } static [Symbol.hasInstance] (instance) { return instance && instance[kInvalidReturnValueError] === true } [kInvalidReturnValueError] = true } const kAbortError = Symbol.for('undici.error.UND_ERR_ABORT') class AbortError extends UndiciError { constructor (message) { super(message) this.name = 'AbortError' this.message = message || 'The operation was aborted' this.code = 'UND_ERR_ABORT' } static [Symbol.hasInstance] (instance) { return instance && instance[kAbortError] === true } [kAbortError] = true } const kRequestAbortedError = Symbol.for('undici.error.UND_ERR_ABORTED') class RequestAbortedError extends AbortError { constructor (message) { super(message) this.name = 'AbortError' this.message = message || 'Request aborted' this.code = 'UND_ERR_ABORTED' } static [Symbol.hasInstance] (instance) { return instance && instance[kRequestAbortedError] === true } [kRequestAbortedError] = true } const kInformationalError = Symbol.for('undici.error.UND_ERR_INFO') class InformationalError extends UndiciError { constructor (message) { super(message) this.name = 'InformationalError' this.message = message || 'Request information' this.code = 'UND_ERR_INFO' } static [Symbol.hasInstance] (instance) { return instance && instance[kInformationalError] === true } [kInformationalError] = true } const kRequestContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_REQ_CONTENT_LENGTH_MISMATCH') class RequestContentLengthMismatchError extends UndiciError { constructor (message) { super(message) this.name = 'RequestContentLengthMismatchError' this.message = message || 'Request body length does not match content-length header' this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' } static [Symbol.hasInstance] (instance) { return instance && instance[kRequestContentLengthMismatchError] === true } [kRequestContentLengthMismatchError] = true } const kResponseContentLengthMismatchError = Symbol.for('undici.error.UND_ERR_RES_CONTENT_LENGTH_MISMATCH') class ResponseContentLengthMismatchError extends UndiciError { constructor (message) { super(message) this.name = 'ResponseContentLengthMismatchError' this.message = message || 'Response body length does not match content-length header' this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH' } static [Symbol.hasInstance] (instance) { return instance && instance[kResponseContentLengthMismatchError] === true } [kResponseContentLengthMismatchError] = true } const kClientDestroyedError = Symbol.for('undici.error.UND_ERR_DESTROYED') class ClientDestroyedError extends UndiciError { constructor (message) { super(message) this.name = 'ClientDestroyedError' this.message = message || 'The client is destroyed' this.code = 'UND_ERR_DESTROYED' } static [Symbol.hasInstance] (instance) { return instance && instance[kClientDestroyedError] === true } [kClientDestroyedError] = true } const kClientClosedError = Symbol.for('undici.error.UND_ERR_CLOSED') class ClientClosedError extends UndiciError { constructor (message) { super(message) this.name = 'ClientClosedError' this.message = message || 'The client is closed' this.code = 'UND_ERR_CLOSED' } static [Symbol.hasInstance] (instance) { return instance && instance[kClientClosedError] === true } [kClientClosedError] = true } const kSocketError = Symbol.for('undici.error.UND_ERR_SOCKET') class SocketError extends UndiciError { constructor (message, socket) { super(message) this.name = 'SocketError' this.message = message || 'Socket error' this.code = 'UND_ERR_SOCKET' this.socket = socket } static [Symbol.hasInstance] (instance) { return instance && instance[kSocketError] === true } [kSocketError] = true } const kNotSupportedError = Symbol.for('undici.error.UND_ERR_NOT_SUPPORTED') class NotSupportedError extends UndiciError { constructor (message) { super(message) this.name = 'NotSupportedError' this.message = message || 'Not supported error' this.code = 'UND_ERR_NOT_SUPPORTED' } static [Symbol.hasInstance] (instance) { return instance && instance[kNotSupportedError] === true } [kNotSupportedError] = true } const kBalancedPoolMissingUpstreamError = Symbol.for('undici.error.UND_ERR_BPL_MISSING_UPSTREAM') class BalancedPoolMissingUpstreamError extends UndiciError { constructor (message) { super(message) this.name = 'MissingUpstreamError' this.message = message || 'No upstream has been added to the BalancedPool' this.code = 'UND_ERR_BPL_MISSING_UPSTREAM' } static [Symbol.hasInstance] (instance) { return instance && instance[kBalancedPoolMissingUpstreamError] === true } [kBalancedPoolMissingUpstreamError] = true } const kHTTPParserError = Symbol.for('undici.error.UND_ERR_HTTP_PARSER') class HTTPParserError extends Error { constructor (message, code, data) { super(message) this.name = 'HTTPParserError' this.code = code ? `HPE_${code}` : undefined this.data = data ? data.toString() : undefined } static [Symbol.hasInstance] (instance) { return instance && instance[kHTTPParserError] === true } [kHTTPParserError] = true } const kResponseExceededMaxSizeError = Symbol.for('undici.error.UND_ERR_RES_EXCEEDED_MAX_SIZE') class ResponseExceededMaxSizeError extends UndiciError { constructor (message) { super(message) this.name = 'ResponseExceededMaxSizeError' this.message = message || 'Response content exceeded max size' this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE' } static [Symbol.hasInstance] (instance) { return instance && instance[kResponseExceededMaxSizeError] === true } [kResponseExceededMaxSizeError] = true } const kRequestRetryError = Symbol.for('undici.error.UND_ERR_REQ_RETRY') class RequestRetryError extends UndiciError { constructor (message, code, { headers, data }) { super(message) this.name = 'RequestRetryError' this.message = message || 'Request retry error' this.code = 'UND_ERR_REQ_RETRY' this.statusCode = code this.data = data this.headers = headers } static [Symbol.hasInstance] (instance) { return instance && instance[kRequestRetryError] === true } [kRequestRetryError] = true } const kResponseError = Symbol.for('undici.error.UND_ERR_RESPONSE') class ResponseError extends UndiciError { constructor (message, code, { headers, data }) { super(message) this.name = 'ResponseError' this.message = message || 'Response error' this.code = 'UND_ERR_RESPONSE' this.statusCode = code this.data = data this.headers = headers } static [Symbol.hasInstance] (instance) { return instance && instance[kResponseError] === true } [kResponseError] = true } const kSecureProxyConnectionError = Symbol.for('undici.error.UND_ERR_PRX_TLS') class SecureProxyConnectionError extends UndiciError { constructor (cause, message, options) { super(message, { cause, ...(options ?? {}) }) this.name = 'SecureProxyConnectionError' this.message = message || 'Secure Proxy Connection failed' this.code = 'UND_ERR_PRX_TLS' this.cause = cause } static [Symbol.hasInstance] (instance) { return instance && instance[kSecureProxyConnectionError] === true } [kSecureProxyConnectionError] = true } const kMessageSizeExceededError = Symbol.for('undici.error.UND_ERR_WS_MESSAGE_SIZE_EXCEEDED') class MessageSizeExceededError extends UndiciError { constructor (message) { super(message) this.name = 'MessageSizeExceededError' this.message = message || 'Max decompressed message size exceeded' this.code = 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED' } static [Symbol.hasInstance] (instance) { return instance && instance[kMessageSizeExceededError] === true } get [kMessageSizeExceededError] () { return true } } module.exports = { AbortError, HTTPParserError, UndiciError, HeadersTimeoutError, HeadersOverflowError, BodyTimeoutError, RequestContentLengthMismatchError, ConnectTimeoutError, ResponseStatusCodeError, InvalidArgumentError, InvalidReturnValueError, RequestAbortedError, ClientDestroyedError, ClientClosedError, InformationalError, SocketError, NotSupportedError, ResponseContentLengthMismatchError, BalancedPoolMissingUpstreamError, ResponseExceededMaxSizeError, RequestRetryError, ResponseError, SecureProxyConnectionError, MessageSizeExceededError } /***/ }), /***/ 62905: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { InvalidArgumentError, NotSupportedError } = __nccwpck_require__(48045) const assert = __nccwpck_require__(98061) const { isValidHTTPToken, isValidHeaderValue, isStream, destroy, isBuffer, isFormDataLike, isIterable, isBlobLike, buildURL, validateHandler, getServerName, normalizedMethodRecords } = __nccwpck_require__(83983) const { channels } = __nccwpck_require__(58438) const { headerNameLowerCasedRecord } = __nccwpck_require__(14462) // Verifies that a given path is valid does not contain control chars \x00 to \x20 const invalidPathRegex = /[^\u0021-\u00ff]/ const kHandler = Symbol('handler') class Request { constructor (origin, { path, method, body, headers, query, idempotent, blocking, upgrade, headersTimeout, bodyTimeout, reset, throwOnError, expectContinue, servername }, handler) { if (typeof path !== 'string') { throw new InvalidArgumentError('path must be a string') } else if ( path[0] !== '/' && !(path.startsWith('http://') || path.startsWith('https://')) && method !== 'CONNECT' ) { throw new InvalidArgumentError('path must be an absolute URL or start with a slash') } else if (invalidPathRegex.test(path)) { throw new InvalidArgumentError('invalid request path') } if (typeof method !== 'string') { throw new InvalidArgumentError('method must be a string') } else if (normalizedMethodRecords[method] === undefined && !isValidHTTPToken(method)) { throw new InvalidArgumentError('invalid request method') } if (upgrade && typeof upgrade !== 'string') { throw new InvalidArgumentError('upgrade must be a string') } if (upgrade && !isValidHeaderValue(upgrade)) { throw new InvalidArgumentError('invalid upgrade header') } if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) { throw new InvalidArgumentError('invalid headersTimeout') } if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) { throw new InvalidArgumentError('invalid bodyTimeout') } if (reset != null && typeof reset !== 'boolean') { throw new InvalidArgumentError('invalid reset') } if (expectContinue != null && typeof expectContinue !== 'boolean') { throw new InvalidArgumentError('invalid expectContinue') } this.headersTimeout = headersTimeout this.bodyTimeout = bodyTimeout this.throwOnError = throwOnError === true this.method = method this.abort = null if (body == null) { this.body = null } else if (isStream(body)) { this.body = body const rState = this.body._readableState if (!rState || !rState.autoDestroy) { this.endHandler = function autoDestroy () { destroy(this) } this.body.on('end', this.endHandler) } this.errorHandler = err => { if (this.abort) { this.abort(err) } else { this.error = err } } this.body.on('error', this.errorHandler) } else if (isBuffer(body)) { this.body = body.byteLength ? body : null } else if (ArrayBuffer.isView(body)) { this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null } else if (body instanceof ArrayBuffer) { this.body = body.byteLength ? Buffer.from(body) : null } else if (typeof body === 'string') { this.body = body.length ? Buffer.from(body) : null } else if (isFormDataLike(body) || isIterable(body) || isBlobLike(body)) { this.body = body } else { throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable') } this.completed = false this.aborted = false this.upgrade = upgrade || null this.path = query ? buildURL(path, query) : path this.origin = origin this.idempotent = idempotent == null ? method === 'HEAD' || method === 'GET' : idempotent this.blocking = blocking == null ? false : blocking this.reset = reset == null ? null : reset this.host = null this.contentLength = null this.contentType = null this.headers = [] // Only for H2 this.expectContinue = expectContinue != null ? expectContinue : false if (Array.isArray(headers)) { if (headers.length % 2 !== 0) { throw new InvalidArgumentError('headers array must be even') } for (let i = 0; i < headers.length; i += 2) { processHeader(this, headers[i], headers[i + 1]) } } else if (headers && typeof headers === 'object') { if (headers[Symbol.iterator]) { for (const header of headers) { if (!Array.isArray(header) || header.length !== 2) { throw new InvalidArgumentError('headers must be in key-value pair format') } processHeader(this, header[0], header[1]) } } else { const keys = Object.keys(headers) for (let i = 0; i < keys.length; ++i) { processHeader(this, keys[i], headers[keys[i]]) } } } else if (headers != null) { throw new InvalidArgumentError('headers must be an object or an array') } validateHandler(handler, method, upgrade) this.servername = servername || getServerName(this.host) this[kHandler] = handler if (channels.create.hasSubscribers) { channels.create.publish({ request: this }) } } onBodySent (chunk) { if (this[kHandler].onBodySent) { try { return this[kHandler].onBodySent(chunk) } catch (err) { this.abort(err) } } } onRequestSent () { if (channels.bodySent.hasSubscribers) { channels.bodySent.publish({ request: this }) } if (this[kHandler].onRequestSent) { try { return this[kHandler].onRequestSent() } catch (err) { this.abort(err) } } } onConnect (abort) { assert(!this.aborted) assert(!this.completed) if (this.error) { abort(this.error) } else { this.abort = abort return this[kHandler].onConnect(abort) } } onResponseStarted () { return this[kHandler].onResponseStarted?.() } onHeaders (statusCode, headers, resume, statusText) { assert(!this.aborted) assert(!this.completed) if (channels.headers.hasSubscribers) { channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }) } try { return this[kHandler].onHeaders(statusCode, headers, resume, statusText) } catch (err) { this.abort(err) } } onData (chunk) { assert(!this.aborted) assert(!this.completed) try { return this[kHandler].onData(chunk) } catch (err) { this.abort(err) return false } } onUpgrade (statusCode, headers, socket) { assert(!this.aborted) assert(!this.completed) return this[kHandler].onUpgrade(statusCode, headers, socket) } onComplete (trailers) { this.onFinally() assert(!this.aborted) this.completed = true if (channels.trailers.hasSubscribers) { channels.trailers.publish({ request: this, trailers }) } try { return this[kHandler].onComplete(trailers) } catch (err) { // TODO (fix): This might be a bad idea? this.onError(err) } } onError (error) { this.onFinally() if (channels.error.hasSubscribers) { channels.error.publish({ request: this, error }) } if (this.aborted) { return } this.aborted = true return this[kHandler].onError(error) } onFinally () { if (this.errorHandler) { this.body.off('error', this.errorHandler) this.errorHandler = null } if (this.endHandler) { this.body.off('end', this.endHandler) this.endHandler = null } } addHeader (key, value) { processHeader(this, key, value) return this } } function processHeader (request, key, val) { if (val && (typeof val === 'object' && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`) } else if (val === undefined) { return } let headerName = headerNameLowerCasedRecord[key] if (headerName === undefined) { headerName = key.toLowerCase() if (headerNameLowerCasedRecord[headerName] === undefined && !isValidHTTPToken(headerName)) { throw new InvalidArgumentError('invalid header key') } } if (Array.isArray(val)) { const arr = [] for (let i = 0; i < val.length; i++) { if (typeof val[i] === 'string') { if (!isValidHeaderValue(val[i])) { throw new InvalidArgumentError(`invalid ${key} header`) } arr.push(val[i]) } else if (val[i] === null) { arr.push('') } else if (typeof val[i] === 'object') { throw new InvalidArgumentError(`invalid ${key} header`) } else { // Coerce primitives (and reject unsafe coercions such as functions // with a crafted toString/Symbol.toPrimitive). const str = `${val[i]}` if (!isValidHeaderValue(str)) { throw new InvalidArgumentError(`invalid ${key} header`) } arr.push(str) } } val = arr } else if (typeof val === 'string') { if (!isValidHeaderValue(val)) { throw new InvalidArgumentError(`invalid ${key} header`) } } else if (val === null) { val = '' } else { // Coerce primitives (and reject unsafe coercions such as functions // with a crafted toString/Symbol.toPrimitive). val = `${val}` if (!isValidHeaderValue(val)) { throw new InvalidArgumentError(`invalid ${key} header`) } } if (headerName === 'host') { if (request.host !== null) { throw new InvalidArgumentError('duplicate host header') } if (typeof val !== 'string') { throw new InvalidArgumentError('invalid host header') } // Consumed by Client request.host = val } else if (headerName === 'content-length') { if (request.contentLength !== null) { throw new InvalidArgumentError('duplicate content-length header') } request.contentLength = parseInt(val, 10) if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError('invalid content-length header') } } else if (request.contentType === null && headerName === 'content-type') { request.contentType = val request.headers.push(key, val) } else if (headerName === 'transfer-encoding' || headerName === 'keep-alive' || headerName === 'upgrade') { throw new InvalidArgumentError(`invalid ${headerName} header`) } else if (headerName === 'connection') { const value = typeof val === 'string' ? val.toLowerCase() : null if (value !== 'close' && value !== 'keep-alive') { throw new InvalidArgumentError('invalid connection header') } if (value === 'close') { request.reset = true } } else if (headerName === 'expect') { throw new NotSupportedError('expect header not supported') } else { request.headers.push(key, val) } } module.exports = Request /***/ }), /***/ 72785: /***/ ((module) => { module.exports = { kClose: Symbol('close'), kDestroy: Symbol('destroy'), kDispatch: Symbol('dispatch'), kUrl: Symbol('url'), kWriting: Symbol('writing'), kResuming: Symbol('resuming'), kQueue: Symbol('queue'), kConnect: Symbol('connect'), kConnecting: Symbol('connecting'), kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'), kKeepAliveMaxTimeout: Symbol('max keep alive timeout'), kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'), kKeepAliveTimeoutValue: Symbol('keep alive timeout'), kKeepAlive: Symbol('keep alive'), kHeadersTimeout: Symbol('headers timeout'), kBodyTimeout: Symbol('body timeout'), kServerName: Symbol('server name'), kLocalAddress: Symbol('local address'), kHost: Symbol('host'), kNoRef: Symbol('no ref'), kBodyUsed: Symbol('used'), kBody: Symbol('abstracted request body'), kRunning: Symbol('running'), kBlocking: Symbol('blocking'), kPending: Symbol('pending'), kSize: Symbol('size'), kBusy: Symbol('busy'), kQueued: Symbol('queued'), kFree: Symbol('free'), kConnected: Symbol('connected'), kClosed: Symbol('closed'), kNeedDrain: Symbol('need drain'), kReset: Symbol('reset'), kDestroyed: Symbol.for('nodejs.stream.destroyed'), kResume: Symbol('resume'), kOnError: Symbol('on error'), kMaxHeadersSize: Symbol('max headers size'), kRunningIdx: Symbol('running index'), kPendingIdx: Symbol('pending index'), kError: Symbol('error'), kClients: Symbol('clients'), kClient: Symbol('client'), kParser: Symbol('parser'), kOnDestroyed: Symbol('destroy callbacks'), kPipelining: Symbol('pipelining'), kSocket: Symbol('socket'), kHostHeader: Symbol('host header'), kConnector: Symbol('connector'), kStrictContentLength: Symbol('strict content length'), kMaxRedirections: Symbol('maxRedirections'), kMaxRequests: Symbol('maxRequestsPerClient'), kProxy: Symbol('proxy agent options'), kCounter: Symbol('socket request counter'), kInterceptors: Symbol('dispatch interceptors'), kMaxResponseSize: Symbol('max response size'), kHTTP2Session: Symbol('http2Session'), kHTTP2SessionState: Symbol('http2Session state'), kRetryHandlerDefaultRetry: Symbol('retry agent default retry'), kConstruct: Symbol('constructable'), kListeners: Symbol('listeners'), kHTTPContext: Symbol('http context'), kMaxConcurrentStreams: Symbol('max concurrent streams'), kNoProxyAgent: Symbol('no proxy agent'), kHttpProxyAgent: Symbol('http proxy agent'), kHttpsProxyAgent: Symbol('https proxy agent') } /***/ }), /***/ 57506: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { wellknownHeaderNames, headerNameLowerCasedRecord } = __nccwpck_require__(14462) class TstNode { /** @type {any} */ value = null /** @type {null | TstNode} */ left = null /** @type {null | TstNode} */ middle = null /** @type {null | TstNode} */ right = null /** @type {number} */ code /** * @param {string} key * @param {any} value * @param {number} index */ constructor (key, value, index) { if (index === undefined || index >= key.length) { throw new TypeError('Unreachable') } const code = this.code = key.charCodeAt(index) // check code is ascii string if (code > 0x7F) { throw new TypeError('key must be ascii string') } if (key.length !== ++index) { this.middle = new TstNode(key, value, index) } else { this.value = value } } /** * @param {string} key * @param {any} value */ add (key, value) { const length = key.length if (length === 0) { throw new TypeError('Unreachable') } let index = 0 let node = this while (true) { const code = key.charCodeAt(index) // check code is ascii string if (code > 0x7F) { throw new TypeError('key must be ascii string') } if (node.code === code) { if (length === ++index) { node.value = value break } else if (node.middle !== null) { node = node.middle } else { node.middle = new TstNode(key, value, index) break } } else if (node.code < code) { if (node.left !== null) { node = node.left } else { node.left = new TstNode(key, value, index) break } } else if (node.right !== null) { node = node.right } else { node.right = new TstNode(key, value, index) break } } } /** * @param {Uint8Array} key * @return {TstNode | null} */ search (key) { const keylength = key.length let index = 0 let node = this while (node !== null && index < keylength) { let code = key[index] // A-Z // First check if it is bigger than 0x5a. // Lowercase letters have higher char codes than uppercase ones. // Also we assume that headers will mostly contain lowercase characters. if (code <= 0x5a && code >= 0x41) { // Lowercase for uppercase. code |= 32 } while (node !== null) { if (code === node.code) { if (keylength === ++index) { // Returns Node since it is the last key. return node } node = node.middle break } node = node.code < code ? node.left : node.right } } return null } } class TernarySearchTree { /** @type {TstNode | null} */ node = null /** * @param {string} key * @param {any} value * */ insert (key, value) { if (this.node === null) { this.node = new TstNode(key, value, 0) } else { this.node.add(key, value) } } /** * @param {Uint8Array} key * @return {any} */ lookup (key) { return this.node?.search(key)?.value ?? null } } const tree = new TernarySearchTree() for (let i = 0; i < wellknownHeaderNames.length; ++i) { const key = headerNameLowerCasedRecord[wellknownHeaderNames[i]] tree.insert(key, key) } module.exports = { TernarySearchTree, tree } /***/ }), /***/ 83983: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(98061) const { kDestroyed, kBodyUsed, kListeners, kBody } = __nccwpck_require__(72785) const { IncomingMessage } = __nccwpck_require__(88849) const stream = __nccwpck_require__(84492) const net = __nccwpck_require__(87503) const { Blob } = __nccwpck_require__(72254) const nodeUtil = __nccwpck_require__(47261) const { stringify } = __nccwpck_require__(39630) const { EventEmitter: EE } = __nccwpck_require__(15673) const { InvalidArgumentError } = __nccwpck_require__(48045) const { headerNameLowerCasedRecord } = __nccwpck_require__(14462) const { tree } = __nccwpck_require__(57506) const [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v)) class BodyAsyncIterable { constructor (body) { this[kBody] = body this[kBodyUsed] = false } async * [Symbol.asyncIterator] () { assert(!this[kBodyUsed], 'disturbed') this[kBodyUsed] = true yield * this[kBody] } } function wrapRequestBody (body) { if (isStream(body)) { // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp // so that it can be dispatched again? // TODO (fix): Do we need 100-expect support to provide a way to do this properly? if (bodyLength(body) === 0) { body .on('data', function () { assert(false) }) } if (typeof body.readableDidRead !== 'boolean') { body[kBodyUsed] = false EE.prototype.on.call(body, 'data', function () { this[kBodyUsed] = true }) } return body } else if (body && typeof body.pipeTo === 'function') { // TODO (fix): We can't access ReadableStream internal state // to determine whether or not it has been disturbed. This is just // a workaround. return new BodyAsyncIterable(body) } else if ( body && typeof body !== 'string' && !ArrayBuffer.isView(body) && isIterable(body) ) { // TODO: Should we allow re-using iterable if !this.opts.idempotent // or through some other flag? return new BodyAsyncIterable(body) } else { return body } } function nop () {} function isStream (obj) { return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function' } // based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License) function isBlobLike (object) { if (object === null) { return false } else if (object instanceof Blob) { return true } else if (typeof object !== 'object') { return false } else { const sTag = object[Symbol.toStringTag] return (sTag === 'Blob' || sTag === 'File') && ( ('stream' in object && typeof object.stream === 'function') || ('arrayBuffer' in object && typeof object.arrayBuffer === 'function') ) } } function buildURL (url, queryParams) { if (url.includes('?') || url.includes('#')) { throw new Error('Query params cannot be passed when url already contains "?" or "#".') } const stringified = stringify(queryParams) if (stringified) { url += '?' + stringified } return url } function isValidPort (port) { const value = parseInt(port, 10) return ( value === Number(port) && value >= 0 && value <= 65535 ) } function isHttpOrHttpsPrefixed (value) { return ( value != null && value[0] === 'h' && value[1] === 't' && value[2] === 't' && value[3] === 'p' && ( value[4] === ':' || ( value[4] === 's' && value[5] === ':' ) ) ) } function parseURL (url) { if (typeof url === 'string') { url = new URL(url) if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') } return url } if (!url || typeof url !== 'object') { throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.') } if (!(url instanceof URL)) { if (url.port != null && url.port !== '' && isValidPort(url.port) === false) { throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.') } if (url.path != null && typeof url.path !== 'string') { throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.') } if (url.pathname != null && typeof url.pathname !== 'string') { throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.') } if (url.hostname != null && typeof url.hostname !== 'string') { throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.') } if (url.origin != null && typeof url.origin !== 'string') { throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.') } if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') } const port = url.port != null ? url.port : (url.protocol === 'https:' ? 443 : 80) let origin = url.origin != null ? url.origin : `${url.protocol || ''}//${url.hostname || ''}:${port}` let path = url.path != null ? url.path : `${url.pathname || ''}${url.search || ''}` if (origin[origin.length - 1] === '/') { origin = origin.slice(0, origin.length - 1) } if (path && path[0] !== '/') { path = `/${path}` } // new URL(path, origin) is unsafe when `path` contains an absolute URL // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL: // If first parameter is a relative URL, second param is required, and will be used as the base URL. // If first parameter is an absolute URL, a given second param will be ignored. return new URL(`${origin}${path}`) } if (!isHttpOrHttpsPrefixed(url.origin || url.protocol)) { throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.') } return url } function parseOrigin (url) { url = parseURL(url) if (url.pathname !== '/' || url.search || url.hash) { throw new InvalidArgumentError('invalid url') } return url } function getHostname (host) { if (host[0] === '[') { const idx = host.indexOf(']') assert(idx !== -1) return host.substring(1, idx) } const idx = host.indexOf(':') if (idx === -1) return host return host.substring(0, idx) } // IP addresses are not valid server names per RFC6066 // > Currently, the only server names supported are DNS hostnames function getServerName (host) { if (!host) { return null } assert(typeof host === 'string') const servername = getHostname(host) if (net.isIP(servername)) { return '' } return servername } function deepClone (obj) { return JSON.parse(JSON.stringify(obj)) } function isAsyncIterable (obj) { return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function') } function isIterable (obj) { return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function')) } function bodyLength (body) { if (body == null) { return 0 } else if (isStream(body)) { const state = body._readableState return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length) ? state.length : null } else if (isBlobLike(body)) { return body.size != null ? body.size : null } else if (isBuffer(body)) { return body.byteLength } return null } function isDestroyed (body) { return body && !!(body.destroyed || body[kDestroyed] || (stream.isDestroyed?.(body))) } function destroy (stream, err) { if (stream == null || !isStream(stream) || isDestroyed(stream)) { return } if (typeof stream.destroy === 'function') { if (Object.getPrototypeOf(stream).constructor === IncomingMessage) { // See: https://github.com/nodejs/node/pull/38505/files stream.socket = null } stream.destroy(err) } else if (err) { queueMicrotask(() => { stream.emit('error', err) }) } if (stream.destroyed !== true) { stream[kDestroyed] = true } } const KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/ function parseKeepAliveTimeout (val) { const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR) return m ? parseInt(m[1], 10) * 1000 : null } /** * Retrieves a header name and returns its lowercase value. * @param {string | Buffer} value Header name * @returns {string} */ function headerNameToString (value) { return typeof value === 'string' ? headerNameLowerCasedRecord[value] ?? value.toLowerCase() : tree.lookup(value) ?? value.toString('latin1').toLowerCase() } /** * Receive the buffer as a string and return its lowercase value. * @param {Buffer} value Header name * @returns {string} */ function bufferToLowerCasedHeaderName (value) { return tree.lookup(value) ?? value.toString('latin1').toLowerCase() } /** * @param {Record | (Buffer | string | (Buffer | string)[])[]} headers * @param {Record} [obj] * @returns {Record} */ function parseHeaders (headers, obj) { if (obj === undefined) obj = {} for (let i = 0; i < headers.length; i += 2) { const key = headerNameToString(headers[i]) let val = obj[key] if (val) { if (typeof val === 'string') { val = [val] obj[key] = val } val.push(headers[i + 1].toString('utf8')) } else { const headersValue = headers[i + 1] if (typeof headersValue === 'string') { obj[key] = headersValue } else { obj[key] = Array.isArray(headersValue) ? headersValue.map(x => x.toString('utf8')) : headersValue.toString('utf8') } } } // See https://github.com/nodejs/node/pull/46528 if ('content-length' in obj && 'content-disposition' in obj) { obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1') } return obj } function parseRawHeaders (headers) { const len = headers.length const ret = new Array(len) let hasContentLength = false let contentDispositionIdx = -1 let key let val let kLen = 0 for (let n = 0; n < headers.length; n += 2) { key = headers[n] val = headers[n + 1] typeof key !== 'string' && (key = key.toString()) typeof val !== 'string' && (val = val.toString('utf8')) kLen = key.length if (kLen === 14 && key[7] === '-' && (key === 'content-length' || key.toLowerCase() === 'content-length')) { hasContentLength = true } else if (kLen === 19 && key[7] === '-' && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) { contentDispositionIdx = n + 1 } ret[n] = key ret[n + 1] = val } // See https://github.com/nodejs/node/pull/46528 if (hasContentLength && contentDispositionIdx !== -1) { ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1') } return ret } function isBuffer (buffer) { // See, https://github.com/mcollina/undici/pull/319 return buffer instanceof Uint8Array || Buffer.isBuffer(buffer) } function validateHandler (handler, method, upgrade) { if (!handler || typeof handler !== 'object') { throw new InvalidArgumentError('handler must be an object') } if (typeof handler.onConnect !== 'function') { throw new InvalidArgumentError('invalid onConnect method') } if (typeof handler.onError !== 'function') { throw new InvalidArgumentError('invalid onError method') } if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) { throw new InvalidArgumentError('invalid onBodySent method') } if (upgrade || method === 'CONNECT') { if (typeof handler.onUpgrade !== 'function') { throw new InvalidArgumentError('invalid onUpgrade method') } } else { if (typeof handler.onHeaders !== 'function') { throw new InvalidArgumentError('invalid onHeaders method') } if (typeof handler.onData !== 'function') { throw new InvalidArgumentError('invalid onData method') } if (typeof handler.onComplete !== 'function') { throw new InvalidArgumentError('invalid onComplete method') } } } // A body is disturbed if it has been read from and it cannot // be re-used without losing state or data. function isDisturbed (body) { // TODO (fix): Why is body[kBodyUsed] needed? return !!(body && (stream.isDisturbed(body) || body[kBodyUsed])) } function isErrored (body) { return !!(body && stream.isErrored(body)) } function isReadable (body) { return !!(body && stream.isReadable(body)) } function getSocketInfo (socket) { return { localAddress: socket.localAddress, localPort: socket.localPort, remoteAddress: socket.remoteAddress, remotePort: socket.remotePort, remoteFamily: socket.remoteFamily, timeout: socket.timeout, bytesWritten: socket.bytesWritten, bytesRead: socket.bytesRead } } /** @type {globalThis['ReadableStream']} */ function ReadableStreamFrom (iterable) { // We cannot use ReadableStream.from here because it does not return a byte stream. let iterator return new ReadableStream( { async start () { iterator = iterable[Symbol.asyncIterator]() }, async pull (controller) { const { done, value } = await iterator.next() if (done) { queueMicrotask(() => { controller.close() controller.byobRequest?.respond(0) }) } else { const buf = Buffer.isBuffer(value) ? value : Buffer.from(value) if (buf.byteLength) { controller.enqueue(new Uint8Array(buf)) } } return controller.desiredSize > 0 }, async cancel (reason) { await iterator.return() }, type: 'bytes' } ) } // The chunk should be a FormData instance and contains // all the required methods. function isFormDataLike (object) { return ( object && typeof object === 'object' && typeof object.append === 'function' && typeof object.delete === 'function' && typeof object.get === 'function' && typeof object.getAll === 'function' && typeof object.has === 'function' && typeof object.set === 'function' && object[Symbol.toStringTag] === 'FormData' ) } function addAbortListener (signal, listener) { if ('addEventListener' in signal) { signal.addEventListener('abort', listener, { once: true }) return () => signal.removeEventListener('abort', listener) } signal.addListener('abort', listener) return () => signal.removeListener('abort', listener) } const hasToWellFormed = typeof String.prototype.toWellFormed === 'function' const hasIsWellFormed = typeof String.prototype.isWellFormed === 'function' /** * @param {string} val */ function toUSVString (val) { return hasToWellFormed ? `${val}`.toWellFormed() : nodeUtil.toUSVString(val) } /** * @param {string} val */ // TODO: move this to webidl function isUSVString (val) { return hasIsWellFormed ? `${val}`.isWellFormed() : toUSVString(val) === `${val}` } /** * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 * @param {number} c */ function isTokenCharCode (c) { switch (c) { case 0x22: case 0x28: case 0x29: case 0x2c: case 0x2f: case 0x3a: case 0x3b: case 0x3c: case 0x3d: case 0x3e: case 0x3f: case 0x40: case 0x5b: case 0x5c: case 0x5d: case 0x7b: case 0x7d: // DQUOTE and "(),/:;<=>?@[\]{}" return false default: // VCHAR %x21-7E return c >= 0x21 && c <= 0x7e } } /** * @param {string} characters */ function isValidHTTPToken (characters) { if (characters.length === 0) { return false } for (let i = 0; i < characters.length; ++i) { if (!isTokenCharCode(characters.charCodeAt(i))) { return false } } return true } // headerCharRegex have been lifted from // https://github.com/nodejs/node/blob/main/lib/_http_common.js /** * Matches if val contains an invalid field-vchar * field-value = *( field-content / obs-fold ) * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] * field-vchar = VCHAR / obs-text */ const headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/ /** * @param {string} characters */ function isValidHeaderValue (characters) { return !headerCharRegex.test(characters) } // Parsed accordingly to RFC 9110 // https://www.rfc-editor.org/rfc/rfc9110#field.content-range function parseRangeHeader (range) { if (range == null || range === '') return { start: 0, end: null, size: null } const m = range ? range.match(/^bytes (\d+)-(\d+)\/(\d+)?$/) : null return m ? { start: parseInt(m[1]), end: m[2] ? parseInt(m[2]) : null, size: m[3] ? parseInt(m[3]) : null } : null } function addListener (obj, name, listener) { const listeners = (obj[kListeners] ??= []) listeners.push([name, listener]) obj.on(name, listener) return obj } function removeAllListeners (obj) { for (const [name, listener] of obj[kListeners] ?? []) { obj.removeListener(name, listener) } obj[kListeners] = null } function errorRequest (client, request, err) { try { request.onError(err) assert(request.aborted) } catch (err) { client.emit('error', err) } } const kEnumerableProperty = Object.create(null) kEnumerableProperty.enumerable = true const normalizedMethodRecordsBase = { delete: 'DELETE', DELETE: 'DELETE', get: 'GET', GET: 'GET', head: 'HEAD', HEAD: 'HEAD', options: 'OPTIONS', OPTIONS: 'OPTIONS', post: 'POST', POST: 'POST', put: 'PUT', PUT: 'PUT' } const normalizedMethodRecords = { ...normalizedMethodRecordsBase, patch: 'patch', PATCH: 'PATCH' } // Note: object prototypes should not be able to be referenced. e.g. `Object#hasOwnProperty`. Object.setPrototypeOf(normalizedMethodRecordsBase, null) Object.setPrototypeOf(normalizedMethodRecords, null) module.exports = { kEnumerableProperty, nop, isDisturbed, isErrored, isReadable, toUSVString, isUSVString, isBlobLike, parseOrigin, parseURL, getServerName, isStream, isIterable, isAsyncIterable, isDestroyed, headerNameToString, bufferToLowerCasedHeaderName, addListener, removeAllListeners, errorRequest, parseRawHeaders, parseHeaders, parseKeepAliveTimeout, destroy, bodyLength, deepClone, ReadableStreamFrom, isBuffer, validateHandler, getSocketInfo, isFormDataLike, buildURL, addAbortListener, isValidHTTPToken, isValidHeaderValue, isTokenCharCode, parseRangeHeader, normalizedMethodRecordsBase, normalizedMethodRecords, isValidPort, isHttpOrHttpsPrefixed, nodeMajor, nodeMinor, safeHTTPMethods: ['GET', 'HEAD', 'OPTIONS', 'TRACE'], wrapRequestBody } /***/ }), /***/ 71208: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { InvalidArgumentError } = __nccwpck_require__(48045) const { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(72785) const DispatcherBase = __nccwpck_require__(61544) const Pool = __nccwpck_require__(20177) const Client = __nccwpck_require__(8176) const util = __nccwpck_require__(83983) const createRedirectInterceptor = __nccwpck_require__(99099) const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') const kOnConnectionError = Symbol('onConnectionError') const kMaxRedirections = Symbol('maxRedirections') const kOnDrain = Symbol('onDrain') const kFactory = Symbol('factory') const kOptions = Symbol('options') function defaultFactory (origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts) } class Agent extends DispatcherBase { constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) { if (typeof factory !== 'function') { throw new InvalidArgumentError('factory must be a function.') } if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { throw new InvalidArgumentError('connect must be a function or an object') } if (!Number.isInteger(maxRedirections) || maxRedirections < 0) { throw new InvalidArgumentError('maxRedirections must be a positive number') } super(options) if (connect && typeof connect !== 'function') { connect = { ...connect } } this[kInterceptors] = options.interceptors?.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })] this[kOptions] = { ...util.deepClone(options), connect } this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : undefined this[kMaxRedirections] = maxRedirections this[kFactory] = factory this[kClients] = new Map() this[kOnDrain] = (origin, targets) => { this.emit('drain', origin, [this, ...targets]) } this[kOnConnect] = (origin, targets) => { this.emit('connect', origin, [this, ...targets]) } this[kOnDisconnect] = (origin, targets, err) => { this.emit('disconnect', origin, [this, ...targets], err) } this[kOnConnectionError] = (origin, targets, err) => { this.emit('connectionError', origin, [this, ...targets], err) } } get [kRunning] () { let ret = 0 for (const client of this[kClients].values()) { ret += client[kRunning] } return ret } [kDispatch] (opts, handler) { let key if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) { key = String(opts.origin) } else { throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.') } let dispatcher = this[kClients].get(key) if (!dispatcher) { dispatcher = this[kFactory](opts.origin, this[kOptions]) .on('drain', this[kOnDrain]) .on('connect', this[kOnConnect]) .on('disconnect', this[kOnDisconnect]) .on('connectionError', this[kOnConnectionError]) // This introduces a tiny memory leak, as dispatchers are never removed from the map. // TODO(mcollina): remove te timer when the client/pool do not have any more // active connections. this[kClients].set(key, dispatcher) } return dispatcher.dispatch(opts, handler) } async [kClose] () { const closePromises = [] for (const client of this[kClients].values()) { closePromises.push(client.close()) } this[kClients].clear() await Promise.all(closePromises) } async [kDestroy] (err) { const destroyPromises = [] for (const client of this[kClients].values()) { destroyPromises.push(client.destroy(err)) } this[kClients].clear() await Promise.all(destroyPromises) } } module.exports = Agent /***/ }), /***/ 46232: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { BalancedPoolMissingUpstreamError, InvalidArgumentError } = __nccwpck_require__(48045) const { PoolBase, kClients, kNeedDrain, kAddClient, kRemoveClient, kGetDispatcher } = __nccwpck_require__(90494) const Pool = __nccwpck_require__(20177) const { kUrl, kInterceptors } = __nccwpck_require__(72785) const { parseOrigin } = __nccwpck_require__(83983) const kFactory = Symbol('factory') const kOptions = Symbol('options') const kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor') const kCurrentWeight = Symbol('kCurrentWeight') const kIndex = Symbol('kIndex') const kWeight = Symbol('kWeight') const kMaxWeightPerServer = Symbol('kMaxWeightPerServer') const kErrorPenalty = Symbol('kErrorPenalty') /** * Calculate the greatest common divisor of two numbers by * using the Euclidean algorithm. * * @param {number} a * @param {number} b * @returns {number} */ function getGreatestCommonDivisor (a, b) { if (a === 0) return b while (b !== 0) { const t = b b = a % b a = t } return a } function defaultFactory (origin, opts) { return new Pool(origin, opts) } class BalancedPool extends PoolBase { constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) { super() this[kOptions] = opts this[kIndex] = -1 this[kCurrentWeight] = 0 this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100 this[kErrorPenalty] = this[kOptions].errorPenalty || 15 if (!Array.isArray(upstreams)) { upstreams = [upstreams] } if (typeof factory !== 'function') { throw new InvalidArgumentError('factory must be a function.') } this[kInterceptors] = opts.interceptors?.BalancedPool && Array.isArray(opts.interceptors.BalancedPool) ? opts.interceptors.BalancedPool : [] this[kFactory] = factory for (const upstream of upstreams) { this.addUpstream(upstream) } this._updateBalancedPoolStats() } addUpstream (upstream) { const upstreamOrigin = parseOrigin(upstream).origin if (this[kClients].find((pool) => ( pool[kUrl].origin === upstreamOrigin && pool.closed !== true && pool.destroyed !== true ))) { return this } const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions])) this[kAddClient](pool) pool.on('connect', () => { pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty]) }) pool.on('connectionError', () => { pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) this._updateBalancedPoolStats() }) pool.on('disconnect', (...args) => { const err = args[2] if (err && err.code === 'UND_ERR_SOCKET') { // decrease the weight of the pool. pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty]) this._updateBalancedPoolStats() } }) for (const client of this[kClients]) { client[kWeight] = this[kMaxWeightPerServer] } this._updateBalancedPoolStats() return this } _updateBalancedPoolStats () { let result = 0 for (let i = 0; i < this[kClients].length; i++) { result = getGreatestCommonDivisor(this[kClients][i][kWeight], result) } this[kGreatestCommonDivisor] = result } removeUpstream (upstream) { const upstreamOrigin = parseOrigin(upstream).origin const pool = this[kClients].find((pool) => ( pool[kUrl].origin === upstreamOrigin && pool.closed !== true && pool.destroyed !== true )) if (pool) { this[kRemoveClient](pool) } return this } get upstreams () { return this[kClients] .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true) .map((p) => p[kUrl].origin) } [kGetDispatcher] () { // We validate that pools is greater than 0, // otherwise we would have to wait until an upstream // is added, which might never happen. if (this[kClients].length === 0) { throw new BalancedPoolMissingUpstreamError() } const dispatcher = this[kClients].find(dispatcher => ( !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true )) if (!dispatcher) { return } const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true) if (allClientsBusy) { return } let counter = 0 let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain]) while (counter++ < this[kClients].length) { this[kIndex] = (this[kIndex] + 1) % this[kClients].length const pool = this[kClients][this[kIndex]] // find pool index with the largest weight if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) { maxWeightIndex = this[kIndex] } // decrease the current weight every `this[kClients].length`. if (this[kIndex] === 0) { // Set the current weight to the next lower weight. this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor] if (this[kCurrentWeight] <= 0) { this[kCurrentWeight] = this[kMaxWeightPerServer] } } if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) { return pool } } this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight] this[kIndex] = maxWeightIndex return this[kClients][maxWeightIndex] } } module.exports = BalancedPool /***/ }), /***/ 43264: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; /* global WebAssembly */ const assert = __nccwpck_require__(98061) const util = __nccwpck_require__(83983) const { channels } = __nccwpck_require__(58438) const timers = __nccwpck_require__(85194) const { RequestContentLengthMismatchError, ResponseContentLengthMismatchError, RequestAbortedError, InvalidArgumentError, HeadersTimeoutError, HeadersOverflowError, SocketError, InformationalError, BodyTimeoutError, HTTPParserError, ResponseExceededMaxSizeError } = __nccwpck_require__(48045) const { kUrl, kReset, kClient, kParser, kBlocking, kRunning, kPending, kSize, kWriting, kQueue, kNoRef, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError, kPipelining, kSocket, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kMaxRequests, kCounter, kMaxResponseSize, kOnError, kResume, kHTTPContext } = __nccwpck_require__(72785) const constants = __nccwpck_require__(30953) const EMPTY_BUF = Buffer.alloc(0) const FastBuffer = Buffer[Symbol.species] const addListener = util.addListener const removeAllListeners = util.removeAllListeners const kIdleSocketValidation = Symbol('kIdleSocketValidation') const kIdleSocketValidationTimeout = Symbol('kIdleSocketValidationTimeout') const kSocketUsed = Symbol('kSocketUsed') let extractBody async function lazyllhttp () { const llhttpWasmData = process.env.JEST_WORKER_ID ? __nccwpck_require__(61145) : undefined let mod try { mod = await WebAssembly.compile(__nccwpck_require__(95627)) } catch (e) { /* istanbul ignore next */ // We could check if the error was caused by the simd option not // being enabled, but the occurring of this other error // * https://github.com/emscripten-core/emscripten/issues/11495 // got me to remove that check to avoid breaking Node 12. mod = await WebAssembly.compile(llhttpWasmData || __nccwpck_require__(61145)) } return await WebAssembly.instantiate(mod, { env: { /* eslint-disable camelcase */ wasm_on_url: (p, at, len) => { /* istanbul ignore next */ return 0 }, wasm_on_status: (p, at, len) => { assert(currentParser.ptr === p) const start = at - currentBufferPtr + currentBufferRef.byteOffset return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 }, wasm_on_message_begin: (p) => { assert(currentParser.ptr === p) return currentParser.onMessageBegin() || 0 }, wasm_on_header_field: (p, at, len) => { assert(currentParser.ptr === p) const start = at - currentBufferPtr + currentBufferRef.byteOffset return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 }, wasm_on_header_value: (p, at, len) => { assert(currentParser.ptr === p) const start = at - currentBufferPtr + currentBufferRef.byteOffset return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 }, wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { assert(currentParser.ptr === p) return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0 }, wasm_on_body: (p, at, len) => { assert(currentParser.ptr === p) const start = at - currentBufferPtr + currentBufferRef.byteOffset return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0 }, wasm_on_message_complete: (p) => { assert(currentParser.ptr === p) return currentParser.onMessageComplete() || 0 } /* eslint-enable camelcase */ } }) } let llhttpInstance = null let llhttpPromise = lazyllhttp() llhttpPromise.catch() let currentParser = null let currentBufferRef = null let currentBufferSize = 0 let currentBufferPtr = null const USE_NATIVE_TIMER = 0 const USE_FAST_TIMER = 1 // Use fast timers for headers and body to take eventual event loop // latency into account. const TIMEOUT_HEADERS = 2 | USE_FAST_TIMER const TIMEOUT_BODY = 4 | USE_FAST_TIMER // Use native timers to ignore event loop latency for keep-alive // handling. const TIMEOUT_KEEP_ALIVE = 8 | USE_NATIVE_TIMER class Parser { constructor (client, socket, { exports }) { assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0) this.llhttp = exports this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE) this.client = client this.socket = socket this.timeout = null this.timeoutValue = null this.timeoutType = null this.statusCode = null this.statusText = '' this.upgrade = false this.headers = [] this.headersSize = 0 this.headersMaxSize = client[kMaxHeadersSize] this.shouldKeepAlive = false this.paused = false this.resume = this.resume.bind(this) this.bytesRead = 0 this.keepAlive = '' this.contentLength = '' this.connection = '' this.maxResponseSize = client[kMaxResponseSize] } setTimeout (delay, type) { // If the existing timer and the new timer are of different timer type // (fast or native) or have different delay, we need to clear the existing // timer and set a new one. if ( delay !== this.timeoutValue || (type & USE_FAST_TIMER) ^ (this.timeoutType & USE_FAST_TIMER) ) { // If a timeout is already set, clear it with clearTimeout of the fast // timer implementation, as it can clear fast and native timers. if (this.timeout) { timers.clearTimeout(this.timeout) this.timeout = null } if (delay) { if (type & USE_FAST_TIMER) { this.timeout = timers.setFastTimeout(onParserTimeout, delay, new WeakRef(this)) } else { this.timeout = setTimeout(onParserTimeout, delay, new WeakRef(this)) this.timeout.unref() } } this.timeoutValue = delay } else if (this.timeout) { // istanbul ignore else: only for jest if (this.timeout.refresh) { this.timeout.refresh() } } this.timeoutType = type } resume () { if (this.socket.destroyed || !this.paused) { return } assert(this.ptr != null) assert(currentParser == null) this.llhttp.llhttp_resume(this.ptr) assert(this.timeoutType === TIMEOUT_BODY) if (this.timeout) { // istanbul ignore else: only for jest if (this.timeout.refresh) { this.timeout.refresh() } } this.paused = false this.execute(this.socket.read() || EMPTY_BUF) // Flush parser. this.readMore() } readMore () { while (!this.paused && this.ptr) { const chunk = this.socket.read() if (chunk === null) { break } this.execute(chunk) } } execute (data) { assert(this.ptr != null) assert(currentParser == null) assert(!this.paused) const { socket, llhttp } = this if (data.length > currentBufferSize) { if (currentBufferPtr) { llhttp.free(currentBufferPtr) } currentBufferSize = Math.ceil(data.length / 4096) * 4096 currentBufferPtr = llhttp.malloc(currentBufferSize) } new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data) // Call `execute` on the wasm parser. // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data, // and finally the length of bytes to parse. // The return value is an error code or `constants.ERROR.OK`. try { let ret try { currentBufferRef = data currentParser = this ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length) /* eslint-disable-next-line no-useless-catch */ } catch (err) { /* istanbul ignore next: difficult to make a test case for */ throw err } finally { currentParser = null currentBufferRef = null } const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr if (ret !== constants.ERROR.OK) { const body = data.subarray(offset) if (ret === constants.ERROR.PAUSED_UPGRADE) { this.onUpgrade(body) } else if (ret === constants.ERROR.PAUSED) { this.paused = true socket.unshift(body) } else { throw this.createError(ret, body) } } } catch (err) { util.destroy(socket, err) } } finish () { assert(currentParser === null) assert(this.ptr != null) assert(!this.paused) const { llhttp } = this let ret try { currentParser = this ret = llhttp.llhttp_finish(this.ptr) } finally { currentParser = null } if (ret === constants.ERROR.OK) { return null } if (ret === constants.ERROR.PAUSED || ret === constants.ERROR.PAUSED_UPGRADE) { this.paused = true return null } return this.createError(ret, EMPTY_BUF) } createError (ret, data) { const { llhttp, contentLength, bytesRead } = this if (contentLength && bytesRead !== parseInt(contentLength, 10)) { return new ResponseContentLengthMismatchError() } const ptr = llhttp.llhttp_get_error_reason(this.ptr) let message = '' if (ptr) { const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0) message = 'Response does not match the HTTP/1.1 protocol (' + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ')' } return new HTTPParserError(message, constants.ERROR[ret], data) } destroy () { assert(this.ptr != null) assert(currentParser == null) this.llhttp.llhttp_free(this.ptr) this.ptr = null this.timeout && timers.clearTimeout(this.timeout) this.timeout = null this.timeoutValue = null this.timeoutType = null this.paused = false } onStatus (buf) { this.statusText = buf.toString() } onMessageBegin () { const { socket, client } = this /* istanbul ignore next: difficult to make a test case for */ if (socket.destroyed) { return -1 } if (client[kRunning] === 0) { util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) return -1 } const request = client[kQueue][client[kRunningIdx]] if (!request) { return -1 } request.onResponseStarted() } onHeaderField (buf) { const len = this.headers.length if ((len & 1) === 0) { this.headers.push(buf) } else { this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) } this.trackHeader(buf.length) } onHeaderValue (buf) { let len = this.headers.length if ((len & 1) === 1) { this.headers.push(buf) len += 1 } else { this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]) } const key = this.headers[len - 2] if (key.length === 10) { const headerName = util.bufferToLowerCasedHeaderName(key) if (headerName === 'keep-alive') { this.keepAlive += buf.toString() } else if (headerName === 'connection') { this.connection += buf.toString() } } else if (key.length === 14 && util.bufferToLowerCasedHeaderName(key) === 'content-length') { this.contentLength += buf.toString() } this.trackHeader(buf.length) } trackHeader (len) { this.headersSize += len if (this.headersSize >= this.headersMaxSize) { util.destroy(this.socket, new HeadersOverflowError()) } } onUpgrade (head) { const { upgrade, client, socket, headers, statusCode } = this assert(upgrade) assert(client[kSocket] === socket) assert(!socket.destroyed) assert(!this.paused) assert((headers.length & 1) === 0) const request = client[kQueue][client[kRunningIdx]] assert(request) assert(request.upgrade || request.method === 'CONNECT') this.statusCode = null this.statusText = '' this.shouldKeepAlive = null this.headers = [] this.headersSize = 0 socket.unshift(head) socket[kParser].destroy() socket[kParser] = null socket[kClient] = null socket[kError] = null removeAllListeners(socket) client[kSocket] = null client[kHTTPContext] = null // TODO (fix): This is hacky... client[kQueue][client[kRunningIdx]++] = null client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade')) try { request.onUpgrade(statusCode, headers, socket) } catch (err) { util.destroy(socket, err) } client[kResume]() } onHeadersComplete (statusCode, upgrade, shouldKeepAlive) { const { client, socket, headers, statusText } = this /* istanbul ignore next: difficult to make a test case for */ if (socket.destroyed) { return -1 } if (client[kRunning] === 0) { util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) return -1 } const request = client[kQueue][client[kRunningIdx]] /* istanbul ignore next: difficult to make a test case for */ if (!request) { return -1 } assert(!this.upgrade) assert(this.statusCode < 200) if (statusCode === 100) { util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket))) return -1 } /* this can only happen if server is misbehaving */ if (upgrade && !request.upgrade) { util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket))) return -1 } assert(this.timeoutType === TIMEOUT_HEADERS) this.statusCode = statusCode this.shouldKeepAlive = ( shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive') ) if (this.statusCode >= 200) { const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout] this.setTimeout(bodyTimeout, TIMEOUT_BODY) } else if (this.timeout) { // istanbul ignore else: only for jest if (this.timeout.refresh) { this.timeout.refresh() } } if (request.method === 'CONNECT') { assert(client[kRunning] === 1) this.upgrade = true return 2 } if (upgrade) { assert(client[kRunning] === 1) this.upgrade = true return 2 } assert((this.headers.length & 1) === 0) this.headers = [] this.headersSize = 0 if (this.shouldKeepAlive && client[kPipelining]) { const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null if (keepAliveTimeout != null) { const timeout = Math.min( keepAliveTimeout - client[kKeepAliveTimeoutThreshold], client[kKeepAliveMaxTimeout] ) if (timeout <= 0) { socket[kReset] = true } else { client[kKeepAliveTimeoutValue] = timeout } } else { client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout] } } else { // Stop more requests from being dispatched. socket[kReset] = true } const pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false if (request.aborted) { return -1 } if (request.method === 'HEAD') { return 1 } if (statusCode < 200) { return 1 } if (socket[kBlocking]) { socket[kBlocking] = false client[kResume]() } return pause ? constants.ERROR.PAUSED : 0 } onBody (buf) { const { client, socket, statusCode, maxResponseSize } = this if (socket.destroyed) { return -1 } const request = client[kQueue][client[kRunningIdx]] assert(request) assert(this.timeoutType === TIMEOUT_BODY) if (this.timeout) { // istanbul ignore else: only for jest if (this.timeout.refresh) { this.timeout.refresh() } } assert(statusCode >= 200) if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { util.destroy(socket, new ResponseExceededMaxSizeError()) return -1 } this.bytesRead += buf.length if (request.onData(buf) === false) { return constants.ERROR.PAUSED } } onMessageComplete () { const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this if (socket.destroyed && (!statusCode || shouldKeepAlive)) { return -1 } if (upgrade) { return } assert(statusCode >= 100) assert((this.headers.length & 1) === 0) const request = client[kQueue][client[kRunningIdx]] assert(request) this.statusCode = null this.statusText = '' this.bytesRead = 0 this.contentLength = '' this.keepAlive = '' this.connection = '' this.headers = [] this.headersSize = 0 if (statusCode < 200) { return } /* istanbul ignore next: should be handled by llhttp? */ if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) { util.destroy(socket, new ResponseContentLengthMismatchError()) return -1 } request.onComplete(headers) client[kQueue][client[kRunningIdx]++] = null socket[kSocketUsed] = true if (socket[kWriting]) { assert(client[kRunning] === 0) // Response completed before request. util.destroy(socket, new InformationalError('reset')) return constants.ERROR.PAUSED } else if (!shouldKeepAlive) { util.destroy(socket, new InformationalError('reset')) return constants.ERROR.PAUSED } else if (socket[kReset] && client[kRunning] === 0) { // Destroy socket once all requests have completed. // The request at the tail of the pipeline is the one // that requested reset and no further requests should // have been queued since then. util.destroy(socket, new InformationalError('reset')) return constants.ERROR.PAUSED } else if (client[kPipelining] == null || client[kPipelining] === 1) { // We must wait a full event loop cycle to reuse this socket to make sure // that non-spec compliant servers are not closing the connection even if they // said they won't. setImmediate(() => client[kResume]()) } else { client[kResume]() } } } function onParserTimeout (parser) { const { socket, timeoutType, client, paused } = parser.deref() /* istanbul ignore else */ if (timeoutType === TIMEOUT_HEADERS) { if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { assert(!paused, 'cannot be paused while waiting for headers') util.destroy(socket, new HeadersTimeoutError()) } } else if (timeoutType === TIMEOUT_BODY) { if (!paused) { util.destroy(socket, new BodyTimeoutError()) } } else if (timeoutType === TIMEOUT_KEEP_ALIVE) { assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]) util.destroy(socket, new InformationalError('socket idle timeout')) } } async function connectH1 (client, socket) { client[kSocket] = socket if (!llhttpInstance) { llhttpInstance = await llhttpPromise llhttpPromise = null } socket[kNoRef] = false socket[kWriting] = false socket[kReset] = false socket[kBlocking] = false socket[kIdleSocketValidation] = 0 socket[kIdleSocketValidationTimeout] = null socket[kSocketUsed] = false socket[kParser] = new Parser(client, socket, llhttpInstance) addListener(socket, 'error', function (err) { assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') const parser = this[kParser] // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded // to the user. if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) { const parserErr = parser.finish() if (parserErr) { this[kError] = parserErr this[kClient][kOnError](parserErr) } return } this[kError] = err this[kClient][kOnError](err) }) addListener(socket, 'readable', function () { const parser = this[kParser] if (parser) { parser.readMore() } }) addListener(socket, 'end', function () { const parser = this[kParser] if (parser.statusCode && !parser.shouldKeepAlive) { const parserErr = parser.finish() if (parserErr) { util.destroy(this, parserErr) } return } util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this))) }) addListener(socket, 'close', function () { const client = this[kClient] const parser = this[kParser] clearIdleSocketValidation(this) if (parser) { if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) { this[kError] = parser.finish() || this[kError] } this[kParser].destroy() this[kParser] = null } const err = this[kError] || new SocketError('closed', util.getSocketInfo(this)) client[kSocket] = null client[kHTTPContext] = null // TODO (fix): This is hacky... if (client.destroyed) { assert(client[kPending] === 0) // Fail entire queue. const requests = client[kQueue].splice(client[kRunningIdx]) for (let i = 0; i < requests.length; i++) { const request = requests[i] util.errorRequest(client, request, err) } } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') { // Fail head of pipeline. const request = client[kQueue][client[kRunningIdx]] client[kQueue][client[kRunningIdx]++] = null util.errorRequest(client, request, err) } client[kPendingIdx] = client[kRunningIdx] assert(client[kRunning] === 0) client.emit('disconnect', client[kUrl], [client], err) client[kResume]() }) let closed = false socket.on('close', () => { closed = true }) return { version: 'h1', defaultPipelining: 1, write (...args) { return writeH1(client, ...args) }, resume () { resumeH1(client) }, destroy (err, callback) { if (closed) { queueMicrotask(callback) } else { socket.destroy(err).on('close', callback) } }, get destroyed () { return socket.destroyed }, busy (request) { if (socket[kWriting] || socket[kReset] || socket[kBlocking] || socket[kIdleSocketValidation] === 1) { return true } if (request) { if (client[kRunning] > 0 && !request.idempotent) { // Non-idempotent request cannot be retried. // Ensure that no other requests are inflight and // could cause failure. return true } if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) { // Don't dispatch an upgrade until all preceding requests have completed. // A misbehaving server might upgrade the connection before all pipelined // request has completed. return true } if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && (util.isStream(request.body) || util.isAsyncIterable(request.body) || util.isFormDataLike(request.body))) { // Request with stream or iterator body can error while other requests // are inflight and indirectly error those as well. // Ensure this doesn't happen by waiting for inflight // to complete before dispatching. // Request with stream or iterator body cannot be retried. // Ensure that no other requests are inflight and // could cause failure. return true } } return false } } } function clearIdleSocketValidation (socket) { if (socket[kIdleSocketValidationTimeout]) { clearTimeout(socket[kIdleSocketValidationTimeout]) socket[kIdleSocketValidationTimeout] = null } socket[kIdleSocketValidation] = 0 } function scheduleIdleSocketValidation (client, socket) { socket[kIdleSocketValidation] = 1 socket[kIdleSocketValidationTimeout] = setTimeout(() => { socket[kIdleSocketValidationTimeout] = null socket[kIdleSocketValidation] = 2 if (client[kSocket] === socket && !socket.destroyed) { client[kResume]() } }, 0) socket[kIdleSocketValidationTimeout].unref?.() } /** * @param {import('./client.js')} client */ function resumeH1 (client) { const socket = client[kSocket] if (socket && !socket.destroyed) { if (client[kSize] === 0) { if (!socket[kNoRef] && socket.unref) { socket.unref() socket[kNoRef] = true } } else if (socket[kNoRef] && socket.ref) { socket.ref() socket[kNoRef] = false } if (client[kRunning] === 0 && client[kPending] > 0 && socket[kSocketUsed]) { if (socket[kIdleSocketValidation] === 0) { scheduleIdleSocketValidation(client, socket) socket[kParser].readMore() if (socket.destroyed) { return } return } if (socket[kIdleSocketValidation] === 1) { socket[kParser].readMore() if (socket.destroyed) { return } return } } if (client[kRunning] === 0) { socket[kParser].readMore() if (socket.destroyed) { return } } if (client[kSize] === 0) { if (socket[kParser].timeoutType !== TIMEOUT_KEEP_ALIVE) { socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_KEEP_ALIVE) } } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) { if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) { const request = client[kQueue][client[kRunningIdx]] const headersTimeout = request.headersTimeout != null ? request.headersTimeout : client[kHeadersTimeout] socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS) } } } } // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2 function shouldSendContentLength (method) { return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT' } function writeH1 (client, request) { const { method, path, host, upgrade, blocking, reset } = request let { body, headers, contentLength } = request // https://tools.ietf.org/html/rfc7231#section-4.3.1 // https://tools.ietf.org/html/rfc7231#section-4.3.2 // https://tools.ietf.org/html/rfc7231#section-4.3.5 // Sending a payload body on a request that does not // expect it can cause undefined behavior on some // servers and corrupt connection state. Do not // re-use the connection for further requests. const expectsPayload = ( method === 'PUT' || method === 'POST' || method === 'PATCH' || method === 'QUERY' || method === 'PROPFIND' || method === 'PROPPATCH' ) if (util.isFormDataLike(body)) { if (!extractBody) { extractBody = (__nccwpck_require__(36682).extractBody) } const [bodyStream, contentType] = extractBody(body) if (request.contentType == null) { headers.push('content-type', contentType) } body = bodyStream.stream contentLength = bodyStream.length } else if (util.isBlobLike(body) && request.contentType == null) { const contentType = body.type if (contentType) { const contentTypeValue = `${contentType}` if (!util.isValidHeaderValue(contentTypeValue)) { util.errorRequest(client, request, new InvalidArgumentError('invalid content-type header')) return false } headers.push('content-type', contentTypeValue) } } if (body && typeof body.read === 'function') { // Try to read EOF in order to get length. body.read(0) } const bodyLength = util.bodyLength(body) contentLength = bodyLength ?? contentLength if (contentLength === null) { contentLength = request.contentLength } if (contentLength === 0 && !expectsPayload) { // https://tools.ietf.org/html/rfc7230#section-3.3.2 // A user agent SHOULD NOT send a Content-Length header field when // the request message does not contain a payload body and the method // semantics do not anticipate such a body. contentLength = null } // https://github.com/nodejs/undici/issues/2046 // A user agent may send a Content-Length header with 0 value, this should be allowed. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) { if (client[kStrictContentLength]) { util.errorRequest(client, request, new RequestContentLengthMismatchError()) return false } process.emitWarning(new RequestContentLengthMismatchError()) } const socket = client[kSocket] clearIdleSocketValidation(socket) const abort = (err) => { if (request.aborted || request.completed) { return } util.errorRequest(client, request, err || new RequestAbortedError()) util.destroy(body) util.destroy(socket, new InformationalError('aborted')) } try { request.onConnect(abort) } catch (err) { util.errorRequest(client, request, err) } if (request.aborted) { return false } if (method === 'HEAD') { // https://github.com/mcollina/undici/issues/258 // Close after a HEAD request to interop with misbehaving servers // that may send a body in the response. socket[kReset] = true } if (upgrade || method === 'CONNECT') { // On CONNECT or upgrade, block pipeline from dispatching further // requests on this connection. socket[kReset] = true } if (reset != null) { socket[kReset] = reset } if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) { socket[kReset] = true } if (blocking) { socket[kBlocking] = true } let header = `${method} ${path} HTTP/1.1\r\n` if (typeof host === 'string') { header += `host: ${host}\r\n` } else { header += client[kHostHeader] } if (upgrade) { header += `connection: upgrade\r\nupgrade: ${upgrade}\r\n` } else if (client[kPipelining] && !socket[kReset]) { header += 'connection: keep-alive\r\n' } else { header += 'connection: close\r\n' } if (Array.isArray(headers)) { for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0] const val = headers[n + 1] if (Array.isArray(val)) { for (let i = 0; i < val.length; i++) { header += `${key}: ${val[i]}\r\n` } } else { header += `${key}: ${val}\r\n` } } } if (channels.sendHeaders.hasSubscribers) { channels.sendHeaders.publish({ request, headers: header, socket }) } /* istanbul ignore else: assertion */ if (!body || bodyLength === 0) { writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload) } else if (util.isBuffer(body)) { writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload) } else if (util.isBlobLike(body)) { if (typeof body.stream === 'function') { writeIterable(abort, body.stream(), client, request, socket, contentLength, header, expectsPayload) } else { writeBlob(abort, body, client, request, socket, contentLength, header, expectsPayload) } } else if (util.isStream(body)) { writeStream(abort, body, client, request, socket, contentLength, header, expectsPayload) } else if (util.isIterable(body)) { writeIterable(abort, body, client, request, socket, contentLength, header, expectsPayload) } else { assert(false) } return true } function writeStream (abort, body, client, request, socket, contentLength, header, expectsPayload) { assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined') let finished = false const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header }) const onData = function (chunk) { if (finished) { return } try { if (!writer.write(chunk) && this.pause) { this.pause() } } catch (err) { util.destroy(this, err) } } const onDrain = function () { if (finished) { return } if (body.resume) { body.resume() } } const onClose = function () { // 'close' might be emitted *before* 'error' for // broken streams. Wait a tick to avoid this case. queueMicrotask(() => { // It's only safe to remove 'error' listener after // 'close'. body.removeListener('error', onFinished) }) if (!finished) { const err = new RequestAbortedError() queueMicrotask(() => onFinished(err)) } } const onFinished = function (err) { if (finished) { return } finished = true assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1)) socket .off('drain', onDrain) .off('error', onFinished) body .removeListener('data', onData) .removeListener('end', onFinished) .removeListener('close', onClose) if (!err) { try { writer.end() } catch (er) { err = er } } writer.destroy(err) if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) { util.destroy(body, err) } else { util.destroy(body) } } body .on('data', onData) .on('end', onFinished) .on('error', onFinished) .on('close', onClose) if (body.resume) { body.resume() } socket .on('drain', onDrain) .on('error', onFinished) if (body.errorEmitted ?? body.errored) { setImmediate(() => onFinished(body.errored)) } else if (body.endEmitted ?? body.readableEnded) { setImmediate(() => onFinished(null)) } if (body.closeEmitted ?? body.closed) { setImmediate(onClose) } } function writeBuffer (abort, body, client, request, socket, contentLength, header, expectsPayload) { try { if (!body) { if (contentLength === 0) { socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') } else { assert(contentLength === null, 'no body must not have content length') socket.write(`${header}\r\n`, 'latin1') } } else if (util.isBuffer(body)) { assert(contentLength === body.byteLength, 'buffer body must have content length') socket.cork() socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') socket.write(body) socket.uncork() request.onBodySent(body) if (!expectsPayload && request.reset !== false) { socket[kReset] = true } } request.onRequestSent() client[kResume]() } catch (err) { abort(err) } } async function writeBlob (abort, body, client, request, socket, contentLength, header, expectsPayload) { assert(contentLength === body.size, 'blob body must have content length') try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError() } const buffer = Buffer.from(await body.arrayBuffer()) socket.cork() socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') socket.write(buffer) socket.uncork() request.onBodySent(buffer) request.onRequestSent() if (!expectsPayload && request.reset !== false) { socket[kReset] = true } client[kResume]() } catch (err) { abort(err) } } async function writeIterable (abort, body, client, request, socket, contentLength, header, expectsPayload) { assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined') let callback = null function onDrain () { if (callback) { const cb = callback callback = null cb() } } const waitForDrain = () => new Promise((resolve, reject) => { assert(callback === null) if (socket[kError]) { reject(socket[kError]) } else { callback = resolve } }) socket .on('close', onDrain) .on('drain', onDrain) const writer = new AsyncWriter({ abort, socket, request, contentLength, client, expectsPayload, header }) try { // It's up to the user to somehow abort the async iterable. for await (const chunk of body) { if (socket[kError]) { throw socket[kError] } if (!writer.write(chunk)) { await waitForDrain() } } writer.end() } catch (err) { writer.destroy(err) } finally { socket .off('close', onDrain) .off('drain', onDrain) } } class AsyncWriter { constructor ({ abort, socket, request, contentLength, client, expectsPayload, header }) { this.socket = socket this.request = request this.contentLength = contentLength this.client = client this.bytesWritten = 0 this.expectsPayload = expectsPayload this.header = header this.abort = abort socket[kWriting] = true } write (chunk) { const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this if (socket[kError]) { throw socket[kError] } if (socket.destroyed) { return false } const len = Buffer.byteLength(chunk) if (!len) { return true } // We should defer writing chunks. if (contentLength !== null && bytesWritten + len > contentLength) { if (client[kStrictContentLength]) { throw new RequestContentLengthMismatchError() } process.emitWarning(new RequestContentLengthMismatchError()) } socket.cork() if (bytesWritten === 0) { if (!expectsPayload && request.reset !== false) { socket[kReset] = true } if (contentLength === null) { socket.write(`${header}transfer-encoding: chunked\r\n`, 'latin1') } else { socket.write(`${header}content-length: ${contentLength}\r\n\r\n`, 'latin1') } } if (contentLength === null) { socket.write(`\r\n${len.toString(16)}\r\n`, 'latin1') } this.bytesWritten += len const ret = socket.write(chunk) socket.uncork() request.onBodySent(chunk) if (!ret) { if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { // istanbul ignore else: only for jest if (socket[kParser].timeout.refresh) { socket[kParser].timeout.refresh() } } } return ret } end () { const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this request.onRequestSent() socket[kWriting] = false if (socket[kError]) { throw socket[kError] } if (socket.destroyed) { return } if (bytesWritten === 0) { if (expectsPayload) { // https://tools.ietf.org/html/rfc7230#section-3.3.2 // A user agent SHOULD send a Content-Length in a request message when // no Transfer-Encoding is sent and the request method defines a meaning // for an enclosed payload body. socket.write(`${header}content-length: 0\r\n\r\n`, 'latin1') } else { socket.write(`${header}\r\n`, 'latin1') } } else if (contentLength === null) { socket.write('\r\n0\r\n\r\n', 'latin1') } if (contentLength !== null && bytesWritten !== contentLength) { if (client[kStrictContentLength]) { throw new RequestContentLengthMismatchError() } else { process.emitWarning(new RequestContentLengthMismatchError()) } } if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) { // istanbul ignore else: only for jest if (socket[kParser].timeout.refresh) { socket[kParser].timeout.refresh() } } client[kResume]() } destroy (err) { const { socket, client, abort } = this socket[kWriting] = false if (err) { assert(client[kRunning] <= 1, 'pipeline should only contain this request') abort(err) } } } module.exports = connectH1 /***/ }), /***/ 90296: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(98061) const { pipeline } = __nccwpck_require__(84492) const util = __nccwpck_require__(83983) const { RequestContentLengthMismatchError, RequestAbortedError, SocketError, InformationalError } = __nccwpck_require__(48045) const { kUrl, kReset, kClient, kRunning, kPending, kQueue, kPendingIdx, kRunningIdx, kError, kSocket, kStrictContentLength, kOnError, kMaxConcurrentStreams, kHTTP2Session, kResume, kSize, kHTTPContext } = __nccwpck_require__(72785) const kOpenStreams = Symbol('open streams') let extractBody // Experimental let h2ExperimentalWarned = false /** @type {import('http2')} */ let http2 try { http2 = __nccwpck_require__(42725) } catch { // @ts-ignore http2 = { constants: {} } } const { constants: { HTTP2_HEADER_AUTHORITY, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_SCHEME, HTTP2_HEADER_CONTENT_LENGTH, HTTP2_HEADER_EXPECT, HTTP2_HEADER_STATUS } } = http2 function parseH2Headers (headers) { const result = [] for (const [name, value] of Object.entries(headers)) { // h2 may concat the header value by array // e.g. Set-Cookie if (Array.isArray(value)) { for (const subvalue of value) { // we need to provide each header value of header name // because the headers handler expect name-value pair result.push(Buffer.from(name), Buffer.from(subvalue)) } } else { result.push(Buffer.from(name), Buffer.from(value)) } } return result } async function connectH2 (client, socket) { client[kSocket] = socket if (!h2ExperimentalWarned) { h2ExperimentalWarned = true process.emitWarning('H2 support is experimental, expect them to change at any time.', { code: 'UNDICI-H2' }) } const session = http2.connect(client[kUrl], { createConnection: () => socket, peerMaxConcurrentStreams: client[kMaxConcurrentStreams] }) session[kOpenStreams] = 0 session[kClient] = client session[kSocket] = socket util.addListener(session, 'error', onHttp2SessionError) util.addListener(session, 'frameError', onHttp2FrameError) util.addListener(session, 'end', onHttp2SessionEnd) util.addListener(session, 'goaway', onHTTP2GoAway) util.addListener(session, 'close', function () { const { [kClient]: client } = this const { [kSocket]: socket } = client const err = this[kSocket][kError] || this[kError] || new SocketError('closed', util.getSocketInfo(socket)) client[kHTTP2Session] = null if (client.destroyed) { assert(client[kPending] === 0) // Fail entire queue. const requests = client[kQueue].splice(client[kRunningIdx]) for (let i = 0; i < requests.length; i++) { const request = requests[i] util.errorRequest(client, request, err) } } }) session.unref() client[kHTTP2Session] = session socket[kHTTP2Session] = session util.addListener(socket, 'error', function (err) { assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') this[kError] = err this[kClient][kOnError](err) }) util.addListener(socket, 'end', function () { util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this))) }) util.addListener(socket, 'close', function () { const err = this[kError] || new SocketError('closed', util.getSocketInfo(this)) client[kSocket] = null if (this[kHTTP2Session] != null) { this[kHTTP2Session].destroy(err) } client[kPendingIdx] = client[kRunningIdx] assert(client[kRunning] === 0) client.emit('disconnect', client[kUrl], [client], err) client[kResume]() }) let closed = false socket.on('close', () => { closed = true }) return { version: 'h2', defaultPipelining: Infinity, write (...args) { return writeH2(client, ...args) }, resume () { resumeH2(client) }, destroy (err, callback) { if (closed) { queueMicrotask(callback) } else { // Destroying the socket will trigger the session close socket.destroy(err).on('close', callback) } }, get destroyed () { return socket.destroyed }, busy () { return false } } } function resumeH2 (client) { const socket = client[kSocket] if (socket?.destroyed === false) { if (client[kSize] === 0 && client[kMaxConcurrentStreams] === 0) { socket.unref() client[kHTTP2Session].unref() } else { socket.ref() client[kHTTP2Session].ref() } } } function onHttp2SessionError (err) { assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID') this[kSocket][kError] = err this[kClient][kOnError](err) } function onHttp2FrameError (type, code, id) { if (id === 0) { const err = new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`) this[kSocket][kError] = err this[kClient][kOnError](err) } } function onHttp2SessionEnd () { const err = new SocketError('other side closed', util.getSocketInfo(this[kSocket])) this.destroy(err) util.destroy(this[kSocket], err) } /** * This is the root cause of #3011 * We need to handle GOAWAY frames properly, and trigger the session close * along with the socket right away */ function onHTTP2GoAway (code) { // We cannot recover, so best to close the session and the socket const err = this[kError] || new SocketError(`HTTP/2: "GOAWAY" frame received with code ${code}`, util.getSocketInfo(this)) const client = this[kClient] client[kSocket] = null client[kHTTPContext] = null if (this[kHTTP2Session] != null) { this[kHTTP2Session].destroy(err) this[kHTTP2Session] = null } util.destroy(this[kSocket], err) // Fail head of pipeline. if (client[kRunningIdx] < client[kQueue].length) { const request = client[kQueue][client[kRunningIdx]] client[kQueue][client[kRunningIdx]++] = null util.errorRequest(client, request, err) client[kPendingIdx] = client[kRunningIdx] } assert(client[kRunning] === 0) client.emit('disconnect', client[kUrl], [client], err) client[kResume]() } // https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2 function shouldSendContentLength (method) { return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT' } function writeH2 (client, request) { const session = client[kHTTP2Session] const { method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request let { body } = request if (upgrade) { util.errorRequest(client, request, new Error('Upgrade not supported for H2')) return false } const headers = {} for (let n = 0; n < reqHeaders.length; n += 2) { const key = reqHeaders[n + 0] const val = reqHeaders[n + 1] if (Array.isArray(val)) { for (let i = 0; i < val.length; i++) { if (headers[key]) { headers[key] += `,${val[i]}` } else { headers[key] = val[i] } } } else { headers[key] = val } } /** @type {import('node:http2').ClientHttp2Stream} */ let stream const { hostname, port } = client[kUrl] headers[HTTP2_HEADER_AUTHORITY] = host || `${hostname}${port ? `:${port}` : ''}` headers[HTTP2_HEADER_METHOD] = method const abort = (err) => { if (request.aborted || request.completed) { return } err = err || new RequestAbortedError() util.errorRequest(client, request, err) if (stream != null) { util.destroy(stream, err) } // We do not destroy the socket as we can continue using the session // the stream get's destroyed and the session remains to create new streams util.destroy(body, err) client[kQueue][client[kRunningIdx]++] = null client[kResume]() } try { // We are already connected, streams are pending. // We can call on connect, and wait for abort request.onConnect(abort) } catch (err) { util.errorRequest(client, request, err) } if (request.aborted) { return false } if (method === 'CONNECT') { session.ref() // We are already connected, streams are pending, first request // will create a new stream. We trigger a request to create the stream and wait until // `ready` event is triggered // We disabled endStream to allow the user to write to the stream stream = session.request(headers, { endStream: false, signal }) if (stream.id && !stream.pending) { request.onUpgrade(null, null, stream) ++session[kOpenStreams] client[kQueue][client[kRunningIdx]++] = null } else { stream.once('ready', () => { request.onUpgrade(null, null, stream) ++session[kOpenStreams] client[kQueue][client[kRunningIdx]++] = null }) } stream.once('close', () => { session[kOpenStreams] -= 1 if (session[kOpenStreams] === 0) session.unref() }) return true } // https://tools.ietf.org/html/rfc7540#section-8.3 // :path and :scheme headers must be omitted when sending CONNECT headers[HTTP2_HEADER_PATH] = path headers[HTTP2_HEADER_SCHEME] = 'https' // https://tools.ietf.org/html/rfc7231#section-4.3.1 // https://tools.ietf.org/html/rfc7231#section-4.3.2 // https://tools.ietf.org/html/rfc7231#section-4.3.5 // Sending a payload body on a request that does not // expect it can cause undefined behavior on some // servers and corrupt connection state. Do not // re-use the connection for further requests. const expectsPayload = ( method === 'PUT' || method === 'POST' || method === 'PATCH' ) if (body && typeof body.read === 'function') { // Try to read EOF in order to get length. body.read(0) } let contentLength = util.bodyLength(body) if (util.isFormDataLike(body)) { extractBody ??= (__nccwpck_require__(36682).extractBody) const [bodyStream, contentType] = extractBody(body) headers['content-type'] = contentType body = bodyStream.stream contentLength = bodyStream.length } if (contentLength == null) { contentLength = request.contentLength } if (contentLength === 0 || !expectsPayload) { // https://tools.ietf.org/html/rfc7230#section-3.3.2 // A user agent SHOULD NOT send a Content-Length header field when // the request message does not contain a payload body and the method // semantics do not anticipate such a body. contentLength = null } // https://github.com/nodejs/undici/issues/2046 // A user agent may send a Content-Length header with 0 value, this should be allowed. if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) { if (client[kStrictContentLength]) { util.errorRequest(client, request, new RequestContentLengthMismatchError()) return false } process.emitWarning(new RequestContentLengthMismatchError()) } if (contentLength != null) { assert(body, 'no body must not have content length') headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}` } session.ref() const shouldEndStream = method === 'GET' || method === 'HEAD' || body === null if (expectContinue) { headers[HTTP2_HEADER_EXPECT] = '100-continue' stream = session.request(headers, { endStream: shouldEndStream, signal }) stream.once('continue', writeBodyH2) } else { stream = session.request(headers, { endStream: shouldEndStream, signal }) writeBodyH2() } // Increment counter as we have new streams open ++session[kOpenStreams] stream.once('response', headers => { const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers request.onResponseStarted() // Due to the stream nature, it is possible we face a race condition // where the stream has been assigned, but the request has been aborted // the request remains in-flight and headers hasn't been received yet // for those scenarios, best effort is to destroy the stream immediately // as there's no value to keep it open. if (request.aborted) { const err = new RequestAbortedError() util.errorRequest(client, request, err) util.destroy(stream, err) return } if (request.onHeaders(Number(statusCode), parseH2Headers(realHeaders), stream.resume.bind(stream), '') === false) { stream.pause() } stream.on('data', (chunk) => { if (request.onData(chunk) === false) { stream.pause() } }) }) stream.once('end', () => { // When state is null, it means we haven't consumed body and the stream still do not have // a state. // Present specially when using pipeline or stream if (stream.state?.state == null || stream.state.state < 6) { request.onComplete([]) } if (session[kOpenStreams] === 0) { // Stream is closed or half-closed-remote (6), decrement counter and cleanup // It does not have sense to continue working with the stream as we do not // have yet RST_STREAM support on client-side session.unref() } abort(new InformationalError('HTTP/2: stream half-closed (remote)')) client[kQueue][client[kRunningIdx]++] = null client[kPendingIdx] = client[kRunningIdx] client[kResume]() }) stream.once('close', () => { session[kOpenStreams] -= 1 if (session[kOpenStreams] === 0) { session.unref() } }) stream.once('error', function (err) { abort(err) }) stream.once('frameError', (type, code) => { abort(new InformationalError(`HTTP/2: "frameError" received - type ${type}, code ${code}`)) }) // stream.on('aborted', () => { // // TODO(HTTP/2): Support aborted // }) // stream.on('timeout', () => { // // TODO(HTTP/2): Support timeout // }) // stream.on('push', headers => { // // TODO(HTTP/2): Support push // }) // stream.on('trailers', headers => { // // TODO(HTTP/2): Support trailers // }) return true function writeBodyH2 () { /* istanbul ignore else: assertion */ if (!body || contentLength === 0) { writeBuffer( abort, stream, null, client, request, client[kSocket], contentLength, expectsPayload ) } else if (util.isBuffer(body)) { writeBuffer( abort, stream, body, client, request, client[kSocket], contentLength, expectsPayload ) } else if (util.isBlobLike(body)) { if (typeof body.stream === 'function') { writeIterable( abort, stream, body.stream(), client, request, client[kSocket], contentLength, expectsPayload ) } else { writeBlob( abort, stream, body, client, request, client[kSocket], contentLength, expectsPayload ) } } else if (util.isStream(body)) { writeStream( abort, client[kSocket], expectsPayload, stream, body, client, request, contentLength ) } else if (util.isIterable(body)) { writeIterable( abort, stream, body, client, request, client[kSocket], contentLength, expectsPayload ) } else { assert(false) } } } function writeBuffer (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { try { if (body != null && util.isBuffer(body)) { assert(contentLength === body.byteLength, 'buffer body must have content length') h2stream.cork() h2stream.write(body) h2stream.uncork() h2stream.end() request.onBodySent(body) } if (!expectsPayload) { socket[kReset] = true } request.onRequestSent() client[kResume]() } catch (error) { abort(error) } } function writeStream (abort, socket, expectsPayload, h2stream, body, client, request, contentLength) { assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined') // For HTTP/2, is enough to pipe the stream const pipe = pipeline( body, h2stream, (err) => { if (err) { util.destroy(pipe, err) abort(err) } else { util.removeAllListeners(pipe) request.onRequestSent() if (!expectsPayload) { socket[kReset] = true } client[kResume]() } } ) util.addListener(pipe, 'data', onPipeData) function onPipeData (chunk) { request.onBodySent(chunk) } } async function writeBlob (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { assert(contentLength === body.size, 'blob body must have content length') try { if (contentLength != null && contentLength !== body.size) { throw new RequestContentLengthMismatchError() } const buffer = Buffer.from(await body.arrayBuffer()) h2stream.cork() h2stream.write(buffer) h2stream.uncork() h2stream.end() request.onBodySent(buffer) request.onRequestSent() if (!expectsPayload) { socket[kReset] = true } client[kResume]() } catch (err) { abort(err) } } async function writeIterable (abort, h2stream, body, client, request, socket, contentLength, expectsPayload) { assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined') let callback = null function onDrain () { if (callback) { const cb = callback callback = null cb() } } const waitForDrain = () => new Promise((resolve, reject) => { assert(callback === null) if (socket[kError]) { reject(socket[kError]) } else { callback = resolve } }) h2stream .on('close', onDrain) .on('drain', onDrain) try { // It's up to the user to somehow abort the async iterable. for await (const chunk of body) { if (socket[kError]) { throw socket[kError] } const res = h2stream.write(chunk) request.onBodySent(chunk) if (!res) { await waitForDrain() } } h2stream.end() request.onRequestSent() if (!expectsPayload) { socket[kReset] = true } client[kResume]() } catch (err) { abort(err) } finally { h2stream .off('close', onDrain) .off('drain', onDrain) } } module.exports = connectH2 /***/ }), /***/ 8176: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; // @ts-check const assert = __nccwpck_require__(98061) const net = __nccwpck_require__(87503) const http = __nccwpck_require__(88849) const util = __nccwpck_require__(83983) const { channels } = __nccwpck_require__(58438) const Request = __nccwpck_require__(62905) const DispatcherBase = __nccwpck_require__(61544) const { InvalidArgumentError, InformationalError, ClientDestroyedError } = __nccwpck_require__(48045) const buildConnector = __nccwpck_require__(82067) const { kUrl, kServerName, kClient, kBusy, kConnect, kResuming, kRunning, kPending, kSize, kQueue, kConnected, kConnecting, kNeedDrain, kKeepAliveDefaultTimeout, kHostHeader, kPendingIdx, kRunningIdx, kError, kPipelining, kKeepAliveTimeoutValue, kMaxHeadersSize, kKeepAliveMaxTimeout, kKeepAliveTimeoutThreshold, kHeadersTimeout, kBodyTimeout, kStrictContentLength, kConnector, kMaxRedirections, kMaxRequests, kCounter, kClose, kDestroy, kDispatch, kInterceptors, kLocalAddress, kMaxResponseSize, kOnError, kHTTPContext, kMaxConcurrentStreams, kResume } = __nccwpck_require__(72785) const connectH1 = __nccwpck_require__(43264) const connectH2 = __nccwpck_require__(90296) let deprecatedInterceptorWarned = false const kClosedResolve = Symbol('kClosedResolve') const noop = () => {} function getPipelining (client) { return client[kPipelining] ?? client[kHTTPContext]?.defaultPipelining ?? 1 } /** * @type {import('../../types/client.js').default} */ class Client extends DispatcherBase { /** * * @param {string|URL} url * @param {import('../../types/client.js').Client.Options} options */ constructor (url, { interceptors, maxHeaderSize, headersTimeout, socketTimeout, requestTimeout, connectTimeout, bodyTimeout, idleTimeout, keepAlive, keepAliveTimeout, maxKeepAliveTimeout, keepAliveMaxTimeout, keepAliveTimeoutThreshold, socketPath, pipelining, tls, strictContentLength, maxCachedSessions, maxRedirections, connect, maxRequestsPerClient, localAddress, maxResponseSize, autoSelectFamily, autoSelectFamilyAttemptTimeout, // h2 maxConcurrentStreams, allowH2, webSocket } = {}) { super({ webSocket }) if (keepAlive !== undefined) { throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead') } if (socketTimeout !== undefined) { throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead') } if (requestTimeout !== undefined) { throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead') } if (idleTimeout !== undefined) { throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead') } if (maxKeepAliveTimeout !== undefined) { throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead') } if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) { throw new InvalidArgumentError('invalid maxHeaderSize') } if (socketPath != null && typeof socketPath !== 'string') { throw new InvalidArgumentError('invalid socketPath') } if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) { throw new InvalidArgumentError('invalid connectTimeout') } if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) { throw new InvalidArgumentError('invalid keepAliveTimeout') } if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) { throw new InvalidArgumentError('invalid keepAliveMaxTimeout') } if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) { throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold') } if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) { throw new InvalidArgumentError('headersTimeout must be a positive integer or zero') } if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) { throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero') } if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { throw new InvalidArgumentError('connect must be a function or an object') } if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { throw new InvalidArgumentError('maxRedirections must be a positive number') } if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) { throw new InvalidArgumentError('maxRequestsPerClient must be a positive number') } if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) { throw new InvalidArgumentError('localAddress must be valid string IP address') } if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) { throw new InvalidArgumentError('maxResponseSize must be a positive number') } if ( autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1) ) { throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number') } // h2 if (allowH2 != null && typeof allowH2 !== 'boolean') { throw new InvalidArgumentError('allowH2 must be a valid boolean value') } if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) { throw new InvalidArgumentError('maxConcurrentStreams must be a positive integer, greater than 0') } if (typeof connect !== 'function') { connect = buildConnector({ ...tls, maxCachedSessions, allowH2, socketPath, timeout: connectTimeout, ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), ...connect }) } if (interceptors?.Client && Array.isArray(interceptors.Client)) { this[kInterceptors] = interceptors.Client if (!deprecatedInterceptorWarned) { deprecatedInterceptorWarned = true process.emitWarning('Client.Options#interceptor is deprecated. Use Dispatcher#compose instead.', { code: 'UNDICI-CLIENT-INTERCEPTOR-DEPRECATED' }) } } else { this[kInterceptors] = [createRedirectInterceptor({ maxRedirections })] } this[kUrl] = util.parseOrigin(url) this[kConnector] = connect this[kPipelining] = pipelining != null ? pipelining : 1 this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 2e3 : keepAliveTimeoutThreshold this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout] this[kServerName] = null this[kLocalAddress] = localAddress != null ? localAddress : null this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\r\n` this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3 this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3 this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength this[kMaxRedirections] = maxRedirections this[kMaxRequests] = maxRequestsPerClient this[kClosedResolve] = null this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1 this[kMaxConcurrentStreams] = maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server this[kHTTPContext] = null // kQueue is built up of 3 sections separated by // the kRunningIdx and kPendingIdx indices. // | complete | running | pending | // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length // kRunningIdx points to the first running element. // kPendingIdx points to the first pending element. // This implements a fast queue with an amortized // time of O(1). this[kQueue] = [] this[kRunningIdx] = 0 this[kPendingIdx] = 0 this[kResume] = (sync) => resume(this, sync) this[kOnError] = (err) => onError(this, err) } get pipelining () { return this[kPipelining] } set pipelining (value) { this[kPipelining] = value this[kResume](true) } get [kPending] () { return this[kQueue].length - this[kPendingIdx] } get [kRunning] () { return this[kPendingIdx] - this[kRunningIdx] } get [kSize] () { return this[kQueue].length - this[kRunningIdx] } get [kConnected] () { return !!this[kHTTPContext] && !this[kConnecting] && !this[kHTTPContext].destroyed } get [kBusy] () { return Boolean( this[kHTTPContext]?.busy(null) || (this[kSize] >= (getPipelining(this) || 1)) || this[kPending] > 0 ) } /* istanbul ignore: only used for test */ [kConnect] (cb) { connect(this) this.once('connect', cb) } [kDispatch] (opts, handler) { const origin = opts.origin || this[kUrl].origin const request = new Request(origin, opts, handler) this[kQueue].push(request) if (this[kResuming]) { // Do nothing. } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { // Wait a tick in case stream/iterator is ended in the same tick. this[kResuming] = 1 queueMicrotask(() => resume(this)) } else { this[kResume](true) } if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) { this[kNeedDrain] = 2 } return this[kNeedDrain] < 2 } async [kClose] () { // TODO: for H2 we need to gracefully flush the remaining enqueued // request and close each stream. return new Promise((resolve) => { if (this[kSize]) { this[kClosedResolve] = resolve } else { resolve(null) } }) } async [kDestroy] (err) { return new Promise((resolve) => { const requests = this[kQueue].splice(this[kPendingIdx]) for (let i = 0; i < requests.length; i++) { const request = requests[i] util.errorRequest(this, request, err) } const callback = () => { if (this[kClosedResolve]) { // TODO (fix): Should we error here with ClientDestroyedError? this[kClosedResolve]() this[kClosedResolve] = null } resolve(null) } if (this[kHTTPContext]) { this[kHTTPContext].destroy(err, callback) this[kHTTPContext] = null } else { queueMicrotask(callback) } this[kResume]() }) } } const createRedirectInterceptor = __nccwpck_require__(99099) function onError (client, err) { if ( client[kRunning] === 0 && err.code !== 'UND_ERR_INFO' && err.code !== 'UND_ERR_SOCKET' ) { // Error is not caused by running request and not a recoverable // socket error. assert(client[kPendingIdx] === client[kRunningIdx]) const requests = client[kQueue].splice(client[kRunningIdx]) for (let i = 0; i < requests.length; i++) { const request = requests[i] util.errorRequest(client, request, err) } assert(client[kSize] === 0) } } /** * @param {Client} client * @returns */ async function connect (client) { assert(!client[kConnecting]) assert(!client[kHTTPContext]) let { host, hostname, protocol, port } = client[kUrl] // Resolve ipv6 if (hostname[0] === '[') { const idx = hostname.indexOf(']') assert(idx !== -1) const ip = hostname.substring(1, idx) assert(net.isIP(ip)) hostname = ip } client[kConnecting] = true if (channels.beforeConnect.hasSubscribers) { channels.beforeConnect.publish({ connectParams: { host, hostname, protocol, port, version: client[kHTTPContext]?.version, servername: client[kServerName], localAddress: client[kLocalAddress] }, connector: client[kConnector] }) } try { const socket = await new Promise((resolve, reject) => { client[kConnector]({ host, hostname, protocol, port, servername: client[kServerName], localAddress: client[kLocalAddress] }, (err, socket) => { if (err) { reject(err) } else { resolve(socket) } }) }) if (client.destroyed) { util.destroy(socket.on('error', noop), new ClientDestroyedError()) return } assert(socket) try { client[kHTTPContext] = socket.alpnProtocol === 'h2' ? await connectH2(client, socket) : await connectH1(client, socket) } catch (err) { socket.destroy().on('error', noop) throw err } client[kConnecting] = false socket[kCounter] = 0 socket[kMaxRequests] = client[kMaxRequests] socket[kClient] = client socket[kError] = null if (channels.connected.hasSubscribers) { channels.connected.publish({ connectParams: { host, hostname, protocol, port, version: client[kHTTPContext]?.version, servername: client[kServerName], localAddress: client[kLocalAddress] }, connector: client[kConnector], socket }) } client.emit('connect', client[kUrl], [client]) } catch (err) { if (client.destroyed) { return } client[kConnecting] = false if (channels.connectError.hasSubscribers) { channels.connectError.publish({ connectParams: { host, hostname, protocol, port, version: client[kHTTPContext]?.version, servername: client[kServerName], localAddress: client[kLocalAddress] }, connector: client[kConnector], error: err }) } if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { assert(client[kRunning] === 0) while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { const request = client[kQueue][client[kPendingIdx]++] util.errorRequest(client, request, err) } } else { onError(client, err) } client.emit('connectionError', client[kUrl], [client], err) } client[kResume]() } function emitDrain (client) { client[kNeedDrain] = 0 client.emit('drain', client[kUrl], [client]) } function resume (client, sync) { if (client[kResuming] === 2) { return } client[kResuming] = 2 _resume(client, sync) client[kResuming] = 0 if (client[kRunningIdx] > 256) { client[kQueue].splice(0, client[kRunningIdx]) client[kPendingIdx] -= client[kRunningIdx] client[kRunningIdx] = 0 } } function _resume (client, sync) { while (true) { if (client.destroyed) { assert(client[kPending] === 0) return } if (client[kClosedResolve] && !client[kSize]) { client[kClosedResolve]() client[kClosedResolve] = null return } if (client[kHTTPContext]) { client[kHTTPContext].resume() } if (client[kBusy]) { client[kNeedDrain] = 2 } else if (client[kNeedDrain] === 2) { if (sync) { client[kNeedDrain] = 1 queueMicrotask(() => emitDrain(client)) } else { emitDrain(client) } continue } if (client[kPending] === 0) { return } if (client[kRunning] >= (getPipelining(client) || 1)) { return } const request = client[kQueue][client[kPendingIdx]] if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) { if (client[kRunning] > 0) { return } client[kServerName] = request.servername client[kHTTPContext]?.destroy(new InformationalError('servername changed'), () => { client[kHTTPContext] = null resume(client) }) } if (client[kConnecting]) { return } if (!client[kHTTPContext]) { connect(client) return } if (client[kHTTPContext].destroyed) { return } if (client[kHTTPContext].busy(request)) { return } if (!request.aborted && client[kHTTPContext].write(request)) { client[kPendingIdx]++ } else { client[kQueue].splice(client[kPendingIdx], 1) } } } module.exports = Client /***/ }), /***/ 61544: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const Dispatcher = __nccwpck_require__(87781) const { ClientDestroyedError, ClientClosedError, InvalidArgumentError } = __nccwpck_require__(48045) const { kDestroy, kClose, kClosed, kDestroyed, kDispatch, kInterceptors } = __nccwpck_require__(72785) const kOnDestroyed = Symbol('onDestroyed') const kOnClosed = Symbol('onClosed') const kInterceptedDispatch = Symbol('Intercepted Dispatch') const kWebSocketOptions = Symbol('webSocketOptions') class DispatcherBase extends Dispatcher { constructor (opts) { super() this[kDestroyed] = false this[kOnDestroyed] = null this[kClosed] = false this[kOnClosed] = [] this[kWebSocketOptions] = opts?.webSocket ?? {} } get webSocketOptions () { return { maxFragments: this[kWebSocketOptions].maxFragments ?? 131072, maxPayloadSize: this[kWebSocketOptions].maxPayloadSize ?? 128 * 1024 * 1024 } } get destroyed () { return this[kDestroyed] } get closed () { return this[kClosed] } get interceptors () { return this[kInterceptors] } set interceptors (newInterceptors) { if (newInterceptors) { for (let i = newInterceptors.length - 1; i >= 0; i--) { const interceptor = this[kInterceptors][i] if (typeof interceptor !== 'function') { throw new InvalidArgumentError('interceptor must be an function') } } } this[kInterceptors] = newInterceptors } close (callback) { if (callback === undefined) { return new Promise((resolve, reject) => { this.close((err, data) => { return err ? reject(err) : resolve(data) }) }) } if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } if (this[kDestroyed]) { queueMicrotask(() => callback(new ClientDestroyedError(), null)) return } if (this[kClosed]) { if (this[kOnClosed]) { this[kOnClosed].push(callback) } else { queueMicrotask(() => callback(null, null)) } return } this[kClosed] = true this[kOnClosed].push(callback) const onClosed = () => { const callbacks = this[kOnClosed] this[kOnClosed] = null for (let i = 0; i < callbacks.length; i++) { callbacks[i](null, null) } } // Should not error. this[kClose]() .then(() => this.destroy()) .then(() => { queueMicrotask(onClosed) }) } destroy (err, callback) { if (typeof err === 'function') { callback = err err = null } if (callback === undefined) { return new Promise((resolve, reject) => { this.destroy(err, (err, data) => { return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data) }) }) } if (typeof callback !== 'function') { throw new InvalidArgumentError('invalid callback') } if (this[kDestroyed]) { if (this[kOnDestroyed]) { this[kOnDestroyed].push(callback) } else { queueMicrotask(() => callback(null, null)) } return } if (!err) { err = new ClientDestroyedError() } this[kDestroyed] = true this[kOnDestroyed] = this[kOnDestroyed] || [] this[kOnDestroyed].push(callback) const onDestroyed = () => { const callbacks = this[kOnDestroyed] this[kOnDestroyed] = null for (let i = 0; i < callbacks.length; i++) { callbacks[i](null, null) } } // Should not error. this[kDestroy](err).then(() => { queueMicrotask(onDestroyed) }) } [kInterceptedDispatch] (opts, handler) { if (!this[kInterceptors] || this[kInterceptors].length === 0) { this[kInterceptedDispatch] = this[kDispatch] return this[kDispatch](opts, handler) } let dispatch = this[kDispatch].bind(this) for (let i = this[kInterceptors].length - 1; i >= 0; i--) { dispatch = this[kInterceptors][i](dispatch) } this[kInterceptedDispatch] = dispatch return dispatch(opts, handler) } dispatch (opts, handler) { if (!handler || typeof handler !== 'object') { throw new InvalidArgumentError('handler must be an object') } try { if (!opts || typeof opts !== 'object') { throw new InvalidArgumentError('opts must be an object.') } if (this[kDestroyed] || this[kOnDestroyed]) { throw new ClientDestroyedError() } if (this[kClosed]) { throw new ClientClosedError() } return this[kInterceptedDispatch](opts, handler) } catch (err) { if (typeof handler.onError !== 'function') { throw new InvalidArgumentError('invalid onError method') } handler.onError(err) return false } } } module.exports = DispatcherBase /***/ }), /***/ 87781: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const EventEmitter = __nccwpck_require__(15673) class Dispatcher extends EventEmitter { dispatch () { throw new Error('not implemented') } close () { throw new Error('not implemented') } destroy () { throw new Error('not implemented') } compose (...args) { // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ... const interceptors = Array.isArray(args[0]) ? args[0] : args let dispatch = this.dispatch.bind(this) for (const interceptor of interceptors) { if (interceptor == null) { continue } if (typeof interceptor !== 'function') { throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`) } dispatch = interceptor(dispatch) if (dispatch == null || typeof dispatch !== 'function' || dispatch.length !== 2) { throw new TypeError('invalid interceptor') } } return new ComposedDispatcher(this, dispatch) } } class ComposedDispatcher extends Dispatcher { #dispatcher = null #dispatch = null constructor (dispatcher, dispatch) { super() this.#dispatcher = dispatcher this.#dispatch = dispatch } dispatch (...args) { this.#dispatch(...args) } close (...args) { return this.#dispatcher.close(...args) } destroy (...args) { return this.#dispatcher.destroy(...args) } } module.exports = Dispatcher /***/ }), /***/ 88374: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const DispatcherBase = __nccwpck_require__(61544) const { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = __nccwpck_require__(72785) const ProxyAgent = __nccwpck_require__(15657) const Agent = __nccwpck_require__(71208) const DEFAULT_PORTS = { 'http:': 80, 'https:': 443 } let experimentalWarned = false class EnvHttpProxyAgent extends DispatcherBase { #noProxyValue = null #noProxyEntries = null #opts = null constructor (opts = {}) { super() this.#opts = opts if (!experimentalWarned) { experimentalWarned = true process.emitWarning('EnvHttpProxyAgent is experimental, expect them to change at any time.', { code: 'UNDICI-EHPA' }) } const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts this[kNoProxyAgent] = new Agent(agentOpts) const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY if (HTTP_PROXY) { this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY }) } else { this[kHttpProxyAgent] = this[kNoProxyAgent] } const HTTPS_PROXY = httpsProxy ?? process.env.https_proxy ?? process.env.HTTPS_PROXY if (HTTPS_PROXY) { this[kHttpsProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTPS_PROXY }) } else { this[kHttpsProxyAgent] = this[kHttpProxyAgent] } this.#parseNoProxy() } [kDispatch] (opts, handler) { const url = new URL(opts.origin) const agent = this.#getProxyAgentForUrl(url) return agent.dispatch(opts, handler) } async [kClose] () { await this[kNoProxyAgent].close() if (!this[kHttpProxyAgent][kClosed]) { await this[kHttpProxyAgent].close() } if (!this[kHttpsProxyAgent][kClosed]) { await this[kHttpsProxyAgent].close() } } async [kDestroy] (err) { await this[kNoProxyAgent].destroy(err) if (!this[kHttpProxyAgent][kDestroyed]) { await this[kHttpProxyAgent].destroy(err) } if (!this[kHttpsProxyAgent][kDestroyed]) { await this[kHttpsProxyAgent].destroy(err) } } #getProxyAgentForUrl (url) { let { protocol, host: hostname, port } = url // Stripping ports in this way instead of using parsedUrl.hostname to make // sure that the brackets around IPv6 addresses are kept. hostname = hostname.replace(/:\d*$/, '').toLowerCase() port = Number.parseInt(port, 10) || DEFAULT_PORTS[protocol] || 0 if (!this.#shouldProxy(hostname, port)) { return this[kNoProxyAgent] } if (protocol === 'https:') { return this[kHttpsProxyAgent] } return this[kHttpProxyAgent] } #shouldProxy (hostname, port) { if (this.#noProxyChanged) { this.#parseNoProxy() } if (this.#noProxyEntries.length === 0) { return true // Always proxy if NO_PROXY is not set or empty. } if (this.#noProxyValue === '*') { return false // Never proxy if wildcard is set. } for (let i = 0; i < this.#noProxyEntries.length; i++) { const entry = this.#noProxyEntries[i] if (entry.port && entry.port !== port) { continue // Skip if ports don't match. } if (!/^[.*]/.test(entry.hostname)) { // No wildcards, so don't proxy only if there is not an exact match. if (hostname === entry.hostname) { return false } } else { // Don't proxy if the hostname ends with the no_proxy host. if (hostname.endsWith(entry.hostname.replace(/^\*/, ''))) { return false } } } return true } #parseNoProxy () { const noProxyValue = this.#opts.noProxy ?? this.#noProxyEnv const noProxySplit = noProxyValue.split(/[,\s]/) const noProxyEntries = [] for (let i = 0; i < noProxySplit.length; i++) { const entry = noProxySplit[i] if (!entry) { continue } const parsed = entry.match(/^(.+):(\d+)$/) noProxyEntries.push({ hostname: (parsed ? parsed[1] : entry).toLowerCase(), port: parsed ? Number.parseInt(parsed[2], 10) : 0 }) } this.#noProxyValue = noProxyValue this.#noProxyEntries = noProxyEntries } get #noProxyChanged () { if (this.#opts.noProxy !== undefined) { return false } return this.#noProxyValue !== this.#noProxyEnv } get #noProxyEnv () { return process.env.no_proxy ?? process.env.NO_PROXY ?? '' } } module.exports = EnvHttpProxyAgent /***/ }), /***/ 75158: /***/ ((module) => { "use strict"; /* eslint-disable */ // Extracted from node/lib/internal/fixed_queue.js // Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two. const kSize = 2048; const kMask = kSize - 1; // The FixedQueue is implemented as a singly-linked list of fixed-size // circular buffers. It looks something like this: // // head tail // | | // v v // +-----------+ <-----\ +-----------+ <------\ +-----------+ // | [null] | \----- | next | \------- | next | // +-----------+ +-----------+ +-----------+ // | item | <-- bottom | item | <-- bottom | [empty] | // | item | | item | | [empty] | // | item | | item | | [empty] | // | item | | item | | [empty] | // | item | | item | bottom --> | item | // | item | | item | | item | // | ... | | ... | | ... | // | item | | item | | item | // | item | | item | | item | // | [empty] | <-- top | item | | item | // | [empty] | | item | | item | // | [empty] | | [empty] | <-- top top --> | [empty] | // +-----------+ +-----------+ +-----------+ // // Or, if there is only one circular buffer, it looks something // like either of these: // // head tail head tail // | | | | // v v v v // +-----------+ +-----------+ // | [null] | | [null] | // +-----------+ +-----------+ // | [empty] | | item | // | [empty] | | item | // | item | <-- bottom top --> | [empty] | // | item | | [empty] | // | [empty] | <-- top bottom --> | item | // | [empty] | | item | // +-----------+ +-----------+ // // Adding a value means moving `top` forward by one, removing means // moving `bottom` forward by one. After reaching the end, the queue // wraps around. // // When `top === bottom` the current queue is empty and when // `top + 1 === bottom` it's full. This wastes a single space of storage // but allows much quicker checks. class FixedCircularBuffer { constructor() { this.bottom = 0; this.top = 0; this.list = new Array(kSize); this.next = null; } isEmpty() { return this.top === this.bottom; } isFull() { return ((this.top + 1) & kMask) === this.bottom; } push(data) { this.list[this.top] = data; this.top = (this.top + 1) & kMask; } shift() { const nextItem = this.list[this.bottom]; if (nextItem === undefined) return null; this.list[this.bottom] = undefined; this.bottom = (this.bottom + 1) & kMask; return nextItem; } } module.exports = class FixedQueue { constructor() { this.head = this.tail = new FixedCircularBuffer(); } isEmpty() { return this.head.isEmpty(); } push(data) { if (this.head.isFull()) { // Head is full: Creates a new queue, sets the old queue's `.next` to it, // and sets it as the new main queue. this.head = this.head.next = new FixedCircularBuffer(); } this.head.push(data); } shift() { const tail = this.tail; const next = tail.shift(); if (tail.isEmpty() && tail.next !== null) { // If there is another queue, it forms the new tail. this.tail = tail.next; } return next; } }; /***/ }), /***/ 90494: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const DispatcherBase = __nccwpck_require__(61544) const FixedQueue = __nccwpck_require__(75158) const { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = __nccwpck_require__(72785) const PoolStats = __nccwpck_require__(54667) const kClients = Symbol('clients') const kNeedDrain = Symbol('needDrain') const kQueue = Symbol('queue') const kClosedResolve = Symbol('closed resolve') const kOnDrain = Symbol('onDrain') const kOnConnect = Symbol('onConnect') const kOnDisconnect = Symbol('onDisconnect') const kOnConnectionError = Symbol('onConnectionError') const kGetDispatcher = Symbol('get dispatcher') const kAddClient = Symbol('add client') const kRemoveClient = Symbol('remove client') const kStats = Symbol('stats') class PoolBase extends DispatcherBase { constructor (opts) { super(opts) this[kQueue] = new FixedQueue() this[kClients] = [] this[kQueued] = 0 const pool = this this[kOnDrain] = function onDrain (origin, targets) { const queue = pool[kQueue] let needDrain = false while (!needDrain) { const item = queue.shift() if (!item) { break } pool[kQueued]-- needDrain = !this.dispatch(item.opts, item.handler) } this[kNeedDrain] = needDrain if (!this[kNeedDrain] && pool[kNeedDrain]) { pool[kNeedDrain] = false pool.emit('drain', origin, [pool, ...targets]) } if (pool[kClosedResolve] && queue.isEmpty()) { Promise .all(pool[kClients].map(c => c.close())) .then(pool[kClosedResolve]) } } this[kOnConnect] = (origin, targets) => { pool.emit('connect', origin, [pool, ...targets]) } this[kOnDisconnect] = (origin, targets, err) => { pool.emit('disconnect', origin, [pool, ...targets], err) } this[kOnConnectionError] = (origin, targets, err) => { pool.emit('connectionError', origin, [pool, ...targets], err) } this[kStats] = new PoolStats(this) } get [kBusy] () { return this[kNeedDrain] } get [kConnected] () { return this[kClients].filter(client => client[kConnected]).length } get [kFree] () { return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length } get [kPending] () { let ret = this[kQueued] for (const { [kPending]: pending } of this[kClients]) { ret += pending } return ret } get [kRunning] () { let ret = 0 for (const { [kRunning]: running } of this[kClients]) { ret += running } return ret } get [kSize] () { let ret = this[kQueued] for (const { [kSize]: size } of this[kClients]) { ret += size } return ret } get stats () { return this[kStats] } async [kClose] () { if (this[kQueue].isEmpty()) { await Promise.all(this[kClients].map(c => c.close())) } else { await new Promise((resolve) => { this[kClosedResolve] = resolve }) } } async [kDestroy] (err) { while (true) { const item = this[kQueue].shift() if (!item) { break } item.handler.onError(err) } await Promise.all(this[kClients].map(c => c.destroy(err))) } [kDispatch] (opts, handler) { const dispatcher = this[kGetDispatcher]() if (!dispatcher) { this[kNeedDrain] = true this[kQueue].push({ opts, handler }) this[kQueued]++ } else if (!dispatcher.dispatch(opts, handler)) { dispatcher[kNeedDrain] = true this[kNeedDrain] = !this[kGetDispatcher]() } return !this[kNeedDrain] } [kAddClient] (client) { client .on('drain', this[kOnDrain]) .on('connect', this[kOnConnect]) .on('disconnect', this[kOnDisconnect]) .on('connectionError', this[kOnConnectionError]) this[kClients].push(client) if (this[kNeedDrain]) { queueMicrotask(() => { if (this[kNeedDrain]) { this[kOnDrain](client[kUrl], [this, client]) } }) } return this } [kRemoveClient] (client) { client.close(() => { const idx = this[kClients].indexOf(client) if (idx !== -1) { this[kClients].splice(idx, 1) } }) this[kNeedDrain] = this[kClients].some(dispatcher => ( !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true )) } } module.exports = { PoolBase, kClients, kNeedDrain, kAddClient, kRemoveClient, kGetDispatcher } /***/ }), /***/ 54667: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = __nccwpck_require__(72785) const kPool = Symbol('pool') class PoolStats { constructor (pool) { this[kPool] = pool } get connected () { return this[kPool][kConnected] } get free () { return this[kPool][kFree] } get pending () { return this[kPool][kPending] } get queued () { return this[kPool][kQueued] } get running () { return this[kPool][kRunning] } get size () { return this[kPool][kSize] } } module.exports = PoolStats /***/ }), /***/ 20177: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { PoolBase, kClients, kNeedDrain, kAddClient, kGetDispatcher } = __nccwpck_require__(90494) const Client = __nccwpck_require__(8176) const { InvalidArgumentError } = __nccwpck_require__(48045) const util = __nccwpck_require__(83983) const { kUrl, kInterceptors } = __nccwpck_require__(72785) const buildConnector = __nccwpck_require__(82067) const kOptions = Symbol('options') const kConnections = Symbol('connections') const kFactory = Symbol('factory') function defaultFactory (origin, opts) { return new Client(origin, opts) } class Pool extends PoolBase { constructor (origin, { connections, factory = defaultFactory, connect, connectTimeout, tls, maxCachedSessions, socketPath, autoSelectFamily, autoSelectFamilyAttemptTimeout, allowH2, ...options } = {}) { if (connections != null && (!Number.isFinite(connections) || connections < 0)) { throw new InvalidArgumentError('invalid connections') } if (typeof factory !== 'function') { throw new InvalidArgumentError('factory must be a function.') } if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') { throw new InvalidArgumentError('connect must be a function or an object') } if (typeof connect !== 'function') { connect = buildConnector({ ...tls, maxCachedSessions, allowH2, socketPath, timeout: connectTimeout, ...(autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined), ...connect }) } super(options) this[kInterceptors] = options.interceptors?.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : [] this[kConnections] = connections || null this[kUrl] = util.parseOrigin(origin) this[kOptions] = { ...util.deepClone(options), connect, allowH2 } this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : undefined this[kFactory] = factory this.on('connectionError', (origin, targets, error) => { // If a connection error occurs, we remove the client from the pool, // and emit a connectionError event. They will not be re-used. // Fixes https://github.com/nodejs/undici/issues/3895 for (const target of targets) { // Do not use kRemoveClient here, as it will close the client, // but the client cannot be closed in this state. const idx = this[kClients].indexOf(target) if (idx !== -1) { this[kClients].splice(idx, 1) } } }) } [kGetDispatcher] () { for (const client of this[kClients]) { if (!client[kNeedDrain]) { return client } } if (!this[kConnections] || this[kClients].length < this[kConnections]) { const dispatcher = this[kFactory](this[kUrl], this[kOptions]) this[kAddClient](dispatcher) return dispatcher } } } module.exports = Pool /***/ }), /***/ 15657: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { kProxy, kClose, kDestroy, kDispatch, kInterceptors } = __nccwpck_require__(72785) const { URL } = __nccwpck_require__(41041) const Agent = __nccwpck_require__(71208) const Pool = __nccwpck_require__(20177) const DispatcherBase = __nccwpck_require__(61544) const { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = __nccwpck_require__(48045) const buildConnector = __nccwpck_require__(82067) const Client = __nccwpck_require__(8176) const kAgent = Symbol('proxy agent') const kClient = Symbol('proxy client') const kProxyHeaders = Symbol('proxy headers') const kRequestTls = Symbol('request tls settings') const kProxyTls = Symbol('proxy tls settings') const kConnectEndpoint = Symbol('connect endpoint function') const kTunnelProxy = Symbol('tunnel proxy') function defaultProtocolPort (protocol) { return protocol === 'https:' ? 443 : 80 } function defaultFactory (origin, opts) { return new Pool(origin, opts) } const noop = () => {} function defaultAgentFactory (origin, opts) { if (opts.connections === 1) { return new Client(origin, opts) } return new Pool(origin, opts) } class Http1ProxyWrapper extends DispatcherBase { #client constructor (proxyUrl, { headers = {}, connect, factory }) { super() if (!proxyUrl) { throw new InvalidArgumentError('Proxy URL is mandatory') } this[kProxyHeaders] = headers if (factory) { this.#client = factory(proxyUrl, { connect }) } else { this.#client = new Client(proxyUrl, { connect }) } } [kDispatch] (opts, handler) { const onHeaders = handler.onHeaders handler.onHeaders = function (statusCode, data, resume) { if (statusCode === 407) { if (typeof handler.onError === 'function') { handler.onError(new InvalidArgumentError('Proxy Authentication Required (407)')) } return } if (onHeaders) onHeaders.call(this, statusCode, data, resume) } // Rewrite request as an HTTP1 Proxy request, without tunneling. const { origin, path = '/', headers = {} } = opts opts.path = origin + path if (!('host' in headers) && !('Host' in headers)) { const { host } = new URL(origin) headers.host = host } opts.headers = { ...this[kProxyHeaders], ...headers } return this.#client[kDispatch](opts, handler) } async [kClose] () { return this.#client.close() } async [kDestroy] (err) { return this.#client.destroy(err) } } class ProxyAgent extends DispatcherBase { constructor (opts) { super() if (!opts || (typeof opts === 'object' && !(opts instanceof URL) && !opts.uri)) { throw new InvalidArgumentError('Proxy uri is mandatory') } const { clientFactory = defaultFactory } = opts if (typeof clientFactory !== 'function') { throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.') } const { proxyTunnel = true } = opts const url = this.#getUrl(opts) const { href, origin, port, protocol, username, password, hostname: proxyHostname } = url this[kProxy] = { uri: href, protocol } this[kInterceptors] = opts.interceptors?.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent) ? opts.interceptors.ProxyAgent : [] this[kRequestTls] = opts.requestTls this[kProxyTls] = opts.proxyTls this[kProxyHeaders] = opts.headers || {} this[kTunnelProxy] = proxyTunnel if (opts.auth && opts.token) { throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token') } else if (opts.auth) { /* @deprecated in favour of opts.token */ this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}` } else if (opts.token) { this[kProxyHeaders]['proxy-authorization'] = opts.token } else if (username && password) { this[kProxyHeaders]['proxy-authorization'] = `Basic ${Buffer.from(`${decodeURIComponent(username)}:${decodeURIComponent(password)}`).toString('base64')}` } const connect = buildConnector({ ...opts.proxyTls }) this[kConnectEndpoint] = buildConnector({ ...opts.requestTls }) const agentFactory = opts.factory || defaultAgentFactory const factory = (origin, options) => { const { protocol } = new URL(origin) if (!this[kTunnelProxy] && protocol === 'http:' && this[kProxy].protocol === 'http:') { return new Http1ProxyWrapper(this[kProxy].uri, { headers: this[kProxyHeaders], connect, factory: agentFactory }) } return agentFactory(origin, options) } this[kClient] = clientFactory(url, { connect }) this[kAgent] = new Agent({ ...opts, factory, connect: async (opts, callback) => { let requestedPath = opts.host if (!opts.port) { requestedPath += `:${defaultProtocolPort(opts.protocol)}` } try { const { socket, statusCode } = await this[kClient].connect({ origin, port, path: requestedPath, signal: opts.signal, headers: { ...this[kProxyHeaders], host: opts.host }, servername: this[kProxyTls]?.servername || proxyHostname }) if (statusCode !== 200) { socket.on('error', noop).destroy() callback(new RequestAbortedError(`Proxy response (${statusCode}) !== 200 when HTTP Tunneling`)) } if (opts.protocol !== 'https:') { callback(null, socket) return } let servername if (this[kRequestTls]) { servername = this[kRequestTls].servername } else { servername = opts.servername } this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback) } catch (err) { if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') { // Throw a custom error to avoid loop in client.js#connect callback(new SecureProxyConnectionError(err)) } else { callback(err) } } } }) } dispatch (opts, handler) { const headers = buildHeaders(opts.headers) throwIfProxyAuthIsSent(headers) if (headers && !('host' in headers) && !('Host' in headers)) { const { host } = new URL(opts.origin) headers.host = host } return this[kAgent].dispatch( { ...opts, headers }, handler ) } /** * @param {import('../types/proxy-agent').ProxyAgent.Options | string | URL} opts * @returns {URL} */ #getUrl (opts) { if (typeof opts === 'string') { return new URL(opts) } else if (opts instanceof URL) { return opts } else { return new URL(opts.uri) } } async [kClose] () { await this[kAgent].close() await this[kClient].close() } async [kDestroy] () { await this[kAgent].destroy() await this[kClient].destroy() } } /** * @param {string[] | Record} headers * @returns {Record} */ function buildHeaders (headers) { // When using undici.fetch, the headers list is stored // as an array. if (Array.isArray(headers)) { /** @type {Record} */ const headersPair = {} for (let i = 0; i < headers.length; i += 2) { headersPair[headers[i]] = headers[i + 1] } return headersPair } return headers } /** * @param {Record} headers * * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers * Nevertheless, it was changed and to avoid a security vulnerability by end users * this check was created. * It should be removed in the next major version for performance reasons */ function throwIfProxyAuthIsSent (headers) { const existProxyAuth = headers && Object.keys(headers) .find((key) => key.toLowerCase() === 'proxy-authorization') if (existProxyAuth) { throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor') } } module.exports = ProxyAgent /***/ }), /***/ 94411: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const Dispatcher = __nccwpck_require__(87781) const RetryHandler = __nccwpck_require__(86242) class RetryAgent extends Dispatcher { #agent = null #options = null constructor (agent, options = {}) { super(options) this.#agent = agent this.#options = options } dispatch (opts, handler) { const retry = new RetryHandler({ ...opts, retryOptions: this.#options }, { dispatch: this.#agent.dispatch.bind(this.#agent), handler }) return this.#agent.dispatch(opts, retry) } close () { return this.#agent.close() } destroy () { return this.#agent.destroy() } } module.exports = RetryAgent /***/ }), /***/ 21892: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; // We include a version number for the Dispatcher API. In case of breaking changes, // this version number must be increased to avoid conflicts. const globalDispatcher = Symbol.for('undici.globalDispatcher.1') const { InvalidArgumentError } = __nccwpck_require__(48045) const Agent = __nccwpck_require__(71208) if (getGlobalDispatcher() === undefined) { setGlobalDispatcher(new Agent()) } function setGlobalDispatcher (agent) { if (!agent || typeof agent.dispatch !== 'function') { throw new InvalidArgumentError('Argument agent must implement Agent') } Object.defineProperty(globalThis, globalDispatcher, { value: agent, writable: true, enumerable: false, configurable: false }) } function getGlobalDispatcher () { return globalThis[globalDispatcher] } module.exports = { setGlobalDispatcher, getGlobalDispatcher } /***/ }), /***/ 4117: /***/ ((module) => { "use strict"; module.exports = class DecoratorHandler { #handler constructor (handler) { if (typeof handler !== 'object' || handler === null) { throw new TypeError('handler must be an object') } this.#handler = handler } onConnect (...args) { return this.#handler.onConnect?.(...args) } onError (...args) { return this.#handler.onError?.(...args) } onUpgrade (...args) { return this.#handler.onUpgrade?.(...args) } onResponseStarted (...args) { return this.#handler.onResponseStarted?.(...args) } onHeaders (...args) { return this.#handler.onHeaders?.(...args) } onData (...args) { return this.#handler.onData?.(...args) } onComplete (...args) { return this.#handler.onComplete?.(...args) } onBodySent (...args) { return this.#handler.onBodySent?.(...args) } } /***/ }), /***/ 30649: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const util = __nccwpck_require__(83983) const { kBodyUsed } = __nccwpck_require__(72785) const assert = __nccwpck_require__(98061) const { InvalidArgumentError } = __nccwpck_require__(48045) const EE = __nccwpck_require__(15673) const redirectableStatusCodes = [300, 301, 302, 303, 307, 308] const kBody = Symbol('body') class BodyAsyncIterable { constructor (body) { this[kBody] = body this[kBodyUsed] = false } async * [Symbol.asyncIterator] () { assert(!this[kBodyUsed], 'disturbed') this[kBodyUsed] = true yield * this[kBody] } } class RedirectHandler { constructor (dispatch, maxRedirections, opts, handler) { if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { throw new InvalidArgumentError('maxRedirections must be a positive number') } util.validateHandler(handler, opts.method, opts.upgrade) this.dispatch = dispatch this.location = null this.abort = null this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy this.maxRedirections = maxRedirections this.handler = handler this.history = [] this.redirectionLimitReached = false if (util.isStream(this.opts.body)) { // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp // so that it can be dispatched again? // TODO (fix): Do we need 100-expect support to provide a way to do this properly? if (util.bodyLength(this.opts.body) === 0) { this.opts.body .on('data', function () { assert(false) }) } if (typeof this.opts.body.readableDidRead !== 'boolean') { this.opts.body[kBodyUsed] = false EE.prototype.on.call(this.opts.body, 'data', function () { this[kBodyUsed] = true }) } } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') { // TODO (fix): We can't access ReadableStream internal state // to determine whether or not it has been disturbed. This is just // a workaround. this.opts.body = new BodyAsyncIterable(this.opts.body) } else if ( this.opts.body && typeof this.opts.body !== 'string' && !ArrayBuffer.isView(this.opts.body) && util.isIterable(this.opts.body) ) { // TODO: Should we allow re-using iterable if !this.opts.idempotent // or through some other flag? this.opts.body = new BodyAsyncIterable(this.opts.body) } } onConnect (abort) { this.abort = abort this.handler.onConnect(abort, { history: this.history }) } onUpgrade (statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket) } onError (error) { this.handler.onError(error) } onHeaders (statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers) if (this.opts.throwOnMaxRedirect && this.history.length >= this.maxRedirections) { if (this.request) { this.request.abort(new Error('max redirects')) } this.redirectionLimitReached = true this.abort(new Error('max redirects')) return } if (this.opts.origin) { this.history.push(new URL(this.opts.path, this.opts.origin)) } if (!this.location) { return this.handler.onHeaders(statusCode, headers, resume, statusText) } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))) const path = search ? `${pathname}${search}` : pathname // Remove headers referring to the original URL. // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers. // https://tools.ietf.org/html/rfc7231#section-6.4 this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin) this.opts.path = path this.opts.origin = origin this.opts.maxRedirections = 0 this.opts.query = null // https://tools.ietf.org/html/rfc7231#section-6.4.4 // In case of HTTP 303, always replace method to be either HEAD or GET if (statusCode === 303 && this.opts.method !== 'HEAD') { this.opts.method = 'GET' this.opts.body = null } } onData (chunk) { if (this.location) { /* https://tools.ietf.org/html/rfc7231#section-6.4 TLDR: undici always ignores 3xx response bodies. Redirection is used to serve the requested resource from another URL, so it is assumes that no body is generated (and thus can be ignored). Even though generating a body is not prohibited. For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually (which means it's optional and not mandated) contain just an hyperlink to the value of the Location response header, so the body can be ignored safely. For status 300, which is "Multiple Choices", the spec mentions both generating a Location response header AND a response body with the other possible location to follow. Since the spec explicitly chooses not to specify a format for such body and leave it to servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it. */ } else { return this.handler.onData(chunk) } } onComplete (trailers) { if (this.location) { /* https://tools.ietf.org/html/rfc7231#section-6.4 TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections and neither are useful if present. See comment on onData method above for more detailed information. */ this.location = null this.abort = null this.dispatch(this.opts, this) } else { this.handler.onComplete(trailers) } } onBodySent (chunk) { if (this.handler.onBodySent) { this.handler.onBodySent(chunk) } } } function parseLocation (statusCode, headers) { if (redirectableStatusCodes.indexOf(statusCode) === -1) { return null } for (let i = 0; i < headers.length; i += 2) { if (headers[i].length === 8 && util.headerNameToString(headers[i]) === 'location') { return headers[i + 1] } } } // https://tools.ietf.org/html/rfc7231#section-6.4.4 function shouldRemoveHeader (header, removeContent, unknownOrigin) { if (header.length === 4) { return util.headerNameToString(header) === 'host' } if (removeContent && util.headerNameToString(header).startsWith('content-')) { return true } if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { const name = util.headerNameToString(header) return name === 'authorization' || name === 'cookie' || name === 'proxy-authorization' } return false } // https://tools.ietf.org/html/rfc7231#section-6.4 function cleanRequestHeaders (headers, removeContent, unknownOrigin) { const ret = [] if (Array.isArray(headers)) { for (let i = 0; i < headers.length; i += 2) { if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) { ret.push(headers[i], headers[i + 1]) } } } else if (headers && typeof headers === 'object') { for (const key of Object.keys(headers)) { if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) { ret.push(key, headers[key]) } } } else { assert(headers == null, 'headers must be an object or an array') } return ret } module.exports = RedirectHandler /***/ }), /***/ 86242: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(98061) const { kRetryHandlerDefaultRetry } = __nccwpck_require__(72785) const { RequestRetryError } = __nccwpck_require__(48045) const { isDisturbed, parseHeaders, parseRangeHeader, wrapRequestBody } = __nccwpck_require__(83983) function calculateRetryAfterHeader (retryAfter) { const current = Date.now() return new Date(retryAfter).getTime() - current } function validatePartialResponseContentLength (headers, range, statusCode, retryCount) { const contentLength = headers['content-length'] if (contentLength == null) { return null } if (!Number.isFinite(range.start) || !Number.isFinite(range.end)) { return null } const length = Number(contentLength) const expectedLength = range.end - range.start + 1 if (!Number.isFinite(length) || length !== expectedLength) { return new RequestRetryError('Content-Length mismatch', statusCode, { headers, data: { count: retryCount } }) } return null } class RetryHandler { constructor (opts, handlers) { const { retryOptions, ...dispatchOpts } = opts const { // Retry scoped retry: retryFn, maxRetries, maxTimeout, minTimeout, timeoutFactor, // Response scoped methods, errorCodes, retryAfter, statusCodes } = retryOptions ?? {} this.dispatch = handlers.dispatch this.handler = handlers.handler this.opts = { ...dispatchOpts, body: wrapRequestBody(opts.body) } this.abort = null this.aborted = false this.retryOpts = { retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry], retryAfter: retryAfter ?? true, maxTimeout: maxTimeout ?? 30 * 1000, // 30s, minTimeout: minTimeout ?? 500, // .5s timeoutFactor: timeoutFactor ?? 2, maxRetries: maxRetries ?? 5, // What errors we should retry methods: methods ?? ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'], // Indicates which errors to retry statusCodes: statusCodes ?? [500, 502, 503, 504, 429], // List of errors to retry errorCodes: errorCodes ?? [ 'ECONNRESET', 'ECONNREFUSED', 'ENOTFOUND', 'ENETDOWN', 'ENETUNREACH', 'EHOSTDOWN', 'EHOSTUNREACH', 'EPIPE', 'UND_ERR_SOCKET' ] } this.retryCount = 0 this.retryCountCheckpoint = 0 this.start = 0 this.end = null this.etag = null this.resume = null // Handle possible onConnect duplication this.handler.onConnect(reason => { this.aborted = true if (this.abort) { this.abort(reason) } else { this.reason = reason } }) } onRequestSent () { if (this.handler.onRequestSent) { this.handler.onRequestSent() } } onUpgrade (statusCode, headers, socket) { if (this.handler.onUpgrade) { this.handler.onUpgrade(statusCode, headers, socket) } } onConnect (abort) { if (this.aborted) { abort(this.reason) } else { this.abort = abort } } onBodySent (chunk) { if (this.handler.onBodySent) return this.handler.onBodySent(chunk) } static [kRetryHandlerDefaultRetry] (err, { state, opts }, cb) { const { statusCode, code, headers } = err const { method, retryOptions } = opts const { maxRetries, minTimeout, maxTimeout, timeoutFactor, statusCodes, errorCodes, methods } = retryOptions const { counter } = state // Any code that is not a Undici's originated and allowed to retry if (code && code !== 'UND_ERR_REQ_RETRY' && !errorCodes.includes(code)) { cb(err) return } // If a set of method are provided and the current method is not in the list if (Array.isArray(methods) && !methods.includes(method)) { cb(err) return } // If a set of status code are provided and the current status code is not in the list if ( statusCode != null && Array.isArray(statusCodes) && !statusCodes.includes(statusCode) ) { cb(err) return } // If we reached the max number of retries if (counter > maxRetries) { cb(err) return } let retryAfterHeader = headers?.['retry-after'] if (retryAfterHeader) { retryAfterHeader = Number(retryAfterHeader) retryAfterHeader = Number.isNaN(retryAfterHeader) ? calculateRetryAfterHeader(retryAfterHeader) : retryAfterHeader * 1e3 // Retry-After is in seconds } const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout) setTimeout(() => cb(null), retryTimeout) } onHeaders (statusCode, rawHeaders, resume, statusMessage) { const headers = parseHeaders(rawHeaders) this.retryCount += 1 if (statusCode >= 300) { if (this.retryOpts.statusCodes.includes(statusCode) === false) { return this.handler.onHeaders( statusCode, rawHeaders, resume, statusMessage ) } else { this.abort( new RequestRetryError('Request failed', statusCode, { headers, data: { count: this.retryCount } }) ) return false } } // Checkpoint for resume from where we left it if (this.resume != null) { this.resume = null // Only Partial Content 206 supposed to provide Content-Range, // any other status code that partially consumed the payload // should not be retry because it would result in downstream // wrongly concatanete multiple responses. if (statusCode !== 206 && (this.start > 0 || statusCode !== 200)) { this.abort( new RequestRetryError('server does not support the range header and the payload was partially consumed', statusCode, { headers, data: { count: this.retryCount } }) ) return false } const contentRange = parseRangeHeader(headers['content-range']) // If no content range if (!contentRange) { this.abort( new RequestRetryError('Content-Range mismatch', statusCode, { headers, data: { count: this.retryCount } }) ) return false } // Let's start with a weak etag check if (this.etag != null && this.etag !== headers.etag) { this.abort( new RequestRetryError('ETag mismatch', statusCode, { headers, data: { count: this.retryCount } }) ) return false } const contentLengthError = validatePartialResponseContentLength(headers, contentRange, statusCode, this.retryCount) if (contentLengthError != null) { this.abort(contentLengthError) return false } const { start, size, end = size - 1 } = contentRange assert(this.start === start, 'content-range mismatch') assert(this.end == null || this.end === end, 'content-range mismatch') this.resume = resume return true } if (this.end == null) { if (statusCode === 206) { // First time we receive 206 const range = parseRangeHeader(headers['content-range']) if (range == null) { return this.handler.onHeaders( statusCode, rawHeaders, resume, statusMessage ) } const contentLengthError = validatePartialResponseContentLength(headers, range, statusCode, this.retryCount) if (contentLengthError != null) { this.abort(contentLengthError) return false } const { start, size, end = size - 1 } = range assert( start != null && Number.isFinite(start), 'content-range mismatch' ) assert(end != null && Number.isFinite(end), 'invalid content-length') this.start = start this.end = end } // We make our best to checkpoint the body for further range headers if (this.end == null) { const contentLength = headers['content-length'] this.end = contentLength != null ? Number(contentLength) - 1 : null } assert(Number.isFinite(this.start)) assert( this.end == null || Number.isFinite(this.end), 'invalid content-length' ) this.resume = resume this.etag = headers.etag != null ? headers.etag : null // Weak etags are not useful for comparison nor cache // for instance not safe to assume if the response is byte-per-byte // equal if (this.etag != null && this.etag.startsWith('W/')) { this.etag = null } return this.handler.onHeaders( statusCode, rawHeaders, resume, statusMessage ) } const err = new RequestRetryError('Request failed', statusCode, { headers, data: { count: this.retryCount } }) this.abort(err) return false } onData (chunk) { this.start += chunk.length return this.handler.onData(chunk) } onComplete (rawTrailers) { this.retryCount = 0 return this.handler.onComplete(rawTrailers) } onError (err) { if (this.aborted || isDisturbed(this.opts.body)) { return this.handler.onError(err) } // We reconcile in case of a mix between network errors // and server error response if (this.retryCount - this.retryCountCheckpoint > 0) { // We count the difference between the last checkpoint and the current retry count this.retryCount = this.retryCountCheckpoint + (this.retryCount - this.retryCountCheckpoint) } else { this.retryCount += 1 } this.retryOpts.retry( err, { state: { counter: this.retryCount }, opts: { retryOptions: this.retryOpts, ...this.opts } }, onRetry.bind(this) ) function onRetry (err) { if (err != null || this.aborted || isDisturbed(this.opts.body)) { return this.handler.onError(err) } if (this.start !== 0) { const headers = { range: `bytes=${this.start}-${this.end ?? ''}` } // Weak etag check - weak etags will make comparison algorithms never match if (this.etag != null) { headers['if-match'] = this.etag } this.opts = { ...this.opts, headers: { ...this.opts.headers, ...headers } } } try { this.retryCountCheckpoint = this.retryCount this.dispatch(this.opts, this) } catch (err) { this.handler.onError(err) } } } } module.exports = RetryHandler /***/ }), /***/ 97334: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { isIP } = __nccwpck_require__(87503) const { lookup } = __nccwpck_require__(30604) const DecoratorHandler = __nccwpck_require__(4117) const { InvalidArgumentError, InformationalError } = __nccwpck_require__(48045) const maxInt = Math.pow(2, 31) - 1 class DNSInstance { #maxTTL = 0 #maxItems = 0 #records = new Map() dualStack = true affinity = null lookup = null pick = null constructor (opts) { this.#maxTTL = opts.maxTTL this.#maxItems = opts.maxItems this.dualStack = opts.dualStack this.affinity = opts.affinity this.lookup = opts.lookup ?? this.#defaultLookup this.pick = opts.pick ?? this.#defaultPick } get full () { return this.#records.size === this.#maxItems } runLookup (origin, opts, cb) { const ips = this.#records.get(origin.hostname) // If full, we just return the origin if (ips == null && this.full) { cb(null, origin.origin) return } const newOpts = { affinity: this.affinity, dualStack: this.dualStack, lookup: this.lookup, pick: this.pick, ...opts.dns, maxTTL: this.#maxTTL, maxItems: this.#maxItems } // If no IPs we lookup if (ips == null) { this.lookup(origin, newOpts, (err, addresses) => { if (err || addresses == null || addresses.length === 0) { cb(err ?? new InformationalError('No DNS entries found')) return } this.setRecords(origin, addresses) const records = this.#records.get(origin.hostname) const ip = this.pick( origin, records, newOpts.affinity ) let port if (typeof ip.port === 'number') { port = `:${ip.port}` } else if (origin.port !== '') { port = `:${origin.port}` } else { port = '' } cb( null, `${origin.protocol}//${ ip.family === 6 ? `[${ip.address}]` : ip.address }${port}` ) }) } else { // If there's IPs we pick const ip = this.pick( origin, ips, newOpts.affinity ) // If no IPs we lookup - deleting old records if (ip == null) { this.#records.delete(origin.hostname) this.runLookup(origin, opts, cb) return } let port if (typeof ip.port === 'number') { port = `:${ip.port}` } else if (origin.port !== '') { port = `:${origin.port}` } else { port = '' } cb( null, `${origin.protocol}//${ ip.family === 6 ? `[${ip.address}]` : ip.address }${port}` ) } } #defaultLookup (origin, opts, cb) { lookup( origin.hostname, { all: true, family: this.dualStack === false ? this.affinity : 0, order: 'ipv4first' }, (err, addresses) => { if (err) { return cb(err) } const results = new Map() for (const addr of addresses) { // On linux we found duplicates, we attempt to remove them with // the latest record results.set(`${addr.address}:${addr.family}`, addr) } cb(null, results.values()) } ) } #defaultPick (origin, hostnameRecords, affinity) { let ip = null const { records, offset } = hostnameRecords let family if (this.dualStack) { if (affinity == null) { // Balance between ip families if (offset == null || offset === maxInt) { hostnameRecords.offset = 0 affinity = 4 } else { hostnameRecords.offset++ affinity = (hostnameRecords.offset & 1) === 1 ? 6 : 4 } } if (records[affinity] != null && records[affinity].ips.length > 0) { family = records[affinity] } else { family = records[affinity === 4 ? 6 : 4] } } else { family = records[affinity] } // If no IPs we return null if (family == null || family.ips.length === 0) { return ip } if (family.offset == null || family.offset === maxInt) { family.offset = 0 } else { family.offset++ } const position = family.offset % family.ips.length ip = family.ips[position] ?? null if (ip == null) { return ip } if (Date.now() - ip.timestamp > ip.ttl) { // record TTL is already in ms // We delete expired records // It is possible that they have different TTL, so we manage them individually family.ips.splice(position, 1) return this.pick(origin, hostnameRecords, affinity) } return ip } setRecords (origin, addresses) { const timestamp = Date.now() const records = { records: { 4: null, 6: null } } for (const record of addresses) { record.timestamp = timestamp if (typeof record.ttl === 'number') { // The record TTL is expected to be in ms record.ttl = Math.min(record.ttl, this.#maxTTL) } else { record.ttl = this.#maxTTL } const familyRecords = records.records[record.family] ?? { ips: [] } familyRecords.ips.push(record) records.records[record.family] = familyRecords } this.#records.set(origin.hostname, records) } getHandler (meta, opts) { return new DNSDispatchHandler(this, meta, opts) } } class DNSDispatchHandler extends DecoratorHandler { #state = null #opts = null #dispatch = null #handler = null #origin = null constructor (state, { origin, handler, dispatch }, opts) { super(handler) this.#origin = origin this.#handler = handler this.#opts = { ...opts } this.#state = state this.#dispatch = dispatch } onError (err) { switch (err.code) { case 'ETIMEDOUT': case 'ECONNREFUSED': { if (this.#state.dualStack) { // We delete the record and retry this.#state.runLookup(this.#origin, this.#opts, (err, newOrigin) => { if (err) { return this.#handler.onError(err) } const dispatchOpts = { ...this.#opts, origin: newOrigin } this.#dispatch(dispatchOpts, this) }) // if dual-stack disabled, we error out return } this.#handler.onError(err) return } case 'ENOTFOUND': this.#state.deleteRecord(this.#origin) // eslint-disable-next-line no-fallthrough default: this.#handler.onError(err) break } } } module.exports = interceptorOpts => { if ( interceptorOpts?.maxTTL != null && (typeof interceptorOpts?.maxTTL !== 'number' || interceptorOpts?.maxTTL < 0) ) { throw new InvalidArgumentError('Invalid maxTTL. Must be a positive number') } if ( interceptorOpts?.maxItems != null && (typeof interceptorOpts?.maxItems !== 'number' || interceptorOpts?.maxItems < 1) ) { throw new InvalidArgumentError( 'Invalid maxItems. Must be a positive number and greater than zero' ) } if ( interceptorOpts?.affinity != null && interceptorOpts?.affinity !== 4 && interceptorOpts?.affinity !== 6 ) { throw new InvalidArgumentError('Invalid affinity. Must be either 4 or 6') } if ( interceptorOpts?.dualStack != null && typeof interceptorOpts?.dualStack !== 'boolean' ) { throw new InvalidArgumentError('Invalid dualStack. Must be a boolean') } if ( interceptorOpts?.lookup != null && typeof interceptorOpts?.lookup !== 'function' ) { throw new InvalidArgumentError('Invalid lookup. Must be a function') } if ( interceptorOpts?.pick != null && typeof interceptorOpts?.pick !== 'function' ) { throw new InvalidArgumentError('Invalid pick. Must be a function') } const dualStack = interceptorOpts?.dualStack ?? true let affinity if (dualStack) { affinity = interceptorOpts?.affinity ?? null } else { affinity = interceptorOpts?.affinity ?? 4 } const opts = { maxTTL: interceptorOpts?.maxTTL ?? 10e3, // Expressed in ms lookup: interceptorOpts?.lookup ?? null, pick: interceptorOpts?.pick ?? null, dualStack, affinity, maxItems: interceptorOpts?.maxItems ?? Infinity } const instance = new DNSInstance(opts) return dispatch => { return function dnsInterceptor (origDispatchOpts, handler) { const origin = origDispatchOpts.origin.constructor === URL ? origDispatchOpts.origin : new URL(origDispatchOpts.origin) if (isIP(origin.hostname) !== 0) { return dispatch(origDispatchOpts, handler) } instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => { if (err) { return handler.onError(err) } let dispatchOpts = null dispatchOpts = { ...origDispatchOpts, servername: origin.hostname, // For SNI on TLS origin: newOrigin, headers: { host: origin.hostname, ...origDispatchOpts.headers } } dispatch( dispatchOpts, instance.getHandler({ origin, dispatch, handler }, origDispatchOpts) ) }) return true } } } /***/ }), /***/ 66090: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const util = __nccwpck_require__(83983) const { InvalidArgumentError, RequestAbortedError } = __nccwpck_require__(48045) const DecoratorHandler = __nccwpck_require__(4117) class DumpHandler extends DecoratorHandler { #maxSize = 1024 * 1024 #abort = null #dumped = false #aborted = false #size = 0 #reason = null #handler = null constructor ({ maxSize }, handler) { super(handler) if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) { throw new InvalidArgumentError('maxSize must be a number greater than 0') } this.#maxSize = maxSize ?? this.#maxSize this.#handler = handler } onConnect (abort) { this.#abort = abort this.#handler.onConnect(this.#customAbort.bind(this)) } #customAbort (reason) { this.#aborted = true this.#reason = reason } // TODO: will require adjustment after new hooks are out onHeaders (statusCode, rawHeaders, resume, statusMessage) { const headers = util.parseHeaders(rawHeaders) const contentLength = headers['content-length'] if (contentLength != null && contentLength > this.#maxSize) { throw new RequestAbortedError( `Response size (${contentLength}) larger than maxSize (${ this.#maxSize })` ) } if (this.#aborted) { return true } return this.#handler.onHeaders( statusCode, rawHeaders, resume, statusMessage ) } onError (err) { if (this.#dumped) { return } err = this.#reason ?? err this.#handler.onError(err) } onData (chunk) { this.#size = this.#size + chunk.length if (this.#size >= this.#maxSize) { this.#dumped = true if (this.#aborted) { this.#handler.onError(this.#reason) } else { this.#handler.onComplete([]) } } return true } onComplete (trailers) { if (this.#dumped) { return } if (this.#aborted) { this.#handler.onError(this.reason) return } this.#handler.onComplete(trailers) } } function createDumpInterceptor ( { maxSize: defaultMaxSize } = { maxSize: 1024 * 1024 } ) { return dispatch => { return function Intercept (opts, handler) { const { dumpMaxSize = defaultMaxSize } = opts const dumpHandler = new DumpHandler( { maxSize: dumpMaxSize }, handler ) return dispatch(opts, dumpHandler) } } } module.exports = createDumpInterceptor /***/ }), /***/ 99099: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const RedirectHandler = __nccwpck_require__(30649) function createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) { return (dispatch) => { return function Intercept (opts, handler) { const { maxRedirections = defaultMaxRedirections } = opts if (!maxRedirections) { return dispatch(opts, handler) } const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler) opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting. return dispatch(opts, redirectHandler) } } } module.exports = createRedirectInterceptor /***/ }), /***/ 87773: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const RedirectHandler = __nccwpck_require__(30649) module.exports = opts => { const globalMaxRedirections = opts?.maxRedirections return dispatch => { return function redirectInterceptor (opts, handler) { const { maxRedirections = globalMaxRedirections, ...baseOpts } = opts if (!maxRedirections) { return dispatch(opts, handler) } const redirectHandler = new RedirectHandler( dispatch, maxRedirections, opts, handler ) return dispatch(baseOpts, redirectHandler) } } } /***/ }), /***/ 55558: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const RetryHandler = __nccwpck_require__(86242) module.exports = globalOpts => { return dispatch => { return function retryInterceptor (opts, handler) { return dispatch( opts, new RetryHandler( { ...opts, retryOptions: { ...globalOpts, ...opts.retryOptions } }, { handler, dispatch } ) ) } } } /***/ }), /***/ 30953: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0; const utils_1 = __nccwpck_require__(41891); // C headers var ERROR; (function (ERROR) { ERROR[ERROR["OK"] = 0] = "OK"; ERROR[ERROR["INTERNAL"] = 1] = "INTERNAL"; ERROR[ERROR["STRICT"] = 2] = "STRICT"; ERROR[ERROR["LF_EXPECTED"] = 3] = "LF_EXPECTED"; ERROR[ERROR["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH"; ERROR[ERROR["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION"; ERROR[ERROR["INVALID_METHOD"] = 6] = "INVALID_METHOD"; ERROR[ERROR["INVALID_URL"] = 7] = "INVALID_URL"; ERROR[ERROR["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT"; ERROR[ERROR["INVALID_VERSION"] = 9] = "INVALID_VERSION"; ERROR[ERROR["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN"; ERROR[ERROR["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH"; ERROR[ERROR["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE"; ERROR[ERROR["INVALID_STATUS"] = 13] = "INVALID_STATUS"; ERROR[ERROR["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE"; ERROR[ERROR["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING"; ERROR[ERROR["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN"; ERROR[ERROR["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE"; ERROR[ERROR["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE"; ERROR[ERROR["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER"; ERROR[ERROR["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE"; ERROR[ERROR["PAUSED"] = 21] = "PAUSED"; ERROR[ERROR["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE"; ERROR[ERROR["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE"; ERROR[ERROR["USER"] = 24] = "USER"; })(ERROR = exports.ERROR || (exports.ERROR = {})); var TYPE; (function (TYPE) { TYPE[TYPE["BOTH"] = 0] = "BOTH"; TYPE[TYPE["REQUEST"] = 1] = "REQUEST"; TYPE[TYPE["RESPONSE"] = 2] = "RESPONSE"; })(TYPE = exports.TYPE || (exports.TYPE = {})); var FLAGS; (function (FLAGS) { FLAGS[FLAGS["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE"; FLAGS[FLAGS["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE"; FLAGS[FLAGS["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE"; FLAGS[FLAGS["CHUNKED"] = 8] = "CHUNKED"; FLAGS[FLAGS["UPGRADE"] = 16] = "UPGRADE"; FLAGS[FLAGS["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH"; FLAGS[FLAGS["SKIPBODY"] = 64] = "SKIPBODY"; FLAGS[FLAGS["TRAILING"] = 128] = "TRAILING"; // 1 << 8 is unused FLAGS[FLAGS["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING"; })(FLAGS = exports.FLAGS || (exports.FLAGS = {})); var LENIENT_FLAGS; (function (LENIENT_FLAGS) { LENIENT_FLAGS[LENIENT_FLAGS["HEADERS"] = 1] = "HEADERS"; LENIENT_FLAGS[LENIENT_FLAGS["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH"; LENIENT_FLAGS[LENIENT_FLAGS["KEEP_ALIVE"] = 4] = "KEEP_ALIVE"; })(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {})); var METHODS; (function (METHODS) { METHODS[METHODS["DELETE"] = 0] = "DELETE"; METHODS[METHODS["GET"] = 1] = "GET"; METHODS[METHODS["HEAD"] = 2] = "HEAD"; METHODS[METHODS["POST"] = 3] = "POST"; METHODS[METHODS["PUT"] = 4] = "PUT"; /* pathological */ METHODS[METHODS["CONNECT"] = 5] = "CONNECT"; METHODS[METHODS["OPTIONS"] = 6] = "OPTIONS"; METHODS[METHODS["TRACE"] = 7] = "TRACE"; /* WebDAV */ METHODS[METHODS["COPY"] = 8] = "COPY"; METHODS[METHODS["LOCK"] = 9] = "LOCK"; METHODS[METHODS["MKCOL"] = 10] = "MKCOL"; METHODS[METHODS["MOVE"] = 11] = "MOVE"; METHODS[METHODS["PROPFIND"] = 12] = "PROPFIND"; METHODS[METHODS["PROPPATCH"] = 13] = "PROPPATCH"; METHODS[METHODS["SEARCH"] = 14] = "SEARCH"; METHODS[METHODS["UNLOCK"] = 15] = "UNLOCK"; METHODS[METHODS["BIND"] = 16] = "BIND"; METHODS[METHODS["REBIND"] = 17] = "REBIND"; METHODS[METHODS["UNBIND"] = 18] = "UNBIND"; METHODS[METHODS["ACL"] = 19] = "ACL"; /* subversion */ METHODS[METHODS["REPORT"] = 20] = "REPORT"; METHODS[METHODS["MKACTIVITY"] = 21] = "MKACTIVITY"; METHODS[METHODS["CHECKOUT"] = 22] = "CHECKOUT"; METHODS[METHODS["MERGE"] = 23] = "MERGE"; /* upnp */ METHODS[METHODS["M-SEARCH"] = 24] = "M-SEARCH"; METHODS[METHODS["NOTIFY"] = 25] = "NOTIFY"; METHODS[METHODS["SUBSCRIBE"] = 26] = "SUBSCRIBE"; METHODS[METHODS["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE"; /* RFC-5789 */ METHODS[METHODS["PATCH"] = 28] = "PATCH"; METHODS[METHODS["PURGE"] = 29] = "PURGE"; /* CalDAV */ METHODS[METHODS["MKCALENDAR"] = 30] = "MKCALENDAR"; /* RFC-2068, section 19.6.1.2 */ METHODS[METHODS["LINK"] = 31] = "LINK"; METHODS[METHODS["UNLINK"] = 32] = "UNLINK"; /* icecast */ METHODS[METHODS["SOURCE"] = 33] = "SOURCE"; /* RFC-7540, section 11.6 */ METHODS[METHODS["PRI"] = 34] = "PRI"; /* RFC-2326 RTSP */ METHODS[METHODS["DESCRIBE"] = 35] = "DESCRIBE"; METHODS[METHODS["ANNOUNCE"] = 36] = "ANNOUNCE"; METHODS[METHODS["SETUP"] = 37] = "SETUP"; METHODS[METHODS["PLAY"] = 38] = "PLAY"; METHODS[METHODS["PAUSE"] = 39] = "PAUSE"; METHODS[METHODS["TEARDOWN"] = 40] = "TEARDOWN"; METHODS[METHODS["GET_PARAMETER"] = 41] = "GET_PARAMETER"; METHODS[METHODS["SET_PARAMETER"] = 42] = "SET_PARAMETER"; METHODS[METHODS["REDIRECT"] = 43] = "REDIRECT"; METHODS[METHODS["RECORD"] = 44] = "RECORD"; /* RAOP */ METHODS[METHODS["FLUSH"] = 45] = "FLUSH"; })(METHODS = exports.METHODS || (exports.METHODS = {})); exports.METHODS_HTTP = [ METHODS.DELETE, METHODS.GET, METHODS.HEAD, METHODS.POST, METHODS.PUT, METHODS.CONNECT, METHODS.OPTIONS, METHODS.TRACE, METHODS.COPY, METHODS.LOCK, METHODS.MKCOL, METHODS.MOVE, METHODS.PROPFIND, METHODS.PROPPATCH, METHODS.SEARCH, METHODS.UNLOCK, METHODS.BIND, METHODS.REBIND, METHODS.UNBIND, METHODS.ACL, METHODS.REPORT, METHODS.MKACTIVITY, METHODS.CHECKOUT, METHODS.MERGE, METHODS['M-SEARCH'], METHODS.NOTIFY, METHODS.SUBSCRIBE, METHODS.UNSUBSCRIBE, METHODS.PATCH, METHODS.PURGE, METHODS.MKCALENDAR, METHODS.LINK, METHODS.UNLINK, METHODS.PRI, // TODO(indutny): should we allow it with HTTP? METHODS.SOURCE, ]; exports.METHODS_ICE = [ METHODS.SOURCE, ]; exports.METHODS_RTSP = [ METHODS.OPTIONS, METHODS.DESCRIBE, METHODS.ANNOUNCE, METHODS.SETUP, METHODS.PLAY, METHODS.PAUSE, METHODS.TEARDOWN, METHODS.GET_PARAMETER, METHODS.SET_PARAMETER, METHODS.REDIRECT, METHODS.RECORD, METHODS.FLUSH, // For AirPlay METHODS.GET, METHODS.POST, ]; exports.METHOD_MAP = utils_1.enumToMap(METHODS); exports.H_METHOD_MAP = {}; Object.keys(exports.METHOD_MAP).forEach((key) => { if (/^H/.test(key)) { exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key]; } }); var FINISH; (function (FINISH) { FINISH[FINISH["SAFE"] = 0] = "SAFE"; FINISH[FINISH["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB"; FINISH[FINISH["UNSAFE"] = 2] = "UNSAFE"; })(FINISH = exports.FINISH || (exports.FINISH = {})); exports.ALPHA = []; for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) { // Upper case exports.ALPHA.push(String.fromCharCode(i)); // Lower case exports.ALPHA.push(String.fromCharCode(i + 0x20)); } exports.NUM_MAP = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, }; exports.HEX_MAP = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF, a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf, }; exports.NUM = [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ]; exports.ALPHANUM = exports.ALPHA.concat(exports.NUM); exports.MARK = ['-', '_', '.', '!', '~', '*', '\'', '(', ')']; exports.USERINFO_CHARS = exports.ALPHANUM .concat(exports.MARK) .concat(['%', ';', ':', '&', '=', '+', '$', ',']); // TODO(indutny): use RFC exports.STRICT_URL_CHAR = [ '!', '"', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~', ].concat(exports.ALPHANUM); exports.URL_CHAR = exports.STRICT_URL_CHAR .concat(['\t', '\f']); // All characters with 0x80 bit set to 1 for (let i = 0x80; i <= 0xff; i++) { exports.URL_CHAR.push(i); } exports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']); /* Tokens as defined by rfc 2616. Also lowercases them. * token = 1* * separators = "(" | ")" | "<" | ">" | "@" * | "," | ";" | ":" | "\" | <"> * | "/" | "[" | "]" | "?" | "=" * | "{" | "}" | SP | HT */ exports.STRICT_TOKEN = [ '!', '#', '$', '%', '&', '\'', '*', '+', '-', '.', '^', '_', '`', '|', '~', ].concat(exports.ALPHANUM); exports.TOKEN = exports.STRICT_TOKEN.concat([' ']); /* * Verify that a char is a valid visible (printable) US-ASCII * character or %x80-FF */ exports.HEADER_CHARS = ['\t']; for (let i = 32; i <= 255; i++) { if (i !== 127) { exports.HEADER_CHARS.push(i); } } // ',' = \x44 exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44); exports.MAJOR = exports.NUM_MAP; exports.MINOR = exports.MAJOR; var HEADER_STATE; (function (HEADER_STATE) { HEADER_STATE[HEADER_STATE["GENERAL"] = 0] = "GENERAL"; HEADER_STATE[HEADER_STATE["CONNECTION"] = 1] = "CONNECTION"; HEADER_STATE[HEADER_STATE["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH"; HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING"; HEADER_STATE[HEADER_STATE["UPGRADE"] = 4] = "UPGRADE"; HEADER_STATE[HEADER_STATE["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE"; HEADER_STATE[HEADER_STATE["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE"; HEADER_STATE[HEADER_STATE["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE"; HEADER_STATE[HEADER_STATE["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED"; })(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {})); exports.SPECIAL_HEADERS = { 'connection': HEADER_STATE.CONNECTION, 'content-length': HEADER_STATE.CONTENT_LENGTH, 'proxy-connection': HEADER_STATE.CONNECTION, 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING, 'upgrade': HEADER_STATE.UPGRADE, }; //# sourceMappingURL=constants.js.map /***/ }), /***/ 61145: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Buffer } = __nccwpck_require__(72254) module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXRfaHR0cF9tYWpvcgAOFWxsaHR0cF9nZXRfaHR0cF9taW5vcgAPEWxsaHR0cF9nZXRfbWV0aG9kABAWbGxodHRwX2dldF9zdGF0dXNfY29kZQAREmxsaHR0cF9nZXRfdXBncmF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AANgIYCyAFQRRqKAIAIgJFDQAgAEEUaiACNgIAIAIgADYCGAsgASAEaiAENgIAIAEgBEEBcjYCBCABQaDQACgCAEcNAEGU0AAgBDYCAAwBCyAEQf8BTQRAIARBeHFBtNAAaiEAAn9BjNAAKAIAIgJBASAEQQN2dCIDcUUEQEGM0AAgAiADcjYCACAADAELIAAoAggLIgIgATYCDCAAIAE2AgggASAANgIMIAEgAjYCCAwBC0EfIQIgBEH///8HTQRAIARBJiAEQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgASACNgIcIAFCADcCECACQQJ0QbzSAGohAAJAQZDQACgCACIDQQEgAnQiB3FFBEAgACABNgIAQZDQACADIAdyNgIAIAEgADYCGCABIAE2AgggASABNgIMDAELIARBGSACQQF2a0EAIAJBH0cbdCECIAAoAgAhAAJAA0AgACIDKAIEQXhxIARGDQEgAkEddiEAIAJBAXQhAiADIABBBHFqQRBqIgcoAgAiAA0ACyAHIAE2AgAgASADNgIYIAEgATYCDCABIAE2AggMAQsgAygCCCIAIAE2AgwgAyABNgIIIAFBADYCGCABIAM2AgwgASAANgIIC0Gs0ABBrNAAKAIAQQFrIgBBfyAAGzYCAAsLBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LQAEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABAwIAAgBDYCOCAAIAM6ACggACACOgAtIAAgATYCGAu74gECB38DfiABIAJqIQQCQCAAIgIoAgwiAA0AIAIoAgQEQCACIAE2AgQLIwBBEGsiCCQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAk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BqgEMGgtBqwEMGQtBrAEMGAtBrQEMFwtBrgEMFgtBAQwVC0GvAQwUC0GwAQwTC0GxAQwSC0GzAQwRC0GyAQwQC0G0AQwPC0G1AQwOC0G2AQwNC0G3AQwMC0G4AQwLC0G5AQwKC0G6AQwJC0G7AQwIC0HGAQwHC0G8AQwGC0G9AQwFC0G+AQwEC0G/AQwDC0HAAQwCC0HCAQwBC0HBAQshAwNAAkACQAJAAkACQAJAAkACQAJAIAICfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACfwJAAkACQAJAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJ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qIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGhzwBqLQAARw1dIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAybAgsgAkEANgIAIAZBAWohAUEeDF4LIAEgBEYEQEGTASEDDJoCCyABLQAAQcwARw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AAAAAIAQbHNAAs6AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB8M4AC5YBTk9VTkNFRUNLT1VUTkVDVEVURUNSSUJFTFVTSEVURUFEU0VBUkNIUkdFQ1RJVklUWUxFTkRBUlZFT1RJRllQVElPTlNDSFNFQVlTVEFUQ0hHRU9SRElSRUNUT1JUUkNIUEFSQU1FVEVSVVJDRUJTQ1JJQkVBUkRPV05BQ0VJTkROS0NLVUJTQ1JJQkVIVFRQL0FEVFAv', 'base64') /***/ }), /***/ 95627: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Buffer } = __nccwpck_require__(72254) module.exports = Buffer.from('AGFzbQEAAAABJwdgAX8Bf2ADf39/AX9gAX8AYAJ/fwBgBH9/f38Bf2AAAGADf39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQAEA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAAy0sBQYAAAIAAAAAAAACAQIAAgICAAADAAAAAAMDAwMBAQEBAQEBAQEAAAIAAAAEBQFwARISBQMBAAIGCAF/AUGA1AQLB9EFIgZtZW1vcnkCAAtfaW5pdGlhbGl6ZQAIGV9faW5kaXJlY3RfZnVuY3Rpb25fdGFibGUBAAtsbGh0dHBfaW5pdAAJGGxsaHR0cF9zaG91bGRfa2VlcF9hbGl2ZQAvDGxsaHR0cF9hbGxvYwALBm1hbGxvYwAxC2xsaHR0cF9mcmVlAAwEZnJlZQAMD2xsaHR0cF9nZXRfdHlwZQANFWxsaHR0cF9nZXR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gEgAEEBaiEAIAQgAUEBaiIBRw0ACyACIAU2AgAMogILQYsBIQMgASAERg2hAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGOzwBqLQAARw1kIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyiAgsgAkEANgIAIAZBAWohAUECDGULQYwBIQMgASAERg2gAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHwzwBqLQAARw1jIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyhAgsgAkEANgIAIAZBAWohAUEfDGQLQY0BIQMgASAERg2fAiACKAIAIgAgBCABa2ohBSABIABrQQFqIQYCQANAIAEtAAAgAEHyzwBqLQAARw1iIABBAUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAygAgsgAkEANgIAIAZBAWohAUEJDGMLIAEgBEYEQEGOASEDDJ8CCwJAAkAgAS0AAEHJAGsOBwBiYmJiYgFiCyABQQFqIQFB+AAhAwyGAgsgAUEBaiEBQfkAIQMMhQILQY8BIQMgASAERg2dAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQANAIAEtAAAgAEGRzwBqLQAARw1gIABBBUYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAyeAgsgAkEANgIAIAZBAWohAUEYDGELQZABIQMgASAERg2cAiACKAIAIgAgBCABa2ohBSABIABrQQJqIQYCQANAIAEtAAAgAEGXzwBqLQAARw1fIABBAkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAydAgsgAkEANgIAIAZBAWohAUEXDGALQZEBIQMgASAERg2bAiACKAIAIgAgBCABa2ohBSABIABrQQZqIQYCQANAIAEtAAAgAEGazwBqLQAARw1eIABBBkYNASAAQQFqIQAgBCABQQFqIgFHDQALIAIgBTYCAAycAgsgAkEANgIAIAZBAWohAUEVDF8LQZIBIQMgASAERg2aAiACKAIAIgAgBCABa2ohBSABIABrQQVqIQYCQ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E2AhQgAkHcCDYCECACQQc2AgxBACEDDKsBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNByACQeUANgIcIAIgATYCFCACIAA2AgxBACEDDKoBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNFiACQdMANgIcIAIgATYCFCACIAA2AgxBACEDDKkBCyACKAIEIQAgAkEANgIEIAIgACABECUiAEUNGCACQdIANgIcIAIgATYCFCACIAA2AgxBACEDDKgBCyACQQA2AhwgAiABNgIUIAJBxgo2AhAgAkEHNgIMQQAhAwynAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQMgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwymAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRIgAkHTADYCHCACIAE2AhQgAiAANgIMQQAhAwylAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDRQgAkHSADYCHCACIAE2AhQgAiAANgIMQQAhAwykAQsgAigCBCEAIAJBADYCBCACIAAgARAlIgBFDQAgAkHlADYCHCACIAE2AhQgAiAANgIMQQAhAwyjAQtB1QAhAwyJAQsgAEEVRwRAIAJBADYCHCACIAE2AhQgAkG5DTYCECACQRo2AgxBACEDDKIBCyACQeQANgIcIAIgATYCFCACQeMXNgIQIAJBFTYCDEEAIQMMoQELIAJBADYCACAGQQFqIQEgAi0AKSIAQSNrQQtJDQQCQCAAQQZLDQBBASAAdEHKAHFFDQAMBQtBACEDIAJBADYCHCACIAE2AhQgAkH3CTYCECACQQg2AgwMoAELIAJBADYCACAGQQFqIQEgAi0AKUEhRg0DIAJBADYCHCACIAE2AhQgAkGbCjYCECACQQg2AgxBACEDDJ8BCyACQQA2AgALQQAhAyACQQA2AhwgAiABNgIUIAJBkDM2AhAgAkEINgIMDJ0BCyACQQA2AgAgBkEBaiEBIAItAClBI0kNACACQQA2AhwgAiABNgIUIAJB0wk2AhAgAkEINgIMQQAhAwycAQtB0QAhAwyCAQsgAS0AAEEwayIAQf8BcUEKSQRAIAIgADoAKiABQQ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BAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAEH6ygALBAEAAAEAQZDLAAsBAQBBqssAC0ECAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwBB+swACwQBAAABAEGQzQALAQEAQZrNAAsGAgAAAAACAEGxzQALOgMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAQfDOAAuWAU5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw==', 'base64') /***/ }), /***/ 41891: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.enumToMap = void 0; function enumToMap(obj) { const res = {}; Object.keys(obj).forEach((key) => { const value = obj[key]; if (typeof value === 'number') { res[key] = value; } }); return res; } exports.enumToMap = enumToMap; //# sourceMappingURL=utils.js.map /***/ }), /***/ 66771: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { kClients } = __nccwpck_require__(72785) const Agent = __nccwpck_require__(71208) const { kAgent, kMockAgentSet, kMockAgentGet, kDispatches, kIsMockActive, kNetConnect, kGetNetConnect, kOptions, kFactory } = __nccwpck_require__(24347) const MockClient = __nccwpck_require__(58687) const MockPool = __nccwpck_require__(26193) const { matchValue, buildMockOptions } = __nccwpck_require__(79323) const { InvalidArgumentError, UndiciError } = __nccwpck_require__(48045) const Dispatcher = __nccwpck_require__(87781) const Pluralizer = __nccwpck_require__(78891) const PendingInterceptorsFormatter = __nccwpck_require__(86823) class MockAgent extends Dispatcher { constructor (opts) { super(opts) this[kNetConnect] = true this[kIsMockActive] = true // Instantiate Agent and encapsulate if ((opts?.agent && typeof opts.agent.dispatch !== 'function')) { throw new InvalidArgumentError('Argument opts.agent must implement Agent') } const agent = opts?.agent ? opts.agent : new Agent(opts) this[kAgent] = agent this[kClients] = agent[kClients] this[kOptions] = buildMockOptions(opts) } get (origin) { let dispatcher = this[kMockAgentGet](origin) if (!dispatcher) { dispatcher = this[kFactory](origin) this[kMockAgentSet](origin, dispatcher) } return dispatcher } dispatch (opts, handler) { // Call MockAgent.get to perform additional setup before dispatching as normal this.get(opts.origin) return this[kAgent].dispatch(opts, handler) } async close () { await this[kAgent].close() this[kClients].clear() } deactivate () { this[kIsMockActive] = false } activate () { this[kIsMockActive] = true } enableNetConnect (matcher) { if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) { if (Array.isArray(this[kNetConnect])) { this[kNetConnect].push(matcher) } else { this[kNetConnect] = [matcher] } } else if (typeof matcher === 'undefined') { this[kNetConnect] = true } else { throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.') } } disableNetConnect () { this[kNetConnect] = false } // This is required to bypass issues caused by using global symbols - see: // https://github.com/nodejs/undici/issues/1447 get isMockActive () { return this[kIsMockActive] } [kMockAgentSet] (origin, dispatcher) { this[kClients].set(origin, dispatcher) } [kFactory] (origin) { const mockOptions = Object.assign({ agent: this }, this[kOptions]) return this[kOptions] && this[kOptions].connections === 1 ? new MockClient(origin, mockOptions) : new MockPool(origin, mockOptions) } [kMockAgentGet] (origin) { // First check if we can immediately find it const client = this[kClients].get(origin) if (client) { return client } // If the origin is not a string create a dummy parent pool and return to user if (typeof origin !== 'string') { const dispatcher = this[kFactory]('http://localhost:9999') this[kMockAgentSet](origin, dispatcher) return dispatcher } // If we match, create a pool and assign the same dispatches for (const [keyMatcher, nonExplicitDispatcher] of Array.from(this[kClients])) { if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) { const dispatcher = this[kFactory](origin) this[kMockAgentSet](origin, dispatcher) dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches] return dispatcher } } } [kGetNetConnect] () { return this[kNetConnect] } pendingInterceptors () { const mockAgentClients = this[kClients] return Array.from(mockAgentClients.entries()) .flatMap(([origin, scope]) => scope[kDispatches].map(dispatch => ({ ...dispatch, origin }))) .filter(({ pending }) => pending) } assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) { const pending = this.pendingInterceptors() if (pending.length === 0) { return } const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length) throw new UndiciError(` ${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending: ${pendingInterceptorsFormatter.format(pending)} `.trim()) } } module.exports = MockAgent /***/ }), /***/ 58687: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(47261) const Client = __nccwpck_require__(8176) const { buildMockDispatch } = __nccwpck_require__(79323) const { kDispatches, kMockAgent, kClose, kOriginalClose, kOrigin, kOriginalDispatch, kConnected } = __nccwpck_require__(24347) const { MockInterceptor } = __nccwpck_require__(90410) const Symbols = __nccwpck_require__(72785) const { InvalidArgumentError } = __nccwpck_require__(48045) /** * MockClient provides an API that extends the Client to influence the mockDispatches. */ class MockClient extends Client { constructor (origin, opts) { super(origin, opts) if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { throw new InvalidArgumentError('Argument opts.agent must implement Agent') } this[kMockAgent] = opts.agent this[kOrigin] = origin this[kDispatches] = [] this[kConnected] = 1 this[kOriginalDispatch] = this.dispatch this[kOriginalClose] = this.close.bind(this) this.dispatch = buildMockDispatch.call(this) this.close = this[kClose] } get [Symbols.kConnected] () { return this[kConnected] } /** * Sets up the base interceptor for mocking replies from undici. */ intercept (opts) { return new MockInterceptor(opts, this[kDispatches]) } async [kClose] () { await promisify(this[kOriginalClose])() this[kConnected] = 0 this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) } } module.exports = MockClient /***/ }), /***/ 50888: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { UndiciError } = __nccwpck_require__(48045) const kMockNotMatchedError = Symbol.for('undici.error.UND_MOCK_ERR_MOCK_NOT_MATCHED') /** * The request does not match any registered mock dispatches. */ class MockNotMatchedError extends UndiciError { constructor (message) { super(message) Error.captureStackTrace(this, MockNotMatchedError) this.name = 'MockNotMatchedError' this.message = message || 'The request does not match any registered mock dispatches' this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED' } static [Symbol.hasInstance] (instance) { return instance && instance[kMockNotMatchedError] === true } [kMockNotMatchedError] = true } module.exports = { MockNotMatchedError } /***/ }), /***/ 90410: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { getResponseData, buildKey, addMockDispatch } = __nccwpck_require__(79323) const { kDispatches, kDispatchKey, kDefaultHeaders, kDefaultTrailers, kContentLength, kMockDispatch } = __nccwpck_require__(24347) const { InvalidArgumentError } = __nccwpck_require__(48045) const { buildURL } = __nccwpck_require__(83983) /** * Defines the scope API for an interceptor reply */ class MockScope { constructor (mockDispatch) { this[kMockDispatch] = mockDispatch } /** * Delay a reply by a set amount in ms. */ delay (waitInMs) { if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) { throw new InvalidArgumentError('waitInMs must be a valid integer > 0') } this[kMockDispatch].delay = waitInMs return this } /** * For a defined reply, never mark as consumed. */ persist () { this[kMockDispatch].persist = true return this } /** * Allow one to define a reply for a set amount of matching requests. */ times (repeatTimes) { if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) { throw new InvalidArgumentError('repeatTimes must be a valid integer > 0') } this[kMockDispatch].times = repeatTimes return this } } /** * Defines an interceptor for a Mock */ class MockInterceptor { constructor (opts, mockDispatches) { if (typeof opts !== 'object') { throw new InvalidArgumentError('opts must be an object') } if (typeof opts.path === 'undefined') { throw new InvalidArgumentError('opts.path must be defined') } if (typeof opts.method === 'undefined') { opts.method = 'GET' } // See https://github.com/nodejs/undici/issues/1245 // As per RFC 3986, clients are not supposed to send URI // fragments to servers when they retrieve a document, if (typeof opts.path === 'string') { if (opts.query) { opts.path = buildURL(opts.path, opts.query) } else { // Matches https://github.com/nodejs/undici/blob/main/lib/web/fetch/index.js#L1811 const parsedURL = new URL(opts.path, 'data://') opts.path = parsedURL.pathname + parsedURL.search } } if (typeof opts.method === 'string') { opts.method = opts.method.toUpperCase() } this[kDispatchKey] = buildKey(opts) this[kDispatches] = mockDispatches this[kDefaultHeaders] = {} this[kDefaultTrailers] = {} this[kContentLength] = false } createMockScopeDispatchData ({ statusCode, data, responseOptions }) { const responseData = getResponseData(data) const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {} const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers } const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers } return { statusCode, data, headers, trailers } } validateReplyParameters (replyParameters) { if (typeof replyParameters.statusCode === 'undefined') { throw new InvalidArgumentError('statusCode must be defined') } if (typeof replyParameters.responseOptions !== 'object' || replyParameters.responseOptions === null) { throw new InvalidArgumentError('responseOptions must be an object') } } /** * Mock an undici request with a defined reply. */ reply (replyOptionsCallbackOrStatusCode) { // Values of reply aren't available right now as they // can only be available when the reply callback is invoked. if (typeof replyOptionsCallbackOrStatusCode === 'function') { // We'll first wrap the provided callback in another function, // this function will properly resolve the data from the callback // when invoked. const wrappedDefaultsCallback = (opts) => { // Our reply options callback contains the parameter for statusCode, data and options. const resolvedData = replyOptionsCallbackOrStatusCode(opts) // Check if it is in the right format if (typeof resolvedData !== 'object' || resolvedData === null) { throw new InvalidArgumentError('reply options callback must return an object') } const replyParameters = { data: '', responseOptions: {}, ...resolvedData } this.validateReplyParameters(replyParameters) // Since the values can be obtained immediately we return them // from this higher order function that will be resolved later. return { ...this.createMockScopeDispatchData(replyParameters) } } // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data. const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback) return new MockScope(newMockDispatch) } // We can have either one or three parameters, if we get here, // we should have 1-3 parameters. So we spread the arguments of // this function to obtain the parameters, since replyData will always // just be the statusCode. const replyParameters = { statusCode: replyOptionsCallbackOrStatusCode, data: arguments[1] === undefined ? '' : arguments[1], responseOptions: arguments[2] === undefined ? {} : arguments[2] } this.validateReplyParameters(replyParameters) // Send in-already provided data like usual const dispatchData = this.createMockScopeDispatchData(replyParameters) const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData) return new MockScope(newMockDispatch) } /** * Mock an undici request with a defined error. */ replyWithError (error) { if (typeof error === 'undefined') { throw new InvalidArgumentError('error must be defined') } const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error }) return new MockScope(newMockDispatch) } /** * Set default reply headers on the interceptor for subsequent replies */ defaultReplyHeaders (headers) { if (typeof headers === 'undefined') { throw new InvalidArgumentError('headers must be defined') } this[kDefaultHeaders] = headers return this } /** * Set default reply trailers on the interceptor for subsequent replies */ defaultReplyTrailers (trailers) { if (typeof trailers === 'undefined') { throw new InvalidArgumentError('trailers must be defined') } this[kDefaultTrailers] = trailers return this } /** * Set reply content length header for replies on the interceptor */ replyContentLength () { this[kContentLength] = true return this } } module.exports.MockInterceptor = MockInterceptor module.exports.MockScope = MockScope /***/ }), /***/ 26193: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { promisify } = __nccwpck_require__(47261) const Pool = __nccwpck_require__(20177) const { buildMockDispatch } = __nccwpck_require__(79323) const { kDispatches, kMockAgent, kClose, kOriginalClose, kOrigin, kOriginalDispatch, kConnected } = __nccwpck_require__(24347) const { MockInterceptor } = __nccwpck_require__(90410) const Symbols = __nccwpck_require__(72785) const { InvalidArgumentError } = __nccwpck_require__(48045) /** * MockPool provides an API that extends the Pool to influence the mockDispatches. */ class MockPool extends Pool { constructor (origin, opts) { super(origin, opts) if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') { throw new InvalidArgumentError('Argument opts.agent must implement Agent') } this[kMockAgent] = opts.agent this[kOrigin] = origin this[kDispatches] = [] this[kConnected] = 1 this[kOriginalDispatch] = this.dispatch this[kOriginalClose] = this.close.bind(this) this.dispatch = buildMockDispatch.call(this) this.close = this[kClose] } get [Symbols.kConnected] () { return this[kConnected] } /** * Sets up the base interceptor for mocking replies from undici. */ intercept (opts) { return new MockInterceptor(opts, this[kDispatches]) } async [kClose] () { await promisify(this[kOriginalClose])() this[kConnected] = 0 this[kMockAgent][Symbols.kClients].delete(this[kOrigin]) } } module.exports = MockPool /***/ }), /***/ 24347: /***/ ((module) => { "use strict"; module.exports = { kAgent: Symbol('agent'), kOptions: Symbol('options'), kFactory: Symbol('factory'), kDispatches: Symbol('dispatches'), kDispatchKey: Symbol('dispatch key'), kDefaultHeaders: Symbol('default headers'), kDefaultTrailers: Symbol('default trailers'), kContentLength: Symbol('content length'), kMockAgent: Symbol('mock agent'), kMockAgentSet: Symbol('mock agent set'), kMockAgentGet: Symbol('mock agent get'), kMockDispatch: Symbol('mock dispatch'), kClose: Symbol('close'), kOriginalClose: Symbol('original agent close'), kOrigin: Symbol('origin'), kIsMockActive: Symbol('is mock active'), kNetConnect: Symbol('net connect'), kGetNetConnect: Symbol('get net connect'), kConnected: Symbol('connected') } /***/ }), /***/ 79323: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { MockNotMatchedError } = __nccwpck_require__(50888) const { kDispatches, kMockAgent, kOriginalDispatch, kOrigin, kGetNetConnect } = __nccwpck_require__(24347) const { buildURL } = __nccwpck_require__(83983) const { STATUS_CODES } = __nccwpck_require__(88849) const { types: { isPromise } } = __nccwpck_require__(47261) function matchValue (match, value) { if (typeof match === 'string') { return match === value } if (match instanceof RegExp) { return match.test(value) } if (typeof match === 'function') { return match(value) === true } return false } function lowerCaseEntries (headers) { return Object.fromEntries( Object.entries(headers).map(([headerName, headerValue]) => { return [headerName.toLocaleLowerCase(), headerValue] }) ) } /** * @param {import('../../index').Headers|string[]|Record} headers * @param {string} key */ function getHeaderByName (headers, key) { if (Array.isArray(headers)) { for (let i = 0; i < headers.length; i += 2) { if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) { return headers[i + 1] } } return undefined } else if (typeof headers.get === 'function') { return headers.get(key) } else { return lowerCaseEntries(headers)[key.toLocaleLowerCase()] } } /** @param {string[]} headers */ function buildHeadersFromArray (headers) { // fetch HeadersList const clone = headers.slice() const entries = [] for (let index = 0; index < clone.length; index += 2) { entries.push([clone[index], clone[index + 1]]) } return Object.fromEntries(entries) } function matchHeaders (mockDispatch, headers) { if (typeof mockDispatch.headers === 'function') { if (Array.isArray(headers)) { // fetch HeadersList headers = buildHeadersFromArray(headers) } return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {}) } if (typeof mockDispatch.headers === 'undefined') { return true } if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') { return false } for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) { const headerValue = getHeaderByName(headers, matchHeaderName) if (!matchValue(matchHeaderValue, headerValue)) { return false } } return true } function safeUrl (path) { if (typeof path !== 'string') { return path } const pathSegments = path.split('?') if (pathSegments.length !== 2) { return path } const qp = new URLSearchParams(pathSegments.pop()) qp.sort() return [...pathSegments, qp.toString()].join('?') } function matchKey (mockDispatch, { path, method, body, headers }) { const pathMatch = matchValue(mockDispatch.path, path) const methodMatch = matchValue(mockDispatch.method, method) const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true const headersMatch = matchHeaders(mockDispatch, headers) return pathMatch && methodMatch && bodyMatch && headersMatch } function getResponseData (data) { if (Buffer.isBuffer(data)) { return data } else if (data instanceof Uint8Array) { return data } else if (data instanceof ArrayBuffer) { return data } else if (typeof data === 'object') { return JSON.stringify(data) } else { return data.toString() } } function getMockDispatch (mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath // Match path let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath)) if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`) } // Match method matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method)) if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}' on path '${resolvedPath}'`) } // Match body matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true) if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`) } // Match headers matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers)) if (matchedMockDispatches.length === 0) { const headers = typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`) } return matchedMockDispatches[0] } function addMockDispatch (mockDispatches, key, data) { const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false } const replyData = typeof data === 'function' ? { callback: data } : { ...data } const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } } mockDispatches.push(newMockDispatch) return newMockDispatch } function deleteMockDispatch (mockDispatches, key) { const index = mockDispatches.findIndex(dispatch => { if (!dispatch.consumed) { return false } return matchKey(dispatch, key) }) if (index !== -1) { mockDispatches.splice(index, 1) } } function buildKey (opts) { const { path, method, body, headers, query } = opts return { path, method, body, headers, query } } function generateKeyValues (data) { const keys = Object.keys(data) const result = [] for (let i = 0; i < keys.length; ++i) { const key = keys[i] const value = data[key] const name = Buffer.from(`${key}`) if (Array.isArray(value)) { for (let j = 0; j < value.length; ++j) { result.push(name, Buffer.from(`${value[j]}`)) } } else { result.push(name, Buffer.from(`${value}`)) } } return result } /** * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status * @param {number} statusCode */ function getStatusText (statusCode) { return STATUS_CODES[statusCode] || 'unknown' } async function getResponse (body) { const buffers = [] for await (const data of body) { buffers.push(data) } return Buffer.concat(buffers).toString('utf8') } /** * Mock dispatch function used to simulate undici dispatches */ function mockDispatch (opts, handler) { // Get mock dispatch from built key const key = buildKey(opts) const mockDispatch = getMockDispatch(this[kDispatches], key) mockDispatch.timesInvoked++ // Here's where we resolve a callback if a callback is present for the dispatch data. if (mockDispatch.data.callback) { mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) } } // Parse mockDispatch data const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch const { timesInvoked, times } = mockDispatch // If it's used up and not persistent, mark as consumed mockDispatch.consumed = !persist && timesInvoked >= times mockDispatch.pending = timesInvoked < times // If specified, trigger dispatch error if (error !== null) { deleteMockDispatch(this[kDispatches], key) handler.onError(error) return true } // Handle the request with a delay if necessary if (typeof delay === 'number' && delay > 0) { setTimeout(() => { handleReply(this[kDispatches]) }, delay) } else { handleReply(this[kDispatches]) } function handleReply (mockDispatches, _data = data) { // fetch's HeadersList is a 1D string array const optsHeaders = Array.isArray(opts.headers) ? buildHeadersFromArray(opts.headers) : opts.headers const body = typeof _data === 'function' ? _data({ ...opts, headers: optsHeaders }) : _data // util.types.isPromise is likely needed for jest. if (isPromise(body)) { // If handleReply is asynchronous, throwing an error // in the callback will reject the promise, rather than // synchronously throw the error, which breaks some tests. // Rather, we wait for the callback to resolve if it is a // promise, and then re-run handleReply with the new body. body.then((newData) => handleReply(mockDispatches, newData)) return } const responseData = getResponseData(body) const responseHeaders = generateKeyValues(headers) const responseTrailers = generateKeyValues(trailers) handler.onConnect?.(err => handler.onError(err), null) handler.onHeaders?.(statusCode, responseHeaders, resume, getStatusText(statusCode)) handler.onData?.(Buffer.from(responseData)) handler.onComplete?.(responseTrailers) deleteMockDispatch(mockDispatches, key) } function resume () {} return true } function buildMockDispatch () { const agent = this[kMockAgent] const origin = this[kOrigin] const originalDispatch = this[kOriginalDispatch] return function dispatch (opts, handler) { if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler) } catch (error) { if (error instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect]() if (netConnect === false) { throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`) } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler) } else { throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`) } } else { throw error } } } else { originalDispatch.call(this, opts, handler) } } } function checkNetConnect (netConnect, origin) { const url = new URL(origin) if (netConnect === true) { return true } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) { return true } return false } function buildMockOptions (opts) { if (opts) { const { agent, ...mockOptions } = opts return mockOptions } } module.exports = { getResponseData, getMockDispatch, addMockDispatch, deleteMockDispatch, buildKey, generateKeyValues, matchValue, getResponse, getStatusText, mockDispatch, buildMockDispatch, checkNetConnect, buildMockOptions, getHeaderByName, buildHeadersFromArray } /***/ }), /***/ 86823: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { Transform } = __nccwpck_require__(84492) const { Console } = __nccwpck_require__(40027) const PERSISTENT = process.versions.icu ? '✅' : 'Y ' const NOT_PERSISTENT = process.versions.icu ? '❌' : 'N ' /** * Gets the output of `console.table(…)` as a string. */ module.exports = class PendingInterceptorsFormatter { constructor ({ disableColors } = {}) { this.transform = new Transform({ transform (chunk, _enc, cb) { cb(null, chunk) } }) this.logger = new Console({ stdout: this.transform, inspectOptions: { colors: !disableColors && !process.env.CI } }) } format (pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, Path: path, 'Status code': statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, Remaining: persist ? Infinity : times - timesInvoked })) this.logger.table(withPrettyHeaders) return this.transform.read().toString() } } /***/ }), /***/ 78891: /***/ ((module) => { "use strict"; const singulars = { pronoun: 'it', is: 'is', was: 'was', this: 'this' } const plurals = { pronoun: 'they', is: 'are', was: 'were', this: 'these' } module.exports = class Pluralizer { constructor (singular, plural) { this.singular = singular this.plural = plural } pluralize (count) { const one = count === 1 const keys = one ? singulars : plurals const noun = one ? this.singular : this.plural return { ...keys, count, noun } } } /***/ }), /***/ 85194: /***/ ((module) => { "use strict"; /** * This module offers an optimized timer implementation designed for scenarios * where high precision is not critical. * * The timer achieves faster performance by using a low-resolution approach, * with an accuracy target of within 500ms. This makes it particularly useful * for timers with delays of 1 second or more, where exact timing is less * crucial. * * It's important to note that Node.js timers are inherently imprecise, as * delays can occur due to the event loop being blocked by other operations. * Consequently, timers may trigger later than their scheduled time. */ /** * The fastNow variable contains the internal fast timer clock value. * * @type {number} */ let fastNow = 0 /** * RESOLUTION_MS represents the target resolution time in milliseconds. * * @type {number} * @default 1000 */ const RESOLUTION_MS = 1e3 /** * TICK_MS defines the desired interval in milliseconds between each tick. * The target value is set to half the resolution time, minus 1 ms, to account * for potential event loop overhead. * * @type {number} * @default 499 */ const TICK_MS = (RESOLUTION_MS >> 1) - 1 /** * fastNowTimeout is a Node.js timer used to manage and process * the FastTimers stored in the `fastTimers` array. * * @type {NodeJS.Timeout} */ let fastNowTimeout /** * The kFastTimer symbol is used to identify FastTimer instances. * * @type {Symbol} */ const kFastTimer = Symbol('kFastTimer') /** * The fastTimers array contains all active FastTimers. * * @type {FastTimer[]} */ const fastTimers = [] /** * These constants represent the various states of a FastTimer. */ /** * The `NOT_IN_LIST` constant indicates that the FastTimer is not included * in the `fastTimers` array. Timers with this status will not be processed * during the next tick by the `onTick` function. * * A FastTimer can be re-added to the `fastTimers` array by invoking the * `refresh` method on the FastTimer instance. * * @type {-2} */ const NOT_IN_LIST = -2 /** * The `TO_BE_CLEARED` constant indicates that the FastTimer is scheduled * for removal from the `fastTimers` array. A FastTimer in this state will * be removed in the next tick by the `onTick` function and will no longer * be processed. * * This status is also set when the `clear` method is called on the FastTimer instance. * * @type {-1} */ const TO_BE_CLEARED = -1 /** * The `PENDING` constant signifies that the FastTimer is awaiting processing * in the next tick by the `onTick` function. Timers with this status will have * their `_idleStart` value set and their status updated to `ACTIVE` in the next tick. * * @type {0} */ const PENDING = 0 /** * The `ACTIVE` constant indicates that the FastTimer is active and waiting * for its timer to expire. During the next tick, the `onTick` function will * check if the timer has expired, and if so, it will execute the associated callback. * * @type {1} */ const ACTIVE = 1 /** * The onTick function processes the fastTimers array. * * @returns {void} */ function onTick () { /** * Increment the fastNow value by the TICK_MS value, despite the actual time * that has passed since the last tick. This approach ensures independence * from the system clock and delays caused by a blocked event loop. * * @type {number} */ fastNow += TICK_MS /** * The `idx` variable is used to iterate over the `fastTimers` array. * Expired timers are removed by replacing them with the last element in the array. * Consequently, `idx` is only incremented when the current element is not removed. * * @type {number} */ let idx = 0 /** * The len variable will contain the length of the fastTimers array * and will be decremented when a FastTimer should be removed from the * fastTimers array. * * @type {number} */ let len = fastTimers.length while (idx < len) { /** * @type {FastTimer} */ const timer = fastTimers[idx] // If the timer is in the ACTIVE state and the timer has expired, it will // be processed in the next tick. if (timer._state === PENDING) { // Set the _idleStart value to the fastNow value minus the TICK_MS value // to account for the time the timer was in the PENDING state. timer._idleStart = fastNow - TICK_MS timer._state = ACTIVE } else if ( timer._state === ACTIVE && fastNow >= timer._idleStart + timer._idleTimeout ) { timer._state = TO_BE_CLEARED timer._idleStart = -1 timer._onTimeout(timer._timerArg) } if (timer._state === TO_BE_CLEARED) { timer._state = NOT_IN_LIST // Move the last element to the current index and decrement len if it is // not the only element in the array. if (--len !== 0) { fastTimers[idx] = fastTimers[len] } } else { ++idx } } // Set the length of the fastTimers array to the new length and thus // removing the excess FastTimers elements from the array. fastTimers.length = len // If there are still active FastTimers in the array, refresh the Timer. // If there are no active FastTimers, the timer will be refreshed again // when a new FastTimer is instantiated. if (fastTimers.length !== 0) { refreshTimeout() } } function refreshTimeout () { // If the fastNowTimeout is already set, refresh it. if (fastNowTimeout) { fastNowTimeout.refresh() // fastNowTimeout is not instantiated yet, create a new Timer. } else { clearTimeout(fastNowTimeout) fastNowTimeout = setTimeout(onTick, TICK_MS) // If the Timer has an unref method, call it to allow the process to exit if // there are no other active handles. if (fastNowTimeout.unref) { fastNowTimeout.unref() } } } /** * The `FastTimer` class is a data structure designed to store and manage * timer information. */ class FastTimer { [kFastTimer] = true /** * The state of the timer, which can be one of the following: * - NOT_IN_LIST (-2) * - TO_BE_CLEARED (-1) * - PENDING (0) * - ACTIVE (1) * * @type {-2|-1|0|1} * @private */ _state = NOT_IN_LIST /** * The number of milliseconds to wait before calling the callback. * * @type {number} * @private */ _idleTimeout = -1 /** * The time in milliseconds when the timer was started. This value is used to * calculate when the timer should expire. * * @type {number} * @default -1 * @private */ _idleStart = -1 /** * The function to be executed when the timer expires. * @type {Function} * @private */ _onTimeout /** * The argument to be passed to the callback when the timer expires. * * @type {*} * @private */ _timerArg /** * @constructor * @param {Function} callback A function to be executed after the timer * expires. * @param {number} delay The time, in milliseconds that the timer should wait * before the specified function or code is executed. * @param {*} arg */ constructor (callback, delay, arg) { this._onTimeout = callback this._idleTimeout = delay this._timerArg = arg this.refresh() } /** * Sets the timer's start time to the current time, and reschedules the timer * to call its callback at the previously specified duration adjusted to the * current time. * Using this on a timer that has already called its callback will reactivate * the timer. * * @returns {void} */ refresh () { // In the special case that the timer is not in the list of active timers, // add it back to the array to be processed in the next tick by the onTick // function. if (this._state === NOT_IN_LIST) { fastTimers.push(this) } // If the timer is the only active timer, refresh the fastNowTimeout for // better resolution. if (!fastNowTimeout || fastTimers.length === 1) { refreshTimeout() } // Setting the state to PENDING will cause the timer to be reset in the // next tick by the onTick function. this._state = PENDING } /** * The `clear` method cancels the timer, preventing it from executing. * * @returns {void} * @private */ clear () { // Set the state to TO_BE_CLEARED to mark the timer for removal in the next // tick by the onTick function. this._state = TO_BE_CLEARED // Reset the _idleStart value to -1 to indicate that the timer is no longer // active. this._idleStart = -1 } } /** * This module exports a setTimeout and clearTimeout function that can be * used as a drop-in replacement for the native functions. */ module.exports = { /** * The setTimeout() method sets a timer which executes a function once the * timer expires. * @param {Function} callback A function to be executed after the timer * expires. * @param {number} delay The time, in milliseconds that the timer should * wait before the specified function or code is executed. * @param {*} [arg] An optional argument to be passed to the callback function * when the timer expires. * @returns {NodeJS.Timeout|FastTimer} */ setTimeout (callback, delay, arg) { // If the delay is less than or equal to the RESOLUTION_MS value return a // native Node.js Timer instance. return delay <= RESOLUTION_MS ? setTimeout(callback, delay, arg) : new FastTimer(callback, delay, arg) }, /** * The clearTimeout method cancels an instantiated Timer previously created * by calling setTimeout. * * @param {NodeJS.Timeout|FastTimer} timeout */ clearTimeout (timeout) { // If the timeout is a FastTimer, call its own clear method. if (timeout[kFastTimer]) { /** * @type {FastTimer} */ timeout.clear() // Otherwise it is an instance of a native NodeJS.Timeout, so call the // Node.js native clearTimeout function. } else { clearTimeout(timeout) } }, /** * The setFastTimeout() method sets a fastTimer which executes a function once * the timer expires. * @param {Function} callback A function to be executed after the timer * expires. * @param {number} delay The time, in milliseconds that the timer should * wait before the specified function or code is executed. * @param {*} [arg] An optional argument to be passed to the callback function * when the timer expires. * @returns {FastTimer} */ setFastTimeout (callback, delay, arg) { return new FastTimer(callback, delay, arg) }, /** * The clearTimeout method cancels an instantiated FastTimer previously * created by calling setFastTimeout. * * @param {FastTimer} timeout */ clearFastTimeout (timeout) { timeout.clear() }, /** * The now method returns the value of the internal fast timer clock. * * @returns {number} */ now () { return fastNow }, /** * Trigger the onTick function to process the fastTimers array. * Exported for testing purposes only. * Marking as deprecated to discourage any use outside of testing. * @deprecated * @param {number} [delay=0] The delay in milliseconds to add to the now value. */ tick (delay = 0) { fastNow += delay - RESOLUTION_MS + 1 onTick() onTick() }, /** * Reset FastTimers. * Exported for testing purposes only. * Marking as deprecated to discourage any use outside of testing. * @deprecated */ reset () { fastNow = 0 fastTimers.length = 0 clearTimeout(fastNowTimeout) fastNowTimeout = null }, /** * Exporting for testing purposes only. * Marking as deprecated to discourage any use outside of testing. * @deprecated */ kFastTimer } /***/ }), /***/ 31028: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { kConstruct } = __nccwpck_require__(92562) const { urlEquals, getFieldValues } = __nccwpck_require__(38531) const { kEnumerableProperty, isDisturbed } = __nccwpck_require__(83983) const { webidl } = __nccwpck_require__(44890) const { Response, cloneResponse, fromInnerResponse } = __nccwpck_require__(12583) const { Request, fromInnerRequest } = __nccwpck_require__(20610) const { kState } = __nccwpck_require__(18597) const { fetching } = __nccwpck_require__(85170) const { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = __nccwpck_require__(1310) const assert = __nccwpck_require__(98061) /** * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation * @typedef {Object} CacheBatchOperation * @property {'delete' | 'put'} type * @property {any} request * @property {any} response * @property {import('../../types/cache').CacheQueryOptions} options */ /** * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list * @typedef {[any, any][]} requestResponseList */ class Cache { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list * @type {requestResponseList} */ #relevantRequestResponseList constructor () { if (arguments[0] !== kConstruct) { webidl.illegalConstructor() } webidl.util.markAsUncloneable(this) this.#relevantRequestResponseList = arguments[1] } async match (request, options = {}) { webidl.brandCheck(this, Cache) const prefix = 'Cache.match' webidl.argumentLengthCheck(arguments, 1, prefix) request = webidl.converters.RequestInfo(request, prefix, 'request') options = webidl.converters.CacheQueryOptions(options, prefix, 'options') const p = this.#internalMatchAll(request, options, 1) if (p.length === 0) { return } return p[0] } async matchAll (request = undefined, options = {}) { webidl.brandCheck(this, Cache) const prefix = 'Cache.matchAll' if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request') options = webidl.converters.CacheQueryOptions(options, prefix, 'options') return this.#internalMatchAll(request, options) } async add (request) { webidl.brandCheck(this, Cache) const prefix = 'Cache.add' webidl.argumentLengthCheck(arguments, 1, prefix) request = webidl.converters.RequestInfo(request, prefix, 'request') // 1. const requests = [request] // 2. const responseArrayPromise = this.addAll(requests) // 3. return await responseArrayPromise } async addAll (requests) { webidl.brandCheck(this, Cache) const prefix = 'Cache.addAll' webidl.argumentLengthCheck(arguments, 1, prefix) // 1. const responsePromises = [] // 2. const requestList = [] // 3. for (let request of requests) { if (request === undefined) { throw webidl.errors.conversionFailed({ prefix, argument: 'Argument 1', types: ['undefined is not allowed'] }) } request = webidl.converters.RequestInfo(request) if (typeof request === 'string') { continue } // 3.1 const r = request[kState] // 3.2 if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') { throw webidl.errors.exception({ header: prefix, message: 'Expected http/s scheme when method is not GET.' }) } } // 4. /** @type {ReturnType[]} */ const fetchControllers = [] // 5. for (const request of requests) { // 5.1 const r = new Request(request)[kState] // 5.2 if (!urlIsHttpHttpsScheme(r.url)) { throw webidl.errors.exception({ header: prefix, message: 'Expected http/s scheme.' }) } // 5.4 r.initiator = 'fetch' r.destination = 'subresource' // 5.5 requestList.push(r) // 5.6 const responsePromise = createDeferredPromise() // 5.7 fetchControllers.push(fetching({ request: r, processResponse (response) { // 1. if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) { responsePromise.reject(webidl.errors.exception({ header: 'Cache.addAll', message: 'Received an invalid status code or the request failed.' })) } else if (response.headersList.contains('vary')) { // 2. // 2.1 const fieldValues = getFieldValues(response.headersList.get('vary')) // 2.2 for (const fieldValue of fieldValues) { // 2.2.1 if (fieldValue === '*') { responsePromise.reject(webidl.errors.exception({ header: 'Cache.addAll', message: 'invalid vary field value' })) for (const controller of fetchControllers) { controller.abort() } return } } } }, processResponseEndOfBody (response) { // 1. if (response.aborted) { responsePromise.reject(new DOMException('aborted', 'AbortError')) return } // 2. responsePromise.resolve(response) } })) // 5.8 responsePromises.push(responsePromise.promise) } // 6. const p = Promise.all(responsePromises) // 7. const responses = await p // 7.1 const operations = [] // 7.2 let index = 0 // 7.3 for (const response of responses) { // 7.3.1 /** @type {CacheBatchOperation} */ const operation = { type: 'put', // 7.3.2 request: requestList[index], // 7.3.3 response // 7.3.4 } operations.push(operation) // 7.3.5 index++ // 7.3.6 } // 7.5 const cacheJobPromise = createDeferredPromise() // 7.6.1 let errorData = null // 7.6.2 try { this.#batchCacheOperations(operations) } catch (e) { errorData = e } // 7.6.3 queueMicrotask(() => { // 7.6.3.1 if (errorData === null) { cacheJobPromise.resolve(undefined) } else { // 7.6.3.2 cacheJobPromise.reject(errorData) } }) // 7.7 return cacheJobPromise.promise } async put (request, response) { webidl.brandCheck(this, Cache) const prefix = 'Cache.put' webidl.argumentLengthCheck(arguments, 2, prefix) request = webidl.converters.RequestInfo(request, prefix, 'request') response = webidl.converters.Response(response, prefix, 'response') // 1. let innerRequest = null // 2. if (request instanceof Request) { innerRequest = request[kState] } else { // 3. innerRequest = new Request(request)[kState] } // 4. if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') { throw webidl.errors.exception({ header: prefix, message: 'Expected an http/s scheme when method is not GET' }) } // 5. const innerResponse = response[kState] // 6. if (innerResponse.status === 206) { throw webidl.errors.exception({ header: prefix, message: 'Got 206 status' }) } // 7. if (innerResponse.headersList.contains('vary')) { // 7.1. const fieldValues = getFieldValues(innerResponse.headersList.get('vary')) // 7.2. for (const fieldValue of fieldValues) { // 7.2.1 if (fieldValue === '*') { throw webidl.errors.exception({ header: prefix, message: 'Got * vary field value' }) } } } // 8. if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) { throw webidl.errors.exception({ header: prefix, message: 'Response body is locked or disturbed' }) } // 9. const clonedResponse = cloneResponse(innerResponse) // 10. const bodyReadPromise = createDeferredPromise() // 11. if (innerResponse.body != null) { // 11.1 const stream = innerResponse.body.stream // 11.2 const reader = stream.getReader() // 11.3 readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject) } else { bodyReadPromise.resolve(undefined) } // 12. /** @type {CacheBatchOperation[]} */ const operations = [] // 13. /** @type {CacheBatchOperation} */ const operation = { type: 'put', // 14. request: innerRequest, // 15. response: clonedResponse // 16. } // 17. operations.push(operation) // 19. const bytes = await bodyReadPromise.promise if (clonedResponse.body != null) { clonedResponse.body.source = bytes } // 19.1 const cacheJobPromise = createDeferredPromise() // 19.2.1 let errorData = null // 19.2.2 try { this.#batchCacheOperations(operations) } catch (e) { errorData = e } // 19.2.3 queueMicrotask(() => { // 19.2.3.1 if (errorData === null) { cacheJobPromise.resolve() } else { // 19.2.3.2 cacheJobPromise.reject(errorData) } }) return cacheJobPromise.promise } async delete (request, options = {}) { webidl.brandCheck(this, Cache) const prefix = 'Cache.delete' webidl.argumentLengthCheck(arguments, 1, prefix) request = webidl.converters.RequestInfo(request, prefix, 'request') options = webidl.converters.CacheQueryOptions(options, prefix, 'options') /** * @type {Request} */ let r = null if (request instanceof Request) { r = request[kState] if (r.method !== 'GET' && !options.ignoreMethod) { return false } } else { assert(typeof request === 'string') r = new Request(request)[kState] } /** @type {CacheBatchOperation[]} */ const operations = [] /** @type {CacheBatchOperation} */ const operation = { type: 'delete', request: r, options } operations.push(operation) const cacheJobPromise = createDeferredPromise() let errorData = null let requestResponses try { requestResponses = this.#batchCacheOperations(operations) } catch (e) { errorData = e } queueMicrotask(() => { if (errorData === null) { cacheJobPromise.resolve(!!requestResponses?.length) } else { cacheJobPromise.reject(errorData) } }) return cacheJobPromise.promise } /** * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys * @param {any} request * @param {import('../../types/cache').CacheQueryOptions} options * @returns {Promise} */ async keys (request = undefined, options = {}) { webidl.brandCheck(this, Cache) const prefix = 'Cache.keys' if (request !== undefined) request = webidl.converters.RequestInfo(request, prefix, 'request') options = webidl.converters.CacheQueryOptions(options, prefix, 'options') // 1. let r = null // 2. if (request !== undefined) { // 2.1 if (request instanceof Request) { // 2.1.1 r = request[kState] // 2.1.2 if (r.method !== 'GET' && !options.ignoreMethod) { return [] } } else if (typeof request === 'string') { // 2.2 r = new Request(request)[kState] } } // 4. const promise = createDeferredPromise() // 5. // 5.1 const requests = [] // 5.2 if (request === undefined) { // 5.2.1 for (const requestResponse of this.#relevantRequestResponseList) { // 5.2.1.1 requests.push(requestResponse[0]) } } else { // 5.3 // 5.3.1 const requestResponses = this.#queryCache(r, options) // 5.3.2 for (const requestResponse of requestResponses) { // 5.3.2.1 requests.push(requestResponse[0]) } } // 5.4 queueMicrotask(() => { // 5.4.1 const requestList = [] // 5.4.2 for (const request of requests) { const requestObject = fromInnerRequest( request, new AbortController().signal, 'immutable' ) // 5.4.2.1 requestList.push(requestObject) } // 5.4.3 promise.resolve(Object.freeze(requestList)) }) return promise.promise } /** * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm * @param {CacheBatchOperation[]} operations * @returns {requestResponseList} */ #batchCacheOperations (operations) { // 1. const cache = this.#relevantRequestResponseList // 2. const backupCache = [...cache] // 3. const addedItems = [] // 4.1 const resultList = [] try { // 4.2 for (const operation of operations) { // 4.2.1 if (operation.type !== 'delete' && operation.type !== 'put') { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'operation type does not match "delete" or "put"' }) } // 4.2.2 if (operation.type === 'delete' && operation.response != null) { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'delete operation should not have an associated response' }) } // 4.2.3 if (this.#queryCache(operation.request, operation.options, addedItems).length) { throw new DOMException('???', 'InvalidStateError') } // 4.2.4 let requestResponses // 4.2.5 if (operation.type === 'delete') { // 4.2.5.1 requestResponses = this.#queryCache(operation.request, operation.options) // TODO: the spec is wrong, this is needed to pass WPTs if (requestResponses.length === 0) { return [] } // 4.2.5.2 for (const requestResponse of requestResponses) { const idx = cache.indexOf(requestResponse) assert(idx !== -1) // 4.2.5.2.1 cache.splice(idx, 1) } } else if (operation.type === 'put') { // 4.2.6 // 4.2.6.1 if (operation.response == null) { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'put operation should have an associated response' }) } // 4.2.6.2 const r = operation.request // 4.2.6.3 if (!urlIsHttpHttpsScheme(r.url)) { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'expected http or https scheme' }) } // 4.2.6.4 if (r.method !== 'GET') { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'not get method' }) } // 4.2.6.5 if (operation.options != null) { throw webidl.errors.exception({ header: 'Cache.#batchCacheOperations', message: 'options must not be defined' }) } // 4.2.6.6 requestResponses = this.#queryCache(operation.request) // 4.2.6.7 for (const requestResponse of requestResponses) { const idx = cache.indexOf(requestResponse) assert(idx !== -1) // 4.2.6.7.1 cache.splice(idx, 1) } // 4.2.6.8 cache.push([operation.request, operation.response]) // 4.2.6.10 addedItems.push([operation.request, operation.response]) } // 4.2.7 resultList.push([operation.request, operation.response]) } // 4.3 return resultList } catch (e) { // 5. // 5.1 this.#relevantRequestResponseList.length = 0 // 5.2 this.#relevantRequestResponseList = backupCache // 5.3 throw e } } /** * @see https://w3c.github.io/ServiceWorker/#query-cache * @param {any} requestQuery * @param {import('../../types/cache').CacheQueryOptions} options * @param {requestResponseList} targetStorage * @returns {requestResponseList} */ #queryCache (requestQuery, options, targetStorage) { /** @type {requestResponseList} */ const resultList = [] const storage = targetStorage ?? this.#relevantRequestResponseList for (const requestResponse of storage) { const [cachedRequest, cachedResponse] = requestResponse if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) { resultList.push(requestResponse) } } return resultList } /** * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm * @param {any} requestQuery * @param {any} request * @param {any | null} response * @param {import('../../types/cache').CacheQueryOptions | undefined} options * @returns {boolean} */ #requestMatchesCachedItem (requestQuery, request, response = null, options) { // if (options?.ignoreMethod === false && request.method === 'GET') { // return false // } const queryURL = new URL(requestQuery.url) const cachedURL = new URL(request.url) if (options?.ignoreSearch) { cachedURL.search = '' queryURL.search = '' } if (!urlEquals(queryURL, cachedURL, true)) { return false } if ( response == null || options?.ignoreVary || !response.headersList.contains('vary') ) { return true } const fieldValues = getFieldValues(response.headersList.get('vary')) for (const fieldValue of fieldValues) { if (fieldValue === '*') { return false } const requestValue = request.headersList.get(fieldValue) const queryValue = requestQuery.headersList.get(fieldValue) // If one has the header and the other doesn't, or one has // a different value than the other, return false if (requestValue !== queryValue) { return false } } return true } #internalMatchAll (request, options, maxResponses = Infinity) { // 1. let r = null // 2. if (request !== undefined) { if (request instanceof Request) { // 2.1.1 r = request[kState] // 2.1.2 if (r.method !== 'GET' && !options.ignoreMethod) { return [] } } else if (typeof request === 'string') { // 2.2.1 r = new Request(request)[kState] } } // 5. // 5.1 const responses = [] // 5.2 if (request === undefined) { // 5.2.1 for (const requestResponse of this.#relevantRequestResponseList) { responses.push(requestResponse[1]) } } else { // 5.3 // 5.3.1 const requestResponses = this.#queryCache(r, options) // 5.3.2 for (const requestResponse of requestResponses) { responses.push(requestResponse[1]) } } // 5.4 // We don't implement CORs so we don't need to loop over the responses, yay! // 5.5.1 const responseList = [] // 5.5.2 for (const response of responses) { // 5.5.2.1 const responseObject = fromInnerResponse(response, 'immutable') responseList.push(responseObject.clone()) if (responseList.length >= maxResponses) { break } } // 6. return Object.freeze(responseList) } } Object.defineProperties(Cache.prototype, { [Symbol.toStringTag]: { value: 'Cache', configurable: true }, match: kEnumerableProperty, matchAll: kEnumerableProperty, add: kEnumerableProperty, addAll: kEnumerableProperty, put: kEnumerableProperty, delete: kEnumerableProperty, keys: kEnumerableProperty }) const cacheQueryOptionConverters = [ { key: 'ignoreSearch', converter: webidl.converters.boolean, defaultValue: () => false }, { key: 'ignoreMethod', converter: webidl.converters.boolean, defaultValue: () => false }, { key: 'ignoreVary', converter: webidl.converters.boolean, defaultValue: () => false } ] webidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters) webidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([ ...cacheQueryOptionConverters, { key: 'cacheName', converter: webidl.converters.DOMString } ]) webidl.converters.Response = webidl.interfaceConverter(Response) webidl.converters['sequence'] = webidl.sequenceConverter( webidl.converters.RequestInfo ) module.exports = { Cache } /***/ }), /***/ 76847: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { kConstruct } = __nccwpck_require__(92562) const { Cache } = __nccwpck_require__(31028) const { webidl } = __nccwpck_require__(44890) const { kEnumerableProperty } = __nccwpck_require__(83983) class CacheStorage { /** * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map * @type {Map} */ async has (cacheName) { webidl.brandCheck(this, CacheStorage) const prefix = 'CacheStorage.has' webidl.argumentLengthCheck(arguments, 1, prefix) cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName') // 2.1.1 // 2.2 return this.#caches.has(cacheName) } /** * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open * @param {string} cacheName * @returns {Promise} */ async open (cacheName) { webidl.brandCheck(this, CacheStorage) const prefix = 'CacheStorage.open' webidl.argumentLengthCheck(arguments, 1, prefix) cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName') // 2.1 if (this.#caches.has(cacheName)) { // await caches.open('v1') !== await caches.open('v1') // 2.1.1 const cache = this.#caches.get(cacheName) // 2.1.1.1 return new Cache(kConstruct, cache) } // 2.2 const cache = [] // 2.3 this.#caches.set(cacheName, cache) // 2.4 return new Cache(kConstruct, cache) } /** * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete * @param {string} cacheName * @returns {Promise} */ async delete (cacheName) { webidl.brandCheck(this, CacheStorage) const prefix = 'CacheStorage.delete' webidl.argumentLengthCheck(arguments, 1, prefix) cacheName = webidl.converters.DOMString(cacheName, prefix, 'cacheName') return this.#caches.delete(cacheName) } /** * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys * @returns {Promise} */ async keys () { webidl.brandCheck(this, CacheStorage) // 2.1 const keys = this.#caches.keys() // 2.2 return [...keys] } } Object.defineProperties(CacheStorage.prototype, { [Symbol.toStringTag]: { value: 'CacheStorage', configurable: true }, match: kEnumerableProperty, has: kEnumerableProperty, open: kEnumerableProperty, delete: kEnumerableProperty, keys: kEnumerableProperty }) module.exports = { CacheStorage } /***/ }), /***/ 92562: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; module.exports = { kConstruct: (__nccwpck_require__(72785).kConstruct) } /***/ }), /***/ 38531: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const assert = __nccwpck_require__(98061) const { URLSerializer } = __nccwpck_require__(17704) const { isValidHeaderName } = __nccwpck_require__(1310) /** * @see https://url.spec.whatwg.org/#concept-url-equals * @param {URL} A * @param {URL} B * @param {boolean | undefined} excludeFragment * @returns {boolean} */ function urlEquals (A, B, excludeFragment = false) { const serializedA = URLSerializer(A, excludeFragment) const serializedB = URLSerializer(B, excludeFragment) return serializedA === serializedB } /** * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262 * @param {string} header */ function getFieldValues (header) { assert(header !== null) const values = [] for (let value of header.split(',')) { value = value.trim() if (isValidHeaderName(value)) { values.push(value) } } return values } module.exports = { urlEquals, getFieldValues } /***/ }), /***/ 7762: /***/ ((module) => { "use strict"; // https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size const maxAttributeValueSize = 1024 // https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size const maxNameValuePairSize = 4096 module.exports = { maxAttributeValueSize, maxNameValuePairSize } /***/ }), /***/ 42193: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { parseSetCookie } = __nccwpck_require__(13903) const { stringify } = __nccwpck_require__(54806) const { webidl } = __nccwpck_require__(44890) const { Headers } = __nccwpck_require__(52991) /** * @typedef {Object} Cookie * @property {string} name * @property {string} value * @property {Date|number|undefined} expires * @property {number|undefined} maxAge * @property {string|undefined} domain * @property {string|undefined} path * @property {boolean|undefined} secure * @property {boolean|undefined} httpOnly * @property {'Strict'|'Lax'|'None'} sameSite * @property {string[]} unparsed */ /** * @param {Headers} headers * @returns {Record} */ function getCookies (headers) { webidl.argumentLengthCheck(arguments, 1, 'getCookies') webidl.brandCheck(headers, Headers, { strict: false }) const cookie = headers.get('cookie') const out = {} if (!cookie) { return out } for (const piece of cookie.split(';')) { const [name, ...value] = piece.split('=') out[name.trim()] = value.join('=') } return out } /** * @param {Headers} headers * @param {string} name * @param {{ path?: string, domain?: string }|undefined} attributes * @returns {void} */ function deleteCookie (headers, name, attributes) { webidl.brandCheck(headers, Headers, { strict: false }) const prefix = 'deleteCookie' webidl.argumentLengthCheck(arguments, 2, prefix) name = webidl.converters.DOMString(name, prefix, 'name') attributes = webidl.converters.DeleteCookieAttributes(attributes) // Matches behavior of // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278 setCookie(headers, { name, value: '', expires: new Date(0), ...attributes }) } /** * @param {Headers} headers * @returns {Cookie[]} */ function getSetCookies (headers) { webidl.argumentLengthCheck(arguments, 1, 'getSetCookies') webidl.brandCheck(headers, Headers, { strict: false }) const cookies = headers.getSetCookie() if (!cookies) { return [] } return cookies.map((pair) => parseSetCookie(pair)) } /** * @param {Headers} headers * @param {Cookie} cookie * @returns {void} */ function setCookie (headers, cookie) { webidl.argumentLengthCheck(arguments, 2, 'setCookie') webidl.brandCheck(headers, Headers, { strict: false }) cookie = webidl.converters.Cookie(cookie) const str = stringify(cookie) if (str) { headers.append('Set-Cookie', str) } } webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ { converter: webidl.nullableConverter(webidl.converters.DOMString), key: 'path', defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: 'domain', defaultValue: () => null } ]) webidl.converters.Cookie = webidl.dictionaryConverter([ { converter: webidl.converters.DOMString, key: 'name' }, { converter: webidl.converters.DOMString, key: 'value' }, { converter: webidl.nullableConverter((value) => { if (typeof value === 'number') { return webidl.converters['unsigned long long'](value) } return new Date(value) }), key: 'expires', defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters['long long']), key: 'maxAge', defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: 'domain', defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters.DOMString), key: 'path', defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters.boolean), key: 'secure', defaultValue: () => null }, { converter: webidl.nullableConverter(webidl.converters.boolean), key: 'httpOnly', defaultValue: () => null }, { converter: webidl.converters.USVString, key: 'sameSite', allowedValues: ['Strict', 'Lax', 'None'] }, { converter: webidl.sequenceConverter(webidl.converters.DOMString), key: 'unparsed', defaultValue: () => new Array(0) } ]) module.exports = { getCookies, deleteCookie, getSetCookies, setCookie } /***/ }), /***/ 13903: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { "use strict"; const { maxNameValuePairSize, maxAttributeValueSize } = __nccwpck_require__(7762) const { isCTLExcludingHtab } = __nccwpck_require__(54806) const { collectASequenceOfCodePointsFast } = __nccwpck_require__(17704) const assert = __nccwpck_require__(98061) /** * @description Parses the field-value attributes of a set-cookie header string. * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 * @param {string} header * @returns if the header is invalid, null will be returned */ function parseSetCookie (header) { // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F // character (CTL characters excluding HTAB): Abort these steps and // ignore the set-cookie-string entirely. if (isCTLExcludingHtab(header)) { return null } let nameValuePair = '' let unparsedAttributes = '' let name = '' let value = '' // 2. If the set-cookie-string contains a %x3B (";") character: if (header.includes(';')) { // 1. The name-value-pair string consists of the characters up to, // but not including, the first %x3B (";"), and the unparsed- // attributes consist of the remainder of the set-cookie-string // (including the %x3B (";") in question). const position = { position: 0 } nameValuePair = collectASequenceOfCodePointsFast(';', header, position) unparsedAttributes = header.slice(position.position) } else { // Otherwise: // 1. The name-value-pair string consists of all the characters // contained in the set-cookie-string, and the unparsed- // attributes is the empty string. nameValuePair = header } // 3. If the name-value-pair string lacks a %x3D ("=") character, then // the name string is empty, and the value string is the value of // name-value-pair. if (!nameValuePair.includes('=')) { value = nameValuePair } else { // Otherwise, the name string consists of the characters up to, but // not including, the first %x3D ("=") character, and the (possibly // empty) value string consists of the characters after the first // %x3D ("=") character. const position = { position: 0 } name = collectASequenceOfCodePointsFast( '=', nameValuePair, position ) value = nameValuePair.slice(position.position + 1) } // 4. Remove any leading or trailing WSP characters from the name // string and the value string. name = name.trim() value = value.trim() // 5. If the sum of the lengths of the name string and the value string // is more than 4096 octets, abort these steps and ignore the set- // cookie-string entirely. if (name.length + value.length > maxNameValuePairSize) { return null } // 6. The cookie-name is the name string, and the cookie-value is the // value string. return { name, value, ...parseUnparsedAttributes(unparsedAttributes) } } /** * Parses the remaining attributes of a set-cookie header * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4 * @param {string} unparsedAttributes * @param {[Object.]={}} cookieAttributeList */ function parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) { // 1. If the unparsed-attributes string is empty, skip the rest of // these steps. if (unparsedAttributes.length === 0) { return cookieAttributeList } // 2. Discard the first character of the unparsed-attributes (which // will be a %x3B (";") character). assert(unparsedAttributes[0] === ';') unparsedAttributes = unparsedAttributes.slice(1) let cookieAv = '' // 3. If the remaining unparsed-attributes contains a %x3B (";") // character: if (unparsedAttributes.includes(';')) { // 1. Consume the characters of the unparsed-attributes up to, but // not including, the first %x3B (";") character. cookieAv = collectASequenceOfCodePointsFast( ';', unparsedAttributes, { position: 0 } ) unparsedAttributes = unparsedAttributes.slice(cookieAv.length) } else { // Otherwise: // 1. Consume the remainder of the unparsed-attributes. cookieAv = unparsedAttributes unparsedAttributes = '' } // Let the cookie-av string be the characters consumed in this step. let attributeName = '' let attributeValue = '' // 4. If the cookie-av string contains a %x3D ("=") character: if (cookieAv.includes('=')) { // 1. The (possibly empty) attribute-name string consists of the // characters up to, but not including, the first %x3D ("=") // character, and the (possibly empty) attribute-value string // consists of the characters after the first %x3D ("=") // character. const position = { position: 0 } attributeName = collectASequenceOfCodePointsFast( '=', cookieAv, position ) attributeValue = cookieAv.slice(position.position + 1) } else { // Otherwise: // 1. The attribute-name string consists of the entire cookie-av // string, and the attribute-value string is empty. attributeName = cookieAv } // 5. Remove any leading or trailing WSP characters from the attribute- // name string and the attribute-value string. attributeName = attributeName.trim() attributeValue = attributeValue.trim() // 6. If the attribute-value is longer than 1024 octets, ignore the // cookie-av string and return to Step 1 of this algorithm. if (attributeValue.length > maxAttributeValueSize) { return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) } // 7. Process the attribute-name and attribute-value according to the // requirements in the following subsections. (Notice that // attributes with unrecognized attribute-names are ignored.) const attributeNameLowercase = attributeName.toLowerCase() // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1 // If the attribute-name case-insensitively matches the string // "Expires", the user agent MUST process the cookie-av as follows. if (attributeNameLowercase === 'expires') { // 1. Let the expiry-time be the result of parsing the attribute-value // as cookie-date (see Section 5.1.1). const expiryTime = new Date(attributeValue) // 2. If the attribute-value failed to parse as a cookie date, ignore // the cookie-av. cookieAttributeList.expires = expiryTime } else if (attributeNameLowercase === 'max-age') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2 // If the attribute-name case-insensitively matches the string "Max- // Age", the user agent MUST process the cookie-av as follows. // 1. If the first character of the attribute-value is not a DIGIT or a // "-" character, ignore the cookie-av. const charCode = attributeValue.charCodeAt(0) if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') { return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) } // 2. If the remainder of attribute-value contains a non-DIGIT // character, ignore the cookie-av. if (!/^\d+$/.test(attributeValue)) { return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) } // 3. Let delta-seconds be the attribute-value converted to an integer. const deltaSeconds = Number(attributeValue) // 4. Let cookie-age-limit be the maximum age of the cookie (which // SHOULD be 400 days or less, see Section 4.1.2.2). // 5. Set delta-seconds to the smaller of its present value and cookie- // age-limit. // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs) // 6. If delta-seconds is less than or equal to zero (0), let expiry- // time be the earliest representable date and time. Otherwise, let // the expiry-time be the current date and time plus delta-seconds // seconds. // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds // 7. Append an attribute to the cookie-attribute-list with an // attribute-name of Max-Age and an attribute-value of expiry-time. cookieAttributeList.maxAge = deltaSeconds } else if (attributeNameLowercase === 'domain') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3 // If the attribute-name case-insensitively matches the string "Domain", // the user agent MUST process the cookie-av as follows. // 1. Let cookie-domain be the attribute-value. let cookieDomain = attributeValue // 2. If cookie-domain starts with %x2E ("."), let cookie-domain be // cookie-domain without its leading %x2E ("."). if (cookieDomain[0] === '.') { cookieDomain = cookieDomain.slice(1) } // 3. Convert the cookie-domain to lower case. cookieDomain = cookieDomain.toLowerCase() // 4. Append an attribute to the cookie-attribute-list with an // attribute-name of Domain and an attribute-value of cookie-domain. cookieAttributeList.domain = cookieDomain } else if (attributeNameLowercase === 'path') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4 // If the attribute-name case-insensitively matches the string "Path", // the user agent MUST process the cookie-av as follows. // 1. If the attribute-value is empty or if the first character of the // attribute-value is not %x2F ("/"): let cookiePath = '' if (attributeValue.length === 0 || attributeValue[0] !== '/') { // 1. Let cookie-path be the default-path. cookiePath = '/' } else { // Otherwise: // 1. Let cookie-path be the attribute-value. cookiePath = attributeValue } // 2. Append an attribute to the cookie-attribute-list with an // attribute-name of Path and an attribute-value of cookie-path. cookieAttributeList.path = cookiePath } else if (attributeNameLowercase === 'secure') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5 // If the attribute-name case-insensitively matches the string "Secure", // the user agent MUST append an attribute to the cookie-attribute-list // with an attribute-name of Secure and an empty attribute-value. cookieAttributeList.secure = true } else if (attributeNameLowercase === 'httponly') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6 // If the attribute-name case-insensitively matches the string // "HttpOnly", the user agent MUST append an attribute to the cookie- // attribute-list with an attribute-name of HttpOnly and an empty // attribute-value. cookieAttributeList.httpOnly = true } else if (attributeNameLowercase === 'samesite') { // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7 // If the attribute-name case-insensitively matches the string // "SameSite", the user agent MUST process the cookie-av as follows: const attributeValueLowercase = attributeValue.toLowerCase() // 1. If cookie-av's attribute-value is a case-insensitive match for // "None", append an attribute to the cookie-attribute-list with an // attribute-name of "SameSite" and an attribute-value of "None". if (attributeValueLowercase === 'none') { cookieAttributeList.sameSite = 'None' } else if (attributeValueLowercase === 'strict') { // 2. If cookie-av's attribute-value is a case-insensitive match for // "Strict", append an attribute to the cookie-attribute-list with // an attribute-name of "SameSite" and an attribute-value of // "Strict". cookieAttributeList.sameSite = 'Strict' } else if (attributeValueLowercase === 'lax') { // 3. If cookie-av's attribute-value is a case-insensitive match for // "Lax", append an attribute to the cookie-attribute-list with an // attribute-name of "SameSite" and an attribute-value of "Lax". cookieAttributeList.sameSite = 'Lax' } } else { cookieAttributeList.unparsed ??= [] cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`) } // 8. Return to Step 1 of this algorithm. return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList) } module.exports = { parseSetCookie, parseUnparsedAttributes } /***/ }), /***/ 54806: /***/ ((module) => { "use strict"; /** * @param {string} value * @returns {boolean} */ function isCTLExcludingHtab (value) { for (let i = 0; i < value.length; ++i) { const code = value.charCodeAt(i) if ( (code >= 0x00 && code <= 0x08) || (code >= 0x0A && code <= 0x1F) || code === 0x7F ) { return true } } return false } /** CHAR = token = 1* separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT * @param {string} name */ function validateCookieName (name) { for (let i = 0; i < name.length; ++i) { const code = name.charCodeAt(i) if ( code < 0x21 || // exclude CTLs (0-31), SP and HT code > 0x7E || // exclude non-ascii and DEL code === 0x22 || // " code === 0x28 || // ( code === 0x29 || // ) code === 0x3C || // < code === 0x3E || // > code === 0x40 || // @ code === 0x2C || // , code === 0x3B || // ; code === 0x3A || // : code === 0x5C || // \ code === 0x2F || // / code === 0x5B || // [ code === 0x5D || // ] code === 0x3F || // ? code === 0x3D || // = code === 0x7B || // { code === 0x7D // } ) { throw new Error('Invalid cookie name') } } } /** cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE ) cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E ; US-ASCII characters excluding CTLs, ; whitespace DQUOTE, comma, semicolon, ; and backslash * @param {string} value */ function validateCookieValue (value) { let len = value.length let i = 0 // if the value is wrapped in DQUOTE if (value[0] === '"') { if (len === 1 || value[len - 1] !== '"') { throw new Error('Invalid cookie value') } --len ++i } while (i < len) { const code = value.charCodeAt(i++) if ( code < 0x21 || // exclude CTLs (0-31) code > 0x7E || // non-ascii and DEL (127) code === 0x22 || // " code === 0x2C || // , code === 0x3B || // ; code === 0x5C // \ ) { throw new Error('Invalid cookie value') } } } /** * path-value = * @param {string} path */ function validateCookiePath (path) { for (let i = 0; i < path.length; ++i) { const code = path.charCodeAt(i) if ( code < 0x20 || // exclude CTLs (0-31) code > 0x7E || // exclude DEL and non-ascii code === 0x3B // ; ) { throw new Error('Invalid cookie path') } } } /** * ::= | * * ::= any one of the 52 alphabetic characters A through Z in * upper case and a through z in lower case * * ::= any one of the ten digits 0 through 9r * * @see https://www.rfc-editor.org/rfc/rfc1034#section-3.5 * @param {number} code */ function isLetterOrDigit (code) { return ( (code >= 0x30 && code <= 0x39) || // 0-9 (code >= 0x41 && code <= 0x5A) || // A-Z (code >= 0x61 && code <= 0x7A) // a-z ) } /** * Validates a cookie domain against the "preferred name syntax". * * ::= | " " * ::=