@sentry/node 10.53.0 → 10.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/debug-build.js +0 -5
- package/build/cjs/debug-build.js.map +1 -1
- package/build/cjs/index.js +68 -68
- 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 +107 -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 +311 -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 +11 -37
- package/build/cjs/integrations/http.js.map +1 -1
- package/build/cjs/integrations/node-fetch/index.js +19 -46
- package/build/cjs/integrations/node-fetch/index.js.map +1 -1
- package/build/cjs/integrations/node-fetch/vendored/undici.js +71 -215
- package/build/cjs/integrations/node-fetch/vendored/undici.js.map +1 -1
- package/build/cjs/integrations/tracing/amqplib/index.js +29 -0
- package/build/cjs/integrations/tracing/amqplib/index.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js +452 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js +24 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js +12 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/types.js +23 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -0
- package/build/cjs/integrations/tracing/amqplib/vendored/utils.js +137 -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 +16 -39
- package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/connect/index.js +56 -0
- package/build/cjs/integrations/tracing/connect/index.js.map +1 -0
- package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +22 -0
- package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
- package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +148 -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 +35 -0
- package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/dataloader/index.js +41 -0
- package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -0
- package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js +245 -0
- package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/express.js +15 -23
- package/build/cjs/integrations/tracing/express.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/index.js +46 -165
- 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 +68 -150
- 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/fastify/vendored/instrumentation.js +388 -0
- package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/firebase/firebase.js +15 -21
- package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -1
- package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +6 -14
- package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +57 -161
- package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
- package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js +81 -147
- package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
- package/build/cjs/integrations/tracing/genericPool/index.js +35 -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 +18 -39
- package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/index.js +83 -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 +17 -0
- package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -0
- package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +318 -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 +300 -0
- package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/hapi/index.js +20 -78
- 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 +275 -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/semconv.js +6 -0
- package/build/cjs/integrations/tracing/hapi/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/hapi/vendored/utils.js +91 -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 +19 -70
- 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 -82
- package/build/cjs/integrations/tracing/index.js.map +1 -1
- package/build/cjs/integrations/tracing/kafka/index.js +31 -0
- package/build/cjs/integrations/tracing/kafka/index.js.map +1 -0
- package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +438 -0
- package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js +6 -0
- package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js.map +1 -0
- package/build/cjs/integrations/tracing/kafka/vendored/propagator.js +22 -0
- package/build/cjs/integrations/tracing/kafka/vendored/propagator.js.map +1 -0
- package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +38 -0
- package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/knex/index.js +36 -0
- package/build/cjs/integrations/tracing/knex/index.js.map +1 -0
- package/build/cjs/integrations/tracing/knex/vendored/constants.js +16 -0
- package/build/cjs/integrations/tracing/knex/vendored/constants.js.map +1 -0
- package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +162 -0
- package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/knex/vendored/semconv.js +24 -0
- package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/knex/vendored/utils.js +97 -0
- package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/koa/index.js +69 -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 +140 -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 +33 -0
- package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/langchain/index.js +3 -97
- package/build/cjs/integrations/tracing/langchain/index.js.map +1 -1
- package/build/cjs/integrations/tracing/langchain/instrumentation.js +51 -146
- 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 +27 -38
- 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 +39 -0
- package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/mongo/index.js +62 -0
- package/build/cjs/integrations/tracing/mongo/index.js.map +1 -0
- package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +678 -0
- package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js +14 -0
- package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js.map +1 -0
- package/build/cjs/integrations/tracing/mongo/vendored/semconv.js +26 -0
- package/build/cjs/integrations/tracing/mongo/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/mongoose/index.js +28 -0
- package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -0
- package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +375 -0
- package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
- package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js +22 -0
- package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +87 -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/AttributeNames.js +9 -0
- package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js +278 -0
- package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql/vendored/semconv.js +22 -0
- package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql/vendored/utils.js +63 -0
- package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql2/index.js +28 -0
- package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +173 -0
- package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js +20 -0
- package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +97 -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 +17 -41
- package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/postgres/index.js +31 -0
- package/build/cjs/integrations/tracing/postgres/index.js.map +1 -0
- package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +12 -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 +436 -0
- package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js +6 -0
- package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js.map +1 -0
- package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +32 -0
- package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing/postgres/vendored/utils.js +275 -0
- package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/postgresjs.js +66 -181
- package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
- package/build/cjs/integrations/tracing/prisma/index.js +123 -0
- package/build/cjs/integrations/tracing/prisma/index.js.map +1 -0
- package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js +119 -0
- package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -0
- package/build/cjs/integrations/tracing/prisma/vendored/constants.js +14 -0
- package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -0
- package/build/cjs/integrations/tracing/prisma/vendored/global.js +28 -0
- package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -0
- package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js +38 -0
- package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/redis/index.js +15 -72
- package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js +42 -77
- package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +53 -98
- package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/vendored/redis-common.js +9 -49
- package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +175 -282
- package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/vendored/semconv.js +7 -36
- package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/tedious/index.js +45 -0
- package/build/cjs/integrations/tracing/tedious/index.js.map +1 -0
- package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +205 -0
- package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/tedious/vendored/semconv.js +20 -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/utils/sql-common.js +43 -0
- package/build/cjs/integrations/tracing/utils/sql-common.js.map +1 -0
- package/build/cjs/integrations/tracing/vercelai/constants.js +1 -1
- package/build/cjs/integrations/tracing/vercelai/index.js +3 -50
- package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
- package/build/cjs/integrations/tracing/vercelai/instrumentation.js +58 -157
- 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/index.js +6 -34
- package/build/cjs/sdk/index.js.map +1 -1
- package/build/cjs/sdk/initOtel.js +13 -51
- 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/esm/debug-build.js +0 -5
- package/build/esm/debug-build.js.map +1 -1
- package/build/esm/index.js +17 -17
- 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 +105 -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 +309 -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 +11 -37
- package/build/esm/integrations/http.js.map +1 -1
- package/build/esm/integrations/node-fetch/index.js +19 -46
- package/build/esm/integrations/node-fetch/index.js.map +1 -1
- package/build/esm/integrations/node-fetch/vendored/undici.js +71 -215
- package/build/esm/integrations/node-fetch/vendored/undici.js.map +1 -1
- package/build/esm/integrations/tracing/amqplib/index.js +26 -0
- package/build/esm/integrations/tracing/amqplib/index.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js +450 -0
- package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js +13 -0
- package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib/vendored/semconv.js +7 -0
- package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib/vendored/types.js +20 -0
- package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -0
- package/build/esm/integrations/tracing/amqplib/vendored/utils.js +126 -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 +16 -39
- package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/connect/index.js +52 -0
- package/build/esm/integrations/tracing/connect/index.js.map +1 -0
- package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +18 -0
- package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
- package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +145 -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 +31 -0
- package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/dataloader/index.js +38 -0
- package/build/esm/integrations/tracing/dataloader/index.js.map +1 -0
- package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js +243 -0
- package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/express.js +15 -23
- package/build/esm/integrations/tracing/express.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/index.js +45 -164
- 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 +68 -150
- 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/fastify/vendored/instrumentation.js +386 -0
- package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/firebase/firebase.js +15 -21
- package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -1
- package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +6 -14
- package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +57 -161
- package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
- package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +81 -147
- package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
- package/build/esm/integrations/tracing/genericPool/index.js +32 -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 +18 -39
- package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/index.js +80 -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 +15 -0
- package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -0
- package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +316 -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 +291 -0
- package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/hapi/index.js +19 -77
- 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 +273 -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/semconv.js +4 -0
- package/build/esm/integrations/tracing/hapi/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/hapi/vendored/utils.js +82 -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 +19 -70
- 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 +16 -24
- package/build/esm/integrations/tracing/index.js.map +1 -1
- package/build/esm/integrations/tracing/kafka/index.js +28 -0
- package/build/esm/integrations/tracing/kafka/index.js.map +1 -0
- package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +436 -0
- package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/kafka/vendored/internal-types.js +4 -0
- package/build/esm/integrations/tracing/kafka/vendored/internal-types.js.map +1 -0
- package/build/esm/integrations/tracing/kafka/vendored/propagator.js +20 -0
- package/build/esm/integrations/tracing/kafka/vendored/propagator.js.map +1 -0
- package/build/esm/integrations/tracing/kafka/vendored/semconv.js +20 -0
- package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/knex/index.js +33 -0
- package/build/esm/integrations/tracing/knex/index.js.map +1 -0
- package/build/esm/integrations/tracing/knex/vendored/constants.js +13 -0
- package/build/esm/integrations/tracing/knex/vendored/constants.js.map +1 -0
- package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +160 -0
- package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/knex/vendored/semconv.js +13 -0
- package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/knex/vendored/utils.js +87 -0
- package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/koa/index.js +65 -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 +138 -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 +30 -0
- package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/langchain/index.js +3 -97
- package/build/esm/integrations/tracing/langchain/index.js.map +1 -1
- package/build/esm/integrations/tracing/langchain/instrumentation.js +52 -147
- 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 +27 -38
- 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 +37 -0
- package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/mongo/index.js +58 -0
- package/build/esm/integrations/tracing/mongo/index.js.map +1 -0
- package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +676 -0
- package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/mongo/vendored/internal-types.js +12 -0
- package/build/esm/integrations/tracing/mongo/vendored/internal-types.js.map +1 -0
- package/build/esm/integrations/tracing/mongo/vendored/semconv.js +14 -0
- package/build/esm/integrations/tracing/mongo/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/mongoose/index.js +25 -0
- package/build/esm/integrations/tracing/mongoose/index.js.map +1 -0
- package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +371 -0
- package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
- package/build/esm/integrations/tracing/mongoose/vendored/semconv.js +12 -0
- package/build/esm/integrations/tracing/mongoose/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/mongoose/vendored/utils.js +83 -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/AttributeNames.js +7 -0
- package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -0
- package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js +276 -0
- package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/mysql/vendored/semconv.js +12 -0
- package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/mysql/vendored/utils.js +55 -0
- package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/mysql2/index.js +25 -0
- package/build/esm/integrations/tracing/mysql2/index.js.map +1 -0
- package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +171 -0
- package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/mysql2/vendored/semconv.js +11 -0
- package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/mysql2/vendored/utils.js +91 -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 +17 -41
- package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/postgres/index.js +28 -0
- package/build/esm/integrations/tracing/postgres/index.js.map +1 -0
- package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +10 -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 +434 -0
- package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/postgres/vendored/internal-types.js +4 -0
- package/build/esm/integrations/tracing/postgres/vendored/internal-types.js.map +1 -0
- package/build/esm/integrations/tracing/postgres/vendored/semconv.js +17 -0
- package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/tracing/postgres/vendored/utils.js +257 -0
- package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/postgresjs.js +66 -181
- package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
- package/build/esm/integrations/tracing/prisma/index.js +120 -0
- package/build/esm/integrations/tracing/prisma/index.js.map +1 -0
- package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js +117 -0
- package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -0
- package/build/esm/integrations/tracing/prisma/vendored/constants.js +9 -0
- package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -0
- package/build/esm/integrations/tracing/prisma/vendored/global.js +24 -0
- package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -0
- package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js +36 -0
- package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/redis/index.js +15 -72
- package/build/esm/integrations/tracing/redis/index.js.map +1 -1
- package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js +42 -77
- package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js.map +1 -1
- package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +53 -98
- package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/redis/vendored/redis-common.js +9 -49
- package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
- package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +175 -282
- package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/redis/vendored/semconv.js +7 -36
- package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/tedious/index.js +42 -0
- package/build/esm/integrations/tracing/tedious/index.js.map +1 -0
- package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +202 -0
- package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/tedious/vendored/semconv.js +11 -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/utils/sql-common.js +41 -0
- package/build/esm/integrations/tracing/utils/sql-common.js.map +1 -0
- package/build/esm/integrations/tracing/vercelai/constants.js +1 -1
- package/build/esm/integrations/tracing/vercelai/index.js +3 -50
- package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
- package/build/esm/integrations/tracing/vercelai/instrumentation.js +58 -157
- 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/index.js +6 -34
- package/build/esm/sdk/index.js.map +1 -1
- package/build/esm/sdk/initOtel.js +13 -51
- 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/types/integrations/{fs.d.ts → fs/index.d.ts} +1 -1
- 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 +15 -0
- package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/fs/vendored/types.d.ts +29 -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-ts3.8/integrations/tracing/amqplib.d.ts → types/integrations/tracing/amqplib/index.d.ts} +20 -20
- 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/amqplib.d.ts +26 -0
- package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts.map +1 -0
- package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts +63 -0
- package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts.map +1 -0
- package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts +41 -0
- package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/amqplib/vendored/types.d.ts +130 -0
- package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts +35 -0
- package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/{connect.d.ts → connect/index.d.ts} +2 -2
- package/build/types/integrations/tracing/connect/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +13 -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} +2 -2
- package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +14 -0
- package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts +21 -0
- package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/dataloader/vendored/types.d.ts +10 -0
- package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts +27 -0
- package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +1 -0
- package/build/{types-ts3.8/integrations/tracing/genericPool.d.ts → types/integrations/tracing/genericPool/index.d.ts} +20 -20
- 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 +10 -0
- package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +2 -2
- 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 +12 -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 +136 -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 +20 -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 +71 -0
- package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +17 -0
- package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/hapi/index.d.ts +1 -1
- 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/semconv.d.ts +13 -0
- package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +19 -0
- package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/{kafka.d.ts → kafka/index.d.ts} +2 -2
- package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +25 -0
- package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts +9 -0
- package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +111 -0
- package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts +3 -0
- package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts.map +1 -0
- package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +131 -0
- package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/kafka/vendored/types.d.ts +26 -0
- package/build/types/integrations/tracing/kafka/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/{knex.d.ts → knex/index.d.ts} +2 -2
- package/build/types/integrations/tracing/knex/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/knex/vendored/constants.d.ts +3 -0
- package/build/types/integrations/tracing/knex/vendored/constants.d.ts.map +1 -0
- package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +14 -0
- package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +38 -0
- package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/knex/vendored/types.d.ts +8 -0
- package/build/types/integrations/tracing/knex/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/knex/vendored/utils.d.ts +15 -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} +2 -2
- 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 +50 -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/instrumentation.d.ts.map +1 -1
- package/build/{types-ts3.8/integrations/tracing/lrumemoizer.d.ts → types/integrations/tracing/lrumemoizer/index.d.ts} +19 -19
- 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/integrations/tracing/{mongo.d.ts → mongo/index.d.ts} +2 -2
- package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +79 -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 +121 -0
- package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts +107 -0
- package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongo/vendored/types.d.ts +51 -0
- package/build/types/integrations/tracing/mongo/vendored/types.d.ts.map +1 -0
- package/build/{types-ts3.8/integrations/tracing/mongoose.d.ts → types/integrations/tracing/mongoose/index.d.ts} +20 -20
- package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +30 -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 +24 -0
- package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts +71 -0
- package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongoose/vendored/types.d.ts +36 -0
- package/build/types/integrations/tracing/mongoose/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +8 -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} +2 -2
- package/build/types/integrations/tracing/mysql/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts +4 -0
- package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts +28 -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 +88 -0
- package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql/vendored/types.d.ts +9 -0
- package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql/vendored/utils.d.ts +25 -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} +2 -2
- package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +12 -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 +9 -0
- package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql2/vendored/types.d.ts +18 -0
- package/build/types/integrations/tracing/mysql2/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +27 -0
- package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +2 -2
- package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +7 -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 +20 -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 +35 -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 +112 -0
- package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/types.d.ts +65 -0
- package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +69 -0
- package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/{prisma.d.ts → prisma/index.d.ts} +2 -2
- package/build/types/integrations/tracing/prisma/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +18 -0
- package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -0
- package/build/types/integrations/tracing/prisma/vendored/constants.d.ts +5 -0
- package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -0
- package/build/types/integrations/tracing/prisma/vendored/global.d.ts +5 -0
- package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -0
- package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts +17 -0
- package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/prisma/vendored/types.d.ts +52 -0
- package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -0
- package/build/types/integrations/tracing/prisma/vendored/v5-tracing-helper.d.ts.map +1 -0
- package/build/types/integrations/tracing/prisma/vendored/v6-tracing-helper.d.ts.map +1 -0
- package/build/types/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +2 -2
- package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +22 -0
- package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts +80 -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/types.d.ts +10 -0
- package/build/types/integrations/tracing/tedious/vendored/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/utils/sql-common.d.ts +3 -0
- package/build/types/integrations/tracing/utils/sql-common.d.ts.map +1 -0
- package/build/types-ts3.8/integrations/{fs.d.ts → fs/index.d.ts} +1 -1
- package/build/types-ts3.8/integrations/fs/vendored/constants.d.ts +5 -0
- package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +15 -0
- package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +29 -0
- package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +15 -0
- package/build/{types/integrations/tracing/amqplib.d.ts → types-ts3.8/integrations/tracing/amqplib/index.d.ts} +20 -20
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +44 -0
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib.d.ts +26 -0
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts +63 -0
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv.d.ts +41 -0
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/types.d.ts +130 -0
- package/build/types-ts3.8/integrations/tracing/amqplib/vendored/utils.d.ts +35 -0
- package/build/types-ts3.8/integrations/tracing/{connect.d.ts → connect/index.d.ts} +2 -2
- package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +13 -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} +2 -2
- package/build/types-ts3.8/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +14 -0
- package/build/types-ts3.8/integrations/tracing/dataloader/vendored/instrumentation.d.ts +21 -0
- package/build/types-ts3.8/integrations/tracing/dataloader/vendored/types.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing/fastify/vendored/instrumentation.d.ts +27 -0
- package/build/{types/integrations/tracing/genericPool.d.ts → types-ts3.8/integrations/tracing/genericPool/index.d.ts} +20 -20
- 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 +10 -0
- package/build/types-ts3.8/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +2 -2
- 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 +12 -0
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/graphql-types.d.ts +136 -0
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +20 -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 +71 -0
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +17 -0
- package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +1 -1
- 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/semconv.d.ts +13 -0
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +19 -0
- package/build/types-ts3.8/integrations/tracing/{kafka.d.ts → kafka/index.d.ts} +2 -2
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/instrumentation.d.ts +25 -0
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/internal-types.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +111 -0
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/propagator.d.ts +3 -0
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +131 -0
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/types.d.ts +26 -0
- package/build/types-ts3.8/integrations/tracing/{knex.d.ts → knex/index.d.ts} +2 -2
- package/build/types-ts3.8/integrations/tracing/knex/vendored/constants.d.ts +3 -0
- package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +14 -0
- package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +38 -0
- package/build/types-ts3.8/integrations/tracing/knex/vendored/types.d.ts +8 -0
- package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing/{koa.d.ts → koa/index.d.ts} +2 -2
- 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 +50 -0
- package/build/types-ts3.8/integrations/tracing/koa/vendored/utils.d.ts +15 -0
- package/build/{types/integrations/tracing/lrumemoizer.d.ts → types-ts3.8/integrations/tracing/lrumemoizer/index.d.ts} +19 -19
- package/build/types-ts3.8/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +6 -0
- package/build/types-ts3.8/integrations/tracing/{mongo.d.ts → mongo/index.d.ts} +2 -2
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +79 -0
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +121 -0
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/semconv.d.ts +107 -0
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/types.d.ts +51 -0
- package/build/{types/integrations/tracing/mongoose.d.ts → types-ts3.8/integrations/tracing/mongoose/index.d.ts} +20 -20
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +30 -0
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +24 -0
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/semconv.d.ts +71 -0
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/types.d.ts +36 -0
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +8 -0
- package/build/types-ts3.8/integrations/tracing/{mysql.d.ts → mysql/index.d.ts} +2 -2
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/AttributeNames.d.ts +4 -0
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/instrumentation.d.ts +28 -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 +88 -0
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/types.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing/mysql/vendored/utils.d.ts +25 -0
- package/build/types-ts3.8/integrations/tracing/{mysql2.d.ts → mysql2/index.d.ts} +2 -2
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +12 -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 +9 -0
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/types.d.ts +18 -0
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +27 -0
- package/build/types-ts3.8/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +2 -2
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +7 -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 +20 -0
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +35 -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 +112 -0
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +65 -0
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +69 -0
- package/build/types-ts3.8/integrations/tracing/{prisma.d.ts → prisma/index.d.ts} +2 -2
- package/build/types-ts3.8/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +18 -0
- package/build/types-ts3.8/integrations/tracing/prisma/vendored/constants.d.ts +5 -0
- package/build/types-ts3.8/integrations/tracing/prisma/vendored/global.d.ts +5 -0
- package/build/types-ts3.8/integrations/tracing/prisma/vendored/instrumentation.d.ts +17 -0
- package/build/types-ts3.8/integrations/tracing/prisma/vendored/types.d.ts +55 -0
- package/build/types-ts3.8/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +2 -2
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +22 -0
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/semconv.d.ts +80 -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/types.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/utils.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing/utils/sql-common.d.ts +3 -0
- package/package.json +4 -24
- 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 -207
- package/build/cjs/integrations/tracing/prisma.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 -204
- package/build/esm/integrations/tracing/prisma.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.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.map +0 -1
- package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts.map +0 -1
- package/build/types/integrations/tracing/prisma.d.ts.map +0 -1
- package/build/types/integrations/tracing/tedious.d.ts.map +0 -1
- /package/build/types/integrations/tracing/prisma/{vendor → vendored}/v5-tracing-helper.d.ts +0 -0
- /package/build/types/integrations/tracing/prisma/{vendor → vendored}/v6-tracing-helper.d.ts +0 -0
- /package/build/types-ts3.8/integrations/tracing/prisma/{vendor → vendored}/v5-tracing-helper.d.ts +0 -0
- /package/build/types-ts3.8/integrations/tracing/prisma/{vendor → vendored}/v6-tracing-helper.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeNames.js","sources":["../../../../../../../src/integrations/tracing/fastify/v3/enums/AttributeNames.ts"],"sourcesContent":["// Vendored from https://github.com/open-telemetry/opentelemetry-js-contrib/blob/407f61591ba69a39a6908264379d4d98a48dbec4/plugins/node/opentelemetry-instrumentation-fastify/src/enums/AttributeNames.ts\n//\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum AttributeNames {\n FASTIFY_NAME = 'fastify.name',\n FASTIFY_TYPE = 'fastify.type',\n HOOK_NAME = 'hook.name',\n PLUGIN_NAME = 'plugin.name',\n}\n\nexport enum FastifyTypes {\n MIDDLEWARE = 'middleware',\n REQUEST_HANDLER = 'request_handler',\n}\n\nexport enum FastifyNames {\n MIDDLEWARE = 'middleware',\n REQUEST_HANDLER = 'request handler',\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AttributeNames.js","sources":["../../../../../../../src/integrations/tracing/fastify/v3/enums/AttributeNames.ts"],"sourcesContent":["// Vendored from https://github.com/open-telemetry/opentelemetry-js-contrib/blob/407f61591ba69a39a6908264379d4d98a48dbec4/plugins/node/opentelemetry-instrumentation-fastify/src/enums/AttributeNames.ts\n//\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport enum AttributeNames {\n FASTIFY_NAME = 'fastify.name',\n FASTIFY_TYPE = 'fastify.type',\n HOOK_NAME = 'hook.name',\n PLUGIN_NAME = 'plugin.name',\n}\n\nexport enum FastifyTypes {\n MIDDLEWARE = 'middleware',\n REQUEST_HANDLER = 'request_handler',\n}\n\nexport enum FastifyNames {\n MIDDLEWARE = 'middleware',\n REQUEST_HANDLER = 'request handler',\n}\n"],"names":["AttributeNames","FastifyTypes","FastifyNames"],"mappings":"AAkBO,IAAK,cAAA,qBAAAA,eAAAA,KAAL;AACL,EAAAA,gBAAA,cAAA,CAAA,GAAe,cAAA;AACf,EAAAA,gBAAA,cAAA,CAAA,GAAe,cAAA;AACf,EAAAA,gBAAA,WAAA,CAAA,GAAY,WAAA;AACZ,EAAAA,gBAAA,aAAA,CAAA,GAAc,aAAA;AAJJ,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;AAOL,IAAK,YAAA,qBAAAC,aAAAA,KAAL;AACL,EAAAA,cAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,cAAA,iBAAA,CAAA,GAAkB,iBAAA;AAFR,EAAA,OAAAA,aAAAA;AAAA,CAAA,EAAA,YAAA,IAAA,EAAA;AAKL,IAAK,YAAA,qBAAAC,aAAAA,KAAL;AACL,EAAAA,cAAA,YAAA,CAAA,GAAa,YAAA;AACb,EAAAA,cAAA,iBAAA,CAAA,GAAkB,iBAAA;AAFR,EAAA,OAAAA,aAAAA;AAAA,CAAA,EAAA,YAAA,IAAA,EAAA;;;;"}
|
|
@@ -6,294 +6,212 @@ import { getIsolationScope, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_A
|
|
|
6
6
|
import { FastifyNames, AttributeNames, FastifyTypes } from './enums/AttributeNames.js';
|
|
7
7
|
import { startSpan, endSpan, safeExecuteInTheMiddleMaybePromise } from './utils.js';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// The instrumentation creates a span for invocations of lifecycle hook handlers
|
|
24
|
-
// that take `(request, reply, ...[, done])` arguments. Currently this is all
|
|
25
|
-
// lifecycle hooks except `onRequestAbort`.
|
|
26
|
-
// https://fastify.dev/docs/latest/Reference/Hooks
|
|
27
|
-
const hooksNamesToWrap = new Set([
|
|
28
|
-
'onTimeout',
|
|
29
|
-
'onRequest',
|
|
30
|
-
'preParsing',
|
|
31
|
-
'preValidation',
|
|
32
|
-
'preSerialization',
|
|
33
|
-
'preHandler',
|
|
34
|
-
'onSend',
|
|
35
|
-
'onResponse',
|
|
36
|
-
'onError',
|
|
9
|
+
const PACKAGE_VERSION = "0.1.0";
|
|
10
|
+
const PACKAGE_NAME = "@sentry/instrumentation-fastify-v3";
|
|
11
|
+
const ANONYMOUS_NAME = "anonymous";
|
|
12
|
+
const hooksNamesToWrap = /* @__PURE__ */ new Set([
|
|
13
|
+
"onTimeout",
|
|
14
|
+
"onRequest",
|
|
15
|
+
"preParsing",
|
|
16
|
+
"preValidation",
|
|
17
|
+
"preSerialization",
|
|
18
|
+
"preHandler",
|
|
19
|
+
"onSend",
|
|
20
|
+
"onResponse",
|
|
21
|
+
"onError"
|
|
37
22
|
]);
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Fastify instrumentation for OpenTelemetry
|
|
41
|
-
*/
|
|
42
23
|
class FastifyInstrumentationV3 extends InstrumentationBase {
|
|
43
|
-
|
|
24
|
+
constructor(config = {}) {
|
|
44
25
|
super(PACKAGE_NAME, PACKAGE_VERSION, config);
|
|
45
26
|
}
|
|
46
|
-
|
|
47
|
-
init() {
|
|
27
|
+
init() {
|
|
48
28
|
return [
|
|
49
|
-
new InstrumentationNodeModuleDefinition(
|
|
29
|
+
new InstrumentationNodeModuleDefinition("fastify", [">=3.0.0 <4"], (moduleExports) => {
|
|
50
30
|
return this._patchConstructor(moduleExports);
|
|
51
|
-
})
|
|
31
|
+
})
|
|
52
32
|
];
|
|
53
33
|
}
|
|
54
|
-
|
|
55
|
-
_hookOnRequest() {
|
|
34
|
+
_hookOnRequest() {
|
|
56
35
|
const instrumentation = this;
|
|
57
|
-
|
|
58
36
|
return function onRequest(request, reply, done) {
|
|
59
37
|
if (!instrumentation.isEnabled()) {
|
|
60
38
|
return done();
|
|
61
39
|
}
|
|
62
|
-
instrumentation._wrap(reply,
|
|
63
|
-
|
|
64
|
-
const anyRequest = request ;
|
|
65
|
-
|
|
40
|
+
instrumentation._wrap(reply, "send", instrumentation._patchSend());
|
|
41
|
+
const anyRequest = request;
|
|
66
42
|
const rpcMetadata = getRPCMetadata(context.active());
|
|
67
|
-
const routeName = anyRequest.routeOptions
|
|
68
|
-
? anyRequest.routeOptions.url // since fastify@4.10.0
|
|
69
|
-
: request.routerPath;
|
|
43
|
+
const routeName = anyRequest.routeOptions ? anyRequest.routeOptions.url : request.routerPath;
|
|
70
44
|
if (routeName && rpcMetadata?.type === RPCType.HTTP) {
|
|
71
45
|
rpcMetadata.route = routeName;
|
|
72
46
|
}
|
|
73
|
-
|
|
74
|
-
const method = request.method || 'GET';
|
|
75
|
-
|
|
47
|
+
const method = request.method || "GET";
|
|
76
48
|
getIsolationScope().setTransactionName(`${method} ${routeName}`);
|
|
77
49
|
done();
|
|
78
50
|
};
|
|
79
51
|
}
|
|
80
|
-
|
|
81
|
-
_wrapHandler(
|
|
82
|
-
pluginName,
|
|
83
|
-
hookName,
|
|
84
|
-
original,
|
|
85
|
-
syncFunctionWithDone,
|
|
86
|
-
) {
|
|
52
|
+
_wrapHandler(pluginName, hookName, original, syncFunctionWithDone) {
|
|
87
53
|
const instrumentation = this;
|
|
88
|
-
this._diag.debug(
|
|
89
|
-
|
|
90
|
-
return function ( ...args) {
|
|
54
|
+
this._diag.debug("Patching fastify route.handler function");
|
|
55
|
+
return function(...args) {
|
|
91
56
|
if (!instrumentation.isEnabled()) {
|
|
92
57
|
return original.apply(this, args);
|
|
93
58
|
}
|
|
94
|
-
|
|
95
59
|
const name = original.name || pluginName || ANONYMOUS_NAME;
|
|
96
60
|
const spanName = `${FastifyNames.MIDDLEWARE} - ${name}`;
|
|
97
|
-
|
|
98
|
-
const reply = args[1] ;
|
|
99
|
-
|
|
61
|
+
const reply = args[1];
|
|
100
62
|
const span = startSpan(reply, instrumentation.tracer, spanName, {
|
|
101
63
|
[AttributeNames.FASTIFY_TYPE]: FastifyTypes.MIDDLEWARE,
|
|
102
64
|
[AttributeNames.PLUGIN_NAME]: pluginName,
|
|
103
|
-
[AttributeNames.HOOK_NAME]: hookName
|
|
65
|
+
[AttributeNames.HOOK_NAME]: hookName
|
|
104
66
|
});
|
|
105
|
-
|
|
106
|
-
const origDone = syncFunctionWithDone && (args[args.length - 1] );
|
|
67
|
+
const origDone = syncFunctionWithDone && args[args.length - 1];
|
|
107
68
|
if (origDone) {
|
|
108
|
-
args[args.length - 1] = function
|
|
69
|
+
args[args.length - 1] = function(...doneArgs) {
|
|
109
70
|
endSpan(reply);
|
|
110
71
|
origDone.apply(this, doneArgs);
|
|
111
72
|
};
|
|
112
73
|
}
|
|
113
|
-
|
|
114
74
|
return context.with(trace.setSpan(context.active(), span), () => {
|
|
115
75
|
return safeExecuteInTheMiddleMaybePromise(
|
|
116
76
|
() => {
|
|
117
77
|
return original.apply(this, args);
|
|
118
78
|
},
|
|
119
|
-
err => {
|
|
79
|
+
(err) => {
|
|
120
80
|
if (err instanceof Error) {
|
|
121
81
|
span.setStatus({
|
|
122
82
|
code: SpanStatusCode.ERROR,
|
|
123
|
-
message: err.message
|
|
83
|
+
message: err.message
|
|
124
84
|
});
|
|
125
85
|
span.recordException(err);
|
|
126
86
|
}
|
|
127
|
-
// async hooks should end the span as soon as the promise is resolved
|
|
128
87
|
if (!syncFunctionWithDone) {
|
|
129
88
|
endSpan(reply);
|
|
130
89
|
}
|
|
131
|
-
}
|
|
90
|
+
}
|
|
132
91
|
);
|
|
133
92
|
});
|
|
134
93
|
};
|
|
135
94
|
}
|
|
136
|
-
|
|
137
|
-
_wrapAddHook() {
|
|
95
|
+
_wrapAddHook() {
|
|
138
96
|
const instrumentation = this;
|
|
139
|
-
this._diag.debug(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const name = args[0] ;
|
|
145
|
-
const handler = args[1] ;
|
|
97
|
+
this._diag.debug("Patching fastify server.addHook function");
|
|
98
|
+
return function(original) {
|
|
99
|
+
return function wrappedAddHook(...args) {
|
|
100
|
+
const name = args[0];
|
|
101
|
+
const handler = args[1];
|
|
146
102
|
const pluginName = this.pluginName;
|
|
147
103
|
if (!hooksNamesToWrap.has(name)) {
|
|
148
104
|
return original.apply(this, args);
|
|
149
105
|
}
|
|
150
|
-
|
|
151
|
-
const syncFunctionWithDone =
|
|
152
|
-
typeof args[args.length - 1] === 'function' && handler.constructor.name !== 'AsyncFunction';
|
|
153
|
-
|
|
106
|
+
const syncFunctionWithDone = typeof args[args.length - 1] === "function" && handler.constructor.name !== "AsyncFunction";
|
|
154
107
|
return original.apply(this, [
|
|
155
108
|
name,
|
|
156
|
-
instrumentation._wrapHandler(pluginName, name, handler, syncFunctionWithDone)
|
|
157
|
-
]
|
|
109
|
+
instrumentation._wrapHandler(pluginName, name, handler, syncFunctionWithDone)
|
|
110
|
+
]);
|
|
158
111
|
};
|
|
159
112
|
};
|
|
160
113
|
}
|
|
161
|
-
|
|
162
|
-
_patchConstructor(moduleExports
|
|
163
|
-
|
|
164
|
-
) {
|
|
114
|
+
_patchConstructor(moduleExports) {
|
|
165
115
|
const instrumentation = this;
|
|
166
|
-
|
|
167
|
-
function fastify( ...args) {
|
|
116
|
+
function fastify(...args) {
|
|
168
117
|
const app = moduleExports.fastify.apply(this, args);
|
|
169
|
-
app.addHook(
|
|
170
|
-
app.addHook(
|
|
171
|
-
|
|
118
|
+
app.addHook("onRequest", instrumentation._hookOnRequest());
|
|
119
|
+
app.addHook("preHandler", instrumentation._hookPreHandler());
|
|
172
120
|
instrumentClient();
|
|
173
|
-
|
|
174
|
-
instrumentation._wrap(app, 'addHook', instrumentation._wrapAddHook());
|
|
175
|
-
|
|
121
|
+
instrumentation._wrap(app, "addHook", instrumentation._wrapAddHook());
|
|
176
122
|
return app;
|
|
177
123
|
}
|
|
178
|
-
|
|
179
|
-
if (moduleExports.errorCodes !== undefined) {
|
|
124
|
+
if (moduleExports.errorCodes !== void 0) {
|
|
180
125
|
fastify.errorCodes = moduleExports.errorCodes;
|
|
181
126
|
}
|
|
182
127
|
fastify.fastify = fastify;
|
|
183
128
|
fastify.default = fastify;
|
|
184
129
|
return fastify;
|
|
185
130
|
}
|
|
186
|
-
|
|
187
|
-
_patchSend() {
|
|
131
|
+
_patchSend() {
|
|
188
132
|
const instrumentation = this;
|
|
189
|
-
this._diag.debug(
|
|
190
|
-
|
|
133
|
+
this._diag.debug("Patching fastify reply.send function");
|
|
191
134
|
return function patchSend(original) {
|
|
192
|
-
return function send(
|
|
135
|
+
return function send(...args) {
|
|
193
136
|
const maybeError = args[0];
|
|
194
|
-
|
|
195
137
|
if (!instrumentation.isEnabled()) {
|
|
196
138
|
return original.apply(this, args);
|
|
197
139
|
}
|
|
198
|
-
|
|
199
140
|
return safeExecuteInTheMiddle(
|
|
200
141
|
() => {
|
|
201
142
|
return original.apply(this, args);
|
|
202
143
|
},
|
|
203
|
-
err => {
|
|
144
|
+
(err) => {
|
|
204
145
|
if (!err && maybeError instanceof Error) {
|
|
205
|
-
// eslint-disable-next-line no-param-reassign
|
|
206
146
|
err = maybeError;
|
|
207
147
|
}
|
|
208
148
|
endSpan(this, err);
|
|
209
|
-
}
|
|
149
|
+
}
|
|
210
150
|
);
|
|
211
151
|
};
|
|
212
152
|
};
|
|
213
153
|
}
|
|
214
|
-
|
|
215
|
-
_hookPreHandler() {
|
|
154
|
+
_hookPreHandler() {
|
|
216
155
|
const instrumentation = this;
|
|
217
|
-
this._diag.debug(
|
|
218
|
-
|
|
219
|
-
return function preHandler( request, reply, done) {
|
|
156
|
+
this._diag.debug("Patching fastify preHandler function");
|
|
157
|
+
return function preHandler(request, reply, done) {
|
|
220
158
|
if (!instrumentation.isEnabled()) {
|
|
221
159
|
return done();
|
|
222
160
|
}
|
|
223
|
-
const anyRequest = request
|
|
224
|
-
|
|
161
|
+
const anyRequest = request;
|
|
225
162
|
const handler = anyRequest.routeOptions?.handler || anyRequest.context?.handler;
|
|
226
|
-
const handlerName = handler?.name.startsWith(
|
|
163
|
+
const handlerName = handler?.name.startsWith("bound ") ? handler.name.substring(6) : handler?.name;
|
|
227
164
|
const spanName = `${FastifyNames.REQUEST_HANDLER} - ${handlerName || this.pluginName || ANONYMOUS_NAME}`;
|
|
228
|
-
|
|
229
165
|
const spanAttributes = {
|
|
230
166
|
[AttributeNames.PLUGIN_NAME]: this.pluginName,
|
|
231
167
|
[AttributeNames.FASTIFY_TYPE]: FastifyTypes.REQUEST_HANDLER,
|
|
232
168
|
// eslint-disable-next-line deprecation/deprecation
|
|
233
|
-
[SEMATTRS_HTTP_ROUTE]: anyRequest.routeOptions
|
|
234
|
-
? anyRequest.routeOptions.url // since fastify@4.10.0
|
|
235
|
-
: request.routerPath,
|
|
169
|
+
[SEMATTRS_HTTP_ROUTE]: anyRequest.routeOptions ? anyRequest.routeOptions.url : request.routerPath
|
|
236
170
|
};
|
|
237
171
|
if (handlerName) {
|
|
238
172
|
spanAttributes[AttributeNames.FASTIFY_NAME] = handlerName;
|
|
239
173
|
}
|
|
240
174
|
const span = startSpan(reply, instrumentation.tracer, spanName, spanAttributes);
|
|
241
|
-
|
|
242
175
|
addFastifyV3SpanAttributes(span);
|
|
243
|
-
|
|
244
176
|
const { requestHook } = instrumentation.getConfig();
|
|
245
177
|
if (requestHook) {
|
|
246
178
|
safeExecuteInTheMiddle(
|
|
247
179
|
() => requestHook(span, { request }),
|
|
248
|
-
e => {
|
|
180
|
+
(e) => {
|
|
249
181
|
if (e) {
|
|
250
|
-
instrumentation._diag.error(
|
|
182
|
+
instrumentation._diag.error("request hook failed", e);
|
|
251
183
|
}
|
|
252
184
|
},
|
|
253
|
-
true
|
|
185
|
+
true
|
|
254
186
|
);
|
|
255
187
|
}
|
|
256
|
-
|
|
257
188
|
return context.with(trace.setSpan(context.active(), span), () => {
|
|
258
189
|
done();
|
|
259
190
|
});
|
|
260
191
|
};
|
|
261
192
|
}
|
|
262
193
|
}
|
|
263
|
-
|
|
264
194
|
function instrumentClient() {
|
|
265
195
|
const client = getClient();
|
|
266
196
|
if (client) {
|
|
267
|
-
client.on(
|
|
197
|
+
client.on("spanStart", (span) => {
|
|
268
198
|
addFastifyV3SpanAttributes(span);
|
|
269
199
|
});
|
|
270
200
|
}
|
|
271
201
|
}
|
|
272
|
-
|
|
273
202
|
function addFastifyV3SpanAttributes(span) {
|
|
274
203
|
const attributes = spanToJSON(span).data;
|
|
275
|
-
|
|
276
|
-
// this is one of: middleware, request_handler
|
|
277
|
-
const type = attributes['fastify.type'];
|
|
278
|
-
|
|
279
|
-
// If this is already set, or we have no fastify span, no need to process again...
|
|
204
|
+
const type = attributes["fastify.type"];
|
|
280
205
|
if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {
|
|
281
206
|
return;
|
|
282
207
|
}
|
|
283
|
-
|
|
284
208
|
span.setAttributes({
|
|
285
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]:
|
|
286
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify
|
|
209
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.fastify",
|
|
210
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify`
|
|
287
211
|
});
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
if (typeof name === 'string') {
|
|
292
|
-
// Try removing `fastify -> ` and `@fastify/otel -> ` prefixes
|
|
293
|
-
// This is a bit of a hack, and not always working for all spans
|
|
294
|
-
// But it's the best we can do without a proper API
|
|
295
|
-
const updatedName = name.replace(/^fastify -> /, '').replace(/^@fastify\/otel -> /, '');
|
|
296
|
-
|
|
212
|
+
const name = attributes["fastify.name"] || attributes["plugin.name"] || attributes["hook.name"];
|
|
213
|
+
if (typeof name === "string") {
|
|
214
|
+
const updatedName = name.replace(/^fastify -> /, "").replace(/^@fastify\/otel -> /, "");
|
|
297
215
|
span.updateName(updatedName);
|
|
298
216
|
}
|
|
299
217
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/fastify/v3/instrumentation.ts"],"sourcesContent":["// Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/407f61591ba69a39a6908264379d4d98a48dbec4/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-this-alias */\n/* eslint-disable jsdoc/require-jsdoc */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type Attributes, context, SpanStatusCode, trace } from '@opentelemetry/api';\nimport { getRPCMetadata, RPCType } from '@opentelemetry/core';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport { SEMATTRS_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\nimport type { Span } from '@sentry/core';\nimport {\n getClient,\n getIsolationScope,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n} from '@sentry/core';\nimport type {\n FastifyErrorCodes,\n FastifyInstance,\n FastifyReply,\n FastifyRequest,\n HandlerOriginal,\n HookHandlerDoneFunction,\n} from '../types';\nimport { AttributeNames, FastifyNames, FastifyTypes } from './enums/AttributeNames';\nimport type { PluginFastifyReply } from './internal-types';\nimport type { FastifyInstrumentationConfig } from './types';\nimport { endSpan, safeExecuteInTheMiddleMaybePromise, startSpan } from './utils';\n/** @knipignore */\n\nconst PACKAGE_VERSION = '0.1.0';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-fastify-v3';\nconst ANONYMOUS_NAME = 'anonymous';\n\n// The instrumentation creates a span for invocations of lifecycle hook handlers\n// that take `(request, reply, ...[, done])` arguments. Currently this is all\n// lifecycle hooks except `onRequestAbort`.\n// https://fastify.dev/docs/latest/Reference/Hooks\nconst hooksNamesToWrap = new Set([\n 'onTimeout',\n 'onRequest',\n 'preParsing',\n 'preValidation',\n 'preSerialization',\n 'preHandler',\n 'onSend',\n 'onResponse',\n 'onError',\n]);\n\n/**\n * Fastify instrumentation for OpenTelemetry\n */\nexport class FastifyInstrumentationV3 extends InstrumentationBase<FastifyInstrumentationConfig> {\n public constructor(config: FastifyInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n }\n\n public init(): InstrumentationNodeModuleDefinition[] {\n return [\n new InstrumentationNodeModuleDefinition('fastify', ['>=3.0.0 <4'], moduleExports => {\n return this._patchConstructor(moduleExports);\n }),\n ];\n }\n\n private _hookOnRequest() {\n const instrumentation = this;\n\n return function onRequest(request: FastifyRequest, reply: FastifyReply, done: HookHandlerDoneFunction) {\n if (!instrumentation.isEnabled()) {\n return done();\n }\n instrumentation._wrap(reply, 'send', instrumentation._patchSend());\n\n const anyRequest = request as any;\n\n const rpcMetadata = getRPCMetadata(context.active());\n const routeName = anyRequest.routeOptions\n ? anyRequest.routeOptions.url // since fastify@4.10.0\n : request.routerPath;\n if (routeName && rpcMetadata?.type === RPCType.HTTP) {\n rpcMetadata.route = routeName;\n }\n\n const method = request.method || 'GET';\n\n getIsolationScope().setTransactionName(`${method} ${routeName}`);\n done();\n };\n }\n\n private _wrapHandler(\n pluginName: string,\n hookName: string,\n original: HandlerOriginal,\n syncFunctionWithDone: boolean,\n ): () => Promise<unknown> {\n const instrumentation = this;\n this._diag.debug('Patching fastify route.handler function');\n\n return function (this: any, ...args: unknown[]): Promise<unknown> {\n if (!instrumentation.isEnabled()) {\n return original.apply(this, args);\n }\n\n const name = original.name || pluginName || ANONYMOUS_NAME;\n const spanName = `${FastifyNames.MIDDLEWARE} - ${name}`;\n\n const reply = args[1] as PluginFastifyReply;\n\n const span = startSpan(reply, instrumentation.tracer, spanName, {\n [AttributeNames.FASTIFY_TYPE]: FastifyTypes.MIDDLEWARE,\n [AttributeNames.PLUGIN_NAME]: pluginName,\n [AttributeNames.HOOK_NAME]: hookName,\n });\n\n const origDone = syncFunctionWithDone && (args[args.length - 1] as HookHandlerDoneFunction);\n if (origDone) {\n args[args.length - 1] = function (...doneArgs: Parameters<HookHandlerDoneFunction>) {\n endSpan(reply);\n origDone.apply(this, doneArgs);\n };\n }\n\n return context.with(trace.setSpan(context.active(), span), () => {\n return safeExecuteInTheMiddleMaybePromise(\n () => {\n return original.apply(this, args);\n },\n err => {\n if (err instanceof Error) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n span.recordException(err);\n }\n // async hooks should end the span as soon as the promise is resolved\n if (!syncFunctionWithDone) {\n endSpan(reply);\n }\n },\n );\n });\n };\n }\n\n private _wrapAddHook(): (original: FastifyInstance['addHook']) => () => FastifyInstance {\n const instrumentation = this;\n this._diag.debug('Patching fastify server.addHook function');\n\n // biome-ignore lint/complexity/useArrowFunction: <explanation>\n return function (original: FastifyInstance['addHook']): () => FastifyInstance {\n return function wrappedAddHook(this: any, ...args: any) {\n const name = args[0] as string;\n const handler = args[1] as HandlerOriginal;\n const pluginName = this.pluginName;\n if (!hooksNamesToWrap.has(name)) {\n return original.apply(this, args);\n }\n\n const syncFunctionWithDone =\n typeof args[args.length - 1] === 'function' && handler.constructor.name !== 'AsyncFunction';\n\n return original.apply(this, [\n name,\n instrumentation._wrapHandler(pluginName, name, handler, syncFunctionWithDone),\n ] as never);\n };\n };\n }\n\n private _patchConstructor(moduleExports: {\n fastify: () => FastifyInstance;\n errorCodes: FastifyErrorCodes | undefined;\n }): () => FastifyInstance {\n const instrumentation = this;\n\n function fastify(this: FastifyInstance, ...args: any) {\n const app: FastifyInstance = moduleExports.fastify.apply(this, args);\n app.addHook('onRequest', instrumentation._hookOnRequest());\n app.addHook('preHandler', instrumentation._hookPreHandler());\n\n instrumentClient();\n\n instrumentation._wrap(app, 'addHook', instrumentation._wrapAddHook());\n\n return app;\n }\n\n if (moduleExports.errorCodes !== undefined) {\n fastify.errorCodes = moduleExports.errorCodes;\n }\n fastify.fastify = fastify;\n fastify.default = fastify;\n return fastify;\n }\n\n private _patchSend() {\n const instrumentation = this;\n this._diag.debug('Patching fastify reply.send function');\n\n return function patchSend(original: () => FastifyReply): () => FastifyReply {\n return function send(this: FastifyReply, ...args: any) {\n const maybeError: any = args[0];\n\n if (!instrumentation.isEnabled()) {\n return original.apply(this, args);\n }\n\n return safeExecuteInTheMiddle<FastifyReply>(\n () => {\n return original.apply(this, args);\n },\n err => {\n if (!err && maybeError instanceof Error) {\n // eslint-disable-next-line no-param-reassign\n err = maybeError;\n }\n endSpan(this, err);\n },\n );\n };\n };\n }\n\n private _hookPreHandler() {\n const instrumentation = this;\n this._diag.debug('Patching fastify preHandler function');\n\n return function preHandler(this: any, request: FastifyRequest, reply: FastifyReply, done: HookHandlerDoneFunction) {\n if (!instrumentation.isEnabled()) {\n return done();\n }\n const anyRequest = request as any;\n\n const handler = anyRequest.routeOptions?.handler || anyRequest.context?.handler;\n const handlerName = handler?.name.startsWith('bound ') ? handler.name.substring(6) : handler?.name;\n const spanName = `${FastifyNames.REQUEST_HANDLER} - ${handlerName || this.pluginName || ANONYMOUS_NAME}`;\n\n const spanAttributes: Attributes = {\n [AttributeNames.PLUGIN_NAME]: this.pluginName,\n [AttributeNames.FASTIFY_TYPE]: FastifyTypes.REQUEST_HANDLER,\n // eslint-disable-next-line deprecation/deprecation\n [SEMATTRS_HTTP_ROUTE]: anyRequest.routeOptions\n ? anyRequest.routeOptions.url // since fastify@4.10.0\n : request.routerPath,\n };\n if (handlerName) {\n spanAttributes[AttributeNames.FASTIFY_NAME] = handlerName;\n }\n const span = startSpan(reply, instrumentation.tracer, spanName, spanAttributes);\n\n addFastifyV3SpanAttributes(span);\n\n const { requestHook } = instrumentation.getConfig();\n if (requestHook) {\n safeExecuteInTheMiddle(\n () => requestHook(span, { request }),\n e => {\n if (e) {\n instrumentation._diag.error('request hook failed', e);\n }\n },\n true,\n );\n }\n\n return context.with(trace.setSpan(context.active(), span), () => {\n done();\n });\n };\n }\n}\n\nfunction instrumentClient(): void {\n const client = getClient();\n if (client) {\n client.on('spanStart', (span: Span) => {\n addFastifyV3SpanAttributes(span);\n });\n }\n}\n\nfunction addFastifyV3SpanAttributes(span: Span): void {\n const attributes = spanToJSON(span).data;\n\n // this is one of: middleware, request_handler\n const type = attributes['fastify.type'];\n\n // If this is already set, or we have no fastify span, no need to process again...\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {\n return;\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify`,\n });\n\n // Also update the name, we don't need to \"middleware - \" prefix\n const name = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name'];\n if (typeof name === 'string') {\n // Try removing `fastify -> ` and `@fastify/otel -> ` prefixes\n // This is a bit of a hack, and not always working for all spans\n // But it's the best we can do without a proper API\n const updatedName = name.replace(/^fastify -> /, '').repl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AAA,IAAA,KAAA,QAAA,EAAA;AACA;AACA;AACA;AACA,IAAA,MAAA,WAAA,GAAA,IAAA,CAAA,OAAA,CAAA,cAAA,EAAA,EAAA,CAAA,CAAA,OAAA,CAAA,qBAAA,EAAA,EAAA,CAAA;;AAEA,IAAA,IAAA,CAAA,UAAA,CAAA,WAAA,CAAA;AACA,EAAA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/fastify/v3/instrumentation.ts"],"sourcesContent":["// Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/407f61591ba69a39a6908264379d4d98a48dbec4/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-this-alias */\n/* eslint-disable jsdoc/require-jsdoc */\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type Attributes, context, SpanStatusCode, trace } from '@opentelemetry/api';\nimport { getRPCMetadata, RPCType } from '@opentelemetry/core';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport { SEMATTRS_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\nimport type { Span } from '@sentry/core';\nimport {\n getClient,\n getIsolationScope,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n} from '@sentry/core';\nimport type {\n FastifyErrorCodes,\n FastifyInstance,\n FastifyReply,\n FastifyRequest,\n HandlerOriginal,\n HookHandlerDoneFunction,\n} from '../types';\nimport { AttributeNames, FastifyNames, FastifyTypes } from './enums/AttributeNames';\nimport type { PluginFastifyReply } from './internal-types';\nimport type { FastifyInstrumentationConfig } from './types';\nimport { endSpan, safeExecuteInTheMiddleMaybePromise, startSpan } from './utils';\n/** @knipignore */\n\nconst PACKAGE_VERSION = '0.1.0';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-fastify-v3';\nconst ANONYMOUS_NAME = 'anonymous';\n\n// The instrumentation creates a span for invocations of lifecycle hook handlers\n// that take `(request, reply, ...[, done])` arguments. Currently this is all\n// lifecycle hooks except `onRequestAbort`.\n// https://fastify.dev/docs/latest/Reference/Hooks\nconst hooksNamesToWrap = new Set([\n 'onTimeout',\n 'onRequest',\n 'preParsing',\n 'preValidation',\n 'preSerialization',\n 'preHandler',\n 'onSend',\n 'onResponse',\n 'onError',\n]);\n\n/**\n * Fastify instrumentation for OpenTelemetry\n */\nexport class FastifyInstrumentationV3 extends InstrumentationBase<FastifyInstrumentationConfig> {\n public constructor(config: FastifyInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n }\n\n public init(): InstrumentationNodeModuleDefinition[] {\n return [\n new InstrumentationNodeModuleDefinition('fastify', ['>=3.0.0 <4'], moduleExports => {\n return this._patchConstructor(moduleExports);\n }),\n ];\n }\n\n private _hookOnRequest() {\n const instrumentation = this;\n\n return function onRequest(request: FastifyRequest, reply: FastifyReply, done: HookHandlerDoneFunction) {\n if (!instrumentation.isEnabled()) {\n return done();\n }\n instrumentation._wrap(reply, 'send', instrumentation._patchSend());\n\n const anyRequest = request as any;\n\n const rpcMetadata = getRPCMetadata(context.active());\n const routeName = anyRequest.routeOptions\n ? anyRequest.routeOptions.url // since fastify@4.10.0\n : request.routerPath;\n if (routeName && rpcMetadata?.type === RPCType.HTTP) {\n rpcMetadata.route = routeName;\n }\n\n const method = request.method || 'GET';\n\n getIsolationScope().setTransactionName(`${method} ${routeName}`);\n done();\n };\n }\n\n private _wrapHandler(\n pluginName: string,\n hookName: string,\n original: HandlerOriginal,\n syncFunctionWithDone: boolean,\n ): () => Promise<unknown> {\n const instrumentation = this;\n this._diag.debug('Patching fastify route.handler function');\n\n return function (this: any, ...args: unknown[]): Promise<unknown> {\n if (!instrumentation.isEnabled()) {\n return original.apply(this, args);\n }\n\n const name = original.name || pluginName || ANONYMOUS_NAME;\n const spanName = `${FastifyNames.MIDDLEWARE} - ${name}`;\n\n const reply = args[1] as PluginFastifyReply;\n\n const span = startSpan(reply, instrumentation.tracer, spanName, {\n [AttributeNames.FASTIFY_TYPE]: FastifyTypes.MIDDLEWARE,\n [AttributeNames.PLUGIN_NAME]: pluginName,\n [AttributeNames.HOOK_NAME]: hookName,\n });\n\n const origDone = syncFunctionWithDone && (args[args.length - 1] as HookHandlerDoneFunction);\n if (origDone) {\n args[args.length - 1] = function (...doneArgs: Parameters<HookHandlerDoneFunction>) {\n endSpan(reply);\n origDone.apply(this, doneArgs);\n };\n }\n\n return context.with(trace.setSpan(context.active(), span), () => {\n return safeExecuteInTheMiddleMaybePromise(\n () => {\n return original.apply(this, args);\n },\n err => {\n if (err instanceof Error) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n span.recordException(err);\n }\n // async hooks should end the span as soon as the promise is resolved\n if (!syncFunctionWithDone) {\n endSpan(reply);\n }\n },\n );\n });\n };\n }\n\n private _wrapAddHook(): (original: FastifyInstance['addHook']) => () => FastifyInstance {\n const instrumentation = this;\n this._diag.debug('Patching fastify server.addHook function');\n\n // biome-ignore lint/complexity/useArrowFunction: <explanation>\n return function (original: FastifyInstance['addHook']): () => FastifyInstance {\n return function wrappedAddHook(this: any, ...args: any) {\n const name = args[0] as string;\n const handler = args[1] as HandlerOriginal;\n const pluginName = this.pluginName;\n if (!hooksNamesToWrap.has(name)) {\n return original.apply(this, args);\n }\n\n const syncFunctionWithDone =\n typeof args[args.length - 1] === 'function' && handler.constructor.name !== 'AsyncFunction';\n\n return original.apply(this, [\n name,\n instrumentation._wrapHandler(pluginName, name, handler, syncFunctionWithDone),\n ] as never);\n };\n };\n }\n\n private _patchConstructor(moduleExports: {\n fastify: () => FastifyInstance;\n errorCodes: FastifyErrorCodes | undefined;\n }): () => FastifyInstance {\n const instrumentation = this;\n\n function fastify(this: FastifyInstance, ...args: any) {\n const app: FastifyInstance = moduleExports.fastify.apply(this, args);\n app.addHook('onRequest', instrumentation._hookOnRequest());\n app.addHook('preHandler', instrumentation._hookPreHandler());\n\n instrumentClient();\n\n instrumentation._wrap(app, 'addHook', instrumentation._wrapAddHook());\n\n return app;\n }\n\n if (moduleExports.errorCodes !== undefined) {\n fastify.errorCodes = moduleExports.errorCodes;\n }\n fastify.fastify = fastify;\n fastify.default = fastify;\n return fastify;\n }\n\n private _patchSend() {\n const instrumentation = this;\n this._diag.debug('Patching fastify reply.send function');\n\n return function patchSend(original: () => FastifyReply): () => FastifyReply {\n return function send(this: FastifyReply, ...args: any) {\n const maybeError: any = args[0];\n\n if (!instrumentation.isEnabled()) {\n return original.apply(this, args);\n }\n\n return safeExecuteInTheMiddle<FastifyReply>(\n () => {\n return original.apply(this, args);\n },\n err => {\n if (!err && maybeError instanceof Error) {\n // eslint-disable-next-line no-param-reassign\n err = maybeError;\n }\n endSpan(this, err);\n },\n );\n };\n };\n }\n\n private _hookPreHandler() {\n const instrumentation = this;\n this._diag.debug('Patching fastify preHandler function');\n\n return function preHandler(this: any, request: FastifyRequest, reply: FastifyReply, done: HookHandlerDoneFunction) {\n if (!instrumentation.isEnabled()) {\n return done();\n }\n const anyRequest = request as any;\n\n const handler = anyRequest.routeOptions?.handler || anyRequest.context?.handler;\n const handlerName = handler?.name.startsWith('bound ') ? handler.name.substring(6) : handler?.name;\n const spanName = `${FastifyNames.REQUEST_HANDLER} - ${handlerName || this.pluginName || ANONYMOUS_NAME}`;\n\n const spanAttributes: Attributes = {\n [AttributeNames.PLUGIN_NAME]: this.pluginName,\n [AttributeNames.FASTIFY_TYPE]: FastifyTypes.REQUEST_HANDLER,\n // eslint-disable-next-line deprecation/deprecation\n [SEMATTRS_HTTP_ROUTE]: anyRequest.routeOptions\n ? anyRequest.routeOptions.url // since fastify@4.10.0\n : request.routerPath,\n };\n if (handlerName) {\n spanAttributes[AttributeNames.FASTIFY_NAME] = handlerName;\n }\n const span = startSpan(reply, instrumentation.tracer, spanName, spanAttributes);\n\n addFastifyV3SpanAttributes(span);\n\n const { requestHook } = instrumentation.getConfig();\n if (requestHook) {\n safeExecuteInTheMiddle(\n () => requestHook(span, { request }),\n e => {\n if (e) {\n instrumentation._diag.error('request hook failed', e);\n }\n },\n true,\n );\n }\n\n return context.with(trace.setSpan(context.active(), span), () => {\n done();\n });\n };\n }\n}\n\nfunction instrumentClient(): void {\n const client = getClient();\n if (client) {\n client.on('spanStart', (span: Span) => {\n addFastifyV3SpanAttributes(span);\n });\n }\n}\n\nfunction addFastifyV3SpanAttributes(span: Span): void {\n const attributes = spanToJSON(span).data;\n\n // this is one of: middleware, request_handler\n const type = attributes['fastify.type'];\n\n // If this is already set, or we have no fastify span, no need to process again...\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {\n return;\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify`,\n });\n\n // Also update the name, we don't need to \"middleware - \" prefix\n const name = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name'];\n if (typeof name === 'string') {\n // Try removing `fastify -> ` and `@fastify/otel -> ` prefixes\n // This is a bit of a hack, and not always working for all spans\n // But it's the best we can do without a proper API\n const updatedName = name.replace(/^fastify -> /, '').replace(/^@fastify\\/otel -> /, '');\n\n span.updateName(updatedName);\n }\n}\n"],"names":[],"mappings":";;;;;;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H,CAAA;AAAA,EACF;AACF;AAEA,SAAS,gBAAA,GAAyB;AAChC,EAAA,MAAM,SAAS,SAAA,EAAU;AACzB,EAAA,IAAI,MAAA,EAAQ;AACV,IAAA,MAAA,CAAO,EAAA,CAAG,WAAA,EAAa,CAAC,IAAA,KAAe;AACrC,MAAA,0BAAA,CAA2B,IAAI,CAAA;AAAA,IACjC,CAAC,CAAA;AAAA,EACH;AACF;AAEA,SAAS,2BAA2B,IAAA,EAAkB;AACpD,EAAA,MAAM,UAAA,GAAa,UAAA,CAAW,IAAI,CAAA,CAAE,IAAA;AAGpC,EAAA,MAAM,IAAA,GAAO,WAAW,cAAc,CAAA;AAGtC,EAAA,IAAI,UAAA,CAAW,4BAA4B,CAAA,IAAK,CAAC,IAAA,EAAM;AACrD,IAAA;AAAA,EACF;AAEA,EAAA,IAAA,CAAK,aAAA,CAAc;AAAA,IACjB,CAAC,gCAAgC,GAAG,wBAAA;AAAA,IACpC,CAAC,4BAA4B,GAAG,CAAA,EAAG,IAAI,CAAA,QAAA;AAAA,GACxC,CAAA;AAGD,EAAA,MAAM,IAAA,GAAO,WAAW,cAAc,CAAA,IAAK,WAAW,aAAa,CAAA,IAAK,WAAW,WAAW,CAAA;AAC9F,EAAA,IAAI,OAAO,SAAS,QAAA,EAAU;AAI5B,IAAA,MAAM,WAAA,GAAc,KAAK,OAAA,CAAQ,cAAA,EAAgB,EAAE,CAAA,CAAE,OAAA,CAAQ,uBAAuB,EAAE,CAAA;AAEtF,IAAA,IAAA,CAAK,WAAW,WAAW,CAAA;AAAA,EAC7B;AACF;;;;"}
|
|
@@ -1,73 +1,27 @@
|
|
|
1
1
|
import { SpanStatusCode } from '@opentelemetry/api';
|
|
2
2
|
import { spanRequestSymbol } from './constants.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
/* eslint-disable jsdoc/require-jsdoc */
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-dynamic-delete */
|
|
7
|
-
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
8
|
-
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
9
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
10
|
-
/*
|
|
11
|
-
* Copyright The OpenTelemetry Authors
|
|
12
|
-
*
|
|
13
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
-
* you may not use this file except in compliance with the License.
|
|
15
|
-
* You may obtain a copy of the License at
|
|
16
|
-
*
|
|
17
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
-
*
|
|
19
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
-
* See the License for the specific language governing permissions and
|
|
23
|
-
* limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Starts Span
|
|
29
|
-
* @param reply - reply function
|
|
30
|
-
* @param tracer - tracer
|
|
31
|
-
* @param spanName - span name
|
|
32
|
-
* @param spanAttributes - span attributes
|
|
33
|
-
*/
|
|
34
|
-
function startSpan(
|
|
35
|
-
reply,
|
|
36
|
-
tracer,
|
|
37
|
-
spanName,
|
|
38
|
-
spanAttributes = {},
|
|
39
|
-
) {
|
|
4
|
+
function startSpan(reply, tracer, spanName, spanAttributes = {}) {
|
|
40
5
|
const span = tracer.startSpan(spanName, { attributes: spanAttributes });
|
|
41
|
-
|
|
42
6
|
const spans = reply[spanRequestSymbol] || [];
|
|
43
7
|
spans.push(span);
|
|
44
|
-
|
|
45
8
|
Object.defineProperty(reply, spanRequestSymbol, {
|
|
46
9
|
enumerable: false,
|
|
47
10
|
configurable: true,
|
|
48
|
-
value: spans
|
|
11
|
+
value: spans
|
|
49
12
|
});
|
|
50
|
-
|
|
51
13
|
return span;
|
|
52
14
|
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Ends span
|
|
56
|
-
* @param reply - reply function
|
|
57
|
-
* @param err - error
|
|
58
|
-
*/
|
|
59
15
|
function endSpan(reply, err) {
|
|
60
16
|
const spans = reply[spanRequestSymbol] || [];
|
|
61
|
-
// there is no active span, or it has already ended
|
|
62
17
|
if (!spans.length) {
|
|
63
18
|
return;
|
|
64
19
|
}
|
|
65
|
-
// biome-ignore lint/complexity/noForEach: <explanation>
|
|
66
20
|
spans.forEach((span) => {
|
|
67
21
|
if (err) {
|
|
68
22
|
span.setStatus({
|
|
69
23
|
code: SpanStatusCode.ERROR,
|
|
70
|
-
message: err.message
|
|
24
|
+
message: err.message
|
|
71
25
|
});
|
|
72
26
|
span.recordException(err);
|
|
73
27
|
}
|
|
@@ -75,34 +29,15 @@ function endSpan(reply, err) {
|
|
|
75
29
|
});
|
|
76
30
|
delete reply[spanRequestSymbol];
|
|
77
31
|
}
|
|
78
|
-
|
|
79
|
-
// @TODO after approve add this to instrumentation package and replace usage
|
|
80
|
-
// when it will be released
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* This function handles the missing case from instrumentation package when
|
|
84
|
-
* execute can either return a promise or void. And using async is not an
|
|
85
|
-
* option as it is producing unwanted side effects.
|
|
86
|
-
* @param execute - function to be executed
|
|
87
|
-
* @param onFinish - function called when function executed
|
|
88
|
-
* @param preventThrowingError - prevent to throw error when execute
|
|
89
|
-
* function fails
|
|
90
|
-
*/
|
|
91
|
-
|
|
92
|
-
function safeExecuteInTheMiddleMaybePromise(
|
|
93
|
-
execute,
|
|
94
|
-
onFinish,
|
|
95
|
-
preventThrowingError,
|
|
96
|
-
) {
|
|
32
|
+
function safeExecuteInTheMiddleMaybePromise(execute, onFinish, preventThrowingError) {
|
|
97
33
|
let error;
|
|
98
|
-
let result =
|
|
34
|
+
let result = void 0;
|
|
99
35
|
try {
|
|
100
36
|
result = execute();
|
|
101
|
-
|
|
102
37
|
if (isPromise(result)) {
|
|
103
38
|
result.then(
|
|
104
|
-
res => onFinish(
|
|
105
|
-
err => onFinish(err)
|
|
39
|
+
(res) => onFinish(void 0, res),
|
|
40
|
+
(err) => onFinish(err)
|
|
106
41
|
);
|
|
107
42
|
}
|
|
108
43
|
} catch (e) {
|
|
@@ -111,20 +46,14 @@ function safeExecuteInTheMiddleMaybePromise(
|
|
|
111
46
|
if (!isPromise(result)) {
|
|
112
47
|
onFinish(error, result);
|
|
113
48
|
if (error && true) {
|
|
114
|
-
// eslint-disable-next-line no-unsafe-finally
|
|
115
49
|
throw error;
|
|
116
50
|
}
|
|
117
51
|
}
|
|
118
|
-
// eslint-disable-next-line no-unsafe-finally
|
|
119
52
|
return result;
|
|
120
53
|
}
|
|
121
54
|
}
|
|
122
|
-
|
|
123
55
|
function isPromise(val) {
|
|
124
|
-
return (
|
|
125
|
-
(typeof val === 'object' && val && typeof Object.getOwnPropertyDescriptor(val, 'then')?.value === 'function') ||
|
|
126
|
-
false
|
|
127
|
-
);
|
|
56
|
+
return typeof val === "object" && val && typeof Object.getOwnPropertyDescriptor(val, "then")?.value === "function" || false;
|
|
128
57
|
}
|
|
129
58
|
|
|
130
59
|
export { endSpan, safeExecuteInTheMiddleMaybePromise, startSpan };
|