@sentry/node 10.58.0 → 10.60.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 +3 -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/index.js +7 -8
- package/build/cjs/integrations/node-fetch/index.js.map +1 -1
- package/build/cjs/integrations/node-fetch/vendored/semconv.js +28 -0
- package/build/cjs/integrations/node-fetch/vendored/semconv.js.map +1 -0
- package/build/cjs/integrations/node-fetch/vendored/undici.js +91 -127
- 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/index.js +1 -11
- package/build/cjs/integrations/tracing/kafka/index.js.map +1 -1
- package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +45 -247
- package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +4 -8
- package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
- package/build/cjs/integrations/tracing/kafka/vendored/utils.js +113 -0
- package/build/cjs/integrations/tracing/kafka/vendored/utils.js.map +1 -0
- 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/cjs/sdk/initOtel.js +2 -1
- package/build/cjs/sdk/initOtel.js.map +1 -1
- package/build/esm/index.js +2 -1
- 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/index.js +8 -9
- package/build/esm/integrations/node-fetch/index.js.map +1 -1
- package/build/esm/integrations/node-fetch/vendored/semconv.js +15 -0
- package/build/esm/integrations/node-fetch/vendored/semconv.js.map +1 -0
- package/build/esm/integrations/node-fetch/vendored/undici.js +80 -116
- 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/index.js +2 -12
- package/build/esm/integrations/tracing/kafka/index.js.map +1 -1
- package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +47 -249
- package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/kafka/vendored/semconv.js +3 -5
- package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
- package/build/esm/integrations/tracing/kafka/vendored/utils.js +107 -0
- package/build/esm/integrations/tracing/kafka/vendored/utils.js.map +1 -0
- 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/esm/sdk/initOtel.js +2 -1
- package/build/esm/sdk/initOtel.js.map +1 -1
- package/build/import-hook.mjs +6 -0
- package/build/types/index.d.ts +2 -1
- 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/index.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/semconv.d.ts +13 -0
- package/build/types/integrations/node-fetch/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/node-fetch/vendored/types.d.ts +2 -4
- package/build/types/integrations/node-fetch/vendored/types.d.ts.map +1 -1
- package/build/types/integrations/node-fetch/vendored/undici.d.ts +6 -7
- 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/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +3 -13
- package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -1
- package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -32
- package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +1 -1
- package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +9 -28
- package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -1
- package/build/types/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
- package/build/types/integrations/tracing/kafka/vendored/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing/knex/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/sdk/initOtel.d.ts.map +1 -1
- package/build/types-ts3.8/index.d.ts +2 -1
- 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/node-fetch/vendored/semconv.d.ts +13 -0
- package/build/types-ts3.8/integrations/node-fetch/vendored/types.d.ts +2 -4
- package/build/types-ts3.8/integrations/node-fetch/vendored/undici.d.ts +6 -7
- 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/kafka/vendored/instrumentation.d.ts +3 -13
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -32
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +9 -28
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
- 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 -7
- package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js +0 -6
- package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js.map +0 -1
- package/build/cjs/integrations/tracing/kafka/vendored/propagator.js +0 -22
- package/build/cjs/integrations/tracing/kafka/vendored/propagator.js.map +0 -1
- 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/kafka/vendored/internal-types.js +0 -4
- package/build/esm/integrations/tracing/kafka/vendored/internal-types.js.map +0 -1
- package/build/esm/integrations/tracing/kafka/vendored/propagator.js +0 -20
- package/build/esm/integrations/tracing/kafka/vendored/propagator.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/kafka/vendored/internal-types.d.ts +0 -9
- package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts.map +0 -1
- package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts +0 -3
- package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts.map +0 -1
- package/build/types/integrations/tracing/kafka/vendored/types.d.ts +0 -26
- package/build/types/integrations/tracing/kafka/vendored/types.d.ts.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/integrations/tracing/utils/sql-common.d.ts +0 -3
- package/build/types/integrations/tracing/utils/sql-common.d.ts.map +0 -1
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/internal-types.d.ts +0 -9
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/propagator.d.ts +0 -3
- package/build/types-ts3.8/integrations/tracing/kafka/vendored/types.d.ts +0 -26
- 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
- package/build/types-ts3.8/integrations/tracing/utils/sql-common.d.ts +0 -3
|
@@ -1,48 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { InstrumentationBase, semconvStabilityFromStr, InstrumentationNodeModuleDefinition, isWrapped, SemconvStability, safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';
|
|
3
|
-
import { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile.js';
|
|
4
|
-
import { ATTR_DB_SYSTEM_NAME, ATTR_DB_NAMESPACE, ATTR_DB_OPERATION_NAME, ATTR_DB_COLLECTION_NAME, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_DB_QUERY_TEXT } from '@opentelemetry/semantic-conventions';
|
|
5
|
-
import { METRIC_DB_CLIENT_CONNECTIONS_USAGE, DB_SYSTEM_VALUE_MONGODB, ATTR_DB_SYSTEM, ATTR_DB_NAME, ATTR_DB_MONGODB_COLLECTION, ATTR_DB_OPERATION, ATTR_DB_CONNECTION_STRING, DB_SYSTEM_NAME_VALUE_MONGODB, ATTR_NET_PEER_NAME, ATTR_NET_PEER_PORT, ATTR_DB_STATEMENT } from './semconv.js';
|
|
6
|
-
import { MongodbCommandType } from './internal-types.js';
|
|
1
|
+
import { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';
|
|
7
2
|
import { SDK_VERSION } from '@sentry/core';
|
|
3
|
+
import { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile.js';
|
|
4
|
+
import { getV3PatchOperation, getV3PatchCommand, getV3PatchFind, getV3PatchCursor, getV4ConnectionPoolCheckOut, getV4PatchCommandPromise, getV4PatchCommandCallback } from './patches.js';
|
|
8
5
|
|
|
9
6
|
const PACKAGE_NAME = "@sentry/instrumentation-mongodb";
|
|
10
|
-
const DEFAULT_CONFIG = {
|
|
11
|
-
requireParentSpan: true
|
|
12
|
-
};
|
|
13
7
|
class MongoDBInstrumentation extends InstrumentationBase {
|
|
14
8
|
constructor(config = {}) {
|
|
15
|
-
super(PACKAGE_NAME, SDK_VERSION,
|
|
16
|
-
this._setSemconvStabilityFromEnv();
|
|
17
|
-
}
|
|
18
|
-
// Used for testing.
|
|
19
|
-
_setSemconvStabilityFromEnv() {
|
|
20
|
-
this._netSemconvStability = semconvStabilityFromStr("http", process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
|
|
21
|
-
this._dbSemconvStability = semconvStabilityFromStr("database", process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
|
|
22
|
-
}
|
|
23
|
-
setConfig(config = {}) {
|
|
24
|
-
super.setConfig({ ...DEFAULT_CONFIG, ...config });
|
|
25
|
-
}
|
|
26
|
-
_updateMetricInstruments() {
|
|
27
|
-
this._connectionsUsage = this.meter.createUpDownCounter(METRIC_DB_CLIENT_CONNECTIONS_USAGE, {
|
|
28
|
-
description: "The number of connections that are currently in state described by the state attribute.",
|
|
29
|
-
unit: "{connection}"
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Convenience function for updating the `db.client.connections.usage` metric.
|
|
34
|
-
* The name "count" comes from the eventual replacement for this metric per
|
|
35
|
-
* https://opentelemetry.io/docs/specs/semconv/non-normative/db-migration/#database-client-connection-count
|
|
36
|
-
*/
|
|
37
|
-
_connCountAdd(n, poolName, state) {
|
|
38
|
-
this._connectionsUsage?.add(n, { "pool.name": poolName, state });
|
|
9
|
+
super(PACKAGE_NAME, SDK_VERSION, config);
|
|
39
10
|
}
|
|
40
11
|
init() {
|
|
41
12
|
const { v3PatchConnection, v3UnpatchConnection } = this._getV3ConnectionPatches();
|
|
42
|
-
const { v4PatchConnect, v4UnpatchConnect } = this._getV4ConnectPatches();
|
|
43
13
|
const { v4PatchConnectionCallback, v4PatchConnectionPromise, v4UnpatchConnection } = this._getV4ConnectionPatches();
|
|
44
14
|
const { v4PatchConnectionPool, v4UnpatchConnectionPool } = this._getV4ConnectionPoolPatches();
|
|
45
|
-
const { v4PatchSessions, v4UnpatchSessions } = this._getV4SessionsPatches();
|
|
46
15
|
return [
|
|
47
16
|
new InstrumentationNodeModuleDefinition("mongodb", [">=3.3.0 <4"], void 0, void 0, [
|
|
48
17
|
new InstrumentationNodeModuleFile(
|
|
@@ -70,18 +39,6 @@ class MongoDBInstrumentation extends InstrumentationBase {
|
|
|
70
39
|
[">=4.0.0 <6.4"],
|
|
71
40
|
v4PatchConnectionPool,
|
|
72
41
|
v4UnpatchConnectionPool
|
|
73
|
-
),
|
|
74
|
-
new InstrumentationNodeModuleFile(
|
|
75
|
-
"mongodb/lib/cmap/connect.js",
|
|
76
|
-
[">=4.0.0 <8"],
|
|
77
|
-
v4PatchConnect,
|
|
78
|
-
v4UnpatchConnect
|
|
79
|
-
),
|
|
80
|
-
new InstrumentationNodeModuleFile(
|
|
81
|
-
"mongodb/lib/sessions.js",
|
|
82
|
-
[">=4.0.0 <8"],
|
|
83
|
-
v4PatchSessions,
|
|
84
|
-
v4UnpatchSessions
|
|
85
42
|
)
|
|
86
43
|
])
|
|
87
44
|
];
|
|
@@ -92,27 +49,27 @@ class MongoDBInstrumentation extends InstrumentationBase {
|
|
|
92
49
|
if (isWrapped(moduleExports.insert)) {
|
|
93
50
|
this._unwrap(moduleExports, "insert");
|
|
94
51
|
}
|
|
95
|
-
this._wrap(moduleExports, "insert",
|
|
52
|
+
this._wrap(moduleExports, "insert", getV3PatchOperation("insert"));
|
|
96
53
|
if (isWrapped(moduleExports.remove)) {
|
|
97
54
|
this._unwrap(moduleExports, "remove");
|
|
98
55
|
}
|
|
99
|
-
this._wrap(moduleExports, "remove",
|
|
56
|
+
this._wrap(moduleExports, "remove", getV3PatchOperation("remove"));
|
|
100
57
|
if (isWrapped(moduleExports.update)) {
|
|
101
58
|
this._unwrap(moduleExports, "update");
|
|
102
59
|
}
|
|
103
|
-
this._wrap(moduleExports, "update",
|
|
60
|
+
this._wrap(moduleExports, "update", getV3PatchOperation("update"));
|
|
104
61
|
if (isWrapped(moduleExports.command)) {
|
|
105
62
|
this._unwrap(moduleExports, "command");
|
|
106
63
|
}
|
|
107
|
-
this._wrap(moduleExports, "command",
|
|
64
|
+
this._wrap(moduleExports, "command", getV3PatchCommand());
|
|
108
65
|
if (isWrapped(moduleExports.query)) {
|
|
109
66
|
this._unwrap(moduleExports, "query");
|
|
110
67
|
}
|
|
111
|
-
this._wrap(moduleExports, "query",
|
|
68
|
+
this._wrap(moduleExports, "query", getV3PatchFind());
|
|
112
69
|
if (isWrapped(moduleExports.getMore)) {
|
|
113
70
|
this._unwrap(moduleExports, "getMore");
|
|
114
71
|
}
|
|
115
|
-
this._wrap(moduleExports, "getMore",
|
|
72
|
+
this._wrap(moduleExports, "getMore", getV3PatchCursor());
|
|
116
73
|
return moduleExports;
|
|
117
74
|
},
|
|
118
75
|
v3UnpatchConnection: (moduleExports) => {
|
|
@@ -126,58 +83,6 @@ class MongoDBInstrumentation extends InstrumentationBase {
|
|
|
126
83
|
}
|
|
127
84
|
};
|
|
128
85
|
}
|
|
129
|
-
_getV4SessionsPatches() {
|
|
130
|
-
return {
|
|
131
|
-
v4PatchSessions: (moduleExports) => {
|
|
132
|
-
if (isWrapped(moduleExports.acquire)) {
|
|
133
|
-
this._unwrap(moduleExports, "acquire");
|
|
134
|
-
}
|
|
135
|
-
this._wrap(moduleExports.ServerSessionPool.prototype, "acquire", this._getV4AcquireCommand());
|
|
136
|
-
if (isWrapped(moduleExports.release)) {
|
|
137
|
-
this._unwrap(moduleExports, "release");
|
|
138
|
-
}
|
|
139
|
-
this._wrap(moduleExports.ServerSessionPool.prototype, "release", this._getV4ReleaseCommand());
|
|
140
|
-
return moduleExports;
|
|
141
|
-
},
|
|
142
|
-
v4UnpatchSessions: (moduleExports) => {
|
|
143
|
-
if (moduleExports === void 0) return;
|
|
144
|
-
if (isWrapped(moduleExports.acquire)) {
|
|
145
|
-
this._unwrap(moduleExports, "acquire");
|
|
146
|
-
}
|
|
147
|
-
if (isWrapped(moduleExports.release)) {
|
|
148
|
-
this._unwrap(moduleExports, "release");
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
_getV4AcquireCommand() {
|
|
154
|
-
const instrumentation = this;
|
|
155
|
-
return (original) => {
|
|
156
|
-
return function patchAcquire() {
|
|
157
|
-
const nSessionsBeforeAcquire = this.sessions.length;
|
|
158
|
-
const session = original.call(this);
|
|
159
|
-
const nSessionsAfterAcquire = this.sessions.length;
|
|
160
|
-
if (nSessionsBeforeAcquire === nSessionsAfterAcquire) {
|
|
161
|
-
instrumentation._connCountAdd(1, instrumentation._poolName, "used");
|
|
162
|
-
} else if (nSessionsBeforeAcquire - 1 === nSessionsAfterAcquire) {
|
|
163
|
-
instrumentation._connCountAdd(-1, instrumentation._poolName, "idle");
|
|
164
|
-
instrumentation._connCountAdd(1, instrumentation._poolName, "used");
|
|
165
|
-
}
|
|
166
|
-
return session;
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
_getV4ReleaseCommand() {
|
|
171
|
-
const instrumentation = this;
|
|
172
|
-
return (original) => {
|
|
173
|
-
return function patchRelease(session) {
|
|
174
|
-
const cmdPromise = original.call(this, session);
|
|
175
|
-
instrumentation._connCountAdd(-1, instrumentation._poolName, "used");
|
|
176
|
-
instrumentation._connCountAdd(1, instrumentation._poolName, "idle");
|
|
177
|
-
return cmdPromise;
|
|
178
|
-
};
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
86
|
_getV4ConnectionPoolPatches() {
|
|
182
87
|
return {
|
|
183
88
|
v4PatchConnectionPool: (moduleExports) => {
|
|
@@ -185,7 +90,7 @@ class MongoDBInstrumentation extends InstrumentationBase {
|
|
|
185
90
|
if (isWrapped(poolPrototype.checkOut)) {
|
|
186
91
|
this._unwrap(poolPrototype, "checkOut");
|
|
187
92
|
}
|
|
188
|
-
this._wrap(poolPrototype, "checkOut",
|
|
93
|
+
this._wrap(poolPrototype, "checkOut", getV4ConnectionPoolCheckOut());
|
|
189
94
|
return moduleExports;
|
|
190
95
|
},
|
|
191
96
|
v4UnpatchConnectionPool: (moduleExports) => {
|
|
@@ -194,73 +99,20 @@ class MongoDBInstrumentation extends InstrumentationBase {
|
|
|
194
99
|
}
|
|
195
100
|
};
|
|
196
101
|
}
|
|
197
|
-
_getV4ConnectPatches() {
|
|
198
|
-
return {
|
|
199
|
-
v4PatchConnect: (moduleExports) => {
|
|
200
|
-
if (isWrapped(moduleExports.connect)) {
|
|
201
|
-
this._unwrap(moduleExports, "connect");
|
|
202
|
-
}
|
|
203
|
-
this._wrap(moduleExports, "connect", this._getV4ConnectCommand());
|
|
204
|
-
return moduleExports;
|
|
205
|
-
},
|
|
206
|
-
v4UnpatchConnect: (moduleExports) => {
|
|
207
|
-
if (moduleExports === void 0) return;
|
|
208
|
-
this._unwrap(moduleExports, "connect");
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
// This patch will become unnecessary once
|
|
213
|
-
// https://jira.mongodb.org/browse/NODE-5639 is done.
|
|
214
|
-
_getV4ConnectionPoolCheckOut() {
|
|
215
|
-
return (original) => {
|
|
216
|
-
return function patchedCheckout(callback) {
|
|
217
|
-
const patchedCallback = context.bind(context.active(), callback);
|
|
218
|
-
return original.call(this, patchedCallback);
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
_getV4ConnectCommand() {
|
|
223
|
-
const instrumentation = this;
|
|
224
|
-
return (original) => {
|
|
225
|
-
return function patchedConnect(options, callback) {
|
|
226
|
-
if (original.length === 1) {
|
|
227
|
-
const result = original.call(this, options);
|
|
228
|
-
if (result && typeof result.then === "function") {
|
|
229
|
-
result.then(
|
|
230
|
-
() => instrumentation.setPoolName(options),
|
|
231
|
-
// this handler is set to pass the lint rules
|
|
232
|
-
() => void 0
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
return result;
|
|
236
|
-
}
|
|
237
|
-
const patchedCallback = function(err, conn) {
|
|
238
|
-
if (err || !conn) {
|
|
239
|
-
callback(err, conn);
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
instrumentation.setPoolName(options);
|
|
243
|
-
callback(err, conn);
|
|
244
|
-
};
|
|
245
|
-
return original.call(this, options, patchedCallback);
|
|
246
|
-
};
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
250
102
|
_getV4ConnectionPatches() {
|
|
251
103
|
return {
|
|
252
104
|
v4PatchConnectionCallback: (moduleExports) => {
|
|
253
105
|
if (isWrapped(moduleExports.Connection.prototype.command)) {
|
|
254
106
|
this._unwrap(moduleExports.Connection.prototype, "command");
|
|
255
107
|
}
|
|
256
|
-
this._wrap(moduleExports.Connection.prototype, "command",
|
|
108
|
+
this._wrap(moduleExports.Connection.prototype, "command", getV4PatchCommandCallback());
|
|
257
109
|
return moduleExports;
|
|
258
110
|
},
|
|
259
111
|
v4PatchConnectionPromise: (moduleExports) => {
|
|
260
112
|
if (isWrapped(moduleExports.Connection.prototype.command)) {
|
|
261
113
|
this._unwrap(moduleExports.Connection.prototype, "command");
|
|
262
114
|
}
|
|
263
|
-
this._wrap(moduleExports.Connection.prototype, "command",
|
|
115
|
+
this._wrap(moduleExports.Connection.prototype, "command", getV4PatchCommandPromise());
|
|
264
116
|
return moduleExports;
|
|
265
117
|
},
|
|
266
118
|
v4UnpatchConnection: (moduleExports) => {
|
|
@@ -269,408 +121,6 @@ class MongoDBInstrumentation extends InstrumentationBase {
|
|
|
269
121
|
}
|
|
270
122
|
};
|
|
271
123
|
}
|
|
272
|
-
/** Creates spans for common operations */
|
|
273
|
-
_getV3PatchOperation(operationName) {
|
|
274
|
-
const instrumentation = this;
|
|
275
|
-
return (original) => {
|
|
276
|
-
return function patchedServerCommand(server, ns, ops, options, callback) {
|
|
277
|
-
const currentSpan = trace.getSpan(context.active());
|
|
278
|
-
const skipInstrumentation = instrumentation._checkSkipInstrumentation(currentSpan);
|
|
279
|
-
const resultHandler = typeof options === "function" ? options : callback;
|
|
280
|
-
if (skipInstrumentation || typeof resultHandler !== "function" || typeof ops !== "object") {
|
|
281
|
-
if (typeof options === "function") {
|
|
282
|
-
return original.call(this, server, ns, ops, options);
|
|
283
|
-
} else {
|
|
284
|
-
return original.call(this, server, ns, ops, options, callback);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
const attributes = instrumentation._getV3SpanAttributes(
|
|
288
|
-
ns,
|
|
289
|
-
server,
|
|
290
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
291
|
-
ops[0],
|
|
292
|
-
operationName
|
|
293
|
-
);
|
|
294
|
-
const spanName = instrumentation._spanNameFromAttrs(attributes);
|
|
295
|
-
const span = instrumentation.tracer.startSpan(spanName, {
|
|
296
|
-
kind: SpanKind.CLIENT,
|
|
297
|
-
attributes
|
|
298
|
-
});
|
|
299
|
-
const patchedCallback = instrumentation._patchEnd(span, resultHandler);
|
|
300
|
-
if (typeof options === "function") {
|
|
301
|
-
return original.call(this, server, ns, ops, patchedCallback);
|
|
302
|
-
} else {
|
|
303
|
-
return original.call(this, server, ns, ops, options, patchedCallback);
|
|
304
|
-
}
|
|
305
|
-
};
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
/** Creates spans for command operation */
|
|
309
|
-
_getV3PatchCommand() {
|
|
310
|
-
const instrumentation = this;
|
|
311
|
-
return (original) => {
|
|
312
|
-
return function patchedServerCommand(server, ns, cmd, options, callback) {
|
|
313
|
-
const currentSpan = trace.getSpan(context.active());
|
|
314
|
-
const skipInstrumentation = instrumentation._checkSkipInstrumentation(currentSpan);
|
|
315
|
-
const resultHandler = typeof options === "function" ? options : callback;
|
|
316
|
-
if (skipInstrumentation || typeof resultHandler !== "function" || typeof cmd !== "object") {
|
|
317
|
-
if (typeof options === "function") {
|
|
318
|
-
return original.call(this, server, ns, cmd, options);
|
|
319
|
-
} else {
|
|
320
|
-
return original.call(this, server, ns, cmd, options, callback);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
const commandType = MongoDBInstrumentation._getCommandType(cmd);
|
|
324
|
-
const operationName = commandType === MongodbCommandType.UNKNOWN ? void 0 : commandType;
|
|
325
|
-
const attributes = instrumentation._getV3SpanAttributes(ns, server, cmd, operationName);
|
|
326
|
-
const spanName = instrumentation._spanNameFromAttrs(attributes);
|
|
327
|
-
const span = instrumentation.tracer.startSpan(spanName, {
|
|
328
|
-
kind: SpanKind.CLIENT,
|
|
329
|
-
attributes
|
|
330
|
-
});
|
|
331
|
-
const patchedCallback = instrumentation._patchEnd(span, resultHandler);
|
|
332
|
-
if (typeof options === "function") {
|
|
333
|
-
return original.call(this, server, ns, cmd, patchedCallback);
|
|
334
|
-
} else {
|
|
335
|
-
return original.call(this, server, ns, cmd, options, patchedCallback);
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
/** Creates spans for command operation */
|
|
341
|
-
_getV4PatchCommandCallback() {
|
|
342
|
-
const instrumentation = this;
|
|
343
|
-
return (original) => {
|
|
344
|
-
return function patchedV4ServerCommand(ns, cmd, options, callback) {
|
|
345
|
-
const currentSpan = trace.getSpan(context.active());
|
|
346
|
-
const skipInstrumentation = instrumentation._checkSkipInstrumentation(currentSpan);
|
|
347
|
-
const resultHandler = callback;
|
|
348
|
-
const commandType = Object.keys(cmd)[0];
|
|
349
|
-
if (typeof cmd !== "object" || cmd.ismaster || cmd.hello) {
|
|
350
|
-
return original.call(this, ns, cmd, options, callback);
|
|
351
|
-
}
|
|
352
|
-
let span = void 0;
|
|
353
|
-
if (!skipInstrumentation) {
|
|
354
|
-
const attributes = instrumentation._getV4SpanAttributes(this, ns, cmd, commandType);
|
|
355
|
-
const spanName = instrumentation._spanNameFromAttrs(attributes);
|
|
356
|
-
span = instrumentation.tracer.startSpan(spanName, {
|
|
357
|
-
kind: SpanKind.CLIENT,
|
|
358
|
-
attributes
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
const patchedCallback = instrumentation._patchEnd(span, resultHandler, this.id, commandType);
|
|
362
|
-
return original.call(this, ns, cmd, options, patchedCallback);
|
|
363
|
-
};
|
|
364
|
-
};
|
|
365
|
-
}
|
|
366
|
-
_getV4PatchCommandPromise() {
|
|
367
|
-
const instrumentation = this;
|
|
368
|
-
return (original) => {
|
|
369
|
-
return function patchedV4ServerCommand(...args) {
|
|
370
|
-
const [ns, cmd] = args;
|
|
371
|
-
const currentSpan = trace.getSpan(context.active());
|
|
372
|
-
const skipInstrumentation = instrumentation._checkSkipInstrumentation(currentSpan);
|
|
373
|
-
const commandType = Object.keys(cmd)[0];
|
|
374
|
-
const resultHandler = () => void 0;
|
|
375
|
-
if (typeof cmd !== "object" || cmd.ismaster || cmd.hello) {
|
|
376
|
-
return original.apply(this, args);
|
|
377
|
-
}
|
|
378
|
-
let span = void 0;
|
|
379
|
-
if (!skipInstrumentation) {
|
|
380
|
-
const attributes = instrumentation._getV4SpanAttributes(this, ns, cmd, commandType);
|
|
381
|
-
const spanName = instrumentation._spanNameFromAttrs(attributes);
|
|
382
|
-
span = instrumentation.tracer.startSpan(spanName, {
|
|
383
|
-
kind: SpanKind.CLIENT,
|
|
384
|
-
attributes
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
const patchedCallback = instrumentation._patchEnd(span, resultHandler, this.id, commandType);
|
|
388
|
-
const result = original.apply(this, args);
|
|
389
|
-
result.then(
|
|
390
|
-
(res) => patchedCallback(null, res),
|
|
391
|
-
(err) => patchedCallback(err)
|
|
392
|
-
);
|
|
393
|
-
return result;
|
|
394
|
-
};
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
/** Creates spans for find operation */
|
|
398
|
-
_getV3PatchFind() {
|
|
399
|
-
const instrumentation = this;
|
|
400
|
-
return (original) => {
|
|
401
|
-
return function patchedServerCommand(server, ns, cmd, cursorState, options, callback) {
|
|
402
|
-
const currentSpan = trace.getSpan(context.active());
|
|
403
|
-
const skipInstrumentation = instrumentation._checkSkipInstrumentation(currentSpan);
|
|
404
|
-
const resultHandler = typeof options === "function" ? options : callback;
|
|
405
|
-
if (skipInstrumentation || typeof resultHandler !== "function" || typeof cmd !== "object") {
|
|
406
|
-
if (typeof options === "function") {
|
|
407
|
-
return original.call(this, server, ns, cmd, cursorState, options);
|
|
408
|
-
} else {
|
|
409
|
-
return original.call(this, server, ns, cmd, cursorState, options, callback);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
const attributes = instrumentation._getV3SpanAttributes(ns, server, cmd, "find");
|
|
413
|
-
const spanName = instrumentation._spanNameFromAttrs(attributes);
|
|
414
|
-
const span = instrumentation.tracer.startSpan(spanName, {
|
|
415
|
-
kind: SpanKind.CLIENT,
|
|
416
|
-
attributes
|
|
417
|
-
});
|
|
418
|
-
const patchedCallback = instrumentation._patchEnd(span, resultHandler);
|
|
419
|
-
if (typeof options === "function") {
|
|
420
|
-
return original.call(this, server, ns, cmd, cursorState, patchedCallback);
|
|
421
|
-
} else {
|
|
422
|
-
return original.call(this, server, ns, cmd, cursorState, options, patchedCallback);
|
|
423
|
-
}
|
|
424
|
-
};
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
/** Creates spans for find operation */
|
|
428
|
-
_getV3PatchCursor() {
|
|
429
|
-
const instrumentation = this;
|
|
430
|
-
return (original) => {
|
|
431
|
-
return function patchedServerCommand(server, ns, cursorState, batchSize, options, callback) {
|
|
432
|
-
const currentSpan = trace.getSpan(context.active());
|
|
433
|
-
const skipInstrumentation = instrumentation._checkSkipInstrumentation(currentSpan);
|
|
434
|
-
const resultHandler = typeof options === "function" ? options : callback;
|
|
435
|
-
if (skipInstrumentation || typeof resultHandler !== "function") {
|
|
436
|
-
if (typeof options === "function") {
|
|
437
|
-
return original.call(this, server, ns, cursorState, batchSize, options);
|
|
438
|
-
} else {
|
|
439
|
-
return original.call(this, server, ns, cursorState, batchSize, options, callback);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
const attributes = instrumentation._getV3SpanAttributes(ns, server, cursorState.cmd, "getMore");
|
|
443
|
-
const spanName = instrumentation._spanNameFromAttrs(attributes);
|
|
444
|
-
const span = instrumentation.tracer.startSpan(spanName, {
|
|
445
|
-
kind: SpanKind.CLIENT,
|
|
446
|
-
attributes
|
|
447
|
-
});
|
|
448
|
-
const patchedCallback = instrumentation._patchEnd(span, resultHandler);
|
|
449
|
-
if (typeof options === "function") {
|
|
450
|
-
return original.call(this, server, ns, cursorState, batchSize, patchedCallback);
|
|
451
|
-
} else {
|
|
452
|
-
return original.call(this, server, ns, cursorState, batchSize, options, patchedCallback);
|
|
453
|
-
}
|
|
454
|
-
};
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
/**
|
|
458
|
-
* Get the mongodb command type from the object.
|
|
459
|
-
* @param command Internal mongodb command object
|
|
460
|
-
*/
|
|
461
|
-
static _getCommandType(command) {
|
|
462
|
-
if (command.createIndexes !== void 0) {
|
|
463
|
-
return MongodbCommandType.CREATE_INDEXES;
|
|
464
|
-
} else if (command.findandmodify !== void 0) {
|
|
465
|
-
return MongodbCommandType.FIND_AND_MODIFY;
|
|
466
|
-
} else if (command.ismaster !== void 0) {
|
|
467
|
-
return MongodbCommandType.IS_MASTER;
|
|
468
|
-
} else if (command.count !== void 0) {
|
|
469
|
-
return MongodbCommandType.COUNT;
|
|
470
|
-
} else if (command.aggregate !== void 0) {
|
|
471
|
-
return MongodbCommandType.AGGREGATE;
|
|
472
|
-
} else {
|
|
473
|
-
return MongodbCommandType.UNKNOWN;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
/**
|
|
477
|
-
* Determine a span's attributes by fetching related metadata from the context
|
|
478
|
-
* @param connectionCtx mongodb internal connection context
|
|
479
|
-
* @param ns mongodb namespace
|
|
480
|
-
* @param command mongodb internal representation of a command
|
|
481
|
-
*/
|
|
482
|
-
_getV4SpanAttributes(connectionCtx, ns, command, operation) {
|
|
483
|
-
let host, port;
|
|
484
|
-
if (connectionCtx) {
|
|
485
|
-
const hostParts = typeof connectionCtx.address === "string" ? connectionCtx.address.split(":") : "";
|
|
486
|
-
if (hostParts.length === 2) {
|
|
487
|
-
host = hostParts[0];
|
|
488
|
-
port = hostParts[1];
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
let commandObj;
|
|
492
|
-
if (command?.documents && command.documents[0]) {
|
|
493
|
-
commandObj = command.documents[0];
|
|
494
|
-
} else if (command?.cursors) {
|
|
495
|
-
commandObj = command.cursors;
|
|
496
|
-
} else {
|
|
497
|
-
commandObj = command;
|
|
498
|
-
}
|
|
499
|
-
return this._getSpanAttributes(ns.db, ns.collection, host, port, commandObj, operation);
|
|
500
|
-
}
|
|
501
|
-
/**
|
|
502
|
-
* Determine a span's attributes by fetching related metadata from the context
|
|
503
|
-
* @param ns mongodb namespace
|
|
504
|
-
* @param topology mongodb internal representation of the network topology
|
|
505
|
-
* @param command mongodb internal representation of a command
|
|
506
|
-
*/
|
|
507
|
-
_getV3SpanAttributes(ns, topology, command, operation) {
|
|
508
|
-
let host;
|
|
509
|
-
let port;
|
|
510
|
-
if (topology && topology.s) {
|
|
511
|
-
host = topology.s.options?.host ?? topology.s.host;
|
|
512
|
-
port = (topology.s.options?.port ?? topology.s.port)?.toString();
|
|
513
|
-
if (host == null || port == null) {
|
|
514
|
-
const address = topology.description?.address;
|
|
515
|
-
if (address) {
|
|
516
|
-
const addressSegments = address.split(":");
|
|
517
|
-
host = addressSegments[0];
|
|
518
|
-
port = addressSegments[1];
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
const [dbName, dbCollection] = ns.toString().split(".");
|
|
523
|
-
const commandObj = command?.query ?? command?.q ?? command;
|
|
524
|
-
return this._getSpanAttributes(dbName, dbCollection, host, port, commandObj, operation);
|
|
525
|
-
}
|
|
526
|
-
_getSpanAttributes(dbName, dbCollection, host, port, commandObj, operation) {
|
|
527
|
-
const attributes = {};
|
|
528
|
-
if (this._dbSemconvStability & SemconvStability.OLD) {
|
|
529
|
-
attributes[ATTR_DB_SYSTEM] = DB_SYSTEM_VALUE_MONGODB;
|
|
530
|
-
attributes[ATTR_DB_NAME] = dbName;
|
|
531
|
-
attributes[ATTR_DB_MONGODB_COLLECTION] = dbCollection;
|
|
532
|
-
attributes[ATTR_DB_OPERATION] = operation;
|
|
533
|
-
attributes[ATTR_DB_CONNECTION_STRING] = `mongodb://${host}:${port}/${dbName}`;
|
|
534
|
-
}
|
|
535
|
-
if (this._dbSemconvStability & SemconvStability.STABLE) {
|
|
536
|
-
attributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_MONGODB;
|
|
537
|
-
attributes[ATTR_DB_NAMESPACE] = dbName;
|
|
538
|
-
attributes[ATTR_DB_OPERATION_NAME] = operation;
|
|
539
|
-
attributes[ATTR_DB_COLLECTION_NAME] = dbCollection;
|
|
540
|
-
}
|
|
541
|
-
if (host && port) {
|
|
542
|
-
if (this._netSemconvStability & SemconvStability.OLD) {
|
|
543
|
-
attributes[ATTR_NET_PEER_NAME] = host;
|
|
544
|
-
}
|
|
545
|
-
if (this._netSemconvStability & SemconvStability.STABLE) {
|
|
546
|
-
attributes[ATTR_SERVER_ADDRESS] = host;
|
|
547
|
-
}
|
|
548
|
-
const portNumber = parseInt(port, 10);
|
|
549
|
-
if (!isNaN(portNumber)) {
|
|
550
|
-
if (this._netSemconvStability & SemconvStability.OLD) {
|
|
551
|
-
attributes[ATTR_NET_PEER_PORT] = portNumber;
|
|
552
|
-
}
|
|
553
|
-
if (this._netSemconvStability & SemconvStability.STABLE) {
|
|
554
|
-
attributes[ATTR_SERVER_PORT] = portNumber;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
if (commandObj) {
|
|
559
|
-
const { dbStatementSerializer: configDbStatementSerializer } = this.getConfig();
|
|
560
|
-
const dbStatementSerializer = typeof configDbStatementSerializer === "function" ? configDbStatementSerializer : this._defaultDbStatementSerializer.bind(this);
|
|
561
|
-
safeExecuteInTheMiddle(
|
|
562
|
-
() => {
|
|
563
|
-
const query = dbStatementSerializer(commandObj);
|
|
564
|
-
if (this._dbSemconvStability & SemconvStability.OLD) {
|
|
565
|
-
attributes[ATTR_DB_STATEMENT] = query;
|
|
566
|
-
}
|
|
567
|
-
if (this._dbSemconvStability & SemconvStability.STABLE) {
|
|
568
|
-
attributes[ATTR_DB_QUERY_TEXT] = query;
|
|
569
|
-
}
|
|
570
|
-
},
|
|
571
|
-
(err) => {
|
|
572
|
-
if (err) {
|
|
573
|
-
this._diag.error("Error running dbStatementSerializer hook", err);
|
|
574
|
-
}
|
|
575
|
-
},
|
|
576
|
-
true
|
|
577
|
-
);
|
|
578
|
-
}
|
|
579
|
-
return attributes;
|
|
580
|
-
}
|
|
581
|
-
_spanNameFromAttrs(attributes) {
|
|
582
|
-
let spanName;
|
|
583
|
-
if (this._dbSemconvStability & SemconvStability.STABLE) {
|
|
584
|
-
spanName = [attributes[ATTR_DB_OPERATION_NAME], attributes[ATTR_DB_COLLECTION_NAME]].filter((attr) => attr).join(" ") || DB_SYSTEM_NAME_VALUE_MONGODB;
|
|
585
|
-
} else {
|
|
586
|
-
spanName = `mongodb.${attributes[ATTR_DB_OPERATION] || "command"}`;
|
|
587
|
-
}
|
|
588
|
-
return spanName;
|
|
589
|
-
}
|
|
590
|
-
_getDefaultDbStatementReplacer() {
|
|
591
|
-
const seen = /* @__PURE__ */ new WeakSet();
|
|
592
|
-
return (_key, value) => {
|
|
593
|
-
if (typeof value !== "object" || !value) return "?";
|
|
594
|
-
if (seen.has(value)) return "[Circular]";
|
|
595
|
-
seen.add(value);
|
|
596
|
-
return value;
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
_defaultDbStatementSerializer(commandObj) {
|
|
600
|
-
const { enhancedDatabaseReporting } = this.getConfig();
|
|
601
|
-
if (enhancedDatabaseReporting) {
|
|
602
|
-
return JSON.stringify(commandObj);
|
|
603
|
-
}
|
|
604
|
-
return JSON.stringify(commandObj, this._getDefaultDbStatementReplacer());
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* Triggers the response hook in case it is defined.
|
|
608
|
-
* @param span The span to add the results to.
|
|
609
|
-
* @param result The command result
|
|
610
|
-
*/
|
|
611
|
-
_handleExecutionResult(span, result) {
|
|
612
|
-
const { responseHook } = this.getConfig();
|
|
613
|
-
if (typeof responseHook === "function") {
|
|
614
|
-
safeExecuteInTheMiddle(
|
|
615
|
-
() => {
|
|
616
|
-
responseHook(span, { data: result });
|
|
617
|
-
},
|
|
618
|
-
(err) => {
|
|
619
|
-
if (err) {
|
|
620
|
-
this._diag.error("Error running response hook", err);
|
|
621
|
-
}
|
|
622
|
-
},
|
|
623
|
-
true
|
|
624
|
-
);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
/**
|
|
628
|
-
* Ends a created span.
|
|
629
|
-
* @param span The created span to end.
|
|
630
|
-
* @param resultHandler A callback function.
|
|
631
|
-
* @param connectionId: The connection ID of the Command response.
|
|
632
|
-
*/
|
|
633
|
-
_patchEnd(span, resultHandler, connectionId, commandType) {
|
|
634
|
-
const activeContext = context.active();
|
|
635
|
-
const instrumentation = this;
|
|
636
|
-
let spanEnded = false;
|
|
637
|
-
return function patchedEnd(...args) {
|
|
638
|
-
if (!spanEnded) {
|
|
639
|
-
spanEnded = true;
|
|
640
|
-
const error = args[0];
|
|
641
|
-
if (span) {
|
|
642
|
-
if (error instanceof Error) {
|
|
643
|
-
span.setStatus({
|
|
644
|
-
code: SpanStatusCode.ERROR,
|
|
645
|
-
message: error.message
|
|
646
|
-
});
|
|
647
|
-
} else {
|
|
648
|
-
const result = args[1];
|
|
649
|
-
instrumentation._handleExecutionResult(span, result);
|
|
650
|
-
}
|
|
651
|
-
span.end();
|
|
652
|
-
}
|
|
653
|
-
if (commandType === "endSessions") {
|
|
654
|
-
instrumentation._connCountAdd(-1, instrumentation._poolName, "idle");
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
return context.with(activeContext, () => {
|
|
658
|
-
return resultHandler.apply(this, args);
|
|
659
|
-
});
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
setPoolName(options) {
|
|
663
|
-
const host = options.hostAddress?.host;
|
|
664
|
-
const port = options.hostAddress?.port;
|
|
665
|
-
const database = options.dbName;
|
|
666
|
-
const poolName = `mongodb://${host}:${port}/${database}`;
|
|
667
|
-
this._poolName = poolName;
|
|
668
|
-
}
|
|
669
|
-
_checkSkipInstrumentation(currentSpan) {
|
|
670
|
-
const requireParentSpan = this.getConfig().requireParentSpan;
|
|
671
|
-
const hasNoParentSpan = currentSpan === void 0;
|
|
672
|
-
return requireParentSpan === true && hasNoParentSpan;
|
|
673
|
-
}
|
|
674
124
|
}
|
|
675
125
|
|
|
676
126
|
export { MongoDBInstrumentation };
|