@sentry/node 9.32.0 → 9.34.0-alpha.1
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/index.js +50 -56
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/featureFlagShims/launchDarkly.js +43 -0
- package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -0
- package/build/cjs/integrations/featureFlagShims/openFeature.js +55 -0
- package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -0
- package/build/cjs/integrations/featureFlagShims/statsig.js +23 -0
- package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -0
- package/build/cjs/integrations/featureFlagShims/unleash.js +23 -0
- package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -0
- package/build/cjs/integrations/fs.js +2 -2
- package/build/cjs/integrations/fs.js.map +1 -1
- package/build/cjs/integrations/http/index.js +7 -11
- package/build/cjs/integrations/http/index.js.map +1 -1
- package/build/cjs/integrations/node-fetch/index.js +4 -5
- package/build/cjs/integrations/node-fetch/index.js.map +1 -1
- package/build/cjs/integrations/tracing/amqplib.js +4 -5
- package/build/cjs/integrations/tracing/amqplib.js.map +1 -1
- package/build/cjs/integrations/tracing/connect.js +3 -4
- package/build/cjs/integrations/tracing/connect.js.map +1 -1
- package/build/cjs/integrations/tracing/dataloader.js +3 -3
- package/build/cjs/integrations/tracing/dataloader.js.map +1 -1
- package/build/cjs/integrations/tracing/express.js +5 -7
- package/build/cjs/integrations/tracing/express.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js +5 -10
- package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/index.js +47 -10
- package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
- package/build/cjs/integrations/tracing/genericPool.js +3 -3
- package/build/cjs/integrations/tracing/genericPool.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql.js +3 -4
- package/build/cjs/integrations/tracing/graphql.js.map +1 -1
- package/build/cjs/integrations/tracing/hapi/index.js +3 -4
- package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
- package/build/cjs/integrations/tracing/index.js +3 -0
- package/build/cjs/integrations/tracing/index.js.map +1 -1
- package/build/cjs/integrations/tracing/kafka.js +4 -5
- package/build/cjs/integrations/tracing/kafka.js.map +1 -1
- package/build/cjs/integrations/tracing/knex.js +3 -3
- package/build/cjs/integrations/tracing/knex.js.map +1 -1
- package/build/cjs/integrations/tracing/koa.js +4 -6
- package/build/cjs/integrations/tracing/koa.js.map +1 -1
- package/build/cjs/integrations/tracing/lrumemoizer.js +2 -2
- package/build/cjs/integrations/tracing/lrumemoizer.js.map +1 -1
- package/build/cjs/integrations/tracing/mongo.js +3 -4
- package/build/cjs/integrations/tracing/mongo.js.map +1 -1
- package/build/cjs/integrations/tracing/mongoose.js +3 -4
- package/build/cjs/integrations/tracing/mongoose.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql.js +2 -2
- package/build/cjs/integrations/tracing/mysql.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql2.js +3 -4
- package/build/cjs/integrations/tracing/mysql2.js.map +1 -1
- package/build/cjs/integrations/tracing/postgres.js +3 -4
- package/build/cjs/integrations/tracing/postgres.js.map +1 -1
- package/build/cjs/integrations/tracing/postgresjs.js +282 -0
- package/build/cjs/integrations/tracing/postgresjs.js.map +1 -0
- package/build/cjs/integrations/tracing/prisma.js +2 -2
- package/build/cjs/integrations/tracing/prisma.js.map +1 -1
- package/build/cjs/integrations/tracing/redis.js +3 -3
- package/build/cjs/integrations/tracing/redis.js.map +1 -1
- package/build/cjs/integrations/tracing/tedious.js +3 -3
- package/build/cjs/integrations/tracing/tedious.js.map +1 -1
- package/build/cjs/integrations/tracing/vercelai/index.js +9 -185
- package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
- package/build/cjs/preload.js +2 -2
- package/build/cjs/preload.js.map +1 -1
- package/build/cjs/sdk/index.js +22 -203
- package/build/cjs/sdk/index.js.map +1 -1
- package/build/cjs/sdk/initOtel.js +4 -22
- package/build/cjs/sdk/initOtel.js.map +1 -1
- package/build/esm/index.js +7 -21
- package/build/esm/index.js.map +1 -1
- package/build/esm/integrations/featureFlagShims/launchDarkly.js +40 -0
- package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -0
- package/build/esm/integrations/featureFlagShims/openFeature.js +52 -0
- package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -0
- package/build/esm/integrations/featureFlagShims/statsig.js +21 -0
- package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -0
- package/build/esm/integrations/featureFlagShims/unleash.js +21 -0
- package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -0
- package/build/esm/integrations/fs.js +1 -1
- package/build/esm/integrations/fs.js.map +1 -1
- package/build/esm/integrations/http/index.js +1 -5
- package/build/esm/integrations/http/index.js.map +1 -1
- package/build/esm/integrations/node-fetch/index.js +2 -3
- package/build/esm/integrations/node-fetch/index.js.map +1 -1
- package/build/esm/integrations/tracing/amqplib.js +1 -2
- package/build/esm/integrations/tracing/amqplib.js.map +1 -1
- package/build/esm/integrations/tracing/connect.js +1 -2
- package/build/esm/integrations/tracing/connect.js.map +1 -1
- package/build/esm/integrations/tracing/dataloader.js +1 -1
- package/build/esm/integrations/tracing/dataloader.js.map +1 -1
- package/build/esm/integrations/tracing/express.js +2 -4
- package/build/esm/integrations/tracing/express.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/fastify-otel/index.js +5 -10
- package/build/esm/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/index.js +46 -9
- package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
- package/build/esm/integrations/tracing/genericPool.js +1 -1
- package/build/esm/integrations/tracing/genericPool.js.map +1 -1
- package/build/esm/integrations/tracing/graphql.js +2 -3
- package/build/esm/integrations/tracing/graphql.js.map +1 -1
- package/build/esm/integrations/tracing/hapi/index.js +1 -2
- package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
- package/build/esm/integrations/tracing/index.js +3 -0
- package/build/esm/integrations/tracing/index.js.map +1 -1
- package/build/esm/integrations/tracing/kafka.js +1 -2
- package/build/esm/integrations/tracing/kafka.js.map +1 -1
- package/build/esm/integrations/tracing/knex.js +1 -1
- package/build/esm/integrations/tracing/knex.js.map +1 -1
- package/build/esm/integrations/tracing/koa.js +2 -4
- package/build/esm/integrations/tracing/koa.js.map +1 -1
- package/build/esm/integrations/tracing/lrumemoizer.js +1 -1
- package/build/esm/integrations/tracing/lrumemoizer.js.map +1 -1
- package/build/esm/integrations/tracing/mongo.js +1 -2
- package/build/esm/integrations/tracing/mongo.js.map +1 -1
- package/build/esm/integrations/tracing/mongoose.js +1 -2
- package/build/esm/integrations/tracing/mongoose.js.map +1 -1
- package/build/esm/integrations/tracing/mysql.js +1 -1
- package/build/esm/integrations/tracing/mysql.js.map +1 -1
- package/build/esm/integrations/tracing/mysql2.js +1 -2
- package/build/esm/integrations/tracing/mysql2.js.map +1 -1
- package/build/esm/integrations/tracing/postgres.js +1 -2
- package/build/esm/integrations/tracing/postgres.js.map +1 -1
- package/build/esm/integrations/tracing/postgresjs.js +278 -0
- package/build/esm/integrations/tracing/postgresjs.js.map +1 -0
- package/build/esm/integrations/tracing/prisma.js +1 -1
- package/build/esm/integrations/tracing/prisma.js.map +1 -1
- package/build/esm/integrations/tracing/redis.js +1 -1
- package/build/esm/integrations/tracing/redis.js.map +1 -1
- package/build/esm/integrations/tracing/tedious.js +1 -1
- package/build/esm/integrations/tracing/tedious.js.map +1 -1
- package/build/esm/integrations/tracing/vercelai/index.js +9 -185
- package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/preload.js +1 -1
- package/build/esm/preload.js.map +1 -1
- package/build/esm/sdk/index.js +22 -202
- package/build/esm/sdk/index.js.map +1 -1
- package/build/esm/sdk/initOtel.js +3 -21
- package/build/esm/sdk/initOtel.js.map +1 -1
- package/build/types/index.d.ts +4 -21
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/featureFlagShims/index.d.ts +5 -0
- package/build/types/integrations/featureFlagShims/index.d.ts.map +1 -0
- package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
- package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -0
- package/build/types/integrations/featureFlagShims/openFeature.d.ts +23 -0
- package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -0
- package/build/types/integrations/featureFlagShims/statsig.d.ts +6 -0
- package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -0
- package/build/types/integrations/featureFlagShims/unleash.d.ts +6 -0
- package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -0
- package/build/types/integrations/http/index.d.ts +1 -1
- package/build/types/integrations/http/index.d.ts.map +1 -1
- package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/amqplib.d.ts.map +1 -1
- package/build/types/integrations/tracing/connect.d.ts.map +1 -1
- package/build/types/integrations/tracing/express.d.ts.map +1 -1
- package/build/types/integrations/tracing/fastify/index.d.ts +1 -1
- package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql.d.ts.map +1 -1
- package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/kafka.d.ts.map +1 -1
- package/build/types/integrations/tracing/koa.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongo.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongoose.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql2.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgresjs.d.ts +81 -0
- package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -0
- package/build/types/integrations/tracing/vercelai/index.d.ts +5 -7
- package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
- package/build/types/sdk/index.d.ts +2 -6
- package/build/types/sdk/index.d.ts.map +1 -1
- package/build/types/sdk/initOtel.d.ts +1 -1
- package/build/types/sdk/initOtel.d.ts.map +1 -1
- package/build/types/types.d.ts +1 -1
- package/build/types/types.d.ts.map +1 -1
- package/build/types-ts3.8/index.d.ts +4 -21
- package/build/types-ts3.8/integrations/featureFlagShims/index.d.ts +5 -0
- package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
- package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +23 -0
- package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +6 -0
- package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +6 -0
- package/build/types-ts3.8/integrations/http/index.d.ts +1 -1
- package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +1 -1
- package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +81 -0
- package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +5 -7
- package/build/types-ts3.8/sdk/index.d.ts +2 -6
- package/build/types-ts3.8/sdk/initOtel.d.ts +1 -1
- package/build/types-ts3.8/types.d.ts +1 -1
- package/package.json +4 -3
- package/build/cjs/cron/common.js +0 -56
- package/build/cjs/cron/common.js.map +0 -1
- package/build/cjs/cron/cron.js +0 -112
- package/build/cjs/cron/cron.js.map +0 -1
- package/build/cjs/cron/index.js +0 -15
- package/build/cjs/cron/index.js.map +0 -1
- package/build/cjs/cron/node-cron.js +0 -71
- package/build/cjs/cron/node-cron.js.map +0 -1
- package/build/cjs/cron/node-schedule.js +0 -65
- package/build/cjs/cron/node-schedule.js.map +0 -1
- package/build/cjs/integrations/anr/index.js +0 -238
- package/build/cjs/integrations/anr/index.js.map +0 -1
- package/build/cjs/integrations/childProcess.js +0 -100
- package/build/cjs/integrations/childProcess.js.map +0 -1
- package/build/cjs/integrations/context.js +0 -457
- package/build/cjs/integrations/context.js.map +0 -1
- package/build/cjs/integrations/contextlines.js +0 -405
- package/build/cjs/integrations/contextlines.js.map +0 -1
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js +0 -558
- package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +0 -1
- package/build/cjs/integrations/local-variables/common.js +0 -69
- package/build/cjs/integrations/local-variables/common.js.map +0 -1
- package/build/cjs/integrations/local-variables/index.js +0 -12
- package/build/cjs/integrations/local-variables/index.js.map +0 -1
- package/build/cjs/integrations/local-variables/local-variables-async.js +0 -143
- package/build/cjs/integrations/local-variables/local-variables-async.js.map +0 -1
- package/build/cjs/integrations/local-variables/local-variables-sync.js +0 -410
- package/build/cjs/integrations/local-variables/local-variables-sync.js.map +0 -1
- package/build/cjs/integrations/modules.js +0 -135
- package/build/cjs/integrations/modules.js.map +0 -1
- package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -291
- package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
- package/build/cjs/integrations/onuncaughtexception.js +0 -134
- package/build/cjs/integrations/onuncaughtexception.js.map +0 -1
- package/build/cjs/integrations/onunhandledrejection.js +0 -89
- package/build/cjs/integrations/onunhandledrejection.js.map +0 -1
- package/build/cjs/integrations/processSession.js +0 -36
- package/build/cjs/integrations/processSession.js.map +0 -1
- package/build/cjs/integrations/spotlight.js +0 -101
- package/build/cjs/integrations/spotlight.js.map +0 -1
- package/build/cjs/integrations/tracing/vercelai/ai_sdk_attributes.js +0 -168
- package/build/cjs/integrations/tracing/vercelai/ai_sdk_attributes.js.map +0 -1
- package/build/cjs/integrations/winston.js +0 -151
- package/build/cjs/integrations/winston.js.map +0 -1
- package/build/cjs/logs/capture.js +0 -29
- package/build/cjs/logs/capture.js.map +0 -1
- package/build/cjs/logs/exports.js +0 -178
- package/build/cjs/logs/exports.js.map +0 -1
- package/build/cjs/nodeVersion.js +0 -12
- package/build/cjs/nodeVersion.js.map +0 -1
- package/build/cjs/otel/contextManager.js +0 -16
- package/build/cjs/otel/contextManager.js.map +0 -1
- package/build/cjs/otel/instrument.js +0 -139
- package/build/cjs/otel/instrument.js.map +0 -1
- package/build/cjs/proxy/base.js +0 -122
- package/build/cjs/proxy/base.js.map +0 -1
- package/build/cjs/proxy/index.js +0 -173
- package/build/cjs/proxy/index.js.map +0 -1
- package/build/cjs/proxy/parse-proxy-response.js +0 -104
- package/build/cjs/proxy/parse-proxy-response.js.map +0 -1
- package/build/cjs/sdk/api.js +0 -117
- package/build/cjs/sdk/api.js.map +0 -1
- package/build/cjs/sdk/client.js +0 -156
- package/build/cjs/sdk/client.js.map +0 -1
- package/build/cjs/transports/http.js +0 -158
- package/build/cjs/transports/http.js.map +0 -1
- package/build/cjs/utils/addOriginToSpan.js +0 -11
- package/build/cjs/utils/addOriginToSpan.js.map +0 -1
- package/build/cjs/utils/baggage.js +0 -36
- package/build/cjs/utils/baggage.js.map +0 -1
- package/build/cjs/utils/commonjs.js +0 -13
- package/build/cjs/utils/commonjs.js.map +0 -1
- package/build/cjs/utils/createMissingInstrumentationContext.js +0 -11
- package/build/cjs/utils/createMissingInstrumentationContext.js.map +0 -1
- package/build/cjs/utils/debug.js +0 -23
- package/build/cjs/utils/debug.js.map +0 -1
- package/build/cjs/utils/ensureIsWrapped.js +0 -41
- package/build/cjs/utils/ensureIsWrapped.js.map +0 -1
- package/build/cjs/utils/envToBool.js +0 -32
- package/build/cjs/utils/envToBool.js.map +0 -1
- package/build/cjs/utils/errorhandling.js +0 -42
- package/build/cjs/utils/errorhandling.js.map +0 -1
- package/build/cjs/utils/getRequestUrl.js +0 -18
- package/build/cjs/utils/getRequestUrl.js.map +0 -1
- package/build/cjs/utils/module.js +0 -60
- package/build/cjs/utils/module.js.map +0 -1
- package/build/esm/cron/common.js +0 -54
- package/build/esm/cron/common.js.map +0 -1
- package/build/esm/cron/cron.js +0 -110
- package/build/esm/cron/cron.js.map +0 -1
- package/build/esm/cron/index.js +0 -13
- package/build/esm/cron/index.js.map +0 -1
- package/build/esm/cron/node-cron.js +0 -69
- package/build/esm/cron/node-cron.js.map +0 -1
- package/build/esm/cron/node-schedule.js +0 -63
- package/build/esm/cron/node-schedule.js.map +0 -1
- package/build/esm/integrations/anr/index.js +0 -234
- package/build/esm/integrations/anr/index.js.map +0 -1
- package/build/esm/integrations/anr/worker-script.js +0 -2
- package/build/esm/integrations/childProcess.js +0 -98
- package/build/esm/integrations/childProcess.js.map +0 -1
- package/build/esm/integrations/context.js +0 -451
- package/build/esm/integrations/context.js.map +0 -1
- package/build/esm/integrations/contextlines.js +0 -399
- package/build/esm/integrations/contextlines.js.map +0 -1
- package/build/esm/integrations/http/SentryHttpInstrumentation.js +0 -555
- package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +0 -1
- package/build/esm/integrations/local-variables/common.js +0 -64
- package/build/esm/integrations/local-variables/common.js.map +0 -1
- package/build/esm/integrations/local-variables/index.js +0 -10
- package/build/esm/integrations/local-variables/index.js.map +0 -1
- package/build/esm/integrations/local-variables/local-variables-async.js +0 -140
- package/build/esm/integrations/local-variables/local-variables-async.js.map +0 -1
- package/build/esm/integrations/local-variables/local-variables-sync.js +0 -405
- package/build/esm/integrations/local-variables/local-variables-sync.js.map +0 -1
- package/build/esm/integrations/local-variables/worker-script.js +0 -2
- package/build/esm/integrations/modules.js +0 -133
- package/build/esm/integrations/modules.js.map +0 -1
- package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -289
- package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
- package/build/esm/integrations/onuncaughtexception.js +0 -131
- package/build/esm/integrations/onuncaughtexception.js.map +0 -1
- package/build/esm/integrations/onunhandledrejection.js +0 -86
- package/build/esm/integrations/onunhandledrejection.js.map +0 -1
- package/build/esm/integrations/processSession.js +0 -34
- package/build/esm/integrations/processSession.js.map +0 -1
- package/build/esm/integrations/spotlight.js +0 -98
- package/build/esm/integrations/spotlight.js.map +0 -1
- package/build/esm/integrations/tracing/vercelai/ai_sdk_attributes.js +0 -152
- package/build/esm/integrations/tracing/vercelai/ai_sdk_attributes.js.map +0 -1
- package/build/esm/integrations/winston.js +0 -149
- package/build/esm/integrations/winston.js.map +0 -1
- package/build/esm/logs/capture.js +0 -27
- package/build/esm/logs/capture.js.map +0 -1
- package/build/esm/logs/exports.js +0 -170
- package/build/esm/logs/exports.js.map +0 -1
- package/build/esm/nodeVersion.js +0 -8
- package/build/esm/nodeVersion.js.map +0 -1
- package/build/esm/otel/contextManager.js +0 -14
- package/build/esm/otel/contextManager.js.map +0 -1
- package/build/esm/otel/instrument.js +0 -135
- package/build/esm/otel/instrument.js.map +0 -1
- package/build/esm/proxy/base.js +0 -120
- package/build/esm/proxy/base.js.map +0 -1
- package/build/esm/proxy/index.js +0 -171
- package/build/esm/proxy/index.js.map +0 -1
- package/build/esm/proxy/parse-proxy-response.js +0 -102
- package/build/esm/proxy/parse-proxy-response.js.map +0 -1
- package/build/esm/sdk/api.js +0 -114
- package/build/esm/sdk/api.js.map +0 -1
- package/build/esm/sdk/client.js +0 -154
- package/build/esm/sdk/client.js.map +0 -1
- package/build/esm/transports/http.js +0 -156
- package/build/esm/transports/http.js.map +0 -1
- package/build/esm/utils/addOriginToSpan.js +0 -9
- package/build/esm/utils/addOriginToSpan.js.map +0 -1
- package/build/esm/utils/baggage.js +0 -34
- package/build/esm/utils/baggage.js.map +0 -1
- package/build/esm/utils/commonjs.js +0 -11
- package/build/esm/utils/commonjs.js.map +0 -1
- package/build/esm/utils/createMissingInstrumentationContext.js +0 -9
- package/build/esm/utils/createMissingInstrumentationContext.js.map +0 -1
- package/build/esm/utils/debug.js +0 -21
- package/build/esm/utils/debug.js.map +0 -1
- package/build/esm/utils/ensureIsWrapped.js +0 -39
- package/build/esm/utils/ensureIsWrapped.js.map +0 -1
- package/build/esm/utils/envToBool.js +0 -28
- package/build/esm/utils/envToBool.js.map +0 -1
- package/build/esm/utils/errorhandling.js +0 -40
- package/build/esm/utils/errorhandling.js.map +0 -1
- package/build/esm/utils/getRequestUrl.js +0 -16
- package/build/esm/utils/getRequestUrl.js.map +0 -1
- package/build/esm/utils/module.js +0 -58
- package/build/esm/utils/module.js.map +0 -1
- package/build/types/cron/common.d.ts +0 -5
- package/build/types/cron/common.d.ts.map +0 -1
- package/build/types/cron/cron.d.ts +0 -43
- package/build/types/cron/cron.d.ts.map +0 -1
- package/build/types/cron/index.d.ts +0 -10
- package/build/types/cron/index.d.ts.map +0 -1
- package/build/types/cron/node-cron.d.ts +0 -27
- package/build/types/cron/node-cron.d.ts.map +0 -1
- package/build/types/cron/node-schedule.d.ts +0 -19
- package/build/types/cron/node-schedule.d.ts.map +0 -1
- package/build/types/integrations/anr/common.d.ts +0 -52
- package/build/types/integrations/anr/common.d.ts.map +0 -1
- package/build/types/integrations/anr/index.d.ts +0 -13
- package/build/types/integrations/anr/index.d.ts.map +0 -1
- package/build/types/integrations/anr/worker.d.ts +0 -2
- package/build/types/integrations/anr/worker.d.ts.map +0 -1
- package/build/types/integrations/childProcess.d.ts +0 -20
- package/build/types/integrations/childProcess.d.ts.map +0 -1
- package/build/types/integrations/context.d.ts +0 -30
- package/build/types/integrations/context.d.ts.map +0 -1
- package/build/types/integrations/contextlines.d.ts +0 -31
- package/build/types/integrations/contextlines.d.ts.map +0 -1
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +0 -131
- package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +0 -1
- package/build/types/integrations/local-variables/common.d.ts +0 -66
- package/build/types/integrations/local-variables/common.d.ts.map +0 -1
- package/build/types/integrations/local-variables/index.d.ts +0 -4
- package/build/types/integrations/local-variables/index.d.ts.map +0 -1
- package/build/types/integrations/local-variables/local-variables-async.d.ts +0 -7
- package/build/types/integrations/local-variables/local-variables-async.d.ts.map +0 -1
- package/build/types/integrations/local-variables/local-variables-sync.d.ts +0 -34
- package/build/types/integrations/local-variables/local-variables-sync.d.ts.map +0 -1
- package/build/types/integrations/local-variables/worker.d.ts +0 -2
- package/build/types/integrations/local-variables/worker.d.ts.map +0 -1
- package/build/types/integrations/modules.d.ts +0 -17
- package/build/types/integrations/modules.d.ts.map +0 -1
- package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
- package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts.map +0 -1
- package/build/types/integrations/onuncaughtexception.d.ts +0 -31
- package/build/types/integrations/onuncaughtexception.d.ts.map +0 -1
- package/build/types/integrations/onunhandledrejection.d.ts +0 -23
- package/build/types/integrations/onunhandledrejection.d.ts.map +0 -1
- package/build/types/integrations/processSession.d.ts +0 -5
- package/build/types/integrations/processSession.d.ts.map +0 -1
- package/build/types/integrations/spotlight.d.ts +0 -18
- package/build/types/integrations/spotlight.d.ts.map +0 -1
- package/build/types/integrations/tracing/vercelai/ai_sdk_attributes.d.ts +0 -669
- package/build/types/integrations/tracing/vercelai/ai_sdk_attributes.d.ts.map +0 -1
- package/build/types/integrations/winston.d.ts +0 -44
- package/build/types/integrations/winston.d.ts.map +0 -1
- package/build/types/logs/capture.d.ts +0 -11
- package/build/types/logs/capture.d.ts.map +0 -1
- package/build/types/logs/exports.d.ts +0 -150
- package/build/types/logs/exports.d.ts.map +0 -1
- package/build/types/nodeVersion.d.ts +0 -8
- package/build/types/nodeVersion.d.ts.map +0 -1
- package/build/types/otel/contextManager.d.ts +0 -10
- package/build/types/otel/contextManager.d.ts.map +0 -1
- package/build/types/otel/instrument.d.ts +0 -23
- package/build/types/otel/instrument.d.ts.map +0 -1
- package/build/types/proxy/base.d.ts +0 -65
- package/build/types/proxy/base.d.ts.map +0 -1
- package/build/types/proxy/helpers.d.ts +0 -42
- package/build/types/proxy/helpers.d.ts.map +0 -1
- package/build/types/proxy/index.d.ts +0 -73
- package/build/types/proxy/index.d.ts.map +0 -1
- package/build/types/proxy/parse-proxy-response.d.ts +0 -43
- package/build/types/proxy/parse-proxy-response.d.ts.map +0 -1
- package/build/types/sdk/api.d.ts +0 -8
- package/build/types/sdk/api.d.ts.map +0 -1
- package/build/types/sdk/client.d.ts +0 -29
- package/build/types/sdk/client.d.ts.map +0 -1
- package/build/types/sdk/scope.d.ts +0 -7
- package/build/types/sdk/scope.d.ts.map +0 -1
- package/build/types/transports/http-module.d.ts +0 -31
- package/build/types/transports/http-module.d.ts.map +0 -1
- package/build/types/transports/http.d.ts +0 -21
- package/build/types/transports/http.d.ts.map +0 -1
- package/build/types/transports/index.d.ts +0 -3
- package/build/types/transports/index.d.ts.map +0 -1
- package/build/types/utils/addOriginToSpan.d.ts +0 -5
- package/build/types/utils/addOriginToSpan.d.ts.map +0 -1
- package/build/types/utils/baggage.d.ts +0 -6
- package/build/types/utils/baggage.d.ts.map +0 -1
- package/build/types/utils/commonjs.d.ts +0 -3
- package/build/types/utils/commonjs.d.ts.map +0 -1
- package/build/types/utils/createMissingInstrumentationContext.d.ts +0 -3
- package/build/types/utils/createMissingInstrumentationContext.d.ts.map +0 -1
- package/build/types/utils/debug.d.ts +0 -5
- package/build/types/utils/debug.d.ts.map +0 -1
- package/build/types/utils/ensureIsWrapped.d.ts +0 -5
- package/build/types/utils/ensureIsWrapped.d.ts.map +0 -1
- package/build/types/utils/entry-point.d.ts +0 -24
- package/build/types/utils/entry-point.d.ts.map +0 -1
- package/build/types/utils/envToBool.d.ts +0 -13
- package/build/types/utils/envToBool.d.ts.map +0 -1
- package/build/types/utils/errorhandling.d.ts +0 -5
- package/build/types/utils/errorhandling.d.ts.map +0 -1
- package/build/types/utils/getRequestUrl.d.ts +0 -5
- package/build/types/utils/getRequestUrl.d.ts.map +0 -1
- package/build/types/utils/module.d.ts +0 -3
- package/build/types/utils/module.d.ts.map +0 -1
- package/build/types/utils/prepareEvent.d.ts +0 -17
- package/build/types/utils/prepareEvent.d.ts.map +0 -1
- package/build/types-ts3.8/cron/common.d.ts +0 -5
- package/build/types-ts3.8/cron/cron.d.ts +0 -43
- package/build/types-ts3.8/cron/index.d.ts +0 -10
- package/build/types-ts3.8/cron/node-cron.d.ts +0 -27
- package/build/types-ts3.8/cron/node-schedule.d.ts +0 -19
- package/build/types-ts3.8/integrations/anr/common.d.ts +0 -52
- package/build/types-ts3.8/integrations/anr/index.d.ts +0 -13
- package/build/types-ts3.8/integrations/anr/worker.d.ts +0 -2
- package/build/types-ts3.8/integrations/childProcess.d.ts +0 -20
- package/build/types-ts3.8/integrations/context.d.ts +0 -30
- package/build/types-ts3.8/integrations/contextlines.d.ts +0 -31
- package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +0 -133
- package/build/types-ts3.8/integrations/local-variables/common.d.ts +0 -66
- package/build/types-ts3.8/integrations/local-variables/index.d.ts +0 -4
- package/build/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +0 -7
- package/build/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +0 -34
- package/build/types-ts3.8/integrations/local-variables/worker.d.ts +0 -2
- package/build/types-ts3.8/integrations/modules.d.ts +0 -17
- package/build/types-ts3.8/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
- package/build/types-ts3.8/integrations/onuncaughtexception.d.ts +0 -31
- package/build/types-ts3.8/integrations/onunhandledrejection.d.ts +0 -23
- package/build/types-ts3.8/integrations/processSession.d.ts +0 -5
- package/build/types-ts3.8/integrations/spotlight.d.ts +0 -18
- package/build/types-ts3.8/integrations/tracing/vercelai/ai_sdk_attributes.d.ts +0 -669
- package/build/types-ts3.8/integrations/winston.d.ts +0 -44
- package/build/types-ts3.8/logs/capture.d.ts +0 -18
- package/build/types-ts3.8/logs/exports.d.ts +0 -150
- package/build/types-ts3.8/nodeVersion.d.ts +0 -8
- package/build/types-ts3.8/otel/contextManager.d.ts +0 -10
- package/build/types-ts3.8/otel/instrument.d.ts +0 -23
- package/build/types-ts3.8/proxy/base.d.ts +0 -60
- package/build/types-ts3.8/proxy/helpers.d.ts +0 -38
- package/build/types-ts3.8/proxy/index.d.ts +0 -74
- package/build/types-ts3.8/proxy/parse-proxy-response.d.ts +0 -40
- package/build/types-ts3.8/sdk/api.d.ts +0 -8
- package/build/types-ts3.8/sdk/client.d.ts +0 -32
- package/build/types-ts3.8/sdk/scope.d.ts +0 -7
- package/build/types-ts3.8/transports/http-module.d.ts +0 -28
- package/build/types-ts3.8/transports/http.d.ts +0 -20
- package/build/types-ts3.8/transports/index.d.ts +0 -3
- package/build/types-ts3.8/utils/addOriginToSpan.d.ts +0 -5
- package/build/types-ts3.8/utils/baggage.d.ts +0 -6
- package/build/types-ts3.8/utils/commonjs.d.ts +0 -3
- package/build/types-ts3.8/utils/createMissingInstrumentationContext.d.ts +0 -3
- package/build/types-ts3.8/utils/debug.d.ts +0 -5
- package/build/types-ts3.8/utils/ensureIsWrapped.d.ts +0 -5
- package/build/types-ts3.8/utils/entry-point.d.ts +0 -24
- package/build/types-ts3.8/utils/envToBool.d.ts +0 -13
- package/build/types-ts3.8/utils/errorhandling.d.ts +0 -5
- package/build/types-ts3.8/utils/getRequestUrl.d.ts +0 -5
- package/build/types-ts3.8/utils/module.d.ts +0 -3
- package/build/types-ts3.8/utils/prepareEvent.d.ts +0 -17
|
@@ -2,11 +2,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const instrumentationGenericPool = require('@opentelemetry/instrumentation-generic-pool');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
|
-
const
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
6
6
|
|
|
7
7
|
const INTEGRATION_NAME = 'GenericPool';
|
|
8
8
|
|
|
9
|
-
const instrumentGenericPool =
|
|
9
|
+
const instrumentGenericPool = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationGenericPool.GenericPoolInstrumentation({}));
|
|
10
10
|
|
|
11
11
|
const _genericPoolIntegration = (() => {
|
|
12
12
|
let instrumentationWrappedCallback;
|
|
@@ -15,7 +15,7 @@ const _genericPoolIntegration = (() => {
|
|
|
15
15
|
name: INTEGRATION_NAME,
|
|
16
16
|
setupOnce() {
|
|
17
17
|
const instrumentation = instrumentGenericPool();
|
|
18
|
-
instrumentationWrappedCallback =
|
|
18
|
+
instrumentationWrappedCallback = nodeCore.instrumentWhenWrapped(instrumentation);
|
|
19
19
|
},
|
|
20
20
|
|
|
21
21
|
setup(client) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"genericPool.js","sources":["../../../../src/integrations/tracing/genericPool.ts"],"sourcesContent":["import { GenericPoolInstrumentation } from '@opentelemetry/instrumentation-generic-pool';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON } from '@sentry/core';\nimport { generateInstrumentOnce, instrumentWhenWrapped } from '
|
|
1
|
+
{"version":3,"file":"genericPool.js","sources":["../../../../src/integrations/tracing/genericPool.ts"],"sourcesContent":["import { GenericPoolInstrumentation } from '@opentelemetry/instrumentation-generic-pool';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON } from '@sentry/core';\nimport { generateInstrumentOnce, instrumentWhenWrapped } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'GenericPool';\n\nexport const instrumentGenericPool = generateInstrumentOnce(INTEGRATION_NAME, () => new GenericPoolInstrumentation({}));\n\nconst _genericPoolIntegration = (() => {\n let instrumentationWrappedCallback: undefined | ((callback: () => void) => void);\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const instrumentation = instrumentGenericPool();\n instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);\n },\n\n setup(client) {\n instrumentationWrappedCallback?.(() =>\n client.on('spanStart', span => {\n const spanJSON = spanToJSON(span);\n\n const spanDescription = spanJSON.description;\n\n // typo in emitted span for version <= 0.38.0 of @opentelemetry/instrumentation-generic-pool\n const isGenericPoolSpan =\n spanDescription === 'generic-pool.aquire' || spanDescription === 'generic-pool.acquire';\n\n if (isGenericPoolSpan) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.generic_pool');\n }\n }),\n );\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [generic-pool](https://www.npmjs.com/package/generic-pool) library.\n *\n * For more information, see the [`genericPoolIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/genericpool/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.genericPoolIntegration()],\n * });\n * ```\n */\nexport const genericPoolIntegration = defineIntegration(_genericPoolIntegration);\n"],"names":["generateInstrumentOnce","GenericPoolInstrumentation","instrumentWhenWrapped","spanToJSON","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,aAAa;;MAEzB,qBAAsB,GAAEA,+BAAsB,CAAC,gBAAgB,EAAE,MAAM,IAAIC,qDAA0B,CAAC,EAAE,CAAC;;AAEtH,MAAM,uBAAwB,IAAG,MAAM;AACvC,EAAE,IAAI,8BAA8B;;AAEpC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,MAAM,eAAA,GAAkB,qBAAqB,EAAE;AACrD,MAAM,8BAA+B,GAAEC,8BAAqB,CAAC,eAAe,CAAC;AAC7E,KAAK;;AAEL,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,8BAA8B,GAAG;AACvC,QAAQ,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ;AACvC,UAAU,MAAM,QAAS,GAAEC,eAAU,CAAC,IAAI,CAAC;;AAE3C,UAAU,MAAM,eAAA,GAAkB,QAAQ,CAAC,WAAW;;AAEtD;AACA,UAAU,MAAM,iBAAkB;AAClC,YAAY,oBAAoB,qBAAA,IAAyB,eAAA,KAAoB,sBAAsB;;AAEnG,UAAU,IAAI,iBAAiB,EAAE;AACjC,YAAY,IAAI,CAAC,YAAY,CAACC,qCAAgC,EAAE,2BAA2B,CAAC;AAC5F;AACA,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,sBAAuB,GAAEC,sBAAiB,CAAC,uBAAuB;;;;;"}
|
|
@@ -3,13 +3,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3
3
|
const api = require('@opentelemetry/api');
|
|
4
4
|
const instrumentationGraphql = require('@opentelemetry/instrumentation-graphql');
|
|
5
5
|
const core = require('@sentry/core');
|
|
6
|
+
const nodeCore = require('@sentry/node-core');
|
|
6
7
|
const opentelemetry = require('@sentry/opentelemetry');
|
|
7
|
-
const instrument = require('../../otel/instrument.js');
|
|
8
|
-
const addOriginToSpan = require('../../utils/addOriginToSpan.js');
|
|
9
8
|
|
|
10
9
|
const INTEGRATION_NAME = 'Graphql';
|
|
11
10
|
|
|
12
|
-
const instrumentGraphql =
|
|
11
|
+
const instrumentGraphql = nodeCore.generateInstrumentOnce(
|
|
13
12
|
INTEGRATION_NAME,
|
|
14
13
|
instrumentationGraphql.GraphQLInstrumentation,
|
|
15
14
|
(_options) => {
|
|
@@ -18,7 +17,7 @@ const instrumentGraphql = instrument.generateInstrumentOnce(
|
|
|
18
17
|
return {
|
|
19
18
|
...options,
|
|
20
19
|
responseHook(span, result) {
|
|
21
|
-
|
|
20
|
+
nodeCore.addOriginToSpan(span, 'auto.graphql.otel.graphql');
|
|
22
21
|
|
|
23
22
|
// We want to ensure spans are marked as errored if there are errors in the result
|
|
24
23
|
// We only do that if the span is not already marked with a status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.js","sources":["../../../../src/integrations/tracing/graphql.ts"],"sourcesContent":["import type { AttributeValue } from '@opentelemetry/api';\nimport { SpanStatusCode } from '@opentelemetry/api';\nimport { GraphQLInstrumentation } from '@opentelemetry/instrumentation-graphql';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, getRootSpan, spanToJSON } from '@sentry/core';\nimport {
|
|
1
|
+
{"version":3,"file":"graphql.js","sources":["../../../../src/integrations/tracing/graphql.ts"],"sourcesContent":["import type { AttributeValue } from '@opentelemetry/api';\nimport { SpanStatusCode } from '@opentelemetry/api';\nimport { GraphQLInstrumentation } from '@opentelemetry/instrumentation-graphql';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, getRootSpan, spanToJSON } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION } from '@sentry/opentelemetry';\n\ninterface GraphqlOptions {\n /**\n * Do not create spans for resolvers.\n *\n * Defaults to true.\n */\n ignoreResolveSpans?: boolean;\n\n /**\n * Don't create spans for the execution of the default resolver on object properties.\n *\n * When a resolver function is not defined on the schema for a field, graphql will\n * use the default resolver which just looks for a property with that name on the object.\n * If the property is not a function, it's not very interesting to trace.\n * This option can reduce noise and number of spans created.\n *\n * Defaults to true.\n */\n ignoreTrivialResolveSpans?: boolean;\n\n /**\n * If this is enabled, a http.server root span containing this span will automatically be renamed to include the operation name.\n * Set this to `false` if you do not want this behavior, and want to keep the default http.server span name.\n *\n * Defaults to true.\n */\n useOperationNameForRootSpan?: boolean;\n}\n\nconst INTEGRATION_NAME = 'Graphql';\n\nexport const instrumentGraphql = generateInstrumentOnce(\n INTEGRATION_NAME,\n GraphQLInstrumentation,\n (_options: GraphqlOptions) => {\n const options = getOptionsWithDefaults(_options);\n\n return {\n ...options,\n responseHook(span, result) {\n addOriginToSpan(span, 'auto.graphql.otel.graphql');\n\n // We want to ensure spans are marked as errored if there are errors in the result\n // We only do that if the span is not already marked with a status\n const resultWithMaybeError = result as { errors?: { message: string }[] };\n if (resultWithMaybeError.errors?.length && !spanToJSON(span).status) {\n span.setStatus({ code: SpanStatusCode.ERROR });\n }\n\n const attributes = spanToJSON(span).data;\n\n // If operation.name is not set, we fall back to use operation.type only\n const operationType = attributes['graphql.operation.type'];\n const operationName = attributes['graphql.operation.name'];\n\n if (options.useOperationNameForRootSpan && operationType) {\n const rootSpan = getRootSpan(span);\n const rootSpanAttributes = spanToJSON(rootSpan).data;\n\n const existingOperations = rootSpanAttributes[SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION] || [];\n\n const newOperation = operationName ? `${operationType} ${operationName}` : `${operationType}`;\n\n // We keep track of each operation on the root span\n // This can either be a string, or an array of strings (if there are multiple operations)\n if (Array.isArray(existingOperations)) {\n (existingOperations as string[]).push(newOperation);\n rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, existingOperations);\n } else if (typeof existingOperations === 'string') {\n rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, [existingOperations, newOperation]);\n } else {\n rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, newOperation);\n }\n\n if (!spanToJSON(rootSpan).data['original-description']) {\n rootSpan.setAttribute('original-description', spanToJSON(rootSpan).description);\n }\n // Important for e.g. @sentry/aws-serverless because this would otherwise overwrite the name again\n rootSpan.updateName(\n `${spanToJSON(rootSpan).data['original-description']} (${getGraphqlOperationNamesFromAttribute(\n existingOperations,\n )})`,\n );\n }\n },\n };\n },\n);\n\nconst _graphqlIntegration = ((options: GraphqlOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // We set defaults here, too, because otherwise we'd update the instrumentation config\n // to the config without defaults, as `generateInstrumentOnce` automatically calls `setConfig(options)`\n // when being called the second time\n instrumentGraphql(getOptionsWithDefaults(options));\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [graphql](https://www.npmjs.com/package/graphql) library.\n *\n * For more information, see the [`graphqlIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/graphql/).\n *\n * @param {GraphqlOptions} options Configuration options for the GraphQL integration.\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.graphqlIntegration()],\n * });\n */\nexport const graphqlIntegration = defineIntegration(_graphqlIntegration);\n\nfunction getOptionsWithDefaults(options?: GraphqlOptions): GraphqlOptions {\n return {\n ignoreResolveSpans: true,\n ignoreTrivialResolveSpans: true,\n useOperationNameForRootSpan: true,\n ...options,\n };\n}\n\n// copy from packages/opentelemetry/utils\nfunction getGraphqlOperationNamesFromAttribute(attr: AttributeValue): string {\n if (Array.isArray(attr)) {\n const sorted = attr.slice().sort();\n\n // Up to 5 items, we just add all of them\n if (sorted.length <= 5) {\n return sorted.join(', ');\n } else {\n // Else, we add the first 5 and the diff of other operations\n return `${sorted.slice(0, 5).join(', ')}, +${sorted.length - 5}`;\n }\n }\n\n return `${attr}`;\n}\n"],"names":["generateInstrumentOnce","GraphQLInstrumentation","addOriginToSpan","spanToJSON","SpanStatusCode","getRootSpan","SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION","defineIntegration"],"mappings":";;;;;;;;AAqCA,MAAM,gBAAA,GAAmB,SAAS;;AAE3B,MAAM,iBAAkB,GAAEA,+BAAsB;AACvD,EAAE,gBAAgB;AAClB,EAAEC,6CAAsB;AACxB,EAAE,CAAC,QAAQ,KAAqB;AAChC,IAAI,MAAM,OAAQ,GAAE,sBAAsB,CAAC,QAAQ,CAAC;;AAEpD,IAAI,OAAO;AACX,MAAM,GAAG,OAAO;AAChB,MAAM,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE;AACjC,QAAQC,wBAAe,CAAC,IAAI,EAAE,2BAA2B,CAAC;;AAE1D;AACA;AACA,QAAQ,MAAM,oBAAqB,GAAE,MAAO;AAC5C,QAAQ,IAAI,oBAAoB,CAAC,MAAM,EAAE,MAAA,IAAU,CAACC,eAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE;AAC7E,UAAU,IAA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AAA,MAAA,GAAA,CAAA,CAAA,CAAA;AACA;AACA;;AAEA,EAAA,OAAA,CAAA,EAAA,IAAA,CAAA,CAAA;AACA;;;;;"}
|
|
@@ -2,13 +2,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const instrumentationHapi = require('@opentelemetry/instrumentation-hapi');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
5
6
|
const debugBuild = require('../../../debug-build.js');
|
|
6
|
-
const instrument = require('../../../otel/instrument.js');
|
|
7
|
-
const ensureIsWrapped = require('../../../utils/ensureIsWrapped.js');
|
|
8
7
|
|
|
9
8
|
const INTEGRATION_NAME = 'Hapi';
|
|
10
9
|
|
|
11
|
-
const instrumentHapi =
|
|
10
|
+
const instrumentHapi = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationHapi.HapiInstrumentation());
|
|
12
11
|
|
|
13
12
|
const _hapiIntegration = (() => {
|
|
14
13
|
return {
|
|
@@ -113,7 +112,7 @@ async function setupHapiErrorHandler(server) {
|
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
116
|
-
|
|
115
|
+
nodeCore.ensureIsWrapped(server.register, 'hapi');
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
function addHapiSpanAttributes(span) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/hapi/index.ts"],"sourcesContent":["import { HapiInstrumentation } from '@opentelemetry/instrumentation-hapi';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport {\n captureException,\n defineIntegration,\n getClient,\n getDefaultIsolationScope,\n getIsolationScope,\n logger,\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n} from '@sentry/core';\nimport {
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/hapi/index.ts"],"sourcesContent":["import { HapiInstrumentation } from '@opentelemetry/instrumentation-hapi';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport {\n captureException,\n defineIntegration,\n getClient,\n getDefaultIsolationScope,\n getIsolationScope,\n logger,\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n} from '@sentry/core';\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport type { Request, RequestEvent, Server } from './types';\n\nconst INTEGRATION_NAME = 'Hapi';\n\nexport const instrumentHapi = generateInstrumentOnce(INTEGRATION_NAME, () => new HapiInstrumentation());\n\nconst _hapiIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentHapi();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Hapi](https://hapi.dev/).\n *\n * If you also want to capture errors, you need to call `setupHapiErrorHandler(server)` after you set up your server.\n *\n * For more information, see the [hapi documentation](https://docs.sentry.io/platforms/javascript/guides/hapi/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.hapiIntegration()],\n * })\n * ```\n */\nexport const hapiIntegration = defineIntegration(_hapiIntegration);\n\nfunction isErrorEvent(event: unknown): event is RequestEvent {\n return !!(event && typeof event === 'object' && 'error' in event && event.error);\n}\n\nfunction sendErrorToSentry(errorData: object): void {\n captureException(errorData, {\n mechanism: {\n type: 'hapi',\n handled: false,\n data: {\n function: 'hapiErrorPlugin',\n },\n },\n });\n}\n\nexport const hapiErrorPlugin = {\n name: 'SentryHapiErrorPlugin',\n version: SDK_VERSION,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: async function (serverArg: Record<any, any>) {\n const server = serverArg as unknown as Server;\n\n server.events.on({ name: 'request', channels: ['error'] }, (request: Request, event: RequestEvent) => {\n if (getIsolationScope() !== getDefaultIsolationScope()) {\n const route = request.route;\n if (route.path) {\n getIsolationScope().setTransactionName(`${route.method.toUpperCase()} ${route.path}`);\n }\n } else {\n DEBUG_BUILD &&\n logger.warn('Isolation scope is still the default isolation scope - skipping setting transactionName');\n }\n\n if (isErrorEvent(event)) {\n sendErrorToSentry(event.error);\n }\n });\n },\n};\n\n/**\n * Add a Hapi plugin to capture errors to Sentry.\n *\n * @param server The Hapi server to attach the error handler to\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const Hapi = require('@hapi/hapi');\n *\n * const init = async () => {\n * const server = Hapi.server();\n *\n * // all your routes here\n *\n * await Sentry.setupHapiErrorHandler(server);\n *\n * await server.start();\n * };\n * ```\n */\nexport async function setupHapiErrorHandler(server: Server): Promise<void> {\n await server.register(hapiErrorPlugin);\n\n // Sadly, middleware spans do not go through `requestHook`, so we handle those here\n // We register this hook in this method, because if we register it in the integration `setup`,\n // it would always run even for users that are not even using hapi\n const client = getClient();\n if (client) {\n client.on('spanStart', span => {\n addHapiSpanAttributes(span);\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/unbound-method\n ensureIsWrapped(server.register, 'hapi');\n}\n\nfunction addHapiSpanAttributes(span: Span): void {\n const attributes = spanToJSON(span).data;\n\n // this is one of: router, plugin, server.ext\n const type = attributes['hapi.type'];\n\n // If this is already set, or we have no Hapi span, no need to process again...\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {\n return;\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.hapi',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.hapi`,\n });\n}\n"],"names":["generateInstrumentOnce","HapiInstrumentation","defineIntegration","captureException","SDK_VERSION","getIsolationScope","getDefaultIsolationScope","DEBUG_BUILD","logger","getClient","ensureIsWrapped","sp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,CAAAC,iCAAA,CAAA,IAAA,CAAA,IAAA,EAAA;AACA,IAAA;AACA;;AAEA,EAAA,IAAA,CAAA,aAAA,CAAA;AACA,IAAA,CAAAC,qCAAA,GAAA,qBAAA;AACA,IAAA,CAAAD,iCAAA,GAAA,CAAA,EAAA,IAAA,CAAA,KAAA,CAAA;AACA,GAAA,CAAA;AACA;;;;;;;"}
|
|
@@ -16,6 +16,7 @@ const mongoose = require('./mongoose.js');
|
|
|
16
16
|
const mysql = require('./mysql.js');
|
|
17
17
|
const mysql2 = require('./mysql2.js');
|
|
18
18
|
const postgres = require('./postgres.js');
|
|
19
|
+
const postgresjs = require('./postgresjs.js');
|
|
19
20
|
const prisma = require('./prisma.js');
|
|
20
21
|
const redis = require('./redis.js');
|
|
21
22
|
const tedious = require('./tedious.js');
|
|
@@ -45,6 +46,7 @@ function getAutoPerformanceIntegrations() {
|
|
|
45
46
|
amqplib.amqplibIntegration(),
|
|
46
47
|
lrumemoizer.lruMemoizerIntegration(),
|
|
47
48
|
index$3.vercelAIIntegration(),
|
|
49
|
+
postgresjs.postgresJsIntegration(),
|
|
48
50
|
];
|
|
49
51
|
}
|
|
50
52
|
|
|
@@ -76,6 +78,7 @@ function getOpenTelemetryInstrumentationToPreload() {
|
|
|
76
78
|
genericPool.instrumentGenericPool,
|
|
77
79
|
amqplib.instrumentAmqplib,
|
|
78
80
|
index$3.instrumentVercelAi,
|
|
81
|
+
postgresjs.instrumentPostgresJs,
|
|
79
82
|
];
|
|
80
83
|
}
|
|
81
84
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { instrumentOtelHttp } from '../http';\nimport { amqplibIntegration, instrumentAmqplib } from './amqplib';\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress, instrumentExpressV5 } from './express';\nimport { fastifyIntegration, instrumentFastify, instrumentFastifyV3 } from './fastify';\nimport { genericPoolIntegration, instrumentGenericPool } from './genericPool';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { instrumentKafka, kafkaIntegration } from './kafka';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentLruMemoizer, lruMemoizerIntegration } from './lrumemoizer';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { prismaIntegration } from './prisma';\nimport { instrumentRedis, redisIntegration } from './redis';\nimport { instrumentTedious, tediousIntegration } from './tedious';\nimport { instrumentVercelAi, vercelAIIntegration } from './vercelai';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n tediousIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n vercelAIIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentOtelHttp,\n instrumentExpress,\n instrumentExpressV5,\n instrumentConnect,\n instrumentFastify,\n instrumentFastifyV3,\n instrumentHapi,\n instrumentKafka,\n instrumentKoa,\n instrumentLruMemoizer,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n instrumentRedis,\n instrumentTedious,\n instrumentGenericPool,\n instrumentAmqplib,\n instrumentVercelAi,\n ];\n}\n"],"names":["expressIntegration","fastifyIntegration","graphqlIntegration","mongoIntegration","mongooseIntegration","mysqlIntegration","mysql2Integration","redisIntegration","postgresIntegration","prismaIntegration","hapiIntegration","koaIntegration","connectIntegration","tediousIntegration","genericPoolIntegration","kafkaIntegration","amqplibIntegration","lruMemoizerIntegration","vercelAIIntegration","instrumentOtelHttp","instrumentExpress","instrumentExpressV5","instrumentConnect","instrumentFastify","instrumentFastifyV3","instrumentHapi","instrumentKafka","instrumentKoa","instrumentLruMemoizer","instrumentMongo","instrumentMongoose","instrumentMysql","instrumentMysql2","instrumentPostgres","instrumentGraphql","instrumentRedis","instrumentTedious","instrumentGenericPool","instrumentAmqplib","instrumentVercelAi"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { instrumentOtelHttp } from '../http';\nimport { amqplibIntegration, instrumentAmqplib } from './amqplib';\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress, instrumentExpressV5 } from './express';\nimport { fastifyIntegration, instrumentFastify, instrumentFastifyV3 } from './fastify';\nimport { genericPoolIntegration, instrumentGenericPool } from './genericPool';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { instrumentKafka, kafkaIntegration } from './kafka';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentLruMemoizer, lruMemoizerIntegration } from './lrumemoizer';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { instrumentPostgresJs, postgresJsIntegration } from './postgresjs';\nimport { prismaIntegration } from './prisma';\nimport { instrumentRedis, redisIntegration } from './redis';\nimport { instrumentTedious, tediousIntegration } from './tedious';\nimport { instrumentVercelAi, vercelAIIntegration } from './vercelai';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n tediousIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n vercelAIIntegration(),\n postgresJsIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentOtelHttp,\n instrumentExpress,\n instrumentExpressV5,\n instrumentConnect,\n instrumentFastify,\n instrumentFastifyV3,\n instrumentHapi,\n instrumentKafka,\n instrumentKoa,\n instrumentLruMemoizer,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n instrumentRedis,\n instrumentTedious,\n instrumentGenericPool,\n instrumentAmqplib,\n instrumentVercelAi,\n instrumentPostgresJs,\n ];\n}\n"],"names":["expressIntegration","fastifyIntegration","graphqlIntegration","mongoIntegration","mongooseIntegration","mysqlIntegration","mysql2Integration","redisIntegration","postgresIntegration","prismaIntegration","hapiIntegration","koaIntegration","connectIntegration","tediousIntegration","genericPoolIntegration","kafkaIntegration","amqplibIntegration","lruMemoizerIntegration","vercelAIIntegration","postgresJsIntegration","instrumentOtelHttp","instrumentExpress","instrumentExpressV5","instrumentConnect","instrumentFastify","instrumentFastifyV3","instrumentHapi","instrumentKafka","instrumentKoa","instrumentLruMemoizer","instrumentMongo","instrumentMongoose","instrumentMysql","instrumentMysql2","instrumentPostgres","instrumentGraphql","instrumentRedis","instrumentTedious","instrumentGenericPool","instrumentAmqplib","instrumentVercelAi","instrumentPostgresJs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA;AACA;AACA;AACO,SAAS,8BAA8B,GAAkB;AAChE,EAAE,OAAO;AACT,IAAIA,0BAAkB,EAAE;AACxB,IAAIC,0BAAkB,EAAE;AACxB,IAAIC,0BAAkB,EAAE;AACxB,IAAIC,sBAAgB,EAAE;AACtB,IAAIC,4BAAmB,EAAE;AACzB,IAAIC,sBAAgB,EAAE;AACtB,IAAIC,wBAAiB,EAAE;AACvB,IAAIC,sBAAgB,EAAE;AACtB,IAAIC,4BAAmB,EAAE;AACzB,IAAIC,wBAAiB,EAAE;AACvB,IAAIC,uBAAe,EAAE;AACrB,IAAIC,kBAAc,EAAE;AACpB,IAAIC,0BAAkB,EAAE;AACxB,IAAIC,0BAAkB,EAAE;AACxB,IAAIC,kCAAsB,EAAE;AAC5B,IAAIC,sBAAgB,EAAE;AACtB,IAAIC,0BAAkB,EAAE;AACxB,IAAIC,kCAAsB,EAAE;AAC5B,IAAIC,2BAAmB,EAAE;AACzB,IAAIC,gCAAqB,EAAE;AAC3B,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAmD;AAC3G,EAAE,OAAO;AACT,IAAIC,wBAAkB;AACtB,IAAIC,yBAAiB;AACrB,IAAIC,2BAAmB;AACvB,IAAIC,yBAAiB;AACrB,IAAIC,yBAAiB;AACrB,IAAIC,2BAAmB;AACvB,IAAIC,sBAAc;AAClB,IAAIC,qBAAe;AACnB,IAAIC,iBAAa;AACjB,IAAIC,iCAAqB;AACzB,IAAIC,qBAAe;AACnB,IAAIC,2BAAkB;AACtB,IAAIC,qBAAe;AACnB,IAAIC,uBAAgB;AACpB,IAAIC,2BAAkB;AACtB,IAAIR,sBAAc;AAClB,IAAIS,yBAAiB;AACrB,IAAIC,qBAAe;AACnB,IAAIC,yBAAiB;AACrB,IAAIC,iCAAqB;AACzB,IAAIC,yBAAiB;AACrB,IAAIC,0BAAkB;AACtB,IAAIC,+BAAoB;AACxB,GAAG;AACH;;;;;"}
|
|
@@ -2,20 +2,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const instrumentationKafkajs = require('@opentelemetry/instrumentation-kafkajs');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
|
-
const
|
|
6
|
-
const addOriginToSpan = require('../../utils/addOriginToSpan.js');
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
7
6
|
|
|
8
7
|
const INTEGRATION_NAME = 'Kafka';
|
|
9
8
|
|
|
10
|
-
const instrumentKafka =
|
|
9
|
+
const instrumentKafka = nodeCore.generateInstrumentOnce(
|
|
11
10
|
INTEGRATION_NAME,
|
|
12
11
|
() =>
|
|
13
12
|
new instrumentationKafkajs.KafkaJsInstrumentation({
|
|
14
13
|
consumerHook(span) {
|
|
15
|
-
|
|
14
|
+
nodeCore.addOriginToSpan(span, 'auto.kafkajs.otel.consumer');
|
|
16
15
|
},
|
|
17
16
|
producerHook(span) {
|
|
18
|
-
|
|
17
|
+
nodeCore.addOriginToSpan(span, 'auto.kafkajs.otel.producer');
|
|
19
18
|
},
|
|
20
19
|
}),
|
|
21
20
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kafka.js","sources":["../../../../src/integrations/tracing/kafka.ts"],"sourcesContent":["import { KafkaJsInstrumentation } from '@opentelemetry/instrumentation-kafkajs';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '
|
|
1
|
+
{"version":3,"file":"kafka.js","sources":["../../../../src/integrations/tracing/kafka.ts"],"sourcesContent":["import { KafkaJsInstrumentation } from '@opentelemetry/instrumentation-kafkajs';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Kafka';\n\nexport const instrumentKafka = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new KafkaJsInstrumentation({\n consumerHook(span) {\n addOriginToSpan(span, 'auto.kafkajs.otel.consumer');\n },\n producerHook(span) {\n addOriginToSpan(span, 'auto.kafkajs.otel.producer');\n },\n }),\n);\n\nconst _kafkaIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentKafka();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [kafkajs](https://www.npmjs.com/package/kafkajs) library.\n *\n * For more information, see the [`kafkaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/kafka/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.kafkaIntegration()],\n * });\n */\nexport const kafkaIntegration = defineIntegration(_kafkaIntegration);\n"],"names":["generateInstrumentOnce","KafkaJsInstrumentation","addOriginToSpan","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,OAAO;;AAEzB,MAAM,eAAgB,GAAEA,+BAAsB;AACrD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAIC,6CAAsB,CAAC;AAC/B,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQC,wBAAe,CAAC,IAAI,EAAE,4BAA4B,CAAC;AAC3D,OAAO;AACP,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQA,wBAAe,CAAC,IAAI,EAAE,4BAA4B,CAAC;AAC3D,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,iBAAkB,IAAG,MAAM;AACjC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,eAAe,EAAE;AACvB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAEC,sBAAiB,CAAC,iBAAiB;;;;;"}
|
|
@@ -2,11 +2,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const instrumentationKnex = require('@opentelemetry/instrumentation-knex');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
|
-
const
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
6
6
|
|
|
7
7
|
const INTEGRATION_NAME = 'Knex';
|
|
8
8
|
|
|
9
|
-
const instrumentKnex =
|
|
9
|
+
const instrumentKnex = nodeCore.generateInstrumentOnce(
|
|
10
10
|
INTEGRATION_NAME,
|
|
11
11
|
() => new instrumentationKnex.KnexInstrumentation({ requireParentSpan: true }),
|
|
12
12
|
);
|
|
@@ -18,7 +18,7 @@ const _knexIntegration = (() => {
|
|
|
18
18
|
name: INTEGRATION_NAME,
|
|
19
19
|
setupOnce() {
|
|
20
20
|
const instrumentation = instrumentKnex();
|
|
21
|
-
instrumentationWrappedCallback =
|
|
21
|
+
instrumentationWrappedCallback = nodeCore.instrumentWhenWrapped(instrumentation);
|
|
22
22
|
},
|
|
23
23
|
|
|
24
24
|
setup(client) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knex.js","sources":["../../../../src/integrations/tracing/knex.ts"],"sourcesContent":["import { KnexInstrumentation } from '@opentelemetry/instrumentation-knex';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON } from '@sentry/core';\nimport { generateInstrumentOnce, instrumentWhenWrapped } from '
|
|
1
|
+
{"version":3,"file":"knex.js","sources":["../../../../src/integrations/tracing/knex.ts"],"sourcesContent":["import { KnexInstrumentation } from '@opentelemetry/instrumentation-knex';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON } from '@sentry/core';\nimport { generateInstrumentOnce, instrumentWhenWrapped } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Knex';\n\nexport const instrumentKnex = generateInstrumentOnce(\n INTEGRATION_NAME,\n () => new KnexInstrumentation({ requireParentSpan: true }),\n);\n\nconst _knexIntegration = (() => {\n let instrumentationWrappedCallback: undefined | ((callback: () => void) => void);\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const instrumentation = instrumentKnex();\n instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);\n },\n\n setup(client) {\n instrumentationWrappedCallback?.(() =>\n client.on('spanStart', span => {\n const { data } = spanToJSON(span);\n // knex.version is always set in the span data\n // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/0309caeafc44ac9cb13a3345b790b01b76d0497d/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts#L138\n if ('knex.version' in data) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.knex');\n }\n }),\n );\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Knex integration\n *\n * Capture tracing data for [Knex](https://knexjs.org/).\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.init({\n * integrations: [Sentry.knexIntegration()],\n * });\n * ```\n */\nexport const knexIntegration = defineIntegration(_knexIntegration);\n"],"names":["generateInstrumentOnce","KnexInstrumentation","instrumentWhenWrapped","spanToJSON","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,MAAM;;AAExB,MAAM,cAAe,GAAEA,+BAAsB;AACpD,EAAE,gBAAgB;AAClB,EAAE,MAAM,IAAIC,uCAAmB,CAAC,EAAE,iBAAiB,EAAE,IAAK,EAAC,CAAC;AAC5D;;AAEA,MAAM,gBAAiB,IAAG,MAAM;AAChC,EAAE,IAAI,8BAA8B;;AAEpC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,MAAM,eAAA,GAAkB,cAAc,EAAE;AAC9C,MAAM,8BAA+B,GAAEC,8BAAqB,CAAC,eAAe,CAAC;AAC7E,KAAK;;AAEL,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,8BAA8B,GAAG;AACvC,QAAQ,MAAM,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ;AACvC,UAAU,MAAM,EAAE,IAAK,EAAA,GAAIC,eAAU,CAAC,IAAI,CAAC;AAC3C;AACA;AACA,UAAU,IAAI,cAAe,IAAG,IAAI,EAAE;AACtC,YAAY,IAAI,CAAC,YAAY,CAACC,qCAAgC,EAAE,mBAAmB,CAAC;AACpF;AACA,SAAS,CAAC;AACV,OAAO;AACP,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,eAAgB,GAAEC,sBAAiB,CAAC,gBAAgB;;;;;"}
|
|
@@ -3,21 +3,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3
3
|
const instrumentationKoa = require('@opentelemetry/instrumentation-koa');
|
|
4
4
|
const semanticConventions = require('@opentelemetry/semantic-conventions');
|
|
5
5
|
const core = require('@sentry/core');
|
|
6
|
+
const nodeCore = require('@sentry/node-core');
|
|
6
7
|
const debugBuild = require('../../debug-build.js');
|
|
7
|
-
const instrument = require('../../otel/instrument.js');
|
|
8
|
-
const addOriginToSpan = require('../../utils/addOriginToSpan.js');
|
|
9
|
-
const ensureIsWrapped = require('../../utils/ensureIsWrapped.js');
|
|
10
8
|
|
|
11
9
|
const INTEGRATION_NAME = 'Koa';
|
|
12
10
|
|
|
13
|
-
const instrumentKoa =
|
|
11
|
+
const instrumentKoa = nodeCore.generateInstrumentOnce(
|
|
14
12
|
INTEGRATION_NAME,
|
|
15
13
|
instrumentationKoa.KoaInstrumentation,
|
|
16
14
|
(options = {}) => {
|
|
17
15
|
return {
|
|
18
16
|
ignoreLayersType: options.ignoreLayersType ,
|
|
19
17
|
requestHook(span, info) {
|
|
20
|
-
|
|
18
|
+
nodeCore.addOriginToSpan(span, 'auto.http.otel.koa');
|
|
21
19
|
|
|
22
20
|
const attributes = core.spanToJSON(span).data;
|
|
23
21
|
|
|
@@ -126,7 +124,7 @@ const setupKoaErrorHandler = (app) => {
|
|
|
126
124
|
}
|
|
127
125
|
});
|
|
128
126
|
|
|
129
|
-
|
|
127
|
+
nodeCore.ensureIsWrapped(app.use, 'koa');
|
|
130
128
|
};
|
|
131
129
|
|
|
132
130
|
exports.instrumentKoa = instrumentKoa;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"koa.js","sources":["../../../../src/integrations/tracing/koa.ts"],"sourcesContent":["import type { KoaInstrumentationConfig, KoaLayerType } from '@opentelemetry/instrumentation-koa';\nimport { KoaInstrumentation } from '@opentelemetry/instrumentation-koa';\nimport { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n captureException,\n defineIntegration,\n getDefaultIsolationScope,\n getIsolationScope,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n spanToJSON,\n} from '@sentry/core';\nimport {
|
|
1
|
+
{"version":3,"file":"koa.js","sources":["../../../../src/integrations/tracing/koa.ts"],"sourcesContent":["import type { KoaInstrumentationConfig, KoaLayerType } from '@opentelemetry/instrumentation-koa';\nimport { KoaInstrumentation } from '@opentelemetry/instrumentation-koa';\nimport { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n captureException,\n defineIntegration,\n getDefaultIsolationScope,\n getIsolationScope,\n logger,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n spanToJSON,\n} from '@sentry/core';\nimport { addOriginToSpan, ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\nimport { DEBUG_BUILD } from '../../debug-build';\n\ninterface KoaOptions {\n /**\n * Ignore layers of specified types\n */\n ignoreLayersType?: Array<'middleware' | 'router'>;\n}\n\nconst INTEGRATION_NAME = 'Koa';\n\nexport const instrumentKoa = generateInstrumentOnce(\n INTEGRATION_NAME,\n KoaInstrumentation,\n (options: KoaOptions = {}) => {\n return {\n ignoreLayersType: options.ignoreLayersType as KoaLayerType[],\n requestHook(span, info) {\n addOriginToSpan(span, 'auto.http.otel.koa');\n\n const attributes = spanToJSON(span).data;\n\n // this is one of: middleware, router\n const type = attributes['koa.type'];\n if (type) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, `${type}.koa`);\n }\n\n // Also update the name\n const name = attributes['koa.name'];\n if (typeof name === 'string') {\n // Somehow, name is sometimes `''` for middleware spans\n // See: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2220\n span.updateName(name || '< unknown >');\n }\n\n if (getIsolationScope() === getDefaultIsolationScope()) {\n DEBUG_BUILD && logger.warn('Isolation scope is default isolation scope - skipping setting transactionName');\n return;\n }\n const route = attributes[ATTR_HTTP_ROUTE];\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const method = info.context?.request?.method?.toUpperCase() || 'GET';\n if (route) {\n getIsolationScope().setTransactionName(`${method} ${route}`);\n }\n },\n } satisfies KoaInstrumentationConfig;\n },\n);\n\nconst _koaIntegration = ((options: KoaOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentKoa(options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Koa](https://koajs.com/).\n *\n * If you also want to capture errors, you need to call `setupKoaErrorHandler(app)` after you set up your Koa server.\n *\n * For more information, see the [koa documentation](https://docs.sentry.io/platforms/javascript/guides/koa/).\n *\n * @param {KoaOptions} options Configuration options for the Koa integration.\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.koaIntegration()],\n * })\n * ```\n *\n * @example\n * ```javascript\n * // To ignore middleware spans\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [\n * Sentry.koaIntegration({\n * ignoreLayersType: ['middleware']\n * })\n * ],\n * })\n * ```\n */\nexport const koaIntegration = defineIntegration(_koaIntegration);\n\n/**\n * Add an Koa error handler to capture errors to Sentry.\n *\n * The error handler must be before any other middleware and after all controllers.\n *\n * @param app The Express instances\n * @param options {ExpressHandlerOptions} Configuration options for the handler\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const Koa = require(\"koa\");\n *\n * const app = new Koa();\n *\n * Sentry.setupKoaErrorHandler(app);\n *\n * // Add your routes, etc.\n *\n * app.listen(3000);\n * ```\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const setupKoaErrorHandler = (app: { use: (arg0: (ctx: any, next: any) => Promise<void>) => void }): void => {\n app.use(async (ctx, next) => {\n try {\n await next();\n } catch (error) {\n captureException(error);\n throw error;\n }\n });\n\n ensureIsWrapped(app.use, 'koa');\n};\n"],"names":["generateInstrumentOnce","KoaInstrumentation","addOriginToSpan","spanToJSON","SEMANTIC_ATTRIBUTE_SENTRY_OP","getIsolationScope","getDefaultIsolationScope","DEBUG_BUILD","logger","ATTR_HTTP_ROUTE","defineIntegration","captureException","ensureIsWrapped"],"mappings":";;;;;;;;AAuBA,MAAM,gBAAA,GAAmB,KAAK;;AAEvB,MAAM,aAAc,GAAEA,+BAAsB;AACnD,EAAE,gBAAgB;AAClB,EAAEC,qCAAkB;AACpB,EAAE,CAAC,OAAO,GAAe,EAAE,KAAK;AAChC,IAAI,OAAO;AACX,MAAM,gBAAgB,EAAE,OAAO,CAAC,gBAAiB;AACjD,MAAM,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE;AAC9B,QAAQC,wB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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,cAAA,GAAAK,sBAAA,CAAA,eAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAA,oBAAA,GAAA,CAAA,GAAA,KAAA;AACA,EAAA,GAAA,CAAA,GAAA,CAAA,OAAA,GAAA,EAAA,IAAA,KAAA;AACA,IAAA,IAAA;AACA,MAAA,MAAA,IAAA,EAAA;AACA,KAAA,CAAA,OAAA,KAAA,EAAA;AACA,MAAAC,qBAAA,CAAA,KAAA,CAAA;AACA,MAAA,MAAA,KAAA;AACA;AACA,GAAA,CAAA;;AAEA,EAAAC,wBAAA,CAAA,GAAA,CAAA,GAAA,EAAA,KAAA,CAAA;AACA;;;;;;"}
|
|
@@ -2,11 +2,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const instrumentationLruMemoizer = require('@opentelemetry/instrumentation-lru-memoizer');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
|
-
const
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
6
6
|
|
|
7
7
|
const INTEGRATION_NAME = 'LruMemoizer';
|
|
8
8
|
|
|
9
|
-
const instrumentLruMemoizer =
|
|
9
|
+
const instrumentLruMemoizer = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationLruMemoizer.LruMemoizerInstrumentation());
|
|
10
10
|
|
|
11
11
|
const _lruMemoizerIntegration = (() => {
|
|
12
12
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lrumemoizer.js","sources":["../../../../src/integrations/tracing/lrumemoizer.ts"],"sourcesContent":["import { LruMemoizerInstrumentation } from '@opentelemetry/instrumentation-lru-memoizer';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '
|
|
1
|
+
{"version":3,"file":"lrumemoizer.js","sources":["../../../../src/integrations/tracing/lrumemoizer.ts"],"sourcesContent":["import { LruMemoizerInstrumentation } from '@opentelemetry/instrumentation-lru-memoizer';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'LruMemoizer';\n\nexport const instrumentLruMemoizer = generateInstrumentOnce(INTEGRATION_NAME, () => new LruMemoizerInstrumentation());\n\nconst _lruMemoizerIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentLruMemoizer();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [lru-memoizer](https://www.npmjs.com/package/lru-memoizer) library.\n *\n * For more information, see the [`lruMemoizerIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/lrumemoizer/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.lruMemoizerIntegration()],\n * });\n */\nexport const lruMemoizerIntegration = defineIntegration(_lruMemoizerIntegration);\n"],"names":["generateInstrumentOnce","LruMemoizerInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,aAAa;;AAEzB,MAAA,qBAAA,GAAwBA,+BAAsB,CAAC,gBAAgB,EAAE,MAAM,IAAIC,qDAA0B,EAAE;;AAEpH,MAAM,uBAAwB,IAAG,MAAM;AACvC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,qBAAqB,EAAE;AAC7B,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,sBAAuB,GAAEC,sBAAiB,CAAC,uBAAuB;;;;;"}
|
|
@@ -2,18 +2,17 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const instrumentationMongodb = require('@opentelemetry/instrumentation-mongodb');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
|
-
const
|
|
6
|
-
const addOriginToSpan = require('../../utils/addOriginToSpan.js');
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
7
6
|
|
|
8
7
|
const INTEGRATION_NAME = 'Mongo';
|
|
9
8
|
|
|
10
|
-
const instrumentMongo =
|
|
9
|
+
const instrumentMongo = nodeCore.generateInstrumentOnce(
|
|
11
10
|
INTEGRATION_NAME,
|
|
12
11
|
() =>
|
|
13
12
|
new instrumentationMongodb.MongoDBInstrumentation({
|
|
14
13
|
dbStatementSerializer: _defaultDbStatementSerializer,
|
|
15
14
|
responseHook(span) {
|
|
16
|
-
|
|
15
|
+
nodeCore.addOriginToSpan(span, 'auto.db.otel.mongo');
|
|
17
16
|
},
|
|
18
17
|
}),
|
|
19
18
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongo.js","sources":["../../../../src/integrations/tracing/mongo.ts"],"sourcesContent":["import { MongoDBInstrumentation } from '@opentelemetry/instrumentation-mongodb';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '
|
|
1
|
+
{"version":3,"file":"mongo.js","sources":["../../../../src/integrations/tracing/mongo.ts"],"sourcesContent":["import { MongoDBInstrumentation } from '@opentelemetry/instrumentation-mongodb';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mongo';\n\nexport const instrumentMongo = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MongoDBInstrumentation({\n dbStatementSerializer: _defaultDbStatementSerializer,\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mongo');\n },\n }),\n);\n\n/**\n * Replaces values in document with '?', hiding PII and helping grouping.\n */\nexport function _defaultDbStatementSerializer(commandObj: Record<string, unknown>): string {\n const resultObj = _scrubStatement(commandObj);\n return JSON.stringify(resultObj);\n}\n\nfunction _scrubStatement(value: unknown): unknown {\n if (Array.isArray(value)) {\n return value.map(element => _scrubStatement(element));\n }\n\n if (isCommandObj(value)) {\n const initial: Record<string, unknown> = {};\n return Object.entries(value)\n .map(([key, element]) => [key, _scrubStatement(element)])\n .reduce((prev, current) => {\n if (isCommandEntry(current)) {\n prev[current[0]] = current[1];\n }\n return prev;\n }, initial);\n }\n\n // A value like string or number, possible contains PII, scrub it\n return '?';\n}\n\nfunction isCommandObj(value: Record<string, unknown> | unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !isBuffer(value);\n}\n\nfunction isBuffer(value: unknown): boolean {\n let isBuffer = false;\n if (typeof Buffer !== 'undefined') {\n isBuffer = Buffer.isBuffer(value);\n }\n return isBuffer;\n}\n\nfunction isCommandEntry(value: [string, unknown] | unknown): value is [string, unknown] {\n return Array.isArray(value);\n}\n\nconst _mongoIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMongo();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mongodb](https://www.npmjs.com/package/mongodb) library.\n *\n * For more information, see the [`mongoIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongo/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mongoIntegration()],\n * });\n * ```\n */\nexport const mongoIntegration = defineIntegration(_mongoIntegration);\n"],"names":["generateInstrumentOnce","MongoDBInstrumentation","addOriginToSpan","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,OAAO;;AAEzB,MAAM,eAAgB,GAAEA,+BAAsB;AACrD,EAAE,gBAA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,CAAC,KAAK,CAAC;AACxE;;AAEA,SAAS,QAAQ,CAAC,KAAK,EAAoB;AAC3C,EAAE,IAAI,QAAS,GAAE,KAAK;AACtB,EAAE,IAAI,OAAO,MAAO,KAAI,WAAW,EAAE;AACrC,IAAI,WAAW,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;AACrC;AACA,EAAE,OAAO,QAAQ;AACjB;;AAEA,SAAS,cAAc,CAAC,KAAK,EAA2D;AACxF,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAC7B;;AAEA,MAAM,iBAAkB,IAAG,MAAM;AACjC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,eAAe,EAAE;AACvB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAEC,sBAAiB,CAAC,iBAAiB;;;;;;"}
|
|
@@ -2,17 +2,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const instrumentationMongoose = require('@opentelemetry/instrumentation-mongoose');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
|
-
const
|
|
6
|
-
const addOriginToSpan = require('../../utils/addOriginToSpan.js');
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
7
6
|
|
|
8
7
|
const INTEGRATION_NAME = 'Mongoose';
|
|
9
8
|
|
|
10
|
-
const instrumentMongoose =
|
|
9
|
+
const instrumentMongoose = nodeCore.generateInstrumentOnce(
|
|
11
10
|
INTEGRATION_NAME,
|
|
12
11
|
() =>
|
|
13
12
|
new instrumentationMongoose.MongooseInstrumentation({
|
|
14
13
|
responseHook(span) {
|
|
15
|
-
|
|
14
|
+
nodeCore.addOriginToSpan(span, 'auto.db.otel.mongoose');
|
|
16
15
|
},
|
|
17
16
|
}),
|
|
18
17
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mongoose.js","sources":["../../../../src/integrations/tracing/mongoose.ts"],"sourcesContent":["import { MongooseInstrumentation } from '@opentelemetry/instrumentation-mongoose';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '
|
|
1
|
+
{"version":3,"file":"mongoose.js","sources":["../../../../src/integrations/tracing/mongoose.ts"],"sourcesContent":["import { MongooseInstrumentation } from '@opentelemetry/instrumentation-mongoose';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mongoose';\n\nexport const instrumentMongoose = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MongooseInstrumentation({\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mongoose');\n },\n }),\n);\n\nconst _mongooseIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMongoose();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mongoose](https://www.npmjs.com/package/mongoose) library.\n *\n * For more information, see the [`mongooseIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongoose/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mongooseIntegration()],\n * });\n * ```\n */\nexport const mongooseIntegration = defineIntegration(_mongooseIntegration);\n"],"names":["generateInstrumentOnce","MongooseInstrumentation","addOriginToSpan","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,UAAU;;AAE5B,MAAM,kBAAmB,GAAEA,+BAAsB;AACxD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAIC,+CAAuB,CAAC;AAChC,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQC,wBAAe,CAAC,IAAI,EAAE,uBAAuB,CAAC;AACtD,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,oBAAqB,IAAG,MAAM;AACpC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,kBAAkB,EAAE;AAC1B,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,mBAAoB,GAAEC,sBAAiB,CAAC,oBAAoB;;;;;"}
|
|
@@ -2,11 +2,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const instrumentationMysql = require('@opentelemetry/instrumentation-mysql');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
|
-
const
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
6
6
|
|
|
7
7
|
const INTEGRATION_NAME = 'Mysql';
|
|
8
8
|
|
|
9
|
-
const instrumentMysql =
|
|
9
|
+
const instrumentMysql = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentationMysql.MySQLInstrumentation({}));
|
|
10
10
|
|
|
11
11
|
const _mysqlIntegration = (() => {
|
|
12
12
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mysql.js","sources":["../../../../src/integrations/tracing/mysql.ts"],"sourcesContent":["import { MySQLInstrumentation } from '@opentelemetry/instrumentation-mysql';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '
|
|
1
|
+
{"version":3,"file":"mysql.js","sources":["../../../../src/integrations/tracing/mysql.ts"],"sourcesContent":["import { MySQLInstrumentation } from '@opentelemetry/instrumentation-mysql';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mysql';\n\nexport const instrumentMysql = generateInstrumentOnce(INTEGRATION_NAME, () => new MySQLInstrumentation({}));\n\nconst _mysqlIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMysql();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mysql](https://www.npmjs.com/package/mysql) library.\n *\n * For more information, see the [`mysqlIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mysqlIntegration()],\n * });\n * ```\n */\nexport const mysqlIntegration = defineIntegration(_mysqlIntegration);\n"],"names":["generateInstrumentOnce","MySQLInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,OAAO;;MAEnB,eAAgB,GAAEA,+BAAsB,CAAC,gBAAgB,EAAE,MAAM,IAAIC,yCAAoB,CAAC,EAAE,CAAC;;AAE1G,MAAM,iBAAkB,IAAG,MAAM;AACjC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,eAAe,EAAE;AACvB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAEC,sBAAiB,CAAC,iBAAiB;;;;;"}
|
|
@@ -2,17 +2,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const instrumentationMysql2 = require('@opentelemetry/instrumentation-mysql2');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
|
-
const
|
|
6
|
-
const addOriginToSpan = require('../../utils/addOriginToSpan.js');
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
7
6
|
|
|
8
7
|
const INTEGRATION_NAME = 'Mysql2';
|
|
9
8
|
|
|
10
|
-
const instrumentMysql2 =
|
|
9
|
+
const instrumentMysql2 = nodeCore.generateInstrumentOnce(
|
|
11
10
|
INTEGRATION_NAME,
|
|
12
11
|
() =>
|
|
13
12
|
new instrumentationMysql2.MySQL2Instrumentation({
|
|
14
13
|
responseHook(span) {
|
|
15
|
-
|
|
14
|
+
nodeCore.addOriginToSpan(span, 'auto.db.otel.mysql2');
|
|
16
15
|
},
|
|
17
16
|
}),
|
|
18
17
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mysql2.js","sources":["../../../../src/integrations/tracing/mysql2.ts"],"sourcesContent":["import { MySQL2Instrumentation } from '@opentelemetry/instrumentation-mysql2';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '
|
|
1
|
+
{"version":3,"file":"mysql2.js","sources":["../../../../src/integrations/tracing/mysql2.ts"],"sourcesContent":["import { MySQL2Instrumentation } from '@opentelemetry/instrumentation-mysql2';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mysql2';\n\nexport const instrumentMysql2 = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MySQL2Instrumentation({\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mysql2');\n },\n }),\n);\n\nconst _mysql2Integration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMysql2();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mysql2](https://www.npmjs.com/package/mysql2) library.\n *\n * For more information, see the [`mysql2Integration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql2/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mysqlIntegration()],\n * });\n * ```\n */\nexport const mysql2Integration = defineIntegration(_mysql2Integration);\n"],"names":["generateInstrumentOnce","MySQL2Instrumentation","addOriginToSpan","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,QAAQ;;AAE1B,MAAM,gBAAiB,GAAEA,+BAAsB;AACtD,EAAE,gBAAgB;AAClB,EAAE;AACF,IAAI,IAAIC,2CAAqB,CAAC;AAC9B,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQC,wBAAe,CAAC,IAAI,EAAE,qBAAqB,CAAC;AACpD,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,kBAAmB,IAAG,MAAM;AAClC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,gBAAgB,EAAE;AACxB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,iBAAkB,GAAEC,sBAAiB,CAAC,kBAAkB;;;;;"}
|
|
@@ -2,18 +2,17 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const instrumentationPg = require('@opentelemetry/instrumentation-pg');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
|
-
const
|
|
6
|
-
const addOriginToSpan = require('../../utils/addOriginToSpan.js');
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
7
6
|
|
|
8
7
|
const INTEGRATION_NAME = 'Postgres';
|
|
9
8
|
|
|
10
|
-
const instrumentPostgres =
|
|
9
|
+
const instrumentPostgres = nodeCore.generateInstrumentOnce(
|
|
11
10
|
INTEGRATION_NAME,
|
|
12
11
|
() =>
|
|
13
12
|
new instrumentationPg.PgInstrumentation({
|
|
14
13
|
requireParentSpan: true,
|
|
15
14
|
requestHook(span) {
|
|
16
|
-
|
|
15
|
+
nodeCore.addOriginToSpan(span, 'auto.db.otel.postgres');
|
|
17
16
|
},
|
|
18
17
|
}),
|
|
19
18
|
);
|