@sentry/node 10.69.0 → 11.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/bundler-plugin/esbuild.js +19 -0
- package/build/cjs/bundler-plugin/esbuild.js.map +1 -0
- package/build/cjs/bundler-plugin/rollup.js +12 -0
- package/build/cjs/bundler-plugin/rollup.js.map +1 -0
- package/build/cjs/bundler-plugin/vite.js +12 -0
- package/build/cjs/bundler-plugin/vite.js.map +1 -0
- package/build/cjs/bundler-plugin/webpack.js +18 -0
- package/build/cjs/bundler-plugin/webpack.js.map +1 -0
- package/build/cjs/cron/common.js +52 -0
- package/build/cjs/cron/common.js.map +1 -0
- package/build/cjs/cron/cron.js +88 -0
- package/build/cjs/cron/cron.js.map +1 -0
- package/build/cjs/cron/index.js +14 -0
- package/build/cjs/cron/index.js.map +1 -0
- package/build/cjs/cron/node-cron.js +52 -0
- package/build/cjs/cron/node-cron.js.map +1 -0
- package/build/cjs/cron/node-schedule.js +41 -0
- package/build/cjs/cron/node-schedule.js.map +1 -0
- package/build/cjs/index.js +111 -123
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/anr/index.js +159 -0
- package/build/cjs/integrations/anr/index.js.map +1 -0
- package/build/cjs/integrations/childProcess.js +81 -0
- package/build/cjs/integrations/childProcess.js.map +1 -0
- package/build/cjs/integrations/console.js +95 -0
- package/build/cjs/integrations/console.js.map +1 -0
- package/build/cjs/integrations/context.js +391 -0
- package/build/cjs/integrations/context.js.map +1 -0
- package/build/cjs/integrations/contextlines.js +251 -0
- package/build/cjs/integrations/contextlines.js.map +1 -0
- package/build/cjs/integrations/fs/index.js +1 -1
- package/build/cjs/integrations/fs/index.js.map +1 -1
- package/build/cjs/integrations/fs/vendored/constants.js.map +1 -1
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js +67 -0
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -0
- package/build/cjs/integrations/http/httpServerIntegration.js +77 -0
- package/build/cjs/integrations/http/httpServerIntegration.js.map +1 -0
- package/build/cjs/integrations/http/httpServerSpansIntegration.js +243 -0
- package/build/cjs/integrations/http/httpServerSpansIntegration.js.map +1 -0
- package/build/cjs/integrations/http/index.js +71 -0
- package/build/cjs/integrations/http/index.js.map +1 -0
- package/build/cjs/integrations/local-variables/common.js +20 -0
- package/build/cjs/integrations/local-variables/common.js.map +1 -0
- package/build/cjs/integrations/local-variables/index.js +10 -0
- package/build/cjs/integrations/local-variables/index.js.map +1 -0
- package/build/cjs/integrations/local-variables/local-variables-async.js +106 -0
- package/build/cjs/integrations/local-variables/local-variables-async.js.map +1 -0
- package/build/cjs/integrations/modules.js +98 -0
- package/build/cjs/integrations/modules.js.map +1 -0
- package/build/cjs/integrations/node-fetch/index.js +24 -0
- package/build/cjs/integrations/node-fetch/index.js.map +1 -0
- package/build/cjs/integrations/node-fetch/undici-instrumentation.js +261 -0
- package/build/cjs/integrations/node-fetch/undici-instrumentation.js.map +1 -0
- package/build/cjs/integrations/nodeRuntimeMetrics.js +181 -0
- package/build/cjs/integrations/nodeRuntimeMetrics.js.map +1 -0
- package/build/cjs/integrations/onuncaughtexception.js +92 -0
- package/build/cjs/integrations/onuncaughtexception.js.map +1 -0
- package/build/cjs/integrations/onunhandledrejection.js +92 -0
- package/build/cjs/integrations/onunhandledrejection.js.map +1 -0
- package/build/cjs/integrations/pino.js +116 -0
- package/build/cjs/integrations/pino.js.map +1 -0
- package/build/cjs/integrations/processSession.js +22 -0
- package/build/cjs/integrations/processSession.js.map +1 -0
- package/build/cjs/integrations/spotlight.js +79 -0
- package/build/cjs/integrations/spotlight.js.map +1 -0
- package/build/cjs/integrations/systemError.js +54 -0
- package/build/cjs/integrations/systemError.js.map +1 -0
- package/build/cjs/integrations/tracing/express.js +0 -52
- package/build/cjs/integrations/tracing/express.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/index.js +1 -16
- package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
- package/build/cjs/integrations/tracing/hapi/index.js +0 -16
- package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
- package/build/cjs/integrations/tracing/index.js +29 -87
- package/build/cjs/integrations/tracing/index.js.map +1 -1
- package/build/cjs/integrations/tracing/koa/index.js +0 -24
- package/build/cjs/integrations/tracing/koa/index.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/cache.js +1 -0
- package/build/cjs/integrations/tracing/redis/cache.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/index.js +10 -26
- package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
- package/build/cjs/integrations/winston.js +84 -0
- package/build/cjs/integrations/winston.js.map +1 -0
- package/build/cjs/logs/capture.js +26 -0
- package/build/cjs/logs/capture.js.map +1 -0
- package/build/cjs/logs/exports.js +32 -0
- package/build/cjs/logs/exports.js.map +1 -0
- package/build/cjs/nodeVersion.js +10 -0
- package/build/cjs/nodeVersion.js.map +1 -0
- package/build/cjs/otel/logger.js +21 -0
- package/build/cjs/otel/logger.js.map +1 -0
- package/build/cjs/proxy/base.js +69 -0
- package/build/cjs/proxy/base.js.map +1 -0
- package/build/cjs/proxy/index.js +112 -0
- package/build/cjs/proxy/index.js.map +1 -0
- package/build/cjs/proxy/parse-proxy-response.js +88 -0
- package/build/cjs/proxy/parse-proxy-response.js.map +1 -0
- package/build/cjs/sdk/api.js +61 -0
- package/build/cjs/sdk/api.js.map +1 -0
- package/build/cjs/sdk/client.js +113 -0
- package/build/cjs/sdk/client.js.map +1 -0
- package/build/cjs/sdk/index.js +185 -41
- package/build/cjs/sdk/index.js.map +1 -1
- package/build/cjs/sdk/initOtel.js +14 -91
- package/build/cjs/sdk/initOtel.js.map +1 -1
- package/build/cjs/transports/http.js +102 -0
- package/build/cjs/transports/http.js.map +1 -0
- package/build/cjs/utils/debug.js +17 -0
- package/build/cjs/utils/debug.js.map +1 -0
- package/build/cjs/utils/entry-point.js +36 -0
- package/build/cjs/utils/entry-point.js.map +1 -0
- package/build/cjs/utils/errorhandling.js +33 -0
- package/build/cjs/utils/errorhandling.js.map +1 -0
- package/build/cjs/utils/module.js +37 -0
- package/build/cjs/utils/module.js.map +1 -0
- package/build/cjs/utils/outgoingFetchRequest.js +178 -0
- package/build/cjs/utils/outgoingFetchRequest.js.map +1 -0
- package/build/cjs/utils/spotlight.js +18 -0
- package/build/cjs/utils/spotlight.js.map +1 -0
- package/build/esm/bundler-plugin/esbuild.js +17 -0
- package/build/esm/bundler-plugin/esbuild.js.map +1 -0
- package/build/esm/bundler-plugin/rollup.js +10 -0
- package/build/esm/bundler-plugin/rollup.js.map +1 -0
- package/build/esm/bundler-plugin/vite.js +10 -0
- package/build/esm/bundler-plugin/vite.js.map +1 -0
- package/build/esm/bundler-plugin/webpack.js +16 -0
- package/build/esm/bundler-plugin/webpack.js.map +1 -0
- package/build/esm/cron/common.js +50 -0
- package/build/esm/cron/common.js.map +1 -0
- package/build/esm/cron/cron.js +86 -0
- package/build/esm/cron/cron.js.map +1 -0
- package/build/esm/cron/index.js +12 -0
- package/build/esm/cron/index.js.map +1 -0
- package/build/esm/cron/node-cron.js +50 -0
- package/build/esm/cron/node-cron.js.map +1 -0
- package/build/esm/cron/node-schedule.js +39 -0
- package/build/esm/cron/node-schedule.js.map +1 -0
- package/build/esm/index.js +36 -36
- package/build/esm/integrations/anr/index.js +155 -0
- package/build/esm/integrations/anr/index.js.map +1 -0
- package/build/esm/integrations/anr/worker-script.js +2 -0
- package/build/esm/integrations/childProcess.js +79 -0
- package/build/esm/integrations/childProcess.js.map +1 -0
- package/build/esm/integrations/console.js +93 -0
- package/build/esm/integrations/console.js.map +1 -0
- package/build/esm/integrations/context.js +383 -0
- package/build/esm/integrations/context.js.map +1 -0
- package/build/esm/integrations/contextlines.js +245 -0
- package/build/esm/integrations/contextlines.js.map +1 -0
- package/build/esm/integrations/fs/index.js +1 -1
- package/build/esm/integrations/fs/index.js.map +1 -1
- package/build/esm/integrations/fs/vendored/constants.js.map +1 -1
- package/build/esm/integrations/http/SentryHttpInstrumentation.js +65 -0
- package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -0
- package/build/esm/integrations/http/httpServerIntegration.js +74 -0
- package/build/esm/integrations/http/httpServerIntegration.js.map +1 -0
- package/build/esm/integrations/http/httpServerSpansIntegration.js +240 -0
- package/build/esm/integrations/http/httpServerSpansIntegration.js.map +1 -0
- package/build/esm/integrations/http/index.js +69 -0
- package/build/esm/integrations/http/index.js.map +1 -0
- package/build/esm/integrations/local-variables/common.js +15 -0
- package/build/esm/integrations/local-variables/common.js.map +1 -0
- package/build/esm/integrations/local-variables/index.js +8 -0
- package/build/esm/integrations/local-variables/index.js.map +1 -0
- package/build/esm/integrations/local-variables/local-variables-async.js +103 -0
- package/build/esm/integrations/local-variables/local-variables-async.js.map +1 -0
- package/build/esm/integrations/local-variables/worker-script.js +2 -0
- package/build/esm/integrations/modules.js +57 -0
- package/build/esm/integrations/modules.js.map +1 -0
- package/build/esm/integrations/node-fetch/index.js +22 -0
- package/build/esm/integrations/node-fetch/index.js.map +1 -0
- package/build/esm/integrations/node-fetch/undici-instrumentation.js +259 -0
- package/build/esm/integrations/node-fetch/undici-instrumentation.js.map +1 -0
- package/build/esm/integrations/nodeRuntimeMetrics.js +178 -0
- package/build/esm/integrations/nodeRuntimeMetrics.js.map +1 -0
- package/build/esm/integrations/onuncaughtexception.js +89 -0
- package/build/esm/integrations/onuncaughtexception.js.map +1 -0
- package/build/esm/integrations/onunhandledrejection.js +89 -0
- package/build/esm/integrations/onunhandledrejection.js.map +1 -0
- package/build/esm/integrations/pino.js +114 -0
- package/build/esm/integrations/pino.js.map +1 -0
- package/build/esm/integrations/processSession.js +20 -0
- package/build/esm/integrations/processSession.js.map +1 -0
- package/build/esm/integrations/spotlight.js +76 -0
- package/build/esm/integrations/spotlight.js.map +1 -0
- package/build/esm/integrations/systemError.js +52 -0
- package/build/esm/integrations/systemError.js.map +1 -0
- package/build/esm/integrations/tracing/express.js +2 -51
- package/build/esm/integrations/tracing/express.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/index.js +3 -17
- package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
- package/build/esm/integrations/tracing/hapi/index.js +2 -16
- package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
- package/build/esm/integrations/tracing/index.js +12 -69
- package/build/esm/integrations/tracing/index.js.map +1 -1
- package/build/esm/integrations/tracing/koa/index.js +2 -24
- package/build/esm/integrations/tracing/koa/index.js.map +1 -1
- package/build/esm/integrations/tracing/redis/cache.js +2 -1
- package/build/esm/integrations/tracing/redis/cache.js.map +1 -1
- package/build/esm/integrations/tracing/redis/index.js +11 -26
- package/build/esm/integrations/tracing/redis/index.js.map +1 -1
- package/build/esm/integrations/winston.js +82 -0
- package/build/esm/integrations/winston.js.map +1 -0
- package/build/esm/logs/capture.js +24 -0
- package/build/esm/logs/capture.js.map +1 -0
- package/build/esm/logs/exports.js +24 -0
- package/build/esm/logs/exports.js.map +1 -0
- package/build/esm/nodeVersion.js +8 -0
- package/build/esm/nodeVersion.js.map +1 -0
- package/build/esm/otel/logger.js +19 -0
- package/build/esm/otel/logger.js.map +1 -0
- package/build/esm/package.json +1 -1
- package/build/esm/proxy/base.js +67 -0
- package/build/esm/proxy/base.js.map +1 -0
- package/build/esm/proxy/index.js +110 -0
- package/build/esm/proxy/index.js.map +1 -0
- package/build/esm/proxy/parse-proxy-response.js +86 -0
- package/build/esm/proxy/parse-proxy-response.js.map +1 -0
- package/build/esm/sdk/api.js +58 -0
- package/build/esm/sdk/api.js.map +1 -0
- package/build/esm/sdk/client.js +111 -0
- package/build/esm/sdk/client.js.map +1 -0
- package/build/esm/sdk/index.js +187 -42
- package/build/esm/sdk/index.js.map +1 -1
- package/build/esm/sdk/initOtel.js +15 -91
- package/build/esm/sdk/initOtel.js.map +1 -1
- package/build/esm/transports/http.js +100 -0
- package/build/esm/transports/http.js.map +1 -0
- package/build/esm/utils/debug.js +15 -0
- package/build/esm/utils/debug.js.map +1 -0
- package/build/esm/utils/entry-point.js +33 -0
- package/build/esm/utils/entry-point.js.map +1 -0
- package/build/esm/utils/errorhandling.js +31 -0
- package/build/esm/utils/errorhandling.js.map +1 -0
- package/build/esm/utils/module.js +35 -0
- package/build/esm/utils/module.js.map +1 -0
- package/build/esm/utils/outgoingFetchRequest.js +174 -0
- package/build/esm/utils/outgoingFetchRequest.js.map +1 -0
- package/build/esm/utils/spotlight.js +16 -0
- package/build/esm/utils/spotlight.js.map +1 -0
- package/build/import-hook.mjs +0 -10
- package/build/types/bundler-plugin/esbuild.d.ts +34 -0
- package/build/types/bundler-plugin/esbuild.d.ts.map +1 -0
- package/build/types/bundler-plugin/rollup.d.ts +35 -0
- package/build/types/bundler-plugin/rollup.d.ts.map +1 -0
- package/build/types/bundler-plugin/vite.d.ts +36 -0
- package/build/types/bundler-plugin/vite.d.ts.map +1 -0
- package/build/types/bundler-plugin/webpack.d.ts +37 -0
- package/build/types/bundler-plugin/webpack.d.ts.map +1 -0
- package/build/types/cron/common.d.ts +5 -0
- package/build/types/cron/common.d.ts.map +1 -0
- package/build/types/cron/cron.d.ts +43 -0
- package/build/types/cron/cron.d.ts.map +1 -0
- package/build/types/cron/index.d.ts +10 -0
- package/build/types/cron/index.d.ts.map +1 -0
- package/build/types/cron/node-cron.d.ts +28 -0
- package/build/types/cron/node-cron.d.ts.map +1 -0
- package/build/types/cron/node-schedule.d.ts +19 -0
- package/build/types/cron/node-schedule.d.ts.map +1 -0
- package/build/types/index.d.ts +35 -35
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/anr/common.d.ts +79 -0
- package/build/types/integrations/anr/common.d.ts.map +1 -0
- package/build/types/integrations/anr/index.d.ts +59 -0
- package/build/types/integrations/anr/index.d.ts.map +1 -0
- package/build/types/integrations/anr/worker.d.ts +2 -0
- package/build/types/integrations/anr/worker.d.ts.map +1 -0
- package/build/types/integrations/childProcess.d.ts +22 -0
- package/build/types/integrations/childProcess.d.ts.map +1 -0
- package/build/types/integrations/console.d.ts +23 -0
- package/build/types/integrations/console.d.ts.map +1 -0
- package/build/types/integrations/context.d.ts +33 -0
- package/build/types/integrations/context.d.ts.map +1 -0
- package/build/types/integrations/contextlines.d.ts +35 -0
- package/build/types/integrations/contextlines.d.ts.map +1 -0
- package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -1
- package/build/types/integrations/fs/index.d.ts.map +1 -1
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +102 -0
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -0
- package/build/types/integrations/http/httpServerIntegration.d.ts +67 -0
- package/build/types/integrations/http/httpServerIntegration.d.ts.map +1 -0
- package/build/types/integrations/http/httpServerSpansIntegration.d.ts +59 -0
- package/build/types/integrations/http/httpServerSpansIntegration.d.ts.map +1 -0
- package/build/types/integrations/http/index.d.ts +127 -0
- package/build/types/integrations/http/index.d.ts.map +1 -0
- package/build/types/integrations/local-variables/common.d.ts +79 -0
- package/build/types/integrations/local-variables/common.d.ts.map +1 -0
- package/build/types/integrations/local-variables/index.d.ts +4 -0
- package/build/types/integrations/local-variables/index.d.ts.map +1 -0
- package/build/types/integrations/local-variables/local-variables-async.d.ts +9 -0
- package/build/types/integrations/local-variables/local-variables-async.d.ts.map +1 -0
- package/build/types/integrations/local-variables/worker.d.ts +2 -0
- package/build/types/integrations/local-variables/worker.d.ts.map +1 -0
- package/build/types/integrations/modules.d.ts +17 -0
- package/build/types/integrations/modules.d.ts.map +1 -0
- package/build/types/integrations/node-fetch/index.d.ts +9 -0
- package/build/types/integrations/node-fetch/index.d.ts.map +1 -0
- package/build/types/integrations/node-fetch/types.d.ts +95 -0
- package/build/types/integrations/node-fetch/types.d.ts.map +1 -0
- package/build/types/integrations/node-fetch/undici-instrumentation.d.ts +17 -0
- package/build/types/integrations/node-fetch/undici-instrumentation.d.ts.map +1 -0
- package/build/types/integrations/nodeRuntimeMetrics.d.ts +66 -0
- package/build/types/integrations/nodeRuntimeMetrics.d.ts.map +1 -0
- package/build/types/integrations/onuncaughtexception.d.ts +33 -0
- package/build/types/integrations/onuncaughtexception.d.ts.map +1 -0
- package/build/types/integrations/onunhandledrejection.d.ts +22 -0
- package/build/types/integrations/onunhandledrejection.d.ts.map +1 -0
- package/build/types/integrations/pino.d.ts +61 -0
- package/build/types/integrations/pino.d.ts.map +1 -0
- package/build/types/integrations/processSession.d.ts +7 -0
- package/build/types/integrations/processSession.d.ts.map +1 -0
- package/build/types/integrations/spotlight.d.ts +18 -0
- package/build/types/integrations/spotlight.d.ts.map +1 -0
- package/build/types/integrations/systemError.d.ts +14 -0
- package/build/types/integrations/systemError.d.ts.map +1 -0
- package/build/types/integrations/tracing/express.d.ts +1 -14
- package/build/types/integrations/tracing/express.d.ts.map +1 -1
- package/build/types/integrations/tracing/fastify/index.d.ts +1 -5
- package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/hapi/index.d.ts +0 -23
- package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/index.d.ts +0 -9
- package/build/types/integrations/tracing/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/koa/index.d.ts +0 -46
- package/build/types/integrations/tracing/koa/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/redis/cache.d.ts.map +1 -1
- package/build/types/integrations/tracing/redis/index.d.ts +0 -7
- package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/redis/vendored/types.d.ts +0 -15
- package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/winston.d.ts +55 -0
- package/build/types/integrations/winston.d.ts.map +1 -0
- package/build/types/logs/capture.d.ts +29 -0
- package/build/types/logs/capture.d.ts.map +1 -0
- package/build/types/logs/exports.d.ts +150 -0
- package/build/types/logs/exports.d.ts.map +1 -0
- package/build/types/nodeVersion.d.ts +8 -0
- package/build/types/nodeVersion.d.ts.map +1 -0
- package/build/types/otel/logger.d.ts +5 -0
- package/build/types/otel/logger.d.ts.map +1 -0
- package/build/types/proxy/base.d.ts +61 -0
- package/build/types/proxy/base.d.ts.map +1 -0
- package/build/types/proxy/helpers.d.ts +37 -0
- package/build/types/proxy/helpers.d.ts.map +1 -0
- package/build/types/proxy/index.d.ts +70 -0
- package/build/types/proxy/index.d.ts.map +1 -0
- package/build/types/proxy/parse-proxy-response.d.ts +39 -0
- package/build/types/proxy/parse-proxy-response.d.ts.map +1 -0
- package/build/types/sdk/api.d.ts +8 -0
- package/build/types/sdk/api.d.ts.map +1 -0
- package/build/types/sdk/client.d.ts +31 -0
- package/build/types/sdk/client.d.ts.map +1 -0
- package/build/types/sdk/index.d.ts +1 -19
- package/build/types/sdk/index.d.ts.map +1 -1
- package/build/types/sdk/initOtel.d.ts +11 -20
- package/build/types/sdk/initOtel.d.ts.map +1 -1
- package/build/types/sdk/scope.d.ts +7 -0
- package/build/types/sdk/scope.d.ts.map +1 -0
- package/build/types/transports/http-module.d.ts +27 -0
- package/build/types/transports/http-module.d.ts.map +1 -0
- package/build/types/transports/http.d.ts +17 -0
- package/build/types/transports/http.d.ts.map +1 -0
- package/build/types/transports/index.d.ts +3 -0
- package/build/types/transports/index.d.ts.map +1 -0
- package/build/types/types.d.ts +35 -23
- package/build/types/types.d.ts.map +1 -1
- package/build/types/utils/addOriginToSpan.d.ts +5 -0
- package/build/types/utils/addOriginToSpan.d.ts.map +1 -0
- package/build/types/utils/debug.d.ts +5 -0
- package/build/types/utils/debug.d.ts.map +1 -0
- package/build/types/utils/entry-point.d.ts +24 -0
- package/build/types/utils/entry-point.d.ts.map +1 -0
- package/build/types/utils/errorhandling.d.ts +5 -0
- package/build/types/utils/errorhandling.d.ts.map +1 -0
- package/build/types/utils/module.d.ts +3 -0
- package/build/types/utils/module.d.ts.map +1 -0
- package/build/types/utils/outgoingFetchRequest.d.ts +20 -0
- package/build/types/utils/outgoingFetchRequest.d.ts.map +1 -0
- package/build/types/utils/prepareEvent.d.ts +17 -0
- package/build/types/utils/prepareEvent.d.ts.map +1 -0
- package/build/types/utils/spotlight.d.ts +8 -0
- package/build/types/utils/spotlight.d.ts.map +1 -0
- package/package.json +37 -31
- package/build/cjs/init.js +0 -4
- package/build/cjs/init.js.map +0 -1
- package/build/cjs/integrations/http.js +0 -69
- package/build/cjs/integrations/http.js.map +0 -1
- package/build/cjs/integrations/node-fetch.js +0 -24
- package/build/cjs/integrations/node-fetch.js.map +0 -1
- package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js +0 -15
- package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js.map +0 -1
- package/build/cjs/integrations/tracing/amqplib/index.js +0 -21
- package/build/cjs/integrations/tracing/amqplib/index.js.map +0 -1
- package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js +0 -117
- package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/amqplib/vendored/patches.js +0 -185
- package/build/cjs/integrations/tracing/amqplib/vendored/patches.js.map +0 -1
- package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js +0 -26
- package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +0 -1
- package/build/cjs/integrations/tracing/amqplib/vendored/types.js +0 -17
- package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +0 -1
- package/build/cjs/integrations/tracing/amqplib/vendored/utils.js +0 -129
- package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/anthropic-ai/index.js +0 -24
- package/build/cjs/integrations/tracing/anthropic-ai/index.js.map +0 -1
- package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js +0 -72
- package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/connect/index.js +0 -35
- package/build/cjs/integrations/tracing/connect/index.js.map +0 -1
- package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +0 -16
- package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +0 -1
- package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +0 -137
- package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/connect/vendored/internal-types.js +0 -8
- package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +0 -1
- package/build/cjs/integrations/tracing/connect/vendored/utils.js +0 -36
- package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/dataloader/index.js +0 -26
- package/build/cjs/integrations/tracing/dataloader/index.js.map +0 -1
- package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js +0 -227
- package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/fastify/v3/constants.js +0 -6
- package/build/cjs/integrations/tracing/fastify/v3/constants.js.map +0 -1
- package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js +0 -24
- package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +0 -1
- package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +0 -220
- package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/fastify/v3/utils.js +0 -64
- package/build/cjs/integrations/tracing/fastify/v3/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/firebase/firebase.js +0 -21
- package/build/cjs/integrations/tracing/firebase/firebase.js.map +0 -1
- package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +0 -28
- package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +0 -155
- package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +0 -1
- package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js +0 -141
- package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +0 -1
- package/build/cjs/integrations/tracing/genericPool/index.js +0 -21
- package/build/cjs/integrations/tracing/genericPool/index.js.map +0 -1
- package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +0 -122
- package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/google-genai/index.js +0 -23
- package/build/cjs/integrations/tracing/google-genai/index.js.map +0 -1
- package/build/cjs/integrations/tracing/google-genai/instrumentation.js +0 -68
- package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/graphql/index.js +0 -34
- package/build/cjs/integrations/tracing/graphql/index.js.map +0 -1
- package/build/cjs/integrations/tracing/graphql/vendored/enum.js +0 -47
- package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +0 -1
- package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -15
- package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +0 -1
- package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +0 -329
- package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js +0 -6
- package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +0 -1
- package/build/cjs/integrations/tracing/graphql/vendored/symbols.js +0 -8
- package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +0 -1
- package/build/cjs/integrations/tracing/graphql/vendored/utils.js +0 -265
- package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js +0 -11
- package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +0 -1
- package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +0 -255
- package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js +0 -24
- package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +0 -1
- package/build/cjs/integrations/tracing/hapi/vendored/utils.js +0 -85
- package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/hono/constants.js +0 -14
- package/build/cjs/integrations/tracing/hono/constants.js.map +0 -1
- package/build/cjs/integrations/tracing/hono/index.js +0 -86
- package/build/cjs/integrations/tracing/hono/index.js.map +0 -1
- package/build/cjs/integrations/tracing/hono/instrumentation.js +0 -201
- package/build/cjs/integrations/tracing/hono/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/kafka/index.js +0 -21
- package/build/cjs/integrations/tracing/kafka/index.js.map +0 -1
- package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +0 -237
- package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +0 -22
- package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +0 -1
- package/build/cjs/integrations/tracing/kafka/vendored/utils.js +0 -114
- package/build/cjs/integrations/tracing/kafka/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/knex/index.js +0 -26
- package/build/cjs/integrations/tracing/knex/index.js.map +0 -1
- package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +0 -135
- package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/knex/vendored/semconv.js +0 -10
- package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +0 -1
- package/build/cjs/integrations/tracing/knex/vendored/utils.js +0 -84
- package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js +0 -10
- package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +0 -1
- package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +0 -127
- package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/koa/vendored/internal-types.js +0 -6
- package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +0 -1
- package/build/cjs/integrations/tracing/koa/vendored/types.js +0 -10
- package/build/cjs/integrations/tracing/koa/vendored/types.js.map +0 -1
- package/build/cjs/integrations/tracing/koa/vendored/utils.js +0 -36
- package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/langchain/index.js +0 -23
- package/build/cjs/integrations/tracing/langchain/index.js.map +0 -1
- package/build/cjs/integrations/tracing/langchain/instrumentation.js +0 -160
- package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/langgraph/index.js +0 -23
- package/build/cjs/integrations/tracing/langgraph/index.js.map +0 -1
- package/build/cjs/integrations/tracing/langgraph/instrumentation.js +0 -96
- package/build/cjs/integrations/tracing/langgraph/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/lrumemoizer/index.js +0 -21
- package/build/cjs/integrations/tracing/lrumemoizer/index.js.map +0 -1
- package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js +0 -38
- package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/mongo/index.js +0 -21
- package/build/cjs/integrations/tracing/mongo/index.js.map +0 -1
- package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +0 -129
- package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/mongo/vendored/patches.js +0 -150
- package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +0 -1
- package/build/cjs/integrations/tracing/mongo/vendored/utils.js +0 -40
- package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/mongoose/index.js +0 -22
- package/build/cjs/integrations/tracing/mongoose/index.js.map +0 -1
- package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +0 -240
- package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +0 -1
- package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +0 -41
- package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/mysql/index.js +0 -21
- package/build/cjs/integrations/tracing/mysql/index.js.map +0 -1
- package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js +0 -185
- package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/mysql/vendored/semconv.js +0 -8
- package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +0 -1
- package/build/cjs/integrations/tracing/mysql/vendored/utils.js +0 -38
- package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/mysql2/index.js +0 -22
- package/build/cjs/integrations/tracing/mysql2/index.js.map +0 -1
- package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +0 -138
- package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js +0 -8
- package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +0 -1
- package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +0 -81
- package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/openai/index.js +0 -23
- package/build/cjs/integrations/tracing/openai/index.js.map +0 -1
- package/build/cjs/integrations/tracing/openai/instrumentation.js +0 -80
- package/build/cjs/integrations/tracing/openai/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/postgres/index.js +0 -27
- package/build/cjs/integrations/tracing/postgres/index.js.map +0 -1
- package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -11
- package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +0 -1
- package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js +0 -11
- package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +0 -1
- package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +0 -225
- package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +0 -8
- package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +0 -1
- package/build/cjs/integrations/tracing/postgres/vendored/utils.js +0 -151
- package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/postgresjs.js +0 -265
- package/build/cjs/integrations/tracing/postgresjs.js.map +0 -1
- package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +0 -147
- package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +0 -445
- package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/redis/vendored/semconv.js +0 -8
- package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +0 -1
- package/build/cjs/integrations/tracing/tedious/index.js +0 -21
- package/build/cjs/integrations/tracing/tedious/index.js.map +0 -1
- package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +0 -154
- package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +0 -1
- package/build/cjs/integrations/tracing/tedious/vendored/semconv.js +0 -8
- package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +0 -1
- package/build/cjs/integrations/tracing/tedious/vendored/utils.js +0 -29
- package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +0 -1
- package/build/cjs/integrations/tracing/vercelai/constants.js +0 -6
- package/build/cjs/integrations/tracing/vercelai/constants.js.map +0 -1
- package/build/cjs/integrations/tracing/vercelai/index.js +0 -36
- package/build/cjs/integrations/tracing/vercelai/index.js.map +0 -1
- package/build/cjs/integrations/tracing/vercelai/instrumentation.js +0 -176
- package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +0 -1
- package/build/cjs/preload.js +0 -8
- package/build/cjs/preload.js.map +0 -1
- package/build/cjs/sdk/diagnosticsChannelInjection.js +0 -21
- package/build/cjs/sdk/diagnosticsChannelInjection.js.map +0 -1
- package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +0 -33
- package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +0 -1
- package/build/cjs/utils/setHttpServerSpanRouteAttribute.js +0 -21
- package/build/cjs/utils/setHttpServerSpanRouteAttribute.js.map +0 -1
- package/build/esm/init.js +0 -4
- package/build/esm/init.js.map +0 -1
- package/build/esm/integrations/http.js +0 -66
- package/build/esm/integrations/http.js.map +0 -1
- package/build/esm/integrations/node-fetch.js +0 -22
- package/build/esm/integrations/node-fetch.js.map +0 -1
- package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js +0 -13
- package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js.map +0 -1
- package/build/esm/integrations/tracing/amqplib/index.js +0 -18
- package/build/esm/integrations/tracing/amqplib/index.js.map +0 -1
- package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js +0 -115
- package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/amqplib/vendored/patches.js +0 -177
- package/build/esm/integrations/tracing/amqplib/vendored/patches.js.map +0 -1
- package/build/esm/integrations/tracing/amqplib/vendored/semconv.js +0 -14
- package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +0 -1
- package/build/esm/integrations/tracing/amqplib/vendored/types.js +0 -15
- package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +0 -1
- package/build/esm/integrations/tracing/amqplib/vendored/utils.js +0 -117
- package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/anthropic-ai/index.js +0 -21
- package/build/esm/integrations/tracing/anthropic-ai/index.js.map +0 -1
- package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js +0 -70
- package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/connect/index.js +0 -31
- package/build/esm/integrations/tracing/connect/index.js.map +0 -1
- package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +0 -13
- package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +0 -1
- package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +0 -135
- package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/connect/vendored/internal-types.js +0 -6
- package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +0 -1
- package/build/esm/integrations/tracing/connect/vendored/utils.js +0 -32
- package/build/esm/integrations/tracing/connect/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/dataloader/index.js +0 -23
- package/build/esm/integrations/tracing/dataloader/index.js.map +0 -1
- package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js +0 -225
- package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/fastify/v3/constants.js +0 -4
- package/build/esm/integrations/tracing/fastify/v3/constants.js.map +0 -1
- package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js +0 -20
- package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +0 -1
- package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +0 -218
- package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/fastify/v3/utils.js +0 -60
- package/build/esm/integrations/tracing/fastify/v3/utils.js.map +0 -1
- package/build/esm/integrations/tracing/firebase/firebase.js +0 -18
- package/build/esm/integrations/tracing/firebase/firebase.js.map +0 -1
- package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +0 -26
- package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +0 -152
- package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +0 -1
- package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +0 -138
- package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +0 -1
- package/build/esm/integrations/tracing/genericPool/index.js +0 -18
- package/build/esm/integrations/tracing/genericPool/index.js.map +0 -1
- package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +0 -120
- package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/google-genai/index.js +0 -20
- package/build/esm/integrations/tracing/google-genai/index.js.map +0 -1
- package/build/esm/integrations/tracing/google-genai/instrumentation.js +0 -66
- package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/graphql/index.js +0 -31
- package/build/esm/integrations/tracing/graphql/index.js.map +0 -1
- package/build/esm/integrations/tracing/graphql/vendored/enum.js +0 -43
- package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +0 -1
- package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -13
- package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +0 -1
- package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +0 -327
- package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/graphql/vendored/internal-types.js +0 -4
- package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +0 -1
- package/build/esm/integrations/tracing/graphql/vendored/symbols.js +0 -5
- package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +0 -1
- package/build/esm/integrations/tracing/graphql/vendored/utils.js +0 -257
- package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js +0 -9
- package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +0 -1
- package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +0 -253
- package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/hapi/vendored/internal-types.js +0 -19
- package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +0 -1
- package/build/esm/integrations/tracing/hapi/vendored/utils.js +0 -76
- package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/hono/constants.js +0 -11
- package/build/esm/integrations/tracing/hono/constants.js.map +0 -1
- package/build/esm/integrations/tracing/hono/index.js +0 -82
- package/build/esm/integrations/tracing/hono/index.js.map +0 -1
- package/build/esm/integrations/tracing/hono/instrumentation.js +0 -199
- package/build/esm/integrations/tracing/hono/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/kafka/index.js +0 -18
- package/build/esm/integrations/tracing/kafka/index.js.map +0 -1
- package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +0 -235
- package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/kafka/vendored/semconv.js +0 -12
- package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +0 -1
- package/build/esm/integrations/tracing/kafka/vendored/utils.js +0 -108
- package/build/esm/integrations/tracing/kafka/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/knex/index.js +0 -23
- package/build/esm/integrations/tracing/knex/index.js.map +0 -1
- package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +0 -133
- package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/knex/vendored/semconv.js +0 -6
- package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +0 -1
- package/build/esm/integrations/tracing/knex/vendored/utils.js +0 -75
- package/build/esm/integrations/tracing/knex/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js +0 -8
- package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +0 -1
- package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +0 -125
- package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/koa/vendored/internal-types.js +0 -4
- package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +0 -1
- package/build/esm/integrations/tracing/koa/vendored/types.js +0 -8
- package/build/esm/integrations/tracing/koa/vendored/types.js.map +0 -1
- package/build/esm/integrations/tracing/koa/vendored/utils.js +0 -33
- package/build/esm/integrations/tracing/koa/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/langchain/index.js +0 -20
- package/build/esm/integrations/tracing/langchain/index.js.map +0 -1
- package/build/esm/integrations/tracing/langchain/instrumentation.js +0 -158
- package/build/esm/integrations/tracing/langchain/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/langgraph/index.js +0 -20
- package/build/esm/integrations/tracing/langgraph/index.js.map +0 -1
- package/build/esm/integrations/tracing/langgraph/instrumentation.js +0 -94
- package/build/esm/integrations/tracing/langgraph/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/lrumemoizer/index.js +0 -18
- package/build/esm/integrations/tracing/lrumemoizer/index.js.map +0 -1
- package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js +0 -36
- package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/mongo/index.js +0 -18
- package/build/esm/integrations/tracing/mongo/index.js.map +0 -1
- package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +0 -127
- package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/mongo/vendored/patches.js +0 -142
- package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +0 -1
- package/build/esm/integrations/tracing/mongo/vendored/utils.js +0 -34
- package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/mongoose/index.js +0 -19
- package/build/esm/integrations/tracing/mongoose/index.js.map +0 -1
- package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +0 -236
- package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +0 -1
- package/build/esm/integrations/tracing/mongoose/vendored/utils.js +0 -38
- package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/mysql/index.js +0 -18
- package/build/esm/integrations/tracing/mysql/index.js.map +0 -1
- package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js +0 -183
- package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/mysql/vendored/semconv.js +0 -5
- package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +0 -1
- package/build/esm/integrations/tracing/mysql/vendored/utils.js +0 -33
- package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/mysql2/index.js +0 -19
- package/build/esm/integrations/tracing/mysql2/index.js.map +0 -1
- package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +0 -136
- package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/mysql2/vendored/semconv.js +0 -5
- package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +0 -1
- package/build/esm/integrations/tracing/mysql2/vendored/utils.js +0 -75
- package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/openai/index.js +0 -20
- package/build/esm/integrations/tracing/openai/index.js.map +0 -1
- package/build/esm/integrations/tracing/openai/instrumentation.js +0 -78
- package/build/esm/integrations/tracing/openai/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/postgres/index.js +0 -24
- package/build/esm/integrations/tracing/postgres/index.js.map +0 -1
- package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -9
- package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +0 -1
- package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js +0 -9
- package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +0 -1
- package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +0 -223
- package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/postgres/vendored/semconv.js +0 -5
- package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +0 -1
- package/build/esm/integrations/tracing/postgres/vendored/utils.js +0 -136
- package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/postgresjs.js +0 -261
- package/build/esm/integrations/tracing/postgresjs.js.map +0 -1
- package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +0 -145
- package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +0 -443
- package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/redis/vendored/semconv.js +0 -5
- package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +0 -1
- package/build/esm/integrations/tracing/tedious/index.js +0 -18
- package/build/esm/integrations/tracing/tedious/index.js.map +0 -1
- package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +0 -152
- package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +0 -1
- package/build/esm/integrations/tracing/tedious/vendored/semconv.js +0 -5
- package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +0 -1
- package/build/esm/integrations/tracing/tedious/vendored/utils.js +0 -26
- package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +0 -1
- package/build/esm/integrations/tracing/vercelai/constants.js +0 -4
- package/build/esm/integrations/tracing/vercelai/constants.js.map +0 -1
- package/build/esm/integrations/tracing/vercelai/index.js +0 -33
- package/build/esm/integrations/tracing/vercelai/index.js.map +0 -1
- package/build/esm/integrations/tracing/vercelai/instrumentation.js +0 -171
- package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +0 -1
- package/build/esm/preload.js +0 -8
- package/build/esm/preload.js.map +0 -1
- package/build/esm/sdk/diagnosticsChannelInjection.js +0 -17
- package/build/esm/sdk/diagnosticsChannelInjection.js.map +0 -1
- package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +0 -30
- package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +0 -1
- package/build/esm/utils/setHttpServerSpanRouteAttribute.js +0 -19
- package/build/esm/utils/setHttpServerSpanRouteAttribute.js.map +0 -1
- package/build/loader-hook.mjs +0 -1
- package/build/types/init.d.ts +0 -2
- package/build/types/init.d.ts.map +0 -1
- package/build/types/integrations/http.d.ts +0 -131
- package/build/types/integrations/http.d.ts.map +0 -1
- package/build/types/integrations/node-fetch.d.ts +0 -9
- package/build/types/integrations/node-fetch.d.ts.map +0 -1
- package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts +0 -9
- package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts.map +0 -1
- package/build/types/integrations/tracing/amqplib/index.d.ts +0 -22
- package/build/types/integrations/tracing/amqplib/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +0 -44
- package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts +0 -11
- package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts +0 -11
- package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts.map +0 -1
- package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts +0 -23
- package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +0 -1
- package/build/types/integrations/tracing/amqplib/vendored/types.d.ts +0 -49
- package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts +0 -42
- package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/anthropic-ai/index.d.ts +0 -62
- package/build/types/integrations/tracing/anthropic-ai/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/anthropic-ai/instrumentation.d.ts +0 -19
- package/build/types/integrations/tracing/anthropic-ai/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/connect/index.d.ts +0 -48
- package/build/types/integrations/tracing/connect/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -9
- package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +0 -1
- package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +0 -18
- package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +0 -31
- package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/connect/vendored/utils.d.ts +0 -5
- package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/dataloader/index.d.ts +0 -22
- package/build/types/integrations/tracing/dataloader/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts +0 -18
- package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/dataloader/vendored/types.d.ts +0 -22
- package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/fastify/v3/constants.d.ts +0 -3
- package/build/types/integrations/tracing/fastify/v3/constants.d.ts.map +0 -1
- package/build/types/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts +0 -15
- package/build/types/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts.map +0 -1
- package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts +0 -16
- package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/fastify/v3/internal-types.d.ts +0 -7
- package/build/types/integrations/tracing/fastify/v3/internal-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/fastify/v3/types.d.ts +0 -21
- package/build/types/integrations/tracing/fastify/v3/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/fastify/v3/utils.d.ts +0 -28
- package/build/types/integrations/tracing/fastify/v3/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/firebase/firebase.d.ts +0 -8
- package/build/types/integrations/tracing/firebase/firebase.d.ts.map +0 -1
- package/build/types/integrations/tracing/firebase/index.d.ts +0 -2
- package/build/types/integrations/tracing/firebase/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +0 -14
- package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/firebase/otel/index.d.ts +0 -3
- package/build/types/integrations/tracing/firebase/otel/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts +0 -22
- package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts.map +0 -1
- package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts +0 -18
- package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts.map +0 -1
- package/build/types/integrations/tracing/firebase/otel/types.d.ts +0 -100
- package/build/types/integrations/tracing/firebase/otel/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/genericPool/index.d.ts +0 -22
- package/build/types/integrations/tracing/genericPool/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +0 -5
- package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts +0 -11
- package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/google-genai/index.d.ts +0 -62
- package/build/types/integrations/tracing/google-genai/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/google-genai/instrumentation.d.ts +0 -20
- package/build/types/integrations/tracing/google-genai/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/graphql/index.d.ts +0 -50
- package/build/types/integrations/tracing/graphql/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/graphql/vendored/enum.d.ts +0 -38
- package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +0 -1
- package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +0 -10
- package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +0 -1
- package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts +0 -2
- package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +0 -25
- package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +0 -63
- package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts +0 -3
- package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +0 -1
- package/build/types/integrations/tracing/graphql/vendored/types.d.ts +0 -33
- package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +0 -14
- package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +0 -6
- package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +0 -1
- package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts +0 -70
- package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +0 -72
- package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts +0 -32
- package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +0 -18
- package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/hono/constants.d.ts +0 -11
- package/build/types/integrations/tracing/hono/constants.d.ts.map +0 -1
- package/build/types/integrations/tracing/hono/index.d.ts +0 -60
- package/build/types/integrations/tracing/hono/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/hono/instrumentation.d.ts +0 -55
- package/build/types/integrations/tracing/hono/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/hono/types.d.ts +0 -36
- package/build/types/integrations/tracing/hono/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/kafka/index.d.ts +0 -21
- package/build/types/integrations/tracing/kafka/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +0 -15
- package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -79
- package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +0 -54
- package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +0 -1
- package/build/types/integrations/tracing/kafka/vendored/utils.d.ts +0 -29
- package/build/types/integrations/tracing/kafka/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/knex/index.d.ts +0 -22
- package/build/types/integrations/tracing/knex/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +0 -12
- package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +0 -7
- package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +0 -1
- package/build/types/integrations/tracing/knex/vendored/utils.d.ts +0 -9
- package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +0 -5
- package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +0 -1
- package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +0 -32
- package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +0 -34
- package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/koa/vendored/types.d.ts +0 -13
- package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/koa/vendored/utils.d.ts +0 -15
- package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/langchain/index.d.ts +0 -101
- package/build/types/integrations/tracing/langchain/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/langchain/instrumentation.d.ts +0 -38
- package/build/types/integrations/tracing/langchain/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/langgraph/index.d.ts +0 -77
- package/build/types/integrations/tracing/langgraph/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/langgraph/instrumentation.d.ts +0 -19
- package/build/types/integrations/tracing/langgraph/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/lrumemoizer/index.d.ts +0 -21
- package/build/types/integrations/tracing/lrumemoizer/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +0 -6
- package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongo/index.d.ts +0 -22
- package/build/types/integrations/tracing/mongo/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +0 -11
- package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -62
- package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongo/vendored/patches.d.ts +0 -15
- package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +0 -15
- package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongoose/index.d.ts +0 -22
- package/build/types/integrations/tracing/mongoose/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +0 -33
- package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +0 -18
- package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +0 -4
- package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql/index.d.ts +0 -22
- package/build/types/integrations/tracing/mysql/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts +0 -14
- package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts +0 -78
- package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts +0 -19
- package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql/vendored/utils.d.ts +0 -22
- package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql2/index.d.ts +0 -22
- package/build/types/integrations/tracing/mysql2/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +0 -9
- package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +0 -39
- package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts +0 -3
- package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +0 -25
- package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/openai/index.d.ts +0 -62
- package/build/types/integrations/tracing/openai/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/openai/instrumentation.d.ts +0 -26
- package/build/types/integrations/tracing/openai/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgres/index.d.ts +0 -26
- package/build/types/integrations/tracing/postgres/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -6
- package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +0 -6
- package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +0 -12
- package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -33
- package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +0 -20
- package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts +0 -54
- package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +0 -13
- package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgres/vendored/types.d.ts +0 -11
- package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +0 -56
- package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgresjs.d.ts +0 -103
- package/build/types/integrations/tracing/postgresjs.d.ts.map +0 -1
- package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +0 -10
- package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +0 -16
- package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/redis/vendored/semconv.d.ts +0 -4
- package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +0 -1
- package/build/types/integrations/tracing/tedious/index.d.ts +0 -22
- package/build/types/integrations/tracing/tedious/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +0 -11
- package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts +0 -19
- package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +0 -1
- package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts +0 -21
- package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/tedious/vendored/utils.d.ts +0 -9
- package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +0 -1
- package/build/types/integrations/tracing/vercelai/constants.d.ts +0 -2
- package/build/types/integrations/tracing/vercelai/constants.d.ts.map +0 -1
- package/build/types/integrations/tracing/vercelai/index.d.ts +0 -44
- package/build/types/integrations/tracing/vercelai/index.d.ts.map +0 -1
- package/build/types/integrations/tracing/vercelai/instrumentation.d.ts +0 -56
- package/build/types/integrations/tracing/vercelai/instrumentation.d.ts.map +0 -1
- package/build/types/integrations/tracing/vercelai/types.d.ts +0 -50
- package/build/types/integrations/tracing/vercelai/types.d.ts.map +0 -1
- package/build/types/preload.d.ts +0 -2
- package/build/types/preload.d.ts.map +0 -1
- package/build/types/sdk/diagnosticsChannelInjection.d.ts +0 -41
- package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +0 -1
- package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +0 -37
- package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +0 -1
- package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts +0 -9
- package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts.map +0 -1
- package/build/types-ts3.8/debug-build.d.ts +0 -7
- package/build/types-ts3.8/index.d.ts +0 -44
- package/build/types-ts3.8/init.d.ts +0 -2
- package/build/types-ts3.8/integrations/featureFlagShims/growthbook.d.ts +0 -6
- package/build/types-ts3.8/integrations/featureFlagShims/index.d.ts +0 -6
- package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +0 -12
- package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +0 -25
- package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +0 -8
- package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +0 -8
- package/build/types-ts3.8/integrations/fs/index.d.ts +0 -14
- package/build/types-ts3.8/integrations/fs/vendored/constants.d.ts +0 -5
- package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +0 -3
- package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +0 -23
- package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +0 -15
- package/build/types-ts3.8/integrations/http.d.ts +0 -134
- package/build/types-ts3.8/integrations/node-fetch.d.ts +0 -9
- package/build/types-ts3.8/integrations/tracing/InstrumentationNodeModuleFile.d.ts +0 -9
- package/build/types-ts3.8/integrations/tracing/amqplib/index.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +0 -44
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/instrumentation.d.ts +0 -11
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/patches.d.ts +0 -11
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv.d.ts +0 -23
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/types.d.ts +0 -49
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/utils.d.ts +0 -42
- package/build/types-ts3.8/integrations/tracing/anthropic-ai/index.d.ts +0 -62
- package/build/types-ts3.8/integrations/tracing/anthropic-ai/instrumentation.d.ts +0 -19
- package/build/types-ts3.8/integrations/tracing/connect/index.d.ts +0 -48
- package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -9
- package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +0 -18
- package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +0 -36
- package/build/types-ts3.8/integrations/tracing/connect/vendored/utils.d.ts +0 -5
- package/build/types-ts3.8/integrations/tracing/dataloader/index.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/dataloader/vendored/instrumentation.d.ts +0 -18
- package/build/types-ts3.8/integrations/tracing/dataloader/vendored/types.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/express.d.ts +0 -19
- package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +0 -119
- package/build/types-ts3.8/integrations/tracing/fastify/types.d.ts +0 -33
- package/build/types-ts3.8/integrations/tracing/fastify/v3/constants.d.ts +0 -3
- package/build/types-ts3.8/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts +0 -15
- package/build/types-ts3.8/integrations/tracing/fastify/v3/instrumentation.d.ts +0 -16
- package/build/types-ts3.8/integrations/tracing/fastify/v3/internal-types.d.ts +0 -7
- package/build/types-ts3.8/integrations/tracing/fastify/v3/types.d.ts +0 -21
- package/build/types-ts3.8/integrations/tracing/fastify/v3/utils.d.ts +0 -28
- package/build/types-ts3.8/integrations/tracing/firebase/firebase.d.ts +0 -8
- package/build/types-ts3.8/integrations/tracing/firebase/index.d.ts +0 -2
- package/build/types-ts3.8/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +0 -14
- package/build/types-ts3.8/integrations/tracing/firebase/otel/index.d.ts +0 -3
- package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/firestore.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/functions.d.ts +0 -18
- package/build/types-ts3.8/integrations/tracing/firebase/otel/types.d.ts +0 -100
- package/build/types-ts3.8/integrations/tracing/genericPool/index.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +0 -5
- package/build/types-ts3.8/integrations/tracing/genericPool/vendored/instrumentation.d.ts +0 -11
- package/build/types-ts3.8/integrations/tracing/google-genai/index.d.ts +0 -62
- package/build/types-ts3.8/integrations/tracing/google-genai/instrumentation.d.ts +0 -20
- package/build/types-ts3.8/integrations/tracing/graphql/index.d.ts +0 -50
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/enum.d.ts +0 -38
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +0 -10
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/graphql-types.d.ts +0 -2
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +0 -25
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +0 -63
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/symbols.d.ts +0 -3
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +0 -33
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +0 -14
- package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +0 -52
- package/build/types-ts3.8/integrations/tracing/hapi/types.d.ts +0 -166
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +0 -6
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/hapi-types.d.ts +0 -70
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +0 -72
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/internal-types.d.ts +0 -32
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +0 -18
- package/build/types-ts3.8/integrations/tracing/hono/constants.d.ts +0 -11
- package/build/types-ts3.8/integrations/tracing/hono/index.d.ts +0 -60
- package/build/types-ts3.8/integrations/tracing/hono/instrumentation.d.ts +0 -55
- package/build/types-ts3.8/integrations/tracing/hono/types.d.ts +0 -36
- package/build/types-ts3.8/integrations/tracing/index.d.ts +0 -12
- package/build/types-ts3.8/integrations/tracing/kafka/index.d.ts +0 -21
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/instrumentation.d.ts +0 -15
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -79
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +0 -54
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/utils.d.ts +0 -29
- package/build/types-ts3.8/integrations/tracing/knex/index.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +0 -12
- package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +0 -7
- package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +0 -9
- package/build/types-ts3.8/integrations/tracing/koa/index.d.ts +0 -72
- package/build/types-ts3.8/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +0 -5
- package/build/types-ts3.8/integrations/tracing/koa/vendored/instrumentation.d.ts +0 -32
- package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +0 -34
- package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +0 -13
- package/build/types-ts3.8/integrations/tracing/koa/vendored/utils.d.ts +0 -15
- package/build/types-ts3.8/integrations/tracing/langchain/index.d.ts +0 -101
- package/build/types-ts3.8/integrations/tracing/langchain/instrumentation.d.ts +0 -38
- package/build/types-ts3.8/integrations/tracing/langgraph/index.d.ts +0 -77
- package/build/types-ts3.8/integrations/tracing/langgraph/instrumentation.d.ts +0 -19
- package/build/types-ts3.8/integrations/tracing/lrumemoizer/index.d.ts +0 -21
- package/build/types-ts3.8/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +0 -6
- package/build/types-ts3.8/integrations/tracing/mongo/index.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +0 -11
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -62
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/patches.d.ts +0 -15
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +0 -15
- package/build/types-ts3.8/integrations/tracing/mongoose/index.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +0 -33
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +0 -18
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +0 -4
- package/build/types-ts3.8/integrations/tracing/mysql/index.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/instrumentation.d.ts +0 -14
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/mysql-types.d.ts +0 -78
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/semconv.d.ts +0 -19
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/utils.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/mysql2/index.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +0 -9
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +0 -39
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/semconv.d.ts +0 -3
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +0 -25
- package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +0 -62
- package/build/types-ts3.8/integrations/tracing/openai/instrumentation.d.ts +0 -26
- package/build/types-ts3.8/integrations/tracing/postgres/index.d.ts +0 -26
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -6
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +0 -6
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +0 -12
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -33
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +0 -20
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-types.d.ts +0 -54
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +0 -13
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +0 -11
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +0 -56
- package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +0 -103
- package/build/types-ts3.8/integrations/tracing/redis/cache.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/redis/index.d.ts +0 -28
- package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +0 -10
- package/build/types-ts3.8/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +0 -16
- package/build/types-ts3.8/integrations/tracing/redis/vendored/semconv.d.ts +0 -4
- package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +0 -24
- package/build/types-ts3.8/integrations/tracing/tedious/index.d.ts +0 -22
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +0 -11
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/semconv.d.ts +0 -19
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/tedious-types.d.ts +0 -21
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/utils.d.ts +0 -9
- package/build/types-ts3.8/integrations/tracing/vercelai/constants.d.ts +0 -2
- package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +0 -44
- package/build/types-ts3.8/integrations/tracing/vercelai/instrumentation.d.ts +0 -56
- package/build/types-ts3.8/integrations/tracing/vercelai/types.d.ts +0 -50
- package/build/types-ts3.8/preload.d.ts +0 -2
- package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +0 -41
- package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +0 -37
- package/build/types-ts3.8/sdk/index.d.ts +0 -36
- package/build/types-ts3.8/sdk/initOtel.d.ts +0 -30
- package/build/types-ts3.8/types.d.ts +0 -89
- package/build/types-ts3.8/utils/redisCache.d.ts +0 -17
- package/build/types-ts3.8/utils/setHttpServerSpanRouteAttribute.d.ts +0 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../src/integrations/context.ts"],"sourcesContent":["/* eslint-disable max-lines */\n\nimport { execFile } from 'node:child_process';\nimport { readdir, readFile } from 'node:fs';\nimport * as os from 'node:os';\nimport { join } from 'node:path';\nimport { promisify } from 'node:util';\nimport type {\n AppContext,\n CloudResourceContext,\n Contexts,\n CultureContext,\n DeviceContext,\n Event,\n IntegrationFn,\n OsContext,\n} from '@sentry/core';\nimport { defineIntegration, safeSetSpanJSONAttributes } from '@sentry/core';\n\nexport const readFileAsync = promisify(readFile);\nexport const readDirAsync = promisify(readdir);\n\n// Process enhanced with methods from Node 18, 20, 22 as @types/node\n// is on `14.18.0` to match minimum version requirements of the SDK\ninterface ProcessWithCurrentValues extends NodeJS.Process {\n availableMemory?(): number;\n}\n\nconst INTEGRATION_NAME = 'Context' as const;\n\ninterface DeviceContextOptions {\n cpu?: boolean;\n memory?: boolean;\n}\n\ninterface ContextOptions {\n app?: boolean;\n os?: boolean;\n device?: DeviceContextOptions | boolean;\n culture?: boolean;\n cloudResource?: boolean;\n}\n\nconst _nodeContextIntegration = ((options: ContextOptions = {}) => {\n const _options = {\n app: true,\n os: true,\n device: true,\n culture: true,\n cloudResource: true,\n ...options,\n };\n\n // Compute contexts eagerly (shared between tx and span paths)\n const appContext = _options.app ? getAppContext() : undefined;\n const deviceContext = _options.device ? getDeviceContext(_options.device) : undefined;\n const cultureContext = _options.culture ? getCultureContext() : undefined;\n const cloudResourceContext = _options.cloudResource ? getCloudResourceContext() : undefined;\n const osContextPromise = _options.os ? getOsContext() : undefined;\n\n // Map static context data to span attributes\n const cachedSpanAttributes: Record<string, unknown> = {\n 'process.runtime.engine.name': 'v8',\n 'process.runtime.engine.version': process.versions.v8,\n ...contextsToSpanAttributes({\n app: appContext,\n device: deviceContext,\n culture: cultureContext,\n cloud_resource: cloudResourceContext,\n }),\n };\n\n if (osContextPromise) {\n osContextPromise\n .then(osCtx => Object.assign(cachedSpanAttributes, contextsToSpanAttributes({ os: osCtx })))\n .catch(() => {\n // Ignore - os attributes will be undefined\n });\n }\n\n // Build contexts for event processing (reuses same data, awaits async OS context)\n const contextsPromise: Promise<Contexts> = (async () => {\n const contexts: Contexts = {};\n if (osContextPromise) {\n contexts.os = await osContextPromise;\n }\n if (appContext) {\n contexts.app = appContext;\n }\n if (deviceContext) {\n contexts.device = deviceContext;\n }\n if (cultureContext) {\n contexts.culture = cultureContext;\n }\n if (cloudResourceContext) {\n contexts.cloud_resource = cloudResourceContext;\n }\n return contexts;\n })();\n\n async function addContext(event: Event): Promise<Event> {\n const updatedContext = _updateContext(await contextsPromise);\n\n event.contexts = {\n ...event.contexts,\n app: { ...updatedContext.app, ...event.contexts?.app },\n os: { ...updatedContext.os, ...event.contexts?.os },\n device: { ...updatedContext.device, ...event.contexts?.device },\n culture: { ...updatedContext.culture, ...event.contexts?.culture },\n cloud_resource: { ...updatedContext.cloud_resource, ...event.contexts?.cloud_resource },\n };\n\n return event;\n }\n\n return {\n name: INTEGRATION_NAME,\n processEvent(event) {\n return addContext(event);\n },\n processSegmentSpan(span) {\n safeSetSpanJSONAttributes(span, cachedSpanAttributes);\n safeSetSpanJSONAttributes(span, getDynamicSpanAttributes(appContext, deviceContext));\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Capture context about the environment and the device that the client is running on, to events.\n */\nexport const nodeContextIntegration = defineIntegration(_nodeContextIntegration);\n\n/**\n * Updates the context with dynamic values that can change\n */\nfunction _updateContext(contexts: Contexts): Contexts {\n // Only update properties if they exist\n\n if (contexts.app?.app_memory) {\n contexts.app.app_memory = process.memoryUsage().rss;\n }\n\n if (contexts.app?.free_memory && typeof (process as ProcessWithCurrentValues).availableMemory === 'function') {\n const freeMemory = (process as ProcessWithCurrentValues).availableMemory?.();\n if (freeMemory != null) {\n contexts.app.free_memory = freeMemory;\n }\n }\n\n if (contexts.device?.free_memory) {\n contexts.device.free_memory = os.freemem();\n }\n\n return contexts;\n}\n\nexport function contextsToSpanAttributes(contexts: Contexts): Record<string, unknown> {\n const attrs: Record<string, unknown> = {};\n\n const { app, device, os: osCtx, culture, cloud_resource } = contexts;\n\n if (app) {\n if (app.app_start_time) {\n attrs['app.start_time'] = app.app_start_time;\n }\n }\n\n if (device) {\n if (device.arch) {\n attrs['device.archs'] = [device.arch];\n }\n if (device.boot_time) {\n attrs['device.boot_time'] = device.boot_time;\n }\n if (device.memory_size != null) {\n attrs['device.memory_size'] = device.memory_size;\n }\n if (device.processor_count != null) {\n attrs['device.processor_count'] = device.processor_count;\n }\n if (device.cpu_description) {\n attrs['device.cpu_description'] = device.cpu_description;\n }\n if (device.processor_frequency != null) {\n attrs['device.processor_frequency'] = device.processor_frequency;\n }\n }\n\n if (osCtx) {\n if (osCtx.name) {\n attrs['os.name'] = osCtx.name;\n }\n if (osCtx.version) {\n attrs['os.version'] = osCtx.version;\n }\n if (osCtx.kernel_version) {\n attrs['os.kernel_version'] = osCtx.kernel_version;\n }\n if (osCtx.build) {\n attrs['os.build'] = osCtx.build;\n }\n }\n\n if (culture) {\n if (culture.locale) {\n attrs['culture.locale'] = culture.locale;\n }\n if (culture.timezone) {\n attrs['culture.timezone'] = culture.timezone;\n }\n }\n\n // CloudResourceContext already uses dot-notation keys matching span attribute conventions\n if (cloud_resource) {\n for (const [key, value] of Object.entries(cloud_resource)) {\n if (value != null) {\n attrs[key] = value;\n }\n }\n }\n\n return attrs;\n}\n\nexport function getDynamicSpanAttributes(\n appContext: AppContext | undefined,\n deviceContext: DeviceContext | undefined,\n): Record<string, unknown> {\n const attrs: Record<string, unknown> = {};\n\n if (appContext) {\n attrs['app.memory'] = process.memoryUsage().rss;\n if (typeof (process as ProcessWithCurrentValues).availableMemory === 'function') {\n const freeMemory = (process as ProcessWithCurrentValues).availableMemory?.();\n if (freeMemory != null) {\n attrs['app.free_memory'] = freeMemory;\n }\n }\n }\n\n // Only include if memory tracking was initially enabled (indicated by free_memory being set)\n if (deviceContext?.free_memory != null) {\n attrs['device.free_memory'] = os.freemem();\n }\n\n return attrs;\n}\n\n/**\n * Returns the operating system context.\n *\n * Based on the current platform, this uses a different strategy to provide the\n * most accurate OS information. Since this might involve spawning subprocesses\n * or accessing the file system, this should only be executed lazily and cached.\n *\n * - On macOS (Darwin), this will execute the `sw_vers` utility. The context\n * has a `name`, `version`, `build` and `kernel_version` set.\n * - On Linux, this will try to load a distribution release from `/etc` and set\n * the `name`, `version` and `kernel_version` fields.\n * - On all other platforms, only a `name` and `version` will be returned. Note\n * that `version` might actually be the kernel version.\n */\nasync function getOsContext(): Promise<OsContext> {\n const platformId = os.platform();\n switch (platformId) {\n case 'darwin':\n return getDarwinInfo();\n case 'linux':\n return getLinuxInfo();\n default:\n return {\n name: PLATFORM_NAMES[platformId] || platformId,\n version: os.release(),\n };\n }\n}\n\nfunction getCultureContext(): CultureContext | undefined {\n try {\n if (typeof process.versions.icu !== 'string') {\n // Node was built without ICU support\n return;\n }\n\n // Check that node was built with full Intl support. Its possible it was built without support for non-English\n // locales which will make resolvedOptions inaccurate\n //\n // https://nodejs.org/api/intl.html#detecting-internationalization-support\n const january = new Date(9e8);\n const spanish = new Intl.DateTimeFormat('es', { month: 'long' });\n if (spanish.format(january) === 'enero') {\n const options = Intl.DateTimeFormat().resolvedOptions();\n\n return {\n locale: options.locale,\n timezone: options.timeZone,\n };\n }\n } catch {\n //\n }\n\n return;\n}\n\n/**\n * Get app context information from process\n */\nexport function getAppContext(): AppContext {\n const app_memory = process.memoryUsage().rss;\n // oxlint-disable-next-line sdk/no-unsafe-random-apis\n const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString();\n // https://nodejs.org/api/process.html#processavailablememory\n const appContext: AppContext = { app_start_time, app_memory };\n\n if (typeof (process as ProcessWithCurrentValues).availableMemory === 'function') {\n const freeMemory = (process as ProcessWithCurrentValues).availableMemory?.();\n if (freeMemory != null) {\n appContext.free_memory = freeMemory;\n }\n }\n\n return appContext;\n}\n\n/**\n * Gets device information from os\n */\nexport function getDeviceContext(deviceOpt: DeviceContextOptions | true): DeviceContext {\n const device: DeviceContext = {};\n\n // Sometimes os.uptime() throws due to lacking permissions: https://github.com/getsentry/sentry-javascript/issues/8202\n let uptime;\n try {\n uptime = os.uptime();\n } catch {\n // noop\n }\n\n // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions).\n // Hence, we only set boot time, if we get a valid uptime value.\n // @see https://github.com/getsentry/sentry-javascript/issues/5856\n if (typeof uptime === 'number') {\n // oxlint-disable-next-line sdk/no-unsafe-random-apis\n device.boot_time = new Date(Date.now() - uptime * 1000).toISOString();\n }\n\n device.arch = os.arch();\n\n if (deviceOpt === true || deviceOpt.memory) {\n device.memory_size = os.totalmem();\n device.free_memory = os.freemem();\n }\n\n if (deviceOpt === true || deviceOpt.cpu) {\n const cpuInfo = os.cpus() as os.CpuInfo[] | undefined;\n const firstCpu = cpuInfo?.[0];\n if (firstCpu) {\n device.processor_count = cpuInfo.length;\n device.cpu_description = firstCpu.model;\n device.processor_frequency = firstCpu.speed;\n }\n }\n\n return device;\n}\n\n/** Mapping of Node's platform names to actual OS names. */\nconst PLATFORM_NAMES: { [platform: string]: string } = {\n aix: 'IBM AIX',\n freebsd: 'FreeBSD',\n openbsd: 'OpenBSD',\n sunos: 'SunOS',\n win32: 'Windows',\n ohos: 'OpenHarmony',\n android: 'Android',\n};\n\n/** Linux version file to check for a distribution. */\ninterface DistroFile {\n /** The file name, located in `/etc`. */\n name: string;\n /** Potential distributions to check. */\n distros: [string, ...string[]];\n}\n\n/** Mapping of linux release files located in /etc to distributions. */\nconst LINUX_DISTROS: DistroFile[] = [\n { name: 'fedora-release', distros: ['Fedora'] },\n { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },\n { name: 'redhat_version', distros: ['Red Hat Linux'] },\n { name: 'SuSE-release', distros: ['SUSE Linux'] },\n { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },\n { name: 'debian_version', distros: ['Debian'] },\n { name: 'debian_release', distros: ['Debian'] },\n { name: 'arch-release', distros: ['Arch Linux'] },\n { name: 'gentoo-release', distros: ['Gentoo Linux'] },\n { name: 'novell-release', distros: ['SUSE Linux'] },\n { name: 'alpine-release', distros: ['Alpine Linux'] },\n];\n\n/** Functions to extract the OS version from Linux release files. */\nconst LINUX_VERSIONS: {\n [identifier: string]: (content: string) => string | undefined;\n} = {\n alpine: content => content,\n arch: content => matchFirst(/distrib_release=(.*)/, content),\n centos: content => matchFirst(/release ([^ ]+)/, content),\n debian: content => content,\n fedora: content => matchFirst(/release (..)/, content),\n mint: content => matchFirst(/distrib_release=(.*)/, content),\n red: content => matchFirst(/release ([^ ]+)/, content),\n suse: content => matchFirst(/VERSION = (.*)\\n/, content),\n ubuntu: content => matchFirst(/distrib_release=(.*)/, content),\n};\n\n/**\n * Executes a regular expression with one capture group.\n *\n * @param regex A regular expression to execute.\n * @param text Content to execute the RegEx on.\n * @returns The captured string if matched; otherwise undefined.\n */\nfunction matchFirst(regex: RegExp, text: string): string | undefined {\n const match = regex.exec(text);\n return match ? match[1] : undefined;\n}\n\n/** Loads the macOS operating system context. */\nasync function getDarwinInfo(): Promise<OsContext> {\n // Default values that will be used in case no operating system information\n // can be loaded. The default version is computed via heuristics from the\n // kernel version, but the build ID is missing.\n const darwinInfo: OsContext = {\n kernel_version: os.release(),\n name: 'Mac OS X',\n version: `10.${Number(os.release().split('.')[0]) - 4}`,\n };\n\n try {\n // We try to load the actual macOS version by executing the `sw_vers` tool.\n // This tool should be available on every standard macOS installation. In\n // case this fails, we stick with the values computed above.\n\n const output = await new Promise<string>((resolve, reject) => {\n execFile('/usr/bin/sw_vers', (error: Error | null, stdout: string) => {\n if (error) {\n reject(error);\n return;\n }\n resolve(stdout);\n });\n });\n\n darwinInfo.name = matchFirst(/^ProductName:\\s+(.*)$/m, output);\n darwinInfo.version = matchFirst(/^ProductVersion:\\s+(.*)$/m, output);\n darwinInfo.build = matchFirst(/^BuildVersion:\\s+(.*)$/m, output);\n } catch {\n // ignore\n }\n\n return darwinInfo;\n}\n\n/** Returns a distribution identifier to look up version callbacks. */\nfunction getLinuxDistroId(name: string): string {\n return (name.split(' ') as [string])[0].toLowerCase();\n}\n\n/** Loads the Linux operating system context. */\nasync function getLinuxInfo(): Promise<OsContext> {\n // By default, we cannot assume anything about the distribution or Linux\n // version. `os.release()` returns the kernel version and we assume a generic\n // \"Linux\" name, which will be replaced down below.\n const linuxInfo: OsContext = {\n kernel_version: os.release(),\n name: 'Linux',\n };\n\n try {\n // We start guessing the distribution by listing files in the /etc\n // directory. This is were most Linux distributions (except Knoppix) store\n // release files with certain distribution-dependent meta data. We search\n // for exactly one known file defined in `LINUX_DISTROS` and exit if none\n // are found. In case there are more than one file, we just stick with the\n // first one.\n const etcFiles = await readDirAsync('/etc');\n const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name));\n if (!distroFile) {\n return linuxInfo;\n }\n\n // Once that file is known, load its contents. To make searching in those\n // files easier, we lowercase the file contents. Since these files are\n // usually quite small, this should not allocate too much memory and we only\n // hold on to it for a very short amount of time.\n const distroPath = join('/etc', distroFile.name);\n const contents = (await readFileAsync(distroPath, { encoding: 'utf-8' })).toLowerCase();\n\n // Some Linux distributions store their release information in the same file\n // (e.g. RHEL and Centos). In those cases, we scan the file for an\n // identifier, that basically consists of the first word of the linux\n // distribution name (e.g. \"red\" for Red Hat). In case there is no match, we\n // just assume the first distribution in our list.\n const { distros } = distroFile;\n linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];\n\n // Based on the found distribution, we can now compute the actual version\n // number. This is different for every distribution, so several strategies\n // are computed in `LINUX_VERSIONS`.\n const id = getLinuxDistroId(linuxInfo.name);\n linuxInfo.version = LINUX_VERSIONS[id]?.(contents);\n } catch {\n // ignore\n }\n\n return linuxInfo;\n}\n\n/**\n * Grabs some information about hosting provider based on best effort.\n */\nfunction getCloudResourceContext(): CloudResourceContext | undefined {\n if (process.env.VERCEL) {\n // https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables\n return {\n 'cloud.provider': 'vercel',\n 'cloud.region': process.env.VERCEL_REGION,\n };\n } else if (process.env.AWS_REGION) {\n // https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html\n return {\n 'cloud.provider': 'aws',\n 'cloud.region': process.env.AWS_REGION,\n 'cloud.platform': process.env.AWS_EXECUTION_ENV,\n };\n } else if (process.env.GCP_PROJECT) {\n // https://cloud.google.com/composer/docs/how-to/managing/environment-variables#reserved_variables\n return {\n 'cloud.provider': 'gcp',\n };\n } else if (process.env.ALIYUN_REGION_ID) {\n // TODO: find where I found these environment variables - at least gc.github.com returns something\n return {\n 'cloud.provider': 'alibaba_cloud',\n 'cloud.region': process.env.ALIYUN_REGION_ID,\n };\n } else if (process.env.WEBSITE_SITE_NAME && process.env.REGION_NAME) {\n // https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#app-environment\n return {\n 'cloud.provider': 'azure',\n 'cloud.region': process.env.REGION_NAME,\n };\n } else if (process.env.IBM_CLOUD_REGION) {\n // TODO: find where I found these environment variables - at least gc.github.com returns something\n return {\n 'cloud.provider': 'ibm_cloud',\n 'cloud.region': process.env.IBM_CLOUD_REGION,\n };\n } else if (process.env.TENCENTCLOUD_REGION) {\n // https://www.tencentcloud.com/document/product/583/32748\n return {\n 'cloud.provider': 'tencent_cloud',\n 'cloud.region': process.env.TENCENTCLOUD_REGION,\n 'cloud.account.id': process.env.TENCENTCLOUD_APPID,\n 'cloud.availability_zone': process.env.TENCENTCLOUD_ZONE,\n };\n } else if (process.env.NETLIFY) {\n // https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables\n return {\n 'cloud.provider': 'netlify',\n };\n } else if (process.env.FLY_REGION) {\n // https://fly.io/docs/reference/runtime-environment/\n return {\n 'cloud.provider': 'fly.io',\n 'cloud.region': process.env.FLY_REGION,\n };\n } else if (process.env.DYNO) {\n // https://devcenter.heroku.com/articles/dynos#local-environment-variables\n return {\n 'cloud.provider': 'heroku',\n };\n } else {\n return undefined;\n }\n}\n"],"names":["promisify","readFile","readdir","safeSetSpanJSONAttributes","defineIntegration","execFile","join"],"mappings":";;;;;;;;;AAmBO,MAAM,aAAA,GAAgBA,eAAUC,gBAAQ;AACxC,MAAM,YAAA,GAAeD,eAAUE,eAAO;AAQ7C,MAAM,gBAAA,GAAmB,SAAA;AAezB,MAAM,uBAAA,IAA2B,CAAC,OAAA,GAA0B,EAAC,KAAM;AACjE,EAAA,MAAM,QAAA,GAAW;AAAA,IACf,GAAA,EAAK,IAAA;AAAA,IACL,EAAA,EAAI,IAAA;AAAA,IACJ,MAAA,EAAQ,IAAA;AAAA,IACR,OAAA,EAAS,IAAA;AAAA,IACT,aAAA,EAAe,IAAA;AAAA,IACf,GAAG;AAAA,GACL;AAGA,EAAA,MAAM,UAAA,GAAa,QAAA,CAAS,GAAA,GAAM,aAAA,EAAc,GAAI,MAAA;AACpD,EAAA,MAAM,gBAAgB,QAAA,CAAS,MAAA,GAAS,gBAAA,CAAiB,QAAA,CAAS,MAAM,CAAA,GAAI,MAAA;AAC5E,EAAA,MAAM,cAAA,GAAiB,QAAA,CAAS,OAAA,GAAU,iBAAA,EAAkB,GAAI,MAAA;AAChE,EAAA,MAAM,oBAAA,GAAuB,QAAA,CAAS,aAAA,GAAgB,uBAAA,EAAwB,GAAI,MAAA;AAClF,EAAA,MAAM,gBAAA,GAAmB,QAAA,CAAS,EAAA,GAAK,YAAA,EAAa,GAA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,IAAA,OAAO;AAAA,MACL,gBAAA,EAAkB,QAAA;AAAA,MAClB,cAAA,EAAgB,QAAQ,GAAA,CAAI;AAAA,KAC9B;AAAA,EACF,CAAA,MAAA,IAAW,OAAA,CAAQ,GAAA,CAAI,IAAA,EAAM;AAE3B,IAAA,OAAO;AAAA,MACL,gBAAA,EAAkB;AAAA,KACpB;AAAA,EACF,CAAA,MAAO;AACL,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;;;;;;;"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const node_fs = require('node:fs');
|
|
4
|
+
const node_readline = require('node:readline');
|
|
5
|
+
const core = require('@sentry/core');
|
|
6
|
+
const debugBuild = require('../debug-build.js');
|
|
7
|
+
|
|
8
|
+
const LRU_FILE_CONTENTS_CACHE = new core.LRUMap(10);
|
|
9
|
+
const LRU_FILE_CONTENTS_FS_READ_FAILED = new core.LRUMap(20);
|
|
10
|
+
const DEFAULT_LINES_OF_CONTEXT = 7;
|
|
11
|
+
const INTEGRATION_NAME = "ContextLines";
|
|
12
|
+
const MAX_CONTEXTLINES_COLNO = 1e3;
|
|
13
|
+
const MAX_CONTEXTLINES_LINENO = 1e4;
|
|
14
|
+
function emplace(map, key, contents) {
|
|
15
|
+
const value = map.get(key);
|
|
16
|
+
if (value === void 0) {
|
|
17
|
+
map.set(key, contents);
|
|
18
|
+
return contents;
|
|
19
|
+
}
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
function shouldSkipContextLinesForFile(path) {
|
|
23
|
+
if (path.startsWith("node:")) return true;
|
|
24
|
+
if (path.endsWith(".min.js")) return true;
|
|
25
|
+
if (path.endsWith(".min.cjs")) return true;
|
|
26
|
+
if (path.endsWith(".min.mjs")) return true;
|
|
27
|
+
if (path.startsWith("data:")) return true;
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
function shouldSkipContextLinesForFrame(frame) {
|
|
31
|
+
if (frame.lineno !== void 0 && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;
|
|
32
|
+
if (frame.colno !== void 0 && frame.colno > MAX_CONTEXTLINES_COLNO) return true;
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
function rangeExistsInContentCache(file, range) {
|
|
36
|
+
const contents = LRU_FILE_CONTENTS_CACHE.get(file);
|
|
37
|
+
if (contents === void 0) return false;
|
|
38
|
+
for (let i = range[0]; i <= range[1]; i++) {
|
|
39
|
+
if (contents[i] === void 0) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
function makeLineReaderRanges(lines, linecontext) {
|
|
46
|
+
if (!lines.length) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
let i = 0;
|
|
50
|
+
const line = lines[0];
|
|
51
|
+
if (typeof line !== "number") {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
let current = makeContextRange(line, linecontext);
|
|
55
|
+
const out = [];
|
|
56
|
+
while (true) {
|
|
57
|
+
if (i === lines.length - 1) {
|
|
58
|
+
out.push(current);
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
const next = lines[i + 1];
|
|
62
|
+
if (typeof next !== "number") {
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
if (next <= current[1]) {
|
|
66
|
+
current[1] = next + linecontext;
|
|
67
|
+
} else {
|
|
68
|
+
out.push(current);
|
|
69
|
+
current = makeContextRange(next, linecontext);
|
|
70
|
+
}
|
|
71
|
+
i++;
|
|
72
|
+
}
|
|
73
|
+
return out;
|
|
74
|
+
}
|
|
75
|
+
function getContextLinesFromFile(path, ranges, output) {
|
|
76
|
+
return new Promise((resolve, _reject) => {
|
|
77
|
+
const stream = node_fs.createReadStream(path);
|
|
78
|
+
const lineReaded = node_readline.createInterface({
|
|
79
|
+
input: stream
|
|
80
|
+
});
|
|
81
|
+
function destroyStreamAndResolve() {
|
|
82
|
+
stream.destroy();
|
|
83
|
+
resolve();
|
|
84
|
+
}
|
|
85
|
+
let lineNumber = 0;
|
|
86
|
+
let currentRangeIndex = 0;
|
|
87
|
+
const range = ranges[currentRangeIndex];
|
|
88
|
+
if (range === void 0) {
|
|
89
|
+
destroyStreamAndResolve();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
let rangeStart = range[0];
|
|
93
|
+
let rangeEnd = range[1];
|
|
94
|
+
function onStreamError(e) {
|
|
95
|
+
LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1);
|
|
96
|
+
debugBuild.DEBUG_BUILD && core.debug.error(`Failed to read file: ${path}. Error: ${e}`);
|
|
97
|
+
lineReaded.close();
|
|
98
|
+
lineReaded.removeAllListeners();
|
|
99
|
+
destroyStreamAndResolve();
|
|
100
|
+
}
|
|
101
|
+
stream.on("error", onStreamError);
|
|
102
|
+
lineReaded.on("error", onStreamError);
|
|
103
|
+
lineReaded.on("close", destroyStreamAndResolve);
|
|
104
|
+
lineReaded.on("line", (line) => {
|
|
105
|
+
lineNumber++;
|
|
106
|
+
if (lineNumber < rangeStart) return;
|
|
107
|
+
output[lineNumber] = core.snipLine(line, 0);
|
|
108
|
+
if (lineNumber >= rangeEnd) {
|
|
109
|
+
if (currentRangeIndex === ranges.length - 1) {
|
|
110
|
+
lineReaded.close();
|
|
111
|
+
lineReaded.removeAllListeners();
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
currentRangeIndex++;
|
|
115
|
+
const range2 = ranges[currentRangeIndex];
|
|
116
|
+
if (range2 === void 0) {
|
|
117
|
+
lineReaded.close();
|
|
118
|
+
lineReaded.removeAllListeners();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
rangeStart = range2[0];
|
|
122
|
+
rangeEnd = range2[1];
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
async function addSourceContext(event, contextLines) {
|
|
128
|
+
const filesToLines = {};
|
|
129
|
+
if (contextLines > 0 && event.exception?.values) {
|
|
130
|
+
for (const exception of event.exception.values) {
|
|
131
|
+
if (!exception.stacktrace?.frames?.length) {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {
|
|
135
|
+
const frame = exception.stacktrace.frames[i];
|
|
136
|
+
const filename = frame?.filename;
|
|
137
|
+
if (!frame || typeof filename !== "string" || typeof frame.lineno !== "number" || shouldSkipContextLinesForFile(filename) || shouldSkipContextLinesForFrame(frame)) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
const filesToLinesOutput = filesToLines[filename];
|
|
141
|
+
if (!filesToLinesOutput) filesToLines[filename] = [];
|
|
142
|
+
filesToLines[filename].push(frame.lineno);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
const files = Object.keys(filesToLines);
|
|
147
|
+
if (files.length == 0) {
|
|
148
|
+
return event;
|
|
149
|
+
}
|
|
150
|
+
const readlinePromises = [];
|
|
151
|
+
for (const file of files) {
|
|
152
|
+
if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) {
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
const filesToLineRanges = filesToLines[file];
|
|
156
|
+
if (!filesToLineRanges) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
filesToLineRanges.sort((a, b) => a - b);
|
|
160
|
+
const ranges = makeLineReaderRanges(filesToLineRanges, contextLines);
|
|
161
|
+
if (ranges.every((r) => rangeExistsInContentCache(file, r))) {
|
|
162
|
+
continue;
|
|
163
|
+
}
|
|
164
|
+
const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {});
|
|
165
|
+
readlinePromises.push(getContextLinesFromFile(file, ranges, cache));
|
|
166
|
+
}
|
|
167
|
+
await Promise.all(readlinePromises).catch(() => {
|
|
168
|
+
debugBuild.DEBUG_BUILD && core.debug.log("Failed to read one or more source files and resolve context lines");
|
|
169
|
+
});
|
|
170
|
+
if (contextLines > 0 && event.exception?.values) {
|
|
171
|
+
for (const exception of event.exception.values) {
|
|
172
|
+
if (exception.stacktrace?.frames && exception.stacktrace.frames.length > 0) {
|
|
173
|
+
addSourceContextToFrames(exception.stacktrace.frames, contextLines, LRU_FILE_CONTENTS_CACHE);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return event;
|
|
178
|
+
}
|
|
179
|
+
function addSourceContextToFrames(frames, contextLines, cache) {
|
|
180
|
+
for (const frame of frames) {
|
|
181
|
+
if (frame.filename && frame.context_line === void 0 && typeof frame.lineno === "number") {
|
|
182
|
+
const contents = cache.get(frame.filename);
|
|
183
|
+
if (contents === void 0) {
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
addContextToFrame(frame.lineno, frame, contextLines, contents);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function clearLineContext(frame) {
|
|
191
|
+
delete frame.pre_context;
|
|
192
|
+
delete frame.context_line;
|
|
193
|
+
delete frame.post_context;
|
|
194
|
+
}
|
|
195
|
+
function addContextToFrame(lineno, frame, contextLines, contents) {
|
|
196
|
+
if (frame.lineno === void 0 || contents === void 0) {
|
|
197
|
+
debugBuild.DEBUG_BUILD && core.debug.error("Cannot resolve context for frame with no lineno or file contents");
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
frame.pre_context = [];
|
|
201
|
+
for (let i = makeRangeStart(lineno, contextLines); i < lineno; i++) {
|
|
202
|
+
const line = contents[i];
|
|
203
|
+
if (line === void 0) {
|
|
204
|
+
clearLineContext(frame);
|
|
205
|
+
debugBuild.DEBUG_BUILD && core.debug.error(`Could not find line ${i} in file ${frame.filename}`);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
frame.pre_context.push(line);
|
|
209
|
+
}
|
|
210
|
+
if (contents[lineno] === void 0) {
|
|
211
|
+
clearLineContext(frame);
|
|
212
|
+
debugBuild.DEBUG_BUILD && core.debug.error(`Could not find line ${lineno} in file ${frame.filename}`);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
frame.context_line = contents[lineno];
|
|
216
|
+
const end = makeRangeEnd(lineno, contextLines);
|
|
217
|
+
frame.post_context = [];
|
|
218
|
+
for (let i = lineno + 1; i <= end; i++) {
|
|
219
|
+
const line = contents[i];
|
|
220
|
+
if (line === void 0) {
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
frame.post_context.push(line);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function makeRangeStart(line, linecontext) {
|
|
227
|
+
return Math.max(1, line - linecontext);
|
|
228
|
+
}
|
|
229
|
+
function makeRangeEnd(line, linecontext) {
|
|
230
|
+
return line + linecontext;
|
|
231
|
+
}
|
|
232
|
+
function makeContextRange(line, linecontext) {
|
|
233
|
+
return [makeRangeStart(line, linecontext), makeRangeEnd(line, linecontext)];
|
|
234
|
+
}
|
|
235
|
+
const _contextLinesIntegration = ((options = {}) => {
|
|
236
|
+
return {
|
|
237
|
+
name: INTEGRATION_NAME,
|
|
238
|
+
processEvent(event, _hint, client) {
|
|
239
|
+
const contextLines = options.frameContextLines ?? client?.getDataCollectionOptions().frameContextLines ?? DEFAULT_LINES_OF_CONTEXT;
|
|
240
|
+
return addSourceContext(event, contextLines);
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
});
|
|
244
|
+
const contextLinesIntegration = core.defineIntegration(_contextLinesIntegration);
|
|
245
|
+
|
|
246
|
+
exports.MAX_CONTEXTLINES_COLNO = MAX_CONTEXTLINES_COLNO;
|
|
247
|
+
exports.MAX_CONTEXTLINES_LINENO = MAX_CONTEXTLINES_LINENO;
|
|
248
|
+
exports._contextLinesIntegration = _contextLinesIntegration;
|
|
249
|
+
exports.addContextToFrame = addContextToFrame;
|
|
250
|
+
exports.contextLinesIntegration = contextLinesIntegration;
|
|
251
|
+
//# sourceMappingURL=contextlines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextlines.js","sources":["../../../src/integrations/contextlines.ts"],"sourcesContent":["import { createReadStream } from 'node:fs';\nimport { createInterface } from 'node:readline';\nimport type { Event, IntegrationFn, StackFrame } from '@sentry/core';\nimport { debug, defineIntegration, LRUMap, snipLine } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\n\nconst LRU_FILE_CONTENTS_CACHE = new LRUMap<string, Record<number, string>>(10);\nconst LRU_FILE_CONTENTS_FS_READ_FAILED = new LRUMap<string, 1>(20);\nconst DEFAULT_LINES_OF_CONTEXT = 7;\nconst INTEGRATION_NAME = 'ContextLines' as const;\n// Determines the upper bound of lineno/colno that we will attempt to read. Large colno values are likely to be\n// minified code while large lineno values are likely to be bundled code.\n// Exported for testing purposes.\nexport const MAX_CONTEXTLINES_COLNO: number = 1000;\nexport const MAX_CONTEXTLINES_LINENO: number = 10000;\n\n// TODO(v11): Use `dataCollection.frameContextLines` default (5)\ninterface ContextLinesOptions {\n /**\n * Sets the number of context lines for each frame when loading a file.\n * Defaults to 7.\n *\n * Set to 0 to disable loading and inclusion of source files.\n *\n * When set, this option takes precedence over `dataCollection.frameContextLines`.\n **/\n frameContextLines?: number;\n}\n\n/**\n * Exported for testing purposes.\n */\nexport function resetFileContentCache(): void {\n LRU_FILE_CONTENTS_CACHE.clear();\n}\n\n/**\n * Get or init map value\n */\nfunction emplace<T extends LRUMap<K, V>, K extends string, V>(map: T, key: K, contents: V): V {\n const value = map.get(key);\n\n if (value === undefined) {\n map.set(key, contents);\n return contents;\n }\n\n return value;\n}\n\n/**\n * Determines if context lines should be skipped for a file.\n * - .min.(mjs|cjs|js) files are and not useful since they dont point to the original source\n * - node: prefixed modules are part of the runtime and cannot be resolved to a file\n * - data: skip json, wasm and inline js https://nodejs.org/api/esm.html#data-imports\n */\nfunction shouldSkipContextLinesForFile(path: string): boolean {\n // Test the most common prefix and extension first. These are the ones we\n // are most likely to see in user applications and are the ones we can break out of first.\n if (path.startsWith('node:')) return true;\n if (path.endsWith('.min.js')) return true;\n if (path.endsWith('.min.cjs')) return true;\n if (path.endsWith('.min.mjs')) return true;\n if (path.startsWith('data:')) return true;\n return false;\n}\n\n/**\n * Determines if we should skip contextlines based off the max lineno and colno values.\n */\nfunction shouldSkipContextLinesForFrame(frame: StackFrame): boolean {\n if (frame.lineno !== undefined && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;\n if (frame.colno !== undefined && frame.colno > MAX_CONTEXTLINES_COLNO) return true;\n return false;\n}\n/**\n * Checks if we have all the contents that we need in the cache.\n */\nfunction rangeExistsInContentCache(file: string, range: ReadlineRange): boolean {\n const contents = LRU_FILE_CONTENTS_CACHE.get(file);\n if (contents === undefined) return false;\n\n for (let i = range[0]; i <= range[1]; i++) {\n if (contents[i] === undefined) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Creates contiguous ranges of lines to read from a file. In the case where context lines overlap,\n * the ranges are merged to create a single range.\n */\nfunction makeLineReaderRanges(lines: number[], linecontext: number): ReadlineRange[] {\n if (!lines.length) {\n return [];\n }\n\n let i = 0;\n const line = lines[0];\n\n if (typeof line !== 'number') {\n return [];\n }\n\n let current = makeContextRange(line, linecontext);\n const out: ReadlineRange[] = [];\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (i === lines.length - 1) {\n out.push(current);\n break;\n }\n\n // If the next line falls into the current range, extend the current range to lineno + linecontext.\n const next = lines[i + 1];\n if (typeof next !== 'number') {\n break;\n }\n if (next <= current[1]) {\n current[1] = next + linecontext;\n } else {\n out.push(current);\n current = makeContextRange(next, linecontext);\n }\n\n i++;\n }\n\n return out;\n}\n\n/**\n * Extracts lines from a file and stores them in a cache.\n */\nfunction getContextLinesFromFile(path: string, ranges: ReadlineRange[], output: Record<number, string>): Promise<void> {\n return new Promise((resolve, _reject) => {\n // It is important *not* to have any async code between createInterface and the 'line' event listener\n // as it will cause the 'line' event to\n // be emitted before the listener is attached.\n const stream = createReadStream(path);\n const lineReaded = createInterface({\n input: stream,\n });\n\n // We need to explicitly destroy the stream to prevent memory leaks,\n // removing the listeners on the readline interface is not enough.\n // See: https://github.com/nodejs/node/issues/9002 and https://github.com/getsentry/sentry-javascript/issues/14892\n function destroyStreamAndResolve(): void {\n stream.destroy();\n resolve();\n }\n\n // Init at zero and increment at the start of the loop because lines are 1 indexed.\n let lineNumber = 0;\n let currentRangeIndex = 0;\n const range = ranges[currentRangeIndex];\n if (range === undefined) {\n // We should never reach this point, but if we do, we should resolve the promise to prevent it from hanging.\n destroyStreamAndResolve();\n return;\n }\n let rangeStart = range[0];\n let rangeEnd = range[1];\n\n // We use this inside Promise.all, so we need to resolve the promise even if there is an error\n // to prevent Promise.all from short circuiting the rest.\n function onStreamError(e: Error): void {\n // Mark file path as failed to read and prevent multiple read attempts.\n LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1);\n DEBUG_BUILD && debug.error(`Failed to read file: ${path}. Error: ${e}`);\n lineReaded.close();\n lineReaded.removeAllListeners();\n destroyStreamAndResolve();\n }\n\n // We need to handle the error event to prevent the process from crashing in < Node 16\n // https://github.com/nodejs/node/pull/31603\n stream.on('error', onStreamError);\n lineReaded.on('error', onStreamError);\n lineReaded.on('close', destroyStreamAndResolve);\n\n lineReaded.on('line', line => {\n lineNumber++;\n if (lineNumber < rangeStart) return;\n\n // !Warning: This mutates the cache by storing the snipped line into the cache.\n output[lineNumber] = snipLine(line, 0);\n\n if (lineNumber >= rangeEnd) {\n if (currentRangeIndex === ranges.length - 1) {\n // We need to close the file stream and remove listeners, else the reader will continue to run our listener;\n lineReaded.close();\n lineReaded.removeAllListeners();\n return;\n }\n currentRangeIndex++;\n const range = ranges[currentRangeIndex];\n if (range === undefined) {\n // This should never happen as it means we have a bug in the context.\n lineReaded.close();\n lineReaded.removeAllListeners();\n return;\n }\n rangeStart = range[0];\n rangeEnd = range[1];\n }\n });\n });\n}\n\n/**\n * Adds surrounding (context) lines of the line that an exception occurred on to the event.\n * This is done by reading the file line by line and extracting the lines. The extracted lines are stored in\n * a cache to prevent multiple reads of the same file. Failures to read a file are similarly cached to prevent multiple\n * failing reads from happening.\n */\n/* eslint-disable complexity */\nasync function addSourceContext(event: Event, contextLines: number): Promise<Event> {\n // keep a lookup map of which files we've already enqueued to read,\n // so we don't enqueue the same file multiple times which would cause multiple i/o reads\n const filesToLines: Record<string, number[]> = {};\n\n if (contextLines > 0 && event.exception?.values) {\n for (const exception of event.exception.values) {\n if (!exception.stacktrace?.frames?.length) {\n continue;\n }\n\n // Maps preserve insertion order, so we iterate in reverse, starting at the\n // outermost frame and closer to where the exception has occurred (poor mans priority)\n for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {\n const frame: StackFrame | undefined = exception.stacktrace.frames[i];\n const filename = frame?.filename;\n\n if (\n !frame ||\n typeof filename !== 'string' ||\n typeof frame.lineno !== 'number' ||\n shouldSkipContextLinesForFile(filename) ||\n shouldSkipContextLinesForFrame(frame)\n ) {\n continue;\n }\n\n const filesToLinesOutput = filesToLines[filename];\n if (!filesToLinesOutput) filesToLines[filename] = [];\n // @ts-expect-error this is defined above\n filesToLines[filename].push(frame.lineno);\n }\n }\n }\n\n const files = Object.keys(filesToLines);\n if (files.length == 0) {\n return event;\n }\n\n const readlinePromises: Promise<void>[] = [];\n for (const file of files) {\n // If we failed to read this before, dont try reading it again.\n if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) {\n continue;\n }\n\n const filesToLineRanges = filesToLines[file];\n if (!filesToLineRanges) {\n continue;\n }\n\n // Sort ranges so that they are sorted by line increasing order and match how the file is read.\n filesToLineRanges.sort((a, b) => a - b);\n // Check if the contents are already in the cache and if we can avoid reading the file again.\n const ranges = makeLineReaderRanges(filesToLineRanges, contextLines);\n if (ranges.every(r => rangeExistsInContentCache(file, r))) {\n continue;\n }\n\n const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {});\n readlinePromises.push(getContextLinesFromFile(file, ranges, cache));\n }\n\n // The promise rejections are caught in order to prevent them from short circuiting Promise.all\n await Promise.all(readlinePromises).catch(() => {\n DEBUG_BUILD && debug.log('Failed to read one or more source files and resolve context lines');\n });\n\n // Perform the same loop as above, but this time we can assume all files are in the cache\n // and attempt to add source context to frames.\n if (contextLines > 0 && event.exception?.values) {\n for (const exception of event.exception.values) {\n if (exception.stacktrace?.frames && exception.stacktrace.frames.length > 0) {\n addSourceContextToFrames(exception.stacktrace.frames, contextLines, LRU_FILE_CONTENTS_CACHE);\n }\n }\n }\n\n return event;\n}\n/* eslint-enable complexity */\n\n/** Adds context lines to frames */\nfunction addSourceContextToFrames(\n frames: StackFrame[],\n contextLines: number,\n cache: LRUMap<string, Record<number, string>>,\n): void {\n for (const frame of frames) {\n // Only add context if we have a filename and it hasn't already been added\n if (frame.filename && frame.context_line === undefined && typeof frame.lineno === 'number') {\n const contents = cache.get(frame.filename);\n if (contents === undefined) {\n continue;\n }\n\n addContextToFrame(frame.lineno, frame, contextLines, contents);\n }\n }\n}\n\n/**\n * Clears the context lines from a frame, used to reset a frame to its original state\n * if we fail to resolve all context lines for it.\n */\nfunction clearLineContext(frame: StackFrame): void {\n delete frame.pre_context;\n delete frame.context_line;\n delete frame.post_context;\n}\n\n/**\n * Resolves context lines before and after the given line number and appends them to the frame;\n */\nexport function addContextToFrame(\n lineno: number,\n frame: StackFrame,\n contextLines: number,\n contents: Record<number, string> | undefined,\n): void {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping.\n // We already check for lineno before calling this, but since StackFrame lineno ism optional, we check it again.\n if (frame.lineno === undefined || contents === undefined) {\n DEBUG_BUILD && debug.error('Cannot resolve context for frame with no lineno or file contents');\n return;\n }\n\n frame.pre_context = [];\n for (let i = makeRangeStart(lineno, contextLines); i < lineno; i++) {\n // We always expect the start context as line numbers cannot be negative. If we dont find a line, then\n // something went wrong somewhere. Clear the context and return without adding any linecontext.\n const line = contents[i];\n if (line === undefined) {\n clearLineContext(frame);\n DEBUG_BUILD && debug.error(`Could not find line ${i} in file ${frame.filename}`);\n return;\n }\n\n frame.pre_context.push(line);\n }\n\n // We should always have the context line. If we dont, something went wrong, so we clear the context and return\n // without adding any linecontext.\n if (contents[lineno] === undefined) {\n clearLineContext(frame);\n DEBUG_BUILD && debug.error(`Could not find line ${lineno} in file ${frame.filename}`);\n return;\n }\n\n frame.context_line = contents[lineno];\n\n const end = makeRangeEnd(lineno, contextLines);\n frame.post_context = [];\n for (let i = lineno + 1; i <= end; i++) {\n // Since we dont track when the file ends, we cant clear the context if we dont find a line as it could\n // just be that we reached the end of the file.\n const line = contents[i];\n if (line === undefined) {\n break;\n }\n frame.post_context.push(line);\n }\n}\n\n// Helper functions for generating line context ranges. They take a line number and the number of lines of context to\n// include before and after the line and generate an inclusive range of indices.\ntype ReadlineRange = [start: number, end: number];\n// Compute inclusive end context range\nfunction makeRangeStart(line: number, linecontext: number): number {\n return Math.max(1, line - linecontext);\n}\n// Compute inclusive start context range\nfunction makeRangeEnd(line: number, linecontext: number): number {\n return line + linecontext;\n}\n// Determine start and end indices for context range (inclusive);\nfunction makeContextRange(line: number, linecontext: number): [start: number, end: number] {\n return [makeRangeStart(line, linecontext), makeRangeEnd(line, linecontext)];\n}\n\n/** Exported only for tests, as a type-safe variant. */\nexport const _contextLinesIntegration = ((options: ContextLinesOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n processEvent(event, _hint, client) {\n const contextLines =\n options.frameContextLines ?? client?.getDataCollectionOptions().frameContextLines ?? DEFAULT_LINES_OF_CONTEXT;\n return addSourceContext(event, contextLines);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Capture the lines before and after the frame's context.\n */\nexport const contextLinesIntegration = defineIntegration(_contextLinesIntegration);\n"],"names":["LRUMap","createReadStream","createInterface","DEBUG_BUILD","debug","snipLine","range","defineIntegration"],"mappings":";;;;;;;AAMA,MAAM,uBAAA,GAA0B,IAAIA,WAAA,CAAuC,EAAE,CAAA;AAC7E,MAAM,gCAAA,GA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,CAAA;AAC7C,EAAA,KAAA,CAAM,eAAe,EAAC;AACtB,EAAA,KAAA,IAAS,CAAA,GAAI,MAAA,GAAS,CAAA,EAAG,CAAA,IAAK,KAAK,CAAA,EAAA,EAAK;AAGtC,IAAA,MAAM,IAAA,GAAO,SAAS,CAAC,CAAA;AACvB,IAAA,IAAI,SAAS,MAAA,EAAW;AACtB,MAAA;AAAA,IACF;AACA,IAAA,KAAA,CAAM,YAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC9B;AACF;AAMA,SAAS,cAAA,CAAe,MAAc,WAAA,EAA6B;AACjE,EAAA,OAAO,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,IAAA,GAAO,WAAW,CAAA;AACvC;AAEA,SAAS,YAAA,CAAa,MAAc,WAAA,EAA6B;AAC/D,EAAA,OAAO,IAAA,GAAO,WAAA;AAChB;AAEA,SAAS,gBAAA,CAAiB,MAAc,WAAA,EAAmD;AACzF,EAAA,OAAO,CAAC,eAAe,IAAA,EAAM,WAAW,GAAG,YAAA,CAAa,IAAA,EAAM,WAAW,CAAC,CAAA;AAC5E;AAGO,MAAM,wBAAA,IAA4B,CAAC,OAAA,GAA+B,EAAC,KAAM;AAC9E,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,YAAA,CAAa,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ;AACjC,MAAA,MAAM,eACJ,OAAA,CAAQ,iBAAA,IAAqB,MAAA,EAAQ,wBAAA,GAA2B,iBAAA,IAAqB,wBAAA;AACvF,MAAA,OAAO,gBAAA,CAAiB,OAAO,YAAY,CAAA;AAAA,IAC7C;AAAA,GACF;AACF,CAAA;AAKO,MAAM,uBAAA,GAA0BG,uBAAkB,wBAAwB;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/integrations/fs/index.ts"],"sourcesContent":["import { defineIntegration } from '@sentry/core';\nimport { enableFsInstrumentation } from './vendored/instrumentation';\nimport type { FsInstrumentationConfig } from './vendored/types';\n\nconst INTEGRATION_NAME = 'FileSystem' as const;\n\n/**\n * This integration will create spans for `fs` API operations, like reading and writing files.\n *\n * **WARNING:** This integration may add significant overhead to your application. Especially in scenarios with a lot of\n * file I/O, like for example when running a framework dev server, including this integration can massively slow down\n * your application.\n *\n * @param options Configuration for this integration.\n */\nexport const fsIntegration = defineIntegration((options: FsInstrumentationConfig = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n enableFsInstrumentation(options);\n },\n };\n});\n"],"names":["defineIntegration","enableFsInstrumentation"],"mappings":";;;;;AAIA,MAAM,gBAAA,GAAmB,YAAA;AAWlB,MAAM,aAAA,GAAgBA,sBAAA,CAAkB,CAAC,OAAA,GAAmC,EAAC,KAAM;AACxF,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/integrations/fs/index.ts"],"sourcesContent":["import { defineIntegration } from '@sentry/core';\nimport { enableFsInstrumentation } from './vendored/instrumentation';\nimport type { FsInstrumentationConfig } from './vendored/types';\n\nconst INTEGRATION_NAME = 'FileSystem' as const;\n\n/**\n * This integration will create spans for `fs` API operations, like reading and writing files.\n *\n * **WARNING:** This integration may add significant overhead to your application. Especially in scenarios with a lot of\n * file I/O, like for example when running a framework dev server, including this integration can massively slow down\n * your application.\n *\n * @param options Configuration for this integration.\n */\nexport const fsIntegration = defineIntegration((options: FsInstrumentationConfig = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // We only run this in the next tick to avoid instrumenting the `fs` module while the SDK is initializating\n // especially, at the point when this runs the Async Context Manager may not be set up yet,\n // which could lead to weird outcomes - so we wait until everything is settled before we instrument.\n setImmediate(() => enableFsInstrumentation(options));\n },\n };\n});\n"],"names":["defineIntegration","enableFsInstrumentation"],"mappings":";;;;;AAIA,MAAM,gBAAA,GAAmB,YAAA;AAWlB,MAAM,aAAA,GAAgBA,sBAAA,CAAkB,CAAC,OAAA,GAAmC,EAAC,KAAM;AACxF,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AAIV,MAAA,YAAA,CAAa,MAAMC,uCAAA,CAAwB,OAAO,CAAC,CAAA;AAAA,IACrD;AAAA,GACF;AACF,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../src/integrations/fs/vendored/constants.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-fs\n * - Upstream version: @opentelemetry/instrumentation-fs@0.37.0\n */\n\nimport type { FMember, FPMember } from './types';\n\nexport const PROMISE_FUNCTIONS: FPMember[] = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'copyFile',\n 'cp'
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../src/integrations/fs/vendored/constants.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-fs\n * - Upstream version: @opentelemetry/instrumentation-fs@0.37.0\n */\n\nimport type { FMember, FPMember } from './types';\n\nexport const PROMISE_FUNCTIONS: FPMember[] = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'copyFile',\n 'cp', // added in v16\n 'lchown',\n 'link',\n 'lstat',\n 'lutimes', // added in v12\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir', // added in v12\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'rename',\n 'rm', // added in v14\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile',\n // 'lchmod', // only implemented on macOS\n];\n\nexport const CALLBACK_FUNCTIONS: FMember[] = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'copyFile',\n 'cp', // added in v16\n 'exists', // deprecated, inconsistent cb signature, handling separately when patching\n 'lchown',\n 'link',\n 'lstat',\n 'lutimes', // added in v12\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir', // added in v12\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'realpath.native',\n 'rename',\n 'rm', // added in v14\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile',\n // 'close', // functions on file descriptor\n // 'fchmod', // functions on file descriptor\n // 'fchown', // functions on file descriptor\n // 'fdatasync', // functions on file descriptor\n // 'fstat', // functions on file descriptor\n // 'fsync', // functions on file descriptor\n // 'ftruncate', // functions on file descriptor\n // 'futimes', // functions on file descriptor\n // 'lchmod', // only implemented on macOS\n // 'read', // functions on file descriptor\n // 'readv', // functions on file descriptor\n // 'write', // functions on file descriptor\n // 'writev', // functions on file descriptor\n];\n\nexport const SYNC_FUNCTIONS: FMember[] = [\n 'accessSync',\n 'appendFileSync',\n 'chmodSync',\n 'chownSync',\n 'copyFileSync',\n 'cpSync', // added in v16\n 'existsSync',\n 'lchownSync',\n 'linkSync',\n 'lstatSync',\n 'lutimesSync', // added in v12\n 'mkdirSync',\n 'mkdtempSync',\n 'opendirSync', // added in v12\n 'openSync',\n 'readdirSync',\n 'readFileSync',\n 'readlinkSync',\n 'realpathSync',\n 'realpathSync.native',\n 'renameSync',\n 'rmdirSync',\n 'rmSync', // added in v14\n 'statSync',\n 'symlinkSync',\n 'truncateSync',\n 'unlinkSync',\n 'utimesSync',\n 'writeFileSync',\n // 'closeSync', // functions on file descriptor\n // 'fchmodSync', // functions on file descriptor\n // 'fchownSync', // functions on file descriptor\n // 'fdatasyncSync', // functions on file descriptor\n // 'fstatSync', // functions on file descriptor\n // 'fsyncSync', // functions on file descriptor\n // 'ftruncateSync', // functions on file descriptor\n // 'futimesSync', // functions on file descriptor\n // 'lchmodSync', // only implemented on macOS\n // 'readSync', // functions on file descriptor\n // 'readvSync', // functions on file descriptor\n // 'writeSync', // functions on file descriptor\n // 'writevSync', // functions on file descriptor\n];\n"],"names":[],"mappings":";;AAWO,MAAM,iBAAA,GAAgC;AAAA,EAC3C,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AAAA;AAEF;AAEO,MAAM,kBAAA,GAAgC;AAAA,EAC3C,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,QAAA;AAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcF;AAEO,MAAM,cAAA,GAA4B;AAAA,EACvC,YAAA;AAAA,EACA,gBAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,qBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcF;;;;;;"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const diagnosticsChannel = require('node:diagnostics_channel');
|
|
4
|
+
const api = require('@opentelemetry/api');
|
|
5
|
+
const core = require('@sentry/core');
|
|
6
|
+
const nodeVersion = require('../../nodeVersion.js');
|
|
7
|
+
const node_events = require('node:events');
|
|
8
|
+
const http = require('node:http');
|
|
9
|
+
|
|
10
|
+
const FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL = nodeVersion.NODE_VERSION.major === 22 && nodeVersion.NODE_VERSION.minor >= 12 || nodeVersion.NODE_VERSION.major === 23 && nodeVersion.NODE_VERSION.minor >= 2 || nodeVersion.NODE_VERSION.major >= 24;
|
|
11
|
+
function instrumentHttpOutgoingRequests(instrumentationOptions = {}) {
|
|
12
|
+
const { outgoingRequestApplyCustomAttributes: applyCustomAttributesOnSpan, ...options } = instrumentationOptions;
|
|
13
|
+
const patchOptions = {
|
|
14
|
+
propagateTrace: options.propagateTraceInOutgoingRequests ?? true,
|
|
15
|
+
applyCustomAttributesOnSpan,
|
|
16
|
+
...options,
|
|
17
|
+
// oxlint-disable-next-line typescript/no-deprecated
|
|
18
|
+
spans: options.createSpansForOutgoingRequests !== false && (options.spans ?? true),
|
|
19
|
+
ignoreOutgoingRequests(url, request) {
|
|
20
|
+
return core.isTracingSuppressed() || !!options.ignoreOutgoingRequests?.(url, core.getRequestOptions(request));
|
|
21
|
+
},
|
|
22
|
+
outgoingRequestHook(span, request) {
|
|
23
|
+
options.outgoingRequestHook?.(span, request);
|
|
24
|
+
const originalOnce = request.once;
|
|
25
|
+
const newOnce = new Proxy(originalOnce, {
|
|
26
|
+
apply(target, thisArg, args) {
|
|
27
|
+
const [event] = args;
|
|
28
|
+
if (event !== "response") {
|
|
29
|
+
return target.apply(thisArg, args);
|
|
30
|
+
}
|
|
31
|
+
const parentContext = api.context.active();
|
|
32
|
+
const requestContext = api.trace.setSpan(parentContext, span);
|
|
33
|
+
return api.context.with(requestContext, () => {
|
|
34
|
+
return target.apply(thisArg, args);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
request.once = newOnce;
|
|
39
|
+
},
|
|
40
|
+
outgoingResponseHook(span, response) {
|
|
41
|
+
options.outgoingResponseHook?.(span, response);
|
|
42
|
+
},
|
|
43
|
+
errorMonitor: node_events.errorMonitor,
|
|
44
|
+
// Pass these in to detect OTel double-wrapping if we're enabling spans
|
|
45
|
+
http
|
|
46
|
+
};
|
|
47
|
+
if (FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL) {
|
|
48
|
+
instrumentHttpOutgoingRequestsViaChannel(patchOptions);
|
|
49
|
+
} else {
|
|
50
|
+
instrumentHttpOutgoingRequestsViaMonkeyPatching(patchOptions);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
let _currentListener;
|
|
54
|
+
function instrumentHttpOutgoingRequestsViaChannel(options) {
|
|
55
|
+
const { [core.HTTP_ON_CLIENT_REQUEST]: onHttpClientRequestCreated } = core.getHttpClientSubscriptions(options);
|
|
56
|
+
if (_currentListener) {
|
|
57
|
+
diagnosticsChannel.unsubscribe(core.HTTP_ON_CLIENT_REQUEST, _currentListener);
|
|
58
|
+
}
|
|
59
|
+
diagnosticsChannel.subscribe(core.HTTP_ON_CLIENT_REQUEST, onHttpClientRequestCreated);
|
|
60
|
+
_currentListener = onHttpClientRequestCreated;
|
|
61
|
+
}
|
|
62
|
+
function instrumentHttpOutgoingRequestsViaMonkeyPatching(options) {
|
|
63
|
+
core.patchHttpModuleClient(http, options);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
exports.instrumentHttpOutgoingRequests = instrumentHttpOutgoingRequests;
|
|
67
|
+
//# sourceMappingURL=SentryHttpInstrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SentryHttpInstrumentation.js","sources":["../../../../src/integrations/http/SentryHttpInstrumentation.ts"],"sourcesContent":["import type { ChannelListener } from 'node:diagnostics_channel';\nimport { subscribe, unsubscribe } from 'node:diagnostics_channel';\nimport { context, trace } from '@opentelemetry/api';\nimport type { ClientRequest, IncomingMessage, ServerResponse } from 'node:http';\nimport type { HttpClientRequest, HttpIncomingMessage, HttpInstrumentationOptions, Span } from '@sentry/core';\nimport {\n getHttpClientSubscriptions,\n patchHttpModuleClient,\n getRequestOptions,\n isTracingSuppressed,\n} from '@sentry/core';\nimport { HTTP_ON_CLIENT_REQUEST } from '@sentry/core';\nimport { NODE_VERSION } from '../../nodeVersion';\nimport { errorMonitor } from 'node:events';\nimport * as http from 'node:http';\n\nconst FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL =\n (NODE_VERSION.major === 22 && NODE_VERSION.minor >= 12) ||\n (NODE_VERSION.major === 23 && NODE_VERSION.minor >= 2) ||\n NODE_VERSION.major >= 24;\n\ninterface OutgoingHttpRequestInstrumentationOptions {\n /**\n * Whether breadcrumbs should be recorded for outgoing requests.\n *\n * @default `true`\n */\n breadcrumbs?: boolean;\n\n /**\n * Whether to create spans for outgoing requests (user preference).\n * This only takes effect if `createSpansForOutgoingRequests` is not disabled.\n * If `createSpansForOutgoingRequests` is explicitly set false, this option is ignored.\n *\n * @default `true`\n */\n spans?: boolean;\n\n /**\n * Whether to propagate Sentry trace headers in outgoing requests.\n *\n * @default `true`\n */\n propagateTraceInOutgoingRequests?: boolean;\n\n /**\n * @deprecated Use spans option instead.\n *\n * @default `true`\n */\n createSpansForOutgoingRequests?: boolean;\n\n /**\n * Do not instrument outgoing HTTP requests to URLs where the given callback returns `true`.\n * When it returns `true`, the request is skipped entirely: no breadcrumb and no span are created,\n * and no trace headers are propagated for that request.\n *\n * @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.\n * @param request Contains the {@type RequestOptions} object used to make the outgoing request.\n */\n ignoreOutgoingRequests?: (url: string, request: http.RequestOptions) => boolean;\n\n /**\n * Hooks for outgoing request spans, only called when spans are created for outgoing requests\n * (i.e. when `spans` is enabled).\n * These mirror the OTEL HttpInstrumentation hooks for backwards compatibility.\n */\n outgoingRequestHook?: (span: Span, request: ClientRequest | HttpClientRequest) => void;\n outgoingResponseHook?: (span: Span, response: IncomingMessage | HttpIncomingMessage) => void;\n outgoingRequestApplyCustomAttributes?: (\n span: Span,\n request: HttpClientRequest,\n response: HttpIncomingMessage,\n ) => void;\n}\n\nexport type SentryHttpInstrumentationOptions = OutgoingHttpRequestInstrumentationOptions & {\n // All options below do not do anything anymore in this instrumentation, and will be removed in the future.\n // They are only kept here for backwards compatibility - the respective functionality is now handled by the httpServerIntegration/httpServerSpansIntegration.\n\n /**\n * @deprecated This no longer does anything.\n */\n extractIncomingTraceFromHeader?: boolean;\n\n /**\n * @deprecated This no longer does anything.\n */\n ignoreStaticAssets?: boolean;\n\n /**\n * @deprecated This no longer does anything.\n */\n disableIncomingRequestSpans?: boolean;\n\n /**\n * @deprecated This no longer does anything.\n */\n ignoreSpansForIncomingRequests?: (urlPath: string, request: IncomingMessage) => boolean;\n\n /**\n * @deprecated This no longer does anything.\n */\n ignoreIncomingRequestBody?: (url: string, request: http.RequestOptions) => boolean;\n\n /**\n * @deprecated This no longer does anything.\n */\n maxIncomingRequestBodySize?: 'none' | 'small' | 'medium' | 'always';\n\n /**\n * @deprecated This no longer does anything.\n */\n trackIncomingRequestsAsSessions?: boolean;\n\n /**\n * @deprecated This no longer does anything.\n */\n instrumentation?: {\n requestHook?: (span: Span, req: ClientRequest | IncomingMessage) => void;\n responseHook?: (span: Span, response: IncomingMessage | ServerResponse) => void;\n applyCustomAttributesOnSpan?: (\n span: Span,\n request: ClientRequest | IncomingMessage,\n response: IncomingMessage | ServerResponse,\n ) => void;\n };\n\n /**\n * @deprecated This no longer does anything.\n */\n sessionFlushingDelayMS?: number;\n};\n\n/**\n * This instruments the http modules for outgoing requests.\n * It uses the diagnostics channel if available, otherwise it falls back to monkey-patching.\n *\n * The instrumentation will start spans, create breadcrumbs, and propagate trace headers in outgoing requests (depending on the settings).\n * This can be called multiple times, where the last invocation will have the current options.\n *\n * @TODO Cleanup options in v11\n */\nexport function instrumentHttpOutgoingRequests(\n instrumentationOptions: OutgoingHttpRequestInstrumentationOptions = {},\n): void {\n const { outgoingRequestApplyCustomAttributes: applyCustomAttributesOnSpan, ...options } = instrumentationOptions;\n const patchOptions = {\n propagateTrace: options.propagateTraceInOutgoingRequests ?? true,\n applyCustomAttributesOnSpan,\n ...options,\n // oxlint-disable-next-line typescript/no-deprecated\n spans: options.createSpansForOutgoingRequests !== false && (options.spans ?? true),\n ignoreOutgoingRequests(url, request) {\n return isTracingSuppressed() || !!options.ignoreOutgoingRequests?.(url, getRequestOptions(request));\n },\n outgoingRequestHook(span, request) {\n options.outgoingRequestHook?.(span, request);\n // We monkey-patch `req.once('response'), which is used to trigger\n // the callback of the request, so that it runs in the active context\n // eslint-disable-next-line @typescript-eslint/unbound-method, typescript/no-deprecated\n const originalOnce = request.once;\n\n const newOnce = new Proxy(originalOnce, {\n apply(target, thisArg, args: Parameters<typeof originalOnce>) {\n const [event] = args;\n if (event !== 'response') {\n return target.apply(thisArg, args);\n }\n\n const parentContext = context.active();\n const requestContext = trace.setSpan(parentContext, span);\n\n return context.with(requestContext, () => {\n return target.apply(thisArg, args);\n });\n },\n });\n\n // eslint-disable-next-line typescript/no-deprecated\n request.once = newOnce;\n },\n outgoingResponseHook(span, response) {\n options.outgoingResponseHook?.(span, response);\n },\n errorMonitor,\n // Pass these in to detect OTel double-wrapping if we're enabling spans\n http,\n } satisfies HttpInstrumentationOptions;\n\n if (FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL) {\n instrumentHttpOutgoingRequestsViaChannel(patchOptions);\n } else {\n instrumentHttpOutgoingRequestsViaMonkeyPatching(patchOptions);\n }\n}\n\nlet _currentListener: ChannelListener | undefined;\nfunction instrumentHttpOutgoingRequestsViaChannel(options: HttpInstrumentationOptions): void {\n const { [HTTP_ON_CLIENT_REQUEST]: onHttpClientRequestCreated } = getHttpClientSubscriptions(options);\n // If it was previously subscribed, first unsubscribe it\n // TODO(v11): We can likely remove this when we drop preload support\n if (_currentListener) {\n unsubscribe(HTTP_ON_CLIENT_REQUEST, _currentListener);\n }\n\n subscribe(HTTP_ON_CLIENT_REQUEST, onHttpClientRequestCreated);\n _currentListener = onHttpClientRequestCreated;\n}\n\n/**\n * Instrument outgoing HTTP(S) requests by old-school monkey-patching the `http` module.\n * This is the fallback for runtimes that do not fully support the `node:http` client diagnostics channel\n * (Node < 22.12).\n */\nfunction instrumentHttpOutgoingRequestsViaMonkeyPatching(options: HttpInstrumentationOptions): void {\n // Patching http also patches https, as this uses the same underlying object\n patchHttpModuleClient(http, options);\n}\n"],"names":["NODE_VERSION","isTracingSuppressed","getRequestOptions","context","trace","errorMonitor","HTTP_ON_CLIENT_REQUEST","getHttpClientSubscriptions","unsubscribe","subscribe","patchHttpModuleClient"],"mappings":";;;;;;;;;AAgBA,MAAM,uCAAA,GACHA,wBAAA,CAAa,KAAA,KAAU,EAAA,IAAMA,yBAAa,KAAA,IAAS,EAAA,IACnDA,wBAAA,CAAa,KAAA,KAAU,EAAA,IAAMA,wBAAA,CAAa,KAAA,IAAS,CAAA,IACpDA,yBAAa,KAAA,IAAS,EAAA;AA4HjB,SAAS,8BAAA,CACd,sBAAA,GAAoE,EAAC,EAC/D;AACN,EAAA,MAAM,EAAE,oCAAA,EAAsC,2BAAA,EAA6B,GAAG,SAAQ,GAAI,sBAAA;AAC1F,EAAA,MAAM,YAAA,GAAe;AAAA,IACnB,cAAA,EAAgB,QAAQ,gCAAA,IAAoC,IAAA;AAAA,IAC5D,2BAAA;AAAA,IACA,GAAG,OAAA;AAAA;AAAA,IAEH,KAAA,EAAO,OAAA,CAAQ,8BAAA,KAAmC,KAAA,KAAU,QAAQ,KAAA,IAAS,IAAA,CAAA;AAAA,IAC7E,sBAAA,CAAuB,KAAK,OAAA,EAAS;AACnC,MAAA,OAAOC,wBAAA,MAAyB,CAAC,CAAC,QAAQ,sBAAA,GAAyB,GAAA,EAAKC,sBAAA,CAAkB,OAAO,CAAC,CAAA;AAAA,IACpG,CAAA;AAAA,IACA,mBAAA,CAAoB,MAAM,OAAA,EAAS;AACjC,MAAA,OAAA,CAAQ,mBAAA,GAAsB,MAAM,OAAO,CAAA;AAI3C,MAAA,MAAM,eAAe,OAAA,CAAQ,IAAA;AAE7B,MAAA,MAAM,OAAA,GAAU,IAAI,KAAA,CAAM,YAAA,EAAc;AAAA,QACtC,KAAA,CAAM,MAAA,EAAQ,OAAA,EAAS,IAAA,EAAuC;AAC5D,UAAA,MAAM,CAAC,KAAK,CAAA,GAAI,IAAA;AAChB,UAAA,IAAI,UA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77 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const diagnosticsChannel = require('node:diagnostics_channel');
|
|
4
|
+
const api = require('@opentelemetry/api');
|
|
5
|
+
const core = require('@sentry/core');
|
|
6
|
+
const debugBuild = require('../../debug-build.js');
|
|
7
|
+
|
|
8
|
+
const HTTP_SERVER_INSTRUMENTED_KEY = api.createContextKey("sentry_http_server_instrumented");
|
|
9
|
+
const INTEGRATION_NAME = "Http.Server";
|
|
10
|
+
function addStartSpanCallback(request, callback) {
|
|
11
|
+
core.addNonEnumerableProperty(request, "_startSpanCallback", new WeakRef(callback));
|
|
12
|
+
}
|
|
13
|
+
const _httpServerIntegration = ((options = {}) => {
|
|
14
|
+
const _options = {
|
|
15
|
+
sessions: options.sessions ?? true,
|
|
16
|
+
sessionFlushingDelayMS: options.sessionFlushingDelayMS ?? 6e4,
|
|
17
|
+
maxRequestBodySize: options.maxRequestBodySize,
|
|
18
|
+
// Server spans are created by `httpServerSpansIntegration` via the
|
|
19
|
+
// `httpServerRequest` client event + `_startSpanCallback`, not by the
|
|
20
|
+
// core subscription helper. Explicitly opt out so the helper does not
|
|
21
|
+
// double-create spans when the client has tracing enabled.
|
|
22
|
+
spans: false,
|
|
23
|
+
// Cast: core uses HttpIncomingMessage; node consumers pass
|
|
24
|
+
// RequestOptions-typed callbacks.
|
|
25
|
+
// The two are structurally compatible for the fields the callback reads
|
|
26
|
+
// (url, method, headers).
|
|
27
|
+
ignoreRequestBody: options.ignoreRequestBody,
|
|
28
|
+
/**
|
|
29
|
+
* Hook called by core's `instrumentServer` to wrap the upstream
|
|
30
|
+
* `emit('request')` call.
|
|
31
|
+
*
|
|
32
|
+
* We use it to extract OTel context from request headers and re-enter
|
|
33
|
+
* the OTel context before the framework sees the request, so subsequent
|
|
34
|
+
* spans (eg from `httpServerSpansIntegration`) attach to the right trace.
|
|
35
|
+
*/
|
|
36
|
+
wrapServerEmitRequest(request, response, normalizedRequest, next) {
|
|
37
|
+
const client = core.getClient();
|
|
38
|
+
if (!client) return next();
|
|
39
|
+
if (api.context.active().getValue(HTTP_SERVER_INSTRUMENTED_KEY)) {
|
|
40
|
+
return next();
|
|
41
|
+
}
|
|
42
|
+
const ctx = api.propagation.extract(api.context.active(), normalizedRequest.headers).setValue(HTTP_SERVER_INSTRUMENTED_KEY, true);
|
|
43
|
+
api.context.with(ctx, () => {
|
|
44
|
+
client.emit("httpServerRequest", request, response, normalizedRequest);
|
|
45
|
+
const callback = request._startSpanCallback?.deref();
|
|
46
|
+
if (callback) {
|
|
47
|
+
callback(() => {
|
|
48
|
+
next();
|
|
49
|
+
return true;
|
|
50
|
+
});
|
|
51
|
+
} else {
|
|
52
|
+
next();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
name: INTEGRATION_NAME,
|
|
59
|
+
setupOnce() {
|
|
60
|
+
const { [core.HTTP_ON_SERVER_REQUEST]: onHttpServerRequestStart } = core.getHttpServerSubscriptions(_options);
|
|
61
|
+
diagnosticsChannel.subscribe(core.HTTP_ON_SERVER_REQUEST, onHttpServerRequestStart);
|
|
62
|
+
},
|
|
63
|
+
afterAllSetup(client) {
|
|
64
|
+
if (debugBuild.DEBUG_BUILD && client.getIntegrationByName("Http")) {
|
|
65
|
+
core.debug.warn(
|
|
66
|
+
"It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`."
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
const httpServerIntegration = _httpServerIntegration;
|
|
73
|
+
|
|
74
|
+
exports.recordRequestSession = core.recordRequestSession;
|
|
75
|
+
exports.addStartSpanCallback = addStartSpanCallback;
|
|
76
|
+
exports.httpServerIntegration = httpServerIntegration;
|
|
77
|
+
//# sourceMappingURL=httpServerIntegration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpServerIntegration.js","sources":["../../../../src/integrations/http/httpServerIntegration.ts"],"sourcesContent":["import { subscribe } from 'node:diagnostics_channel';\nimport type { RequestOptions } from 'node:http';\nimport { context, createContextKey, propagation } from '@opentelemetry/api';\nimport type { HttpIncomingMessage, HttpServerResponse, Integration, IntegrationFn } from '@sentry/core';\nimport {\n addNonEnumerableProperty,\n debug,\n getClient,\n getHttpServerSubscriptions,\n HTTP_ON_SERVER_REQUEST,\n recordRequestSession,\n} from '@sentry/core';\nimport type { RequestEventData } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\n\n// Re-export so existing test imports continue to work; the implementation now lives in core.\nexport { recordRequestSession };\n\nconst HTTP_SERVER_INSTRUMENTED_KEY = createContextKey('sentry_http_server_instrumented');\nconst INTEGRATION_NAME = 'Http.Server' as const;\n\n// Inlining this type to not depend on newer TS types\ninterface WeakRefImpl<T> {\n deref(): T | undefined;\n}\n\ntype StartSpanCallback = (next: () => boolean) => boolean;\ntype RequestWithOptionalStartSpanCallback = HttpIncomingMessage & {\n _startSpanCallback?: WeakRefImpl<StartSpanCallback>;\n};\n\nexport interface HttpServerIntegrationOptions {\n /**\n * Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.\n * Read more about Release Health: https://docs.sentry.io/product/releases/health/\n *\n * Defaults to `true`.\n */\n sessions?: boolean;\n\n /**\n * Number of milliseconds until sessions tracked with `trackIncomingRequestsAsSessions` will be flushed as a session aggregate.\n *\n * Defaults to `60000` (60s).\n */\n sessionFlushingDelayMS?: number;\n\n /**\n * Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.\n * This can be useful for long running requests where the body is not needed and we want to avoid capturing it.\n *\n * @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the incoming request.\n * @param request Contains the {@type RequestOptions} object used to make the incoming request.\n */\n ignoreRequestBody?: (url: string, request: RequestOptions) => boolean;\n\n /**\n * Controls the maximum size of incoming HTTP request bodies attached to events.\n *\n * Available options:\n * - 'none': No request bodies will be attached\n * - 'small': Request bodies up to 1,000 bytes will be attached\n * - 'medium': Request bodies up to 10,000 bytes will be attached (default)\n * - 'always': Request bodies will always be attached\n *\n * Note that even with 'always' setting, bodies exceeding 1MB will never be attached\n * for performance and security reasons.\n *\n * @default 'medium'\n */\n maxRequestBodySize?: 'none' | 'small' | 'medium' | 'always';\n}\n\n/**\n * Add a callback to the request object that will be called when the request is started.\n * The callback will receive the next function to continue processing the request.\n */\nexport function addStartSpanCallback(request: RequestWithOptionalStartSpanCallback, callback: StartSpanCallback): void {\n addNonEnumerableProperty(request, '_startSpanCallback', new WeakRef(callback));\n}\n\nconst _httpServerIntegration = ((options: HttpServerIntegrationOptions = {}) => {\n const _options = {\n sessions: options.sessions ?? true,\n sessionFlushingDelayMS: options.sessionFlushingDelayMS ?? 60_000,\n maxRequestBodySize: options.maxRequestBodySize,\n // Server spans are created by `httpServerSpansIntegration` via the\n // `httpServerRequest` client event + `_startSpanCallback`, not by the\n // core subscription helper. Explicitly opt out so the helper does not\n // double-create spans when the client has tracing enabled.\n spans: false as const,\n // Cast: core uses HttpIncomingMessage; node consumers pass\n // RequestOptions-typed callbacks.\n // The two are structurally compatible for the fields the callback reads\n // (url, method, headers).\n ignoreRequestBody: options.ignoreRequestBody as\n | ((url: string, request: HttpIncomingMessage) => boolean)\n | undefined,\n\n /**\n * Hook called by core's `instrumentServer` to wrap the upstream\n * `emit('request')` call.\n *\n * We use it to extract OTel context from request headers and re-enter\n * the OTel context before the framework sees the request, so subsequent\n * spans (eg from `httpServerSpansIntegration`) attach to the right trace.\n */\n wrapServerEmitRequest(\n request: HttpIncomingMessage,\n response: HttpServerResponse,\n normalizedRequest: RequestEventData,\n next: () => void,\n ): void {\n const client = getClient();\n if (!client) return next();\n\n // Guard against double-wrapping: if our wrapper somehow runs inside an\n // already-instrumented context, just continue without re-extracting\n // and re-emitting.\n if (context.active().getValue(HTTP_SERVER_INSTRUMENTED_KEY)) {\n return next();\n }\n\n const ctx = propagation\n .extract(context.active(), normalizedRequest.headers)\n .setValue(HTTP_SERVER_INSTRUMENTED_KEY, true);\n\n context.with(ctx, () => {\n // httpServerSpansIntegration listens for this and may attach\n // `_startSpanCallback` to the request to wrap span creation around\n // the emit.\n client.emit('httpServerRequest', request, response, normalizedRequest);\n\n const callback = (request as RequestWithOptionalStartSpanCallback)._startSpanCallback?.deref();\n if (callback) {\n callback(() => {\n next();\n return true;\n });\n } else {\n next();\n }\n });\n },\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const { [HTTP_ON_SERVER_REQUEST]: onHttpServerRequestStart } = getHttpServerSubscriptions(_options);\n subscribe(HTTP_ON_SERVER_REQUEST, onHttpServerRequestStart);\n },\n afterAllSetup(client) {\n if (DEBUG_BUILD && client.getIntegrationByName('Http')) {\n debug.warn(\n 'It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`.',\n );\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * This integration handles request isolation, trace continuation and other core Sentry functionality around incoming http requests\n * handled via the node `http` module.\n *\n * This version uses OpenTelemetry for context propagation and span management.\n *\n * @see {@link ../../light/integrations/httpServerIntegration.ts} for the lightweight version without OpenTelemetry\n */\nexport const httpServerIntegration = _httpServerIntegration as (\n options?: HttpServerIntegrationOptions,\n) => Integration & {\n name: 'Http.Server';\n setupOnce: () => void;\n};\n"],"names":["createContextKey","addNonEnumerableProperty","getClient","context","propagation","HTTP_ON_SERVER_REQUEST","getHttpServerSubscriptions","subscribe","DEBUG_BUILD","debug"],"mappings":";;;;;;;AAkBA,MAAM,4BAAA,GAA+BA,qBAAiB,iCAAiC,CAAA;AACvF,MAAM,gBAAA,GAAmB,aAAA;AA0DlB,SAAS,oBAAA,CAAqB,SAA+C,QAAA,EAAmC;AACrH,EAAAC,6BAAA,CAAyB,OAAA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