@depup/sentry__node 10.47.0-depup.1 → 10.67.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/README.md +5 -4
- package/build/cjs/debug-build.js +0 -5
- package/build/cjs/debug-build.js.map +1 -1
- package/build/cjs/index.js +81 -68
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/init.js +0 -6
- package/build/cjs/init.js.map +1 -1
- package/build/cjs/integrations/featureFlagShims/growthbook.js +0 -4
- package/build/cjs/integrations/featureFlagShims/growthbook.js.map +1 -1
- package/build/cjs/integrations/featureFlagShims/launchDarkly.js +6 -18
- package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -1
- package/build/cjs/integrations/featureFlagShims/openFeature.js +6 -21
- package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -1
- package/build/cjs/integrations/featureFlagShims/statsig.js +2 -8
- package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -1
- package/build/cjs/integrations/featureFlagShims/unleash.js +2 -8
- package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -1
- package/build/cjs/integrations/fs/index.js +17 -0
- package/build/cjs/integrations/fs/index.js.map +1 -0
- package/build/cjs/integrations/fs/vendored/constants.js +138 -0
- package/build/cjs/integrations/fs/vendored/constants.js.map +1 -0
- package/build/cjs/integrations/fs/vendored/instrumentation.js +230 -0
- package/build/cjs/integrations/fs/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/fs/vendored/utils.js +31 -0
- package/build/cjs/integrations/fs/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/http.js +19 -175
- package/build/cjs/integrations/http.js.map +1 -1
- package/build/cjs/integrations/node-fetch.js +10 -94
- package/build/cjs/integrations/node-fetch.js.map +1 -1
- package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js +15 -0
- package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib/index.js +21 -0
- package/build/cjs/integrations/tracing/amqplib/index.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js +117 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/patches.js +185 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/patches.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js +26 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/types.js +17 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/utils.js +129 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/anthropic-ai/index.js +3 -58
- package/build/cjs/integrations/tracing/anthropic-ai/index.js.map +1 -1
- package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js +21 -44
- package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/connect/index.js +35 -0
- package/build/cjs/integrations/tracing/connect/index.js.map +1 -0
- package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +16 -0
- package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
- package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +137 -0
- package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/connect/vendored/internal-types.js +8 -0
- package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +1 -0
- package/build/cjs/integrations/tracing/connect/vendored/utils.js +36 -0
- package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/dataloader/index.js +26 -0
- package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -0
- package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js +217 -0
- package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/express.js +44 -147
- package/build/cjs/integrations/tracing/express.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/index.js +19 -234
- package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/v3/constants.js +1 -18
- package/build/cjs/integrations/tracing/fastify/v3/constants.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js +20 -33
- package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +78 -162
- package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/v3/utils.js +8 -79
- package/build/cjs/integrations/tracing/fastify/v3/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/firebase/firebase.js +4 -33
- package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -1
- package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +7 -23
- package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +73 -215
- package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
- package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js +86 -210
- package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
- package/build/cjs/integrations/tracing/genericPool/index.js +21 -0
- package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -0
- package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +122 -0
- package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/google-genai/index.js +3 -58
- package/build/cjs/integrations/tracing/google-genai/index.js.map +1 -1
- package/build/cjs/integrations/tracing/google-genai/instrumentation.js +23 -43
- package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/index.js +34 -0
- package/build/cjs/integrations/tracing/graphql/index.js.map +1 -0
- package/build/cjs/integrations/tracing/graphql/vendored/enum.js +47 -0
- package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +1 -0
- package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +15 -0
- package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -0
- package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +329 -0
- package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js +6 -0
- package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +1 -0
- package/build/cjs/integrations/tracing/graphql/vendored/symbols.js +8 -0
- package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +1 -0
- package/build/cjs/integrations/tracing/graphql/vendored/utils.js +265 -0
- package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/hapi/index.js +16 -91
- package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
- package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js +11 -0
- package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -0
- package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +255 -0
- package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js +24 -0
- package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +1 -0
- package/build/cjs/integrations/tracing/hapi/vendored/utils.js +85 -0
- package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/hono/constants.js +6 -7
- package/build/cjs/integrations/tracing/hono/constants.js.map +1 -1
- package/build/cjs/integrations/tracing/hono/index.js +26 -77
- package/build/cjs/integrations/tracing/hono/index.js.map +1 -1
- package/build/cjs/integrations/tracing/hono/instrumentation.js +47 -82
- package/build/cjs/integrations/tracing/hono/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/index.js +74 -83
- package/build/cjs/integrations/tracing/index.js.map +1 -1
- package/build/cjs/integrations/tracing/kafka/index.js +21 -0
- package/build/cjs/integrations/tracing/kafka/index.js.map +1 -0
- package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +237 -0
- package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +22 -0
- package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/kafka/vendored/utils.js +114 -0
- package/build/cjs/integrations/tracing/kafka/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/knex/index.js +26 -0
- package/build/cjs/integrations/tracing/knex/index.js.map +1 -0
- package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +135 -0
- package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/knex/vendored/semconv.js +10 -0
- package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/knex/vendored/utils.js +84 -0
- package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/koa/index.js +46 -0
- package/build/cjs/integrations/tracing/koa/index.js.map +1 -0
- package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js +10 -0
- package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -0
- package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +127 -0
- package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/koa/vendored/internal-types.js +6 -0
- package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +1 -0
- package/build/cjs/integrations/tracing/koa/vendored/types.js +10 -0
- package/build/cjs/integrations/tracing/koa/vendored/types.js.map +1 -0
- package/build/cjs/integrations/tracing/koa/vendored/utils.js +36 -0
- package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/langchain/index.js +3 -96
- package/build/cjs/integrations/tracing/langchain/index.js.map +1 -1
- package/build/cjs/integrations/tracing/langchain/instrumentation.js +80 -140
- package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/langgraph/index.js +3 -73
- package/build/cjs/integrations/tracing/langgraph/index.js.map +1 -1
- package/build/cjs/integrations/tracing/langgraph/instrumentation.js +76 -40
- package/build/cjs/integrations/tracing/langgraph/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/lrumemoizer/index.js +21 -0
- package/build/cjs/integrations/tracing/lrumemoizer/index.js.map +1 -0
- package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js +38 -0
- package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/mongo/index.js +21 -0
- package/build/cjs/integrations/tracing/mongo/index.js.map +1 -0
- package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +129 -0
- package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/mongo/vendored/patches.js +150 -0
- package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +1 -0
- package/build/cjs/integrations/tracing/mongo/vendored/utils.js +40 -0
- package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/mongoose/index.js +22 -0
- package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -0
- package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +240 -0
- package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
- package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +41 -0
- package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql/index.js +21 -0
- package/build/cjs/integrations/tracing/mysql/index.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js +185 -0
- package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql/vendored/semconv.js +8 -0
- package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql/vendored/utils.js +38 -0
- package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql2/index.js +22 -0
- package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +138 -0
- package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js +8 -0
- package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +81 -0
- package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/openai/index.js +3 -58
- package/build/cjs/integrations/tracing/openai/index.js.map +1 -1
- package/build/cjs/integrations/tracing/openai/instrumentation.js +25 -49
- package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/postgres/index.js +27 -0
- package/build/cjs/integrations/tracing/postgres/index.js.map +1 -0
- package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +11 -0
- package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -0
- package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js +11 -0
- package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -0
- package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +225 -0
- package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +8 -0
- package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/postgres/vendored/utils.js +151 -0
- package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/postgresjs.js +77 -190
- package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/cache.js +41 -0
- package/build/cjs/integrations/tracing/redis/cache.js.map +1 -0
- package/build/cjs/integrations/tracing/redis/index.js +50 -0
- package/build/cjs/integrations/tracing/redis/index.js.map +1 -0
- package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +147 -0
- package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +445 -0
- package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/redis/vendored/semconv.js +8 -0
- package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/tedious/index.js +21 -0
- package/build/cjs/integrations/tracing/tedious/index.js.map +1 -0
- package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +154 -0
- package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/tedious/vendored/semconv.js +8 -0
- package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/tedious/vendored/utils.js +29 -0
- package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/vercelai/constants.js +1 -1
- package/build/cjs/integrations/tracing/vercelai/constants.js.map +1 -1
- package/build/cjs/integrations/tracing/vercelai/index.js +7 -53
- package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
- package/build/cjs/integrations/tracing/vercelai/instrumentation.js +60 -158
- package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +1 -1
- package/build/cjs/preload.js +1 -14
- package/build/cjs/preload.js.map +1 -1
- package/build/cjs/sdk/diagnosticsChannelInjection.js +21 -0
- package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -0
- package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +33 -0
- package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
- package/build/cjs/sdk/index.js +33 -35
- package/build/cjs/sdk/index.js.map +1 -1
- package/build/cjs/sdk/initOtel.js +74 -60
- package/build/cjs/sdk/initOtel.js.map +1 -1
- package/build/cjs/utils/redisCache.js +24 -52
- package/build/cjs/utils/redisCache.js.map +1 -1
- package/build/cjs/utils/setHttpServerSpanRouteAttribute.js +21 -0
- package/build/cjs/utils/setHttpServerSpanRouteAttribute.js.map +1 -0
- package/build/esm/debug-build.js +0 -5
- package/build/esm/debug-build.js.map +1 -1
- package/build/esm/index.js +24 -22
- package/build/esm/index.js.map +1 -1
- package/build/esm/init.js +0 -6
- package/build/esm/init.js.map +1 -1
- package/build/esm/integrations/featureFlagShims/growthbook.js +0 -4
- package/build/esm/integrations/featureFlagShims/growthbook.js.map +1 -1
- package/build/esm/integrations/featureFlagShims/launchDarkly.js +6 -18
- package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -1
- package/build/esm/integrations/featureFlagShims/openFeature.js +6 -21
- package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -1
- package/build/esm/integrations/featureFlagShims/statsig.js +2 -8
- package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -1
- package/build/esm/integrations/featureFlagShims/unleash.js +2 -8
- package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -1
- package/build/esm/integrations/fs/index.js +15 -0
- package/build/esm/integrations/fs/index.js.map +1 -0
- package/build/esm/integrations/fs/vendored/constants.js +134 -0
- package/build/esm/integrations/fs/vendored/constants.js.map +1 -0
- package/build/esm/integrations/fs/vendored/instrumentation.js +228 -0
- package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/fs/vendored/utils.js +28 -0
- package/build/esm/integrations/fs/vendored/utils.js.map +1 -0
- package/build/esm/integrations/http.js +22 -176
- package/build/esm/integrations/http.js.map +1 -1
- package/build/esm/integrations/node-fetch.js +12 -95
- package/build/esm/integrations/node-fetch.js.map +1 -1
- package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js +13 -0
- package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib/index.js +18 -0
- package/build/esm/integrations/tracing/amqplib/index.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js +115 -0
- package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib/vendored/patches.js +177 -0
- package/build/esm/integrations/tracing/amqplib/vendored/patches.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib/vendored/semconv.js +14 -0
- package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib/vendored/types.js +15 -0
- package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib/vendored/utils.js +117 -0
- package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/anthropic-ai/index.js +3 -58
- package/build/esm/integrations/tracing/anthropic-ai/index.js.map +1 -1
- package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js +21 -44
- package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/connect/index.js +31 -0
- package/build/esm/integrations/tracing/connect/index.js.map +1 -0
- package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +13 -0
- package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
- package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +135 -0
- package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/connect/vendored/internal-types.js +6 -0
- package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +1 -0
- package/build/esm/integrations/tracing/connect/vendored/utils.js +32 -0
- package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/dataloader/index.js +23 -0
- package/build/esm/integrations/tracing/dataloader/index.js.map +1 -0
- package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js +215 -0
- package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/express.js +45 -148
- package/build/esm/integrations/tracing/express.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/index.js +21 -235
- package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/v3/constants.js +1 -18
- package/build/esm/integrations/tracing/fastify/v3/constants.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js +17 -34
- package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +74 -158
- package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/v3/utils.js +8 -79
- package/build/esm/integrations/tracing/fastify/v3/utils.js.map +1 -1
- package/build/esm/integrations/tracing/firebase/firebase.js +6 -35
- package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -1
- package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +7 -23
- package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +72 -214
- package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
- package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +86 -210
- package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
- package/build/esm/integrations/tracing/genericPool/index.js +18 -0
- package/build/esm/integrations/tracing/genericPool/index.js.map +1 -0
- package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +120 -0
- package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/google-genai/index.js +3 -58
- package/build/esm/integrations/tracing/google-genai/index.js.map +1 -1
- package/build/esm/integrations/tracing/google-genai/instrumentation.js +23 -43
- package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/index.js +31 -0
- package/build/esm/integrations/tracing/graphql/index.js.map +1 -0
- package/build/esm/integrations/tracing/graphql/vendored/enum.js +43 -0
- package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +1 -0
- package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +13 -0
- package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -0
- package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +327 -0
- package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/graphql/vendored/internal-types.js +4 -0
- package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +1 -0
- package/build/esm/integrations/tracing/graphql/vendored/symbols.js +5 -0
- package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +1 -0
- package/build/esm/integrations/tracing/graphql/vendored/utils.js +257 -0
- package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/hapi/index.js +16 -91
- package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
- package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js +9 -0
- package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -0
- package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +253 -0
- package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/hapi/vendored/internal-types.js +19 -0
- package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +1 -0
- package/build/esm/integrations/tracing/hapi/vendored/utils.js +76 -0
- package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/hono/constants.js +6 -7
- package/build/esm/integrations/tracing/hono/constants.js.map +1 -1
- package/build/esm/integrations/tracing/hono/index.js +22 -73
- package/build/esm/integrations/tracing/hono/index.js.map +1 -1
- package/build/esm/integrations/tracing/hono/instrumentation.js +47 -82
- package/build/esm/integrations/tracing/hono/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/index.js +20 -29
- package/build/esm/integrations/tracing/index.js.map +1 -1
- package/build/esm/integrations/tracing/kafka/index.js +18 -0
- package/build/esm/integrations/tracing/kafka/index.js.map +1 -0
- package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +235 -0
- package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/kafka/vendored/semconv.js +12 -0
- package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/kafka/vendored/utils.js +108 -0
- package/build/esm/integrations/tracing/kafka/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/knex/index.js +23 -0
- package/build/esm/integrations/tracing/knex/index.js.map +1 -0
- package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +133 -0
- package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/knex/vendored/semconv.js +6 -0
- package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/knex/vendored/utils.js +75 -0
- package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/koa/index.js +42 -0
- package/build/esm/integrations/tracing/koa/index.js.map +1 -0
- package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js +8 -0
- package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -0
- package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +125 -0
- package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/koa/vendored/internal-types.js +4 -0
- package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +1 -0
- package/build/esm/integrations/tracing/koa/vendored/types.js +8 -0
- package/build/esm/integrations/tracing/koa/vendored/types.js.map +1 -0
- package/build/esm/integrations/tracing/koa/vendored/utils.js +33 -0
- package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/langchain/index.js +3 -96
- package/build/esm/integrations/tracing/langchain/index.js.map +1 -1
- package/build/esm/integrations/tracing/langchain/instrumentation.js +80 -140
- package/build/esm/integrations/tracing/langchain/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/langgraph/index.js +3 -73
- package/build/esm/integrations/tracing/langgraph/index.js.map +1 -1
- package/build/esm/integrations/tracing/langgraph/instrumentation.js +78 -42
- package/build/esm/integrations/tracing/langgraph/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/lrumemoizer/index.js +18 -0
- package/build/esm/integrations/tracing/lrumemoizer/index.js.map +1 -0
- package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js +36 -0
- package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/mongo/index.js +18 -0
- package/build/esm/integrations/tracing/mongo/index.js.map +1 -0
- package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +127 -0
- package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/mongo/vendored/patches.js +142 -0
- package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +1 -0
- package/build/esm/integrations/tracing/mongo/vendored/utils.js +34 -0
- package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/mongoose/index.js +19 -0
- package/build/esm/integrations/tracing/mongoose/index.js.map +1 -0
- package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +236 -0
- package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
- package/build/esm/integrations/tracing/mongoose/vendored/utils.js +38 -0
- package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/mysql/index.js +18 -0
- package/build/esm/integrations/tracing/mysql/index.js.map +1 -0
- package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js +183 -0
- package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/mysql/vendored/semconv.js +5 -0
- package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/mysql/vendored/utils.js +33 -0
- package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/mysql2/index.js +19 -0
- package/build/esm/integrations/tracing/mysql2/index.js.map +1 -0
- package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +136 -0
- package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/mysql2/vendored/semconv.js +5 -0
- package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/mysql2/vendored/utils.js +75 -0
- package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/openai/index.js +3 -58
- package/build/esm/integrations/tracing/openai/index.js.map +1 -1
- package/build/esm/integrations/tracing/openai/instrumentation.js +25 -49
- package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/postgres/index.js +24 -0
- package/build/esm/integrations/tracing/postgres/index.js.map +1 -0
- package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +9 -0
- package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -0
- package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js +9 -0
- package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -0
- package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +223 -0
- package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/postgres/vendored/semconv.js +5 -0
- package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/postgres/vendored/utils.js +136 -0
- package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/postgresjs.js +77 -190
- package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
- package/build/esm/integrations/tracing/redis/cache.js +38 -0
- package/build/esm/integrations/tracing/redis/cache.js.map +1 -0
- package/build/esm/integrations/tracing/redis/index.js +43 -0
- package/build/esm/integrations/tracing/redis/index.js.map +1 -0
- package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +145 -0
- package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +443 -0
- package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/redis/vendored/semconv.js +5 -0
- package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/tedious/index.js +18 -0
- package/build/esm/integrations/tracing/tedious/index.js.map +1 -0
- package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +152 -0
- package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/tedious/vendored/semconv.js +5 -0
- package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/tedious/vendored/utils.js +26 -0
- package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/vercelai/constants.js +1 -1
- package/build/esm/integrations/tracing/vercelai/constants.js.map +1 -1
- package/build/esm/integrations/tracing/vercelai/index.js +8 -54
- package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
- package/build/esm/integrations/tracing/vercelai/instrumentation.js +60 -158
- package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/preload.js +1 -14
- package/build/esm/preload.js.map +1 -1
- package/build/esm/sdk/diagnosticsChannelInjection.js +17 -0
- package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -0
- package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +30 -0
- package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
- package/build/esm/sdk/index.js +33 -36
- package/build/esm/sdk/index.js.map +1 -1
- package/build/esm/sdk/initOtel.js +77 -63
- package/build/esm/sdk/initOtel.js.map +1 -1
- package/build/esm/utils/redisCache.js +24 -52
- package/build/esm/utils/redisCache.js.map +1 -1
- package/build/esm/utils/setHttpServerSpanRouteAttribute.js +19 -0
- package/build/esm/utils/setHttpServerSpanRouteAttribute.js.map +1 -0
- package/build/import-hook.mjs +6 -0
- package/build/types/index.d.ts +6 -4
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
- package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -1
- package/build/types/integrations/featureFlagShims/openFeature.d.ts +3 -1
- package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -1
- package/build/types/integrations/featureFlagShims/statsig.d.ts +3 -1
- package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -1
- package/build/types/integrations/featureFlagShims/unleash.d.ts +3 -1
- package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -1
- package/build/types/integrations/fs/index.d.ts +14 -0
- package/build/types/integrations/fs/index.d.ts.map +1 -0
- package/build/types/integrations/fs/vendored/constants.d.ts +5 -0
- package/build/types/integrations/fs/vendored/constants.d.ts.map +1 -0
- package/build/types/integrations/fs/vendored/instrumentation.d.ts +3 -0
- package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/fs/vendored/types.d.ts +23 -0
- package/build/types/integrations/fs/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/fs/vendored/utils.d.ts +10 -0
- package/build/types/integrations/fs/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/http.d.ts +12 -17
- package/build/types/integrations/http.d.ts.map +1 -1
- package/build/types/integrations/node-fetch.d.ts +8 -35
- package/build/types/integrations/node-fetch.d.ts.map +1 -1
- package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts +9 -0
- package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts.map +1 -0
- package/build/types/integrations/tracing/{amqplib.d.ts → amqplib/index.d.ts} +5 -3
- package/build/types/integrations/tracing/amqplib/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +44 -0
- package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts +11 -0
- package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts +11 -0
- package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts.map +1 -0
- package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts +23 -0
- package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/amqplib/vendored/types.d.ts +49 -0
- package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts +42 -0
- package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/anthropic-ai/index.d.ts +11 -8
- package/build/types/integrations/tracing/anthropic-ai/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/{connect.d.ts → connect/index.d.ts} +5 -3
- package/build/types/integrations/tracing/connect/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +9 -0
- package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +1 -0
- package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +18 -0
- package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +31 -0
- package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/connect/vendored/utils.d.ts +5 -0
- package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/{dataloader.d.ts → dataloader/index.d.ts} +5 -3
- package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts +18 -0
- package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/dataloader/vendored/types.d.ts +22 -0
- package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/express.d.ts +15 -68
- package/build/types/integrations/tracing/express.d.ts.map +1 -1
- package/build/types/integrations/tracing/fastify/index.d.ts +6 -6
- package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/firebase/firebase.d.ts +3 -1
- package/build/types/integrations/tracing/firebase/firebase.d.ts.map +1 -1
- package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +4 -9
- package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts +2 -5
- package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts.map +1 -1
- package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts +3 -8
- package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts.map +1 -1
- package/build/types/integrations/tracing/firebase/otel/types.d.ts +0 -20
- package/build/types/integrations/tracing/firebase/otel/types.d.ts.map +1 -1
- package/build/types/integrations/tracing/{genericPool.d.ts → genericPool/index.d.ts} +5 -3
- package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +5 -0
- package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts +11 -0
- package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/google-genai/index.d.ts +11 -8
- package/build/types/integrations/tracing/google-genai/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/google-genai/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +5 -3
- package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/graphql/vendored/enum.d.ts +38 -0
- package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +1 -0
- package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +10 -0
- package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +1 -0
- package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts +2 -0
- package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +25 -0
- package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +63 -0
- package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts +3 -0
- package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +1 -0
- package/build/types/integrations/tracing/graphql/vendored/types.d.ts +33 -0
- package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +14 -0
- package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/hapi/index.d.ts +4 -2
- package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +6 -0
- package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +1 -0
- package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts +70 -0
- package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +72 -0
- package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts +32 -0
- package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +18 -0
- package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/hono/index.d.ts +9 -1
- package/build/types/integrations/tracing/hono/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 → kafka/index.d.ts} +5 -3
- package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +15 -0
- package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +79 -0
- package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +54 -0
- package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
- package/build/types/integrations/tracing/kafka/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/{knex.d.ts → knex/index.d.ts} +5 -3
- package/build/types/integrations/tracing/knex/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +12 -0
- package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +7 -0
- package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/knex/vendored/utils.d.ts +9 -0
- package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/{koa.d.ts → koa/index.d.ts} +5 -3
- package/build/types/integrations/tracing/koa/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +5 -0
- package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +1 -0
- package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +32 -0
- package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +34 -0
- package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/koa/vendored/types.d.ts +13 -0
- package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/koa/vendored/utils.d.ts +15 -0
- package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/langchain/index.d.ts +16 -12
- package/build/types/integrations/tracing/langchain/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/langchain/instrumentation.d.ts +10 -1
- package/build/types/integrations/tracing/langchain/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/langgraph/index.d.ts +11 -8
- package/build/types/integrations/tracing/langgraph/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/langgraph/instrumentation.d.ts +1 -1
- package/build/types/integrations/tracing/langgraph/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/{lrumemoizer.d.ts → lrumemoizer/index.d.ts} +5 -3
- package/build/types/integrations/tracing/lrumemoizer/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +6 -0
- package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -0
- package/build/{types-ts3.8/integrations/tracing/mongo.d.ts → types/integrations/tracing/mongo/index.d.ts} +22 -24
- package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +11 -0
- package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +62 -0
- package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
- package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +15 -0
- package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/{mongoose.d.ts → mongoose/index.d.ts} +5 -3
- package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +33 -0
- package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +18 -0
- package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +4 -0
- package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/{mysql.d.ts → mysql/index.d.ts} +5 -3
- package/build/types/integrations/tracing/mysql/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts +14 -0
- package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts +78 -0
- package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts +19 -0
- package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql/vendored/utils.d.ts +22 -0
- package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/{mysql2.d.ts → mysql2/index.d.ts} +5 -3
- package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +9 -0
- package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +39 -0
- package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts +3 -0
- package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +25 -0
- package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/openai/index.d.ts +11 -8
- package/build/types/integrations/tracing/openai/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +5 -3
- package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +6 -0
- package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +6 -0
- package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +12 -0
- package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +33 -0
- package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +20 -0
- package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts +54 -0
- package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +13 -0
- package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/types.d.ts +11 -0
- package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +56 -0
- package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgresjs.d.ts +3 -1
- package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
- package/build/types/integrations/tracing/redis/cache.d.ts +22 -0
- package/build/types/integrations/tracing/redis/cache.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis/index.d.ts +28 -0
- package/build/types/integrations/tracing/redis/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +10 -0
- package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +16 -0
- package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis/vendored/semconv.d.ts +4 -0
- package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis/vendored/types.d.ts +24 -0
- package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +5 -3
- package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +11 -0
- package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts +19 -0
- package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts +21 -0
- package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/tedious/vendored/utils.d.ts +9 -0
- package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/vercelai/constants.d.ts +1 -1
- package/build/types/integrations/tracing/vercelai/constants.d.ts.map +1 -1
- package/build/types/integrations/tracing/vercelai/index.d.ts +3 -2
- package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/vercelai/instrumentation.d.ts +2 -2
- package/build/types/integrations/tracing/vercelai/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/vercelai/types.d.ts +11 -4
- package/build/types/integrations/tracing/vercelai/types.d.ts.map +1 -1
- package/build/types/sdk/diagnosticsChannelInjection.d.ts +41 -0
- package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -0
- package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +37 -0
- package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -0
- package/build/types/sdk/index.d.ts +18 -0
- package/build/types/sdk/index.d.ts.map +1 -1
- package/build/types/sdk/initOtel.d.ts +2 -3
- package/build/types/sdk/initOtel.d.ts.map +1 -1
- package/build/types/utils/redisCache.d.ts +1 -1
- package/build/types/utils/redisCache.d.ts.map +1 -1
- package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts +9 -0
- package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts.map +1 -0
- package/build/types-ts3.8/index.d.ts +6 -4
- package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
- package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +3 -1
- package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +3 -1
- package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +3 -1
- package/build/types-ts3.8/integrations/fs/index.d.ts +14 -0
- package/build/types-ts3.8/integrations/fs/vendored/constants.d.ts +5 -0
- package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +3 -0
- package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +23 -0
- package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +15 -0
- package/build/types-ts3.8/integrations/http.d.ts +12 -17
- package/build/types-ts3.8/integrations/node-fetch.d.ts +8 -35
- package/build/types-ts3.8/integrations/tracing/InstrumentationNodeModuleFile.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing/{amqplib.d.ts → amqplib/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +44 -0
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/instrumentation.d.ts +11 -0
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/patches.d.ts +11 -0
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv.d.ts +23 -0
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/types.d.ts +49 -0
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/utils.d.ts +42 -0
- package/build/types-ts3.8/integrations/tracing/anthropic-ai/index.d.ts +11 -8
- package/build/types-ts3.8/integrations/tracing/{connect.d.ts → connect/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +18 -0
- package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +36 -0
- package/build/types-ts3.8/integrations/tracing/connect/vendored/utils.d.ts +5 -0
- package/build/types-ts3.8/integrations/tracing/{dataloader.d.ts → dataloader/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/dataloader/vendored/instrumentation.d.ts +18 -0
- package/build/types-ts3.8/integrations/tracing/dataloader/vendored/types.d.ts +22 -0
- package/build/types-ts3.8/integrations/tracing/express.d.ts +15 -68
- package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +6 -6
- package/build/types-ts3.8/integrations/tracing/firebase/firebase.d.ts +3 -1
- package/build/types-ts3.8/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +4 -9
- package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/firestore.d.ts +2 -5
- package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/functions.d.ts +3 -8
- package/build/types-ts3.8/integrations/tracing/firebase/otel/types.d.ts +0 -20
- package/build/types-ts3.8/integrations/tracing/{genericPool.d.ts → genericPool/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +5 -0
- package/build/types-ts3.8/integrations/tracing/genericPool/vendored/instrumentation.d.ts +11 -0
- package/build/types-ts3.8/integrations/tracing/google-genai/index.d.ts +11 -8
- package/build/types-ts3.8/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/enum.d.ts +38 -0
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/graphql-types.d.ts +2 -0
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +25 -0
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +63 -0
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/symbols.d.ts +3 -0
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +33 -0
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +14 -0
- package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +4 -2
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +6 -0
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/hapi-types.d.ts +70 -0
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +72 -0
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/internal-types.d.ts +32 -0
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +18 -0
- package/build/types-ts3.8/integrations/tracing/hono/index.d.ts +9 -1
- package/build/types-ts3.8/integrations/tracing/{kafka.d.ts → kafka/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/instrumentation.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +79 -0
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +54 -0
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
- package/build/types-ts3.8/integrations/tracing/{knex.d.ts → knex/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +12 -0
- package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +7 -0
- package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing/{koa.d.ts → koa/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +5 -0
- package/build/types-ts3.8/integrations/tracing/koa/vendored/instrumentation.d.ts +32 -0
- package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +34 -0
- package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +13 -0
- package/build/types-ts3.8/integrations/tracing/koa/vendored/utils.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing/langchain/index.d.ts +16 -12
- package/build/types-ts3.8/integrations/tracing/langchain/instrumentation.d.ts +10 -1
- package/build/types-ts3.8/integrations/tracing/langgraph/index.d.ts +11 -8
- package/build/types-ts3.8/integrations/tracing/langgraph/instrumentation.d.ts +1 -1
- package/build/types-ts3.8/integrations/tracing/{lrumemoizer.d.ts → lrumemoizer/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +6 -0
- package/build/{types/integrations/tracing/mongo.d.ts → types-ts3.8/integrations/tracing/mongo/index.d.ts} +22 -24
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +11 -0
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +62 -0
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing/{mongoose.d.ts → mongoose/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +33 -0
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +18 -0
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +4 -0
- package/build/types-ts3.8/integrations/tracing/{mysql.d.ts → mysql/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/instrumentation.d.ts +14 -0
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/mysql-types.d.ts +78 -0
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/semconv.d.ts +19 -0
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/utils.d.ts +22 -0
- package/build/types-ts3.8/integrations/tracing/{mysql2.d.ts → mysql2/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +39 -0
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/semconv.d.ts +3 -0
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +25 -0
- package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +11 -8
- package/build/types-ts3.8/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +6 -0
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +6 -0
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +12 -0
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +33 -0
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +20 -0
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-types.d.ts +54 -0
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +13 -0
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +11 -0
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +56 -0
- package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +3 -1
- package/build/types-ts3.8/integrations/tracing/redis/cache.d.ts +22 -0
- package/build/types-ts3.8/integrations/tracing/redis/index.d.ts +28 -0
- package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +16 -0
- package/build/types-ts3.8/integrations/tracing/redis/vendored/semconv.d.ts +4 -0
- package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +24 -0
- package/build/types-ts3.8/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +5 -3
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +11 -0
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/semconv.d.ts +19 -0
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/tedious-types.d.ts +21 -0
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/utils.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing/vercelai/constants.d.ts +1 -1
- package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +3 -2
- package/build/types-ts3.8/integrations/tracing/vercelai/instrumentation.d.ts +2 -2
- package/build/types-ts3.8/integrations/tracing/vercelai/types.d.ts +11 -4
- package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +41 -0
- package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +37 -0
- package/build/types-ts3.8/sdk/index.d.ts +18 -0
- package/build/types-ts3.8/sdk/initOtel.d.ts +3 -4
- package/build/types-ts3.8/utils/redisCache.d.ts +1 -1
- package/build/types-ts3.8/utils/setHttpServerSpanRouteAttribute.d.ts +9 -0
- package/changes.json +9 -5
- package/package.json +33 -41
- package/build/cjs/integrations/fs.js +0 -142
- package/build/cjs/integrations/fs.js.map +0 -1
- package/build/cjs/integrations/tracing/amqplib.js +0 -47
- package/build/cjs/integrations/tracing/amqplib.js.map +0 -1
- package/build/cjs/integrations/tracing/connect.js +0 -110
- package/build/cjs/integrations/tracing/connect.js.map +0 -1
- package/build/cjs/integrations/tracing/dataloader.js +0 -72
- package/build/cjs/integrations/tracing/dataloader.js.map +0 -1
- package/build/cjs/integrations/tracing/genericPool.js +0 -59
- package/build/cjs/integrations/tracing/genericPool.js.map +0 -1
- package/build/cjs/integrations/tracing/graphql.js +0 -127
- package/build/cjs/integrations/tracing/graphql.js.map +0 -1
- package/build/cjs/integrations/tracing/kafka.js +0 -48
- package/build/cjs/integrations/tracing/kafka.js.map +0 -1
- package/build/cjs/integrations/tracing/knex.js +0 -57
- package/build/cjs/integrations/tracing/knex.js.map +0 -1
- package/build/cjs/integrations/tracing/koa.js +0 -138
- package/build/cjs/integrations/tracing/koa.js.map +0 -1
- package/build/cjs/integrations/tracing/lrumemoizer.js +0 -37
- package/build/cjs/integrations/tracing/lrumemoizer.js.map +0 -1
- package/build/cjs/integrations/tracing/mongo.js +0 -93
- package/build/cjs/integrations/tracing/mongo.js.map +0 -1
- package/build/cjs/integrations/tracing/mongoose.js +0 -46
- package/build/cjs/integrations/tracing/mongoose.js.map +0 -1
- package/build/cjs/integrations/tracing/mysql.js +0 -38
- package/build/cjs/integrations/tracing/mysql.js.map +0 -1
- package/build/cjs/integrations/tracing/mysql2.js +0 -46
- package/build/cjs/integrations/tracing/mysql2.js.map +0 -1
- package/build/cjs/integrations/tracing/postgres.js +0 -48
- package/build/cjs/integrations/tracing/postgres.js.map +0 -1
- package/build/cjs/integrations/tracing/prisma.js +0 -203
- package/build/cjs/integrations/tracing/prisma.js.map +0 -1
- package/build/cjs/integrations/tracing/redis.js +0 -121
- package/build/cjs/integrations/tracing/redis.js.map +0 -1
- package/build/cjs/integrations/tracing/tedious.js +0 -67
- package/build/cjs/integrations/tracing/tedious.js.map +0 -1
- package/build/esm/integrations/fs.js +0 -140
- package/build/esm/integrations/fs.js.map +0 -1
- package/build/esm/integrations/tracing/amqplib.js +0 -44
- package/build/esm/integrations/tracing/amqplib.js.map +0 -1
- package/build/esm/integrations/tracing/connect.js +0 -106
- package/build/esm/integrations/tracing/connect.js.map +0 -1
- package/build/esm/integrations/tracing/dataloader.js +0 -69
- package/build/esm/integrations/tracing/dataloader.js.map +0 -1
- package/build/esm/integrations/tracing/genericPool.js +0 -56
- package/build/esm/integrations/tracing/genericPool.js.map +0 -1
- package/build/esm/integrations/tracing/graphql.js +0 -124
- package/build/esm/integrations/tracing/graphql.js.map +0 -1
- package/build/esm/integrations/tracing/kafka.js +0 -45
- package/build/esm/integrations/tracing/kafka.js.map +0 -1
- package/build/esm/integrations/tracing/knex.js +0 -54
- package/build/esm/integrations/tracing/knex.js.map +0 -1
- package/build/esm/integrations/tracing/koa.js +0 -134
- package/build/esm/integrations/tracing/koa.js.map +0 -1
- package/build/esm/integrations/tracing/lrumemoizer.js +0 -34
- package/build/esm/integrations/tracing/lrumemoizer.js.map +0 -1
- package/build/esm/integrations/tracing/mongo.js +0 -89
- package/build/esm/integrations/tracing/mongo.js.map +0 -1
- package/build/esm/integrations/tracing/mongoose.js +0 -43
- package/build/esm/integrations/tracing/mongoose.js.map +0 -1
- package/build/esm/integrations/tracing/mysql.js +0 -35
- package/build/esm/integrations/tracing/mysql.js.map +0 -1
- package/build/esm/integrations/tracing/mysql2.js +0 -43
- package/build/esm/integrations/tracing/mysql2.js.map +0 -1
- package/build/esm/integrations/tracing/postgres.js +0 -45
- package/build/esm/integrations/tracing/postgres.js.map +0 -1
- package/build/esm/integrations/tracing/prisma.js +0 -200
- package/build/esm/integrations/tracing/prisma.js.map +0 -1
- package/build/esm/integrations/tracing/redis.js +0 -117
- package/build/esm/integrations/tracing/redis.js.map +0 -1
- package/build/esm/integrations/tracing/tedious.js +0 -64
- package/build/esm/integrations/tracing/tedious.js.map +0 -1
- package/build/types/integrations/fs.d.ts +0 -24
- package/build/types/integrations/fs.d.ts.map +0 -1
- package/build/types/integrations/tracing/amqplib.d.ts.map +0 -1
- package/build/types/integrations/tracing/connect.d.ts.map +0 -1
- package/build/types/integrations/tracing/dataloader.d.ts.map +0 -1
- package/build/types/integrations/tracing/genericPool.d.ts.map +0 -1
- package/build/types/integrations/tracing/graphql.d.ts.map +0 -1
- package/build/types/integrations/tracing/kafka.d.ts.map +0 -1
- package/build/types/integrations/tracing/knex.d.ts.map +0 -1
- package/build/types/integrations/tracing/koa.d.ts.map +0 -1
- package/build/types/integrations/tracing/lrumemoizer.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongo.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongoose.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql2.d.ts.map +0 -1
- package/build/types/integrations/tracing/postgres.d.ts.map +0 -1
- package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -38
- package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts.map +0 -1
- package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -31
- package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts.map +0 -1
- package/build/types/integrations/tracing/prisma.d.ts +0 -50
- package/build/types/integrations/tracing/prisma.d.ts.map +0 -1
- package/build/types/integrations/tracing/redis.d.ts +0 -41
- package/build/types/integrations/tracing/redis.d.ts.map +0 -1
- package/build/types/integrations/tracing/tedious.d.ts.map +0 -1
- package/build/types-ts3.8/integrations/fs.d.ts +0 -24
- package/build/types-ts3.8/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts +0 -44
- package/build/types-ts3.8/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts +0 -34
- package/build/types-ts3.8/integrations/tracing/prisma.d.ts +0 -50
- package/build/types-ts3.8/integrations/tracing/redis.d.ts +0 -41
|
@@ -1,160 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { InstrumentationNodeModuleFile } from '../../../InstrumentationNodeModuleFile.js';
|
|
3
|
+
import { startSpanManual, SPAN_KIND, SPAN_STATUS_ERROR, captureException, flush, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @param tracer - Opentelemetry Tracer
|
|
7
|
-
* @param functionsSupportedVersions - supported versions of firebase-functions
|
|
8
|
-
* @param wrap - reference to native instrumentation wrap function
|
|
9
|
-
* @param unwrap - reference to native instrumentation unwrap function
|
|
10
|
-
* @param config - Firebase instrumentation config
|
|
11
|
-
*/
|
|
12
|
-
function patchFunctions(
|
|
13
|
-
tracer,
|
|
14
|
-
functionsSupportedVersions,
|
|
15
|
-
wrap,
|
|
16
|
-
unwrap,
|
|
17
|
-
config,
|
|
18
|
-
) {
|
|
19
|
-
let requestHook = () => {};
|
|
20
|
-
let responseHook = () => {};
|
|
21
|
-
const errorHook = config.functions?.errorHook;
|
|
22
|
-
const configRequestHook = config.functions?.requestHook;
|
|
23
|
-
const configResponseHook = config.functions?.responseHook;
|
|
24
|
-
|
|
25
|
-
if (typeof configResponseHook === 'function') {
|
|
26
|
-
responseHook = (span, err) => {
|
|
27
|
-
safeExecuteInTheMiddle(
|
|
28
|
-
() => configResponseHook(span, err),
|
|
29
|
-
error => {
|
|
30
|
-
if (!error) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
diag.error(error?.message);
|
|
34
|
-
},
|
|
35
|
-
true,
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
if (typeof configRequestHook === 'function') {
|
|
40
|
-
requestHook = (span) => {
|
|
41
|
-
safeExecuteInTheMiddle(
|
|
42
|
-
() => configRequestHook(span),
|
|
43
|
-
error => {
|
|
44
|
-
if (!error) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
diag.error(error?.message);
|
|
48
|
-
},
|
|
49
|
-
true,
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const moduleFunctionsCJS = new InstrumentationNodeModuleDefinition('firebase-functions', functionsSupportedVersions);
|
|
5
|
+
function patchFunctions(functionsSupportedVersions, wrap, unwrap) {
|
|
6
|
+
const moduleFunctionsCJS = new InstrumentationNodeModuleDefinition("firebase-functions", functionsSupportedVersions);
|
|
55
7
|
const modulesToInstrument = [
|
|
56
|
-
{ name:
|
|
57
|
-
{ name:
|
|
58
|
-
{ name:
|
|
59
|
-
{ name:
|
|
60
|
-
]
|
|
61
|
-
|
|
8
|
+
{ name: "firebase-functions/lib/v2/providers/https.js", triggerType: "function" },
|
|
9
|
+
{ name: "firebase-functions/lib/v2/providers/firestore.js", triggerType: "firestore" },
|
|
10
|
+
{ name: "firebase-functions/lib/v2/providers/scheduler.js", triggerType: "scheduler" },
|
|
11
|
+
{ name: "firebase-functions/lib/v2/storage.js", triggerType: "storage" }
|
|
12
|
+
];
|
|
62
13
|
modulesToInstrument.forEach(({ name, triggerType }) => {
|
|
63
14
|
moduleFunctionsCJS.files.push(
|
|
64
15
|
new InstrumentationNodeModuleFile(
|
|
65
16
|
name,
|
|
66
17
|
functionsSupportedVersions,
|
|
67
|
-
moduleExports =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
wrap,
|
|
71
|
-
unwrap,
|
|
72
|
-
tracer,
|
|
73
|
-
{ requestHook, responseHook, errorHook },
|
|
74
|
-
triggerType,
|
|
75
|
-
),
|
|
76
|
-
moduleExports => unwrapCommonFunctions(moduleExports, unwrap),
|
|
77
|
-
),
|
|
18
|
+
(moduleExports) => wrapCommonFunctions(moduleExports, wrap, unwrap, triggerType),
|
|
19
|
+
(moduleExports) => unwrapCommonFunctions(moduleExports, unwrap)
|
|
20
|
+
)
|
|
78
21
|
);
|
|
79
22
|
});
|
|
80
|
-
|
|
81
23
|
return moduleFunctionsCJS;
|
|
82
24
|
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Patches Cloud Functions for Firebase (v2) to add OpenTelemetry instrumentation
|
|
86
|
-
*
|
|
87
|
-
* @param tracer - Opentelemetry Tracer
|
|
88
|
-
* @param functionsConfig - Firebase instrumentation config
|
|
89
|
-
* @param triggerType - Type of trigger
|
|
90
|
-
* @returns A function that patches the function
|
|
91
|
-
*/
|
|
92
|
-
function patchV2Functions(
|
|
93
|
-
tracer,
|
|
94
|
-
functionsConfig,
|
|
95
|
-
triggerType,
|
|
96
|
-
) {
|
|
25
|
+
function patchV2Functions(triggerType) {
|
|
97
26
|
return function v2FunctionsWrapper(original) {
|
|
98
|
-
return function
|
|
99
|
-
const handler = typeof args[0] ===
|
|
100
|
-
const documentOrOptions = typeof args[0] ===
|
|
101
|
-
|
|
27
|
+
return function(...args) {
|
|
28
|
+
const handler = typeof args[0] === "function" ? args[0] : args[1];
|
|
29
|
+
const documentOrOptions = typeof args[0] === "function" ? void 0 : args[0];
|
|
102
30
|
if (!handler) {
|
|
103
31
|
return original.call(this, ...args);
|
|
104
32
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || 'unknown';
|
|
108
|
-
const span = tracer.startSpan(`firebase.function.${triggerType}`, {
|
|
109
|
-
kind: SpanKind.SERVER,
|
|
110
|
-
});
|
|
111
|
-
|
|
33
|
+
const wrappedHandler = async function(...handlerArgs) {
|
|
34
|
+
const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || "unknown";
|
|
112
35
|
const attributes = {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
36
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.firebase.otel.functions",
|
|
37
|
+
"faas.name": functionName,
|
|
38
|
+
"faas.trigger": triggerType,
|
|
39
|
+
"faas.provider": "firebase"
|
|
116
40
|
};
|
|
117
|
-
|
|
118
41
|
if (process.env.GCLOUD_PROJECT) {
|
|
119
|
-
attributes[
|
|
42
|
+
attributes["cloud.project_id"] = process.env.GCLOUD_PROJECT;
|
|
120
43
|
}
|
|
121
|
-
|
|
122
44
|
if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) {
|
|
123
|
-
attributes[
|
|
45
|
+
attributes["cloud.event_source"] = process.env.EVENTARC_CLOUD_EVENT_SOURCE;
|
|
124
46
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if (error) {
|
|
150
|
-
await functionsConfig?.errorHook?.(span, error);
|
|
151
|
-
throw error;
|
|
47
|
+
return startSpanManual(
|
|
48
|
+
{
|
|
49
|
+
name: `firebase.function.${triggerType}`,
|
|
50
|
+
op: "http.request",
|
|
51
|
+
kind: SPAN_KIND.SERVER,
|
|
52
|
+
attributes
|
|
53
|
+
},
|
|
54
|
+
async (span) => {
|
|
55
|
+
try {
|
|
56
|
+
const result = await handler.apply(this, handlerArgs);
|
|
57
|
+
span.end();
|
|
58
|
+
return result;
|
|
59
|
+
} catch (error) {
|
|
60
|
+
span.setStatus({ code: SPAN_STATUS_ERROR });
|
|
61
|
+
captureException(error, {
|
|
62
|
+
mechanism: {
|
|
63
|
+
type: "auto.firebase.otel.functions",
|
|
64
|
+
handled: false
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
span.end();
|
|
68
|
+
await flush(2e3);
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
152
71
|
}
|
|
153
|
-
|
|
154
|
-
return result;
|
|
155
|
-
});
|
|
72
|
+
);
|
|
156
73
|
};
|
|
157
|
-
|
|
158
74
|
if (documentOrOptions) {
|
|
159
75
|
return original.call(this, documentOrOptions, wrappedHandler);
|
|
160
76
|
} else {
|
|
@@ -163,93 +79,53 @@ function patchV2Functions(
|
|
|
163
79
|
};
|
|
164
80
|
};
|
|
165
81
|
}
|
|
166
|
-
|
|
167
|
-
function wrapCommonFunctions(
|
|
168
|
-
moduleExports,
|
|
169
|
-
wrap,
|
|
170
|
-
unwrap,
|
|
171
|
-
tracer,
|
|
172
|
-
functionsConfig,
|
|
173
|
-
triggerType,
|
|
174
|
-
) {
|
|
82
|
+
function wrapCommonFunctions(moduleExports, wrap, unwrap, triggerType) {
|
|
175
83
|
unwrapCommonFunctions(moduleExports, unwrap);
|
|
176
|
-
|
|
177
84
|
switch (triggerType) {
|
|
178
|
-
case
|
|
179
|
-
wrap(moduleExports,
|
|
180
|
-
wrap(moduleExports,
|
|
85
|
+
case "function":
|
|
86
|
+
wrap(moduleExports, "onRequest", patchV2Functions("http.request"));
|
|
87
|
+
wrap(moduleExports, "onCall", patchV2Functions("http.call"));
|
|
181
88
|
break;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
wrap(moduleExports,
|
|
185
|
-
wrap(moduleExports,
|
|
186
|
-
wrap(moduleExports,
|
|
187
|
-
wrap(moduleExports,
|
|
188
|
-
wrap(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
patchV2Functions(tracer, functionsConfig, 'firestore.document.created'),
|
|
192
|
-
);
|
|
193
|
-
wrap(
|
|
194
|
-
moduleExports,
|
|
195
|
-
'onDocumentUpdatedWithAuthContext',
|
|
196
|
-
patchV2Functions(tracer, functionsConfig, 'firestore.document.updated'),
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
wrap(
|
|
200
|
-
moduleExports,
|
|
201
|
-
'onDocumentDeletedWithAuthContext',
|
|
202
|
-
patchV2Functions(tracer, functionsConfig, 'firestore.document.deleted'),
|
|
203
|
-
);
|
|
204
|
-
|
|
205
|
-
wrap(
|
|
206
|
-
moduleExports,
|
|
207
|
-
'onDocumentWrittenWithAuthContext',
|
|
208
|
-
patchV2Functions(tracer, functionsConfig, 'firestore.document.written'),
|
|
209
|
-
);
|
|
89
|
+
case "firestore":
|
|
90
|
+
wrap(moduleExports, "onDocumentCreated", patchV2Functions("firestore.document.created"));
|
|
91
|
+
wrap(moduleExports, "onDocumentUpdated", patchV2Functions("firestore.document.updated"));
|
|
92
|
+
wrap(moduleExports, "onDocumentDeleted", patchV2Functions("firestore.document.deleted"));
|
|
93
|
+
wrap(moduleExports, "onDocumentWritten", patchV2Functions("firestore.document.written"));
|
|
94
|
+
wrap(moduleExports, "onDocumentCreatedWithAuthContext", patchV2Functions("firestore.document.created"));
|
|
95
|
+
wrap(moduleExports, "onDocumentUpdatedWithAuthContext", patchV2Functions("firestore.document.updated"));
|
|
96
|
+
wrap(moduleExports, "onDocumentDeletedWithAuthContext", patchV2Functions("firestore.document.deleted"));
|
|
97
|
+
wrap(moduleExports, "onDocumentWrittenWithAuthContext", patchV2Functions("firestore.document.written"));
|
|
210
98
|
break;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
wrap(moduleExports, 'onSchedule', patchV2Functions(tracer, functionsConfig, 'scheduler.scheduled'));
|
|
99
|
+
case "scheduler":
|
|
100
|
+
wrap(moduleExports, "onSchedule", patchV2Functions("scheduler.scheduled"));
|
|
214
101
|
break;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
wrap(moduleExports,
|
|
218
|
-
wrap(moduleExports,
|
|
219
|
-
wrap(moduleExports,
|
|
220
|
-
wrap(
|
|
221
|
-
moduleExports,
|
|
222
|
-
'onObjectMetadataUpdated',
|
|
223
|
-
patchV2Functions(tracer, functionsConfig, 'storage.object.metadataUpdated'),
|
|
224
|
-
);
|
|
102
|
+
case "storage":
|
|
103
|
+
wrap(moduleExports, "onObjectFinalized", patchV2Functions("storage.object.finalized"));
|
|
104
|
+
wrap(moduleExports, "onObjectArchived", patchV2Functions("storage.object.archived"));
|
|
105
|
+
wrap(moduleExports, "onObjectDeleted", patchV2Functions("storage.object.deleted"));
|
|
106
|
+
wrap(moduleExports, "onObjectMetadataUpdated", patchV2Functions("storage.object.metadataUpdated"));
|
|
225
107
|
break;
|
|
226
108
|
}
|
|
227
|
-
|
|
228
109
|
return moduleExports;
|
|
229
110
|
}
|
|
230
|
-
|
|
231
|
-
function unwrapCommonFunctions(
|
|
232
|
-
moduleExports,
|
|
233
|
-
unwrap,
|
|
234
|
-
) {
|
|
111
|
+
function unwrapCommonFunctions(moduleExports, unwrap) {
|
|
235
112
|
const methods = [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
113
|
+
"onSchedule",
|
|
114
|
+
"onRequest",
|
|
115
|
+
"onCall",
|
|
116
|
+
"onObjectFinalized",
|
|
117
|
+
"onObjectArchived",
|
|
118
|
+
"onObjectDeleted",
|
|
119
|
+
"onObjectMetadataUpdated",
|
|
120
|
+
"onDocumentCreated",
|
|
121
|
+
"onDocumentUpdated",
|
|
122
|
+
"onDocumentDeleted",
|
|
123
|
+
"onDocumentWritten",
|
|
124
|
+
"onDocumentCreatedWithAuthContext",
|
|
125
|
+
"onDocumentUpdatedWithAuthContext",
|
|
126
|
+
"onDocumentDeletedWithAuthContext",
|
|
127
|
+
"onDocumentWrittenWithAuthContext"
|
|
251
128
|
];
|
|
252
|
-
|
|
253
129
|
for (const method of methods) {
|
|
254
130
|
if (isWrapped(moduleExports[method])) {
|
|
255
131
|
unwrap(moduleExports, method);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sources":["../../../../../../../src/integrations/tracing/firebase/otel/patches/functions.ts"],"sourcesContent":["import type { Span, Tracer } from '@opentelemetry/api';\nimport { context, diag, SpanKind, trace } from '@opentelemetry/api';\nimport type { InstrumentationBase } from '@opentelemetry/instrumentation';\nimport {\n InstrumentationNodeModuleDefinition,\n InstrumentationNodeModuleFile,\n isWrapped,\n safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport type { SpanAttributes } from '@sentry/core';\nimport type { FirebaseInstrumentation } from '../firebaseInstrumentation';\nimport type {\n AvailableFirebaseFunctions,\n FirebaseFunctions,\n FirebaseInstrumentationConfig,\n OverloadedParameters,\n RequestHook,\n ResponseHook,\n} from '../types';\n\n/**\n * Patches Firebase Functions v2 to add OpenTelemetry instrumentation\n * @param tracer - Opentelemetry Tracer\n * @param functionsSupportedVersions - supported versions of firebase-functions\n * @param wrap - reference to native instrumentation wrap function\n * @param unwrap - reference to native instrumentation unwrap function\n * @param config - Firebase instrumentation config\n */\nexport function patchFunctions(\n tracer: Tracer,\n functionsSupportedVersions: string[],\n wrap: InstrumentationBase['_wrap'],\n unwrap: InstrumentationBase['_unwrap'],\n config: FirebaseInstrumentationConfig,\n): InstrumentationNodeModuleDefinition {\n let requestHook: RequestHook = () => {};\n let responseHook: ResponseHook = () => {};\n const errorHook = config.functions?.errorHook;\n const configRequestHook = config.functions?.requestHook;\n const configResponseHook = config.functions?.responseHook;\n\n if (typeof configResponseHook === 'function') {\n responseHook = (span: Span, err: unknown) => {\n safeExecuteInTheMiddle(\n () => configResponseHook(span, err),\n error => {\n if (!error) {\n return;\n }\n diag.error(error?.message);\n },\n true,\n );\n };\n }\n if (typeof configRequestHook === 'function') {\n requestHook = (span: Span) => {\n safeExecuteInTheMiddle(\n () => configRequestHook(span),\n error => {\n if (!error) {\n return;\n }\n diag.error(error?.message);\n },\n true,\n );\n };\n }\n\n const moduleFunctionsCJS = new InstrumentationNodeModuleDefinition('firebase-functions', functionsSupportedVersions);\n const modulesToInstrument = [\n { name: 'firebase-functions/lib/v2/providers/https.js', triggerType: 'function' },\n { name: 'firebase-functions/lib/v2/providers/firestore.js', triggerType: 'firestore' },\n { name: 'firebase-functions/lib/v2/providers/scheduler.js', triggerType: 'scheduler' },\n { name: 'firebase-functions/lib/v2/storage.js', triggerType: 'storage' },\n ] as const;\n\n modulesToInstrument.forEach(({ name, triggerType }) => {\n moduleFunctionsCJS.files.push(\n new InstrumentationNodeModuleFile(\n name,\n functionsSupportedVersions,\n moduleExports =>\n wrapCommonFunctions(\n moduleExports,\n wrap,\n unwrap,\n tracer,\n { requestHook, responseHook, errorHook },\n triggerType,\n ),\n moduleExports => unwrapCommonFunctions(moduleExports, unwrap),\n ),\n );\n });\n\n return moduleFunctionsCJS;\n}\n\n/**\n * Patches Cloud Functions for Firebase (v2) to add OpenTelemetry instrumentation\n *\n * @param tracer - Opentelemetry Tracer\n * @param functionsConfig - Firebase instrumentation config\n * @param triggerType - Type of trigger\n * @returns A function that patches the function\n */\nexport function patchV2Functions<T extends FirebaseFunctions = FirebaseFunctions>(\n tracer: Tracer,\n functionsConfig: FirebaseInstrumentationConfig['functions'],\n triggerType: string,\n): (original: T) => (...args: OverloadedParameters<T>) => ReturnType<T> {\n return function v2FunctionsWrapper(original: T): (...args: OverloadedParameters<T>) => ReturnType<T> {\n return function (this: FirebaseInstrumentation, ...args: OverloadedParameters<T>): ReturnType<T> {\n const handler = typeof args[0] === 'function' ? args[0] : args[1];\n const documentOrOptions = typeof args[0] === 'function' ? undefined : args[0];\n\n if (!handler) {\n return original.call(this, ...args);\n }\n\n const wrappedHandler = async function (this: unknown, ...handlerArgs: unknown[]): Promise<unknown> {\n const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || 'unknown';\n const span = tracer.startSpan(`firebase.function.${triggerType}`, {\n kind: SpanKind.SERVER,\n });\n\n const attributes: SpanAttributes = {\n 'faas.name': functionName,\n 'faas.trigger': triggerType,\n 'faas.provider': 'firebase',\n };\n\n if (process.env.GCLOUD_PROJECT) {\n attributes['cloud.project_id'] = process.env.GCLOUD_PROJECT;\n }\n\n if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) {\n attributes['cloud.event_source'] = process.env.EVENTARC_CLOUD_EVENT_SOURCE;\n }\n\n span.setAttributes(attributes);\n functionsConfig?.requestHook?.(span);\n\n // Can be changed to safeExecuteInTheMiddleAsync once following is merged and released\n // https://github.com/open-telemetry/opentelemetry-js/pull/6032\n return context.with(trace.setSpan(context.active(), span), async () => {\n let error: Error | undefined;\n let result: T | undefined;\n\n try {\n result = await handler.apply(this, handlerArgs);\n } catch (e) {\n error = e as Error;\n }\n\n functionsConfig?.responseHook?.(span, error);\n\n if (error) {\n span.recordException(error);\n }\n\n span.end();\n\n if (error) {\n await functionsConfig?.errorHook?.(span, error);\n throw error;\n }\n\n return result;\n });\n };\n\n if (documentOrOptions) {\n return original.call(this, documentOrOptions, wrappedHandler);\n } else {\n return original.call(this, wrappedHandler);\n }\n };\n };\n}\n\nfunction wrapCommonFunctions(\n moduleExports: AvailableFirebaseFunctions,\n wrap: InstrumentationBase<FirebaseInstrumentationConfig>['_wrap'],\n unwrap: InstrumentationBase<FirebaseInstrumentationConfig>['_unwrap'],\n tracer: Tracer,\n functionsConfig: FirebaseInstrumentationConfig['functions'],\n triggerType: 'function' | 'firestore' | 'scheduler' | 'storage',\n): AvailableFirebaseFunctions {\n unwrapCommonFunctions(moduleExports, unwrap);\n\n switch (triggerType) {\n case 'function':\n wrap(moduleExports, 'onRequest', patchV2Functions(tracer, functionsConfig, 'http.request'));\n wrap(moduleExports, 'onCall', patchV2Functions(tracer, functionsConfig, 'http.call'));\n break;\n\n case 'firestore':\n wrap(moduleExports, 'onDocumentCreated', patchV2Functions(tracer, functionsConfig, 'firestore.document.created'));\n wrap(moduleExports, 'onDocumentUpdated', patchV2Functions(tracer, functionsConfig, 'firestore.document.updated'));\n wrap(moduleExports, 'onDocumentDeleted', patchV2Functions(tracer, functionsConfig, 'firestore.document.deleted'));\n wrap(moduleExports, 'onDocumentWritten', patchV2Functions(tracer, functionsConfig, 'firestore.document.written'));\n wrap(\n moduleExports,\n 'onDocumentCreatedWithAuthContext',\n patchV2Functions(tracer, functionsConfig, 'firestore.document.created'),\n );\n wrap(\n moduleExports,\n 'onDocumentUpdatedWithAuthContext',\n patchV2Functions(tracer, functionsConfig, 'firestore.document.updated'),\n );\n\n wrap(\n moduleExports,\n 'onDocumentDeletedWithAuthContext',\n patchV2Functions(tracer, functionsConfig, 'firestore.document.deleted'),\n );\n\n wrap(\n moduleExports,\n 'onDocumentWrittenWithAuthContext',\n patchV2Functions(tracer, functionsConfig, 'firestore.document.written'),\n );\n break;\n\n case 'scheduler':\n wrap(moduleExports, 'onSchedule', patchV2Functions(tracer, functionsConfig, 'scheduler.scheduled'));\n break;\n\n case 'storage':\n wrap(moduleExports, 'onObjectFinalized', patchV2Functions(tracer, functionsConfig, 'storage.object.finalized'));\n wrap(moduleExports, 'onObjectArchived', patchV2Functions(tracer, functionsConfig, 'storage.object.archived'));\n wrap(moduleExports, 'onObjectDeleted', patchV2Functions(tracer, functionsConfig, 'storage.object.deleted'));\n wrap(\n moduleExports,\n 'onObjectMetadataUpdated',\n patchV2Functions(tracer, functionsConfig, 'storage.object.metadataUpdated'),\n );\n break;\n }\n\n return moduleExports;\n}\n\nfunction unwrapCommonFunctions(\n moduleExports: AvailableFirebaseFunctions,\n unwrap: InstrumentationBase<FirebaseInstrumentationConfig>['_unwrap'],\n): AvailableFirebaseFunctions {\n const methods: (keyof AvailableFirebaseFunctions)[] = [\n 'onSchedule',\n 'onRequest',\n 'onCall',\n 'onObjectFinalized',\n 'onObjectArchived',\n 'onObjectDeleted',\n 'onObjectMetadataUpdated',\n 'onDocumentCreated',\n 'onDocumentUpdated',\n 'onDocumentDeleted',\n 'onDocumentWritten',\n 'onDocumentCreatedWithAuthContext',\n 'onDocumentUpdatedWithAuthContext',\n 'onDocumentDeletedWithAuthContext',\n 'onDocumentWrittenWithAuthContext',\n ];\n\n for (const method of methods) {\n if (isWrapped(moduleExports[method])) {\n unwrap(moduleExports, method);\n }\n }\n return moduleExports;\n}\n"],"names":[],"mappings":";;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc;AAC9B,EAAE,MAAM;AACR,EAAE,0BAA0B;AAC5B,EAAE,IAAI;AACN,EAAE,MAAM;AACR,EAAE,MAAM;AACR,EAAuC;AACvC,EAAE,IAAI,WAAW,GAAgB,MAAM,CAAC,CAAC;AACzC,EAAE,IAAI,YAAY,GAAiB,MAAM,CAAC,CAAC;AAC3C,EAAE,MAAM,SAAA,GAAY,MAAM,CAAC,SAAS,EAAE,SAAS;AAC/C,EAAE,MAAM,iBAAA,GAAoB,MAAM,CAAC,SAAS,EAAE,WAAW;AACzD,EAAE,MAAM,kBAAA,GAAqB,MAAM,CAAC,SAAS,EAAE,YAAY;;AAE3D,EAAE,IAAI,OAAO,kBAAA,KAAuB,UAAU,EAAE;AAChD,IAAI,eAAe,CAAC,IAAI,EAAQ,GAAG,KAAc;AACjD,MAAM,sBAAsB;AAC5B,QAAQ,MAAM,kBAAkB,CAAC,IAAI,EAAE,GAAG,CAAC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A;AACA,IAAA,mBAAA;AACA,IAAA,mBAAA;AACA,IAAA,mBAAA;AACA,IAAA,mBAAA;AACA,IAAA,kCAAA;AACA,IAAA,kCAAA;AACA,IAAA,kCAAA;AACA,IAAA,kCAAA;AACA,GAAA;;AAEA,EAAA,KAAA,MAAA,MAAA,IAAA,OAAA,EAAA;AACA,IAAA,IAAA,SAAA,CAAA,aAAA,CAAA,MAAA,CAAA,CAAA,EAAA;AACA,MAAA,MAAA,CAAA,aAAA,EAAA,MAAA,CAAA;AACA,IAAA;AACA,EAAA;AACA,EAAA,OAAA,aAAA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"functions.js","sources":["../../../../../../../src/integrations/tracing/firebase/otel/patches/functions.ts"],"sourcesContent":["import type { InstrumentationBase } from '@opentelemetry/instrumentation';\nimport { InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport { InstrumentationNodeModuleFile } from '../../../InstrumentationNodeModuleFile';\nimport type { SpanAttributes } from '@sentry/core';\nimport {\n captureException,\n flush,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startSpanManual,\n} from '@sentry/core';\nimport type { FirebaseInstrumentation } from '../firebaseInstrumentation';\nimport type { AvailableFirebaseFunctions, FirebaseFunctions, OverloadedParameters } from '../types';\n\n/**\n * Patches Firebase Functions v2 to add OpenTelemetry instrumentation\n * @param functionsSupportedVersions - supported versions of firebase-functions\n * @param wrap - reference to native instrumentation wrap function\n * @param unwrap - reference to native instrumentation unwrap function\n */\nexport function patchFunctions(\n functionsSupportedVersions: string[],\n wrap: InstrumentationBase['_wrap'],\n unwrap: InstrumentationBase['_unwrap'],\n): InstrumentationNodeModuleDefinition {\n const moduleFunctionsCJS = new InstrumentationNodeModuleDefinition('firebase-functions', functionsSupportedVersions);\n const modulesToInstrument = [\n { name: 'firebase-functions/lib/v2/providers/https.js', triggerType: 'function' },\n { name: 'firebase-functions/lib/v2/providers/firestore.js', triggerType: 'firestore' },\n { name: 'firebase-functions/lib/v2/providers/scheduler.js', triggerType: 'scheduler' },\n { name: 'firebase-functions/lib/v2/storage.js', triggerType: 'storage' },\n ] as const;\n\n modulesToInstrument.forEach(({ name, triggerType }) => {\n moduleFunctionsCJS.files.push(\n new InstrumentationNodeModuleFile(\n name,\n functionsSupportedVersions,\n moduleExports => wrapCommonFunctions(moduleExports, wrap, unwrap, triggerType),\n moduleExports => unwrapCommonFunctions(moduleExports, unwrap),\n ),\n );\n });\n\n return moduleFunctionsCJS;\n}\n\n/**\n * Patches Cloud Functions for Firebase (v2) to add OpenTelemetry instrumentation\n *\n * @param triggerType - Type of trigger\n * @returns A function that patches the function\n */\nexport function patchV2Functions<T extends FirebaseFunctions = FirebaseFunctions>(\n triggerType: string,\n): (original: T) => (...args: OverloadedParameters<T>) => ReturnType<T> {\n return function v2FunctionsWrapper(original: T): (...args: OverloadedParameters<T>) => ReturnType<T> {\n return function (this: FirebaseInstrumentation, ...args: OverloadedParameters<T>): ReturnType<T> {\n const handler = typeof args[0] === 'function' ? args[0] : args[1];\n const documentOrOptions = typeof args[0] === 'function' ? undefined : args[0];\n\n if (!handler) {\n return original.call(this, ...args);\n }\n\n const wrappedHandler = async function (this: unknown, ...handlerArgs: unknown[]): Promise<unknown> {\n const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || 'unknown';\n\n const attributes: SpanAttributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.firebase.otel.functions',\n 'faas.name': functionName,\n 'faas.trigger': triggerType,\n 'faas.provider': 'firebase',\n };\n\n if (process.env.GCLOUD_PROJECT) {\n attributes['cloud.project_id'] = process.env.GCLOUD_PROJECT;\n }\n\n if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) {\n attributes['cloud.event_source'] = process.env.EVENTARC_CLOUD_EVENT_SOURCE;\n }\n\n // `startSpanManual` to keep the span active but while still allowing us to end it before flushing on error.\n return startSpanManual(\n {\n name: `firebase.function.${triggerType}`,\n op: 'http.request',\n kind: SPAN_KIND.SERVER,\n attributes,\n },\n async span => {\n try {\n const result = await handler.apply(this, handlerArgs);\n span.end();\n return result;\n } catch (error) {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n captureException(error, {\n mechanism: {\n type: 'auto.firebase.otel.functions',\n handled: false,\n },\n });\n span.end();\n await flush(2000);\n throw error;\n }\n },\n );\n };\n\n if (documentOrOptions) {\n return original.call(this, documentOrOptions, wrappedHandler);\n } else {\n return original.call(this, wrappedHandler);\n }\n };\n };\n}\n\nfunction wrapCommonFunctions(\n moduleExports: AvailableFirebaseFunctions,\n wrap: InstrumentationBase['_wrap'],\n unwrap: InstrumentationBase['_unwrap'],\n triggerType: 'function' | 'firestore' | 'scheduler' | 'storage',\n): AvailableFirebaseFunctions {\n unwrapCommonFunctions(moduleExports, unwrap);\n\n switch (triggerType) {\n case 'function':\n wrap(moduleExports, 'onRequest', patchV2Functions('http.request'));\n wrap(moduleExports, 'onCall', patchV2Functions('http.call'));\n break;\n\n case 'firestore':\n wrap(moduleExports, 'onDocumentCreated', patchV2Functions('firestore.document.created'));\n wrap(moduleExports, 'onDocumentUpdated', patchV2Functions('firestore.document.updated'));\n wrap(moduleExports, 'onDocumentDeleted', patchV2Functions('firestore.document.deleted'));\n wrap(moduleExports, 'onDocumentWritten', patchV2Functions('firestore.document.written'));\n wrap(moduleExports, 'onDocumentCreatedWithAuthContext', patchV2Functions('firestore.document.created'));\n wrap(moduleExports, 'onDocumentUpdatedWithAuthContext', patchV2Functions('firestore.document.updated'));\n wrap(moduleExports, 'onDocumentDeletedWithAuthContext', patchV2Functions('firestore.document.deleted'));\n wrap(moduleExports, 'onDocumentWrittenWithAuthContext', patchV2Functions('firestore.document.written'));\n break;\n\n case 'scheduler':\n wrap(moduleExports, 'onSchedule', patchV2Functions('scheduler.scheduled'));\n break;\n\n case 'storage':\n wrap(moduleExports, 'onObjectFinalized', patchV2Functions('storage.object.finalized'));\n wrap(moduleExports, 'onObjectArchived', patchV2Functions('storage.object.archived'));\n wrap(moduleExports, 'onObjectDeleted', patchV2Functions('storage.object.deleted'));\n wrap(moduleExports, 'onObjectMetadataUpdated', patchV2Functions('storage.object.metadataUpdated'));\n break;\n }\n\n return moduleExports;\n}\n\nfunction unwrapCommonFunctions(\n moduleExports: AvailableFirebaseFunctions,\n unwrap: InstrumentationBase['_unwrap'],\n): AvailableFirebaseFunctions {\n const methods: (keyof AvailableFirebaseFunctions)[] = [\n 'onSchedule',\n 'onRequest',\n 'onCall',\n 'onObjectFinalized',\n 'onObjectArchived',\n 'onObjectDeleted',\n 'onObjectMetadataUpdated',\n 'onDocumentCreated',\n 'onDocumentUpdated',\n 'onDocumentDeleted',\n 'onDocumentWritten',\n 'onDocumentCreatedWithAuthContext',\n 'onDocumentUpdatedWithAuthContext',\n 'onDocumentDeletedWithAuthContext',\n 'onDocumentWrittenWithAuthContext',\n ];\n\n for (const method of methods) {\n if (isWrapped(moduleExports[method])) {\n unwrap(moduleExports, method);\n }\n }\n return moduleExports;\n}\n"],"names":[],"mappings":";;;;AAqBO,SAAS,cAAA,CACd,0BAAA,EACA,IAAA,EACA,MAAA,EACqC;AACrC,EAAA,MAAM,kBAAA,GAAqB,IAAI,mCAAA,CAAoC,oBAAA,EAAsB,0BAA0B,CAAA;AACnH,EAAA,MAAM,mBAAA,GAAsB;AAAA,IAC1B,EAAE,IAAA,EAAM,8CAAA,EAAgD,WAAA,EAAa,UAAA,EAAW;AAAA,IAChF,EAAE,IAAA,EAAM,kDAAA,EAAoD,WAAA,EAAa,WAAA,EAAY;AAAA,IACrF,EAAE,IAAA,EAAM,kDAAA,EAAoD,WAAA,EAAa,WAAA,EAAY;AAAA,IACrF,EAAE,IAAA,EAAM,sCAAA,EAAwC,WAAA,EAAa,SAAA;AAAU,GACzE;AAEA,EAAA,mBAAA,CAAoB,OAAA,CAAQ,CAAC,EAAE,IAAA,EAAM,aAAY,KAAM;AACrD,IAAA,kBAAA,CAAmB,KAAA,CA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AoB,gBAAA,CAAiB,yBAAyB,CAAC,CAAA;AACnF,MAAA,IAAA,CAAK,aAAA,EAAe,iBAAA,EAAmB,gBAAA,CAAiB,wBAAwB,CAAC,CAAA;AACjF,MAAA,IAAA,CAAK,aAAA,EAAe,yBAAA,EAA2B,gBAAA,CAAiB,gCAAgC,CAAC,CAAA;AACjG,MAAA;AAAA;AAGJ,EAAA,OAAO,aAAA;AACT;AAEA,SAAS,qBAAA,CACP,eACA,MAAA,EAC4B;AAC5B,EAAA,MAAM,OAAA,GAAgD;AAAA,IACpD,YAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,mBAAA;AAAA,IACA,kBAAA;AAAA,IACA,iBAAA;AAAA,IACA,yBAAA;AAAA,IACA,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA,kCAAA;AAAA,IACA,kCAAA;AAAA,IACA,kCAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,KAAA,MAAW,UAAU,OAAA,EAAS;AAC5B,IAAA,IAAI,SAAA,CAAU,aAAA,CAAc,MAAM,CAAC,CAAA,EAAG;AACpC,MAAA,MAAA,CAAO,eAAe,MAAM,CAAA;AAAA,IAC9B;AAAA,EACF;AACA,EAAA,OAAO,aAAA;AACT;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { GenericPoolInstrumentation } from './vendored/instrumentation.js';
|
|
2
|
+
import { defineIntegration } from '@sentry/core';
|
|
3
|
+
import { generateInstrumentOnce } from '@sentry/node-core';
|
|
4
|
+
|
|
5
|
+
const INTEGRATION_NAME = "GenericPool";
|
|
6
|
+
const instrumentGenericPool = generateInstrumentOnce(INTEGRATION_NAME, () => new GenericPoolInstrumentation({}));
|
|
7
|
+
const _genericPoolIntegration = (() => {
|
|
8
|
+
return {
|
|
9
|
+
name: INTEGRATION_NAME,
|
|
10
|
+
setupOnce() {
|
|
11
|
+
instrumentGenericPool();
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
const genericPoolIntegration = defineIntegration(_genericPoolIntegration);
|
|
16
|
+
|
|
17
|
+
export { genericPoolIntegration, instrumentGenericPool };
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/genericPool/index.ts"],"sourcesContent":["import { GenericPoolInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'GenericPool' as const;\n\nexport const instrumentGenericPool = generateInstrumentOnce(INTEGRATION_NAME, () => new GenericPoolInstrumentation({}));\n\nconst _genericPoolIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentGenericPool();\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":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,aAAA;AAElB,MAAM,qBAAA,GAAwB,uBAAuB,gBAAA,EAAkB,MAAM,IAAI,0BAAA,CAA2B,EAAE,CAAC;AAEtH,MAAM,2BAA2B,MAAM;AACrC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,qBAAA,EAAsB;AAAA,IACxB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,sBAAA,GAAyB,kBAAkB,uBAAuB;;;;"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { SDK_VERSION, startSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startSpanManual, SPAN_STATUS_ERROR } from '@sentry/core';
|
|
3
|
+
|
|
4
|
+
const MODULE_NAME = "generic-pool";
|
|
5
|
+
const PACKAGE_NAME = "@sentry/instrumentation-generic-pool";
|
|
6
|
+
class GenericPoolInstrumentation extends InstrumentationBase {
|
|
7
|
+
constructor(config = {}) {
|
|
8
|
+
super(PACKAGE_NAME, SDK_VERSION, config);
|
|
9
|
+
// only used for v2 - v2.3)
|
|
10
|
+
this._isDisabled = false;
|
|
11
|
+
}
|
|
12
|
+
init() {
|
|
13
|
+
return [
|
|
14
|
+
new InstrumentationNodeModuleDefinition(
|
|
15
|
+
MODULE_NAME,
|
|
16
|
+
[">=3.0.0 <4"],
|
|
17
|
+
(moduleExports) => {
|
|
18
|
+
const Pool = moduleExports.Pool;
|
|
19
|
+
if (isWrapped(Pool.prototype.acquire)) {
|
|
20
|
+
this._unwrap(Pool.prototype, "acquire");
|
|
21
|
+
}
|
|
22
|
+
this._wrap(Pool.prototype, "acquire", this._acquirePatcher.bind(this));
|
|
23
|
+
return moduleExports;
|
|
24
|
+
},
|
|
25
|
+
(moduleExports) => {
|
|
26
|
+
const Pool = moduleExports.Pool;
|
|
27
|
+
this._unwrap(Pool.prototype, "acquire");
|
|
28
|
+
return moduleExports;
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
new InstrumentationNodeModuleDefinition(
|
|
32
|
+
MODULE_NAME,
|
|
33
|
+
[">=2.4.0 <3"],
|
|
34
|
+
(moduleExports) => {
|
|
35
|
+
const Pool = moduleExports.Pool;
|
|
36
|
+
if (isWrapped(Pool.prototype.acquire)) {
|
|
37
|
+
this._unwrap(Pool.prototype, "acquire");
|
|
38
|
+
}
|
|
39
|
+
this._wrap(Pool.prototype, "acquire", this._acquireWithCallbacksPatcher.bind(this));
|
|
40
|
+
return moduleExports;
|
|
41
|
+
},
|
|
42
|
+
(moduleExports) => {
|
|
43
|
+
const Pool = moduleExports.Pool;
|
|
44
|
+
this._unwrap(Pool.prototype, "acquire");
|
|
45
|
+
return moduleExports;
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
new InstrumentationNodeModuleDefinition(
|
|
49
|
+
MODULE_NAME,
|
|
50
|
+
[">=2.0.0 <2.4"],
|
|
51
|
+
(moduleExports) => {
|
|
52
|
+
this._isDisabled = false;
|
|
53
|
+
if (isWrapped(moduleExports.Pool)) {
|
|
54
|
+
this._unwrap(moduleExports, "Pool");
|
|
55
|
+
}
|
|
56
|
+
this._wrap(moduleExports, "Pool", this._poolWrapper.bind(this));
|
|
57
|
+
return moduleExports;
|
|
58
|
+
},
|
|
59
|
+
(moduleExports) => {
|
|
60
|
+
this._isDisabled = true;
|
|
61
|
+
return moduleExports;
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
_acquirePatcher(original) {
|
|
67
|
+
return function wrapped_acquire(...args) {
|
|
68
|
+
return startSpan(
|
|
69
|
+
{
|
|
70
|
+
name: "generic-pool.acquire",
|
|
71
|
+
attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.otel.generic_pool" }
|
|
72
|
+
},
|
|
73
|
+
() => {
|
|
74
|
+
return original.call(this, ...args);
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
_poolWrapper(original) {
|
|
80
|
+
const wrap = this._wrap.bind(this);
|
|
81
|
+
const acquireWithCallbacksPatcher = this._acquireWithCallbacksPatcher.bind(this);
|
|
82
|
+
return function wrapped_pool(...args) {
|
|
83
|
+
const pool = original.apply(this, args);
|
|
84
|
+
wrap(pool, "acquire", acquireWithCallbacksPatcher);
|
|
85
|
+
return pool;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
_acquireWithCallbacksPatcher(original) {
|
|
89
|
+
const isDisabled = () => this._isDisabled;
|
|
90
|
+
return function wrapped_acquire(cb, priority) {
|
|
91
|
+
if (isDisabled()) {
|
|
92
|
+
return original.call(this, cb, priority);
|
|
93
|
+
}
|
|
94
|
+
return startSpanManual(
|
|
95
|
+
{
|
|
96
|
+
name: "generic-pool.acquire",
|
|
97
|
+
attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.otel.generic_pool" }
|
|
98
|
+
},
|
|
99
|
+
(span) => {
|
|
100
|
+
original.call(
|
|
101
|
+
this,
|
|
102
|
+
(err, client) => {
|
|
103
|
+
if (err) {
|
|
104
|
+
span.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" });
|
|
105
|
+
}
|
|
106
|
+
span.end();
|
|
107
|
+
if (cb) {
|
|
108
|
+
cb(err, client);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
priority
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export { GenericPoolInstrumentation };
|
|
120
|
+
//# sourceMappingURL=instrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/genericPool/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-generic-pool\n * - Upstream version: @opentelemetry/instrumentation-generic-pool@0.61.0\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport {\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_ERROR,\n startSpan,\n startSpanManual,\n} from '@sentry/core';\nimport type * as genericPool from './generic-pool-types';\n\nconst MODULE_NAME = 'generic-pool';\nconst PACKAGE_NAME = '@sentry/instrumentation-generic-pool';\n\ntype AcquireFn = (this: unknown, ...args: unknown[]) => unknown;\ninterface PoolConstructor {\n prototype: { acquire: AcquireFn };\n}\ninterface GenericPoolModule {\n Pool: PoolConstructor;\n}\n\nexport class GenericPoolInstrumentation extends InstrumentationBase {\n // only used for v2 - v2.3)\n private _isDisabled = false;\n\n constructor(config: InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n init() {\n return [\n new InstrumentationNodeModuleDefinition(\n MODULE_NAME,\n ['>=3.0.0 <4'],\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n if (isWrapped(Pool.prototype.acquire)) {\n this._unwrap(Pool.prototype, 'acquire');\n }\n this._wrap(Pool.prototype, 'acquire', this._acquirePatcher.bind(this));\n return moduleExports;\n },\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n this._unwrap(Pool.prototype, 'acquire');\n return moduleExports;\n },\n ),\n new InstrumentationNodeModuleDefinition(\n MODULE_NAME,\n ['>=2.4.0 <3'],\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n if (isWrapped(Pool.prototype.acquire)) {\n this._unwrap(Pool.prototype, 'acquire');\n }\n this._wrap(Pool.prototype, 'acquire', this._acquireWithCallbacksPatcher.bind(this));\n return moduleExports;\n },\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n this._unwrap(Pool.prototype, 'acquire');\n return moduleExports;\n },\n ),\n new InstrumentationNodeModuleDefinition(\n MODULE_NAME,\n ['>=2.0.0 <2.4'],\n (moduleExports: GenericPoolModule) => {\n this._isDisabled = false;\n if (isWrapped(moduleExports.Pool)) {\n this._unwrap(moduleExports, 'Pool');\n }\n this._wrap(moduleExports, 'Pool', this._poolWrapper.bind(this));\n return moduleExports;\n },\n (moduleExports: GenericPoolModule) => {\n // since the object is created on the fly every time, we need to use\n // a boolean switch here to disable the instrumentation\n this._isDisabled = true;\n return moduleExports;\n },\n ),\n ];\n }\n\n private _acquirePatcher(original: AcquireFn) {\n return function wrapped_acquire(this: genericPool.Pool<unknown>, ...args: unknown[]) {\n return startSpan(\n {\n name: 'generic-pool.acquire',\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.otel.generic_pool' },\n },\n () => {\n return original.call(this, ...args) as PromiseLike<unknown>;\n },\n );\n };\n }\n\n private _poolWrapper(original: (this: unknown, ...args: unknown[]) => { acquire: AcquireFn }) {\n const wrap = this._wrap.bind(this);\n const acquireWithCallbacksPatcher = this._acquireWithCallbacksPatcher.bind(this);\n return function wrapped_pool(this: unknown, ...args: unknown[]) {\n const pool = original.apply(this, args);\n wrap(pool, 'acquire', acquireWithCallbacksPatcher);\n return pool;\n };\n }\n\n private _acquireWithCallbacksPatcher(original: AcquireFn) {\n const isDisabled = (): boolean => this._isDisabled;\n return function wrapped_acquire(\n this: genericPool.Pool<unknown>,\n cb: (err: unknown, client: unknown) => unknown,\n priority: number,\n ) {\n // only used for v2 - v2.3\n if (isDisabled()) {\n return original.call(this, cb, priority);\n }\n\n return startSpanManual(\n {\n name: 'generic-pool.acquire',\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.otel.generic_pool' },\n },\n span => {\n original.call(\n this,\n (err: unknown, client: unknown) => {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n }\n span.end();\n // Not checking whether cb is a function because\n // the original code doesn't do that either.\n // The callback's return value is unused by generic-pool, so we don't return it.\n if (cb) {\n cb(err, client);\n }\n },\n priority,\n );\n },\n );\n };\n }\n}\n"],"names":[],"mappings":";;;AAqBA,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;AAAA,YACF,CAAA;AAAA,YACA;AAAA,WACF;AAAA,QACF;AAAA,OACF;AAAA,IACF,CAAA;AAAA,EACF;AACF;;;;"}
|
|
@@ -4,71 +4,16 @@ import { SentryGoogleGenAiInstrumentation } from './instrumentation.js';
|
|
|
4
4
|
|
|
5
5
|
const instrumentGoogleGenAI = generateInstrumentOnce(
|
|
6
6
|
GOOGLE_GENAI_INTEGRATION_NAME,
|
|
7
|
-
options => new SentryGoogleGenAiInstrumentation(options)
|
|
7
|
+
(options) => new SentryGoogleGenAiInstrumentation(options)
|
|
8
8
|
);
|
|
9
|
-
|
|
10
9
|
const _googleGenAIIntegration = ((options = {}) => {
|
|
11
10
|
return {
|
|
12
11
|
name: GOOGLE_GENAI_INTEGRATION_NAME,
|
|
13
12
|
setupOnce() {
|
|
14
13
|
instrumentGoogleGenAI(options);
|
|
15
|
-
}
|
|
14
|
+
}
|
|
16
15
|
};
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Adds Sentry tracing instrumentation for the Google Generative AI SDK.
|
|
21
|
-
*
|
|
22
|
-
* This integration is enabled by default.
|
|
23
|
-
*
|
|
24
|
-
* When configured, this integration automatically instruments Google GenAI SDK client instances
|
|
25
|
-
* to capture telemetry data following OpenTelemetry Semantic Conventions for Generative AI.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```javascript
|
|
29
|
-
* import * as Sentry from '@sentry/node';
|
|
30
|
-
*
|
|
31
|
-
* Sentry.init({
|
|
32
|
-
* integrations: [Sentry.googleGenAiIntegration()],
|
|
33
|
-
* });
|
|
34
|
-
* ```
|
|
35
|
-
*
|
|
36
|
-
* ## Options
|
|
37
|
-
*
|
|
38
|
-
* - `recordInputs`: Whether to record prompt messages (default: respects `sendDefaultPii` client option)
|
|
39
|
-
* - `recordOutputs`: Whether to record response text (default: respects `sendDefaultPii` client option)
|
|
40
|
-
*
|
|
41
|
-
* ### Default Behavior
|
|
42
|
-
*
|
|
43
|
-
* By default, the integration will:
|
|
44
|
-
* - Record inputs and outputs ONLY if `sendDefaultPii` is set to `true` in your Sentry client options
|
|
45
|
-
* - Otherwise, inputs and outputs are NOT recorded unless explicitly enabled
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```javascript
|
|
49
|
-
* // Record inputs and outputs when sendDefaultPii is false
|
|
50
|
-
* Sentry.init({
|
|
51
|
-
* integrations: [
|
|
52
|
-
* Sentry.googleGenAiIntegration({
|
|
53
|
-
* recordInputs: true,
|
|
54
|
-
* recordOutputs: true
|
|
55
|
-
* })
|
|
56
|
-
* ],
|
|
57
|
-
* });
|
|
58
|
-
*
|
|
59
|
-
* // Never record inputs/outputs regardless of sendDefaultPii
|
|
60
|
-
* Sentry.init({
|
|
61
|
-
* sendDefaultPii: true,
|
|
62
|
-
* integrations: [
|
|
63
|
-
* Sentry.googleGenAiIntegration({
|
|
64
|
-
* recordInputs: false,
|
|
65
|
-
* recordOutputs: false
|
|
66
|
-
* })
|
|
67
|
-
* ],
|
|
68
|
-
* });
|
|
69
|
-
* ```
|
|
70
|
-
*
|
|
71
|
-
*/
|
|
16
|
+
});
|
|
72
17
|
const googleGenAIIntegration = defineIntegration(_googleGenAIIntegration);
|
|
73
18
|
|
|
74
19
|
export { googleGenAIIntegration, instrumentGoogleGenAI };
|