@sentry/node 10.58.0 → 10.59.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/index.js +2 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/fs/index.js +3 -84
- package/build/cjs/integrations/fs/index.js.map +1 -1
- package/build/cjs/integrations/fs/vendored/constants.js.map +1 -1
- package/build/cjs/integrations/fs/vendored/instrumentation.js +145 -175
- package/build/cjs/integrations/fs/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/fs/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/node-fetch/vendored/undici.js.map +1 -1
- package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
- package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
- package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -1
- package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/connect/index.js +0 -21
- package/build/cjs/integrations/tracing/connect/index.js.map +1 -1
- package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +0 -6
- package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
- package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +33 -42
- package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
- package/build/cjs/integrations/tracing/connect/vendored/utils.js +3 -2
- package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +1 -1
- package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/genericPool/index.js +1 -15
- package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -1
- package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +30 -18
- package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/index.js +1 -51
- package/build/cjs/integrations/tracing/graphql/index.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
- package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +67 -57
- package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
- package/build/cjs/integrations/tracing/graphql/vendored/utils.js +28 -62
- package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/hapi/index.js +0 -17
- package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
- package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
- package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +28 -45
- package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
- package/build/cjs/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/hapi/vendored/utils.js +4 -9
- package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/index.js +1 -0
- package/build/cjs/integrations/tracing/index.js.map +1 -1
- package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js.map +1 -1
- package/build/cjs/integrations/tracing/kafka/vendored/propagator.js.map +1 -1
- package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/knex/index.js +2 -17
- package/build/cjs/integrations/tracing/knex/index.js.map +1 -1
- package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +65 -93
- package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/knex/vendored/semconv.js +2 -0
- package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/knex/vendored/utils.js +2 -15
- package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/koa/index.js +1 -24
- package/build/cjs/integrations/tracing/koa/index.js.map +1 -1
- package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
- package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +29 -41
- package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
- package/build/cjs/integrations/tracing/koa/vendored/types.js.map +1 -1
- package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/mongo/index.js +1 -42
- package/build/cjs/integrations/tracing/mongo/index.js.map +1 -1
- package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +12 -562
- package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
- package/build/cjs/integrations/tracing/mongo/vendored/patches.js +151 -0
- package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +1 -0
- package/build/cjs/integrations/tracing/mongo/vendored/semconv.js +0 -4
- package/build/cjs/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/mongo/vendored/utils.js +153 -0
- package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -0
- package/build/cjs/integrations/tracing/mongoose/index.js +1 -8
- package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -1
- package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +56 -203
- package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
- package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js +0 -4
- package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +19 -49
- package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql2/index.js +1 -8
- package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +21 -59
- package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +14 -33
- package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/postgres/index.js +0 -4
- package/build/cjs/integrations/tracing/postgres/index.js.map +1 -1
- package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
- package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
- package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
- package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +51 -261
- package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +0 -12
- package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/postgres/vendored/utils.js +43 -167
- package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -1
- package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
- package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -1
- package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -1
- package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +89 -160
- package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +92 -231
- package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/redis/vendored/semconv.js +0 -2
- package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/tedious/index.js +1 -25
- package/build/cjs/integrations/tracing/tedious/index.js.map +1 -1
- package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +25 -76
- package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +1 -1
- package/build/cjs/sdk/diagnosticsChannelInjection.js +21 -0
- package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -0
- package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +19 -0
- package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
- package/build/cjs/sdk/index.js +17 -1
- package/build/cjs/sdk/index.js.map +1 -1
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/integrations/fs/index.js +4 -85
- package/build/esm/integrations/fs/index.js.map +1 -1
- package/build/esm/integrations/fs/vendored/constants.js.map +1 -1
- package/build/esm/integrations/fs/vendored/instrumentation.js +147 -177
- package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/fs/vendored/utils.js.map +1 -1
- package/build/esm/integrations/node-fetch/vendored/undici.js.map +1 -1
- package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
- package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
- package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -1
- package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/connect/index.js +1 -22
- package/build/esm/integrations/tracing/connect/index.js.map +1 -1
- package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +1 -6
- package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
- package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +36 -44
- package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
- package/build/esm/integrations/tracing/connect/vendored/utils.js +3 -2
- package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +1 -1
- package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/genericPool/index.js +3 -17
- package/build/esm/integrations/tracing/genericPool/index.js.map +1 -1
- package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +31 -19
- package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/index.js +3 -53
- package/build/esm/integrations/tracing/graphql/index.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
- package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +69 -59
- package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
- package/build/esm/integrations/tracing/graphql/vendored/utils.js +29 -62
- package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/hapi/index.js +1 -18
- package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
- package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
- package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +30 -47
- package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
- package/build/esm/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/hapi/vendored/utils.js +5 -10
- package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/index.js +1 -0
- package/build/esm/integrations/tracing/index.js.map +1 -1
- package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/kafka/vendored/internal-types.js.map +1 -1
- package/build/esm/integrations/tracing/kafka/vendored/propagator.js.map +1 -1
- package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/knex/index.js +4 -19
- package/build/esm/integrations/tracing/knex/index.js.map +1 -1
- package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +66 -94
- package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/knex/vendored/semconv.js +2 -1
- package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/knex/vendored/utils.js +3 -15
- package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/koa/index.js +3 -26
- package/build/esm/integrations/tracing/koa/index.js.map +1 -1
- package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
- package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +31 -43
- package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
- package/build/esm/integrations/tracing/koa/vendored/types.js.map +1 -1
- package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/mongo/index.js +3 -43
- package/build/esm/integrations/tracing/mongo/index.js.map +1 -1
- package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +13 -563
- package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
- package/build/esm/integrations/tracing/mongo/vendored/patches.js +143 -0
- package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +1 -0
- package/build/esm/integrations/tracing/mongo/vendored/semconv.js +1 -3
- package/build/esm/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/mongo/vendored/utils.js +146 -0
- package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -0
- package/build/esm/integrations/tracing/mongoose/index.js +2 -9
- package/build/esm/integrations/tracing/mongoose/index.js.map +1 -1
- package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +59 -206
- package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
- package/build/esm/integrations/tracing/mongoose/vendored/semconv.js +1 -3
- package/build/esm/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/mongoose/vendored/utils.js +20 -50
- package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
- package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/mysql2/index.js +2 -9
- package/build/esm/integrations/tracing/mysql2/index.js.map +1 -1
- package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +26 -64
- package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/mysql2/vendored/utils.js +15 -34
- package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/postgres/index.js +1 -5
- package/build/esm/integrations/tracing/postgres/index.js.map +1 -1
- package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
- package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
- package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
- package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +52 -262
- package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/postgres/vendored/semconv.js +1 -7
- package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/postgres/vendored/utils.js +44 -165
- package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -1
- package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
- package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -1
- package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -1
- package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/redis/index.js.map +1 -1
- package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +92 -163
- package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
- package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +94 -233
- package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/redis/vendored/semconv.js +1 -2
- package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/tedious/index.js +3 -27
- package/build/esm/integrations/tracing/tedious/index.js.map +1 -1
- package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +29 -79
- package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/sdk/diagnosticsChannelInjection.js +17 -0
- package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -0
- package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +17 -0
- package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
- package/build/esm/sdk/index.js +17 -1
- package/build/esm/sdk/index.js.map +1 -1
- package/build/import-hook.mjs +6 -0
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/fs/index.d.ts.map +1 -1
- package/build/types/integrations/fs/vendored/constants.d.ts.map +1 -1
- package/build/types/integrations/fs/vendored/instrumentation.d.ts +6 -10
- package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/fs/vendored/types.d.ts +10 -15
- package/build/types/integrations/fs/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/fs/vendored/utils.d.ts +2 -2
- package/build/types/integrations/fs/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/node-fetch/vendored/internal-types.d.ts.map +1 -1
- package/build/types/integrations/node-fetch/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/node-fetch/vendored/undici.d.ts.map +1 -1
- package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts.map +1 -1
- package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts.map +1 -1
- package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing/connect/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
- package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +1 -1
- package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +5 -5
- package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
- package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/connect/vendored/utils.d.ts +1 -1
- package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
- package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +7 -2
- package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +4 -4
- package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql/vendored/types.d.ts +5 -43
- package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +8 -11
- package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +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.map +1 -1
- package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
- package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +3 -4
- package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts.map +1 -1
- package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/kafka/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/tracing/knex/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
- package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
- package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/knex/vendored/utils.d.ts +0 -6
- package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing/koa/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +1 -1
- package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +1 -1
- package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
- package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/koa/vendored/types.d.ts +2 -39
- package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/tracing/koa/vendored/utils.d.ts +3 -3
- package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongo/index.d.ts +0 -4
- package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
- package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
- package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
- package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
- package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
- package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
- package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
- package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
- package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
- package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
- package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
- package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
- package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +1 -9
- package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
- package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
- package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres/vendored/types.d.ts +2 -56
- package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
- package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -1
- package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -1
- package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -1
- package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
- package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts.map +1 -1
- package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/redis/vendored/types.d.ts +2 -36
- package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
- package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +1 -1
- package/build/types/sdk/diagnosticsChannelInjection.d.ts +41 -0
- package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -0
- package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
- package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -0
- package/build/types/sdk/index.d.ts.map +1 -1
- package/build/types-ts3.8/index.d.ts +1 -0
- package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +6 -10
- package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +10 -15
- package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +2 -2
- package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
- package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +4 -4
- package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +6 -1
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +3 -3
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +4 -42
- package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +6 -9
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
- package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +1 -2
- package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
- package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
- package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +0 -6
- package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
- package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +1 -38
- package/build/types-ts3.8/integrations/tracing/mongo/index.d.ts +0 -4
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +0 -8
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +1 -55
- package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
- package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
- package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +2 -36
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
- package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +41 -0
- package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
- package/package.json +20 -6
- package/build/cjs/integrations/tracing/knex/vendored/constants.js +0 -16
- package/build/cjs/integrations/tracing/knex/vendored/constants.js.map +0 -1
- package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js +0 -6
- package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
- package/build/cjs/integrations/tracing/utils/sql-common.js +0 -43
- package/build/cjs/integrations/tracing/utils/sql-common.js.map +0 -1
- package/build/esm/integrations/tracing/knex/vendored/constants.js +0 -13
- package/build/esm/integrations/tracing/knex/vendored/constants.js.map +0 -1
- package/build/esm/integrations/tracing/postgres/vendored/internal-types.js +0 -4
- package/build/esm/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
- package/build/esm/integrations/tracing/utils/sql-common.js +0 -41
- package/build/esm/integrations/tracing/utils/sql-common.js.map +0 -1
- package/build/types/integrations/tracing/knex/vendored/constants.d.ts +0 -3
- package/build/types/integrations/tracing/knex/vendored/constants.d.ts.map +0 -1
- package/build/types/integrations/tracing/knex/vendored/types.d.ts +0 -8
- package/build/types/integrations/tracing/knex/vendored/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongo/vendored/types.d.ts +0 -51
- package/build/types/integrations/tracing/mongo/vendored/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
- package/build/types/integrations/tracing/mongoose/vendored/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
- package/build/types/integrations/tracing/mysql2/vendored/types.d.ts.map +0 -1
- package/build/types/integrations/tracing/tedious/vendored/types.d.ts +0 -10
- package/build/types/integrations/tracing/tedious/vendored/types.d.ts.map +0 -1
- package/build/types-ts3.8/integrations/tracing/knex/vendored/constants.d.ts +0 -3
- package/build/types-ts3.8/integrations/tracing/knex/vendored/types.d.ts +0 -8
- package/build/types-ts3.8/integrations/tracing/mongo/vendored/types.d.ts +0 -51
- package/build/types-ts3.8/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
- package/build/types-ts3.8/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
- package/build/types-ts3.8/integrations/tracing/tedious/vendored/types.d.ts +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/fastify/vendored/instrumentation.ts"],"sourcesContent":["/*\n * MIT License\n *\n * Copyright (c) 2024-present The Fastify team <https://github.com/fastify/fastify#team>\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/fastify/otel/tree/bae80d6caef4287e7f01ff3c8dc753243706ea86\n * - Upstream version: @fastify/otel@0.18.1\n * - Converted from JavaScript to TypeScript with minimal type annotations\n * - Removed `ignorePaths` / `minimatch` support (not used by the Sentry integration)\n */\n/* eslint-disable */\n\nimport * as dc from 'node:diagnostics_channel';\nimport { context, trace, SpanStatusCode, propagation, diag, type Span } from '@opentelemetry/api';\nimport {\n ATTR_HTTP_ROUTE,\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n ATTR_HTTP_REQUEST_METHOD,\n ATTR_URL_PATH,\n} from '@opentelemetry/semantic-conventions';\nimport { InstrumentationBase, type InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { SDK_VERSION } from '@sentry/core';\nimport { setHttpServerSpanRouteAttribute } from '../../../../utils/setHttpServerSpanRouteAttribute';\n\nconst PACKAGE_VERSION = SDK_VERSION;\nconst PACKAGE_NAME = '@sentry/instrumentation-fastify';\n\nconst SUPPORTED_VERSIONS = '>=4.0.0 <6';\nconst FASTIFY_HOOKS = [\n 'onRequest',\n 'preParsing',\n 'preValidation',\n 'preHandler',\n 'preSerialization',\n 'onSend',\n 'onResponse',\n 'onError',\n];\nconst ATTRIBUTE_NAMES = {\n HOOK_NAME: 'hook.name',\n FASTIFY_TYPE: 'fastify.type',\n HOOK_CALLBACK_NAME: 'hook.callback.name',\n ROOT: 'fastify.root',\n};\nconst HOOK_TYPES = {\n ROUTE: 'route-hook',\n INSTANCE: 'hook',\n HANDLER: 'request-handler',\n};\nconst ANONYMOUS_FUNCTION_NAME = 'anonymous';\n\nconst kInstrumentation = Symbol('fastify otel instance');\nconst kRequestSpan = Symbol('fastify otel request spans');\nconst kRequestContext = Symbol('fastify otel request context');\nconst kAddHookOriginal = Symbol('fastify otel addhook original');\nconst kSetNotFoundOriginal = Symbol('fastify otel setnotfound original');\nconst kRecordExceptions = Symbol('fastify otel record exceptions');\n\nexport interface FastifyOtelInstrumentationOpts extends InstrumentationConfig {\n registerOnInitialization?: boolean;\n requestHook?: (span: Span, request: any) => void;\n lifecycleHook?: (span: Span, info: { hookName: string; request: any; handler?: string }) => void;\n recordExceptions?: boolean;\n}\n\nexport class FastifyOtelInstrumentation extends InstrumentationBase<FastifyOtelInstrumentationOpts> {\n _otelLogger: any = null;\n _requestHook: ((span: Span, request: any) => void) | null = null;\n _lifecycleHook: ((span: Span, info: any) => void) | null = null;\n _handleInitialization: ((message: any) => void) | undefined = undefined;\n\n [kRecordExceptions]: boolean = true;\n\n constructor(config: FastifyOtelInstrumentationOpts = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n this._otelLogger = diag.createComponentLogger({ namespace: PACKAGE_NAME });\n this[kRecordExceptions] = true;\n\n if (config?.recordExceptions != null) {\n if (typeof config.recordExceptions !== 'boolean') {\n throw new TypeError('recordExceptions must be a boolean');\n }\n\n this[kRecordExceptions] = config.recordExceptions;\n }\n if (typeof config?.requestHook === 'function') {\n this._requestHook = config.requestHook;\n }\n if (typeof config?.lifecycleHook === 'function') {\n this._lifecycleHook = config.lifecycleHook;\n }\n }\n\n enable(): any {\n if (this._handleInitialization === undefined && this.getConfig().registerOnInitialization) {\n this._handleInitialization = (message: any) => {\n this.plugin()(message.fastify, undefined, () => {});\n const emptyPlugin: any = (_: any, __: any, done: () => void) => {\n done();\n };\n emptyPlugin[Symbol.for('skip-override')] = true;\n emptyPlugin[Symbol.for('fastify.display-name')] = PACKAGE_NAME;\n message.fastify.register(emptyPlugin);\n };\n dc.subscribe('fastify.initialization', this._handleInitialization);\n }\n return super.enable();\n }\n\n disable(): any {\n if (this._handleInitialization) {\n dc.unsubscribe('fastify.initialization', this._handleInitialization);\n this._handleInitialization = undefined;\n }\n return super.disable();\n }\n\n init() {\n return [];\n }\n\n plugin(): any {\n const instrumentation = this;\n\n const pluginAny = FastifyInstrumentationPlugin as any;\n pluginAny[Symbol.for('skip-override')] = true;\n pluginAny[Symbol.for('fastify.display-name')] = PACKAGE_NAME;\n pluginAny[Symbol.for('plugin-meta')] = {\n fastify: SUPPORTED_VERSIONS,\n name: PACKAGE_NAME,\n };\n\n return FastifyInstrumentationPlugin;\n\n function FastifyInstrumentationPlugin(instance: any, _opts: any, done: () => void) {\n instance.decorate(kInstrumentation, instrumentation);\n instance.decorate(kAddHookOriginal, instance.addHook);\n instance.decorate(kSetNotFoundOriginal, instance.setNotFoundHandler);\n instance.decorateRequest('opentelemetry', function opentelemetry(this: any) {\n const ctx = this[kRequestContext];\n const span = this[kRequestSpan];\n\n return {\n enabled: this.routeOptions.config?.otel !== false,\n span,\n tracer: instrumentation.tracer,\n context: ctx,\n inject: (carrier: any, setter?: any) => {\n return propagation.inject(ctx, carrier, setter);\n },\n extract: (carrier: any, getter?: any) => {\n return propagation.extract(ctx, carrier, getter);\n },\n };\n });\n instance.decorateRequest(kRequestSpan, null);\n instance.decorateRequest(kRequestContext, null);\n\n instance.addHook('onRoute', function otelWireRoute(this: any, routeOptions: any) {\n if (routeOptions.config?.otel === false) {\n instrumentation._otelLogger.debug(\n `Ignoring route instrumentation ${routeOptions.method} ${routeOptions.url} because it is disabled`,\n );\n\n return;\n }\n\n for (const hook of FASTIFY_HOOKS) {\n if (routeOptions[hook] != null) {\n const handlerLike = routeOptions[hook];\n\n if (typeof handlerLike === 'function') {\n routeOptions[hook] = handlerWrapper(handlerLike, hook, {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route -> ${hook}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.ROUTE,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n handlerLike.name?.length > 0 ? handlerLike.name : ANONYMOUS_FUNCTION_NAME,\n });\n } else if (Array.isArray(handlerLike)) {\n const wrappedHandlers: any[] = [];\n\n for (const handler of handlerLike) {\n wrappedHandlers.push(\n handlerWrapper(handler, hook, {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route -> ${hook}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.ROUTE,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME,\n }),\n );\n }\n\n routeOptions[hook] = wrappedHandlers;\n }\n }\n }\n\n if (routeOptions.onSend != null) {\n routeOptions.onSend = Array.isArray(routeOptions.onSend)\n ? [...routeOptions.onSend, finalizeResponseSpanHook]\n : [routeOptions.onSend, finalizeResponseSpanHook];\n } else {\n routeOptions.onSend = finalizeResponseSpanHook;\n }\n\n if (routeOptions.onError != null) {\n routeOptions.onError = Array.isArray(routeOptions.onError)\n ? [...routeOptions.onError, recordErrorInSpanHook]\n : [routeOptions.onError, recordErrorInSpanHook];\n } else {\n routeOptions.onError = recordErrorInSpanHook;\n }\n\n routeOptions.handler = handlerWrapper(routeOptions.handler, 'handler', {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.HANDLER,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n routeOptions.handler.name.length > 0 ? routeOptions.handler.name : ANONYMOUS_FUNCTION_NAME,\n });\n });\n\n instance.addHook(\n 'onRequest',\n function startRequestSpanHook(this: any, request: any, _reply: any, hookDone: () => void) {\n if (this[kInstrumentation].isEnabled() === false || request.routeOptions.config?.otel === false) {\n return hookDone();\n }\n\n let ctx = context.active();\n\n if (trace.getSpan(ctx) == null) {\n ctx = propagation.extract(ctx, request.headers);\n }\n\n if (request.routeOptions.url != null) {\n setHttpServerSpanRouteAttribute(request.routeOptions.url);\n }\n\n const attributes: Record<string, string> = {\n [ATTRIBUTE_NAMES.ROOT]: PACKAGE_NAME,\n [ATTR_HTTP_REQUEST_METHOD]: request.method,\n [ATTR_URL_PATH]: request.url,\n };\n\n if (request.routeOptions.url != null) {\n attributes[ATTR_HTTP_ROUTE] = request.routeOptions.url;\n }\n\n const span = this[kInstrumentation].tracer.startSpan('request', { attributes }, ctx);\n\n try {\n this[kInstrumentation]._requestHook?.(span, request);\n } catch (err) {\n this[kInstrumentation]._otelLogger.error({ err }, 'requestHook threw');\n }\n\n request[kRequestContext] = trace.setSpan(ctx, span);\n request[kRequestSpan] = span;\n\n context.with(request[kRequestContext], () => {\n hookDone();\n });\n },\n );\n\n instance.addHook('onResponse', function finalizeNotFoundSpanHook(request: any, reply: any, hookDone: () => void) {\n const span = request[kRequestSpan];\n\n if (span != null) {\n span.setAttributes({\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: reply.statusCode,\n });\n span.end();\n }\n\n request[kRequestSpan] = null;\n\n hookDone();\n });\n\n instance.addHook = addHookPatched;\n instance.setNotFoundHandler = setNotFoundHandlerPatched;\n\n done();\n\n function finalizeResponseSpanHook(\n request: any,\n reply: any,\n payload: any,\n hookDone: (err: null, payload: any) => void,\n ) {\n const span = request[kRequestSpan];\n\n if (span != null) {\n if (reply.statusCode >= 500) {\n span.setStatus({ code: SpanStatusCode.ERROR });\n }\n\n span.setAttributes({\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: reply.statusCode,\n });\n span.end();\n }\n\n request[kRequestSpan] = null;\n\n hookDone(null, payload);\n }\n\n function recordErrorInSpanHook(request: any, _reply: any, error: any, hookDone: () => void) {\n const span = request[kRequestSpan];\n\n if (span != null) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n if (instrumentation[kRecordExceptions] !== false) {\n span.recordException(error);\n }\n }\n\n hookDone();\n }\n\n function addHookPatched(this: any, name: string, hook: (...args: any[]) => any) {\n const addHookOriginal = this[kAddHookOriginal];\n\n if (FASTIFY_HOOKS.includes(name)) {\n return addHookOriginal.call(\n this,\n name,\n handlerWrapper(hook, name, {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - ${name}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]: hook.name?.length > 0 ? hook.name : ANONYMOUS_FUNCTION_NAME,\n }),\n );\n } else {\n return addHookOriginal.call(this, name, hook);\n }\n }\n\n function setNotFoundHandlerPatched(this: any, hooks: any, handler?: any) {\n const setNotFoundHandlerOriginal = this[kSetNotFoundOriginal];\n if (typeof hooks === 'function') {\n handler = handlerWrapper(hooks, 'notFoundHandler', {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]: hooks.name?.length > 0 ? hooks.name : ANONYMOUS_FUNCTION_NAME,\n });\n setNotFoundHandlerOriginal.call(this, handler);\n } else {\n if (hooks.preValidation != null) {\n hooks.preValidation = handlerWrapper(hooks.preValidation, 'notFoundHandler - preValidation', {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler - preValidation`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hooks.preValidation.name?.length > 0 ? hooks.preValidation.name : ANONYMOUS_FUNCTION_NAME,\n });\n }\n\n if (hooks.preHandler != null) {\n hooks.preHandler = handlerWrapper(hooks.preHandler, 'notFoundHandler - preHandler', {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler - preHandler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hooks.preHandler.name?.length > 0 ? hooks.preHandler.name : ANONYMOUS_FUNCTION_NAME,\n });\n }\n\n handler = handlerWrapper(handler, 'notFoundHandler', {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]: handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME,\n });\n setNotFoundHandlerOriginal.call(this, hooks, handler);\n }\n }\n\n function getRequestFromArgs(args: any[]) {\n for (const arg of args) {\n if (arg?.routeOptions && arg.url && arg.method) {\n return arg;\n }\n }\n return null;\n }\n\n function handlerWrapper(\n handler: (...args: any[]) => any,\n hookName: string,\n spanAttributes: Record<string, string> = {},\n ) {\n return function handlerWrapped(this: any, ...args: any[]) {\n const instrumentation: FastifyOtelInstrumentation = this[kInstrumentation];\n\n const request = getRequestFromArgs(args);\n if (request === null) {\n instrumentation._otelLogger.debug(\n `Ignoring route instrumentation because ${hookName} was called without a Fastify request argument`,\n );\n return handler.call(this, ...args);\n }\n\n if (instrumentation.isEnabled() === false || request.routeOptions.config?.otel === false) {\n instrumentation._otelLogger.debug(\n `Ignoring route instrumentation ${request.routeOptions.method} ${request.routeOptions.url} because it is disabled`,\n );\n return handler.call(this, ...args);\n }\n\n const ctx = request[kRequestContext] ?? context.active();\n const handlerName = handler.name?.length > 0 ? handler.name : (this.pluginName ?? ANONYMOUS_FUNCTION_NAME);\n\n const span = instrumentation.tracer.startSpan(\n `${hookName} - ${handlerName}`,\n {\n attributes: spanAttributes,\n },\n ctx,\n );\n\n if (instrumentation._lifecycleHook != null) {\n try {\n instrumentation._lifecycleHook(span, {\n hookName,\n request,\n handler: handlerName,\n });\n } catch (err) {\n instrumentation._otelLogger.error({ err }, 'Execution of lifecycleHook failed');\n }\n }\n\n return context.with(\n trace.setSpan(ctx, span),\n function (this: any) {\n try {\n const res = handler.call(this, ...args);\n\n if (typeof res?.then === 'function') {\n return res.then(\n (result: any) => {\n span.end();\n return result;\n },\n (error: any) => {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n if (instrumentation[kRecordExceptions] !== false) {\n span.recordException(error);\n }\n span.end();\n return Promise.reject(error);\n },\n );\n }\n\n span.end();\n return res;\n } catch (error: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n if (instrumentation[kRecordExceptions] !== false) {\n span.recordException(error);\n }\n span.end();\n throw error;\n }\n },\n this,\n );\n };\n }\n }\n }\n}\n"],"names":["SDK_VERSION","InstrumentationBase","diag","propagation","ATTR_HTTP_ROUTE","context","trace","setHttpServerSpanRouteAttribute","ATTR_HTTP_REQUEST_METHOD","ATTR_URL_PATH","ATTR_HTTP_RESPONSE_STATUS_CODE","SpanStatusCode","instrumentation"],"mappings":";;;;;;;;;AAAA,IAAA,EAAA,EAAA,EAAA;AA2CA,MAAM,eAAA,GAAkBA,gBAAA;AACxB,MAAM,YAAA,GAAe,iCAAA;AAErB,MAAM,kBAAA,GAAqB,YAAA;AAC3B,MAAM,aAAA,GAAgB;AAAA,EACpB,WAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA,YAAA;AAAA,EACA,kBAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAA;AACA,MAAM,eAAA,GAAkB;AAAA,EACtB,SAAA,EAAW,WAAA;AAAA,EACX,YAAA,EAAc,cAAA;AAAA,EACd,kBAAA,EAAoB,oBAAA;AAAA,EACpB,IAAA,EAAM;AACR,CAAA;AACA,MAAM,UAAA,GAAa;AAAA,EACjB,KAAA,EAAO,YAAA;AAAA,EACP,QAAA,EAAU,MAAA;AAAA,EACV,OAAA,EAAS;AACX,CAAA;AACA,MAAM,uBAAA,GAA0B,WAAA;AAEhC,MAAM,gBAAA,0BAA0B,uBAAuB,CAAA;AACvD,MAAM,YAAA,0BAAsB,4BAA4B,CAAA;AACxD,MAAM,eAAA,0BAAyB,8BAA8B,CAAA;AAC7D,MAAM,gBAAA,0BAA0B,+BAA+B,CAAA;AAC/D,MAAM,oBAAA,0BAA8B,mCAAmC,CAAA;AACvE,MAAM,iBAAA,0BAA2B,gCAAgC,CAAA;AAS1D,MAAM,0BAAA,UAAmC,EAAA,GAAAC,mCAAA,EAM7C,EAAA,GAAA,iBAAA,EAN6C,EAAA,EAAoD;AAAA,EAQlG,WAAA,CAAY,MAAA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AAM;AAAA,iBAChB,CAAA;AACD,gBAAA,IAAIC,gBAAAA,CAAgB,iBAAiB,CAAA,KAAM,KAAA,EAAO;AAChD,kBAAA,IAAA,CAAK,gBAAgB,KAAK,CAAA;AAAA,gBAC5B;AACA,gBAAA,IAAA,CAAK,GAAA,EAAI;AACT,gBAAA,MAAM,KAAA;AAAA,cACR;AAAA,YACF,CAAA;AAAA,YACA;AAAA,WACF;AAAA,QACF,CAAA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/fastify/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright (c) 2024-present The Fastify team <https://github.com/fastify/fastify#team>\n * SPDX-License-Identifier: MIT\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/fastify/otel/tree/bae80d6caef4287e7f01ff3c8dc753243706ea86\n * - Upstream version: @fastify/otel@0.18.1\n * - Converted from JavaScript to TypeScript with minimal type annotations\n * - Removed `ignorePaths` / `minimatch` support (not used by the Sentry integration)\n */\n/* eslint-disable */\n\nimport * as dc from 'node:diagnostics_channel';\nimport { context, trace, SpanStatusCode, propagation, diag, type Span } from '@opentelemetry/api';\nimport {\n ATTR_HTTP_ROUTE,\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n ATTR_HTTP_REQUEST_METHOD,\n ATTR_URL_PATH,\n} from '@opentelemetry/semantic-conventions';\nimport { InstrumentationBase, type InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { SDK_VERSION } from '@sentry/core';\nimport { setHttpServerSpanRouteAttribute } from '../../../../utils/setHttpServerSpanRouteAttribute';\n\nconst PACKAGE_VERSION = SDK_VERSION;\nconst PACKAGE_NAME = '@sentry/instrumentation-fastify';\n\nconst SUPPORTED_VERSIONS = '>=4.0.0 <6';\nconst FASTIFY_HOOKS = [\n 'onRequest',\n 'preParsing',\n 'preValidation',\n 'preHandler',\n 'preSerialization',\n 'onSend',\n 'onResponse',\n 'onError',\n];\nconst ATTRIBUTE_NAMES = {\n HOOK_NAME: 'hook.name',\n FASTIFY_TYPE: 'fastify.type',\n HOOK_CALLBACK_NAME: 'hook.callback.name',\n ROOT: 'fastify.root',\n};\nconst HOOK_TYPES = {\n ROUTE: 'route-hook',\n INSTANCE: 'hook',\n HANDLER: 'request-handler',\n};\nconst ANONYMOUS_FUNCTION_NAME = 'anonymous';\n\nconst kInstrumentation = Symbol('fastify otel instance');\nconst kRequestSpan = Symbol('fastify otel request spans');\nconst kRequestContext = Symbol('fastify otel request context');\nconst kAddHookOriginal = Symbol('fastify otel addhook original');\nconst kSetNotFoundOriginal = Symbol('fastify otel setnotfound original');\nconst kRecordExceptions = Symbol('fastify otel record exceptions');\n\nexport interface FastifyOtelInstrumentationOpts extends InstrumentationConfig {\n registerOnInitialization?: boolean;\n requestHook?: (span: Span, request: any) => void;\n lifecycleHook?: (span: Span, info: { hookName: string; request: any; handler?: string }) => void;\n recordExceptions?: boolean;\n}\n\nexport class FastifyOtelInstrumentation extends InstrumentationBase<FastifyOtelInstrumentationOpts> {\n _otelLogger: any = null;\n _requestHook: ((span: Span, request: any) => void) | null = null;\n _lifecycleHook: ((span: Span, info: any) => void) | null = null;\n _handleInitialization: ((message: any) => void) | undefined = undefined;\n\n [kRecordExceptions]: boolean = true;\n\n constructor(config: FastifyOtelInstrumentationOpts = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n this._otelLogger = diag.createComponentLogger({ namespace: PACKAGE_NAME });\n this[kRecordExceptions] = true;\n\n if (config?.recordExceptions != null) {\n if (typeof config.recordExceptions !== 'boolean') {\n throw new TypeError('recordExceptions must be a boolean');\n }\n\n this[kRecordExceptions] = config.recordExceptions;\n }\n if (typeof config?.requestHook === 'function') {\n this._requestHook = config.requestHook;\n }\n if (typeof config?.lifecycleHook === 'function') {\n this._lifecycleHook = config.lifecycleHook;\n }\n }\n\n enable(): any {\n if (this._handleInitialization === undefined && this.getConfig().registerOnInitialization) {\n this._handleInitialization = (message: any) => {\n this.plugin()(message.fastify, undefined, () => {});\n const emptyPlugin: any = (_: any, __: any, done: () => void) => {\n done();\n };\n emptyPlugin[Symbol.for('skip-override')] = true;\n emptyPlugin[Symbol.for('fastify.display-name')] = PACKAGE_NAME;\n message.fastify.register(emptyPlugin);\n };\n dc.subscribe('fastify.initialization', this._handleInitialization);\n }\n return super.enable();\n }\n\n disable(): any {\n if (this._handleInitialization) {\n dc.unsubscribe('fastify.initialization', this._handleInitialization);\n this._handleInitialization = undefined;\n }\n return super.disable();\n }\n\n init() {\n return [];\n }\n\n plugin(): any {\n const instrumentation = this;\n\n const pluginAny = FastifyInstrumentationPlugin as any;\n pluginAny[Symbol.for('skip-override')] = true;\n pluginAny[Symbol.for('fastify.display-name')] = PACKAGE_NAME;\n pluginAny[Symbol.for('plugin-meta')] = {\n fastify: SUPPORTED_VERSIONS,\n name: PACKAGE_NAME,\n };\n\n return FastifyInstrumentationPlugin;\n\n function FastifyInstrumentationPlugin(instance: any, _opts: any, done: () => void) {\n instance.decorate(kInstrumentation, instrumentation);\n instance.decorate(kAddHookOriginal, instance.addHook);\n instance.decorate(kSetNotFoundOriginal, instance.setNotFoundHandler);\n instance.decorateRequest('opentelemetry', function opentelemetry(this: any) {\n const ctx = this[kRequestContext];\n const span = this[kRequestSpan];\n\n return {\n enabled: this.routeOptions.config?.otel !== false,\n span,\n tracer: instrumentation.tracer,\n context: ctx,\n inject: (carrier: any, setter?: any) => {\n return propagation.inject(ctx, carrier, setter);\n },\n extract: (carrier: any, getter?: any) => {\n return propagation.extract(ctx, carrier, getter);\n },\n };\n });\n instance.decorateRequest(kRequestSpan, null);\n instance.decorateRequest(kRequestContext, null);\n\n instance.addHook('onRoute', function otelWireRoute(this: any, routeOptions: any) {\n if (routeOptions.config?.otel === false) {\n instrumentation._otelLogger.debug(\n `Ignoring route instrumentation ${routeOptions.method} ${routeOptions.url} because it is disabled`,\n );\n\n return;\n }\n\n for (const hook of FASTIFY_HOOKS) {\n if (routeOptions[hook] != null) {\n const handlerLike = routeOptions[hook];\n\n if (typeof handlerLike === 'function') {\n routeOptions[hook] = handlerWrapper(handlerLike, hook, {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route -> ${hook}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.ROUTE,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n handlerLike.name?.length > 0 ? handlerLike.name : ANONYMOUS_FUNCTION_NAME,\n });\n } else if (Array.isArray(handlerLike)) {\n const wrappedHandlers: any[] = [];\n\n for (const handler of handlerLike) {\n wrappedHandlers.push(\n handlerWrapper(handler, hook, {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route -> ${hook}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.ROUTE,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME,\n }),\n );\n }\n\n routeOptions[hook] = wrappedHandlers;\n }\n }\n }\n\n if (routeOptions.onSend != null) {\n routeOptions.onSend = Array.isArray(routeOptions.onSend)\n ? [...routeOptions.onSend, finalizeResponseSpanHook]\n : [routeOptions.onSend, finalizeResponseSpanHook];\n } else {\n routeOptions.onSend = finalizeResponseSpanHook;\n }\n\n if (routeOptions.onError != null) {\n routeOptions.onError = Array.isArray(routeOptions.onError)\n ? [...routeOptions.onError, recordErrorInSpanHook]\n : [routeOptions.onError, recordErrorInSpanHook];\n } else {\n routeOptions.onError = recordErrorInSpanHook;\n }\n\n routeOptions.handler = handlerWrapper(routeOptions.handler, 'handler', {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.HANDLER,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n routeOptions.handler.name.length > 0 ? routeOptions.handler.name : ANONYMOUS_FUNCTION_NAME,\n });\n });\n\n instance.addHook(\n 'onRequest',\n function startRequestSpanHook(this: any, request: any, _reply: any, hookDone: () => void) {\n if (this[kInstrumentation].isEnabled() === false || request.routeOptions.config?.otel === false) {\n return hookDone();\n }\n\n let ctx = context.active();\n\n if (trace.getSpan(ctx) == null) {\n ctx = propagation.extract(ctx, request.headers);\n }\n\n if (request.routeOptions.url != null) {\n setHttpServerSpanRouteAttribute(request.routeOptions.url);\n }\n\n const attributes: Record<string, string> = {\n [ATTRIBUTE_NAMES.ROOT]: PACKAGE_NAME,\n [ATTR_HTTP_REQUEST_METHOD]: request.method,\n [ATTR_URL_PATH]: request.url,\n };\n\n if (request.routeOptions.url != null) {\n attributes[ATTR_HTTP_ROUTE] = request.routeOptions.url;\n }\n\n const span = this[kInstrumentation].tracer.startSpan('request', { attributes }, ctx);\n\n try {\n this[kInstrumentation]._requestHook?.(span, request);\n } catch (err) {\n this[kInstrumentation]._otelLogger.error({ err }, 'requestHook threw');\n }\n\n request[kRequestContext] = trace.setSpan(ctx, span);\n request[kRequestSpan] = span;\n\n context.with(request[kRequestContext], () => {\n hookDone();\n });\n },\n );\n\n instance.addHook('onResponse', function finalizeNotFoundSpanHook(request: any, reply: any, hookDone: () => void) {\n const span = request[kRequestSpan];\n\n if (span != null) {\n span.setAttributes({\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: reply.statusCode,\n });\n span.end();\n }\n\n request[kRequestSpan] = null;\n\n hookDone();\n });\n\n instance.addHook = addHookPatched;\n instance.setNotFoundHandler = setNotFoundHandlerPatched;\n\n done();\n\n function finalizeResponseSpanHook(\n request: any,\n reply: any,\n payload: any,\n hookDone: (err: null, payload: any) => void,\n ) {\n const span = request[kRequestSpan];\n\n if (span != null) {\n if (reply.statusCode >= 500) {\n span.setStatus({ code: SpanStatusCode.ERROR });\n }\n\n span.setAttributes({\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: reply.statusCode,\n });\n span.end();\n }\n\n request[kRequestSpan] = null;\n\n hookDone(null, payload);\n }\n\n function recordErrorInSpanHook(request: any, _reply: any, error: any, hookDone: () => void) {\n const span = request[kRequestSpan];\n\n if (span != null) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n if (instrumentation[kRecordExceptions] !== false) {\n span.recordException(error);\n }\n }\n\n hookDone();\n }\n\n function addHookPatched(this: any, name: string, hook: (...args: any[]) => any) {\n const addHookOriginal = this[kAddHookOriginal];\n\n if (FASTIFY_HOOKS.includes(name)) {\n return addHookOriginal.call(\n this,\n name,\n handlerWrapper(hook, name, {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - ${name}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]: hook.name?.length > 0 ? hook.name : ANONYMOUS_FUNCTION_NAME,\n }),\n );\n } else {\n return addHookOriginal.call(this, name, hook);\n }\n }\n\n function setNotFoundHandlerPatched(this: any, hooks: any, handler?: any) {\n const setNotFoundHandlerOriginal = this[kSetNotFoundOriginal];\n if (typeof hooks === 'function') {\n handler = handlerWrapper(hooks, 'notFoundHandler', {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]: hooks.name?.length > 0 ? hooks.name : ANONYMOUS_FUNCTION_NAME,\n });\n setNotFoundHandlerOriginal.call(this, handler);\n } else {\n if (hooks.preValidation != null) {\n hooks.preValidation = handlerWrapper(hooks.preValidation, 'notFoundHandler - preValidation', {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler - preValidation`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hooks.preValidation.name?.length > 0 ? hooks.preValidation.name : ANONYMOUS_FUNCTION_NAME,\n });\n }\n\n if (hooks.preHandler != null) {\n hooks.preHandler = handlerWrapper(hooks.preHandler, 'notFoundHandler - preHandler', {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler - preHandler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hooks.preHandler.name?.length > 0 ? hooks.preHandler.name : ANONYMOUS_FUNCTION_NAME,\n });\n }\n\n handler = handlerWrapper(handler, 'notFoundHandler', {\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]: handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME,\n });\n setNotFoundHandlerOriginal.call(this, hooks, handler);\n }\n }\n\n function getRequestFromArgs(args: any[]) {\n for (const arg of args) {\n if (arg?.routeOptions && arg.url && arg.method) {\n return arg;\n }\n }\n return null;\n }\n\n function handlerWrapper(\n handler: (...args: any[]) => any,\n hookName: string,\n spanAttributes: Record<string, string> = {},\n ) {\n return function handlerWrapped(this: any, ...args: any[]) {\n const instrumentation: FastifyOtelInstrumentation = this[kInstrumentation];\n\n const request = getRequestFromArgs(args);\n if (request === null) {\n instrumentation._otelLogger.debug(\n `Ignoring route instrumentation because ${hookName} was called without a Fastify request argument`,\n );\n return handler.call(this, ...args);\n }\n\n if (instrumentation.isEnabled() === false || request.routeOptions.config?.otel === false) {\n instrumentation._otelLogger.debug(\n `Ignoring route instrumentation ${request.routeOptions.method} ${request.routeOptions.url} because it is disabled`,\n );\n return handler.call(this, ...args);\n }\n\n const ctx = request[kRequestContext] ?? context.active();\n const handlerName = handler.name?.length > 0 ? handler.name : (this.pluginName ?? ANONYMOUS_FUNCTION_NAME);\n\n const span = instrumentation.tracer.startSpan(\n `${hookName} - ${handlerName}`,\n {\n attributes: spanAttributes,\n },\n ctx,\n );\n\n if (instrumentation._lifecycleHook != null) {\n try {\n instrumentation._lifecycleHook(span, {\n hookName,\n request,\n handler: handlerName,\n });\n } catch (err) {\n instrumentation._otelLogger.error({ err }, 'Execution of lifecycleHook failed');\n }\n }\n\n return context.with(\n trace.setSpan(ctx, span),\n function (this: any) {\n try {\n const res = handler.call(this, ...args);\n\n if (typeof res?.then === 'function') {\n return res.then(\n (result: any) => {\n span.end();\n return result;\n },\n (error: any) => {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n if (instrumentation[kRecordExceptions] !== false) {\n span.recordException(error);\n }\n span.end();\n return Promise.reject(error);\n },\n );\n }\n\n span.end();\n return res;\n } catch (error: any) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n if (instrumentation[kRecordExceptions] !== false) {\n span.recordException(error);\n }\n span.end();\n throw error;\n }\n },\n this,\n );\n };\n }\n }\n }\n}\n"],"names":["SDK_VERSION","InstrumentationBase","diag","propagation","ATTR_HTTP_ROUTE","context","trace","setHttpServerSpanRouteAttribute","ATTR_HTTP_REQUEST_METHOD","ATTR_URL_PATH","ATTR_HTTP_RESPONSE_STATUS_CODE","SpanStatusCode","instrumentation"],"mappings":";;;;;;;;;AAAA,IAAA,EAAA,EAAA,EAAA;AAwBA,MAAM,eAAA,GAAkBA,gBAAA;AACxB,MAAM,YAAA,GAAe,iCAAA;AAErB,MAAM,kBAAA,GAAqB,YAAA;AAC3B,MAAM,aAAA,GAAgB;AAAA,EACpB,WAAA;AAAA,EACA,YAAA;AAAA,EACA,eAAA;AAAA,EACA,YAAA;AAAA,EACA,kBAAA;AAAA,EACA,QAAA;AAAA,EACA,YAAA;A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CAAC,MAAA,KAAgB;AACf,sBAAA,IAAA,CAAK,GAAA,EAAI;AACT,sBAAA,OAAO,MAAA;AAAA,oBACT,CAAA;AAAA,oBACA,CAAC,KAAA,KAAe;AACd,sBAAA,IAAA,CAAK,SAAA,CAAU;AAAA,wBACb,MAAMK,kBAAA,CAAe,KAAA;AAAA,wBACrB,SAAS,KAAA,CAAM;AAAA,uBAChB,CAAA;AACD,sBAAA,IAAIC,gBAAAA,CAAgB,iBAAiB,CAAA,KAAM,KAAA,EAAO;AAChD,wBAAA,IAAA,CAAK,gBAAgB,KAAK,CAAA;AAAA,sBAC5B;AACA,sBAAA,IAAA,CAAK,GAAA,EAAI;AACT,sBAAA,OAAO,OAAA,CAAQ,OAAO,KAAK,CAAA;AAAA,oBAC7B;AAAA,mBACF;AAAA,gBACF;AAEA,gBAAA,IAAA,CAAK,GAAA,EAAI;AACT,gBAAA,OAAO,GAAA;AAAA,cACT,SAAS,KAAA,EAAY;AACnB,gBAAA,IAAA,CAAK,SAAA,CAAU;AAAA,kBACb,MAAMD,kBAAA,CAAe,KAAA;AAAA,kBACrB,SAAS,KAAA,CAAM;AAAA,iBAChB,CAAA;AACD,gBAAA,IAAIC,gBAAAA,CAAgB,iBAAiB,CAAA,KAAM,KAAA,EAAO;AAChD,kBAAA,IAAA,CAAK,gBAAgB,KAAK,CAAA;AAAA,gBAC5B;AACA,gBAAA,IAAA,CAAK,GAAA,EAAI;AACT,gBAAA,MAAM,KAAA;AAAA,cACR;AAAA,YACF,CAAA;AAAA,YACA;AAAA,WACF;AAAA,QACF,CAAA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;;"}
|
|
@@ -7,24 +7,10 @@ const nodeCore = require('@sentry/node-core');
|
|
|
7
7
|
const INTEGRATION_NAME = "GenericPool";
|
|
8
8
|
const instrumentGenericPool = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.GenericPoolInstrumentation({}));
|
|
9
9
|
const _genericPoolIntegration = (() => {
|
|
10
|
-
let instrumentationWrappedCallback;
|
|
11
10
|
return {
|
|
12
11
|
name: INTEGRATION_NAME,
|
|
13
12
|
setupOnce() {
|
|
14
|
-
|
|
15
|
-
instrumentationWrappedCallback = nodeCore.instrumentWhenWrapped(instrumentation);
|
|
16
|
-
},
|
|
17
|
-
setup(client) {
|
|
18
|
-
instrumentationWrappedCallback?.(
|
|
19
|
-
() => client.on("spanStart", (span) => {
|
|
20
|
-
const spanJSON = core.spanToJSON(span);
|
|
21
|
-
const spanDescription = spanJSON.description;
|
|
22
|
-
const isGenericPoolSpan = spanDescription === "generic-pool.acquire";
|
|
23
|
-
if (isGenericPoolSpan) {
|
|
24
|
-
span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, "auto.db.otel.generic_pool");
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
);
|
|
13
|
+
instrumentGenericPool();
|
|
28
14
|
}
|
|
29
15
|
};
|
|
30
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/genericPool/index.ts"],"sourcesContent":["import { GenericPoolInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/genericPool/index.ts"],"sourcesContent":["import { GenericPoolInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'GenericPool';\n\nexport const instrumentGenericPool = generateInstrumentOnce(INTEGRATION_NAME, () => new GenericPoolInstrumentation({}));\n\nconst _genericPoolIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentGenericPool();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [generic-pool](https://www.npmjs.com/package/generic-pool) library.\n *\n * For more information, see the [`genericPoolIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/genericpool/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.genericPoolIntegration()],\n * });\n * ```\n */\nexport const genericPoolIntegration = defineIntegration(_genericPoolIntegration);\n"],"names":["generateInstrumentOnce","GenericPoolInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,aAAA;AAElB,MAAM,qBAAA,GAAwBA,gCAAuB,gBAAA,EAAkB,MAAM,IAAIC,0CAAA,CAA2B,EAAE,CAAC;AAEtH,MAAM,2BAA2B,MAAM;AACrC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,qBAAA,EAAsB;AAAA,IACxB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,sBAAA,GAAyBC,uBAAkB,uBAAuB;;;;;"}
|
|
@@ -67,9 +67,15 @@ class GenericPoolInstrumentation extends instrumentation.InstrumentationBase {
|
|
|
67
67
|
}
|
|
68
68
|
_acquirePatcher(original) {
|
|
69
69
|
return function wrapped_acquire(...args) {
|
|
70
|
-
return core.startSpan(
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
return core.startSpan(
|
|
71
|
+
{
|
|
72
|
+
name: "generic-pool.acquire",
|
|
73
|
+
attributes: { [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.otel.generic_pool" }
|
|
74
|
+
},
|
|
75
|
+
() => {
|
|
76
|
+
return original.call(this, ...args);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
73
79
|
};
|
|
74
80
|
}
|
|
75
81
|
_poolWrapper(original) {
|
|
@@ -87,21 +93,27 @@ class GenericPoolInstrumentation extends instrumentation.InstrumentationBase {
|
|
|
87
93
|
if (isDisabled()) {
|
|
88
94
|
return original.call(this, cb, priority);
|
|
89
95
|
}
|
|
90
|
-
return core.startSpanManual(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
96
|
+
return core.startSpanManual(
|
|
97
|
+
{
|
|
98
|
+
name: "generic-pool.acquire",
|
|
99
|
+
attributes: { [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.otel.generic_pool" }
|
|
100
|
+
},
|
|
101
|
+
(span) => {
|
|
102
|
+
original.call(
|
|
103
|
+
this,
|
|
104
|
+
(err, client) => {
|
|
105
|
+
if (err) {
|
|
106
|
+
span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "internal_error" });
|
|
107
|
+
}
|
|
108
|
+
span.end();
|
|
109
|
+
if (cb) {
|
|
110
|
+
cb(err, client);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
priority
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
);
|
|
105
117
|
};
|
|
106
118
|
}
|
|
107
119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/genericPool/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/genericPool/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-generic-pool\n * - Upstream version: @opentelemetry/instrumentation-generic-pool@0.61.0\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport {\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_ERROR,\n startSpan,\n startSpanManual,\n} from '@sentry/core';\nimport type * as genericPool from './generic-pool-types';\n\nconst MODULE_NAME = 'generic-pool';\nconst PACKAGE_NAME = '@sentry/instrumentation-generic-pool';\n\ntype AcquireFn = (this: unknown, ...args: unknown[]) => unknown;\ninterface PoolConstructor {\n prototype: { acquire: AcquireFn };\n}\ninterface GenericPoolModule {\n Pool: PoolConstructor;\n}\n\nexport class GenericPoolInstrumentation extends InstrumentationBase {\n // only used for v2 - v2.3)\n private _isDisabled = false;\n\n constructor(config: InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n init() {\n return [\n new InstrumentationNodeModuleDefinition(\n MODULE_NAME,\n ['>=3.0.0 <4'],\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n if (isWrapped(Pool.prototype.acquire)) {\n this._unwrap(Pool.prototype, 'acquire');\n }\n this._wrap(Pool.prototype, 'acquire', this._acquirePatcher.bind(this));\n return moduleExports;\n },\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n this._unwrap(Pool.prototype, 'acquire');\n return moduleExports;\n },\n ),\n new InstrumentationNodeModuleDefinition(\n MODULE_NAME,\n ['>=2.4.0 <3'],\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n if (isWrapped(Pool.prototype.acquire)) {\n this._unwrap(Pool.prototype, 'acquire');\n }\n this._wrap(Pool.prototype, 'acquire', this._acquireWithCallbacksPatcher.bind(this));\n return moduleExports;\n },\n (moduleExports: GenericPoolModule) => {\n const Pool = moduleExports.Pool;\n this._unwrap(Pool.prototype, 'acquire');\n return moduleExports;\n },\n ),\n new InstrumentationNodeModuleDefinition(\n MODULE_NAME,\n ['>=2.0.0 <2.4'],\n (moduleExports: GenericPoolModule) => {\n this._isDisabled = false;\n if (isWrapped(moduleExports.Pool)) {\n this._unwrap(moduleExports, 'Pool');\n }\n this._wrap(moduleExports, 'Pool', this._poolWrapper.bind(this));\n return moduleExports;\n },\n (moduleExports: GenericPoolModule) => {\n // since the object is created on the fly every time, we need to use\n // a boolean switch here to disable the instrumentation\n this._isDisabled = true;\n return moduleExports;\n },\n ),\n ];\n }\n\n private _acquirePatcher(original: AcquireFn) {\n return function wrapped_acquire(this: genericPool.Pool<unknown>, ...args: unknown[]) {\n return startSpan(\n {\n name: 'generic-pool.acquire',\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.otel.generic_pool' },\n },\n () => {\n return original.call(this, ...args) as PromiseLike<unknown>;\n },\n );\n };\n }\n\n private _poolWrapper(original: (this: unknown, ...args: unknown[]) => { acquire: AcquireFn }) {\n const wrap = this._wrap.bind(this);\n const acquireWithCallbacksPatcher = this._acquireWithCallbacksPatcher.bind(this);\n return function wrapped_pool(this: unknown, ...args: unknown[]) {\n const pool = original.apply(this, args);\n wrap(pool, 'acquire', acquireWithCallbacksPatcher);\n return pool;\n };\n }\n\n private _acquireWithCallbacksPatcher(original: AcquireFn) {\n const isDisabled = (): boolean => this._isDisabled;\n return function wrapped_acquire(\n this: genericPool.Pool<unknown>,\n cb: (err: unknown, client: unknown) => unknown,\n priority: number,\n ) {\n // only used for v2 - v2.3\n if (isDisabled()) {\n return original.call(this, cb, priority);\n }\n\n return startSpanManual(\n {\n name: 'generic-pool.acquire',\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.otel.generic_pool' },\n },\n span => {\n original.call(\n this,\n (err: unknown, client: unknown) => {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n }\n span.end();\n // Not checking whether cb is a function because\n // the original code doesn't do that either.\n // The callback's return value is unused by generic-pool, so we don't return it.\n if (cb) {\n cb(err, client);\n }\n },\n priority,\n );\n },\n );\n };\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","isWrapped","startSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","startSpanManual","SPAN_STATUS_ERROR"],"mappings":";;;;;AAqBA,MAAM,WAAA,GAAc,cAAA;AACpB,MAAM,YAAA,GAAe,sCAAA;AAUd,MAAM,mCAAmCA,mCAAA,CAAoB;AAAA,EAIlE,WAAA,CAAY,MAAA,GAAgC,EAAC,EAAG;AAC9C,IAAA,KAAA,CAAM,YAAA,EAAcC,kBAAa,MAAM,CAAA;AAHzC;AAAA,IAAA,IAAA,CAAQ,WAAA,GAAc,KAAA;AAAA,EAItB;AAAA,EAEA,IAAA,GAAO;AACL,IAAA,OAAO;AAAA,MACL,IAAIC,mDAAA;AAAA,QACF,WAAA;AAAA,QACA,CAAC,YAAY,CAAA;AAAA,QACb,CAAC,aAAA,KAAqC;AACpC,UAAA,MAAM,OAAO,aAAA,CAAc,IAAA;AAC3B,UAAA,IAAIC,yBAAA,CAAU,IAAA,CAAK,SAAA,CAAU,OAAO,CAAA,EAAG;AACrC,YAAA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,SAAA,EAAW,SAAS,CAAA;AAAA,UACxC;AACA,UAAA,IAAA,CAAK,KAAA,CAAM,KAAK,SAAA,EAAW,SAAA,EAAW,KAAK,eAAA,CAAgB,IAAA,CAAK,IAAI,CAAC,CAAA;AACrE,UAAA,OAAO,aAAA;AAAA,QACT,CAAA;AAAA,QACA,CAAC,aAAA,KAAqC;AACpC,UAAA,MAAM,OAAO,aAAA,CAAc,IAAA;AAC3B,UAAA,IAAA,CAAK,OAAA,CAAQ,IAAA,CAAK,SAAA,EAAW,SAAS,CAAA;AACtC,UAAA,OAAO,aAAA;AAAA,QACT;AAAA,OACF;AAAA,MACA,IAAID,mDAAA;AAAA,QACF,WAAA;AAAA,QACA,CAAC,YAAY,CAAA;AAAA,QACb,CAAC,aAAA,KAAqC;AACpC,UAAA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AAA,EAAME,sBAAA,EAAmB,OAAA,EAAS,kBAAkB,CAAA;AAAA,cACvE;AACA,cAAA,IAAA,CAAK,GAAA,EAAI;AAIT,cAAA,IAAI,EAAA,EAAI;AACN,gBAAA,EAAA,CAAG,KAAK,MAAM,CAAA;AAAA,cAChB;AAAA,YACF,CAAA;AAAA,YACA;AAAA,WACF;AAAA,QACF;AAAA,OACF;AAAA,IACF,CAAA;AAAA,EACF;AACF;;;;"}
|
|
@@ -1,53 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
const api = require('@opentelemetry/api');
|
|
4
3
|
const instrumentation = require('./vendored/instrumentation.js');
|
|
5
4
|
const core = require('@sentry/core');
|
|
6
5
|
const nodeCore = require('@sentry/node-core');
|
|
7
|
-
const opentelemetry = require('@sentry/opentelemetry');
|
|
8
6
|
|
|
9
7
|
const INTEGRATION_NAME = "Graphql";
|
|
10
8
|
const instrumentGraphql = nodeCore.generateInstrumentOnce(
|
|
11
9
|
INTEGRATION_NAME,
|
|
12
10
|
instrumentation.GraphQLInstrumentation,
|
|
13
|
-
(_options) =>
|
|
14
|
-
const options = getOptionsWithDefaults(_options);
|
|
15
|
-
return {
|
|
16
|
-
...options,
|
|
17
|
-
responseHook(span, result) {
|
|
18
|
-
nodeCore.addOriginToSpan(span, "auto.graphql.otel.graphql");
|
|
19
|
-
const resultWithMaybeError = result;
|
|
20
|
-
if (resultWithMaybeError.errors?.length && !core.spanToJSON(span).status) {
|
|
21
|
-
span.setStatus({ code: api.SpanStatusCode.ERROR });
|
|
22
|
-
}
|
|
23
|
-
const attributes = core.spanToJSON(span).data;
|
|
24
|
-
const operationType = attributes["graphql.operation.type"];
|
|
25
|
-
const operationName = attributes["graphql.operation.name"];
|
|
26
|
-
if (options.useOperationNameForRootSpan && operationType) {
|
|
27
|
-
const rootSpan = core.getRootSpan(span);
|
|
28
|
-
const rootSpanAttributes = core.spanToJSON(rootSpan).data;
|
|
29
|
-
const existingOperations = rootSpanAttributes[opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION] || [];
|
|
30
|
-
const newOperation = operationName ? `${operationType} ${operationName}` : `${operationType}`;
|
|
31
|
-
if (Array.isArray(existingOperations)) {
|
|
32
|
-
existingOperations.push(newOperation);
|
|
33
|
-
rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, existingOperations);
|
|
34
|
-
} else if (typeof existingOperations === "string") {
|
|
35
|
-
rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, [existingOperations, newOperation]);
|
|
36
|
-
} else {
|
|
37
|
-
rootSpan.setAttribute(opentelemetry.SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION, newOperation);
|
|
38
|
-
}
|
|
39
|
-
if (!core.spanToJSON(rootSpan).data["original-description"]) {
|
|
40
|
-
rootSpan.setAttribute("original-description", core.spanToJSON(rootSpan).description);
|
|
41
|
-
}
|
|
42
|
-
rootSpan.updateName(
|
|
43
|
-
`${core.spanToJSON(rootSpan).data["original-description"]} (${getGraphqlOperationNamesFromAttribute(
|
|
44
|
-
existingOperations
|
|
45
|
-
)})`
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
11
|
+
(_options) => getOptionsWithDefaults(_options)
|
|
51
12
|
);
|
|
52
13
|
const _graphqlIntegration = ((options = {}) => {
|
|
53
14
|
return {
|
|
@@ -66,17 +27,6 @@ function getOptionsWithDefaults(options) {
|
|
|
66
27
|
...options
|
|
67
28
|
};
|
|
68
29
|
}
|
|
69
|
-
function getGraphqlOperationNamesFromAttribute(attr) {
|
|
70
|
-
if (Array.isArray(attr)) {
|
|
71
|
-
const sorted = attr.slice().sort();
|
|
72
|
-
if (sorted.length <= 5) {
|
|
73
|
-
return sorted.join(", ");
|
|
74
|
-
} else {
|
|
75
|
-
return `${sorted.slice(0, 5).join(", ")}, +${sorted.length - 5}`;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return `${attr}`;
|
|
79
|
-
}
|
|
80
30
|
|
|
81
31
|
exports.graphqlIntegration = graphqlIntegration;
|
|
82
32
|
exports.instrumentGraphql = instrumentGraphql;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/graphql/index.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/graphql/index.ts"],"sourcesContent":["import { GraphQLInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\ninterface GraphqlOptions {\n /**\n * Do not create spans for resolvers.\n *\n * Defaults to true.\n */\n ignoreResolveSpans?: boolean;\n\n /**\n * Don't create spans for the execution of the default resolver on object properties.\n *\n * When a resolver function is not defined on the schema for a field, graphql will\n * use the default resolver which just looks for a property with that name on the object.\n * If the property is not a function, it's not very interesting to trace.\n * This option can reduce noise and number of spans created.\n *\n * Defaults to true.\n */\n ignoreTrivialResolveSpans?: boolean;\n\n /**\n * If this is enabled, a http.server root span containing this span will automatically be renamed to include the operation name.\n * Set this to `false` if you do not want this behavior, and want to keep the default http.server span name.\n *\n * Defaults to true.\n */\n useOperationNameForRootSpan?: boolean;\n}\n\nconst INTEGRATION_NAME = 'Graphql';\n\nexport const instrumentGraphql = generateInstrumentOnce(\n INTEGRATION_NAME,\n GraphQLInstrumentation,\n (_options: GraphqlOptions) => getOptionsWithDefaults(_options),\n);\n\nconst _graphqlIntegration = ((options: GraphqlOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // We set defaults here, too, because otherwise we'd update the instrumentation config\n // to the config without defaults, as `generateInstrumentOnce` automatically calls `setConfig(options)`\n // when being called the second time\n instrumentGraphql(getOptionsWithDefaults(options));\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [graphql](https://www.npmjs.com/package/graphql) library.\n *\n * For more information, see the [`graphqlIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/graphql/).\n *\n * @param {GraphqlOptions} options Configuration options for the GraphQL integration.\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.graphqlIntegration()],\n * });\n */\nexport const graphqlIntegration = defineIntegration(_graphqlIntegration);\n\nfunction getOptionsWithDefaults(options?: GraphqlOptions): GraphqlOptions {\n return {\n ignoreResolveSpans: true,\n ignoreTrivialResolveSpans: true,\n useOperationNameForRootSpan: true,\n ...options,\n };\n}\n"],"names":["generateInstrumentOnce","GraphQLInstrumentation","defineIntegration"],"mappings":";;;;;;AAkCA,MAAM,gBAAA,GAAmB,SAAA;AAElB,MAAM,iBAAA,GAAoBA,+BAAA;AAAA,EAC/B,gBAAA;AAAA,EACAC,sCAAA;AAAA,EACA,CAAC,QAAA,KAA6B,sBAAA,CAAuB,QAAQ;AAC/D;AAEA,MAAM,mBAAA,IAAuB,CAAC,OAAA,GAA0B,EAAC,KAAM;AAC7D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AAIV,MAAA,iBAAA,CAAkB,sBAAA,CAAuB,OAAO,CAAC,CAAA;AAAA,IACnD;AAAA,GACF;AACF,CAAA,CAAA;AAiBO,MAAM,kBAAA,GAAqBC,uBAAkB,mBAAmB;AAEvE,SAAS,uBAAuB,OAAA,EAA0C;AACxE,EAAA,OAAO;AAAA,IACL,kBAAA,EAAoB,IAAA;AAAA,IACpB,yBAAA,EAA2B,IAAA;AAAA,IAC3B,2BAAA,EAA6B,IAAA;AAAA,IAC7B,GAAG;AAAA,GACL;AACF;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum.js","sources":["../../../../../../src/integrations/tracing/graphql/vendored/enum.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n
|
|
1
|
+
{"version":3,"file":"enum.js","sources":["../../../../../../src/integrations/tracing/graphql/vendored/enum.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-graphql\n * - Upstream version: @opentelemetry/instrumentation-graphql@0.66.0\n */\n\nexport enum AllowedOperationTypes {\n QUERY = 'query',\n MUTATION = 'mutation',\n SUBSCRIPTION = 'subscription',\n}\n\nexport enum TokenKind {\n SOF = '<SOF>',\n EOF = '<EOF>',\n BANG = '!',\n DOLLAR = '$',\n AMP = '&',\n PAREN_L = '(',\n PAREN_R = ')',\n SPREAD = '...',\n COLON = ':',\n EQUALS = '=',\n AT = '@',\n BRACKET_L = '[',\n BRACKET_R = ']',\n BRACE_L = '{',\n PIPE = '|',\n BRACE_R = '}',\n NAME = 'Name',\n INT = 'Int',\n FLOAT = 'Float',\n STRING = 'String',\n BLOCK_STRING = 'BlockString',\n COMMENT = 'Comment',\n}\n\nexport enum SpanNames {\n EXECUTE = 'graphql.execute',\n PARSE = 'graphql.parse',\n RESOLVE = 'graphql.resolve',\n VALIDATE = 'graphql.validate',\n SCHEMA_VALIDATE = 'graphql.validateSchema',\n SCHEMA_PARSE = 'graphql.parseSchema',\n}\n"],"names":["AllowedOperationTypes","TokenKind","SpanNames"],"mappings":";;AASO,IAAK,qBAAA,qBAAAA,sBAAAA,KAAL;AACL,EAAAA,uBAAA,OAAA,CAAA,GAAQ,OAAA;AACR,EAAAA,uBAAA,UAAA,CAAA,GAAW,UAAA;AACX,EAAAA,uBAAA,cAAA,CAAA,GAAe,cAAA;AAHL,EAAA,OAAAA,sBAAAA;AAAA,CAAA,EAAA,qBAAA,IAAA,EAAA;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A,GAAW,kBAAA;AACX,EAAAA,WAAA,iBAAA,CAAA,GAAkB,wBAAA;AAClB,EAAAA,WAAA,cAAA,CAAA,GAAe,qBAAA;AANL,EAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA;;;;;;"}
|
|
@@ -8,8 +8,6 @@ var AttributeNames = /* @__PURE__ */ ((AttributeNames2) => {
|
|
|
8
8
|
AttributeNames2["PARENT_NAME"] = "graphql.parent.name";
|
|
9
9
|
AttributeNames2["OPERATION_TYPE"] = "graphql.operation.type";
|
|
10
10
|
AttributeNames2["OPERATION_NAME"] = "graphql.operation.name";
|
|
11
|
-
AttributeNames2["VARIABLES"] = "graphql.variables.";
|
|
12
|
-
AttributeNames2["ERROR_VALIDATION_NAME"] = "graphql.validation.error";
|
|
13
11
|
return AttributeNames2;
|
|
14
12
|
})(AttributeNames || {});
|
|
15
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttributeNames.js","sources":["../../../../../../../src/integrations/tracing/graphql/vendored/enums/AttributeNames.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n
|
|
1
|
+
{"version":3,"file":"AttributeNames.js","sources":["../../../../../../../src/integrations/tracing/graphql/vendored/enums/AttributeNames.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-graphql\n * - Upstream version: @opentelemetry/instrumentation-graphql@0.66.0\n */\n\nexport enum AttributeNames {\n SOURCE = 'graphql.source',\n FIELD_NAME = 'graphql.field.name',\n FIELD_PATH = 'graphql.field.path',\n FIELD_TYPE = 'graphql.field.type',\n PARENT_NAME = 'graphql.parent.name',\n OPERATION_TYPE = 'graphql.operation.type',\n OPERATION_NAME = 'graphql.operation.name',\n}\n"],"names":["AttributeNames"],"mappings":";;AASO,IAAK,cAAA,qBAAAA,eAAAA,KAAL;AACL,EAAAA,gBAAA,QAAA,CAAA,GAAS,gBAAA;AACT,EAAAA,gBAAA,YAAA,CAAA,GAAa,oBAAA;AACb,EAAAA,gBAAA,YAAA,CAAA,GAAa,oBAAA;AACb,EAAAA,gBAAA,YAAA,CAAA,GAAa,oBAAA;AACb,EAAAA,gBAAA,aAAA,CAAA,GAAc,qBAAA;AACd,EAAAA,gBAAA,gBAAA,CAAA,GAAiB,wBAAA;AACjB,EAAAA,gBAAA,gBAAA,CAAA,GAAiB,wBAAA;AAPP,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;;;;"}
|