start-slicemachine 0.12.57-beta.1 → 0.12.57-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/StartSliceMachineProcess.cjs.map +1 -1
- package/dist/StartSliceMachineProcess.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/api.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/api.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/baseclient.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/baseclient.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/eventProcessors.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/hub.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integration.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integration.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/functiontostring.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/functiontostring.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/inboundfilters.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/inboundfilters.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/requestdata.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/integrations/requestdata.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/instance.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/instance.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/metric-summary.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/metric-summary.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/utils.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/utils.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/session.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/errors.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/errors.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/hubextensions.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/hubextensions.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/sampling.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/sampling.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/span.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/span.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/transaction.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/transaction.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/transports/base.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/transports/base.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/prepareEvent.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/sdkMetadata.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/utils/sdkMetadata.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/aggregate-errors.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/aggregate-errors.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/baggage.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/baggage.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/browser.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/browser.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/cookie.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/cookie.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/dsn.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/dsn.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/envelope.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/envelope.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/eventbuilder.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/eventbuilder.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/_handlers.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/instrument/_handlers.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/is.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/logger.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/misc.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/node-stack-trace.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/node-stack-trace.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/normalize.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/normalize.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/object.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/path.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/path.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/ratelimit.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/ratelimit.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/requestdata.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/requestdata.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/stacktrace.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/stacktrace.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/string.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/string.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/syncpromise.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/tracing.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/tracing.js.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/url.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/_node_modules/@sentry/utils/esm/url.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/context.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/context.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/contextlines.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/contextlines.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/http.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/http.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/common.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/common.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/local-variables/local-variables-sync.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/modules.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/modules.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/spotlight.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/spotlight.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/undici/index.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/undici/index.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/utils/http.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/integrations/utils/http.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/module.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/module.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/proxy/index.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/proxy/index.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/proxy/parse-proxy-response.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/proxy/parse-proxy-response.js.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/transports/http.cjs.map +1 -1
- package/dist/_node_modules/@sentry/node/esm/transports/http.js.map +1 -1
- package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +1 -1
- package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +1 -1
- package/dist/_node_modules/fetch-blob/file.cjs.map +1 -1
- package/dist/_node_modules/fetch-blob/file.js.map +1 -1
- package/dist/_node_modules/fetch-blob/index.cjs.map +1 -1
- package/dist/_node_modules/fetch-blob/index.js.map +1 -1
- package/dist/_node_modules/fetch-blob/streams.cjs.map +1 -1
- package/dist/_node_modules/fetch-blob/streams.js.map +1 -1
- package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +1 -1
- package/dist/_node_modules/formdata-polyfill/esm.min.js.map +1 -1
- package/dist/_node_modules/node-domexception/index.cjs.map +1 -1
- package/dist/_node_modules/node-domexception/index.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/body.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/body.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/headers.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/headers.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/index.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/index.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/request.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/request.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/is.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +1 -1
- package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +1 -1
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +1 -1
- package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -1
- package/dist/_node_modules/yallist/yallist.cjs.map +1 -1
- package/dist/_node_modules/yallist/yallist.js.map +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/legacyMigrations/detectFramework.cjs.map +1 -1
- package/dist/legacyMigrations/detectFramework.js.map +1 -1
- package/dist/legacyMigrations/migrateAssets.cjs.map +1 -1
- package/dist/legacyMigrations/migrateAssets.js.map +1 -1
- package/dist/legacyMigrations/migrateSMJSON.cjs.map +1 -1
- package/dist/legacyMigrations/migrateSMJSON.js.map +1 -1
- package/dist/lib/checkIsSentryEnabled.cjs.map +1 -1
- package/dist/lib/checkIsSentryEnabled.js.map +1 -1
- package/dist/lib/createSliceMachineExpressApp.cjs.map +1 -1
- package/dist/lib/createSliceMachineExpressApp.js.map +1 -1
- package/dist/lib/locateFileUpward.cjs.map +1 -1
- package/dist/lib/locateFileUpward.js.map +1 -1
- package/dist/lib/safelyExecute.cjs.map +1 -1
- package/dist/lib/safelyExecute.js.map +1 -1
- package/dist/lib/sentryFrontendTunnel.cjs.map +1 -1
- package/dist/lib/sentryFrontendTunnel.js.map +1 -1
- package/dist/lib/setupSentry.cjs.map +1 -1
- package/dist/lib/setupSentry.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/comparator.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/comparator.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/range.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/range.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/semver.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/classes/semver.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/cmp.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/cmp.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/coerce.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/coerce.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/inc.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/inc.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/parse.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/parse.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/satisfies.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/functions/satisfies.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/internal/re.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/internal/re.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/max-satisfying.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/max-satisfying.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-satisfying.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-satisfying.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-version.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/min-version.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/simplify.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/simplify.js.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/valid.cjs.map +1 -1
- package/dist/packages/start-slicemachine/_node_modules/semver/ranges/valid.js.map +1 -1
- package/dist/packages/start-slicemachine/package.json.cjs +1 -1
- package/dist/packages/start-slicemachine/package.json.js +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestdata.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/integrations/requestdata.js"],"sourcesContent":["import { extractPathForTransaction, addRequestDataToEvent } from '@sentry/utils';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration.js';\nimport { spanToJSON } from '../utils/spanUtils.js';\n\nconst DEFAULT_OPTIONS = {\n include: {\n cookies: true,\n data: true,\n headers: true,\n ip: false,\n query_string: true,\n url: true,\n user: {\n id: true,\n username: true,\n email: true,\n },\n },\n transactionNamingScheme: 'methodPath',\n};\n\nconst INTEGRATION_NAME = 'RequestData';\n\nconst _requestDataIntegration = ((options = {}) => {\n const _addRequestData = addRequestDataToEvent;\n const _options = {\n ...DEFAULT_OPTIONS,\n ...options,\n include: {\n // @ts-expect-error It's mad because `method` isn't a known `include` key. (It's only here and not set by default in\n // `addRequestDataToEvent` for legacy reasons. TODO (v8): Change that.)\n method: true,\n ...DEFAULT_OPTIONS.include,\n ...options.include,\n user:\n options.include && typeof options.include.user === 'boolean'\n ? options.include.user\n : {\n ...DEFAULT_OPTIONS.include.user,\n // Unclear why TS still thinks `options.include.user` could be a boolean at this point\n ...((options.include || {}).user ),\n },\n },\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event, _hint, client) {\n // Note: In the long run, most of the logic here should probably move into the request data utility functions. For\n // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed.\n // (TL;DR: Those functions touch many parts of the repo in many different ways, and need to be clened up. Once\n // that's happened, it will be easier to add this logic in without worrying about unexpected side effects.)\n const { transactionNamingScheme } = _options;\n\n const { sdkProcessingMetadata = {} } = event;\n const req = sdkProcessingMetadata.request;\n\n if (!req) {\n return event;\n }\n\n // The Express request handler takes a similar `include` option to that which can be passed to this integration.\n // If passed there, we store it in `sdkProcessingMetadata`. TODO(v8): Force express and GCP people to use this\n // integration, so that all of this passing and conversion isn't necessary\n const addRequestDataOptions =\n sdkProcessingMetadata.requestDataOptionsFromExpressHandler ||\n sdkProcessingMetadata.requestDataOptionsFromGCPWrapper ||\n convertReqDataIntegrationOptsToAddReqDataOpts(_options);\n\n const processedEvent = _addRequestData(event, req, addRequestDataOptions);\n\n // Transaction events already have the right `transaction` value\n if (event.type === 'transaction' || transactionNamingScheme === 'handler') {\n return processedEvent;\n }\n\n // In all other cases, use the request's associated transaction (if any) to overwrite the event's `transaction`\n // value with a high-quality one\n const reqWithTransaction = req ;\n const transaction = reqWithTransaction._sentryTransaction;\n if (transaction) {\n const name = spanToJSON(transaction).description || '';\n\n // TODO (v8): Remove the nextjs check and just base it on `transactionNamingScheme` for all SDKs. (We have to\n // keep it the way it is for the moment, because changing the names of transactions in Sentry has the potential\n // to break things like alert rules.)\n const shouldIncludeMethodInTransactionName =\n getSDKName(client) === 'sentry.javascript.nextjs'\n ? name.startsWith('/api')\n : transactionNamingScheme !== 'path';\n\n const [transactionValue] = extractPathForTransaction(req, {\n path: true,\n method: shouldIncludeMethodInTransactionName,\n customRoute: name,\n });\n\n processedEvent.transaction = transactionValue;\n }\n\n return processedEvent;\n },\n };\n}) ;\n\nconst requestDataIntegration = defineIntegration(_requestDataIntegration);\n\n/**\n * Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/integrations`\n * so it can be used in cross-platform SDKs like `@sentry/nextjs`.\n * @deprecated Use `requestDataIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst RequestData = convertIntegrationFnToClass(INTEGRATION_NAME, requestDataIntegration)\n\n;\n\n/** Convert this integration's options to match what `addRequestDataToEvent` expects */\n/** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */\nfunction convertReqDataIntegrationOptsToAddReqDataOpts(\n integrationOptions,\n) {\n const {\n transactionNamingScheme,\n include: { ip, user, ...requestOptions },\n } = integrationOptions;\n\n const requestIncludeKeys = [];\n for (const [key, value] of Object.entries(requestOptions)) {\n if (value) {\n requestIncludeKeys.push(key);\n }\n }\n\n let addReqDataUserOpt;\n if (user === undefined) {\n addReqDataUserOpt = true;\n } else if (typeof user === 'boolean') {\n addReqDataUserOpt = user;\n } else {\n const userIncludeKeys = [];\n for (const [key, value] of Object.entries(user)) {\n if (value) {\n userIncludeKeys.push(key);\n }\n }\n addReqDataUserOpt = userIncludeKeys;\n }\n\n return {\n include: {\n ip,\n user: addReqDataUserOpt,\n request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined,\n transaction: transactionNamingScheme,\n },\n };\n}\n\nfunction getSDKName(client) {\n try {\n // For a long chain like this, it's fewer bytes to combine a try-catch with assuming everything is there than to\n // write out a long chain of `a && a.b && a.b.c && ...`\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return client.getOptions()._metadata.sdk.name;\n } catch (err) {\n // In theory we should never get here\n return undefined;\n }\n}\n\nexport { RequestData, requestDataIntegration };\n//# sourceMappingURL=requestdata.js.map\n"],"names":["addRequestDataToEvent","spanToJSON","extractPathForTransaction","defineIntegration","convertIntegrationFnToClass"],"mappings":";;;;;AAIA,MAAM,kBAAkB;AAAA,EACtB,SAAS;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,IACN,SA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tB,4BAA4B;AAElC,cAAM,CAAC,gBAAgB,IAAIC,YAAyB,0BAAC,KAAK;AAAA,UACxD,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,aAAa;AAAA,QACvB,CAAS;AAED,uBAAe,cAAc;AAAA,MAC9B;AAED,aAAO;AAAA,IACR;AAAA,EACL;AACA;AAEK,MAAC,yBAAyBC,YAAiB,kBAAC,uBAAuB;AAQpDC,YAAAA,4BAA4B,kBAAkB,sBAAsB;AAMxF,SAAS,8CACP,oBACA;AACA,QAAM;AAAA,IACJ;AAAA,IACA,SAAS,EAAE,IAAI,MAAM,GAAG,eAAgB;AAAA,EACzC,IAAG;AAEJ,QAAM,qBAAqB,CAAA;AAC3B,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,cAAc,GAAG;AACzD,QAAI,OAAO;AACT,yBAAmB,KAAK,GAAG;AAAA,IAC5B;AAAA,EACF;AAED,MAAI;AACJ,MAAI,SAAS,QAAW;AACtB,wBAAoB;AAAA,EACxB,WAAa,OAAO,SAAS,WAAW;AACpC,wBAAoB;AAAA,EACxB,OAAS;AACL,UAAM,kBAAkB,CAAA;AACxB,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,GAAG;AAC/C,UAAI,OAAO;AACT,wBAAgB,KAAK,GAAG;AAAA,MACzB;AAAA,IACF;AACD,wBAAoB;AAAA,EACrB;AAED,SAAO;AAAA,IACL,SAAS;AAAA,MACP;AAAA,MACA,MAAM;AAAA,MACN,SAAS,mBAAmB,WAAW,IAAI,qBAAqB;AAAA,MAChE,aAAa;AAAA,IACd;AAAA,EACL;AACA;AAEA,SAAS,WAAW,QAAQ;AAC1B,MAAI;AAIF,WAAO,OAAO,WAAU,EAAG,UAAU,IAAI;AAAA,EAC1C,SAAQ,
|
|
1
|
+
{"version":3,"file":"requestdata.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/integrations/requestdata.js"],"sourcesContent":["import { extractPathForTransaction, addRequestDataToEvent } from '@sentry/utils';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration.js';\nimport { spanToJSON } from '../utils/spanUtils.js';\n\nconst DEFAULT_OPTIONS = {\n include: {\n cookies: true,\n data: true,\n headers: true,\n ip: false,\n query_string: true,\n url: true,\n user: {\n id: true,\n username: true,\n email: true,\n },\n },\n transactionNamingScheme: 'methodPath',\n};\n\nconst INTEGRATION_NAME = 'RequestData';\n\nconst _requestDataIntegration = ((options = {}) => {\n const _addRequestData = addRequestDataToEvent;\n const _options = {\n ...DEFAULT_OPTIONS,\n ...options,\n include: {\n // @ts-expect-error It's mad because `method` isn't a known `include` key. (It's only here and not set by default in\n // `addRequestDataToEvent` for legacy reasons. TODO (v8): Change that.)\n method: true,\n ...DEFAULT_OPTIONS.include,\n ...options.include,\n user:\n options.include && typeof options.include.user === 'boolean'\n ? options.include.user\n : {\n ...DEFAULT_OPTIONS.include.user,\n // Unclear why TS still thinks `options.include.user` could be a boolean at this point\n ...((options.include || {}).user ),\n },\n },\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event, _hint, client) {\n // Note: In the long run, most of the logic here should probably move into the request data utility functions. For\n // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed.\n // (TL;DR: Those functions touch many parts of the repo in many different ways, and need to be clened up. Once\n // that's happened, it will be easier to add this logic in without worrying about unexpected side effects.)\n const { transactionNamingScheme } = _options;\n\n const { sdkProcessingMetadata = {} } = event;\n const req = sdkProcessingMetadata.request;\n\n if (!req) {\n return event;\n }\n\n // The Express request handler takes a similar `include` option to that which can be passed to this integration.\n // If passed there, we store it in `sdkProcessingMetadata`. TODO(v8): Force express and GCP people to use this\n // integration, so that all of this passing and conversion isn't necessary\n const addRequestDataOptions =\n sdkProcessingMetadata.requestDataOptionsFromExpressHandler ||\n sdkProcessingMetadata.requestDataOptionsFromGCPWrapper ||\n convertReqDataIntegrationOptsToAddReqDataOpts(_options);\n\n const processedEvent = _addRequestData(event, req, addRequestDataOptions);\n\n // Transaction events already have the right `transaction` value\n if (event.type === 'transaction' || transactionNamingScheme === 'handler') {\n return processedEvent;\n }\n\n // In all other cases, use the request's associated transaction (if any) to overwrite the event's `transaction`\n // value with a high-quality one\n const reqWithTransaction = req ;\n const transaction = reqWithTransaction._sentryTransaction;\n if (transaction) {\n const name = spanToJSON(transaction).description || '';\n\n // TODO (v8): Remove the nextjs check and just base it on `transactionNamingScheme` for all SDKs. (We have to\n // keep it the way it is for the moment, because changing the names of transactions in Sentry has the potential\n // to break things like alert rules.)\n const shouldIncludeMethodInTransactionName =\n getSDKName(client) === 'sentry.javascript.nextjs'\n ? name.startsWith('/api')\n : transactionNamingScheme !== 'path';\n\n const [transactionValue] = extractPathForTransaction(req, {\n path: true,\n method: shouldIncludeMethodInTransactionName,\n customRoute: name,\n });\n\n processedEvent.transaction = transactionValue;\n }\n\n return processedEvent;\n },\n };\n}) ;\n\nconst requestDataIntegration = defineIntegration(_requestDataIntegration);\n\n/**\n * Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/integrations`\n * so it can be used in cross-platform SDKs like `@sentry/nextjs`.\n * @deprecated Use `requestDataIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst RequestData = convertIntegrationFnToClass(INTEGRATION_NAME, requestDataIntegration)\n\n;\n\n/** Convert this integration's options to match what `addRequestDataToEvent` expects */\n/** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */\nfunction convertReqDataIntegrationOptsToAddReqDataOpts(\n integrationOptions,\n) {\n const {\n transactionNamingScheme,\n include: { ip, user, ...requestOptions },\n } = integrationOptions;\n\n const requestIncludeKeys = [];\n for (const [key, value] of Object.entries(requestOptions)) {\n if (value) {\n requestIncludeKeys.push(key);\n }\n }\n\n let addReqDataUserOpt;\n if (user === undefined) {\n addReqDataUserOpt = true;\n } else if (typeof user === 'boolean') {\n addReqDataUserOpt = user;\n } else {\n const userIncludeKeys = [];\n for (const [key, value] of Object.entries(user)) {\n if (value) {\n userIncludeKeys.push(key);\n }\n }\n addReqDataUserOpt = userIncludeKeys;\n }\n\n return {\n include: {\n ip,\n user: addReqDataUserOpt,\n request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined,\n transaction: transactionNamingScheme,\n },\n };\n}\n\nfunction getSDKName(client) {\n try {\n // For a long chain like this, it's fewer bytes to combine a try-catch with assuming everything is there than to\n // write out a long chain of `a && a.b && a.b.c && ...`\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return client.getOptions()._metadata.sdk.name;\n } catch (err) {\n // In theory we should never get here\n return undefined;\n }\n}\n\nexport { RequestData, requestDataIntegration };\n//# sourceMappingURL=requestdata.js.map\n"],"names":["addRequestDataToEvent","spanToJSON","extractPathForTransaction","defineIntegration","convertIntegrationFnToClass"],"mappings":";;;;;AAIA,MAAM,kBAAkB;AAAA,EACtB,SAAS;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,cAAc;AAAA,IACd,KAAK;AAAA,IACL,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,EACF;AAAA,EACD,yBAAyB;AAC3B;AAEA,MAAM,mBAAmB;AAEzB,MAAM,0BAA2B,CAAC,UAAU,OAAO;AACjD,QAAM,kBAAkBA,YAAAA;AACxB,QAAM,WAAW;AAAA,IACf,GAAG;AAAA,IACH,GAAG;AAAA,IACH,SAAS;AAAA;AAAA;AAAA,MAGP,QAAQ;AAAA,MACR,GAAG,gBAAgB;AAAA,MACnB,GAAG,QAAQ;AAAA,MACX,MACE,QAAQ,WAAW,OAAO,QAAQ,QAAQ,SAAS,YAC/C,QAAQ,QAAQ,OAChB;AAAA,QACE,GAAG,gBAAgB,QAAQ;AAAA;AAAA,QAE3B,IAAK,QAAQ,WAAW,CAA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AI;AACJ,MAAI,SAAS,QAAW;AACtB,wBAAoB;AAAA,EACxB,WAAa,OAAO,SAAS,WAAW;AACpC,wBAAoB;AAAA,EACxB,OAAS;AACL,UAAM,kBAAkB,CAAA;AACxB,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,GAAG;AAC/C,UAAI,OAAO;AACT,wBAAgB,KAAK,GAAG;AAAA,MACzB;AAAA,IACF;AACD,wBAAoB;AAAA,EACrB;AAED,SAAO;AAAA,IACL,SAAS;AAAA,MACP;AAAA,MACA,MAAM;AAAA,MACN,SAAS,mBAAmB,WAAW,IAAI,qBAAqB;AAAA,MAChE,aAAa;AAAA,IACd;AAAA,EACL;AACA;AAEA,SAAS,WAAW,QAAQ;AAC1B,MAAI;AAIF,WAAO,OAAO,WAAU,EAAG,UAAU,IAAI;AAAA,EAC1C,SAAQ,KAAK;AAEZ,WAAO;AAAA,EACR;AACH;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestdata.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/integrations/requestdata.js"],"sourcesContent":["import { extractPathForTransaction, addRequestDataToEvent } from '@sentry/utils';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration.js';\nimport { spanToJSON } from '../utils/spanUtils.js';\n\nconst DEFAULT_OPTIONS = {\n include: {\n cookies: true,\n data: true,\n headers: true,\n ip: false,\n query_string: true,\n url: true,\n user: {\n id: true,\n username: true,\n email: true,\n },\n },\n transactionNamingScheme: 'methodPath',\n};\n\nconst INTEGRATION_NAME = 'RequestData';\n\nconst _requestDataIntegration = ((options = {}) => {\n const _addRequestData = addRequestDataToEvent;\n const _options = {\n ...DEFAULT_OPTIONS,\n ...options,\n include: {\n // @ts-expect-error It's mad because `method` isn't a known `include` key. (It's only here and not set by default in\n // `addRequestDataToEvent` for legacy reasons. TODO (v8): Change that.)\n method: true,\n ...DEFAULT_OPTIONS.include,\n ...options.include,\n user:\n options.include && typeof options.include.user === 'boolean'\n ? options.include.user\n : {\n ...DEFAULT_OPTIONS.include.user,\n // Unclear why TS still thinks `options.include.user` could be a boolean at this point\n ...((options.include || {}).user ),\n },\n },\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event, _hint, client) {\n // Note: In the long run, most of the logic here should probably move into the request data utility functions. For\n // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed.\n // (TL;DR: Those functions touch many parts of the repo in many different ways, and need to be clened up. Once\n // that's happened, it will be easier to add this logic in without worrying about unexpected side effects.)\n const { transactionNamingScheme } = _options;\n\n const { sdkProcessingMetadata = {} } = event;\n const req = sdkProcessingMetadata.request;\n\n if (!req) {\n return event;\n }\n\n // The Express request handler takes a similar `include` option to that which can be passed to this integration.\n // If passed there, we store it in `sdkProcessingMetadata`. TODO(v8): Force express and GCP people to use this\n // integration, so that all of this passing and conversion isn't necessary\n const addRequestDataOptions =\n sdkProcessingMetadata.requestDataOptionsFromExpressHandler ||\n sdkProcessingMetadata.requestDataOptionsFromGCPWrapper ||\n convertReqDataIntegrationOptsToAddReqDataOpts(_options);\n\n const processedEvent = _addRequestData(event, req, addRequestDataOptions);\n\n // Transaction events already have the right `transaction` value\n if (event.type === 'transaction' || transactionNamingScheme === 'handler') {\n return processedEvent;\n }\n\n // In all other cases, use the request's associated transaction (if any) to overwrite the event's `transaction`\n // value with a high-quality one\n const reqWithTransaction = req ;\n const transaction = reqWithTransaction._sentryTransaction;\n if (transaction) {\n const name = spanToJSON(transaction).description || '';\n\n // TODO (v8): Remove the nextjs check and just base it on `transactionNamingScheme` for all SDKs. (We have to\n // keep it the way it is for the moment, because changing the names of transactions in Sentry has the potential\n // to break things like alert rules.)\n const shouldIncludeMethodInTransactionName =\n getSDKName(client) === 'sentry.javascript.nextjs'\n ? name.startsWith('/api')\n : transactionNamingScheme !== 'path';\n\n const [transactionValue] = extractPathForTransaction(req, {\n path: true,\n method: shouldIncludeMethodInTransactionName,\n customRoute: name,\n });\n\n processedEvent.transaction = transactionValue;\n }\n\n return processedEvent;\n },\n };\n}) ;\n\nconst requestDataIntegration = defineIntegration(_requestDataIntegration);\n\n/**\n * Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/integrations`\n * so it can be used in cross-platform SDKs like `@sentry/nextjs`.\n * @deprecated Use `requestDataIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst RequestData = convertIntegrationFnToClass(INTEGRATION_NAME, requestDataIntegration)\n\n;\n\n/** Convert this integration's options to match what `addRequestDataToEvent` expects */\n/** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */\nfunction convertReqDataIntegrationOptsToAddReqDataOpts(\n integrationOptions,\n) {\n const {\n transactionNamingScheme,\n include: { ip, user, ...requestOptions },\n } = integrationOptions;\n\n const requestIncludeKeys = [];\n for (const [key, value] of Object.entries(requestOptions)) {\n if (value) {\n requestIncludeKeys.push(key);\n }\n }\n\n let addReqDataUserOpt;\n if (user === undefined) {\n addReqDataUserOpt = true;\n } else if (typeof user === 'boolean') {\n addReqDataUserOpt = user;\n } else {\n const userIncludeKeys = [];\n for (const [key, value] of Object.entries(user)) {\n if (value) {\n userIncludeKeys.push(key);\n }\n }\n addReqDataUserOpt = userIncludeKeys;\n }\n\n return {\n include: {\n ip,\n user: addReqDataUserOpt,\n request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined,\n transaction: transactionNamingScheme,\n },\n };\n}\n\nfunction getSDKName(client) {\n try {\n // For a long chain like this, it's fewer bytes to combine a try-catch with assuming everything is there than to\n // write out a long chain of `a && a.b && a.b.c && ...`\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return client.getOptions()._metadata.sdk.name;\n } catch (err) {\n // In theory we should never get here\n return undefined;\n }\n}\n\nexport { RequestData, requestDataIntegration };\n//# sourceMappingURL=requestdata.js.map\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sentry/node/node_modules/@sentry/core/esm/integrations/requestdata.js"],"sourcesContent":["import { extractPathForTransaction, addRequestDataToEvent } from '@sentry/utils';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration.js';\nimport { spanToJSON } from '../utils/spanUtils.js';\n\nconst DEFAULT_OPTIONS = {\n include: {\n cookies: true,\n data: true,\n headers: true,\n ip: false,\n query_string: true,\n url: true,\n user: {\n id: true,\n username: true,\n email: true,\n },\n },\n transactionNamingScheme: 'methodPath',\n};\n\nconst INTEGRATION_NAME = 'RequestData';\n\nconst _requestDataIntegration = ((options = {}) => {\n const _addRequestData = addRequestDataToEvent;\n const _options = {\n ...DEFAULT_OPTIONS,\n ...options,\n include: {\n // @ts-expect-error It's mad because `method` isn't a known `include` key. (It's only here and not set by default in\n // `addRequestDataToEvent` for legacy reasons. TODO (v8): Change that.)\n method: true,\n ...DEFAULT_OPTIONS.include,\n ...options.include,\n user:\n options.include && typeof options.include.user === 'boolean'\n ? options.include.user\n : {\n ...DEFAULT_OPTIONS.include.user,\n // Unclear why TS still thinks `options.include.user` could be a boolean at this point\n ...((options.include || {}).user ),\n },\n },\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event, _hint, client) {\n // Note: In the long run, most of the logic here should probably move into the request data utility functions. For\n // the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed.\n // (TL;DR: Those functions touch many parts of the repo in many different ways, and need to be clened up. Once\n // that's happened, it will be easier to add this logic in without worrying about unexpected side effects.)\n const { transactionNamingScheme } = _options;\n\n const { sdkProcessingMetadata = {} } = event;\n const req = sdkProcessingMetadata.request;\n\n if (!req) {\n return event;\n }\n\n // The Express request handler takes a similar `include` option to that which can be passed to this integration.\n // If passed there, we store it in `sdkProcessingMetadata`. TODO(v8): Force express and GCP people to use this\n // integration, so that all of this passing and conversion isn't necessary\n const addRequestDataOptions =\n sdkProcessingMetadata.requestDataOptionsFromExpressHandler ||\n sdkProcessingMetadata.requestDataOptionsFromGCPWrapper ||\n convertReqDataIntegrationOptsToAddReqDataOpts(_options);\n\n const processedEvent = _addRequestData(event, req, addRequestDataOptions);\n\n // Transaction events already have the right `transaction` value\n if (event.type === 'transaction' || transactionNamingScheme === 'handler') {\n return processedEvent;\n }\n\n // In all other cases, use the request's associated transaction (if any) to overwrite the event's `transaction`\n // value with a high-quality one\n const reqWithTransaction = req ;\n const transaction = reqWithTransaction._sentryTransaction;\n if (transaction) {\n const name = spanToJSON(transaction).description || '';\n\n // TODO (v8): Remove the nextjs check and just base it on `transactionNamingScheme` for all SDKs. (We have to\n // keep it the way it is for the moment, because changing the names of transactions in Sentry has the potential\n // to break things like alert rules.)\n const shouldIncludeMethodInTransactionName =\n getSDKName(client) === 'sentry.javascript.nextjs'\n ? name.startsWith('/api')\n : transactionNamingScheme !== 'path';\n\n const [transactionValue] = extractPathForTransaction(req, {\n path: true,\n method: shouldIncludeMethodInTransactionName,\n customRoute: name,\n });\n\n processedEvent.transaction = transactionValue;\n }\n\n return processedEvent;\n },\n };\n}) ;\n\nconst requestDataIntegration = defineIntegration(_requestDataIntegration);\n\n/**\n * Add data about a request to an event. Primarily for use in Node-based SDKs, but included in `@sentry/integrations`\n * so it can be used in cross-platform SDKs like `@sentry/nextjs`.\n * @deprecated Use `requestDataIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst RequestData = convertIntegrationFnToClass(INTEGRATION_NAME, requestDataIntegration)\n\n;\n\n/** Convert this integration's options to match what `addRequestDataToEvent` expects */\n/** TODO: Can possibly be deleted once https://github.com/getsentry/sentry-javascript/issues/5718 is fixed */\nfunction convertReqDataIntegrationOptsToAddReqDataOpts(\n integrationOptions,\n) {\n const {\n transactionNamingScheme,\n include: { ip, user, ...requestOptions },\n } = integrationOptions;\n\n const requestIncludeKeys = [];\n for (const [key, value] of Object.entries(requestOptions)) {\n if (value) {\n requestIncludeKeys.push(key);\n }\n }\n\n let addReqDataUserOpt;\n if (user === undefined) {\n addReqDataUserOpt = true;\n } else if (typeof user === 'boolean') {\n addReqDataUserOpt = user;\n } else {\n const userIncludeKeys = [];\n for (const [key, value] of Object.entries(user)) {\n if (value) {\n userIncludeKeys.push(key);\n }\n }\n addReqDataUserOpt = userIncludeKeys;\n }\n\n return {\n include: {\n ip,\n user: addReqDataUserOpt,\n request: requestIncludeKeys.length !== 0 ? requestIncludeKeys : undefined,\n transaction: transactionNamingScheme,\n },\n };\n}\n\nfunction getSDKName(client) {\n try {\n // For a long chain like this, it's fewer bytes to combine a try-catch with assuming everything is there than to\n // write out a long chain of `a && a.b && a.b.c && ...`\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return client.getOptions()._metadata.sdk.name;\n } catch (err) {\n // In theory we should never get here\n return undefined;\n }\n}\n\nexport { RequestData, requestDataIntegration };\n//# sourceMappingURL=requestdata.js.map\n"],"names":[],"mappings":";;;AAIA,MAAM,kBAAkB;AAAA,EACtB,SAAS;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,IACT,IAAI;AAAA,IACJ,cAAc;AAAA,IACd,KAAK;AAAA,IACL,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,UAAU;AAAA,MACV,OAAO;AAAA,IACR;AAAA,EACF;AAAA,EACD,yBAAyB;AAC3B;AAEA,MAAM,mBAAmB;AAEzB,MAAM,0BAA2B,CAAC,UAAU,OAAO;AACjD,QAAM,kBAAkB;AACxB,QAAM,WAAW;AAAA,IACf,GAAG;AAAA,IACH,GAAG;AAAA,IACH,SAAS;AAAA;AAAA;AAAA,MAGP,QAAQ;AAAA,MACR,GAAG,gBAAgB;AAAA,MACnB,GAAG,QAAQ;AAAA,MACX,MACE,QAAQ,WAAW,OAAO,QAAQ,QAAQ,SAAS,YAC/C,QAAQ,QAAQ,OAChB;AAAA,QACE,GAAG,gBAAgB,QAAQ;AAAA;AAAA,QAE3B,IAAK,QAAQ,WAAW,CAAA,GA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BAAoB;AAAA,EACxB,WAAa,OAAO,SAAS,WAAW;AACpC,wBAAoB;AAAA,EACxB,OAAS;AACL,UAAM,kBAAkB,CAAA;AACxB,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,GAAG;AAC/C,UAAI,OAAO;AACT,wBAAgB,KAAK,GAAG;AAAA,MACzB;AAAA,IACF;AACD,wBAAoB;AAAA,EACrB;AAED,SAAO;AAAA,IACL,SAAS;AAAA,MACP;AAAA,MACA,MAAM;AAAA,MACN,SAAS,mBAAmB,WAAW,IAAI,qBAAqB;AAAA,MAChE,aAAa;AAAA,IACd;AAAA,EACL;AACA;AAEA,SAAS,WAAW,QAAQ;AAC1B,MAAI;AAIF,WAAO,OAAO,WAAU,EAAG,UAAU,IAAI;AAAA,EAC1C,SAAQ,KAAK;AAEZ,WAAO;AAAA,EACR;AACH;","x_google_ignoreList":[0]}
|
package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/instance.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/instance.js"],"sourcesContent":["import { COUNTER_METRIC_TYPE, GAUGE_METRIC_TYPE, DISTRIBUTION_METRIC_TYPE, SET_METRIC_TYPE } from './constants.js';\nimport { simpleHash } from './utils.js';\n\n/**\n * A metric instance representing a counter.\n */\nclass CounterMetric {\n constructor( _value) {this._value = _value;}\n\n /** @inheritDoc */\n get weight() {\n return 1;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value += value;\n }\n\n /** @inheritdoc */\n toString() {\n return `${this._value}`;\n }\n}\n\n/**\n * A metric instance representing a gauge.\n */\nclass GaugeMetric {\n\n constructor(value) {\n this._last = value;\n this._min = value;\n this._max = value;\n this._sum = value;\n this._count = 1;\n }\n\n /** @inheritDoc */\n get weight() {\n return 5;\n }\n\n /** @inheritdoc */\n add(value) {\n this._last = value;\n if (value < this._min) {\n this._min = value;\n }\n if (value > this._max) {\n this._max = value;\n }\n this._sum += value;\n this._count++;\n }\n\n /** @inheritdoc */\n toString() {\n return `${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`;\n }\n}\n\n/**\n * A metric instance representing a distribution.\n */\nclass DistributionMetric {\n\n constructor(first) {\n this._value = [first];\n }\n\n /** @inheritDoc */\n get weight() {\n return this._value.length;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value.push(value);\n }\n\n /** @inheritdoc */\n toString() {\n return this._value.join(':');\n }\n}\n\n/**\n * A metric instance representing a set.\n */\nclass SetMetric {\n\n constructor( first) {this.first = first;\n this._value = new Set([first]);\n }\n\n /** @inheritDoc */\n get weight() {\n return this._value.size;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value.add(value);\n }\n\n /** @inheritdoc */\n toString() {\n return Array.from(this._value)\n .map(val => (typeof val === 'string' ? simpleHash(val) : val))\n .join(':');\n }\n}\n\nconst METRIC_MAP = {\n [COUNTER_METRIC_TYPE]: CounterMetric,\n [GAUGE_METRIC_TYPE]: GaugeMetric,\n [DISTRIBUTION_METRIC_TYPE]: DistributionMetric,\n [SET_METRIC_TYPE]: SetMetric,\n};\n\nexport { CounterMetric, DistributionMetric, GaugeMetric, METRIC_MAP, SetMetric };\n//# sourceMappingURL=instance.js.map\n"],"names":["simpleHash","COUNTER_METRIC_TYPE","GAUGE_METRIC_TYPE","DISTRIBUTION_METRIC_TYPE","SET_METRIC_TYPE"],"mappings":";;;;AAMA,MAAM,cAAe;AAAA,EAClB,YAAa,QAAQ;AAAC,SAAK,SAAS;AAAA,EAAO;AAAA;AAAA,EAG3C,IAAI,SAAS;AACZ,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,IAAI,OAAO;AACV,SAAK,UAAU;AAAA,EAChB;AAAA;AAAA,EAGA,WAAW;AACV,WAAO,GAAG,KAAK;AAAA,
|
|
1
|
+
{"version":3,"file":"instance.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/instance.js"],"sourcesContent":["import { COUNTER_METRIC_TYPE, GAUGE_METRIC_TYPE, DISTRIBUTION_METRIC_TYPE, SET_METRIC_TYPE } from './constants.js';\nimport { simpleHash } from './utils.js';\n\n/**\n * A metric instance representing a counter.\n */\nclass CounterMetric {\n constructor( _value) {this._value = _value;}\n\n /** @inheritDoc */\n get weight() {\n return 1;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value += value;\n }\n\n /** @inheritdoc */\n toString() {\n return `${this._value}`;\n }\n}\n\n/**\n * A metric instance representing a gauge.\n */\nclass GaugeMetric {\n\n constructor(value) {\n this._last = value;\n this._min = value;\n this._max = value;\n this._sum = value;\n this._count = 1;\n }\n\n /** @inheritDoc */\n get weight() {\n return 5;\n }\n\n /** @inheritdoc */\n add(value) {\n this._last = value;\n if (value < this._min) {\n this._min = value;\n }\n if (value > this._max) {\n this._max = value;\n }\n this._sum += value;\n this._count++;\n }\n\n /** @inheritdoc */\n toString() {\n return `${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`;\n }\n}\n\n/**\n * A metric instance representing a distribution.\n */\nclass DistributionMetric {\n\n constructor(first) {\n this._value = [first];\n }\n\n /** @inheritDoc */\n get weight() {\n return this._value.length;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value.push(value);\n }\n\n /** @inheritdoc */\n toString() {\n return this._value.join(':');\n }\n}\n\n/**\n * A metric instance representing a set.\n */\nclass SetMetric {\n\n constructor( first) {this.first = first;\n this._value = new Set([first]);\n }\n\n /** @inheritDoc */\n get weight() {\n return this._value.size;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value.add(value);\n }\n\n /** @inheritdoc */\n toString() {\n return Array.from(this._value)\n .map(val => (typeof val === 'string' ? simpleHash(val) : val))\n .join(':');\n }\n}\n\nconst METRIC_MAP = {\n [COUNTER_METRIC_TYPE]: CounterMetric,\n [GAUGE_METRIC_TYPE]: GaugeMetric,\n [DISTRIBUTION_METRIC_TYPE]: DistributionMetric,\n [SET_METRIC_TYPE]: SetMetric,\n};\n\nexport { CounterMetric, DistributionMetric, GaugeMetric, METRIC_MAP, SetMetric };\n//# sourceMappingURL=instance.js.map\n"],"names":["simpleHash","COUNTER_METRIC_TYPE","GAUGE_METRIC_TYPE","DISTRIBUTION_METRIC_TYPE","SET_METRIC_TYPE"],"mappings":";;;;AAMA,MAAM,cAAe;AAAA,EAClB,YAAa,QAAQ;AAAC,SAAK,SAAS;AAAA,EAAO;AAAA;AAAA,EAG3C,IAAI,SAAS;AACZ,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,IAAI,OAAO;AACV,SAAK,UAAU;AAAA,EAChB;AAAA;AAAA,EAGA,WAAW;AACV,WAAO,GAAG,KAAK,MAAM;AAAA,EACtB;AACH;AAKA,MAAM,YAAa;AAAA,EAEhB,YAAY,OAAO;AAClB,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,SAAS;AAAA,EACf;AAAA;AAAA,EAGA,IAAI,SAAS;AACZ,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,IAAI,OAAO;AACV,SAAK,QAAQ;AACb,QAAI,QAAQ,KAAK,MAAM;AACrB,WAAK,OAAO;AAAA,IACb;AACD,QAAI,QAAQ,KAAK,MAAM;AACrB,WAAK,OAAO;AAAA,IACb;AACD,SAAK,QAAQ;AACb,SAAK;AAAA,EACN;AAAA;AAAA,EAGA,WAAW;AACV,WAAO,GAAG,KAAK,KAAK,IAAI,KAAK,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,MAAM;AAAA,EAC3E;AACH;AAKA,MAAM,mBAAoB;AAAA,EAEvB,YAAY,OAAO;AAClB,SAAK,SAAS,CAAC,KAAK;AAAA,EACrB;AAAA;AAAA,EAGA,IAAI,SAAS;AACZ,WAAO,KAAK,OAAO;AAAA,EACpB;AAAA;AAAA,EAGA,IAAI,OAAO;AACV,SAAK,OAAO,KAAK,KAAK;AAAA,EACvB;AAAA;AAAA,EAGA,WAAW;AACV,WAAO,KAAK,OAAO,KAAK,GAAG;AAAA,EAC5B;AACH;AAKA,MAAM,UAAW;AAAA,EAEd,YAAa,OAAO;AAAC,SAAK,QAAQ;AACjC,SAAK,SAAS,oBAAI,IAAI,CAAC,KAAK,CAAC;AAAA,EAC9B;AAAA;AAAA,EAGA,IAAI,SAAS;AACZ,WAAO,KAAK,OAAO;AAAA,EACpB;AAAA;AAAA,EAGA,IAAI,OAAO;AACV,SAAK,OAAO,IAAI,KAAK;AAAA,EACtB;AAAA;AAAA,EAGA,WAAW;AACV,WAAO,MAAM,KAAK,KAAK,MAAM,EAC1B,IAAI,SAAQ,OAAO,QAAQ,WAAWA,MAAAA,WAAW,GAAG,IAAI,GAAI,EAC5D,KAAK,GAAG;AAAA,EACZ;AACH;AAEK,MAAC,aAAa;AAAA,EACjB,CAACC,UAAmB,mBAAA,GAAG;AAAA,EACvB,CAACC,UAAiB,iBAAA,GAAG;AAAA,EACrB,CAACC,UAAwB,wBAAA,GAAG;AAAA,EAC5B,CAACC,UAAe,eAAA,GAAG;AACrB;;;;;;","x_google_ignoreList":[0]}
|
package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/instance.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/instance.js"],"sourcesContent":["import { COUNTER_METRIC_TYPE, GAUGE_METRIC_TYPE, DISTRIBUTION_METRIC_TYPE, SET_METRIC_TYPE } from './constants.js';\nimport { simpleHash } from './utils.js';\n\n/**\n * A metric instance representing a counter.\n */\nclass CounterMetric {\n constructor( _value) {this._value = _value;}\n\n /** @inheritDoc */\n get weight() {\n return 1;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value += value;\n }\n\n /** @inheritdoc */\n toString() {\n return `${this._value}`;\n }\n}\n\n/**\n * A metric instance representing a gauge.\n */\nclass GaugeMetric {\n\n constructor(value) {\n this._last = value;\n this._min = value;\n this._max = value;\n this._sum = value;\n this._count = 1;\n }\n\n /** @inheritDoc */\n get weight() {\n return 5;\n }\n\n /** @inheritdoc */\n add(value) {\n this._last = value;\n if (value < this._min) {\n this._min = value;\n }\n if (value > this._max) {\n this._max = value;\n }\n this._sum += value;\n this._count++;\n }\n\n /** @inheritdoc */\n toString() {\n return `${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`;\n }\n}\n\n/**\n * A metric instance representing a distribution.\n */\nclass DistributionMetric {\n\n constructor(first) {\n this._value = [first];\n }\n\n /** @inheritDoc */\n get weight() {\n return this._value.length;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value.push(value);\n }\n\n /** @inheritdoc */\n toString() {\n return this._value.join(':');\n }\n}\n\n/**\n * A metric instance representing a set.\n */\nclass SetMetric {\n\n constructor( first) {this.first = first;\n this._value = new Set([first]);\n }\n\n /** @inheritDoc */\n get weight() {\n return this._value.size;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value.add(value);\n }\n\n /** @inheritdoc */\n toString() {\n return Array.from(this._value)\n .map(val => (typeof val === 'string' ? simpleHash(val) : val))\n .join(':');\n }\n}\n\nconst METRIC_MAP = {\n [COUNTER_METRIC_TYPE]: CounterMetric,\n [GAUGE_METRIC_TYPE]: GaugeMetric,\n [DISTRIBUTION_METRIC_TYPE]: DistributionMetric,\n [SET_METRIC_TYPE]: SetMetric,\n};\n\nexport { CounterMetric, DistributionMetric, GaugeMetric, METRIC_MAP, SetMetric };\n//# sourceMappingURL=instance.js.map\n"],"names":[],"mappings":";;AAMA,MAAM,cAAe;AAAA,EAClB,YAAa,QAAQ;AAAC,SAAK,SAAS;AAAA,EAAO;AAAA;AAAA,EAG3C,IAAI,SAAS;AACZ,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,IAAI,OAAO;AACV,SAAK,UAAU;AAAA,EAChB;AAAA;AAAA,EAGA,WAAW;AACV,WAAO,GAAG,KAAK;AAAA,
|
|
1
|
+
{"version":3,"file":"instance.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/instance.js"],"sourcesContent":["import { COUNTER_METRIC_TYPE, GAUGE_METRIC_TYPE, DISTRIBUTION_METRIC_TYPE, SET_METRIC_TYPE } from './constants.js';\nimport { simpleHash } from './utils.js';\n\n/**\n * A metric instance representing a counter.\n */\nclass CounterMetric {\n constructor( _value) {this._value = _value;}\n\n /** @inheritDoc */\n get weight() {\n return 1;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value += value;\n }\n\n /** @inheritdoc */\n toString() {\n return `${this._value}`;\n }\n}\n\n/**\n * A metric instance representing a gauge.\n */\nclass GaugeMetric {\n\n constructor(value) {\n this._last = value;\n this._min = value;\n this._max = value;\n this._sum = value;\n this._count = 1;\n }\n\n /** @inheritDoc */\n get weight() {\n return 5;\n }\n\n /** @inheritdoc */\n add(value) {\n this._last = value;\n if (value < this._min) {\n this._min = value;\n }\n if (value > this._max) {\n this._max = value;\n }\n this._sum += value;\n this._count++;\n }\n\n /** @inheritdoc */\n toString() {\n return `${this._last}:${this._min}:${this._max}:${this._sum}:${this._count}`;\n }\n}\n\n/**\n * A metric instance representing a distribution.\n */\nclass DistributionMetric {\n\n constructor(first) {\n this._value = [first];\n }\n\n /** @inheritDoc */\n get weight() {\n return this._value.length;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value.push(value);\n }\n\n /** @inheritdoc */\n toString() {\n return this._value.join(':');\n }\n}\n\n/**\n * A metric instance representing a set.\n */\nclass SetMetric {\n\n constructor( first) {this.first = first;\n this._value = new Set([first]);\n }\n\n /** @inheritDoc */\n get weight() {\n return this._value.size;\n }\n\n /** @inheritdoc */\n add(value) {\n this._value.add(value);\n }\n\n /** @inheritdoc */\n toString() {\n return Array.from(this._value)\n .map(val => (typeof val === 'string' ? simpleHash(val) : val))\n .join(':');\n }\n}\n\nconst METRIC_MAP = {\n [COUNTER_METRIC_TYPE]: CounterMetric,\n [GAUGE_METRIC_TYPE]: GaugeMetric,\n [DISTRIBUTION_METRIC_TYPE]: DistributionMetric,\n [SET_METRIC_TYPE]: SetMetric,\n};\n\nexport { CounterMetric, DistributionMetric, GaugeMetric, METRIC_MAP, SetMetric };\n//# sourceMappingURL=instance.js.map\n"],"names":[],"mappings":";;AAMA,MAAM,cAAe;AAAA,EAClB,YAAa,QAAQ;AAAC,SAAK,SAAS;AAAA,EAAO;AAAA;AAAA,EAG3C,IAAI,SAAS;AACZ,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,IAAI,OAAO;AACV,SAAK,UAAU;AAAA,EAChB;AAAA;AAAA,EAGA,WAAW;AACV,WAAO,GAAG,KAAK,MAAM;AAAA,EACtB;AACH;AAKA,MAAM,YAAa;AAAA,EAEhB,YAAY,OAAO;AAClB,SAAK,QAAQ;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,SAAS;AAAA,EACf;AAAA;AAAA,EAGA,IAAI,SAAS;AACZ,WAAO;AAAA,EACR;AAAA;AAAA,EAGA,IAAI,OAAO;AACV,SAAK,QAAQ;AACb,QAAI,QAAQ,KAAK,MAAM;AACrB,WAAK,OAAO;AAAA,IACb;AACD,QAAI,QAAQ,KAAK,MAAM;AACrB,WAAK,OAAO;AAAA,IACb;AACD,SAAK,QAAQ;AACb,SAAK;AAAA,EACN;AAAA;AAAA,EAGA,WAAW;AACV,WAAO,GAAG,KAAK,KAAK,IAAI,KAAK,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,MAAM;AAAA,EAC3E;AACH;AAKA,MAAM,mBAAoB;AAAA,EAEvB,YAAY,OAAO;AAClB,SAAK,SAAS,CAAC,KAAK;AAAA,EACrB;AAAA;AAAA,EAGA,IAAI,SAAS;AACZ,WAAO,KAAK,OAAO;AAAA,EACpB;AAAA;AAAA,EAGA,IAAI,OAAO;AACV,SAAK,OAAO,KAAK,KAAK;AAAA,EACvB;AAAA;AAAA,EAGA,WAAW;AACV,WAAO,KAAK,OAAO,KAAK,GAAG;AAAA,EAC5B;AACH;AAKA,MAAM,UAAW;AAAA,EAEd,YAAa,OAAO;AAAC,SAAK,QAAQ;AACjC,SAAK,SAAS,oBAAI,IAAI,CAAC,KAAK,CAAC;AAAA,EAC9B;AAAA;AAAA,EAGA,IAAI,SAAS;AACZ,WAAO,KAAK,OAAO;AAAA,EACpB;AAAA;AAAA,EAGA,IAAI,OAAO;AACV,SAAK,OAAO,IAAI,KAAK;AAAA,EACtB;AAAA;AAAA,EAGA,WAAW;AACV,WAAO,MAAM,KAAK,KAAK,MAAM,EAC1B,IAAI,SAAQ,OAAO,QAAQ,WAAW,WAAW,GAAG,IAAI,GAAI,EAC5D,KAAK,GAAG;AAAA,EACZ;AACH;AAEK,MAAC,aAAa;AAAA,EACjB,CAAC,mBAAmB,GAAG;AAAA,EACvB,CAAC,iBAAiB,GAAG;AAAA,EACrB,CAAC,wBAAwB,GAAG;AAAA,EAC5B,CAAC,eAAe,GAAG;AACrB;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metric-summary.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/metric-summary.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\nimport '../debug-build.js';\nimport '../tracing/errors.js';\nimport '../tracing/spanstatus.js';\nimport { getActiveSpan } from '../tracing/trace.js';\n\n/**\n * key: bucketKey\n * value: [exportKey, MetricSummary]\n */\n\nlet SPAN_METRIC_SUMMARY;\n\nfunction getMetricStorageForSpan(span) {\n return SPAN_METRIC_SUMMARY ? SPAN_METRIC_SUMMARY.get(span) : undefined;\n}\n\n/**\n * Fetches the metric summary if it exists for the passed span\n */\nfunction getMetricSummaryJsonForSpan(span) {\n const storage = getMetricStorageForSpan(span);\n\n if (!storage) {\n return undefined;\n }\n const output = {};\n\n for (const [, [exportKey, summary]] of storage) {\n if (!output[exportKey]) {\n output[exportKey] = [];\n }\n\n output[exportKey].push(dropUndefinedKeys(summary));\n }\n\n return output;\n}\n\n/**\n * Updates the metric summary on the currently active span\n */\nfunction updateMetricSummaryOnActiveSpan(\n metricType,\n sanitizedName,\n value,\n unit,\n tags,\n bucketKey,\n) {\n const span = getActiveSpan();\n if (span) {\n const storage = getMetricStorageForSpan(span) || new Map();\n\n const exportKey = `${metricType}:${sanitizedName}@${unit}`;\n const bucketItem = storage.get(bucketKey);\n\n if (bucketItem) {\n const [, summary] = bucketItem;\n storage.set(bucketKey, [\n exportKey,\n {\n min: Math.min(summary.min, value),\n max: Math.max(summary.max, value),\n count: (summary.count += 1),\n sum: (summary.sum += value),\n tags: summary.tags,\n },\n ]);\n } else {\n storage.set(bucketKey, [\n exportKey,\n {\n min: value,\n max: value,\n count: 1,\n sum: value,\n tags,\n },\n ]);\n }\n\n if (!SPAN_METRIC_SUMMARY) {\n SPAN_METRIC_SUMMARY = new WeakMap();\n }\n\n SPAN_METRIC_SUMMARY.set(span, storage);\n }\n}\n\nexport { getMetricSummaryJsonForSpan, updateMetricSummaryOnActiveSpan };\n//# sourceMappingURL=metric-summary.js.map\n"],"names":["dropUndefinedKeys","getActiveSpan"],"mappings":";;;;AAWA,IAAI;AAEJ,SAAS,wBAAwB,MAAM;AACrC,SAAO,sBAAsB,oBAAoB,IAAI,IAAI,IAAI;AAC/D;AAKA,SAAS,4BAA4B,MAAM;AACzC,QAAM,UAAU,wBAAwB,IAAI;AAE5C,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACR;AACD,QAAM,SAAS,CAAA;AAEf,aAAW,CAAA,EAAG,CAAC,WAAW,OAAO,CAAC,KAAK,SAAS;AAC9C,QAAI,CAAC,OAAO,SAAS,GAAG;AACtB,aAAO,SAAS,IAAI;IACrB;AAED,WAAO,SAAS,EAAE,KAAKA,OAAAA,kBAAkB,OAAO,CAAC;AAAA,EAClD;AAED,SAAO;AACT;AAKA,SAAS,gCACP,YACA,eACA,OACA,MACA,MACA,WACA;AACA,QAAM,OAAOC,MAAAA;AACb,MAAI,MAAM;AACR,UAAM,UAAU,wBAAwB,IAAI,KAAK,oBAAI,IAAG;AAExD,UAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"metric-summary.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/metric-summary.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\nimport '../debug-build.js';\nimport '../tracing/errors.js';\nimport '../tracing/spanstatus.js';\nimport { getActiveSpan } from '../tracing/trace.js';\n\n/**\n * key: bucketKey\n * value: [exportKey, MetricSummary]\n */\n\nlet SPAN_METRIC_SUMMARY;\n\nfunction getMetricStorageForSpan(span) {\n return SPAN_METRIC_SUMMARY ? SPAN_METRIC_SUMMARY.get(span) : undefined;\n}\n\n/**\n * Fetches the metric summary if it exists for the passed span\n */\nfunction getMetricSummaryJsonForSpan(span) {\n const storage = getMetricStorageForSpan(span);\n\n if (!storage) {\n return undefined;\n }\n const output = {};\n\n for (const [, [exportKey, summary]] of storage) {\n if (!output[exportKey]) {\n output[exportKey] = [];\n }\n\n output[exportKey].push(dropUndefinedKeys(summary));\n }\n\n return output;\n}\n\n/**\n * Updates the metric summary on the currently active span\n */\nfunction updateMetricSummaryOnActiveSpan(\n metricType,\n sanitizedName,\n value,\n unit,\n tags,\n bucketKey,\n) {\n const span = getActiveSpan();\n if (span) {\n const storage = getMetricStorageForSpan(span) || new Map();\n\n const exportKey = `${metricType}:${sanitizedName}@${unit}`;\n const bucketItem = storage.get(bucketKey);\n\n if (bucketItem) {\n const [, summary] = bucketItem;\n storage.set(bucketKey, [\n exportKey,\n {\n min: Math.min(summary.min, value),\n max: Math.max(summary.max, value),\n count: (summary.count += 1),\n sum: (summary.sum += value),\n tags: summary.tags,\n },\n ]);\n } else {\n storage.set(bucketKey, [\n exportKey,\n {\n min: value,\n max: value,\n count: 1,\n sum: value,\n tags,\n },\n ]);\n }\n\n if (!SPAN_METRIC_SUMMARY) {\n SPAN_METRIC_SUMMARY = new WeakMap();\n }\n\n SPAN_METRIC_SUMMARY.set(span, storage);\n }\n}\n\nexport { getMetricSummaryJsonForSpan, updateMetricSummaryOnActiveSpan };\n//# sourceMappingURL=metric-summary.js.map\n"],"names":["dropUndefinedKeys","getActiveSpan"],"mappings":";;;;AAWA,IAAI;AAEJ,SAAS,wBAAwB,MAAM;AACrC,SAAO,sBAAsB,oBAAoB,IAAI,IAAI,IAAI;AAC/D;AAKA,SAAS,4BAA4B,MAAM;AACzC,QAAM,UAAU,wBAAwB,IAAI;AAE5C,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACR;AACD,QAAM,SAAS,CAAA;AAEf,aAAW,CAAA,EAAG,CAAC,WAAW,OAAO,CAAC,KAAK,SAAS;AAC9C,QAAI,CAAC,OAAO,SAAS,GAAG;AACtB,aAAO,SAAS,IAAI;IACrB;AAED,WAAO,SAAS,EAAE,KAAKA,OAAAA,kBAAkB,OAAO,CAAC;AAAA,EAClD;AAED,SAAO;AACT;AAKA,SAAS,gCACP,YACA,eACA,OACA,MACA,MACA,WACA;AACA,QAAM,OAAOC,MAAAA;AACb,MAAI,MAAM;AACR,UAAM,UAAU,wBAAwB,IAAI,KAAK,oBAAI,IAAG;AAExD,UAAM,YAAY,GAAG,UAAU,IAAI,aAAa,IAAI,IAAI;AACxD,UAAM,aAAa,QAAQ,IAAI,SAAS;AAExC,QAAI,YAAY;AACd,YAAM,CAAG,EAAA,OAAO,IAAI;AACpB,cAAQ,IAAI,WAAW;AAAA,QACrB;AAAA,QACA;AAAA,UACE,KAAK,KAAK,IAAI,QAAQ,KAAK,KAAK;AAAA,UAChC,KAAK,KAAK,IAAI,QAAQ,KAAK,KAAK;AAAA,UAChC,OAAQ,QAAQ,SAAS;AAAA,UACzB,KAAM,QAAQ,OAAO;AAAA,UACrB,MAAM,QAAQ;AAAA,QACf;AAAA,MACT,CAAO;AAAA,IACP,OAAW;AACL,cAAQ,IAAI,WAAW;AAAA,QACrB;AAAA,QACA;AAAA,UACE,KAAK;AAAA,UACL,KAAK;AAAA,UACL,OAAO;AAAA,UACP,KAAK;AAAA,UACL;AAAA,QACD;AAAA,MACT,CAAO;AAAA,IACF;AAED,QAAI,CAAC,qBAAqB;AACxB,4BAAsB,oBAAI;IAC3B;AAED,wBAAoB,IAAI,MAAM,OAAO;AAAA,EACtC;AACH;;;","x_google_ignoreList":[0]}
|
package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/metric-summary.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metric-summary.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/metric-summary.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\nimport '../debug-build.js';\nimport '../tracing/errors.js';\nimport '../tracing/spanstatus.js';\nimport { getActiveSpan } from '../tracing/trace.js';\n\n/**\n * key: bucketKey\n * value: [exportKey, MetricSummary]\n */\n\nlet SPAN_METRIC_SUMMARY;\n\nfunction getMetricStorageForSpan(span) {\n return SPAN_METRIC_SUMMARY ? SPAN_METRIC_SUMMARY.get(span) : undefined;\n}\n\n/**\n * Fetches the metric summary if it exists for the passed span\n */\nfunction getMetricSummaryJsonForSpan(span) {\n const storage = getMetricStorageForSpan(span);\n\n if (!storage) {\n return undefined;\n }\n const output = {};\n\n for (const [, [exportKey, summary]] of storage) {\n if (!output[exportKey]) {\n output[exportKey] = [];\n }\n\n output[exportKey].push(dropUndefinedKeys(summary));\n }\n\n return output;\n}\n\n/**\n * Updates the metric summary on the currently active span\n */\nfunction updateMetricSummaryOnActiveSpan(\n metricType,\n sanitizedName,\n value,\n unit,\n tags,\n bucketKey,\n) {\n const span = getActiveSpan();\n if (span) {\n const storage = getMetricStorageForSpan(span) || new Map();\n\n const exportKey = `${metricType}:${sanitizedName}@${unit}`;\n const bucketItem = storage.get(bucketKey);\n\n if (bucketItem) {\n const [, summary] = bucketItem;\n storage.set(bucketKey, [\n exportKey,\n {\n min: Math.min(summary.min, value),\n max: Math.max(summary.max, value),\n count: (summary.count += 1),\n sum: (summary.sum += value),\n tags: summary.tags,\n },\n ]);\n } else {\n storage.set(bucketKey, [\n exportKey,\n {\n min: value,\n max: value,\n count: 1,\n sum: value,\n tags,\n },\n ]);\n }\n\n if (!SPAN_METRIC_SUMMARY) {\n SPAN_METRIC_SUMMARY = new WeakMap();\n }\n\n SPAN_METRIC_SUMMARY.set(span, storage);\n }\n}\n\nexport { getMetricSummaryJsonForSpan, updateMetricSummaryOnActiveSpan };\n//# sourceMappingURL=metric-summary.js.map\n"],"names":[],"mappings":";;AAWA,IAAI;AAEJ,SAAS,wBAAwB,MAAM;AACrC,SAAO,sBAAsB,oBAAoB,IAAI,IAAI,IAAI;AAC/D;AAKA,SAAS,4BAA4B,MAAM;AACzC,QAAM,UAAU,wBAAwB,IAAI;AAE5C,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACR;AACD,QAAM,SAAS,CAAA;AAEf,aAAW,CAAA,EAAG,CAAC,WAAW,OAAO,CAAC,KAAK,SAAS;AAC9C,QAAI,CAAC,OAAO,SAAS,GAAG;AACtB,aAAO,SAAS,IAAI;IACrB;AAED,WAAO,SAAS,EAAE,KAAK,kBAAkB,OAAO,CAAC;AAAA,EAClD;AAED,SAAO;AACT;AAKA,SAAS,gCACP,YACA,eACA,OACA,MACA,MACA,WACA;AACA,QAAM,OAAO;AACb,MAAI,MAAM;AACR,UAAM,UAAU,wBAAwB,IAAI,KAAK,oBAAI,IAAG;AAExD,UAAM,YAAY,GAAG,
|
|
1
|
+
{"version":3,"file":"metric-summary.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/metric-summary.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\nimport '../debug-build.js';\nimport '../tracing/errors.js';\nimport '../tracing/spanstatus.js';\nimport { getActiveSpan } from '../tracing/trace.js';\n\n/**\n * key: bucketKey\n * value: [exportKey, MetricSummary]\n */\n\nlet SPAN_METRIC_SUMMARY;\n\nfunction getMetricStorageForSpan(span) {\n return SPAN_METRIC_SUMMARY ? SPAN_METRIC_SUMMARY.get(span) : undefined;\n}\n\n/**\n * Fetches the metric summary if it exists for the passed span\n */\nfunction getMetricSummaryJsonForSpan(span) {\n const storage = getMetricStorageForSpan(span);\n\n if (!storage) {\n return undefined;\n }\n const output = {};\n\n for (const [, [exportKey, summary]] of storage) {\n if (!output[exportKey]) {\n output[exportKey] = [];\n }\n\n output[exportKey].push(dropUndefinedKeys(summary));\n }\n\n return output;\n}\n\n/**\n * Updates the metric summary on the currently active span\n */\nfunction updateMetricSummaryOnActiveSpan(\n metricType,\n sanitizedName,\n value,\n unit,\n tags,\n bucketKey,\n) {\n const span = getActiveSpan();\n if (span) {\n const storage = getMetricStorageForSpan(span) || new Map();\n\n const exportKey = `${metricType}:${sanitizedName}@${unit}`;\n const bucketItem = storage.get(bucketKey);\n\n if (bucketItem) {\n const [, summary] = bucketItem;\n storage.set(bucketKey, [\n exportKey,\n {\n min: Math.min(summary.min, value),\n max: Math.max(summary.max, value),\n count: (summary.count += 1),\n sum: (summary.sum += value),\n tags: summary.tags,\n },\n ]);\n } else {\n storage.set(bucketKey, [\n exportKey,\n {\n min: value,\n max: value,\n count: 1,\n sum: value,\n tags,\n },\n ]);\n }\n\n if (!SPAN_METRIC_SUMMARY) {\n SPAN_METRIC_SUMMARY = new WeakMap();\n }\n\n SPAN_METRIC_SUMMARY.set(span, storage);\n }\n}\n\nexport { getMetricSummaryJsonForSpan, updateMetricSummaryOnActiveSpan };\n//# sourceMappingURL=metric-summary.js.map\n"],"names":[],"mappings":";;AAWA,IAAI;AAEJ,SAAS,wBAAwB,MAAM;AACrC,SAAO,sBAAsB,oBAAoB,IAAI,IAAI,IAAI;AAC/D;AAKA,SAAS,4BAA4B,MAAM;AACzC,QAAM,UAAU,wBAAwB,IAAI;AAE5C,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACR;AACD,QAAM,SAAS,CAAA;AAEf,aAAW,CAAA,EAAG,CAAC,WAAW,OAAO,CAAC,KAAK,SAAS;AAC9C,QAAI,CAAC,OAAO,SAAS,GAAG;AACtB,aAAO,SAAS,IAAI;IACrB;AAED,WAAO,SAAS,EAAE,KAAK,kBAAkB,OAAO,CAAC;AAAA,EAClD;AAED,SAAO;AACT;AAKA,SAAS,gCACP,YACA,eACA,OACA,MACA,MACA,WACA;AACA,QAAM,OAAO;AACb,MAAI,MAAM;AACR,UAAM,UAAU,wBAAwB,IAAI,KAAK,oBAAI,IAAG;AAExD,UAAM,YAAY,GAAG,UAAU,IAAI,aAAa,IAAI,IAAI;AACxD,UAAM,aAAa,QAAQ,IAAI,SAAS;AAExC,QAAI,YAAY;AACd,YAAM,CAAG,EAAA,OAAO,IAAI;AACpB,cAAQ,IAAI,WAAW;AAAA,QACrB;AAAA,QACA;AAAA,UACE,KAAK,KAAK,IAAI,QAAQ,KAAK,KAAK;AAAA,UAChC,KAAK,KAAK,IAAI,QAAQ,KAAK,KAAK;AAAA,UAChC,OAAQ,QAAQ,SAAS;AAAA,UACzB,KAAM,QAAQ,OAAO;AAAA,UACrB,MAAM,QAAQ;AAAA,QACf;AAAA,MACT,CAAO;AAAA,IACP,OAAW;AACL,cAAQ,IAAI,WAAW;AAAA,QACrB;AAAA,QACA;AAAA,UACE,KAAK;AAAA,UACL,KAAK;AAAA,UACL,OAAO;AAAA,UACP,KAAK;AAAA,UACL;AAAA,QACD;AAAA,MACT,CAAO;AAAA,IACF;AAED,QAAI,CAAC,qBAAqB;AACxB,4BAAsB,oBAAI;IAC3B;AAED,wBAAoB,IAAI,MAAM,OAAO;AAAA,EACtC;AACH;","x_google_ignoreList":[0]}
|
package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/metrics/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/utils.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Generate bucket key from metric properties.\n */\nfunction getBucketKey(\n metricType,\n name,\n unit,\n tags,\n) {\n const stringifiedTags = Object.entries(dropUndefinedKeys(tags)).sort((a, b) => a[0].localeCompare(b[0]));\n return `${metricType}${name}${unit}${stringifiedTags}`;\n}\n\n/* eslint-disable no-bitwise */\n/**\n * Simple hash function for strings.\n */\nfunction simpleHash(s) {\n let rv = 0;\n for (let i = 0; i < s.length; i++) {\n const c = s.charCodeAt(i);\n rv = (rv << 5) - rv + c;\n rv &= rv;\n }\n return rv >>> 0;\n}\n/* eslint-enable no-bitwise */\n\n/**\n * Serialize metrics buckets into a string based on statsd format.\n *\n * Example of format:\n * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677\n * Segments:\n * name: metric.name\n * unit: second\n * value: [1, 1.2]\n * type of metric: d (distribution)\n * tags: { a: value, b: anothervalue }\n * timestamp: 12345677\n */\nfunction serializeMetricBuckets(metricBucketItems) {\n let out = '';\n for (const item of metricBucketItems) {\n const tagEntries = Object.entries(item.tags);\n const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : '';\n out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\\n`;\n }\n return out;\n}\n\n/** Sanitizes units */\nfunction sanitizeUnit(unit) {\n return unit.replace(/[^\\w]+/gi, '_');\n}\n\n/** Sanitizes metric keys */\nfunction sanitizeMetricKey(key) {\n return key.replace(/[^\\w\\-.]+/gi, '_');\n}\n\nfunction sanitizeTagKey(key) {\n return key.replace(/[^\\w\\-./]+/gi, '');\n}\n\nconst tagValueReplacements = [\n ['\\n', '\\\\n'],\n ['\\r', '\\\\r'],\n ['\\t', '\\\\t'],\n ['\\\\', '\\\\\\\\'],\n ['|', '\\\\u{7c}'],\n [',', '\\\\u{2c}'],\n];\n\nfunction getCharOrReplacement(input) {\n for (const [search, replacement] of tagValueReplacements) {\n if (input === search) {\n return replacement;\n }\n }\n\n return input;\n}\n\nfunction sanitizeTagValue(value) {\n return [...value].reduce((acc, char) => acc + getCharOrReplacement(char), '');\n}\n\n/**\n * Sanitizes tags.\n */\nfunction sanitizeTags(unsanitizedTags) {\n const tags = {};\n for (const key in unsanitizedTags) {\n if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) {\n const sanitizedKey = sanitizeTagKey(key);\n tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key]));\n }\n }\n return tags;\n}\n\nexport { getBucketKey, sanitizeMetricKey, sanitizeTags, sanitizeUnit, serializeMetricBuckets, simpleHash };\n//# sourceMappingURL=utils.js.map\n"],"names":["dropUndefinedKeys"],"mappings":";;;AAKA,SAAS,aACP,YACA,MACA,MACA,MACA;AACA,QAAM,kBAAkB,OAAO,QAAQA,OAAiB,kBAAC,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;AACvG,SAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"utils.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/utils.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Generate bucket key from metric properties.\n */\nfunction getBucketKey(\n metricType,\n name,\n unit,\n tags,\n) {\n const stringifiedTags = Object.entries(dropUndefinedKeys(tags)).sort((a, b) => a[0].localeCompare(b[0]));\n return `${metricType}${name}${unit}${stringifiedTags}`;\n}\n\n/* eslint-disable no-bitwise */\n/**\n * Simple hash function for strings.\n */\nfunction simpleHash(s) {\n let rv = 0;\n for (let i = 0; i < s.length; i++) {\n const c = s.charCodeAt(i);\n rv = (rv << 5) - rv + c;\n rv &= rv;\n }\n return rv >>> 0;\n}\n/* eslint-enable no-bitwise */\n\n/**\n * Serialize metrics buckets into a string based on statsd format.\n *\n * Example of format:\n * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677\n * Segments:\n * name: metric.name\n * unit: second\n * value: [1, 1.2]\n * type of metric: d (distribution)\n * tags: { a: value, b: anothervalue }\n * timestamp: 12345677\n */\nfunction serializeMetricBuckets(metricBucketItems) {\n let out = '';\n for (const item of metricBucketItems) {\n const tagEntries = Object.entries(item.tags);\n const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : '';\n out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\\n`;\n }\n return out;\n}\n\n/** Sanitizes units */\nfunction sanitizeUnit(unit) {\n return unit.replace(/[^\\w]+/gi, '_');\n}\n\n/** Sanitizes metric keys */\nfunction sanitizeMetricKey(key) {\n return key.replace(/[^\\w\\-.]+/gi, '_');\n}\n\nfunction sanitizeTagKey(key) {\n return key.replace(/[^\\w\\-./]+/gi, '');\n}\n\nconst tagValueReplacements = [\n ['\\n', '\\\\n'],\n ['\\r', '\\\\r'],\n ['\\t', '\\\\t'],\n ['\\\\', '\\\\\\\\'],\n ['|', '\\\\u{7c}'],\n [',', '\\\\u{2c}'],\n];\n\nfunction getCharOrReplacement(input) {\n for (const [search, replacement] of tagValueReplacements) {\n if (input === search) {\n return replacement;\n }\n }\n\n return input;\n}\n\nfunction sanitizeTagValue(value) {\n return [...value].reduce((acc, char) => acc + getCharOrReplacement(char), '');\n}\n\n/**\n * Sanitizes tags.\n */\nfunction sanitizeTags(unsanitizedTags) {\n const tags = {};\n for (const key in unsanitizedTags) {\n if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) {\n const sanitizedKey = sanitizeTagKey(key);\n tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key]));\n }\n }\n return tags;\n}\n\nexport { getBucketKey, sanitizeMetricKey, sanitizeTags, sanitizeUnit, serializeMetricBuckets, simpleHash };\n//# sourceMappingURL=utils.js.map\n"],"names":["dropUndefinedKeys"],"mappings":";;;AAK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AAA,EACf,CAAC,KAAK,SAAS;AACjB;AAEA,SAAS,qBAAqB,OAAO;AACnC,aAAW,CAAC,QAAQ,WAAW,KAAK,sBAAsB;AACxD,QAAI,UAAU,QAAQ;AACpB,aAAO;AAAA,IACR;AAAA,EACF;AAED,SAAO;AACT;AAEA,SAAS,iBAAiB,OAAO;AAC/B,SAAO,CAAC,GAAG,KAAK,EAAE,OAAO,CAAC,KAAK,SAAS,MAAM,qBAAqB,IAAI,GAAG,EAAE;AAC9E;AAKA,SAAS,aAAa,iBAAiB;AACrC,QAAM,OAAO,CAAA;AACb,aAAW,OAAO,iBAAiB;AACjC,QAAI,OAAO,UAAU,eAAe,KAAK,iBAAiB,GAAG,GAAG;AAC9D,YAAM,eAAe,eAAe,GAAG;AACvC,WAAK,YAAY,IAAI,iBAAiB,OAAO,gBAAgB,GAAG,CAAC,CAAC;AAAA,IACnE;AAAA,EACF;AACD,SAAO;AACT;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/utils.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Generate bucket key from metric properties.\n */\nfunction getBucketKey(\n metricType,\n name,\n unit,\n tags,\n) {\n const stringifiedTags = Object.entries(dropUndefinedKeys(tags)).sort((a, b) => a[0].localeCompare(b[0]));\n return `${metricType}${name}${unit}${stringifiedTags}`;\n}\n\n/* eslint-disable no-bitwise */\n/**\n * Simple hash function for strings.\n */\nfunction simpleHash(s) {\n let rv = 0;\n for (let i = 0; i < s.length; i++) {\n const c = s.charCodeAt(i);\n rv = (rv << 5) - rv + c;\n rv &= rv;\n }\n return rv >>> 0;\n}\n/* eslint-enable no-bitwise */\n\n/**\n * Serialize metrics buckets into a string based on statsd format.\n *\n * Example of format:\n * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677\n * Segments:\n * name: metric.name\n * unit: second\n * value: [1, 1.2]\n * type of metric: d (distribution)\n * tags: { a: value, b: anothervalue }\n * timestamp: 12345677\n */\nfunction serializeMetricBuckets(metricBucketItems) {\n let out = '';\n for (const item of metricBucketItems) {\n const tagEntries = Object.entries(item.tags);\n const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : '';\n out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\\n`;\n }\n return out;\n}\n\n/** Sanitizes units */\nfunction sanitizeUnit(unit) {\n return unit.replace(/[^\\w]+/gi, '_');\n}\n\n/** Sanitizes metric keys */\nfunction sanitizeMetricKey(key) {\n return key.replace(/[^\\w\\-.]+/gi, '_');\n}\n\nfunction sanitizeTagKey(key) {\n return key.replace(/[^\\w\\-./]+/gi, '');\n}\n\nconst tagValueReplacements = [\n ['\\n', '\\\\n'],\n ['\\r', '\\\\r'],\n ['\\t', '\\\\t'],\n ['\\\\', '\\\\\\\\'],\n ['|', '\\\\u{7c}'],\n [',', '\\\\u{2c}'],\n];\n\nfunction getCharOrReplacement(input) {\n for (const [search, replacement] of tagValueReplacements) {\n if (input === search) {\n return replacement;\n }\n }\n\n return input;\n}\n\nfunction sanitizeTagValue(value) {\n return [...value].reduce((acc, char) => acc + getCharOrReplacement(char), '');\n}\n\n/**\n * Sanitizes tags.\n */\nfunction sanitizeTags(unsanitizedTags) {\n const tags = {};\n for (const key in unsanitizedTags) {\n if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) {\n const sanitizedKey = sanitizeTagKey(key);\n tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key]));\n }\n }\n return tags;\n}\n\nexport { getBucketKey, sanitizeMetricKey, sanitizeTags, sanitizeUnit, serializeMetricBuckets, simpleHash };\n//# sourceMappingURL=utils.js.map\n"],"names":[],"mappings":";AAKA,SAAS,aACP,YACA,MACA,MACA,MACA;AACA,QAAM,kBAAkB,OAAO,QAAQ,kBAAkB,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;AACvG,SAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/metrics/utils.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Generate bucket key from metric properties.\n */\nfunction getBucketKey(\n metricType,\n name,\n unit,\n tags,\n) {\n const stringifiedTags = Object.entries(dropUndefinedKeys(tags)).sort((a, b) => a[0].localeCompare(b[0]));\n return `${metricType}${name}${unit}${stringifiedTags}`;\n}\n\n/* eslint-disable no-bitwise */\n/**\n * Simple hash function for strings.\n */\nfunction simpleHash(s) {\n let rv = 0;\n for (let i = 0; i < s.length; i++) {\n const c = s.charCodeAt(i);\n rv = (rv << 5) - rv + c;\n rv &= rv;\n }\n return rv >>> 0;\n}\n/* eslint-enable no-bitwise */\n\n/**\n * Serialize metrics buckets into a string based on statsd format.\n *\n * Example of format:\n * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677\n * Segments:\n * name: metric.name\n * unit: second\n * value: [1, 1.2]\n * type of metric: d (distribution)\n * tags: { a: value, b: anothervalue }\n * timestamp: 12345677\n */\nfunction serializeMetricBuckets(metricBucketItems) {\n let out = '';\n for (const item of metricBucketItems) {\n const tagEntries = Object.entries(item.tags);\n const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : '';\n out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\\n`;\n }\n return out;\n}\n\n/** Sanitizes units */\nfunction sanitizeUnit(unit) {\n return unit.replace(/[^\\w]+/gi, '_');\n}\n\n/** Sanitizes metric keys */\nfunction sanitizeMetricKey(key) {\n return key.replace(/[^\\w\\-.]+/gi, '_');\n}\n\nfunction sanitizeTagKey(key) {\n return key.replace(/[^\\w\\-./]+/gi, '');\n}\n\nconst tagValueReplacements = [\n ['\\n', '\\\\n'],\n ['\\r', '\\\\r'],\n ['\\t', '\\\\t'],\n ['\\\\', '\\\\\\\\'],\n ['|', '\\\\u{7c}'],\n [',', '\\\\u{2c}'],\n];\n\nfunction getCharOrReplacement(input) {\n for (const [search, replacement] of tagValueReplacements) {\n if (input === search) {\n return replacement;\n }\n }\n\n return input;\n}\n\nfunction sanitizeTagValue(value) {\n return [...value].reduce((acc, char) => acc + getCharOrReplacement(char), '');\n}\n\n/**\n * Sanitizes tags.\n */\nfunction sanitizeTags(unsanitizedTags) {\n const tags = {};\n for (const key in unsanitizedTags) {\n if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) {\n const sanitizedKey = sanitizeTagKey(key);\n tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key]));\n }\n }\n return tags;\n}\n\nexport { getBucketKey, sanitizeMetricKey, sanitizeTags, sanitizeUnit, serializeMetricBuckets, simpleHash };\n//# sourceMappingURL=utils.js.map\n"],"names":[],"mappings":";AAKA,SAAS,aACP,YACA,MACA,MACA,MACA;AACA,QAAM,kBAAkB,OAAO,QAAQ,kBAAkB,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC;AACvG,SAAO,GAAG,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,eAAe;AACtD;AAMA,SAAS,WAAW,GAAG;AACrB,MAAI,KAAK;AACT,WAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK;AACjC,UAAM,IAAI,EAAE,WAAW,CAAC;AACxB,UAAM,MAAM,KAAK,KAAK;AACtB,UAAM;AAAA,EACP;AACD,SAAO,OAAO;AAChB;AAgBA,SAAS,uBAAuB,mBAAmB;AACjD,MAAI,MAAM;AACV,aAAW,QAAQ,mBAAmB;AACpC,UAAM,aAAa,OAAO,QAAQ,KAAK,IAAI;AAC3C,UAAM,YAAY,WAAW,SAAS,IAA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]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.cjs","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/session.js"],"sourcesContent":["import { timestampInSeconds, uuid4, dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nfunction makeSession(context) {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nfunction updateSession(session, context = {}) {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nfunction closeSession(session, status) {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session) {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n });\n}\n\nexport { closeSession, makeSession, updateSession };\n//# sourceMappingURL=session.js.map\n"],"names":["timestampInSeconds","uuid4","dropUndefinedKeys"],"mappings":";;;;;AAUA,SAAS,YAAY,SAAS;AAE5B,QAAM,eAAeA,KAAAA;AAErB,QAAM,UAAU;AAAA,IACd,KAAKC,KAAAA,MAAO;AAAA,IACZ,MAAM;AAAA,IACN,WAAW;AAAA,IACX,SAAS;AAAA,IACT,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,QAAQ,MAAM,cAAc,OAAO;AAAA,EACvC;AAEE,MAAI,SAAS;AACX,kBAAc,SAAS,OAAO;AAAA,EAC/B;AAED,SAAO;AACT;AAcA,SAAS,cAAc,SAAS,UAAU,IAAI;AAC5C,MAAI,QAAQ,MAAM;AAChB,QAAI,CAAC,QAAQ,aAAa,QAAQ,KAAK,YAAY;AACjD,cAAQ,YAAY,QAAQ,KAAK;AAAA,IAClC;AAED,QAAI,CAAC,QAAQ,OAAO,CAAC,QAAQ,KAAK;AAChC,cAAQ,MAAM,QAAQ,KAAK,MAAM,QAAQ,KAAK,SAAS,QAAQ,KAAK;AAAA,IACrE;AAAA,EACF;AAED,UAAQ,YAAY,QAAQ,aAAaD,KAAkB,mBAAA;AAE3D,MAAI,QAAQ,oBAAoB;AAC9B,YAAQ,qBAAqB,QAAQ;AAAA,EACtC;AAED,MAAI,QAAQ,gBAAgB;AAC1B,YAAQ,iBAAiB,QAAQ;AAAA,EAClC;AACD,MAAI,QAAQ,KAAK;AAEf,YAAQ,MAAM,QAAQ,IAAI,WAAW,KAAK,QAAQ,MAAMC,KAAAA;EACzD;AACD,MAAI,QAAQ,SAAS,QAAW;AAC9B,YAAQ,OAAO,QAAQ;AAAA,EACxB;AACD,MAAI,CAAC,QAAQ,OAAO,QAAQ,KAAK;AAC/B,YAAQ,MAAM,GAAG,QAAQ;AAAA,
|
|
1
|
+
{"version":3,"file":"session.cjs","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/session.js"],"sourcesContent":["import { timestampInSeconds, uuid4, dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nfunction makeSession(context) {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nfunction updateSession(session, context = {}) {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nfunction closeSession(session, status) {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session) {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n });\n}\n\nexport { closeSession, makeSession, updateSession };\n//# sourceMappingURL=session.js.map\n"],"names":["timestampInSeconds","uuid4","dropUndefinedKeys"],"mappings":";;;;;AAUA,SAAS,YAAY,SAAS;AAE5B,QAAM,eAAeA,KAAAA;AAErB,QAAM,UAAU;AAAA,IACd,KAAKC,KAAAA,MAAO;AAAA,IACZ,MAAM;AAAA,IACN,WAAW;AAAA,IACX,SAAS;AAAA,IACT,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,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../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/session.js"],"sourcesContent":["import { timestampInSeconds, uuid4, dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nfunction makeSession(context) {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nfunction updateSession(session, context = {}) {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nfunction closeSession(session, status) {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session) {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n });\n}\n\nexport { closeSession, makeSession, updateSession };\n//# sourceMappingURL=session.js.map\n"],"names":[],"mappings":";;;AAUA,SAAS,YAAY,SAAS;AAE5B,QAAM,eAAe;AAErB,QAAM,UAAU;AAAA,IACd,KAAK,MAAO;AAAA,IACZ,MAAM;AAAA,IACN,WAAW;AAAA,IACX,SAAS;AAAA,IACT,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,QAAQ,MAAM,cAAc,OAAO;AAAA,EACvC;AAEE,MAAI,SAAS;AACX,kBAAc,SAAS,OAAO;AAAA,EAC/B;AAED,SAAO;AACT;AAcA,SAAS,cAAc,SAAS,UAAU,IAAI;AAC5C,MAAI,QAAQ,MAAM;AAChB,QAAI,CAAC,QAAQ,aAAa,QAAQ,KAAK,YAAY;AACjD,cAAQ,YAAY,QAAQ,KAAK;AAAA,IAClC;AAED,QAAI,CAAC,QAAQ,OAAO,CAAC,QAAQ,KAAK;AAChC,cAAQ,MAAM,QAAQ,KAAK,MAAM,QAAQ,KAAK,SAAS,QAAQ,KAAK;AAAA,IACrE;AAAA,EACF;AAED,UAAQ,YAAY,QAAQ,aAAa,mBAAkB;AAE3D,MAAI,QAAQ,oBAAoB;AAC9B,YAAQ,qBAAqB,QAAQ;AAAA,EACtC;AAED,MAAI,QAAQ,gBAAgB;AAC1B,YAAQ,iBAAiB,QAAQ;AAAA,EAClC;AACD,MAAI,QAAQ,KAAK;AAEf,YAAQ,MAAM,QAAQ,IAAI,WAAW,KAAK,QAAQ,MAAM;EACzD;AACD,MAAI,QAAQ,SAAS,QAAW;AAC9B,YAAQ,OAAO,QAAQ;AAAA,EACxB;AACD,MAAI,CAAC,QAAQ,OAAO,QAAQ,KAAK;AAC/B,YAAQ,MAAM,GAAG,QAAQ;AAAA,
|
|
1
|
+
{"version":3,"file":"session.js","sources":["../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/session.js"],"sourcesContent":["import { timestampInSeconds, uuid4, dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nfunction makeSession(context) {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nfunction updateSession(session, context = {}) {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nfunction closeSession(session, status) {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session) {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n });\n}\n\nexport { closeSession, makeSession, updateSession };\n//# sourceMappingURL=session.js.map\n"],"names":[],"mappings":";;;AAUA,SAAS,YAAY,SAAS;AAE5B,QAAM,eAAe;AAErB,QAAM,UAAU;AAAA,IACd,KAAK,MAAO;AAAA,IACZ,MAAM;AAAA,IACN,WAAW;AAAA,IACX,SAAS;AAAA,IACT,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,QAAQ,MAAM,cAAc,OAAO;AAAA,EACvC;AAEE,MAAI,SAAS;AACX,kBAAc,SAAS,OAAO;AAAA,EAC/B;AAED,SAAO;AACT;AAcA,SAAS,cAAc,SAAS,UAAU,IAAI;AAC5C,MAAI,QAAQ,MAAM;AAChB,QAAI,C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AY,QAAQ;AAAA,EAC7B;AACD,MAAI,OAAO,QAAQ,WAAW,UAAU;AACtC,YAAQ,SAAS,QAAQ;AAAA,EAC1B;AACD,MAAI,QAAQ,QAAQ;AAClB,YAAQ,SAAS,QAAQ;AAAA,EAC1B;AACH;AAaA,SAAS,aAAa,SAAS,QAAQ;AACrC,MAAI,UAAU,CAAA;AACd,MAAI,QAAQ;AACV,cAAU,EAAE;EAChB,WAAa,QAAQ,WAAW,MAAM;AAClC,cAAU,EAAE,QAAQ;EACrB;AAED,gBAAc,SAAS,OAAO;AAChC;AAWA,SAAS,cAAc,SAAS;AAC9B,SAAO,kBAAkB;AAAA,IACvB,KAAK,GAAG,QAAQ,GAAG;AAAA,IACnB,MAAM,QAAQ;AAAA;AAAA,IAEd,SAAS,IAAI,KAAK,QAAQ,UAAU,GAAI,EAAE,YAAa;AAAA,IACvD,WAAW,IAAI,KAAK,QAAQ,YAAY,GAAI,EAAE,YAAa;AAAA,IAC3D,QAAQ,QAAQ;AAAA,IAChB,QAAQ,QAAQ;AAAA,IAChB,KAAK,OAAO,QAAQ,QAAQ,YAAY,OAAO,QAAQ,QAAQ,WAAW,GAAG,QAAQ,GAAG,KAAK;AAAA,IAC7F,UAAU,QAAQ;AAAA,IAClB,oBAAoB,QAAQ;AAAA,IAC5B,OAAO;AAAA,MACL,SAAS,QAAQ;AAAA,MACjB,aAAa,QAAQ;AAAA,MACrB,YAAY,QAAQ;AAAA,MACpB,YAAY,QAAQ;AAAA,IACrB;AAAA,EACL,CAAG;AACH;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamicSamplingContext.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getClient, getCurrentScope } from '../exports.js';\nimport { getRootSpan } from '../utils/getRootSpan.js';\nimport { spanToJSON, spanIsSampled } from '../utils/spanUtils.js';\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nfunction getDynamicSamplingContextFromClient(\n trace_id,\n client,\n scope,\n) {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n // TODO(v8): Remove segment from User\n // eslint-disable-next-line deprecation/deprecation\n const { segment: user_segment } = (scope && scope.getUser()) || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n user_segment,\n public_key,\n trace_id,\n }) ;\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * A Span with a frozen dynamic sampling context.\n */\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nfunction getDynamicSamplingContextFromSpan(span) {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n // passing emit=false here to only emit later once the DSC is actually populated\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client, getCurrentScope());\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n const txn = getRootSpan(span) ;\n if (!txn) {\n return dsc;\n }\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n // For now we need to avoid breaking users who directly created a txn with a DSC, where this field is still set.\n // @see Transaction class constructor\n const v7FrozenDsc = txn && txn._frozenDynamicSamplingContext;\n if (v7FrozenDsc) {\n return v7FrozenDsc;\n }\n\n // TODO (v8): Replace txn.metadata with txn.attributes[]\n // We can't do this yet because attributes aren't always set yet.\n // eslint-disable-next-line deprecation/deprecation\n const { sampleRate: maybeSampleRate, source } = txn.metadata;\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const jsonSpan = spanToJSON(txn);\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n if (source && source !== 'url') {\n dsc.transaction = jsonSpan.description;\n }\n\n dsc.sampled = String(spanIsSampled(txn));\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\nexport { getDynamicSamplingContextFromClient, getDynamicSamplingContextFromSpan };\n//# sourceMappingURL=dynamicSamplingContext.js.map\n"],"names":["dropUndefinedKeys","DEFAULT_ENVIRONMENT","getClient","spanToJSON","getCurrentScope","getRootSpan","spanIsSampled"],"mappings":";;;;;;;AAWA,SAAS,oCACP,UACA,QACA,OACA;AACA,QAAM,UAAU,OAAO;AAEvB,QAAM,EAAE,WAAW,WAAU,IAAK,OAAO,OAAQ,KAAI;AAGrD,QAAM,EAAE,SAAS,iBAAkB,SAAS,MAAM,QAAS,KAAK;AAEhE,QAAM,MAAMA,OAAAA,kBAAkB;AAAA,IAC5B,aAAa,QAAQ,eAAeC,UAAmB;AAAA,IACvD,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG;AAED,SAAO,QAAQ,OAAO,KAAK,aAAa,GAAG;AAE3C,SAAO;AACT;AAaA,SAAS,kCAAkC,MAAM;AAC/C,QAAM,SAASC,UAAAA;AACf,MAAI,CAAC,QAAQ;AACX,WAAO;EACR;AAGD,QAAM,MAAM,oCAAoCC,UAAAA,WAAW,IAAI,EAAE,YAAY,IAAI,QAAQC,UAAe,gBAAA,CAAE;AAG1G,QAAM,MAAMC,wBAAY,IAAI;AAC5B,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACR;AAKD,QAAM,cAAc,OAAO,IAAI;AAC/B,MAAI,aAAa;AACf,WAAO;AAAA,EACR;AAKD,QAAM,EAAE,YAAY,iBAAiB,OAAM,IAAK,IAAI;AACpD,MAAI,mBAAmB,MAAM;AAC3B,QAAI,cAAc,GAAG;AAAA,
|
|
1
|
+
{"version":3,"file":"dynamicSamplingContext.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getClient, getCurrentScope } from '../exports.js';\nimport { getRootSpan } from '../utils/getRootSpan.js';\nimport { spanToJSON, spanIsSampled } from '../utils/spanUtils.js';\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nfunction getDynamicSamplingContextFromClient(\n trace_id,\n client,\n scope,\n) {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n // TODO(v8): Remove segment from User\n // eslint-disable-next-line deprecation/deprecation\n const { segment: user_segment } = (scope && scope.getUser()) || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n user_segment,\n public_key,\n trace_id,\n }) ;\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * A Span with a frozen dynamic sampling context.\n */\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nfunction getDynamicSamplingContextFromSpan(span) {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n // passing emit=false here to only emit later once the DSC is actually populated\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client, getCurrentScope());\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n const txn = getRootSpan(span) ;\n if (!txn) {\n return dsc;\n }\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n // For now we need to avoid breaking users who directly created a txn with a DSC, where this field is still set.\n // @see Transaction class constructor\n const v7FrozenDsc = txn && txn._frozenDynamicSamplingContext;\n if (v7FrozenDsc) {\n return v7FrozenDsc;\n }\n\n // TODO (v8): Replace txn.metadata with txn.attributes[]\n // We can't do this yet because attributes aren't always set yet.\n // eslint-disable-next-line deprecation/deprecation\n const { sampleRate: maybeSampleRate, source } = txn.metadata;\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const jsonSpan = spanToJSON(txn);\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n if (source && source !== 'url') {\n dsc.transaction = jsonSpan.description;\n }\n\n dsc.sampled = String(spanIsSampled(txn));\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\nexport { getDynamicSamplingContextFromClient, getDynamicSamplingContextFromSpan };\n//# sourceMappingURL=dynamicSamplingContext.js.map\n"],"names":["dropUndefinedKeys","DEFAULT_ENVIRONMENT","getClient","spanToJSON","getCurrentScope","getRootSpan","spanIsSampled"],"mappings":";;;;;;;AAWA,SAAS,oCACP,UACA,QACA,OACA;AACA,QAAM,UAAU,OAAO;AAEvB,QAAM,EAAE,WAAW,WAAU,IAAK,OAAO,OAAQ,KAAI;AAGrD,QAAM,EAAE,SAAS,iBAAkB,SAAS,MAAM,QAAS,KAAK;AAEhE,QAAM,MAAMA,OAAAA,kBAAkB;AAAA,IAC5B,aAAa,QAAQ,eAAeC,UAAmB;AAAA,IACvD,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG;AAED,SAAO,QAAQ,OAAO,KAAK,aAAa,GAAG;AAE3C,SAAO;AACT;AAaA,SAAS,kCAAkC,MAAM;AAC/C,QAAM,SAASC,UAAAA;AACf,MAAI,CAAC,QAAQ;AACX,WAAO;EACR;AAGD,QAAM,MAAM,oCAAoCC,UAAAA,WAAW,IAAI,EAAE,YAAY,IAAI,QAAQC,UAAe,gBAAA,CAAE;AAG1G,QAAM,MAAMC,wBAAY,IAAI;AAC5B,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACR;AAKD,QAAM,cAAc,OAAO,IAAI;AAC/B,MAAI,aAAa;AACf,WAAO;AAAA,EACR;AAKD,QAAM,EAAE,YAAY,iBAAiB,OAAM,IAAK,IAAI;AACpD,MAAI,mBAAmB,MAAM;AAC3B,QAAI,cAAc,GAAG,eAAe;AAAA,EACrC;AAGD,QAAM,WAAWF,qBAAW,GAAG;AAG/B,MAAI,UAAU,WAAW,OAAO;AAC9B,QAAI,cAAc,SAAS;AAAA,EAC5B;AAED,MAAI,UAAU,OAAOG,UAAAA,cAAc,GAAG,CAAC;AAEvC,SAAO,QAAQ,OAAO,KAAK,aAAa,GAAG;AAE3C,SAAO;AACT;;;","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamicSamplingContext.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getClient, getCurrentScope } from '../exports.js';\nimport { getRootSpan } from '../utils/getRootSpan.js';\nimport { spanToJSON, spanIsSampled } from '../utils/spanUtils.js';\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nfunction getDynamicSamplingContextFromClient(\n trace_id,\n client,\n scope,\n) {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n // TODO(v8): Remove segment from User\n // eslint-disable-next-line deprecation/deprecation\n const { segment: user_segment } = (scope && scope.getUser()) || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n user_segment,\n public_key,\n trace_id,\n }) ;\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * A Span with a frozen dynamic sampling context.\n */\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nfunction getDynamicSamplingContextFromSpan(span) {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n // passing emit=false here to only emit later once the DSC is actually populated\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client, getCurrentScope());\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n const txn = getRootSpan(span) ;\n if (!txn) {\n return dsc;\n }\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n // For now we need to avoid breaking users who directly created a txn with a DSC, where this field is still set.\n // @see Transaction class constructor\n const v7FrozenDsc = txn && txn._frozenDynamicSamplingContext;\n if (v7FrozenDsc) {\n return v7FrozenDsc;\n }\n\n // TODO (v8): Replace txn.metadata with txn.attributes[]\n // We can't do this yet because attributes aren't always set yet.\n // eslint-disable-next-line deprecation/deprecation\n const { sampleRate: maybeSampleRate, source } = txn.metadata;\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const jsonSpan = spanToJSON(txn);\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n if (source && source !== 'url') {\n dsc.transaction = jsonSpan.description;\n }\n\n dsc.sampled = String(spanIsSampled(txn));\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\nexport { getDynamicSamplingContextFromClient, getDynamicSamplingContextFromSpan };\n//# sourceMappingURL=dynamicSamplingContext.js.map\n"],"names":[],"mappings":";;;;;AAWA,SAAS,oCACP,UACA,QACA,OACA;AACA,QAAM,UAAU,OAAO;AAEvB,QAAM,EAAE,WAAW,WAAU,IAAK,OAAO,OAAQ,KAAI;AAGrD,QAAM,EAAE,SAAS,iBAAkB,SAAS,MAAM,QAAS,KAAK;AAEhE,QAAM,MAAM,kBAAkB;AAAA,IAC5B,aAAa,QAAQ,eAAe;AAAA,IACpC,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG;AAED,SAAO,QAAQ,OAAO,KAAK,aAAa,GAAG;AAE3C,SAAO;AACT;AAaA,SAAS,kCAAkC,MAAM;AAC/C,QAAM,SAAS;AACf,MAAI,CAAC,QAAQ;AACX,WAAO;EACR;AAGD,QAAM,MAAM,oCAAoC,WAAW,IAAI,EAAE,YAAY,IAAI,QAAQ,gBAAe,CAAE;AAG1G,QAAM,MAAM,YAAY,IAAI;AAC5B,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACR;AAKD,QAAM,cAAc,OAAO,IAAI;AAC/B,MAAI,aAAa;AACf,WAAO;AAAA,EACR;AAKD,QAAM,EAAE,YAAY,iBAAiB,OAAM,IAAK,IAAI;AACpD,MAAI,mBAAmB,MAAM;AAC3B,QAAI,cAAc,GAAG;AAAA,
|
|
1
|
+
{"version":3,"file":"dynamicSamplingContext.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js"],"sourcesContent":["import { dropUndefinedKeys } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getClient, getCurrentScope } from '../exports.js';\nimport { getRootSpan } from '../utils/getRootSpan.js';\nimport { spanToJSON, spanIsSampled } from '../utils/spanUtils.js';\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nfunction getDynamicSamplingContextFromClient(\n trace_id,\n client,\n scope,\n) {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n // TODO(v8): Remove segment from User\n // eslint-disable-next-line deprecation/deprecation\n const { segment: user_segment } = (scope && scope.getUser()) || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n user_segment,\n public_key,\n trace_id,\n }) ;\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * A Span with a frozen dynamic sampling context.\n */\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nfunction getDynamicSamplingContextFromSpan(span) {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n // passing emit=false here to only emit later once the DSC is actually populated\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client, getCurrentScope());\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n const txn = getRootSpan(span) ;\n if (!txn) {\n return dsc;\n }\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n // For now we need to avoid breaking users who directly created a txn with a DSC, where this field is still set.\n // @see Transaction class constructor\n const v7FrozenDsc = txn && txn._frozenDynamicSamplingContext;\n if (v7FrozenDsc) {\n return v7FrozenDsc;\n }\n\n // TODO (v8): Replace txn.metadata with txn.attributes[]\n // We can't do this yet because attributes aren't always set yet.\n // eslint-disable-next-line deprecation/deprecation\n const { sampleRate: maybeSampleRate, source } = txn.metadata;\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const jsonSpan = spanToJSON(txn);\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n if (source && source !== 'url') {\n dsc.transaction = jsonSpan.description;\n }\n\n dsc.sampled = String(spanIsSampled(txn));\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\nexport { getDynamicSamplingContextFromClient, getDynamicSamplingContextFromSpan };\n//# sourceMappingURL=dynamicSamplingContext.js.map\n"],"names":[],"mappings":";;;;;AAWA,SAAS,oCACP,UACA,QACA,OACA;AACA,QAAM,UAAU,OAAO;AAEvB,QAAM,EAAE,WAAW,WAAU,IAAK,OAAO,OAAQ,KAAI;AAGrD,QAAM,EAAE,SAAS,iBAAkB,SAAS,MAAM,QAAS,KAAK;AAEhE,QAAM,MAAM,kBAAkB;AAAA,IAC5B,aAAa,QAAQ,eAAe;AAAA,IACpC,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG;AAED,SAAO,QAAQ,OAAO,KAAK,aAAa,GAAG;AAE3C,SAAO;AACT;AAaA,SAAS,kCAAkC,MAAM;AAC/C,QAAM,SAAS;AACf,MAAI,CAAC,QAAQ;AACX,WAAO;EACR;AAGD,QAAM,MAAM,oCAAoC,WAAW,IAAI,EAAE,YAAY,IAAI,QAAQ,gBAAe,CAAE;AAG1G,QAAM,MAAM,YAAY,IAAI;AAC5B,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACR;AAKD,QAAM,cAAc,OAAO,IAAI;AAC/B,MAAI,aAAa;AACf,WAAO;AAAA,EACR;AAKD,QAAM,EAAE,YAAY,iBAAiB,OAAM,IAAK,IAAI;AACpD,MAAI,mBAAmB,MAAM;AAC3B,QAAI,cAAc,GAAG,eAAe;AAAA,EACrC;AAGD,QAAM,WAAW,WAAW,GAAG;AAG/B,MAAI,UAAU,WAAW,OAAO;AAC9B,QAAI,cAAc,SAAS;AAAA,EAC5B;AAED,MAAI,UAAU,OAAO,cAAc,GAAG,CAAC;AAEvC,SAAO,QAAQ,OAAO,KAAK,aAAa,GAAG;AAE3C,SAAO;AACT;","x_google_ignoreList":[0]}
|
package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/errors.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/errors.js"],"sourcesContent":["import { addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getActiveTransaction } from './utils.js';\n\nlet errorsInstrumented = false;\n\n/**\n * Configures global error listeners\n */\nfunction registerErrorInstrumentation() {\n if (errorsInstrumented) {\n return;\n }\n\n errorsInstrumented = true;\n addGlobalErrorInstrumentationHandler(errorCallback);\n addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\nfunction errorCallback() {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n const status = 'internal_error';\n DEBUG_BUILD && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n activeTransaction.setStatus(status);\n }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n\nexport { registerErrorInstrumentation };\n//# sourceMappingURL=errors.js.map\n"],"names":["addGlobalErrorInstrumentationHandler","addGlobalUnhandledRejectionInstrumentationHandler","getActiveTransaction","DEBUG_BUILD","logger"],"mappings":";;;;;;;AAIA,IAAI,qBAAqB;AAKzB,SAAS,+BAA+B;AACtC,MAAI,oBAAoB;AACtB;AAAA,EACD;AAED,uBAAqB;AACrBA,cAAoC,qCAAC,aAAa;AAClDC,2BAAiD,kDAAC,aAAa;AACjE;AAKA,SAAS,gBAAgB;AAEvB,QAAM,oBAAoBC,MAAAA;AAC1B,MAAI,mBAAmB;AACrB,UAAM,SAAS;AACfC,eAAW,eAAIC,OAAM,OAAC,IAAI,0BAA0B,
|
|
1
|
+
{"version":3,"file":"errors.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/errors.js"],"sourcesContent":["import { addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getActiveTransaction } from './utils.js';\n\nlet errorsInstrumented = false;\n\n/**\n * Configures global error listeners\n */\nfunction registerErrorInstrumentation() {\n if (errorsInstrumented) {\n return;\n }\n\n errorsInstrumented = true;\n addGlobalErrorInstrumentationHandler(errorCallback);\n addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\nfunction errorCallback() {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n const status = 'internal_error';\n DEBUG_BUILD && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n activeTransaction.setStatus(status);\n }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n\nexport { registerErrorInstrumentation };\n//# sourceMappingURL=errors.js.map\n"],"names":["addGlobalErrorInstrumentationHandler","addGlobalUnhandledRejectionInstrumentationHandler","getActiveTransaction","DEBUG_BUILD","logger"],"mappings":";;;;;;;AAIA,IAAI,qBAAqB;AAKzB,SAAS,+BAA+B;AACtC,MAAI,oBAAoB;AACtB;AAAA,EACD;AAED,uBAAqB;AACrBA,cAAoC,qCAAC,aAAa;AAClDC,2BAAiD,kDAAC,aAAa;AACjE;AAKA,SAAS,gBAAgB;AAEvB,QAAM,oBAAoBC,MAAAA;AAC1B,MAAI,mBAAmB;AACrB,UAAM,SAAS;AACfC,eAAW,eAAIC,OAAM,OAAC,IAAI,0BAA0B,MAAM,0BAA0B;AACpF,sBAAkB,UAAU,MAAM;AAAA,EACnC;AACH;AAIA,cAAc,MAAM;;","x_google_ignoreList":[0]}
|
package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/errors.js"],"sourcesContent":["import { addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getActiveTransaction } from './utils.js';\n\nlet errorsInstrumented = false;\n\n/**\n * Configures global error listeners\n */\nfunction registerErrorInstrumentation() {\n if (errorsInstrumented) {\n return;\n }\n\n errorsInstrumented = true;\n addGlobalErrorInstrumentationHandler(errorCallback);\n addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\nfunction errorCallback() {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n const status = 'internal_error';\n DEBUG_BUILD && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n activeTransaction.setStatus(status);\n }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n\nexport { registerErrorInstrumentation };\n//# sourceMappingURL=errors.js.map\n"],"names":[],"mappings":";;;;;AAIA,IAAI,qBAAqB;AAKzB,SAAS,+BAA+B;AACtC,MAAI,oBAAoB;AACtB;AAAA,EACD;AAED,uBAAqB;AACrB,uCAAqC,aAAa;AAClD,oDAAkD,aAAa;AACjE;AAKA,SAAS,gBAAgB;AAEvB,QAAM,oBAAoB;AAC1B,MAAI,mBAAmB;AACrB,UAAM,SAAS;AACf,mBAAe,OAAO,IAAI,0BAA0B,
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/errors.js"],"sourcesContent":["import { addGlobalErrorInstrumentationHandler, addGlobalUnhandledRejectionInstrumentationHandler, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getActiveTransaction } from './utils.js';\n\nlet errorsInstrumented = false;\n\n/**\n * Configures global error listeners\n */\nfunction registerErrorInstrumentation() {\n if (errorsInstrumented) {\n return;\n }\n\n errorsInstrumented = true;\n addGlobalErrorInstrumentationHandler(errorCallback);\n addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);\n}\n\n/**\n * If an error or unhandled promise occurs, we mark the active transaction as failed\n */\nfunction errorCallback() {\n // eslint-disable-next-line deprecation/deprecation\n const activeTransaction = getActiveTransaction();\n if (activeTransaction) {\n const status = 'internal_error';\n DEBUG_BUILD && logger.log(`[Tracing] Transaction: ${status} -> Global error occured`);\n activeTransaction.setStatus(status);\n }\n}\n\n// The function name will be lost when bundling but we need to be able to identify this listener later to maintain the\n// node.js default exit behaviour\nerrorCallback.tag = 'sentry_tracingErrorCallback';\n\nexport { registerErrorInstrumentation };\n//# sourceMappingURL=errors.js.map\n"],"names":[],"mappings":";;;;;AAIA,IAAI,qBAAqB;AAKzB,SAAS,+BAA+B;AACtC,MAAI,oBAAoB;AACtB;AAAA,EACD;AAED,uBAAqB;AACrB,uCAAqC,aAAa;AAClD,oDAAkD,aAAa;AACjE;AAKA,SAAS,gBAAgB;AAEvB,QAAM,oBAAoB;AAC1B,MAAI,mBAAmB;AACrB,UAAM,SAAS;AACf,mBAAe,OAAO,IAAI,0BAA0B,MAAM,0BAA0B;AACpF,sBAAkB,UAAU,MAAM;AAAA,EACnC;AACH;AAIA,cAAc,MAAM;","x_google_ignoreList":[0]}
|
package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/hubextensions.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hubextensions.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/hubextensions.js"],"sourcesContent":["import { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getMainCarrier } from '../hub.js';\nimport { spanToTraceHeader } from '../utils/spanUtils.js';\nimport { registerErrorInstrumentation } from './errors.js';\nimport { IdleTransaction } from './idletransaction.js';\nimport { sampleTransaction } from './sampling.js';\nimport { Transaction } from './transaction.js';\n\n/** Returns all trace headers that are currently on the top scope. */\n// eslint-disable-next-line deprecation/deprecation\nfunction traceHeaders() {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const span = scope.getSpan();\n\n return span\n ? {\n 'sentry-trace': spanToTraceHeader(span),\n }\n : {};\n}\n\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\nfunction _startTransaction(\n // eslint-disable-next-line deprecation/deprecation\n\n transactionContext,\n customSamplingContext,\n) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options = (client && client.getOptions()) || {};\n\n const configInstrumenter = options.instrumenter || 'sentry';\n const transactionInstrumenter = transactionContext.instrumenter || 'sentry';\n\n if (configInstrumenter !== transactionInstrumenter) {\n DEBUG_BUILD &&\n logger.error(\n `A transaction was started with instrumenter=\\`${transactionInstrumenter}\\`, but the SDK is configured with the \\`${configInstrumenter}\\` instrumenter.\nThe transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,\n );\n\n // eslint-disable-next-line deprecation/deprecation\n transactionContext.sampled = false;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new Transaction(transactionContext, this);\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Create new idle transaction.\n */\nfunction startIdleTransaction(\n // eslint-disable-next-line deprecation/deprecation\n hub,\n transactionContext,\n idleTimeout,\n finalTimeout,\n onScope,\n customSamplingContext,\n heartbeatInterval,\n delayAutoFinishUntilSignal = false,\n) {\n // eslint-disable-next-line deprecation/deprecation\n const client = hub.getClient();\n const options = (client && client.getOptions()) || {};\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new IdleTransaction(\n transactionContext,\n hub,\n idleTimeout,\n finalTimeout,\n heartbeatInterval,\n onScope,\n delayAutoFinishUntilSignal,\n );\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Adds tracing extensions to the global hub.\n */\nfunction addTracingExtensions() {\n const carrier = getMainCarrier();\n if (!carrier.__SENTRY__) {\n return;\n }\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startTransaction) {\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n\n registerErrorInstrumentation();\n}\n\nexport { addTracingExtensions, startIdleTransaction };\n//# sourceMappingURL=hubextensions.js.map\n"],"names":["spanToTraceHeader","DEBUG_BUILD","logger","transaction","Transaction","sampleTransaction","getMainCarrier","registerErrorInstrumentation"],"mappings":";;;;;;;;;AAWA,SAAS,eAAe;AAEtB,QAAM,QAAQ,KAAK;AAEnB,QAAM,OAAO,MAAM;AAEnB,SAAO,OACH;AAAA,IACE,gBAAgBA,UAAiB,kBAAC,IAAI;AAAA,EACvC,IACD;AACN;AAiBA,SAAS,kBAGP,oBACA,uBACA;AAEA,QAAM,SAAS,KAAK;AACpB,QAAM,UAAW,UAAU,OAAO,WAAU,KAAO,CAAA;AAEnD,QAAM,qBAAqB,QAAQ,gBAAgB;AACnD,QAAM,0BAA0B,mBAAmB,gBAAgB;AAEnE,MAAI,uBAAuB,yBAAyB;AAClDC,eAAW,eACTC,OAAAA,OAAO;AAAA,MACL,iDAAiD,
|
|
1
|
+
{"version":3,"file":"hubextensions.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/hubextensions.js"],"sourcesContent":["import { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getMainCarrier } from '../hub.js';\nimport { spanToTraceHeader } from '../utils/spanUtils.js';\nimport { registerErrorInstrumentation } from './errors.js';\nimport { IdleTransaction } from './idletransaction.js';\nimport { sampleTransaction } from './sampling.js';\nimport { Transaction } from './transaction.js';\n\n/** Returns all trace headers that are currently on the top scope. */\n// eslint-disable-next-line deprecation/deprecation\nfunction traceHeaders() {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const span = scope.getSpan();\n\n return span\n ? {\n 'sentry-trace': spanToTraceHeader(span),\n }\n : {};\n}\n\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\nfunction _startTransaction(\n // eslint-disable-next-line deprecation/deprecation\n\n transactionContext,\n customSamplingContext,\n) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options = (client && client.getOptions()) || {};\n\n const configInstrumenter = options.instrumenter || 'sentry';\n const transactionInstrumenter = transactionContext.instrumenter || 'sentry';\n\n if (configInstrumenter !== transactionInstrumenter) {\n DEBUG_BUILD &&\n logger.error(\n `A transaction was started with instrumenter=\\`${transactionInstrumenter}\\`, but the SDK is configured with the \\`${configInstrumenter}\\` instrumenter.\nThe transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,\n );\n\n // eslint-disable-next-line deprecation/deprecation\n transactionContext.sampled = false;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new Transaction(transactionContext, this);\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Create new idle transaction.\n */\nfunction startIdleTransaction(\n // eslint-disable-next-line deprecation/deprecation\n hub,\n transactionContext,\n idleTimeout,\n finalTimeout,\n onScope,\n customSamplingContext,\n heartbeatInterval,\n delayAutoFinishUntilSignal = false,\n) {\n // eslint-disable-next-line deprecation/deprecation\n const client = hub.getClient();\n const options = (client && client.getOptions()) || {};\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new IdleTransaction(\n transactionContext,\n hub,\n idleTimeout,\n finalTimeout,\n heartbeatInterval,\n onScope,\n delayAutoFinishUntilSignal,\n );\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Adds tracing extensions to the global hub.\n */\nfunction addTracingExtensions() {\n const carrier = getMainCarrier();\n if (!carrier.__SENTRY__) {\n return;\n }\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startTransaction) {\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n\n registerErrorInstrumentation();\n}\n\nexport { addTracingExtensions, startIdleTransaction };\n//# sourceMappingURL=hubextensions.js.map\n"],"names":["spanToTraceHeader","DEBUG_BUILD","logger","transaction","Transaction","sampleTransaction","getMainCarrier","registerErrorInstrumentation"],"mappings":";;;;;;;;;AAWA,SAAS,eAAe;AAEtB,QAAM,QAAQ,KAAK;AAEnB,QAAM,OAAO,MAAM;AAEnB,SAAO,OACH;AAAA,IACE,gBAAgBA,UAAiB,kBAAC,IAAI;AAAA,EACvC,IACD;AACN;AAiBA,SAAS,kBAGP,oBACA,uBACA;AAEA,QAAM,SAAS,KAAK;AACpB,QAAM,UAAW,UAAU,OAAO,WAAU,KAAO,CAAA;AAEnD,QAAM,qBAAqB,QAAQ,gBAAgB;AACnD,QAAM,0BAA0B,mBAAmB,gBAAgB;AAEnE,MAAI,uBAAuB,yBAAyB;AAClDC,eAAW,eACTC,OAAAA,OAAO;AAAA,MACL,iDAAiD,uBAAuB,4CAA4C,kBAAkB;AAAA,sDACxF,kBAAkB;AAAA,IACxE;AAGI,uBAAmB,UAAU;AAAA,EAC9B;AAGD,MAAIC,gBAAc,IAAIC,YAAAA,YAAY,oBAAoB,IAAI;AAC1DD,kBAAcE,SAAAA,kBAAkBF,eAAa,SAAS;AAAA,IACpD,MAAM,mBAAmB;AAAA,IACzB,eAAe,mBAAmB;AAAA,IAClC;AAAA,IACA,YAAY;AAAA;AAAA,MAEV,GAAG,mBAAmB;AAAA,MACtB,GAAG,mBAAmB;AAAA,IACvB;AAAA,IACD,GAAG;AAAA,EACP,CAAG;AACD,MAAIA,cAAY,eAAe;AAC7BA,kBAAY,iBAAiB,QAAQ,gBAAiB,QAAQ,aAAa,QAAU;AAAA,EACtF;AACD,MAAI,UAAU,OAAO,MAAM;AACzB,WAAO,KAAK,oBAAoBA,aAAW;AAAA,EAC5C;AACD,SAAOA;AACT;AAqDA,SAAS,uBAAuB;AAC9B,QAAM,UAAUG,IAAAA;AAChB,MAAI,CAAC,QAAQ,YAAY;AACvB;AAAA,EACD;AACD,UAAQ,WAAW,aAAa,QAAQ,WAAW,cAAc;AACjE,MAAI,CAAC,QAAQ,WAAW,WAAW,kBAAkB;AACnD,YAAQ,WAAW,WAAW,mBAAmB;AAAA,EAClD;AACD,MAAI,CAAC,QAAQ,WAAW,WAAW,cAAc;AAC/C,YAAQ,WAAW,WAAW,eAAe;AAAA,EAC9C;AAEDC,SAAAA;AACF;;","x_google_ignoreList":[0]}
|
package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/hubextensions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hubextensions.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/hubextensions.js"],"sourcesContent":["import { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getMainCarrier } from '../hub.js';\nimport { spanToTraceHeader } from '../utils/spanUtils.js';\nimport { registerErrorInstrumentation } from './errors.js';\nimport { IdleTransaction } from './idletransaction.js';\nimport { sampleTransaction } from './sampling.js';\nimport { Transaction } from './transaction.js';\n\n/** Returns all trace headers that are currently on the top scope. */\n// eslint-disable-next-line deprecation/deprecation\nfunction traceHeaders() {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const span = scope.getSpan();\n\n return span\n ? {\n 'sentry-trace': spanToTraceHeader(span),\n }\n : {};\n}\n\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\nfunction _startTransaction(\n // eslint-disable-next-line deprecation/deprecation\n\n transactionContext,\n customSamplingContext,\n) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options = (client && client.getOptions()) || {};\n\n const configInstrumenter = options.instrumenter || 'sentry';\n const transactionInstrumenter = transactionContext.instrumenter || 'sentry';\n\n if (configInstrumenter !== transactionInstrumenter) {\n DEBUG_BUILD &&\n logger.error(\n `A transaction was started with instrumenter=\\`${transactionInstrumenter}\\`, but the SDK is configured with the \\`${configInstrumenter}\\` instrumenter.\nThe transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,\n );\n\n // eslint-disable-next-line deprecation/deprecation\n transactionContext.sampled = false;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new Transaction(transactionContext, this);\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Create new idle transaction.\n */\nfunction startIdleTransaction(\n // eslint-disable-next-line deprecation/deprecation\n hub,\n transactionContext,\n idleTimeout,\n finalTimeout,\n onScope,\n customSamplingContext,\n heartbeatInterval,\n delayAutoFinishUntilSignal = false,\n) {\n // eslint-disable-next-line deprecation/deprecation\n const client = hub.getClient();\n const options = (client && client.getOptions()) || {};\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new IdleTransaction(\n transactionContext,\n hub,\n idleTimeout,\n finalTimeout,\n heartbeatInterval,\n onScope,\n delayAutoFinishUntilSignal,\n );\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Adds tracing extensions to the global hub.\n */\nfunction addTracingExtensions() {\n const carrier = getMainCarrier();\n if (!carrier.__SENTRY__) {\n return;\n }\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startTransaction) {\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n\n registerErrorInstrumentation();\n}\n\nexport { addTracingExtensions, startIdleTransaction };\n//# sourceMappingURL=hubextensions.js.map\n"],"names":[],"mappings":";;;;;;;AAWA,SAAS,eAAe;AAEtB,QAAM,QAAQ,KAAK;AAEnB,QAAM,OAAO,MAAM;AAEnB,SAAO,OACH;AAAA,IACE,gBAAgB,kBAAkB,IAAI;AAAA,EACvC,IACD;AACN;AAiBA,SAAS,kBAGP,oBACA,uBACA;AAEA,QAAM,SAAS,KAAK;AACpB,QAAM,UAAW,UAAU,OAAO,WAAU,KAAO,CAAA;AAEnD,QAAM,qBAAqB,QAAQ,gBAAgB;AACnD,QAAM,0BAA0B,mBAAmB,gBAAgB;AAEnE,MAAI,uBAAuB,yBAAyB;AAClD,mBACE,OAAO;AAAA,MACL,iDAAiD,
|
|
1
|
+
{"version":3,"file":"hubextensions.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/hubextensions.js"],"sourcesContent":["import { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { getMainCarrier } from '../hub.js';\nimport { spanToTraceHeader } from '../utils/spanUtils.js';\nimport { registerErrorInstrumentation } from './errors.js';\nimport { IdleTransaction } from './idletransaction.js';\nimport { sampleTransaction } from './sampling.js';\nimport { Transaction } from './transaction.js';\n\n/** Returns all trace headers that are currently on the top scope. */\n// eslint-disable-next-line deprecation/deprecation\nfunction traceHeaders() {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const span = scope.getSpan();\n\n return span\n ? {\n 'sentry-trace': spanToTraceHeader(span),\n }\n : {};\n}\n\n/**\n * Creates a new transaction and adds a sampling decision if it doesn't yet have one.\n *\n * The Hub.startTransaction method delegates to this method to do its work, passing the Hub instance in as `this`, as if\n * it had been called on the hub directly. Exists as a separate function so that it can be injected into the class as an\n * \"extension method.\"\n *\n * @param this: The Hub starting the transaction\n * @param transactionContext: Data used to configure the transaction\n * @param CustomSamplingContext: Optional data to be provided to the `tracesSampler` function (if any)\n *\n * @returns The new transaction\n *\n * @see {@link Hub.startTransaction}\n */\nfunction _startTransaction(\n // eslint-disable-next-line deprecation/deprecation\n\n transactionContext,\n customSamplingContext,\n) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options = (client && client.getOptions()) || {};\n\n const configInstrumenter = options.instrumenter || 'sentry';\n const transactionInstrumenter = transactionContext.instrumenter || 'sentry';\n\n if (configInstrumenter !== transactionInstrumenter) {\n DEBUG_BUILD &&\n logger.error(\n `A transaction was started with instrumenter=\\`${transactionInstrumenter}\\`, but the SDK is configured with the \\`${configInstrumenter}\\` instrumenter.\nThe transaction will not be sampled. Please use the ${configInstrumenter} instrumentation to start transactions.`,\n );\n\n // eslint-disable-next-line deprecation/deprecation\n transactionContext.sampled = false;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new Transaction(transactionContext, this);\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Create new idle transaction.\n */\nfunction startIdleTransaction(\n // eslint-disable-next-line deprecation/deprecation\n hub,\n transactionContext,\n idleTimeout,\n finalTimeout,\n onScope,\n customSamplingContext,\n heartbeatInterval,\n delayAutoFinishUntilSignal = false,\n) {\n // eslint-disable-next-line deprecation/deprecation\n const client = hub.getClient();\n const options = (client && client.getOptions()) || {};\n\n // eslint-disable-next-line deprecation/deprecation\n let transaction = new IdleTransaction(\n transactionContext,\n hub,\n idleTimeout,\n finalTimeout,\n heartbeatInterval,\n onScope,\n delayAutoFinishUntilSignal,\n );\n transaction = sampleTransaction(transaction, options, {\n name: transactionContext.name,\n parentSampled: transactionContext.parentSampled,\n transactionContext,\n attributes: {\n // eslint-disable-next-line deprecation/deprecation\n ...transactionContext.data,\n ...transactionContext.attributes,\n },\n ...customSamplingContext,\n });\n if (transaction.isRecording()) {\n transaction.initSpanRecorder(options._experiments && (options._experiments.maxSpans ));\n }\n if (client && client.emit) {\n client.emit('startTransaction', transaction);\n }\n return transaction;\n}\n\n/**\n * Adds tracing extensions to the global hub.\n */\nfunction addTracingExtensions() {\n const carrier = getMainCarrier();\n if (!carrier.__SENTRY__) {\n return;\n }\n carrier.__SENTRY__.extensions = carrier.__SENTRY__.extensions || {};\n if (!carrier.__SENTRY__.extensions.startTransaction) {\n carrier.__SENTRY__.extensions.startTransaction = _startTransaction;\n }\n if (!carrier.__SENTRY__.extensions.traceHeaders) {\n carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;\n }\n\n registerErrorInstrumentation();\n}\n\nexport { addTracingExtensions, startIdleTransaction };\n//# sourceMappingURL=hubextensions.js.map\n"],"names":[],"mappings":";;;;;;;AAWA,SAAS,eAAe;AAEtB,QAAM,QAAQ,KAAK;AAEnB,QAAM,OAAO,MAAM;AAEnB,SAAO,OACH;AAAA,IACE,gBAAgB,kBAAkB,IAAI;AAAA,EACvC,IACD;AACN;AAiBA,SAAS,kBAGP,oBACA,uBACA;AAEA,QAAM,SAAS,KAAK;AACpB,QAAM,UAAW,UAAU,OAAO,WAAU,KAAO,CAAA;AAEnD,QAAM,qBAAqB,QAAQ,gBAAgB;AACnD,QAAM,0BAA0B,mBAAmB,gBAAgB;AAEnE,MAAI,uBAAuB,yBAAyB;AAClD,mBACE,OAAO;AAAA,MACL,iDAAiD,uBAAuB,4CAA4C,kBAAkB;AAAA,sDACxF,kBAAkB;AAAA,IACxE;AAGI,uBAAmB,UAAU;AAAA,EAC9B;AAGD,MAAI,cAAc,IAAI,YAAY,oBAAoB,IAAI;AAC1D,gBAAc,kBAAkB,aAAa,SAAS;AAAA,IACpD,MAAM,mBAAmB;AAAA,IACzB,eAAe,mBAAmB;AAAA,IAClC;AAAA,IACA,YAAY;AAAA;AAAA,MAEV,GAAG,mBAAmB;AAAA,MACtB,GAAG,mBAAmB;AAAA,IACvB;AAAA,IACD,GAAG;AAAA,EACP,CAAG;AACD,MAAI,YAAY,eAAe;AAC7B,gBAAY,iBAAiB,QAAQ,gBAAiB,QAAQ,aAAa,QAAU;AAAA,EACtF;AACD,MAAI,UAAU,OAAO,MAAM;AACzB,WAAO,KAAK,oBAAoB,WAAW;AAAA,EAC5C;AACD,SAAO;AACT;AAqDA,SAAS,uBAAuB;AAC9B,QAAM,UAAU;AAChB,MAAI,CAAC,QAAQ,YAAY;AACvB;AAAA,EACD;AACD,UAAQ,WAAW,aAAa,QAAQ,WAAW,cAAc;AACjE,MAAI,CAAC,QAAQ,WAAW,WAAW,kBAAkB;AACnD,YAAQ,WAAW,WAAW,mBAAmB;AAAA,EAClD;AACD,MAAI,CAAC,QAAQ,WAAW,WAAW,cAAc;AAC/C,YAAQ,WAAW,WAAW,eAAe;AAAA,EAC9C;AAED;AACF;","x_google_ignoreList":[0]}
|
package/dist/_node_modules/@sentry/node/_node_modules/@sentry/core/esm/tracing/sampling.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sampling.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/sampling.js"],"sourcesContent":["import { isNaN, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '../semanticAttributes.js';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled.js';\nimport { spanToJSON } from '../utils/spanUtils.js';\n\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * This method muttes the given `transaction` and will set the `sampled` value on it.\n * It returns the same transaction, for convenience.\n */\nfunction sampleTransaction(\n transaction,\n options,\n samplingContext,\n) {\n // nothing to do if tracing is not enabled\n if (!hasTracingEnabled(options)) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n // eslint-disable-next-line deprecation/deprecation\n if (transaction.sampled !== undefined) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(transaction.sampled));\n return transaction;\n }\n\n // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n // work; prefer the hook if so\n let sampleRate;\n if (typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler(samplingContext);\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else if (samplingContext.parentSampled !== undefined) {\n sampleRate = samplingContext.parentSampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else {\n // When `enableTracing === true`, we use a sample rate of 100%\n sampleRate = 1;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate);\n }\n\n // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n // only valid values are booleans or numbers between 0 and 1.)\n if (!isValidSampleRate(sampleRate)) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n if (!sampleRate) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because ${\n typeof options.tracesSampler === 'function'\n ? 'tracesSampler returned 0 or false'\n : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n }`,\n );\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = Math.random() < (sampleRate );\n\n // if we're not going to keep it, we're done\n // eslint-disable-next-line deprecation/deprecation\n if (!transaction.sampled) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n sampleRate,\n )})`,\n );\n return transaction;\n }\n\n DEBUG_BUILD &&\n // eslint-disable-next-line deprecation/deprecation\n logger.log(`[Tracing] starting ${transaction.op} transaction - ${spanToJSON(transaction).description}`);\n return transaction;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nfunction isValidSampleRate(rate) {\n // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n rate,\n )} of type ${JSON.stringify(typeof rate)}.`,\n );\n return false;\n }\n\n // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n if (rate < 0 || rate > 1) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);\n return false;\n }\n return true;\n}\n\nexport { isValidSampleRate, sampleTransaction };\n//# sourceMappingURL=sampling.js.map\n"],"names":["hasTracingEnabled","SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE","DEBUG_BUILD","logger","spanToJSON","isNaN"],"mappings":";;;;;;;;AAeA,SAAS,kBACP,aACA,SACA,iBACA;AAEA,MAAI,CAACA,kBAAAA,kBAAkB,OAAO,GAAG;AAE/B,gBAAY,UAAU;AACtB,WAAO;AAAA,EACR;AAID,MAAI,YAAY,YAAY,QAAW;AAErC,gBAAY,aAAaC,mBAAqC,uCAAE,OAAO,YAAY,OAAO,CAAC;AAC3F,WAAO;AAAA,EACR;AAID,MAAI;AACJ,MAAI,OAAO,QAAQ,kBAAkB,YAAY;AAC/C,iBAAa,QAAQ,cAAc,eAAe;AAClD,gBAAY,aAAaA,mBAAAA,uCAAuC,OAAO,UAAU,CAAC;AAAA,EACtF,WAAa,gBAAgB,kBAAkB,QAAW;AACtD,iBAAa,gBAAgB;AAAA,EAC9B,WAAU,OAAO,QAAQ,qBAAqB,aAAa;AAC1D,iBAAa,QAAQ;AACrB,gBAAY,aAAaA,mBAAAA,uCAAuC,OAAO,UAAU,CAAC;AAAA,EACtF,OAAS;AAEL,iBAAa;AACb,gBAAY,aAAaA,0DAAuC,UAAU;AAAA,EAC3E;AAID,MAAI,CAAC,kBAAkB,UAAU,GAAG;AAClCC,eAAAA,eAAeC,OAAM,OAAC,KAAK,kEAAkE;AAE7F,gBAAY,UAAU;AACtB,WAAO;AAAA,EACR;AAGD,MAAI,CAAC,YAAY;AACfD,eAAW,eACTC,OAAAA,OAAO;AAAA,MACL,4CACE,OAAO,QAAQ,kBAAkB,aAC7B,sCACA;AAAA,
|
|
1
|
+
{"version":3,"file":"sampling.cjs","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/sampling.js"],"sourcesContent":["import { isNaN, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '../semanticAttributes.js';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled.js';\nimport { spanToJSON } from '../utils/spanUtils.js';\n\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * This method muttes the given `transaction` and will set the `sampled` value on it.\n * It returns the same transaction, for convenience.\n */\nfunction sampleTransaction(\n transaction,\n options,\n samplingContext,\n) {\n // nothing to do if tracing is not enabled\n if (!hasTracingEnabled(options)) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n // eslint-disable-next-line deprecation/deprecation\n if (transaction.sampled !== undefined) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(transaction.sampled));\n return transaction;\n }\n\n // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n // work; prefer the hook if so\n let sampleRate;\n if (typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler(samplingContext);\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else if (samplingContext.parentSampled !== undefined) {\n sampleRate = samplingContext.parentSampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else {\n // When `enableTracing === true`, we use a sample rate of 100%\n sampleRate = 1;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate);\n }\n\n // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n // only valid values are booleans or numbers between 0 and 1.)\n if (!isValidSampleRate(sampleRate)) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n if (!sampleRate) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because ${\n typeof options.tracesSampler === 'function'\n ? 'tracesSampler returned 0 or false'\n : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n }`,\n );\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = Math.random() < (sampleRate );\n\n // if we're not going to keep it, we're done\n // eslint-disable-next-line deprecation/deprecation\n if (!transaction.sampled) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n sampleRate,\n )})`,\n );\n return transaction;\n }\n\n DEBUG_BUILD &&\n // eslint-disable-next-line deprecation/deprecation\n logger.log(`[Tracing] starting ${transaction.op} transaction - ${spanToJSON(transaction).description}`);\n return transaction;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nfunction isValidSampleRate(rate) {\n // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n rate,\n )} of type ${JSON.stringify(typeof rate)}.`,\n );\n return false;\n }\n\n // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n if (rate < 0 || rate > 1) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);\n return false;\n }\n return true;\n}\n\nexport { isValidSampleRate, sampleTransaction };\n//# sourceMappingURL=sampling.js.map\n"],"names":["hasTracingEnabled","SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE","DEBUG_BUILD","logger","spanToJSON","isNaN"],"mappings":";;;;;;;;AAeA,SAAS,kBACP,aACA,SACA,iBACA;AAEA,MAAI,CAACA,kBAAAA,kBAAkB,OAAO,GAAG;AAE/B,gBAAY,UAAU;AACtB,WAAO;AAAA,EACR;AAID,MAAI,YAAY,YAAY,QAAW;AAErC,gBAAY,aAAaC,mBAAqC,uCAAE,OAAO,YAAY,OAAO,CAAC;AAC3F,WAAO;AAAA,EACR;AAID,MAAI;AACJ,MAAI,OAAO,QAAQ,kBAAkB,YAAY;AAC/C,iBAAa,QAAQ,cAAc,eAAe;AAClD,gBAAY,aAAaA,mBAAAA,uCAAuC,OAAO,UAAU,CAAC;AAAA,EACtF,WAAa,gBAAgB,kBAAkB,QAAW;AACtD,iBAAa,gBAAgB;AAAA,EAC9B,WAAU,OAAO,QAAQ,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core/esm/tracing/sampling.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sampling.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/sampling.js"],"sourcesContent":["import { isNaN, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '../semanticAttributes.js';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled.js';\nimport { spanToJSON } from '../utils/spanUtils.js';\n\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * This method muttes the given `transaction` and will set the `sampled` value on it.\n * It returns the same transaction, for convenience.\n */\nfunction sampleTransaction(\n transaction,\n options,\n samplingContext,\n) {\n // nothing to do if tracing is not enabled\n if (!hasTracingEnabled(options)) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n // eslint-disable-next-line deprecation/deprecation\n if (transaction.sampled !== undefined) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(transaction.sampled));\n return transaction;\n }\n\n // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n // work; prefer the hook if so\n let sampleRate;\n if (typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler(samplingContext);\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else if (samplingContext.parentSampled !== undefined) {\n sampleRate = samplingContext.parentSampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else {\n // When `enableTracing === true`, we use a sample rate of 100%\n sampleRate = 1;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate);\n }\n\n // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n // only valid values are booleans or numbers between 0 and 1.)\n if (!isValidSampleRate(sampleRate)) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n if (!sampleRate) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because ${\n typeof options.tracesSampler === 'function'\n ? 'tracesSampler returned 0 or false'\n : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n }`,\n );\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = Math.random() < (sampleRate );\n\n // if we're not going to keep it, we're done\n // eslint-disable-next-line deprecation/deprecation\n if (!transaction.sampled) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n sampleRate,\n )})`,\n );\n return transaction;\n }\n\n DEBUG_BUILD &&\n // eslint-disable-next-line deprecation/deprecation\n logger.log(`[Tracing] starting ${transaction.op} transaction - ${spanToJSON(transaction).description}`);\n return transaction;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nfunction isValidSampleRate(rate) {\n // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n rate,\n )} of type ${JSON.stringify(typeof rate)}.`,\n );\n return false;\n }\n\n // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n if (rate < 0 || rate > 1) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);\n return false;\n }\n return true;\n}\n\nexport { isValidSampleRate, sampleTransaction };\n//# sourceMappingURL=sampling.js.map\n"],"names":[],"mappings":";;;;;;AAeA,SAAS,kBACP,aACA,SACA,iBACA;AAEA,MAAI,CAAC,kBAAkB,OAAO,GAAG;AAE/B,gBAAY,UAAU;AACtB,WAAO;AAAA,EACR;AAID,MAAI,YAAY,YAAY,QAAW;AAErC,gBAAY,aAAa,uCAAuC,OAAO,YAAY,OAAO,CAAC;AAC3F,WAAO;AAAA,EACR;AAID,MAAI;AACJ,MAAI,OAAO,QAAQ,kBAAkB,YAAY;AAC/C,iBAAa,QAAQ,cAAc,eAAe;AAClD,gBAAY,aAAa,uCAAuC,OAAO,UAAU,CAAC;AAAA,EACtF,WAAa,gBAAgB,kBAAkB,QAAW;AACtD,iBAAa,gBAAgB;AAAA,EAC9B,WAAU,OAAO,QAAQ,qBAAqB,aAAa;AAC1D,iBAAa,QAAQ;AACrB,gBAAY,aAAa,uCAAuC,OAAO,UAAU,CAAC;AAAA,EACtF,OAAS;AAEL,iBAAa;AACb,gBAAY,aAAa,uCAAuC,UAAU;AAAA,EAC3E;AAID,MAAI,CAAC,kBAAkB,UAAU,GAAG;AAClC,mBAAe,OAAO,KAAK,kEAAkE;AAE7F,gBAAY,UAAU;AACtB,WAAO;AAAA,EACR;AAGD,MAAI,CAAC,YAAY;AACf,mBACE,OAAO;AAAA,MACL,4CACE,OAAO,QAAQ,kBAAkB,aAC7B,sCACA;AAAA,
|
|
1
|
+
{"version":3,"file":"sampling.js","sources":["../../../../../../../../../../../node_modules/@sentry/node/node_modules/@sentry/core/esm/tracing/sampling.js"],"sourcesContent":["import { isNaN, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '../semanticAttributes.js';\nimport { hasTracingEnabled } from '../utils/hasTracingEnabled.js';\nimport { spanToJSON } from '../utils/spanUtils.js';\n\n/**\n * Makes a sampling decision for the given transaction and stores it on the transaction.\n *\n * Called every time a transaction is created. Only transactions which emerge with a `sampled` value of `true` will be\n * sent to Sentry.\n *\n * This method muttes the given `transaction` and will set the `sampled` value on it.\n * It returns the same transaction, for convenience.\n */\nfunction sampleTransaction(\n transaction,\n options,\n samplingContext,\n) {\n // nothing to do if tracing is not enabled\n if (!hasTracingEnabled(options)) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the user has forced a sampling decision by passing a `sampled` value in their transaction context, go with that\n // eslint-disable-next-line deprecation/deprecation\n if (transaction.sampled !== undefined) {\n // eslint-disable-next-line deprecation/deprecation\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(transaction.sampled));\n return transaction;\n }\n\n // we would have bailed already if neither `tracesSampler` nor `tracesSampleRate` nor `enableTracing` were defined, so one of these should\n // work; prefer the hook if so\n let sampleRate;\n if (typeof options.tracesSampler === 'function') {\n sampleRate = options.tracesSampler(samplingContext);\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else if (samplingContext.parentSampled !== undefined) {\n sampleRate = samplingContext.parentSampled;\n } else if (typeof options.tracesSampleRate !== 'undefined') {\n sampleRate = options.tracesSampleRate;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, Number(sampleRate));\n } else {\n // When `enableTracing === true`, we use a sample rate of 100%\n sampleRate = 1;\n transaction.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate);\n }\n\n // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The\n // only valid values are booleans or numbers between 0 and 1.)\n if (!isValidSampleRate(sampleRate)) {\n DEBUG_BUILD && logger.warn('[Tracing] Discarding transaction because of invalid sample rate.');\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // if the function returned 0 (or false), or if `tracesSampleRate` is 0, it's a sign the transaction should be dropped\n if (!sampleRate) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because ${\n typeof options.tracesSampler === 'function'\n ? 'tracesSampler returned 0 or false'\n : 'a negative sampling decision was inherited or tracesSampleRate is set to 0'\n }`,\n );\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = false;\n return transaction;\n }\n\n // Now we roll the dice. Math.random is inclusive of 0, but not of 1, so strict < is safe here. In case sampleRate is\n // a boolean, the < comparison will cause it to be automatically cast to 1 if it's true and 0 if it's false.\n // eslint-disable-next-line deprecation/deprecation\n transaction.sampled = Math.random() < (sampleRate );\n\n // if we're not going to keep it, we're done\n // eslint-disable-next-line deprecation/deprecation\n if (!transaction.sampled) {\n DEBUG_BUILD &&\n logger.log(\n `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(\n sampleRate,\n )})`,\n );\n return transaction;\n }\n\n DEBUG_BUILD &&\n // eslint-disable-next-line deprecation/deprecation\n logger.log(`[Tracing] starting ${transaction.op} transaction - ${spanToJSON(transaction).description}`);\n return transaction;\n}\n\n/**\n * Checks the given sample rate to make sure it is valid type and value (a boolean, or a number between 0 and 1).\n */\nfunction isValidSampleRate(rate) {\n // we need to check NaN explicitly because it's of type 'number' and therefore wouldn't get caught by this typecheck\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (isNaN(rate) || !(typeof rate === 'number' || typeof rate === 'boolean')) {\n DEBUG_BUILD &&\n logger.warn(\n `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(\n rate,\n )} of type ${JSON.stringify(typeof rate)}.`,\n );\n return false;\n }\n\n // in case sampleRate is a boolean, it will get automatically cast to 1 if it's true and 0 if it's false\n if (rate < 0 || rate > 1) {\n DEBUG_BUILD &&\n logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${rate}.`);\n return false;\n }\n return true;\n}\n\nexport { isValidSampleRate, sampleTransaction };\n//# sourceMappingURL=sampling.js.map\n"],"names":[],"mappings":";;;;;;AAeA,SAAS,kBACP,aACA,SACA,iBACA;AAEA,MAAI,CAAC,kBAAkB,OAAO,GAAG;AAE/B,gBAAY,UAAU;AACtB,WAAO;AAAA,EACR;AAID,MAAI,YAAY,YAAY,QAAW;AAErC,gBAAY,aAAa,uCAAuC,OAAO,YAAY,OAAO,CAAC;AAC3F,WAAO;AAAA,EACR;AAID,MAAI;AACJ,MAAI,OAAO,QAAQ,kBAAkB,YAAY;AAC/C,iBAAa,QAAQ,cAAc,eAAe;AAClD,gBAAY,aAAa,uCAAuC,OAAO,UAAU,CAAC;AAAA,EACtF,WAAa,gBAAgB,kBAAkB,QAAW;AACtD,iBAAa,gBAAgB;AAAA,EAC9B,WAAU,OAAO,QAAQ,qBAAqB,aAAa;AAC1D,iBAAa,QAAQ;AACrB,gBAAY,aAAa,uCAAuC,OAAO,UAAU,CAAC;AAAA,EACtF,OAAS;AAEL,iBAAa;AACb,gBAAY,aAAa,uCAAuC,UAAU;AAAA,EAC3E;AAID,MAAI,CAAC,kBAAkB,UAAU,GAAG;AAClC,mBAAe,OAAO,KAAK,kEAAkE;AAE7F,gBAAY,UAAU;AACtB,WAAO;AAAA,EACR;AAGD,MAAI,CAAC,YAAY;AACf,mBACE,OAAO;AAAA,MACL,4CACE,OAAO,QAAQ,kBAAkB,aAC7B,sCACA,4EACd;AAAA,IACA;AAEI,gBAAY,UAAU;AACtB,WAAO;AAAA,EACR;AAKD,cAAY,UAAU,KAAK,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