@depup/sentry__node 10.44.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +31 -0
- package/build/cjs/debug-build.js +11 -0
- package/build/cjs/debug-build.js.map +1 -0
- package/build/cjs/index.js +216 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/init.js +10 -0
- package/build/cjs/init.js.map +1 -0
- package/build/cjs/integrations/featureFlagShims/growthbook.js +12 -0
- package/build/cjs/integrations/featureFlagShims/growthbook.js.map +1 -0
- 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 +142 -0
- package/build/cjs/integrations/fs.js.map +1 -0
- package/build/cjs/integrations/http.js +224 -0
- package/build/cjs/integrations/http.js.map +1 -0
- package/build/cjs/integrations/node-fetch.js +108 -0
- package/build/cjs/integrations/node-fetch.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib.js +47 -0
- package/build/cjs/integrations/tracing/amqplib.js.map +1 -0
- package/build/cjs/integrations/tracing/anthropic-ai/index.js +79 -0
- package/build/cjs/integrations/tracing/anthropic-ai/index.js.map +1 -0
- package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js +95 -0
- package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/connect.js +110 -0
- package/build/cjs/integrations/tracing/connect.js.map +1 -0
- package/build/cjs/integrations/tracing/dataloader.js +72 -0
- package/build/cjs/integrations/tracing/dataloader.js.map +1 -0
- package/build/cjs/integrations/tracing/express.js +166 -0
- package/build/cjs/integrations/tracing/express.js.map +1 -0
- package/build/cjs/integrations/tracing/fastify/index.js +270 -0
- package/build/cjs/integrations/tracing/fastify/index.js.map +1 -0
- package/build/cjs/integrations/tracing/fastify/v3/constants.js +23 -0
- package/build/cjs/integrations/tracing/fastify/v3/constants.js.map +1 -0
- package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js +37 -0
- package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -0
- package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +304 -0
- package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/fastify/v3/utils.js +135 -0
- package/build/cjs/integrations/tracing/fastify/v3/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/firebase/firebase.js +50 -0
- package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -0
- package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +44 -0
- package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +297 -0
- package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -0
- package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js +265 -0
- package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +1 -0
- package/build/cjs/integrations/tracing/genericPool.js +59 -0
- package/build/cjs/integrations/tracing/genericPool.js.map +1 -0
- package/build/cjs/integrations/tracing/google-genai/index.js +78 -0
- package/build/cjs/integrations/tracing/google-genai/index.js.map +1 -0
- package/build/cjs/integrations/tracing/google-genai/instrumentation.js +88 -0
- package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/graphql.js +127 -0
- package/build/cjs/integrations/tracing/graphql.js.map +1 -0
- package/build/cjs/integrations/tracing/hapi/index.js +135 -0
- package/build/cjs/integrations/tracing/hapi/index.js.map +1 -0
- package/build/cjs/integrations/tracing/hono/constants.js +15 -0
- package/build/cjs/integrations/tracing/hono/constants.js.map +1 -0
- package/build/cjs/integrations/tracing/hono/index.js +137 -0
- package/build/cjs/integrations/tracing/hono/index.js.map +1 -0
- package/build/cjs/integrations/tracing/hono/instrumentation.js +236 -0
- package/build/cjs/integrations/tracing/hono/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/index.js +110 -0
- package/build/cjs/integrations/tracing/index.js.map +1 -0
- package/build/cjs/integrations/tracing/kafka.js +48 -0
- package/build/cjs/integrations/tracing/kafka.js.map +1 -0
- package/build/cjs/integrations/tracing/knex.js +57 -0
- package/build/cjs/integrations/tracing/knex.js.map +1 -0
- package/build/cjs/integrations/tracing/koa.js +138 -0
- package/build/cjs/integrations/tracing/koa.js.map +1 -0
- package/build/cjs/integrations/tracing/langchain/index.js +116 -0
- package/build/cjs/integrations/tracing/langchain/index.js.map +1 -0
- package/build/cjs/integrations/tracing/langchain/instrumentation.js +220 -0
- package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/langgraph/index.js +93 -0
- package/build/cjs/integrations/tracing/langgraph/index.js.map +1 -0
- package/build/cjs/integrations/tracing/langgraph/instrumentation.js +60 -0
- package/build/cjs/integrations/tracing/langgraph/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/lrumemoizer.js +37 -0
- package/build/cjs/integrations/tracing/lrumemoizer.js.map +1 -0
- package/build/cjs/integrations/tracing/mongo.js +93 -0
- package/build/cjs/integrations/tracing/mongo.js.map +1 -0
- package/build/cjs/integrations/tracing/mongoose.js +46 -0
- package/build/cjs/integrations/tracing/mongoose.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql.js +38 -0
- package/build/cjs/integrations/tracing/mysql.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql2.js +46 -0
- package/build/cjs/integrations/tracing/mysql2.js.map +1 -0
- package/build/cjs/integrations/tracing/openai/index.js +78 -0
- package/build/cjs/integrations/tracing/openai/index.js.map +1 -0
- package/build/cjs/integrations/tracing/openai/instrumentation.js +104 -0
- package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/postgres.js +48 -0
- package/build/cjs/integrations/tracing/postgres.js.map +1 -0
- package/build/cjs/integrations/tracing/postgresjs.js +378 -0
- package/build/cjs/integrations/tracing/postgresjs.js.map +1 -0
- package/build/cjs/integrations/tracing/prisma.js +203 -0
- package/build/cjs/integrations/tracing/prisma.js.map +1 -0
- package/build/cjs/integrations/tracing/redis.js +121 -0
- package/build/cjs/integrations/tracing/redis.js.map +1 -0
- package/build/cjs/integrations/tracing/tedious.js +67 -0
- package/build/cjs/integrations/tracing/tedious.js.map +1 -0
- package/build/cjs/integrations/tracing/vercelai/constants.js +6 -0
- package/build/cjs/integrations/tracing/vercelai/constants.js.map +1 -0
- package/build/cjs/integrations/tracing/vercelai/index.js +82 -0
- package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -0
- package/build/cjs/integrations/tracing/vercelai/instrumentation.js +274 -0
- package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +1 -0
- package/build/cjs/preload.js +21 -0
- package/build/cjs/preload.js.map +1 -0
- package/build/cjs/sdk/index.js +78 -0
- package/build/cjs/sdk/index.js.map +1 -0
- package/build/cjs/sdk/initOtel.js +126 -0
- package/build/cjs/sdk/initOtel.js.map +1 -0
- package/build/cjs/utils/redisCache.js +122 -0
- package/build/cjs/utils/redisCache.js.map +1 -0
- package/build/esm/debug-build.js +9 -0
- package/build/esm/debug-build.js.map +1 -0
- package/build/esm/index.js +44 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/init.js +10 -0
- package/build/esm/init.js.map +1 -0
- package/build/esm/integrations/featureFlagShims/growthbook.js +10 -0
- package/build/esm/integrations/featureFlagShims/growthbook.js.map +1 -0
- 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 +140 -0
- package/build/esm/integrations/fs.js.map +1 -0
- package/build/esm/integrations/http.js +219 -0
- package/build/esm/integrations/http.js.map +1 -0
- package/build/esm/integrations/node-fetch.js +105 -0
- package/build/esm/integrations/node-fetch.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib.js +44 -0
- package/build/esm/integrations/tracing/amqplib.js.map +1 -0
- package/build/esm/integrations/tracing/anthropic-ai/index.js +76 -0
- package/build/esm/integrations/tracing/anthropic-ai/index.js.map +1 -0
- package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js +93 -0
- package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/connect.js +106 -0
- package/build/esm/integrations/tracing/connect.js.map +1 -0
- package/build/esm/integrations/tracing/dataloader.js +69 -0
- package/build/esm/integrations/tracing/dataloader.js.map +1 -0
- package/build/esm/integrations/tracing/express.js +161 -0
- package/build/esm/integrations/tracing/express.js.map +1 -0
- package/build/esm/integrations/tracing/fastify/index.js +265 -0
- package/build/esm/integrations/tracing/fastify/index.js.map +1 -0
- package/build/esm/integrations/tracing/fastify/v3/constants.js +21 -0
- package/build/esm/integrations/tracing/fastify/v3/constants.js.map +1 -0
- package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js +37 -0
- package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -0
- package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +302 -0
- package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/fastify/v3/utils.js +131 -0
- package/build/esm/integrations/tracing/fastify/v3/utils.js.map +1 -0
- package/build/esm/integrations/tracing/firebase/firebase.js +47 -0
- package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -0
- package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +42 -0
- package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +294 -0
- package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -0
- package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +262 -0
- package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +1 -0
- package/build/esm/integrations/tracing/genericPool.js +56 -0
- package/build/esm/integrations/tracing/genericPool.js.map +1 -0
- package/build/esm/integrations/tracing/google-genai/index.js +75 -0
- package/build/esm/integrations/tracing/google-genai/index.js.map +1 -0
- package/build/esm/integrations/tracing/google-genai/instrumentation.js +86 -0
- package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/graphql.js +124 -0
- package/build/esm/integrations/tracing/graphql.js.map +1 -0
- package/build/esm/integrations/tracing/hapi/index.js +130 -0
- package/build/esm/integrations/tracing/hapi/index.js.map +1 -0
- package/build/esm/integrations/tracing/hono/constants.js +12 -0
- package/build/esm/integrations/tracing/hono/constants.js.map +1 -0
- package/build/esm/integrations/tracing/hono/index.js +133 -0
- package/build/esm/integrations/tracing/hono/index.js.map +1 -0
- package/build/esm/integrations/tracing/hono/instrumentation.js +234 -0
- package/build/esm/integrations/tracing/hono/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/index.js +107 -0
- package/build/esm/integrations/tracing/index.js.map +1 -0
- package/build/esm/integrations/tracing/kafka.js +45 -0
- package/build/esm/integrations/tracing/kafka.js.map +1 -0
- package/build/esm/integrations/tracing/knex.js +54 -0
- package/build/esm/integrations/tracing/knex.js.map +1 -0
- package/build/esm/integrations/tracing/koa.js +134 -0
- package/build/esm/integrations/tracing/koa.js.map +1 -0
- package/build/esm/integrations/tracing/langchain/index.js +113 -0
- package/build/esm/integrations/tracing/langchain/index.js.map +1 -0
- package/build/esm/integrations/tracing/langchain/instrumentation.js +218 -0
- package/build/esm/integrations/tracing/langchain/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/langgraph/index.js +90 -0
- package/build/esm/integrations/tracing/langgraph/index.js.map +1 -0
- package/build/esm/integrations/tracing/langgraph/instrumentation.js +58 -0
- package/build/esm/integrations/tracing/langgraph/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/lrumemoizer.js +34 -0
- package/build/esm/integrations/tracing/lrumemoizer.js.map +1 -0
- package/build/esm/integrations/tracing/mongo.js +89 -0
- package/build/esm/integrations/tracing/mongo.js.map +1 -0
- package/build/esm/integrations/tracing/mongoose.js +43 -0
- package/build/esm/integrations/tracing/mongoose.js.map +1 -0
- package/build/esm/integrations/tracing/mysql.js +35 -0
- package/build/esm/integrations/tracing/mysql.js.map +1 -0
- package/build/esm/integrations/tracing/mysql2.js +43 -0
- package/build/esm/integrations/tracing/mysql2.js.map +1 -0
- package/build/esm/integrations/tracing/openai/index.js +75 -0
- package/build/esm/integrations/tracing/openai/index.js.map +1 -0
- package/build/esm/integrations/tracing/openai/instrumentation.js +102 -0
- package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/postgres.js +45 -0
- package/build/esm/integrations/tracing/postgres.js.map +1 -0
- package/build/esm/integrations/tracing/postgresjs.js +374 -0
- package/build/esm/integrations/tracing/postgresjs.js.map +1 -0
- package/build/esm/integrations/tracing/prisma.js +200 -0
- package/build/esm/integrations/tracing/prisma.js.map +1 -0
- package/build/esm/integrations/tracing/redis.js +117 -0
- package/build/esm/integrations/tracing/redis.js.map +1 -0
- package/build/esm/integrations/tracing/tedious.js +64 -0
- package/build/esm/integrations/tracing/tedious.js.map +1 -0
- package/build/esm/integrations/tracing/vercelai/constants.js +4 -0
- package/build/esm/integrations/tracing/vercelai/constants.js.map +1 -0
- package/build/esm/integrations/tracing/vercelai/index.js +79 -0
- package/build/esm/integrations/tracing/vercelai/index.js.map +1 -0
- package/build/esm/integrations/tracing/vercelai/instrumentation.js +269 -0
- package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +1 -0
- package/build/esm/package.json +1 -0
- package/build/esm/preload.js +21 -0
- package/build/esm/preload.js.map +1 -0
- package/build/esm/sdk/index.js +73 -0
- package/build/esm/sdk/index.js.map +1 -0
- package/build/esm/sdk/initOtel.js +121 -0
- package/build/esm/sdk/initOtel.js.map +1 -0
- package/build/esm/utils/redisCache.js +114 -0
- package/build/esm/utils/redisCache.js.map +1 -0
- package/build/import-hook.mjs +5 -0
- package/build/loader-hook.mjs +1 -0
- package/build/types/debug-build.d.ts +7 -0
- package/build/types/debug-build.d.ts.map +1 -0
- package/build/types/index.d.ts +42 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/init.d.ts +2 -0
- package/build/types/init.d.ts.map +1 -0
- package/build/types/integrations/featureFlagShims/growthbook.d.ts +6 -0
- package/build/types/integrations/featureFlagShims/growthbook.d.ts.map +1 -0
- package/build/types/integrations/featureFlagShims/index.d.ts +6 -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/fs.d.ts +24 -0
- package/build/types/integrations/fs.d.ts.map +1 -0
- package/build/types/integrations/http.d.ts +136 -0
- package/build/types/integrations/http.d.ts.map +1 -0
- package/build/types/integrations/node-fetch.d.ts +36 -0
- package/build/types/integrations/node-fetch.d.ts.map +1 -0
- package/build/types/integrations/tracing/amqplib.d.ts +20 -0
- package/build/types/integrations/tracing/amqplib.d.ts.map +1 -0
- package/build/types/integrations/tracing/anthropic-ai/index.d.ts +59 -0
- package/build/types/integrations/tracing/anthropic-ai/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/anthropic-ai/instrumentation.d.ts +19 -0
- package/build/types/integrations/tracing/anthropic-ai/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/connect.d.ts +46 -0
- package/build/types/integrations/tracing/connect.d.ts.map +1 -0
- package/build/types/integrations/tracing/dataloader.d.ts +20 -0
- package/build/types/integrations/tracing/dataloader.d.ts.map +1 -0
- package/build/types/integrations/tracing/express.d.ts +72 -0
- package/build/types/integrations/tracing/express.d.ts.map +1 -0
- package/build/types/integrations/tracing/fastify/index.d.ts +119 -0
- package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/fastify/types.d.ts +33 -0
- package/build/types/integrations/tracing/fastify/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/fastify/v3/constants.d.ts +3 -0
- package/build/types/integrations/tracing/fastify/v3/constants.d.ts.map +1 -0
- package/build/types/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts +15 -0
- package/build/types/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts.map +1 -0
- package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts +16 -0
- package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/fastify/v3/internal-types.d.ts +7 -0
- package/build/types/integrations/tracing/fastify/v3/internal-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/fastify/v3/types.d.ts +21 -0
- package/build/types/integrations/tracing/fastify/v3/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/fastify/v3/utils.d.ts +28 -0
- package/build/types/integrations/tracing/fastify/v3/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/firebase/firebase.d.ts +6 -0
- package/build/types/integrations/tracing/firebase/firebase.d.ts.map +1 -0
- package/build/types/integrations/tracing/firebase/index.d.ts +2 -0
- package/build/types/integrations/tracing/firebase/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +19 -0
- package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/firebase/otel/index.d.ts +3 -0
- package/build/types/integrations/tracing/firebase/otel/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts +25 -0
- package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts.map +1 -0
- package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts +23 -0
- package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts.map +1 -0
- package/build/types/integrations/tracing/firebase/otel/types.d.ts +120 -0
- package/build/types/integrations/tracing/firebase/otel/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/genericPool.d.ts +20 -0
- package/build/types/integrations/tracing/genericPool.d.ts.map +1 -0
- package/build/types/integrations/tracing/google-genai/index.d.ts +59 -0
- package/build/types/integrations/tracing/google-genai/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/google-genai/instrumentation.d.ts +20 -0
- package/build/types/integrations/tracing/google-genai/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/graphql.d.ts +48 -0
- package/build/types/integrations/tracing/graphql.d.ts.map +1 -0
- package/build/types/integrations/tracing/hapi/index.d.ts +50 -0
- package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/hapi/types.d.ts +166 -0
- package/build/types/integrations/tracing/hapi/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/hono/constants.d.ts +11 -0
- package/build/types/integrations/tracing/hono/constants.d.ts.map +1 -0
- package/build/types/integrations/tracing/hono/index.d.ts +52 -0
- package/build/types/integrations/tracing/hono/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/hono/instrumentation.d.ts +55 -0
- package/build/types/integrations/tracing/hono/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/hono/types.d.ts +36 -0
- package/build/types/integrations/tracing/hono/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/index.d.ts +12 -0
- package/build/types/integrations/tracing/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/kafka.d.ts +19 -0
- package/build/types/integrations/tracing/kafka.d.ts.map +1 -0
- package/build/types/integrations/tracing/knex.d.ts +20 -0
- package/build/types/integrations/tracing/knex.d.ts.map +1 -0
- package/build/types/integrations/tracing/koa.d.ts +70 -0
- package/build/types/integrations/tracing/koa.d.ts.map +1 -0
- package/build/types/integrations/tracing/langchain/index.d.ts +97 -0
- package/build/types/integrations/tracing/langchain/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/langchain/instrumentation.d.ts +29 -0
- package/build/types/integrations/tracing/langchain/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/langgraph/index.d.ts +74 -0
- package/build/types/integrations/tracing/langgraph/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/langgraph/instrumentation.d.ts +19 -0
- package/build/types/integrations/tracing/langgraph/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/lrumemoizer.d.ts +19 -0
- package/build/types/integrations/tracing/lrumemoizer.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongo.d.ts +24 -0
- package/build/types/integrations/tracing/mongo.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongoose.d.ts +20 -0
- package/build/types/integrations/tracing/mongoose.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql.d.ts +20 -0
- package/build/types/integrations/tracing/mysql.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql2.d.ts +20 -0
- package/build/types/integrations/tracing/mysql2.d.ts.map +1 -0
- package/build/types/integrations/tracing/openai/index.d.ts +59 -0
- package/build/types/integrations/tracing/openai/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/openai/instrumentation.d.ts +26 -0
- package/build/types/integrations/tracing/openai/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres.d.ts +24 -0
- package/build/types/integrations/tracing/postgres.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgresjs.d.ts +101 -0
- package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -0
- package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +38 -0
- package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts.map +1 -0
- package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +31 -0
- package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts.map +1 -0
- package/build/types/integrations/tracing/prisma.d.ts +50 -0
- package/build/types/integrations/tracing/prisma.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis.d.ts +41 -0
- package/build/types/integrations/tracing/redis.d.ts.map +1 -0
- package/build/types/integrations/tracing/tedious.d.ts +20 -0
- package/build/types/integrations/tracing/tedious.d.ts.map +1 -0
- package/build/types/integrations/tracing/vercelai/constants.d.ts +2 -0
- package/build/types/integrations/tracing/vercelai/constants.d.ts.map +1 -0
- package/build/types/integrations/tracing/vercelai/index.d.ts +43 -0
- package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/vercelai/instrumentation.d.ts +56 -0
- package/build/types/integrations/tracing/vercelai/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/vercelai/types.d.ts +59 -0
- package/build/types/integrations/tracing/vercelai/types.d.ts.map +1 -0
- package/build/types/preload.d.ts +2 -0
- package/build/types/preload.d.ts.map +1 -0
- package/build/types/sdk/index.d.ts +18 -0
- package/build/types/sdk/index.d.ts.map +1 -0
- package/build/types/sdk/initOtel.d.ts +28 -0
- package/build/types/sdk/initOtel.d.ts.map +1 -0
- package/build/types/types.d.ts +89 -0
- package/build/types/types.d.ts.map +1 -0
- package/build/types/utils/redisCache.d.ts +16 -0
- package/build/types/utils/redisCache.d.ts.map +1 -0
- package/build/types-ts3.8/debug-build.d.ts +7 -0
- package/build/types-ts3.8/index.d.ts +42 -0
- package/build/types-ts3.8/init.d.ts +2 -0
- package/build/types-ts3.8/integrations/featureFlagShims/growthbook.d.ts +6 -0
- package/build/types-ts3.8/integrations/featureFlagShims/index.d.ts +6 -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/fs.d.ts +24 -0
- package/build/types-ts3.8/integrations/http.d.ts +139 -0
- package/build/types-ts3.8/integrations/node-fetch.d.ts +36 -0
- package/build/types-ts3.8/integrations/tracing/amqplib.d.ts +20 -0
- package/build/types-ts3.8/integrations/tracing/anthropic-ai/index.d.ts +59 -0
- package/build/types-ts3.8/integrations/tracing/anthropic-ai/instrumentation.d.ts +19 -0
- package/build/types-ts3.8/integrations/tracing/connect.d.ts +46 -0
- package/build/types-ts3.8/integrations/tracing/dataloader.d.ts +20 -0
- package/build/types-ts3.8/integrations/tracing/express.d.ts +72 -0
- package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +119 -0
- package/build/types-ts3.8/integrations/tracing/fastify/types.d.ts +33 -0
- package/build/types-ts3.8/integrations/tracing/fastify/v3/constants.d.ts +3 -0
- package/build/types-ts3.8/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing/fastify/v3/instrumentation.d.ts +16 -0
- package/build/types-ts3.8/integrations/tracing/fastify/v3/internal-types.d.ts +7 -0
- package/build/types-ts3.8/integrations/tracing/fastify/v3/types.d.ts +21 -0
- package/build/types-ts3.8/integrations/tracing/fastify/v3/utils.d.ts +28 -0
- package/build/types-ts3.8/integrations/tracing/firebase/firebase.d.ts +6 -0
- package/build/types-ts3.8/integrations/tracing/firebase/index.d.ts +2 -0
- package/build/types-ts3.8/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +19 -0
- package/build/types-ts3.8/integrations/tracing/firebase/otel/index.d.ts +3 -0
- package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/firestore.d.ts +25 -0
- package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/functions.d.ts +23 -0
- package/build/types-ts3.8/integrations/tracing/firebase/otel/types.d.ts +120 -0
- package/build/types-ts3.8/integrations/tracing/genericPool.d.ts +20 -0
- package/build/types-ts3.8/integrations/tracing/google-genai/index.d.ts +59 -0
- package/build/types-ts3.8/integrations/tracing/google-genai/instrumentation.d.ts +20 -0
- package/build/types-ts3.8/integrations/tracing/graphql.d.ts +48 -0
- package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +50 -0
- package/build/types-ts3.8/integrations/tracing/hapi/types.d.ts +166 -0
- package/build/types-ts3.8/integrations/tracing/hono/constants.d.ts +11 -0
- package/build/types-ts3.8/integrations/tracing/hono/index.d.ts +52 -0
- package/build/types-ts3.8/integrations/tracing/hono/instrumentation.d.ts +55 -0
- package/build/types-ts3.8/integrations/tracing/hono/types.d.ts +36 -0
- package/build/types-ts3.8/integrations/tracing/index.d.ts +12 -0
- package/build/types-ts3.8/integrations/tracing/kafka.d.ts +19 -0
- package/build/types-ts3.8/integrations/tracing/knex.d.ts +20 -0
- package/build/types-ts3.8/integrations/tracing/koa.d.ts +70 -0
- package/build/types-ts3.8/integrations/tracing/langchain/index.d.ts +97 -0
- package/build/types-ts3.8/integrations/tracing/langchain/instrumentation.d.ts +29 -0
- package/build/types-ts3.8/integrations/tracing/langgraph/index.d.ts +74 -0
- package/build/types-ts3.8/integrations/tracing/langgraph/instrumentation.d.ts +19 -0
- package/build/types-ts3.8/integrations/tracing/lrumemoizer.d.ts +19 -0
- package/build/types-ts3.8/integrations/tracing/mongo.d.ts +24 -0
- package/build/types-ts3.8/integrations/tracing/mongoose.d.ts +20 -0
- package/build/types-ts3.8/integrations/tracing/mysql.d.ts +20 -0
- package/build/types-ts3.8/integrations/tracing/mysql2.d.ts +20 -0
- package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +59 -0
- package/build/types-ts3.8/integrations/tracing/openai/instrumentation.d.ts +26 -0
- package/build/types-ts3.8/integrations/tracing/postgres.d.ts +24 -0
- package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +101 -0
- package/build/types-ts3.8/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +44 -0
- package/build/types-ts3.8/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +34 -0
- package/build/types-ts3.8/integrations/tracing/prisma.d.ts +50 -0
- package/build/types-ts3.8/integrations/tracing/redis.d.ts +41 -0
- package/build/types-ts3.8/integrations/tracing/tedious.d.ts +20 -0
- package/build/types-ts3.8/integrations/tracing/vercelai/constants.d.ts +2 -0
- package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +43 -0
- package/build/types-ts3.8/integrations/tracing/vercelai/instrumentation.d.ts +56 -0
- package/build/types-ts3.8/integrations/tracing/vercelai/types.d.ts +59 -0
- package/build/types-ts3.8/preload.d.ts +2 -0
- package/build/types-ts3.8/sdk/index.d.ts +18 -0
- package/build/types-ts3.8/sdk/initOtel.d.ts +31 -0
- package/build/types-ts3.8/types.d.ts +89 -0
- package/build/types-ts3.8/utils/redisCache.d.ts +16 -0
- package/changes.json +10 -0
- package/package.json +150 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const semanticConventions = require('@opentelemetry/semantic-conventions');
|
|
4
|
+
const core = require('@sentry/core');
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
6
|
+
const debugBuild = require('../../../debug-build.js');
|
|
7
|
+
const constants = require('./constants.js');
|
|
8
|
+
const instrumentation = require('./instrumentation.js');
|
|
9
|
+
|
|
10
|
+
const INTEGRATION_NAME = 'Hono';
|
|
11
|
+
|
|
12
|
+
function addHonoSpanAttributes(span) {
|
|
13
|
+
const attributes = core.spanToJSON(span).data;
|
|
14
|
+
const type = attributes[constants.AttributeNames.HONO_TYPE];
|
|
15
|
+
if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
span.setAttributes({
|
|
20
|
+
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.hono',
|
|
21
|
+
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.hono`,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const name = attributes[constants.AttributeNames.HONO_NAME];
|
|
25
|
+
if (typeof name === 'string') {
|
|
26
|
+
span.updateName(name);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (core.getIsolationScope() === core.getDefaultIsolationScope()) {
|
|
30
|
+
debugBuild.DEBUG_BUILD && core.debug.warn('Isolation scope is default isolation scope - skipping setting transactionName');
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const route = attributes[semanticConventions.ATTR_HTTP_ROUTE];
|
|
35
|
+
const method = attributes[semanticConventions.ATTR_HTTP_REQUEST_METHOD];
|
|
36
|
+
if (typeof route === 'string' && typeof method === 'string') {
|
|
37
|
+
core.getIsolationScope().setTransactionName(`${method} ${route}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const instrumentHono = nodeCore.generateInstrumentOnce(
|
|
42
|
+
INTEGRATION_NAME,
|
|
43
|
+
() =>
|
|
44
|
+
new instrumentation.HonoInstrumentation({
|
|
45
|
+
responseHook: span => {
|
|
46
|
+
addHonoSpanAttributes(span);
|
|
47
|
+
},
|
|
48
|
+
}),
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const _honoIntegration = (() => {
|
|
52
|
+
return {
|
|
53
|
+
name: INTEGRATION_NAME,
|
|
54
|
+
setupOnce() {
|
|
55
|
+
instrumentHono();
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}) ;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Adds Sentry tracing instrumentation for [Hono](https://hono.dev/).
|
|
62
|
+
*
|
|
63
|
+
* If you also want to capture errors, you need to call `setupHonoErrorHandler(app)` after you set up your Hono server.
|
|
64
|
+
*
|
|
65
|
+
* For more information, see the [hono documentation](https://docs.sentry.io/platforms/javascript/guides/hono/).
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```javascript
|
|
69
|
+
* const Sentry = require('@sentry/node');
|
|
70
|
+
*
|
|
71
|
+
* Sentry.init({
|
|
72
|
+
* integrations: [Sentry.honoIntegration()],
|
|
73
|
+
* })
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
const honoIntegration = core.defineIntegration(_honoIntegration);
|
|
77
|
+
|
|
78
|
+
function honoRequestHandler() {
|
|
79
|
+
return async function sentryRequestMiddleware(context, next) {
|
|
80
|
+
const normalizedRequest = core.httpRequestToRequestData(context.req);
|
|
81
|
+
core.getIsolationScope().setSDKProcessingMetadata({ normalizedRequest });
|
|
82
|
+
await next();
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function defaultShouldHandleError(context) {
|
|
87
|
+
const statusCode = context.res.status;
|
|
88
|
+
return statusCode >= 500;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function honoErrorHandler(options) {
|
|
92
|
+
return async function sentryErrorMiddleware(context, next) {
|
|
93
|
+
await next();
|
|
94
|
+
|
|
95
|
+
const shouldHandleError = options?.shouldHandleError || defaultShouldHandleError;
|
|
96
|
+
if (shouldHandleError(context)) {
|
|
97
|
+
(context.res ).sentry = core.captureException(context.error, {
|
|
98
|
+
mechanism: {
|
|
99
|
+
type: 'auto.middleware.hono',
|
|
100
|
+
handled: false,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Add a Hono error handler to capture errors to Sentry.
|
|
109
|
+
*
|
|
110
|
+
* @param app The Hono instances
|
|
111
|
+
* @param options Configuration options for the handler
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```javascript
|
|
115
|
+
* const Sentry = require('@sentry/node');
|
|
116
|
+
* const { Hono } = require("hono");
|
|
117
|
+
*
|
|
118
|
+
* const app = new Hono();
|
|
119
|
+
*
|
|
120
|
+
* Sentry.setupHonoErrorHandler(app);
|
|
121
|
+
*
|
|
122
|
+
* // Add your routes, etc.
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
function setupHonoErrorHandler(
|
|
126
|
+
app,
|
|
127
|
+
options,
|
|
128
|
+
) {
|
|
129
|
+
app.use(honoRequestHandler());
|
|
130
|
+
app.use(honoErrorHandler(options));
|
|
131
|
+
nodeCore.ensureIsWrapped(app.use, 'hono');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
exports.honoIntegration = honoIntegration;
|
|
135
|
+
exports.instrumentHono = instrumentHono;
|
|
136
|
+
exports.setupHonoErrorHandler = setupHonoErrorHandler;
|
|
137
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/hono/index.ts"],"sourcesContent":["import { ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport {\n captureException,\n debug,\n defineIntegration,\n getDefaultIsolationScope,\n getIsolationScope,\n httpRequestToRequestData,\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 { AttributeNames } from './constants';\nimport { HonoInstrumentation } from './instrumentation';\nimport type { Context, MiddlewareHandler, MiddlewareHandlerInterface, Next } from './types';\n\nconst INTEGRATION_NAME = 'Hono';\n\nfunction addHonoSpanAttributes(span: Span): void {\n const attributes = spanToJSON(span).data;\n const type = attributes[AttributeNames.HONO_TYPE];\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {\n return;\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.hono',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.hono`,\n });\n\n const name = attributes[AttributeNames.HONO_NAME];\n if (typeof name === 'string') {\n span.updateName(name);\n }\n\n if (getIsolationScope() === getDefaultIsolationScope()) {\n DEBUG_BUILD && debug.warn('Isolation scope is default isolation scope - skipping setting transactionName');\n return;\n }\n\n const route = attributes[ATTR_HTTP_ROUTE];\n const method = attributes[ATTR_HTTP_REQUEST_METHOD];\n if (typeof route === 'string' && typeof method === 'string') {\n getIsolationScope().setTransactionName(`${method} ${route}`);\n }\n}\n\nexport const instrumentHono = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new HonoInstrumentation({\n responseHook: span => {\n addHonoSpanAttributes(span);\n },\n }),\n);\n\nconst _honoIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentHono();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Hono](https://hono.dev/).\n *\n * If you also want to capture errors, you need to call `setupHonoErrorHandler(app)` after you set up your Hono server.\n *\n * For more information, see the [hono documentation](https://docs.sentry.io/platforms/javascript/guides/hono/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.honoIntegration()],\n * })\n * ```\n */\nexport const honoIntegration = defineIntegration(_honoIntegration);\n\ninterface HonoHandlerOptions {\n /**\n * Callback method deciding whether error should be captured and sent to Sentry\n * @param error Captured Hono error\n */\n shouldHandleError: (context: Context) => boolean;\n}\n\nfunction honoRequestHandler(): MiddlewareHandler {\n return async function sentryRequestMiddleware(context: Context, next: Next): Promise<void> {\n const normalizedRequest = httpRequestToRequestData(context.req);\n getIsolationScope().setSDKProcessingMetadata({ normalizedRequest });\n await next();\n };\n}\n\nfunction defaultShouldHandleError(context: Context): boolean {\n const statusCode = context.res.status;\n return statusCode >= 500;\n}\n\nfunction honoErrorHandler(options?: Partial<HonoHandlerOptions>): MiddlewareHandler {\n return async function sentryErrorMiddleware(context: Context, next: Next): Promise<void> {\n await next();\n\n const shouldHandleError = options?.shouldHandleError || defaultShouldHandleError;\n if (shouldHandleError(context)) {\n (context.res as { sentry?: string }).sentry = captureException(context.error, {\n mechanism: {\n type: 'auto.middleware.hono',\n handled: false,\n },\n });\n }\n };\n}\n\n/**\n * Add a Hono error handler to capture errors to Sentry.\n *\n * @param app The Hono instances\n * @param options Configuration options for the handler\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const { Hono } = require(\"hono\");\n *\n * const app = new Hono();\n *\n * Sentry.setupHonoErrorHandler(app);\n *\n * // Add your routes, etc.\n * ```\n */\nexport function setupHonoErrorHandler(\n app: { use: MiddlewareHandlerInterface },\n options?: Partial<HonoHandlerOptions>,\n): void {\n app.use(honoRequestHandler());\n app.use(honoErrorHandler(options));\n ensureIsWrapped(app.use, 'hono');\n}\n"],"names":["spanToJSON","AttributeNames","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","getIsolationScope","getDefaultIsolationScope","DEBUG_BUILD","debug","ATTR_HTTP_ROUTE","ATTR_HTTP_REQUEST_METHOD","generateInstrumentOnce","HonoInstrumentation","defineIntegration","httpRequestToRequestData","captureException","ensureIsWrapped"],"mappings":";;;;;;;;;AAmBA,MAAM,g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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,qBAAA;AACA,EAAA,GAAA;AACA,EAAA,OAAA;AACA,EAAA;AACA,EAAA,GAAA,CAAA,GAAA,CAAA,kBAAA,EAAA,CAAA;AACA,EAAA,GAAA,CAAA,GAAA,CAAA,gBAAA,CAAA,OAAA,CAAA,CAAA;AACA,EAAAC,wBAAA,CAAA,GAAA,CAAA,GAAA,EAAA,MAAA,CAAA;AACA;;;;;;"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const api = require('@opentelemetry/api');
|
|
4
|
+
const instrumentation = require('@opentelemetry/instrumentation');
|
|
5
|
+
const core = require('@sentry/core');
|
|
6
|
+
const constants = require('./constants.js');
|
|
7
|
+
|
|
8
|
+
const PACKAGE_NAME = '@sentry/instrumentation-hono';
|
|
9
|
+
const PACKAGE_VERSION = '0.0.1';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Hono instrumentation for OpenTelemetry
|
|
13
|
+
*/
|
|
14
|
+
class HonoInstrumentation extends instrumentation.InstrumentationBase {
|
|
15
|
+
constructor(config = {}) {
|
|
16
|
+
super(PACKAGE_NAME, PACKAGE_VERSION, config);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Initialize the instrumentation.
|
|
21
|
+
*/
|
|
22
|
+
init() {
|
|
23
|
+
return [
|
|
24
|
+
new instrumentation.InstrumentationNodeModuleDefinition('hono', ['>=4.0.0 <5'], moduleExports => this._patch(moduleExports)),
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Patches the module exports to instrument Hono.
|
|
30
|
+
*/
|
|
31
|
+
_patch(moduleExports) {
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
33
|
+
const instrumentation = this;
|
|
34
|
+
|
|
35
|
+
class WrappedHono extends moduleExports.Hono {
|
|
36
|
+
constructor(...args) {
|
|
37
|
+
super(...args);
|
|
38
|
+
|
|
39
|
+
instrumentation._wrap(this, 'get', instrumentation._patchHandler());
|
|
40
|
+
instrumentation._wrap(this, 'post', instrumentation._patchHandler());
|
|
41
|
+
instrumentation._wrap(this, 'put', instrumentation._patchHandler());
|
|
42
|
+
instrumentation._wrap(this, 'delete', instrumentation._patchHandler());
|
|
43
|
+
instrumentation._wrap(this, 'options', instrumentation._patchHandler());
|
|
44
|
+
instrumentation._wrap(this, 'patch', instrumentation._patchHandler());
|
|
45
|
+
instrumentation._wrap(this, 'all', instrumentation._patchHandler());
|
|
46
|
+
instrumentation._wrap(this, 'on', instrumentation._patchOnHandler());
|
|
47
|
+
instrumentation._wrap(this, 'use', instrumentation._patchMiddlewareHandler());
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
moduleExports.Hono = WrappedHono;
|
|
53
|
+
} catch {
|
|
54
|
+
// This is a workaround for environments where direct assignment is not allowed.
|
|
55
|
+
return { ...moduleExports, Hono: WrappedHono };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return moduleExports;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Patches the route handler to instrument it.
|
|
63
|
+
*/
|
|
64
|
+
_patchHandler() {
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
66
|
+
const instrumentation = this;
|
|
67
|
+
|
|
68
|
+
return function (original) {
|
|
69
|
+
return function wrappedHandler( ...args) {
|
|
70
|
+
if (typeof args[0] === 'string') {
|
|
71
|
+
const path = args[0];
|
|
72
|
+
if (args.length === 1) {
|
|
73
|
+
return original.apply(this, [path]);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const handlers = args.slice(1);
|
|
77
|
+
return original.apply(this, [
|
|
78
|
+
path,
|
|
79
|
+
...handlers.map(handler => instrumentation._wrapHandler(handler )),
|
|
80
|
+
]);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return original.apply(
|
|
84
|
+
this,
|
|
85
|
+
args.map(handler => instrumentation._wrapHandler(handler )),
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Patches the 'on' handler to instrument it.
|
|
93
|
+
*/
|
|
94
|
+
_patchOnHandler() {
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
96
|
+
const instrumentation = this;
|
|
97
|
+
|
|
98
|
+
return function (original) {
|
|
99
|
+
return function wrappedHandler( ...args) {
|
|
100
|
+
const handlers = args.slice(2);
|
|
101
|
+
return original.apply(this, [
|
|
102
|
+
...args.slice(0, 2),
|
|
103
|
+
...handlers.map(handler => instrumentation._wrapHandler(handler )),
|
|
104
|
+
]);
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Patches the middleware handler to instrument it.
|
|
111
|
+
*/
|
|
112
|
+
_patchMiddlewareHandler() {
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
114
|
+
const instrumentation = this;
|
|
115
|
+
|
|
116
|
+
return function (original) {
|
|
117
|
+
return function wrappedHandler( ...args) {
|
|
118
|
+
if (typeof args[0] === 'string') {
|
|
119
|
+
const path = args[0];
|
|
120
|
+
if (args.length === 1) {
|
|
121
|
+
return original.apply(this, [path]);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const handlers = args.slice(1);
|
|
125
|
+
return original.apply(this, [
|
|
126
|
+
path,
|
|
127
|
+
...handlers.map(handler => instrumentation._wrapHandler(handler )),
|
|
128
|
+
]);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return original.apply(
|
|
132
|
+
this,
|
|
133
|
+
args.map(handler => instrumentation._wrapHandler(handler )),
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Wraps a handler or middleware handler to apply instrumentation.
|
|
141
|
+
*/
|
|
142
|
+
_wrapHandler(handler) {
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
144
|
+
const instrumentation = this;
|
|
145
|
+
|
|
146
|
+
return function ( c, next) {
|
|
147
|
+
if (!instrumentation.isEnabled()) {
|
|
148
|
+
return handler.apply(this, [c, next]);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const path = c.req.path;
|
|
152
|
+
const span = instrumentation.tracer.startSpan(path);
|
|
153
|
+
|
|
154
|
+
return api.context.with(api.trace.setSpan(api.context.active(), span), () => {
|
|
155
|
+
return instrumentation._safeExecute(
|
|
156
|
+
() => {
|
|
157
|
+
const result = handler.apply(this, [c, next]);
|
|
158
|
+
if (core.isThenable(result)) {
|
|
159
|
+
return result.then(result => {
|
|
160
|
+
const type = instrumentation._determineHandlerType(result);
|
|
161
|
+
span.setAttributes({
|
|
162
|
+
[constants.AttributeNames.HONO_TYPE]: type,
|
|
163
|
+
[constants.AttributeNames.HONO_NAME]: type === constants.HonoTypes.REQUEST_HANDLER ? path : handler.name || 'anonymous',
|
|
164
|
+
});
|
|
165
|
+
instrumentation.getConfig().responseHook?.(span);
|
|
166
|
+
return result;
|
|
167
|
+
});
|
|
168
|
+
} else {
|
|
169
|
+
const type = instrumentation._determineHandlerType(result);
|
|
170
|
+
span.setAttributes({
|
|
171
|
+
[constants.AttributeNames.HONO_TYPE]: type,
|
|
172
|
+
[constants.AttributeNames.HONO_NAME]: type === constants.HonoTypes.REQUEST_HANDLER ? path : handler.name || 'anonymous',
|
|
173
|
+
});
|
|
174
|
+
instrumentation.getConfig().responseHook?.(span);
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
() => span.end(),
|
|
179
|
+
error => {
|
|
180
|
+
instrumentation._handleError(span, error);
|
|
181
|
+
span.end();
|
|
182
|
+
},
|
|
183
|
+
);
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Safely executes a function and handles errors.
|
|
190
|
+
*/
|
|
191
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
192
|
+
_safeExecute(execute, onSuccess, onFailure) {
|
|
193
|
+
try {
|
|
194
|
+
const result = execute();
|
|
195
|
+
|
|
196
|
+
if (core.isThenable(result)) {
|
|
197
|
+
result.then(
|
|
198
|
+
() => onSuccess(),
|
|
199
|
+
(error) => onFailure(error),
|
|
200
|
+
);
|
|
201
|
+
} else {
|
|
202
|
+
onSuccess();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return result;
|
|
206
|
+
} catch (error) {
|
|
207
|
+
onFailure(error);
|
|
208
|
+
throw error;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Determines the handler type based on the result.
|
|
214
|
+
* @param result
|
|
215
|
+
* @private
|
|
216
|
+
*/
|
|
217
|
+
_determineHandlerType(result) {
|
|
218
|
+
return result === undefined ? constants.HonoTypes.MIDDLEWARE : constants.HonoTypes.REQUEST_HANDLER;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Handles errors by setting the span status and recording the exception.
|
|
223
|
+
*/
|
|
224
|
+
_handleError(span, error) {
|
|
225
|
+
if (error instanceof Error) {
|
|
226
|
+
span.setStatus({
|
|
227
|
+
code: api.SpanStatusCode.ERROR,
|
|
228
|
+
message: error.message,
|
|
229
|
+
});
|
|
230
|
+
span.recordException(error);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
exports.HonoInstrumentation = HonoInstrumentation;
|
|
236
|
+
//# sourceMappingURL=instrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/tracing/hono/instrumentation.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { context, SpanStatusCode, trace } from '@opentelemetry/api';\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';\nimport { isThenable } from '@sentry/core';\nimport { AttributeNames, HonoTypes } from './constants';\nimport type {\n Context,\n Handler,\n HandlerInterface,\n Hono,\n HonoInstance,\n MiddlewareHandler,\n MiddlewareHandlerInterface,\n Next,\n OnHandlerInterface,\n} from './types';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-hono';\nconst PACKAGE_VERSION = '0.0.1';\n\nexport interface HonoResponseHookFunction {\n (span: Span): void;\n}\n\nexport interface HonoInstrumentationConfig extends InstrumentationConfig {\n /** Function for adding custom span attributes from the response */\n responseHook?: HonoResponseHookFunction;\n}\n\n/**\n * Hono instrumentation for OpenTelemetry\n */\nexport class HonoInstrumentation extends InstrumentationBase<HonoInstrumentationConfig> {\n public constructor(config: HonoInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n }\n\n /**\n * Initialize the instrumentation.\n */\n public init(): InstrumentationNodeModuleDefinition[] {\n return [\n new InstrumentationNodeModuleDefinition('hono', ['>=4.0.0 <5'], moduleExports => this._patch(moduleExports)),\n ];\n }\n\n /**\n * Patches the module exports to instrument Hono.\n */\n private _patch(moduleExports: { Hono: Hono }): { Hono: Hono } {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const instrumentation = this;\n\n class WrappedHono extends moduleExports.Hono {\n public constructor(...args: unknown[]) {\n super(...args);\n\n instrumentation._wrap(this, 'get', instrumentation._patchHandler());\n instrumentation._wrap(this, 'post', instrumentation._patchHandler());\n instrumentation._wrap(this, 'put', instrumentation._patchHandler());\n instrumentation._wrap(this, 'delete', instrumentation._patchHandler());\n instrumentation._wrap(this, 'options', instrumentation._patchHandler());\n instrumentation._wrap(this, 'patch', instrumentation._patchHandler());\n instrumentation._wrap(this, 'all', instrumentation._patchHandler());\n instrumentation._wrap(this, 'on', instrumentation._patchOnHandler());\n instrumentation._wrap(this, 'use', instrumentation._patchMiddlewareHandler());\n }\n }\n\n try {\n moduleExports.Hono = WrappedHono;\n } catch {\n // This is a workaround for environments where direct assignment is not allowed.\n return { ...moduleExports, Hono: WrappedHono };\n }\n\n return moduleExports;\n }\n\n /**\n * Patches the route handler to instrument it.\n */\n private _patchHandler(): (original: HandlerInterface) => HandlerInterface {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const instrumentation = this;\n\n return function (original: HandlerInterface) {\n return function wrappedHandler(this: HonoInstance, ...args: unknown[]) {\n if (typeof args[0] === 'string') {\n const path = args[0];\n if (args.length === 1) {\n return original.apply(this, [path]);\n }\n\n const handlers = args.slice(1);\n return original.apply(this, [\n path,\n ...handlers.map(handler => instrumentation._wrapHandler(handler as Handler | MiddlewareHandler)),\n ]);\n }\n\n return original.apply(\n this,\n args.map(handler => instrumentation._wrapHandler(handler as Handler | MiddlewareHandler)),\n );\n };\n };\n }\n\n /**\n * Patches the 'on' handler to instrument it.\n */\n private _patchOnHandler(): (original: OnHandlerInterface) => OnHandlerInterface {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const instrumentation = this;\n\n return function (original: OnHandlerInterface) {\n return function wrappedHandler(this: HonoInstance, ...args: unknown[]) {\n const handlers = args.slice(2);\n return original.apply(this, [\n ...args.slice(0, 2),\n ...handlers.map(handler => instrumentation._wrapHandler(handler as Handler | MiddlewareHandler)),\n ]);\n };\n };\n }\n\n /**\n * Patches the middleware handler to instrument it.\n */\n private _patchMiddlewareHandler(): (original: MiddlewareHandlerInterface) => MiddlewareHandlerInterface {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const instrumentation = this;\n\n return function (original: MiddlewareHandlerInterface) {\n return function wrappedHandler(this: HonoInstance, ...args: unknown[]) {\n if (typeof args[0] === 'string') {\n const path = args[0];\n if (args.length === 1) {\n return original.apply(this, [path]);\n }\n\n const handlers = args.slice(1);\n return original.apply(this, [\n path,\n ...handlers.map(handler => instrumentation._wrapHandler(handler as MiddlewareHandler)),\n ]);\n }\n\n return original.apply(\n this,\n args.map(handler => instrumentation._wrapHandler(handler as MiddlewareHandler)),\n );\n };\n };\n }\n\n /**\n * Wraps a handler or middleware handler to apply instrumentation.\n */\n private _wrapHandler(handler: Handler | MiddlewareHandler): Handler | MiddlewareHandler {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const instrumentation = this;\n\n return function (this: unknown, c: Context, next: Next) {\n if (!instrumentation.isEnabled()) {\n return handler.apply(this, [c, next]);\n }\n\n const path = c.req.path;\n const span = instrumentation.tracer.startSpan(path);\n\n return context.with(trace.setSpan(context.active(), span), () => {\n return instrumentation._safeExecute(\n () => {\n const result = handler.apply(this, [c, next]);\n if (isThenable(result)) {\n return result.then(result => {\n const type = instrumentation._determineHandlerType(result);\n span.setAttributes({\n [AttributeNames.HONO_TYPE]: type,\n [AttributeNames.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path : handler.name || 'anonymous',\n });\n instrumentation.getConfig().responseHook?.(span);\n return result;\n });\n } else {\n const type = instrumentation._determineHandlerType(result);\n span.setAttributes({\n [AttributeNames.HONO_TYPE]: type,\n [AttributeNames.HONO_NAME]: type === HonoTypes.REQUEST_HANDLER ? path : handler.name || 'anonymous',\n });\n instrumentation.getConfig().responseHook?.(span);\n return result;\n }\n },\n () => span.end(),\n error => {\n instrumentation._handleError(span, error);\n span.end();\n },\n );\n });\n };\n }\n\n /**\n * Safely executes a function and handles errors.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _safeExecute(execute: () => any, onSuccess: () => void, onFailure: (error: unknown) => void): () => any {\n try {\n const result = execute();\n\n if (isThenable(result)) {\n result.then(\n () => onSuccess(),\n (error: unknown) => onFailure(error),\n );\n } else {\n onSuccess();\n }\n\n return result;\n } catch (error: unknown) {\n onFailure(error);\n throw error;\n }\n }\n\n /**\n * Determines the handler type based on the result.\n * @param result\n * @private\n */\n private _determineHandlerType(result: unknown): HonoTypes {\n return result === undefined ? HonoTypes.MIDDLEWARE : HonoTypes.REQUEST_HANDLER;\n }\n\n /**\n * Handles errors by setting the span status and recording the exception.\n */\n private _handleError(span: Span, error: unknown): void {\n if (error instanceof Error) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n span.recordException(error);\n }\n }\n}\n"],"names":["InstrumentationBase","InstrumentationNodeModuleDefinition","context","trace","isThenable","AttributeNames","HonoTypes","SpanStatusCode"],"mappings":";;;;;;;AAkBA,MAAM,YAAA,GAAe,8BAA8B;AACnD,MAAM,eAAA,GAAkB,OAAO;;AAW/B;AACA;AACA;AACO,MAAM,mBAAA,SAA4BA,mCAAmB,CAA4B;AACxF,GAAS,WAAW,CAAC,MAAM,GAA8B,EAAE,EAAE;AAC7D,IAAI,KAAK,CAAC,YAAY,EAAE,eAAe,EAAE,MAAM,CAAC;AAChD,EAAE;;AAEF;AACA;AACA;AACA,GAAS,IAAI,GAA0C;AACvD,IAAI,OAAO;AACX,MAAM,IAAIC,mDAAmC,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,EAAE,aAAA,IAAiB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AAClH,KAAK;AACL,EAAE;;AAEF;AACA;AACA;AACA,GAAU,MAAM,CAAC,aAAa,EAAkC;AAChE;AACA,IAAI,MAAM,eAAA,GAAkB,IAAI;;AAEhC,IAAI,MAAM,WAAA,SAAoB,aAAa,CAAC,IAAA,CAAK;AACjD,OAAa,WAAW,CAAC,GAAG,IAAI,EAAa;AAC7C,QAAQ,KAAK,CAAC,GAAG,IAAI,CAAC;;AAEtB,QAAQ,eAAe,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,eAAe,CAAC,aAAa,EAAE,CAAC;AAC3E,QAAQ,eAAe,CAAC,KAAK,CA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AO,CAAC;AACR,MAAM,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC;AACjC,IAAI;AACJ,EAAE;AACF;;;;"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const http = require('../http.js');
|
|
4
|
+
const amqplib = require('./amqplib.js');
|
|
5
|
+
const index$6 = require('./anthropic-ai/index.js');
|
|
6
|
+
const connect = require('./connect.js');
|
|
7
|
+
const express = require('./express.js');
|
|
8
|
+
const index = require('./fastify/index.js');
|
|
9
|
+
const firebase = require('./firebase/firebase.js');
|
|
10
|
+
const genericPool = require('./genericPool.js');
|
|
11
|
+
const index$7 = require('./google-genai/index.js');
|
|
12
|
+
const graphql = require('./graphql.js');
|
|
13
|
+
const index$1 = require('./hapi/index.js');
|
|
14
|
+
const index$2 = require('./hono/index.js');
|
|
15
|
+
const kafka = require('./kafka.js');
|
|
16
|
+
const koa = require('./koa.js');
|
|
17
|
+
const index$3 = require('./langchain/index.js');
|
|
18
|
+
const index$8 = require('./langgraph/index.js');
|
|
19
|
+
const lrumemoizer = require('./lrumemoizer.js');
|
|
20
|
+
const mongo = require('./mongo.js');
|
|
21
|
+
const mongoose = require('./mongoose.js');
|
|
22
|
+
const mysql = require('./mysql.js');
|
|
23
|
+
const mysql2 = require('./mysql2.js');
|
|
24
|
+
const index$5 = require('./openai/index.js');
|
|
25
|
+
const postgres = require('./postgres.js');
|
|
26
|
+
const postgresjs = require('./postgresjs.js');
|
|
27
|
+
const prisma = require('./prisma.js');
|
|
28
|
+
const redis = require('./redis.js');
|
|
29
|
+
const tedious = require('./tedious.js');
|
|
30
|
+
const index$4 = require('./vercelai/index.js');
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.
|
|
34
|
+
*/
|
|
35
|
+
function getAutoPerformanceIntegrations() {
|
|
36
|
+
return [
|
|
37
|
+
express.expressIntegration(),
|
|
38
|
+
index.fastifyIntegration(),
|
|
39
|
+
graphql.graphqlIntegration(),
|
|
40
|
+
index$2.honoIntegration(),
|
|
41
|
+
mongo.mongoIntegration(),
|
|
42
|
+
mongoose.mongooseIntegration(),
|
|
43
|
+
mysql.mysqlIntegration(),
|
|
44
|
+
mysql2.mysql2Integration(),
|
|
45
|
+
redis.redisIntegration(),
|
|
46
|
+
postgres.postgresIntegration(),
|
|
47
|
+
prisma.prismaIntegration(),
|
|
48
|
+
index$1.hapiIntegration(),
|
|
49
|
+
koa.koaIntegration(),
|
|
50
|
+
connect.connectIntegration(),
|
|
51
|
+
tedious.tediousIntegration(),
|
|
52
|
+
genericPool.genericPoolIntegration(),
|
|
53
|
+
kafka.kafkaIntegration(),
|
|
54
|
+
amqplib.amqplibIntegration(),
|
|
55
|
+
lrumemoizer.lruMemoizerIntegration(),
|
|
56
|
+
// AI providers
|
|
57
|
+
// LangChain must come first to disable AI provider integrations before they instrument
|
|
58
|
+
index$3.langChainIntegration(),
|
|
59
|
+
index$8.langGraphIntegration(),
|
|
60
|
+
index$4.vercelAIIntegration(),
|
|
61
|
+
index$5.openAIIntegration(),
|
|
62
|
+
index$6.anthropicAIIntegration(),
|
|
63
|
+
index$7.googleGenAIIntegration(),
|
|
64
|
+
postgresjs.postgresJsIntegration(),
|
|
65
|
+
firebase.firebaseIntegration(),
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Get a list of methods to instrument OTEL, when preload instrumentation.
|
|
71
|
+
*/
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
73
|
+
function getOpenTelemetryInstrumentationToPreload() {
|
|
74
|
+
return [
|
|
75
|
+
http.instrumentSentryHttp,
|
|
76
|
+
http.instrumentOtelHttp,
|
|
77
|
+
express.instrumentExpress,
|
|
78
|
+
connect.instrumentConnect,
|
|
79
|
+
index.instrumentFastify,
|
|
80
|
+
index.instrumentFastifyV3,
|
|
81
|
+
index$1.instrumentHapi,
|
|
82
|
+
index$2.instrumentHono,
|
|
83
|
+
kafka.instrumentKafka,
|
|
84
|
+
koa.instrumentKoa,
|
|
85
|
+
lrumemoizer.instrumentLruMemoizer,
|
|
86
|
+
mongo.instrumentMongo,
|
|
87
|
+
mongoose.instrumentMongoose,
|
|
88
|
+
mysql.instrumentMysql,
|
|
89
|
+
mysql2.instrumentMysql2,
|
|
90
|
+
postgres.instrumentPostgres,
|
|
91
|
+
index$1.instrumentHapi,
|
|
92
|
+
graphql.instrumentGraphql,
|
|
93
|
+
redis.instrumentRedis,
|
|
94
|
+
tedious.instrumentTedious,
|
|
95
|
+
genericPool.instrumentGenericPool,
|
|
96
|
+
amqplib.instrumentAmqplib,
|
|
97
|
+
index$3.instrumentLangChain,
|
|
98
|
+
index$4.instrumentVercelAi,
|
|
99
|
+
index$5.instrumentOpenAi,
|
|
100
|
+
postgresjs.instrumentPostgresJs,
|
|
101
|
+
firebase.instrumentFirebase,
|
|
102
|
+
index$6.instrumentAnthropicAi,
|
|
103
|
+
index$7.instrumentGoogleGenAI,
|
|
104
|
+
index$8.instrumentLangGraph,
|
|
105
|
+
];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
exports.getAutoPerformanceIntegrations = getAutoPerformanceIntegrations;
|
|
109
|
+
exports.getOpenTelemetryInstrumentationToPreload = getOpenTelemetryInstrumentationToPreload;
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { instrumentOtelHttp, instrumentSentryHttp } from '../http';\nimport { amqplibIntegration, instrumentAmqplib } from './amqplib';\nimport { anthropicAIIntegration, instrumentAnthropicAi } from './anthropic-ai';\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress } from './express';\nimport { fastifyIntegration, instrumentFastify, instrumentFastifyV3 } from './fastify';\nimport { firebaseIntegration, instrumentFirebase } from './firebase';\nimport { genericPoolIntegration, instrumentGenericPool } from './genericPool';\nimport { googleGenAIIntegration, instrumentGoogleGenAI } from './google-genai';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { honoIntegration, instrumentHono } from './hono';\nimport { instrumentKafka, kafkaIntegration } from './kafka';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentLangChain, langChainIntegration } from './langchain';\nimport { instrumentLangGraph, langGraphIntegration } from './langgraph';\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 { instrumentOpenAi, openAIIntegration } from './openai';\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 honoIntegration(),\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 // AI providers\n // LangChain must come first to disable AI provider integrations before they instrument\n langChainIntegration(),\n langGraphIntegration(),\n vercelAIIntegration(),\n openAIIntegration(),\n anthropicAIIntegration(),\n googleGenAIIntegration(),\n postgresJsIntegration(),\n firebaseIntegration(),\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 instrumentSentryHttp,\n instrumentOtelHttp,\n instrumentExpress,\n instrumentConnect,\n instrumentFastify,\n instrumentFastifyV3,\n instrumentHapi,\n instrumentHono,\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 instrumentLangChain,\n instrumentVercelAi,\n instrumentOpenAi,\n instrumentPostgresJs,\n instrumentFirebase,\n instrumentAnthropicAi,\n instrumentGoogleGenAI,\n instrumentLangGraph,\n ];\n}\n"],"names":["expressIntegration","fastifyIntegration","graphqlIntegration","honoIntegration","mongoIntegration","mongooseIntegration","mysqlIntegration","mysql2Integration","redisIntegration","postgresIntegration","prismaIntegration","hapiIntegration","koaIntegration","connectIntegration","tediousIntegration","genericPoolIntegration","kafkaIntegration","amqplibIntegration","lruMemoizerIntegration","langChainIntegration","langGraphIntegration","vercelAIIntegration","openAIIntegration","anthropicAIIntegration","googleGenAIIntegration","postgresJsIntegration","firebaseIntegration","instrumentSentryHttp","instrumentOtelHttp","instrumentExpress","instrumentConnect","instrumentFastify","instrumentFastifyV3","instrumentHapi","instrumentHono","instrumentKafka","instrumentKoa","instrumentLruMemoizer","instrumentMongo","instrumentMongoose","instrumentMysql","instrumentMysql2","instrumentPostgres","instrumentGraphql","instrumentRedis","instrumentTedious","instrumentGenericPool","instrumentAmqplib","instrumentLangChain","instrumentVercelAi","instrumentOpenAi","instrumentPostgresJs","instrumentFirebase","instrumentAnthropicAi","instrumentGoogleGen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2BAAkB;AACtB,IAAIC,qBAAe;AACnB,IAAIC,uBAAgB;AACpB,IAAIC,2BAAkB;AACtB,IAAIT,sBAAc;AAClB,IAAIU,yBAAiB;AACrB,IAAIC,qBAAe;AACnB,IAAIC,yBAAiB;AACrB,IAAIC,iCAAqB;AACzB,IAAIC,yBAAiB;AACrB,IAAIC,2BAAmB;AACvB,IAAIC,0BAAkB;AACtB,IAAIC,wBAAgB;AACpB,IAAIC,+BAAoB;AACxB,IAAIC,2BAAkB;AACtB,IAAIC,6BAAqB;AACzB,IAAIC,6BAAqB;AACzB,IAAIC,2BAAmB;AACvB,GAAG;AACH;;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const instrumentationKafkajs = require('@opentelemetry/instrumentation-kafkajs');
|
|
4
|
+
const core = require('@sentry/core');
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
6
|
+
|
|
7
|
+
const INTEGRATION_NAME = 'Kafka';
|
|
8
|
+
|
|
9
|
+
const instrumentKafka = nodeCore.generateInstrumentOnce(
|
|
10
|
+
INTEGRATION_NAME,
|
|
11
|
+
() =>
|
|
12
|
+
new instrumentationKafkajs.KafkaJsInstrumentation({
|
|
13
|
+
consumerHook(span) {
|
|
14
|
+
nodeCore.addOriginToSpan(span, 'auto.kafkajs.otel.consumer');
|
|
15
|
+
},
|
|
16
|
+
producerHook(span) {
|
|
17
|
+
nodeCore.addOriginToSpan(span, 'auto.kafkajs.otel.producer');
|
|
18
|
+
},
|
|
19
|
+
}),
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const _kafkaIntegration = (() => {
|
|
23
|
+
return {
|
|
24
|
+
name: INTEGRATION_NAME,
|
|
25
|
+
setupOnce() {
|
|
26
|
+
instrumentKafka();
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}) ;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Adds Sentry tracing instrumentation for the [kafkajs](https://www.npmjs.com/package/kafkajs) library.
|
|
33
|
+
*
|
|
34
|
+
* For more information, see the [`kafkaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/kafka/).
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```javascript
|
|
38
|
+
* const Sentry = require('@sentry/node');
|
|
39
|
+
*
|
|
40
|
+
* Sentry.init({
|
|
41
|
+
* integrations: [Sentry.kafkaIntegration()],
|
|
42
|
+
* });
|
|
43
|
+
*/
|
|
44
|
+
const kafkaIntegration = core.defineIntegration(_kafkaIntegration);
|
|
45
|
+
|
|
46
|
+
exports.instrumentKafka = instrumentKafka;
|
|
47
|
+
exports.kafkaIntegration = kafkaIntegration;
|
|
48
|
+
//# sourceMappingURL=kafka.js.map
|
|
@@ -0,0 +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 { 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,eAAA,GAAkBA,+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,MAAM,CAAC;AACP,MAAM,YAAY,CAAC,IAAI,EAAE;AACzB,QAAQA,wBAAe,CAAC,IAAI,EAAE,4BAA4B,CAAC;AAC3D,MAAM,CAAC;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,iBAAA,IAAqB,MAAM;AACjC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,eAAe,EAAE;AACvB,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,gBAAA,GAAmBC,sBAAiB,CAAC,iBAAiB;;;;;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const instrumentationKnex = require('@opentelemetry/instrumentation-knex');
|
|
4
|
+
const core = require('@sentry/core');
|
|
5
|
+
const nodeCore = require('@sentry/node-core');
|
|
6
|
+
|
|
7
|
+
const INTEGRATION_NAME = 'Knex';
|
|
8
|
+
|
|
9
|
+
const instrumentKnex = nodeCore.generateInstrumentOnce(
|
|
10
|
+
INTEGRATION_NAME,
|
|
11
|
+
() => new instrumentationKnex.KnexInstrumentation({ requireParentSpan: true }),
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
const _knexIntegration = (() => {
|
|
15
|
+
let instrumentationWrappedCallback;
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
name: INTEGRATION_NAME,
|
|
19
|
+
setupOnce() {
|
|
20
|
+
const instrumentation = instrumentKnex();
|
|
21
|
+
instrumentationWrappedCallback = nodeCore.instrumentWhenWrapped(instrumentation);
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
setup(client) {
|
|
25
|
+
instrumentationWrappedCallback?.(() =>
|
|
26
|
+
client.on('spanStart', span => {
|
|
27
|
+
const { data } = core.spanToJSON(span);
|
|
28
|
+
// knex.version is always set in the span data
|
|
29
|
+
// https://github.com/open-telemetry/opentelemetry-js-contrib/blob/0309caeafc44ac9cb13a3345b790b01b76d0497d/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts#L138
|
|
30
|
+
if ('knex.version' in data) {
|
|
31
|
+
span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.knex');
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}) ;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Knex integration
|
|
41
|
+
*
|
|
42
|
+
* Capture tracing data for [Knex](https://knexjs.org/).
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```javascript
|
|
46
|
+
* import * as Sentry from '@sentry/node';
|
|
47
|
+
*
|
|
48
|
+
* Sentry.init({
|
|
49
|
+
* integrations: [Sentry.knexIntegration()],
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
const knexIntegration = core.defineIntegration(_knexIntegration);
|
|
54
|
+
|
|
55
|
+
exports.instrumentKnex = instrumentKnex;
|
|
56
|
+
exports.knexIntegration = knexIntegration;
|
|
57
|
+
//# sourceMappingURL=knex.js.map
|