@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/postgres/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-pg\n * - Upstream version: @opentelemetry/instrumentation-pg@0.70.0\n * - Types from `pg` and `pg-pool` packages inlined as simplified interfaces\n * - Minor TypeScript strictness adjustments\n */\n/* eslint-disable */\n\nimport {\n isWrapped,\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n safeExecuteInTheMiddle,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile';\nimport {\n context,\n trace,\n Span,\n SpanStatusCode,\n SpanKind,\n Histogram,\n ValueType,\n Attributes,\n UpDownCounter,\n} from '@opentelemetry/api';\nimport type { PgClient } from './pg-types';\nimport {\n PgClientConnect,\n PgClientExtended,\n PostgresCallback,\n PgPoolExtended,\n PgPoolCallback,\n EVENT_LISTENERS_SET,\n} from './internal-types';\nimport { PgInstrumentationConfig } from './types';\nimport * as utils from './utils';\nimport { addSqlCommenterComment } from '../../utils/sql-common';\nimport { SDK_VERSION, timestampInSeconds } from '@sentry/core';\nconst PACKAGE_NAME = '@sentry/instrumentation-pg';\nimport { SpanNames } from './enums/SpanNames';\nimport {\n ATTR_ERROR_TYPE,\n ATTR_SERVER_PORT,\n ATTR_SERVER_ADDRESS,\n ATTR_DB_NAMESPACE,\n ATTR_DB_OPERATION_NAME,\n ATTR_DB_SYSTEM_NAME,\n METRIC_DB_CLIENT_OPERATION_DURATION,\n} from '@opentelemetry/semantic-conventions';\nimport {\n METRIC_DB_CLIENT_CONNECTION_COUNT,\n METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,\n ATTR_DB_SYSTEM,\n DB_SYSTEM_VALUE_POSTGRESQL,\n} from './semconv';\n\nfunction extractModuleExports(module: any) {\n return module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n}\n\nexport class PgInstrumentation extends InstrumentationBase<PgInstrumentationConfig> {\n declare private _operationDuration: Histogram;\n declare private _connectionsCount: UpDownCounter;\n declare private _connectionPendingRequests: UpDownCounter;\n // Pool events connect, acquire, release and remove can be called\n // multiple times without changing the values of total, idle and waiting\n // connections. The _connectionsCounter is used to keep track of latest\n // values and only update the metrics _connectionsCount and _connectionPendingRequests\n // when the value change.\n private _connectionsCounter: utils.poolConnectionsCounter = {\n used: 0,\n idle: 0,\n pending: 0,\n };\n private _semconvStability: SemconvStability;\n\n constructor(config: PgInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n this._semconvStability = semconvStabilityFromStr('database', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);\n }\n\n override _updateMetricInstruments() {\n this._operationDuration = this.meter.createHistogram(METRIC_DB_CLIENT_OPERATION_DURATION, {\n description: 'Duration of database client operations.',\n unit: 's',\n valueType: ValueType.DOUBLE,\n advice: {\n explicitBucketBoundaries: [0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10],\n },\n });\n\n this._connectionsCounter = {\n idle: 0,\n pending: 0,\n used: 0,\n };\n this._connectionsCount = this.meter.createUpDownCounter(METRIC_DB_CLIENT_CONNECTION_COUNT, {\n description: 'The number of connections that are currently in state described by the state attribute.',\n unit: '{connection}',\n });\n this._connectionPendingRequests = this.meter.createUpDownCounter(METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS, {\n description: 'The number of current pending requests for an open connection.',\n unit: '{connection}',\n });\n }\n\n protected init() {\n const SUPPORTED_PG_VERSIONS = ['>=8.0.3 <9'];\n const SUPPORTED_PG_POOL_VERSIONS = ['>=2.0.0 <4'];\n\n const modulePgNativeClient = new InstrumentationNodeModuleFile(\n 'pg/lib/native/client.js',\n SUPPORTED_PG_VERSIONS,\n this._patchPgClient.bind(this),\n this._unpatchPgClient.bind(this),\n );\n\n const modulePgClient = new InstrumentationNodeModuleFile(\n 'pg/lib/client.js',\n SUPPORTED_PG_VERSIONS,\n this._patchPgClient.bind(this),\n this._unpatchPgClient.bind(this),\n );\n\n const modulePG = new InstrumentationNodeModuleDefinition(\n 'pg',\n SUPPORTED_PG_VERSIONS,\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n\n this._patchPgClient(moduleExports.Client);\n return module;\n },\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n\n this._unpatchPgClient(moduleExports.Client);\n return module;\n },\n [modulePgClient, modulePgNativeClient],\n );\n\n const modulePGPool = new InstrumentationNodeModuleDefinition(\n 'pg-pool',\n SUPPORTED_PG_POOL_VERSIONS,\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n this._wrap(moduleExports.prototype, 'connect', this._getPoolConnectPatch() as any);\n return moduleExports;\n },\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n },\n );\n\n return [modulePG, modulePGPool];\n }\n\n private _patchPgClient(module: any) {\n if (!module) {\n return;\n }\n\n const moduleExports = extractModuleExports(module);\n\n if (isWrapped(moduleExports.prototype.query)) {\n this._unwrap(moduleExports.prototype, 'query');\n }\n\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n\n this._wrap(moduleExports.prototype, 'query', this._getClientQueryPatch() as any);\n\n this._wrap(moduleExports.prototype, 'connect', this._getClientConnectPatch() as any);\n\n return module;\n }\n\n private _unpatchPgClient(module: any) {\n const moduleExports = extractModuleExports(module);\n\n if (isWrapped(moduleExports.prototype.query)) {\n this._unwrap(moduleExports.prototype, 'query');\n }\n\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n\n return module;\n }\n\n private _getClientConnectPatch() {\n const plugin = this;\n return (original: PgClientConnect) => {\n return function connect(this: PgClient, callback?: Function) {\n const config = plugin.getConfig();\n\n if (utils.shouldSkipInstrumentation(config) || config.ignoreConnectSpans) {\n return original.call(this, callback);\n }\n\n const span = plugin.tracer.startSpan(SpanNames.CONNECT, {\n kind: SpanKind.CLIENT,\n attributes: utils.getSemanticAttributesFromConnection(this, plugin._semconvStability),\n });\n\n if (callback) {\n const parentSpan = trace.getSpan(context.active());\n callback = utils.patchClientConnectCallback(span, callback);\n if (parentSpan) {\n callback = context.bind(context.active(), callback);\n }\n }\n\n const connectResult: unknown = context.with(trace.setSpan(context.active(), span), () => {\n return original.call(this, callback);\n });\n\n return handleConnectResult(span, connectResult);\n };\n };\n }\n\n private recordOperationDuration(attributes: Attributes, startTime: number) {\n const metricsAttributes: Attributes = {};\n const keysToCopy: string[] = [\n ATTR_DB_NAMESPACE,\n ATTR_ERROR_TYPE,\n ATTR_SERVER_PORT,\n ATTR_SERVER_ADDRESS,\n ATTR_DB_OPERATION_NAME,\n ];\n if (this._semconvStability & SemconvStability.OLD) {\n keysToCopy.push(ATTR_DB_SYSTEM);\n }\n if (this._semconvStability & SemconvStability.STABLE) {\n keysToCopy.push(ATTR_DB_SYSTEM_NAME);\n }\n\n keysToCopy.forEach(key => {\n if (key in attributes) {\n metricsAttributes[key] = attributes[key];\n }\n });\n\n const durationSeconds = timestampInSeconds() - startTime;\n this._operationDuration.record(durationSeconds, metricsAttributes);\n }\n\n private _getClientQueryPatch() {\n const plugin = this;\n return (original: (...args: any[]) => any) => {\n this._diag.debug('Patching pg.Client.prototype.query');\n return function query(this: PgClientExtended, ...args: unknown[]) {\n if (utils.shouldSkipInstrumentation(plugin.getConfig())) {\n return original.apply(this, args as never);\n }\n const startTime = timestampInSeconds();\n\n // client.query(text, cb?), client.query(text, values, cb?), and\n // client.query(configObj, cb?) are all valid signatures. We construct\n // a queryConfig obj from all (valid) signatures to build the span in a\n // unified way. We verify that we at least have query text, and code\n // defensively when dealing with `queryConfig` after that (to handle all\n // the other invalid cases, like a non-array for values being provided).\n // The type casts here reflect only what we've actually validated.\n const arg0 = args[0];\n const firstArgIsString = typeof arg0 === 'string';\n const firstArgIsQueryObjectWithText = utils.isObjectWithTextString(arg0);\n\n // TODO: remove the `as ...` casts below when the TS version is upgraded.\n // Newer TS versions will use the result of firstArgIsQueryObjectWithText\n // to properly narrow arg0, but TS 4.3.5 does not.\n const queryConfig = firstArgIsString\n ? {\n text: arg0 as string,\n values: Array.isArray(args[1]) ? args[1] : undefined,\n }\n : firstArgIsQueryObjectWithText\n ? {\n ...(arg0 as any),\n name: arg0.name,\n text: arg0.text,\n values: (arg0 as any).values ?? (Array.isArray(args[1]) ? args[1] : undefined),\n }\n : undefined;\n\n const attributes: Attributes = {\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL,\n [ATTR_DB_NAMESPACE]: this.database,\n [ATTR_SERVER_PORT]: this.connectionParameters.port,\n [ATTR_SERVER_ADDRESS]: this.connectionParameters.host,\n };\n\n if (queryConfig?.text) {\n attributes[ATTR_DB_OPERATION_NAME] = utils.parseNormalizedOperationName(queryConfig?.text);\n }\n\n const recordDuration = () => {\n plugin.recordOperationDuration(attributes, startTime);\n };\n\n const instrumentationConfig = plugin.getConfig();\n\n const span = utils.handleConfigQuery.call(\n this,\n plugin.tracer,\n instrumentationConfig,\n plugin._semconvStability,\n queryConfig,\n );\n\n // Modify query text w/ a tracing comment before invoking original for\n // tracing, but only if args[0] has one of our expected shapes.\n if (instrumentationConfig.addSqlCommenterCommentToQueries) {\n if (firstArgIsString) {\n args[0] = addSqlCommenterComment(span, arg0);\n } else if (firstArgIsQueryObjectWithText && !('name' in arg0)) {\n // In the case of a query object, we need to ensure there's no name field\n // as this indicates a prepared query, where the comment would remain the same\n // for every invocation and contain an outdated trace context.\n args[0] = {\n ...arg0,\n text: addSqlCommenterComment(span, arg0.text),\n };\n }\n }\n\n // Bind callback (if any) to parent span (if any)\n if (args.length > 0) {\n const parentSpan = trace.getSpan(context.active());\n if (typeof args[args.length - 1] === 'function') {\n // Patch ParameterQuery callback\n args[args.length - 1] = utils.patchCallback(\n instrumentationConfig,\n span,\n args[args.length - 1] as PostgresCallback, // nb: not type safe.\n attributes,\n recordDuration,\n );\n\n // If a parent span exists, bind the callback\n if (parentSpan) {\n args[args.length - 1] = context.bind(context.active(), args[args.length - 1]);\n }\n } else if (typeof queryConfig?.callback === 'function') {\n // Patch ConfigQuery callback\n let callback = utils.patchCallback(\n plugin.getConfig(),\n span,\n queryConfig.callback as PostgresCallback, // nb: not type safe.\n attributes,\n recordDuration,\n );\n\n // If a parent span existed, bind the callback\n if (parentSpan) {\n callback = context.bind(context.active(), callback);\n }\n\n (args[0] as { callback?: PostgresCallback }).callback = callback;\n }\n }\n\n const { requestHook } = instrumentationConfig;\n if (typeof requestHook === 'function' && queryConfig) {\n safeExecuteInTheMiddle(\n () => {\n // pick keys to expose explicitly, so we're not leaking pg package\n // internals that are subject to change\n const { database, host, port, user } = this.connectionParameters;\n const connection = { database, host, port, user };\n\n requestHook(span, {\n connection,\n query: {\n text: queryConfig.text,\n // nb: if `client.query` is called with illegal arguments\n // (e.g., if `queryConfig.values` is passed explicitly, but a\n // non-array is given), then the type casts will be wrong. But\n // we leave it up to the queryHook to handle that, and we\n // catch and swallow any errors it throws. The other options\n // are all worse. E.g., we could leave `queryConfig.values`\n // and `queryConfig.name` as `unknown`, but then the hook body\n // would be forced to validate (or cast) them before using\n // them, which seems incredibly cumbersome given that these\n // casts will be correct 99.9% of the time -- and pg.query\n // will immediately throw during development in the other .1%\n // of cases. Alternatively, we could simply skip calling the\n // hook when `values` or `name` don't have the expected type,\n // but that would add unnecessary validation overhead to every\n // hook invocation and possibly be even more confusing/unexpected.\n values: queryConfig.values as unknown[],\n name: queryConfig.name as string | undefined,\n },\n });\n },\n err => {\n if (err) {\n plugin._diag.error('Error running query hook', err);\n }\n },\n true,\n );\n }\n\n let result: unknown;\n try {\n result = original.apply(this, args as never);\n } catch (e: unknown) {\n if (e instanceof Error) {\n span.recordException(utils.sanitizedErrorMessage(e));\n }\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: utils.getErrorMessage(e),\n });\n span.end();\n throw e;\n }\n\n // Bind promise to parent span and end the span\n if (result instanceof Promise) {\n return result\n .then((result: unknown) => {\n // Return a pass-along promise which ends the span and then goes to user's orig resolvers\n return new Promise(resolve => {\n utils.handleExecutionResult(plugin.getConfig(), span, result);\n recordDuration();\n span.end();\n resolve(result);\n });\n })\n .catch((error: Error) => {\n return new Promise((_, reject) => {\n if (error instanceof Error) {\n span.recordException(utils.sanitizedErrorMessage(error));\n }\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n recordDuration();\n span.end();\n reject(error);\n });\n });\n }\n\n // else returns void\n return result; // void\n };\n };\n }\n\n private _setPoolConnectEventListeners(pgPool: PgPoolExtended) {\n if (pgPool[EVENT_LISTENERS_SET]) return;\n const poolName = utils.getPoolName(pgPool.options);\n\n pgPool.on('connect', () => {\n this._connectionsCounter = utils.updateCounter(\n poolName,\n pgPool,\n this._connectionsCount,\n this._connectionPendingRequests,\n this._connectionsCounter,\n );\n });\n\n pgPool.on('acquire', () => {\n this._connectionsCounter = utils.updateCounter(\n poolName,\n pgPool,\n this._connectionsCount,\n this._connectionPendingRequests,\n this._connectionsCounter,\n );\n });\n\n pgPool.on('remove', () => {\n this._connectionsCounter = utils.updateCounter(\n poolName,\n pgPool,\n this._connectionsCount,\n this._connectionPendingRequests,\n this._connectionsCounter,\n );\n });\n\n pgPool.on('release' as any, () => {\n this._connectionsCounter = utils.updateCounter(\n poolName,\n pgPool,\n this._connectionsCount,\n this._connectionPendingRequests,\n this._connectionsCounter,\n );\n });\n pgPool[EVENT_LISTENERS_SET] = true;\n }\n\n private _getPoolConnectPatch() {\n const plugin = this;\n return (originalConnect: (...args: any[]) => any) => {\n return function connect(this: PgPoolExtended, callback?: PgPoolCallback) {\n const config = plugin.getConfig();\n\n if (utils.shouldSkipInstrumentation(config)) {\n return originalConnect.call(this, callback as any);\n }\n\n // Still set up event listeners for metrics even when skipping spans\n plugin._setPoolConnectEventListeners(this);\n\n if (config.ignoreConnectSpans) {\n return originalConnect.call(this, callback as any);\n }\n\n // setup span\n const span = plugin.tracer.startSpan(SpanNames.POOL_CONNECT, {\n kind: SpanKind.CLIENT,\n attributes: utils.getSemanticAttributesFromPoolConnection(this.options, plugin._semconvStability),\n });\n\n if (callback) {\n const parentSpan = trace.getSpan(context.active());\n callback = utils.patchCallbackPGPool(span, callback) as PgPoolCallback;\n // If a parent span exists, bind the callback\n if (parentSpan) {\n callback = context.bind(context.active(), callback);\n }\n }\n\n const connectResult: unknown = context.with(trace.setSpan(context.active(), span), () => {\n return originalConnect.call(this, callback as any);\n });\n\n return handleConnectResult(span, connectResult);\n };\n };\n }\n}\n\nfunction handleConnectResult(span: Span, connectResult: unknown) {\n if (!(connectResult instanceof Promise)) {\n return connectResult;\n }\n\n const connectResultPromise = connectResult as Promise<unknown>;\n return context.bind(\n context.active(),\n connectResultPromise\n .then(result => {\n span.end();\n return result;\n })\n .catch((error: unknown) => {\n if (error instanceof Error) {\n span.recordException(utils.sanitizedErrorMessage(error));\n }\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: utils.getErrorMessage(error),\n });\n span.end();\n return Promise.reject(error);\n }),\n );\n}\n"],"names":["utils.shouldSkipInstrumentation","utils.getSemanticAttributesFromConnection","utils.patchClientConnectCallback","utils.isObjectWithTextString","utils.parseNormalizedOperationName","utils.handleConfigQuery","utils.patchCallback","utils.sanitizedErrorMessage","utils.getErrorMessage","result","utils.handleExecutionResult","utils.getPoolName","utils.updateCounter","utils.getSemanticAttributesFromPoolConnection","utils.patchCallbackPGPool"],"mappings":";;;;;;;;;;;AAwDA,MAAM,YAAA,GAAe,4BAAA;AAkBrB,SAAS,qBAAqB,MAAA,EAAa;AACzC,EAAA,OAAO,OAAO,MAAA,CAAO,WAAW,CAAA,KAAM,QAAA,GAClC,OAAO,OAAA,GACP,MAAA;AACN;AAEO,MAAM,0BAA0B,mBAAA,CAA6C;AAAA,EAgBlF,WAAA,CAAY,MAAA,GAAkC,EAAC,EAAG;AAChD,IAAA,KAAA,CAAM,YAAA,EAAc,aAAa,MAAM,CAAA;AARzC;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA,IAAA,CAAQ,mBAAA,GAAoD;AAAA,MAC1D,IAAA,EAAM,CAAA;AAAA,MACN,IAAA,EAAM,CAAA;AAAA,MACN,OAAA,EAAS;AAAA,KACX;AAKE,IAAA,IAAA,CAAK,iBAAA,GAAoB,uBAAA,CAAwB,UAAA,EAAY,OAAA,CAAQ,IAAI,6BAA6B,CAAA;AAAA,EACxG;AAAA,EAES,wBAAA,GAA2B;AAClC,IAAA,IAAA,CAAK,kBAAA,GAAqB,IAAA,CAAK,KAAA,CAAM,eAAA,CAAgB,mCAAA,EAAqC;AAAA,MACxF,WAAA,EAAa,yCAAA;AAAA,MACb,IAAA,EAAM,GAAA;AAAA,MACN,WAAW,SAAA,CAAU,MAAA;AAAA,MACrB,MAAA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OAAA,CAAA,EAAU;AACvC,IAAA,OAAO,aAAA;AAAA,EACT;AAEA,EAAA,MAAM,oBAAA,GAAuB,aAAA;AAC7B,EAAA,OAAO,OAAA,CAAQ,IAAA;AAAA,IACb,QAAQ,MAAA,EAAO;AAAA,IACf,oBAAA,CACG,KAAK,CAAA,MAAA,KAAU;AACd,MAAA,IAAA,CAAK,GAAA,EAAI;AACT,MAAA,OAAO,MAAA;AAAA,IACT,CAAC,CAAA,CACA,KAAA,CAAM,CAAC,KAAA,KAAmB;AACzB,MAAA,IAAI,iBAAiB,KAAA,EAAO;AAC1B,QAAA,IAAA,CAAK,eAAA,CAAgBP,qBAAM,CAAsB,KAAK,CAAC,CAAA;AAAA,MACzD;AACA,MAAA,IAAA,CAAK,SAAA,CAAU;AAAA,QACb,MAAM,cAAA,CAAe,KAAA;AAAA,QACrB,OAAA,EAASC,eAAM,CAAgB,KAAK;AAAA,OACrC,CAAA;AACD,MAAA,IAAA,CAAK,GAAA,EAAI;AACT,MAAA,OAAO,OAAA,CAAQ,OAAO,KAAK,CAAA;AAAA,IAC7B,CAAC;AAAA,GACL;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/postgres/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-pg\n * - Upstream version: @opentelemetry/instrumentation-pg@0.70.0\n * - Types from `pg` and `pg-pool` packages inlined as simplified interfaces\n * - Refactored to use Sentry's span APIs instead of OpenTelemetry tracing APIs\n * - Dropped the OTel metrics (no MeterProvider is wired up), the `SemconvStability`\n * dual-emission, and config the SDK never passes (request/response hooks,\n * enhancedDatabaseReporting, addSqlCommenterCommentToQueries)\n */\n\nimport { SpanKind } from '@opentelemetry/api';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport type { Span } from '@sentry/core';\nimport { getActiveSpan, SDK_VERSION, SPAN_STATUS_ERROR, startInactiveSpan, withActiveSpan } from '@sentry/core';\nimport { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile';\nimport { SpanNames } from './enums/SpanNames';\nimport type {\n PgClientConnect,\n PgClientExtended,\n PgPoolCallback,\n PgPoolExtended,\n PostgresCallback,\n} from './internal-types';\nimport type { PgInstrumentationConfig } from './types';\nimport * as utils from './utils';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-pg';\n\nfunction extractModuleExports(module: any): any {\n return module[Symbol.toStringTag] === 'Module'\n ? module.default // ESM\n : module; // CommonJS\n}\n\n/**\n * Binds `callback` to `parentSpan`, so that the span is active again whenever the\n * (deferred) callback runs. This mirrors the upstream `context.bind(context.active(), callback)`:\n * `pg` invokes callbacks outside of the original async scope (e.g. for pooled connections), so we\n * re-establish the trace context to keep spans created inside the callback correctly parented.\n */\nfunction bindCallbackToSpan<T extends (...args: any[]) => any>(parentSpan: Span, callback: T): T {\n return function (this: unknown, ...args: any[]): unknown {\n return withActiveSpan(parentSpan, () => callback.apply(this, args));\n } as T;\n}\n\nexport class PgInstrumentation extends InstrumentationBase<PgInstrumentationConfig> {\n public constructor(config: PgInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init(): InstrumentationNodeModuleDefinition[] {\n const SUPPORTED_PG_VERSIONS = ['>=8.0.3 <9'];\n const SUPPORTED_PG_POOL_VERSIONS = ['>=2.0.0 <4'];\n\n const modulePgNativeClient = new InstrumentationNodeModuleFile(\n 'pg/lib/native/client.js',\n SUPPORTED_PG_VERSIONS,\n this._patchPgClient.bind(this),\n this._unpatchPgClient.bind(this),\n );\n\n const modulePgClient = new InstrumentationNodeModuleFile(\n 'pg/lib/client.js',\n SUPPORTED_PG_VERSIONS,\n this._patchPgClient.bind(this),\n this._unpatchPgClient.bind(this),\n );\n\n const modulePG = new InstrumentationNodeModuleDefinition(\n 'pg',\n SUPPORTED_PG_VERSIONS,\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n\n this._patchPgClient(moduleExports.Client);\n return module;\n },\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n\n this._unpatchPgClient(moduleExports.Client);\n return module;\n },\n [modulePgClient, modulePgNativeClient],\n );\n\n const modulePGPool = new InstrumentationNodeModuleDefinition(\n 'pg-pool',\n SUPPORTED_PG_POOL_VERSIONS,\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n this._wrap(moduleExports.prototype, 'connect', this._getPoolConnectPatch());\n return moduleExports;\n },\n (module: any) => {\n const moduleExports = extractModuleExports(module);\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n },\n );\n\n return [modulePG, modulePGPool];\n }\n\n private _patchPgClient(module: any): any {\n if (!module) {\n return;\n }\n\n const moduleExports = extractModuleExports(module);\n\n if (isWrapped(moduleExports.prototype.query)) {\n this._unwrap(moduleExports.prototype, 'query');\n }\n\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n\n this._wrap(moduleExports.prototype, 'query', this._getClientQueryPatch());\n\n this._wrap(moduleExports.prototype, 'connect', this._getClientConnectPatch());\n\n return module;\n }\n\n private _unpatchPgClient(module: any): any {\n const moduleExports = extractModuleExports(module);\n\n if (isWrapped(moduleExports.prototype.query)) {\n this._unwrap(moduleExports.prototype, 'query');\n }\n\n if (isWrapped(moduleExports.prototype.connect)) {\n this._unwrap(moduleExports.prototype, 'connect');\n }\n\n return module;\n }\n\n private _getClientConnectPatch() {\n const plugin = this;\n return (original: PgClientConnect) => {\n return function connect(this: PgClientExtended, callback?: (...args: unknown[]) => void) {\n if (utils.shouldSkipInstrumentation() || plugin.getConfig().ignoreConnectSpans) {\n return original.call(this, callback);\n }\n\n const span = startInactiveSpan({\n name: SpanNames.CONNECT,\n kind: SpanKind.CLIENT,\n attributes: utils.getSemanticAttributesFromConnection(this),\n });\n\n let cb = callback;\n if (cb) {\n const parentSpan = getActiveSpan();\n cb = utils.patchClientConnectCallback(span, cb);\n if (parentSpan) {\n cb = bindCallbackToSpan(parentSpan, cb);\n }\n }\n\n const connectResult: unknown = withActiveSpan(span, () => {\n return original.call(this, cb);\n });\n\n return handleConnectResult(span, connectResult);\n };\n };\n }\n\n private _getClientQueryPatch() {\n return (original: (...args: any[]) => any) => {\n this._diag.debug('Patching pg.Client.prototype.query');\n return function query(this: PgClientExtended, ...args: unknown[]) {\n if (utils.shouldSkipInstrumentation()) {\n return original.apply(this, args as never);\n }\n\n // client.query(text, cb?), client.query(text, values, cb?), and\n // client.query(configObj, cb?) are all valid signatures. We construct\n // a queryConfig obj from all (valid) signatures to build the span in a\n // unified way. We verify that we at least have query text, and code\n // defensively when dealing with `queryConfig` after that (to handle all\n // the other invalid cases, like a non-array for values being provided).\n // The type casts here reflect only what we've actually validated.\n const arg0 = args[0];\n const firstArgIsString = typeof arg0 === 'string';\n const firstArgIsQueryObjectWithText = utils.isObjectWithTextString(arg0);\n\n const queryConfig = firstArgIsString\n ? {\n text: arg0,\n values: Array.isArray(args[1]) ? args[1] : undefined,\n }\n : firstArgIsQueryObjectWithText\n ? {\n ...(arg0 as any),\n name: arg0.name,\n text: arg0.text,\n values: (arg0 as any).values ?? (Array.isArray(args[1]) ? args[1] : undefined),\n }\n : undefined;\n\n const span = utils.handleConfigQuery.call(this, queryConfig);\n\n // Bind callback (if any) to parent span (if any)\n if (args.length > 0) {\n const parentSpan = getActiveSpan();\n if (typeof args[args.length - 1] === 'function') {\n // Patch ParameterQuery callback\n args[args.length - 1] = utils.patchCallback(span, args[args.length - 1] as PostgresCallback);\n\n // If a parent span exists, bind the callback\n if (parentSpan) {\n args[args.length - 1] = bindCallbackToSpan(parentSpan, args[args.length - 1] as PostgresCallback);\n }\n } else if (typeof queryConfig?.callback === 'function') {\n // Patch ConfigQuery callback\n let callback = utils.patchCallback(span, queryConfig.callback as PostgresCallback);\n\n // If a parent span existed, bind the callback\n if (parentSpan) {\n callback = bindCallbackToSpan(parentSpan, callback);\n }\n\n (args[0] as { callback?: PostgresCallback }).callback = callback;\n }\n }\n\n let result: unknown;\n try {\n result = original.apply(this, args as never);\n } catch (e: unknown) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: utils.getErrorMessage(e) });\n span.end();\n throw e;\n }\n\n // Bind promise to parent span and end the span\n if (result instanceof Promise) {\n return result\n .then((result: unknown) => {\n span.end();\n return result;\n })\n .catch((error: unknown) => {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: utils.getErrorMessage(error) });\n span.end();\n return Promise.reject(error);\n });\n }\n\n // else returns void\n return result; // void\n };\n };\n }\n\n private _getPoolConnectPatch() {\n const plugin = this;\n return (originalConnect: (...args: any[]) => any) => {\n return function connect(this: PgPoolExtended, callback?: PgPoolCallback) {\n if (utils.shouldSkipInstrumentation() || plugin.getConfig().ignoreConnectSpans) {\n return originalConnect.call(this, callback);\n }\n\n const span = startInactiveSpan({\n name: SpanNames.POOL_CONNECT,\n kind: SpanKind.CLIENT,\n attributes: utils.getSemanticAttributesFromPoolConnection(this.options),\n });\n\n let cb = callback;\n if (cb) {\n const parentSpan = getActiveSpan();\n cb = utils.patchCallbackPGPool(span, cb);\n // If a parent span exists, bind the callback\n if (parentSpan) {\n cb = bindCallbackToSpan(parentSpan, cb);\n }\n }\n\n const connectResult: unknown = withActiveSpan(span, () => {\n return originalConnect.call(this, cb);\n });\n\n return handleConnectResult(span, connectResult);\n };\n };\n }\n}\n\nfunction handleConnectResult(span: Span, connectResult: unknown): unknown {\n if (!(connectResult instanceof Promise)) {\n return connectResult;\n }\n\n const connectResultPromise = connectResult as Promise<unknown>;\n // The caller's continuation after `await client.connect()` keeps its trace context via the\n // SDK's async context propagation, so we don't need to re-bind the returned promise.\n return connectResultPromise\n .then(result => {\n span.end();\n return result;\n })\n .catch((error: unknown) => {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: utils.getErrorMessage(error) });\n span.end();\n return Promise.reject(error);\n });\n}\n"],"names":["utils.shouldSkipInstrumentation","utils.getSemanticAttributesFromConnection","utils.patchClientConnectCallback","utils.isObjectWithTextString","utils.handleConfigQuery","utils.patchCallback","utils.getErrorMessage","result","utils.getSemanticAttributesFromPoolConnection","utils.patchCallbackPGPool"],"mappings":";;;;;;;AA8BA,MAAM,YAAA,GAAe,4BAAA;AAErB,SAAS,qBAAqB,MAAA,EAAkB;AAC9C,EAAA,OAAO,OAAO,MAAA,CAAO,WAAW,CAAA,KAAM,QAAA,GAClC,OAAO,OAAA,GACP,MAAA;AACN;AAQA,SAAS,kBAAA,CAAsD,YAAkB,QAAA,EAAgB;AAC/F,EAAA,OAAO,YAA4B,IAAA,EAAsB;AACvD,IAAA,OAAO,eAAe,UAAA,EAAY,MAAM,SAAS,KAAA,CAAM,IAAA,EAAM,IAAI,CAAC,CAAA;AAAA,EACpE,CAAA;AACF;AAEO,MAAM,0BAA0B,mBAAA,CAA6C;AAAA,EAC3E,WAAA,CAAY,MAAA,GAAkC,EAAC,EAAG;AACvD,IAAA,KAAA,CAAM,YAAA,EAAc,aAAa,MAAM,CAAA;AAAA,EACzC;AAAA,EAEU,IAAA,GAA8C;AACtD,IAAA,MAAM,qBAAA,GAAwB,CAAC,YAAY,CAAA;AAC3C,IAAA,MAAM,0BAAA,GAA6B,CAAC,YAAY,CAAA;AAEhD,IAAA,MAAM,uBAAuB,IAAI,6BAAA;AAAA,MAC/B,yBAAA;AAAA,MACA,qBAAA;AAAA,MACA,IAAA,CAAK,cAAA,CAAe,IAAA,CAAK,IAAI,CAAA;AAAA,MAC7B,IAAA,CAAK,gBAAA,CAAiB,IAAA,CAAK,IAAI;AAAA,KACjC;AAEA,IAAA,MAAM,iBAAiB,IAAI,6BAAA;AAAA,MACzB,kBAAA;AAA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ACJ,KAAK,CAAA,MAAA,KAAU;AACd,IAAA,IAAA,CAAK,GAAA,EAAI;AACT,IAAA,OAAO,MAAA;AAAA,EACT,CAAC,CAAA,CACA,KAAA,CAAM,CAAC,KAAA,KAAmB;AACzB,IAAA,IAAA,CAAK,SAAA,CAAU,EAAE,IAAA,EAAM,iBAAA,EAAmB,SAASH,eAAM,CAAgB,KAAK,CAAA,EAAG,CAAA;AACjF,IAAA,IAAA,CAAK,GAAA,EAAI;AACT,IAAA,OAAO,OAAA,CAAQ,OAAO,KAAK,CAAA;AAAA,EAC7B,CAAC,CAAA;AACL;;;;"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
const ATTR_DB_CLIENT_CONNECTION_POOL_NAME = "db.client.connection.pool.name";
|
|
2
|
-
const ATTR_DB_CLIENT_CONNECTION_STATE = "db.client.connection.state";
|
|
3
1
|
const ATTR_DB_CONNECTION_STRING = "db.connection_string";
|
|
4
2
|
const ATTR_DB_NAME = "db.name";
|
|
5
3
|
const ATTR_DB_STATEMENT = "db.statement";
|
|
@@ -7,11 +5,7 @@ const ATTR_DB_SYSTEM = "db.system";
|
|
|
7
5
|
const ATTR_DB_USER = "db.user";
|
|
8
6
|
const ATTR_NET_PEER_NAME = "net.peer.name";
|
|
9
7
|
const ATTR_NET_PEER_PORT = "net.peer.port";
|
|
10
|
-
const DB_CLIENT_CONNECTION_STATE_VALUE_IDLE = "idle";
|
|
11
|
-
const DB_CLIENT_CONNECTION_STATE_VALUE_USED = "used";
|
|
12
8
|
const DB_SYSTEM_VALUE_POSTGRESQL = "postgresql";
|
|
13
|
-
const METRIC_DB_CLIENT_CONNECTION_COUNT = "db.client.connection.count";
|
|
14
|
-
const METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS = "db.client.connection.pending_requests";
|
|
15
9
|
|
|
16
|
-
export {
|
|
10
|
+
export { ATTR_DB_CONNECTION_STRING, ATTR_DB_NAME, ATTR_DB_STATEMENT, ATTR_DB_SYSTEM, ATTR_DB_USER, ATTR_NET_PEER_NAME, ATTR_NET_PEER_PORT, DB_SYSTEM_VALUE_POSTGRESQL };
|
|
17
11
|
//# sourceMappingURL=semconv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/postgres/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n
|
|
1
|
+
{"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/postgres/vendored/semconv.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-pg\n * - Upstream version: @opentelemetry/instrumentation-pg@0.70.0\n * - Trimmed to the (old) semantic conventions the SDK actually emits\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * Deprecated, use `server.address`, `server.port` attributes instead.\n *\n * @example \"Server=(localdb)\\\\v11.0;Integrated Security=true;\"\n *\n * @deprecated Replaced by `server.address` and `server.port`.\n */\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const;\n\n/**\n * Deprecated, use `db.namespace` instead.\n *\n * @example customers\n * @example main\n *\n * @deprecated Replaced by `db.namespace`.\n */\nexport const ATTR_DB_NAME = 'db.name' as const;\n\n/**\n * The database statement being executed.\n *\n * @example SELECT * FROM wuser_table\n * @example SET mykey \"WuValue\"\n *\n * @deprecated Replaced by `db.query.text`.\n */\nexport const ATTR_DB_STATEMENT = 'db.statement' as const;\n\n/**\n * Deprecated, use `db.system.name` instead.\n *\n * @deprecated Replaced by `db.system.name`.\n */\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\n\n/**\n * Deprecated, no replacement at this time.\n *\n * @example readonly_user\n * @example reporting_user\n *\n * @deprecated Removed, no replacement at this time.\n */\nexport const ATTR_DB_USER = 'db.user' as const;\n\n/**\n * Deprecated, use `server.address` on client spans and `client.address` on server spans.\n *\n * @example example.com\n *\n * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.\n */\nexport const ATTR_NET_PEER_NAME = 'net.peer.name' as const;\n\n/**\n * Deprecated, use `server.port` on client spans and `client.port` on server spans.\n *\n * @example 8080\n *\n * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.\n */\nexport const ATTR_NET_PEER_PORT = 'net.peer.port' as const;\n\n/**\n * Enum value \"postgresql\" for attribute {@link ATTR_DB_SYSTEM}.\n */\nexport const DB_SYSTEM_VALUE_POSTGRESQL = 'postgresql' as const;\n"],"names":[],"mappings":"AAuBO,MAAM,yBAAA,GAA4B;AAUlC,MAAM,YAAA,GAAe;AAUrB,MAAM,iBAAA,GAAoB;AAO1B,MAAM,cAAA,GAAiB;AAUvB,MAAM,YAAA,GAAe;AASrB,MAAM,kBAAA,GAAqB;AAS3B,MAAM,kBAAA,GAAqB;AAK3B,MAAM,0BAAA,GAA6B;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SpanKind } from '@opentelemetry/api';
|
|
2
|
+
import { getActiveSpan, SPAN_STATUS_ERROR, startInactiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
|
|
2
3
|
import { AttributeNames } from './enums/AttributeNames.js';
|
|
3
|
-
import { DB_SYSTEM_NAME_VALUE_POSTGRESQL, ATTR_SERVER_PORT, ATTR_SERVER_ADDRESS, ATTR_DB_NAMESPACE, ATTR_DB_SYSTEM_NAME, ATTR_DB_QUERY_TEXT, ATTR_ERROR_TYPE } from '@opentelemetry/semantic-conventions';
|
|
4
|
-
import { DB_SYSTEM_VALUE_POSTGRESQL, ATTR_NET_PEER_PORT, ATTR_NET_PEER_NAME, ATTR_DB_USER, ATTR_DB_CONNECTION_STRING, ATTR_DB_NAME, ATTR_DB_SYSTEM, ATTR_DB_STATEMENT, DB_CLIENT_CONNECTION_STATE_VALUE_USED, ATTR_DB_CLIENT_CONNECTION_POOL_NAME, ATTR_DB_CLIENT_CONNECTION_STATE, DB_CLIENT_CONNECTION_STATE_VALUE_IDLE } from './semconv.js';
|
|
5
|
-
import { SemconvStability, safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';
|
|
6
4
|
import { SpanNames } from './enums/SpanNames.js';
|
|
5
|
+
import { DB_SYSTEM_VALUE_POSTGRESQL, ATTR_NET_PEER_PORT, ATTR_NET_PEER_NAME, ATTR_DB_USER, ATTR_DB_CONNECTION_STRING, ATTR_DB_NAME, ATTR_DB_SYSTEM, ATTR_DB_STATEMENT } from './semconv.js';
|
|
7
6
|
|
|
7
|
+
const ORIGIN = "auto.db.otel.postgres";
|
|
8
8
|
function getQuerySpanName(dbName, queryConfig) {
|
|
9
9
|
if (!queryConfig) return SpanNames.QUERY_PREFIX;
|
|
10
10
|
const command = typeof queryConfig.name === "string" && queryConfig.name ? queryConfig.name : parseNormalizedOperationName(queryConfig.text);
|
|
@@ -23,7 +23,7 @@ function parseAndMaskConnectionString(connectionString) {
|
|
|
23
23
|
url.username = "";
|
|
24
24
|
url.password = "";
|
|
25
25
|
return url.toString();
|
|
26
|
-
} catch
|
|
26
|
+
} catch {
|
|
27
27
|
return "postgresql://localhost:5432/";
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -42,203 +42,87 @@ function getPort(port) {
|
|
|
42
42
|
}
|
|
43
43
|
return void 0;
|
|
44
44
|
}
|
|
45
|
-
function getSemanticAttributesFromConnection(params
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// required
|
|
56
|
-
[ATTR_NET_PEER_PORT]: getPort(params.port)
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
if (semconvStability & SemconvStability.STABLE) {
|
|
60
|
-
attributes = {
|
|
61
|
-
...attributes,
|
|
62
|
-
[ATTR_DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_POSTGRESQL,
|
|
63
|
-
[ATTR_DB_NAMESPACE]: params.namespace,
|
|
64
|
-
[ATTR_SERVER_ADDRESS]: params.host,
|
|
65
|
-
[ATTR_SERVER_PORT]: getPort(params.port)
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
return attributes;
|
|
45
|
+
function getSemanticAttributesFromConnection(params) {
|
|
46
|
+
return {
|
|
47
|
+
[ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL,
|
|
48
|
+
[ATTR_DB_NAME]: params.database,
|
|
49
|
+
[ATTR_DB_CONNECTION_STRING]: getConnectionString(params),
|
|
50
|
+
[ATTR_DB_USER]: params.user,
|
|
51
|
+
[ATTR_NET_PEER_NAME]: params.host,
|
|
52
|
+
// required
|
|
53
|
+
[ATTR_NET_PEER_PORT]: getPort(params.port)
|
|
54
|
+
};
|
|
69
55
|
}
|
|
70
|
-
function getSemanticAttributesFromPoolConnection(params
|
|
56
|
+
function getSemanticAttributesFromPoolConnection(params) {
|
|
71
57
|
let url;
|
|
72
58
|
try {
|
|
73
59
|
url = params.connectionString ? new URL(params.connectionString) : void 0;
|
|
74
|
-
} catch
|
|
60
|
+
} catch {
|
|
75
61
|
url = void 0;
|
|
76
62
|
}
|
|
77
|
-
|
|
63
|
+
return {
|
|
78
64
|
[AttributeNames.IDLE_TIMEOUT_MILLIS]: params.idleTimeoutMillis,
|
|
79
|
-
[AttributeNames.MAX_CLIENT]: params.maxClient
|
|
65
|
+
[AttributeNames.MAX_CLIENT]: params.maxClient,
|
|
66
|
+
[ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL,
|
|
67
|
+
[ATTR_DB_NAME]: url?.pathname.slice(1) ?? params.database,
|
|
68
|
+
[ATTR_DB_CONNECTION_STRING]: getConnectionString(params),
|
|
69
|
+
[ATTR_NET_PEER_NAME]: url?.hostname ?? params.host,
|
|
70
|
+
[ATTR_NET_PEER_PORT]: Number(url?.port) || getPort(params.port),
|
|
71
|
+
[ATTR_DB_USER]: url?.username ?? params.user
|
|
80
72
|
};
|
|
81
|
-
if (semconvStability & SemconvStability.OLD) {
|
|
82
|
-
attributes = {
|
|
83
|
-
...attributes,
|
|
84
|
-
[ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL,
|
|
85
|
-
[ATTR_DB_NAME]: url?.pathname.slice(1) ?? params.database,
|
|
86
|
-
[ATTR_DB_CONNECTION_STRING]: getConnectionString(params),
|
|
87
|
-
[ATTR_NET_PEER_NAME]: url?.hostname ?? params.host,
|
|
88
|
-
[ATTR_NET_PEER_PORT]: Number(url?.port) || getPort(params.port),
|
|
89
|
-
[ATTR_DB_USER]: url?.username ?? params.user
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
if (semconvStability & SemconvStability.STABLE) {
|
|
93
|
-
attributes = {
|
|
94
|
-
...attributes,
|
|
95
|
-
[ATTR_DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_POSTGRESQL,
|
|
96
|
-
[ATTR_DB_NAMESPACE]: params.namespace,
|
|
97
|
-
[ATTR_SERVER_ADDRESS]: url?.hostname ?? params.host,
|
|
98
|
-
[ATTR_SERVER_PORT]: Number(url?.port) || getPort(params.port)
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
return attributes;
|
|
102
73
|
}
|
|
103
|
-
function shouldSkipInstrumentation(
|
|
104
|
-
return
|
|
74
|
+
function shouldSkipInstrumentation() {
|
|
75
|
+
return getActiveSpan() === void 0;
|
|
105
76
|
}
|
|
106
|
-
function handleConfigQuery(
|
|
77
|
+
function handleConfigQuery(queryConfig) {
|
|
107
78
|
const { connectionParameters } = this;
|
|
108
79
|
const dbName = connectionParameters.database;
|
|
109
80
|
const spanName = getQuerySpanName(dbName, queryConfig);
|
|
110
|
-
const span =
|
|
81
|
+
const span = startInactiveSpan({
|
|
82
|
+
name: spanName,
|
|
111
83
|
kind: SpanKind.CLIENT,
|
|
112
|
-
attributes:
|
|
84
|
+
attributes: {
|
|
85
|
+
...getSemanticAttributesFromConnection(connectionParameters),
|
|
86
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
|
|
87
|
+
}
|
|
113
88
|
});
|
|
114
89
|
if (!queryConfig) {
|
|
115
90
|
return span;
|
|
116
91
|
}
|
|
117
92
|
if (queryConfig.text) {
|
|
118
|
-
|
|
119
|
-
span.setAttribute(ATTR_DB_STATEMENT, queryConfig.text);
|
|
120
|
-
}
|
|
121
|
-
if (semconvStability & SemconvStability.STABLE) {
|
|
122
|
-
span.setAttribute(ATTR_DB_QUERY_TEXT, queryConfig.text);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
if (instrumentationConfig.enhancedDatabaseReporting && Array.isArray(queryConfig.values)) {
|
|
126
|
-
try {
|
|
127
|
-
const convertedValues = queryConfig.values.map((value) => {
|
|
128
|
-
if (value == null) {
|
|
129
|
-
return "null";
|
|
130
|
-
} else if (value instanceof Buffer) {
|
|
131
|
-
return value.toString();
|
|
132
|
-
} else if (typeof value === "object") {
|
|
133
|
-
if (typeof value.toPostgres === "function") {
|
|
134
|
-
return value.toPostgres();
|
|
135
|
-
}
|
|
136
|
-
return JSON.stringify(value);
|
|
137
|
-
} else {
|
|
138
|
-
return value.toString();
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
span.setAttribute(AttributeNames.PG_VALUES, convertedValues);
|
|
142
|
-
} catch (e) {
|
|
143
|
-
diag.error("failed to stringify ", queryConfig.values, e);
|
|
144
|
-
}
|
|
93
|
+
span.setAttribute(ATTR_DB_STATEMENT, queryConfig.text);
|
|
145
94
|
}
|
|
146
95
|
if (typeof queryConfig.name === "string") {
|
|
147
96
|
span.setAttribute(AttributeNames.PG_PLAN, queryConfig.name);
|
|
148
97
|
}
|
|
149
98
|
return span;
|
|
150
99
|
}
|
|
151
|
-
function
|
|
152
|
-
if (typeof config.responseHook === "function") {
|
|
153
|
-
safeExecuteInTheMiddle(
|
|
154
|
-
() => {
|
|
155
|
-
config.responseHook(span, {
|
|
156
|
-
data: pgResult
|
|
157
|
-
});
|
|
158
|
-
},
|
|
159
|
-
(err) => {
|
|
160
|
-
if (err) {
|
|
161
|
-
diag.error("Error running response hook", err);
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
true
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
function patchCallback(instrumentationConfig, span, cb, attributes, recordDuration) {
|
|
100
|
+
function patchCallback(span, cb) {
|
|
169
101
|
return function patchedCallback(err, res) {
|
|
170
102
|
if (err) {
|
|
171
|
-
|
|
172
|
-
attributes[ATTR_ERROR_TYPE] = err["code"];
|
|
173
|
-
}
|
|
174
|
-
if (err instanceof Error) {
|
|
175
|
-
span.recordException(sanitizedErrorMessage(err));
|
|
176
|
-
}
|
|
177
|
-
span.setStatus({
|
|
178
|
-
code: SpanStatusCode.ERROR,
|
|
179
|
-
message: err.message
|
|
180
|
-
});
|
|
181
|
-
} else {
|
|
182
|
-
handleExecutionResult(instrumentationConfig, span, res);
|
|
103
|
+
span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });
|
|
183
104
|
}
|
|
184
|
-
recordDuration();
|
|
185
105
|
span.end();
|
|
186
106
|
cb.call(this, err, res);
|
|
187
107
|
};
|
|
188
108
|
}
|
|
189
|
-
function getPoolName(pool) {
|
|
190
|
-
let poolName = "";
|
|
191
|
-
poolName += (pool?.host ? `${pool.host}` : "unknown_host") + ":";
|
|
192
|
-
poolName += (pool?.port ? `${pool.port}` : "unknown_port") + "/";
|
|
193
|
-
poolName += pool?.database ? `${pool.database}` : "unknown_database";
|
|
194
|
-
return poolName.trim();
|
|
195
|
-
}
|
|
196
|
-
function updateCounter(poolName, pool, connectionCount, connectionPendingRequests, latestCounter) {
|
|
197
|
-
const all = pool.totalCount;
|
|
198
|
-
const pending = pool.waitingCount;
|
|
199
|
-
const idle = pool.idleCount;
|
|
200
|
-
const used = all - idle;
|
|
201
|
-
connectionCount.add(used - latestCounter.used, {
|
|
202
|
-
[ATTR_DB_CLIENT_CONNECTION_STATE]: DB_CLIENT_CONNECTION_STATE_VALUE_USED,
|
|
203
|
-
[ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName
|
|
204
|
-
});
|
|
205
|
-
connectionCount.add(idle - latestCounter.idle, {
|
|
206
|
-
[ATTR_DB_CLIENT_CONNECTION_STATE]: DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,
|
|
207
|
-
[ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName
|
|
208
|
-
});
|
|
209
|
-
connectionPendingRequests.add(pending - latestCounter.pending, {
|
|
210
|
-
[ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName
|
|
211
|
-
});
|
|
212
|
-
return { used, idle, pending };
|
|
213
|
-
}
|
|
214
109
|
function patchCallbackPGPool(span, cb) {
|
|
215
110
|
return function patchedCallback(err, res, done) {
|
|
216
111
|
if (err) {
|
|
217
|
-
|
|
218
|
-
span.recordException(sanitizedErrorMessage(err));
|
|
219
|
-
}
|
|
220
|
-
span.setStatus({
|
|
221
|
-
code: SpanStatusCode.ERROR,
|
|
222
|
-
message: err.message
|
|
223
|
-
});
|
|
112
|
+
span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });
|
|
224
113
|
}
|
|
225
114
|
span.end();
|
|
226
115
|
cb.call(this, err, res, done);
|
|
227
116
|
};
|
|
228
117
|
}
|
|
229
118
|
function patchClientConnectCallback(span, cb) {
|
|
230
|
-
return function patchedClientConnectCallback(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
span.setStatus({
|
|
236
|
-
code: SpanStatusCode.ERROR,
|
|
237
|
-
message: err.message
|
|
238
|
-
});
|
|
119
|
+
return function patchedClientConnectCallback(...args) {
|
|
120
|
+
const err = args[0];
|
|
121
|
+
if (err instanceof Error) {
|
|
122
|
+
span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });
|
|
239
123
|
}
|
|
240
124
|
span.end();
|
|
241
|
-
cb.apply(this,
|
|
125
|
+
cb.apply(this, args);
|
|
242
126
|
};
|
|
243
127
|
}
|
|
244
128
|
function getErrorMessage(e) {
|
|
@@ -247,11 +131,6 @@ function getErrorMessage(e) {
|
|
|
247
131
|
function isObjectWithTextString(it) {
|
|
248
132
|
return typeof it === "object" && typeof it?.text === "string";
|
|
249
133
|
}
|
|
250
|
-
function sanitizedErrorMessage(error) {
|
|
251
|
-
const name = error?.name ?? "PostgreSQLError";
|
|
252
|
-
const code = error?.code ?? "UNKNOWN";
|
|
253
|
-
return `PostgreSQL error of type '${name}' occurred (code: ${code})`;
|
|
254
|
-
}
|
|
255
134
|
|
|
256
|
-
export { getConnectionString, getErrorMessage,
|
|
135
|
+
export { ORIGIN, getConnectionString, getErrorMessage, getQuerySpanName, getSemanticAttributesFromConnection, getSemanticAttributesFromPoolConnection, handleConfigQuery, isObjectWithTextString, parseAndMaskConnectionString, parseNormalizedOperationName, patchCallback, patchCallbackPGPool, patchClientConnectCallback, shouldSkipInstrumentation };
|
|
257
136
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/postgres/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-pg\n * - Upstream version: @opentelemetry/instrumentation-pg@0.70.0\n * - Types from `pg` package inlined as simplified interfaces\n * - Minor TypeScript strictness adjustments\n */\n/* eslint-disable */\n\nimport {\n context,\n trace,\n Span,\n SpanStatusCode,\n Tracer,\n SpanKind,\n diag,\n UpDownCounter,\n Attributes,\n} from '@opentelemetry/api';\nimport { AttributeNames } from './enums/AttributeNames';\nimport {\n ATTR_ERROR_TYPE,\n ATTR_DB_SYSTEM_NAME,\n ATTR_DB_NAMESPACE,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n ATTR_DB_QUERY_TEXT,\n DB_SYSTEM_NAME_VALUE_POSTGRESQL,\n} from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_DB_CLIENT_CONNECTION_POOL_NAME,\n ATTR_DB_CLIENT_CONNECTION_STATE,\n DB_CLIENT_CONNECTION_STATE_VALUE_USED,\n DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,\n ATTR_DB_SYSTEM,\n ATTR_DB_NAME,\n ATTR_DB_USER,\n DB_SYSTEM_VALUE_POSTGRESQL,\n ATTR_DB_CONNECTION_STRING,\n ATTR_NET_PEER_PORT,\n ATTR_NET_PEER_NAME,\n ATTR_DB_STATEMENT,\n} from './semconv';\nimport {\n PgClientExtended,\n PostgresCallback,\n PgPoolCallback,\n PgPoolExtended,\n PgParsedConnectionParams,\n PgPoolOptionsParams,\n} from './internal-types';\nimport { PgInstrumentationConfig } from './types';\nimport type { PgClient, QueryResult, QueryArrayResult } from './pg-types';\nimport { safeExecuteInTheMiddle, SemconvStability } from '@opentelemetry/instrumentation';\nimport { SpanNames } from './enums/SpanNames';\n\n/**\n * Helper function to get a low cardinality span name from whatever info we have\n * about the query.\n *\n * This is tricky, because we don't have most of the information (table name,\n * operation name, etc) the spec recommends using to build a low-cardinality\n * value w/o parsing. So, we use db.name and assume that, if the query's a named\n * prepared statement, those `name` values will be low cardinality. If we don't\n * have a named prepared statement, we try to parse an operation (despite the\n * spec's warnings).\n *\n * @params dbName The name of the db against which this query is being issued,\n * which could be missing if no db name was given at the time that the\n * connection was established.\n * @params queryConfig Information we have about the query being issued, typed\n * to reflect only the validation we've actually done on the args to\n * `client.query()`. This will be undefined if `client.query()` was called\n * with invalid arguments.\n */\nexport function getQuerySpanName(dbName: string | undefined, queryConfig?: { text: string; name?: unknown }) {\n // NB: when the query config is invalid, we omit the dbName too, so that\n // someone (or some tool) reading the span name doesn't misinterpret the\n // dbName as being a prepared statement or sql commit name.\n if (!queryConfig) return SpanNames.QUERY_PREFIX;\n\n // Either the name of a prepared statement; or an attempted parse\n // of the SQL command, normalized to uppercase; or unknown.\n const command =\n typeof queryConfig.name === 'string' && queryConfig.name\n ? queryConfig.name\n : parseNormalizedOperationName(queryConfig.text);\n\n return `${SpanNames.QUERY_PREFIX}:${command}${dbName ? ` ${dbName}` : ''}`;\n}\n\nexport function parseNormalizedOperationName(queryText: string) {\n // Trim the query text to handle leading/trailing whitespace\n const trimmedQuery = queryText.trim();\n const indexOfFirstSpace = trimmedQuery.indexOf(' ');\n let sqlCommand = indexOfFirstSpace === -1 ? trimmedQuery : trimmedQuery.slice(0, indexOfFirstSpace);\n sqlCommand = sqlCommand.toUpperCase();\n\n // Handle query text being \"COMMIT;\", which has an extra semicolon before the space.\n return sqlCommand.endsWith(';') ? sqlCommand.slice(0, -1) : sqlCommand;\n}\n\nexport function parseAndMaskConnectionString(connectionString: string): string {\n try {\n // Parse the connection string\n const url = new URL(connectionString);\n\n // Remove all auth information (username and password)\n url.username = '';\n url.password = '';\n\n return url.toString();\n } catch (e) {\n // If parsing fails, return a generic connection string\n return 'postgresql://localhost:5432/';\n }\n}\n\nexport function getConnectionString(params: PgParsedConnectionParams | PgPoolOptionsParams) {\n if ('connectionString' in params && params.connectionString) {\n return parseAndMaskConnectionString(params.connectionString);\n }\n const host = params.host || 'localhost';\n const port = params.port || 5432;\n const database = params.database || '';\n return `postgresql://${host}:${port}/${database}`;\n}\n\nfunction getPort(port: number | undefined): number | undefined {\n // Port may be NaN as parseInt() is used on the value, passing null will result in NaN being parsed.\n // https://github.com/brianc/node-postgres/blob/2a8efbee09a284be12748ed3962bc9b816965e36/packages/pg/lib/connection-parameters.js#L66\n if (Number.isInteger(port)) {\n return port;\n }\n\n // Unable to find the default used in pg code, so falling back to 'undefined'.\n return undefined;\n}\n\nexport function getSemanticAttributesFromConnection(\n params: PgParsedConnectionParams,\n semconvStability: SemconvStability,\n) {\n let attributes: Attributes = {};\n\n if (semconvStability & SemconvStability.OLD) {\n attributes = {\n ...attributes,\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL,\n [ATTR_DB_NAME]: params.database,\n [ATTR_DB_CONNECTION_STRING]: getConnectionString(params),\n [ATTR_DB_USER]: params.user,\n [ATTR_NET_PEER_NAME]: params.host, // required\n [ATTR_NET_PEER_PORT]: getPort(params.port),\n };\n }\n if (semconvStability & SemconvStability.STABLE) {\n attributes = {\n ...attributes,\n [ATTR_DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_POSTGRESQL,\n [ATTR_DB_NAMESPACE]: params.namespace,\n [ATTR_SERVER_ADDRESS]: params.host,\n [ATTR_SERVER_PORT]: getPort(params.port),\n };\n }\n\n return attributes;\n}\n\nexport function getSemanticAttributesFromPoolConnection(\n params: PgPoolOptionsParams,\n semconvStability: SemconvStability,\n) {\n let url: URL | undefined;\n try {\n url = params.connectionString ? new URL(params.connectionString) : undefined;\n } catch (e) {\n url = undefined;\n }\n let attributes: Attributes = {\n [AttributeNames.IDLE_TIMEOUT_MILLIS]: params.idleTimeoutMillis,\n [AttributeNames.MAX_CLIENT]: params.maxClient,\n };\n\n if (semconvStability & SemconvStability.OLD) {\n attributes = {\n ...attributes,\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL,\n [ATTR_DB_NAME]: url?.pathname.slice(1) ?? params.database,\n [ATTR_DB_CONNECTION_STRING]: getConnectionString(params),\n [ATTR_NET_PEER_NAME]: url?.hostname ?? params.host,\n [ATTR_NET_PEER_PORT]: Number(url?.port) || getPort(params.port),\n [ATTR_DB_USER]: url?.username ?? params.user,\n };\n }\n if (semconvStability & SemconvStability.STABLE) {\n attributes = {\n ...attributes,\n [ATTR_DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_POSTGRESQL,\n [ATTR_DB_NAMESPACE]: params.namespace,\n [ATTR_SERVER_ADDRESS]: url?.hostname ?? params.host,\n [ATTR_SERVER_PORT]: Number(url?.port) || getPort(params.port),\n };\n }\n\n return attributes;\n}\n\nexport function shouldSkipInstrumentation(instrumentationConfig: PgInstrumentationConfig) {\n return instrumentationConfig.requireParentSpan === true && trace.getSpan(context.active()) === undefined;\n}\n\n// Create a span from our normalized queryConfig object,\n// or return a basic span if no queryConfig was given/could be created.\nexport function handleConfigQuery(\n this: PgClientExtended,\n tracer: Tracer,\n instrumentationConfig: PgInstrumentationConfig,\n semconvStability: SemconvStability,\n queryConfig?: { text: string; values?: unknown; name?: unknown },\n) {\n // Create child span.\n const { connectionParameters } = this;\n const dbName = connectionParameters.database;\n\n const spanName = getQuerySpanName(dbName, queryConfig);\n const span = tracer.startSpan(spanName, {\n kind: SpanKind.CLIENT,\n attributes: getSemanticAttributesFromConnection(connectionParameters, semconvStability),\n });\n\n if (!queryConfig) {\n return span;\n }\n\n // Set attributes\n if (queryConfig.text) {\n if (semconvStability & SemconvStability.OLD) {\n span.setAttribute(ATTR_DB_STATEMENT, queryConfig.text);\n }\n if (semconvStability & SemconvStability.STABLE) {\n span.setAttribute(ATTR_DB_QUERY_TEXT, queryConfig.text);\n }\n }\n\n if (instrumentationConfig.enhancedDatabaseReporting && Array.isArray(queryConfig.values)) {\n try {\n const convertedValues = queryConfig.values.map(value => {\n if (value == null) {\n return 'null';\n } else if (value instanceof Buffer) {\n return value.toString();\n } else if (typeof value === 'object') {\n if (typeof value.toPostgres === 'function') {\n return value.toPostgres();\n }\n return JSON.stringify(value);\n } else {\n //string, number\n return value.toString();\n }\n });\n span.setAttribute(AttributeNames.PG_VALUES, convertedValues);\n } catch (e) {\n diag.error('failed to stringify ', queryConfig.values, e);\n }\n }\n\n // Set plan name attribute, if present\n if (typeof queryConfig.name === 'string') {\n span.setAttribute(AttributeNames.PG_PLAN, queryConfig.name);\n }\n\n return span;\n}\n\nexport function handleExecutionResult(\n config: PgInstrumentationConfig,\n span: Span,\n pgResult: QueryResult | QueryArrayResult | unknown,\n) {\n if (typeof config.responseHook === 'function') {\n safeExecuteInTheMiddle(\n () => {\n config.responseHook!(span, {\n data: pgResult as QueryResult | QueryArrayResult,\n });\n },\n err => {\n if (err) {\n diag.error('Error running response hook', err);\n }\n },\n true,\n );\n }\n}\n\nexport function patchCallback(\n instrumentationConfig: PgInstrumentationConfig,\n span: Span,\n cb: PostgresCallback,\n attributes: Attributes,\n recordDuration: { (): void },\n): PostgresCallback {\n return function patchedCallback(this: PgClientExtended, err: Error, res: object) {\n if (err) {\n if (Object.prototype.hasOwnProperty.call(err, 'code')) {\n attributes[ATTR_ERROR_TYPE] = (err as any)['code'];\n }\n if (err instanceof Error) {\n span.recordException(sanitizedErrorMessage(err));\n }\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n } else {\n handleExecutionResult(instrumentationConfig, span, res);\n }\n\n recordDuration();\n span.end();\n cb.call(this, err, res);\n };\n}\n\nexport function getPoolName(pool: PgPoolOptionsParams): string {\n let poolName = '';\n poolName += (pool?.host ? `${pool.host}` : 'unknown_host') + ':';\n poolName += (pool?.port ? `${pool.port}` : 'unknown_port') + '/';\n poolName += pool?.database ? `${pool.database}` : 'unknown_database';\n\n return poolName.trim();\n}\n\nexport interface poolConnectionsCounter {\n used: number;\n idle: number;\n pending: number;\n}\n\nexport function updateCounter(\n poolName: string,\n pool: PgPoolExtended,\n connectionCount: UpDownCounter,\n connectionPendingRequests: UpDownCounter,\n latestCounter: poolConnectionsCounter,\n): poolConnectionsCounter {\n const all = pool.totalCount;\n const pending = pool.waitingCount;\n const idle = pool.idleCount;\n const used = all - idle;\n\n connectionCount.add(used - latestCounter.used, {\n [ATTR_DB_CLIENT_CONNECTION_STATE]: DB_CLIENT_CONNECTION_STATE_VALUE_USED,\n [ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName,\n });\n\n connectionCount.add(idle - latestCounter.idle, {\n [ATTR_DB_CLIENT_CONNECTION_STATE]: DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,\n [ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName,\n });\n\n connectionPendingRequests.add(pending - latestCounter.pending, {\n [ATTR_DB_CLIENT_CONNECTION_POOL_NAME]: poolName,\n });\n\n return { used: used, idle: idle, pending: pending };\n}\n\nexport function patchCallbackPGPool(span: Span, cb: PgPoolCallback): PgPoolCallback {\n return function patchedCallback(this: PgPoolExtended, err: Error, res: object, done: any) {\n if (err) {\n if (err instanceof Error) {\n span.recordException(sanitizedErrorMessage(err));\n }\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n }\n span.end();\n cb.call(this, err, res, done);\n };\n}\n\nexport function patchClientConnectCallback(span: Span, cb: Function): Function {\n return function patchedClientConnectCallback(this: PgClient, err: Error) {\n if (err) {\n if (err instanceof Error) {\n span.recordException(sanitizedErrorMessage(err));\n }\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n }\n span.end();\n cb.apply(this, arguments);\n };\n}\n\n/**\n * Attempt to get a message string from a thrown value, while being quite\n * defensive, to recognize the fact that, in JS, any kind of value (even\n * primitives) can be thrown.\n */\nexport function getErrorMessage(e: unknown) {\n return typeof e === 'object' && e !== null && 'message' in e\n ? String((e as { message?: unknown }).message)\n : undefined;\n}\n\nexport function isObjectWithTextString(it: unknown): it is ObjectWithText {\n return typeof it === 'object' && typeof (it as null | { text?: unknown })?.text === 'string';\n}\n\nexport type ObjectWithText = {\n text: string;\n [k: string]: unknown;\n};\n\n/**\n * Generates a sanitized message for the error.\n * Only includes the error type and PostgreSQL error code, omitting any sensitive details.\n */\nexport function sanitizedErrorMessage(error: unknown): string {\n const name = (error as any)?.name ?? 'PostgreSQLError';\n const code = (error as any)?.code ?? 'UNKNOWN';\n\n return `PostgreSQL error of type '${name}' occurred (code: ${code})`;\n}\n"],"names":[],"mappings":";;;;;;;AA0FO,SAAS,gBAAA,CAAiB,QAA4B,WAAA,EAAgD;AAI3G,EAAA,IAAI,CAAC,WAAA,EAAa,OAAO,SAAA,CAAU,YAAA;AAInC,EAAA,MAAM,OAAA,GACJ,OAAO,WAAA,CAAY,IAAA,KAAS,QAAA,IAAY,WAAA,CAAY,IAAA,GAChD,WAAA,CAAY,IAAA,GACZ,4BAAA,CAA6B,WAAA,CAAY,IAAI,CAAA;AAEnD,EAAA,OAAO,CAAA,EAAG,SAAA,CAAU,YAAY,CAAA,CAAA,EAAI,OAAO,GAAG,MAAA,GAAS,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,GAAK,EAAE,CAAA,CAAA;AAC1E;AAEO,SAAS,6BAA6B,SAAA,EAAmB;AAE9D,EAAA,MAAM,YAAA,GAAe,UAAU,IAAA,EAAK;AACpC,EAAA,MAAM,iBAAA,GAAoB,YAAA,CAAa,OAAA,CAAQ,GAAG,CAAA;AAClD,EAAA,IAAI,aAAa,iBAAA,KAAsB,EAAA,GAAK,eAAe,YAAA,CAAa,KAAA,CAAM,GAAG,iBAAiB,CAAA;AAClG,EAAA,UAAA,GAAa,WAAW,WAAA,EAAY;AAGpC,EAAA,OAAO,UAAA,CAAW,SAAS,GAAG,CAAA,GAAI,WAAW,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA,GAAI,UAAA;AAC9D;AAEO,SAAS,6BAA6B,gBAAA,EAAkC;AAC7E,EAAA,IAAI;AAEF,IAAA,MAAM,GAAA,GAAM,IAAI,GAAA,CAAI,gBAAgB,CAAA;AAGpC,IAAA,GAAA,CAAI,QAAA,GAAW,EA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AC3C,MAAA;AACN;AAEO,SAAS,uBAAuB,EAAA,EAAmC;AACxE,EAAA,OAAO,OAAO,EAAA,KAAO,QAAA,IAAY,OAAQ,IAAkC,IAAA,KAAS,QAAA;AACtF;AAWO,SAAS,sBAAsB,KAAA,EAAwB;AAC5D,EAAA,MAAM,IAAA,GAAQ,OAAe,IAAA,IAAQ,iBAAA;AACrC,EAAA,MAAM,IAAA,GAAQ,OAAe,IAAA,IAAQ,SAAA;AAErC,EAAA,OAAO,CAAA,0BAAA,EAA6B,IAAI,CAAA,kBAAA,EAAqB,IAAI,CAAA,CAAA,CAAA;AACnE;;;;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/postgres/vendored/utils.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-pg\n * - Upstream version: @opentelemetry/instrumentation-pg@0.70.0\n * - Types from `pg` package inlined as simplified interfaces\n * - Refactored to use Sentry's span APIs instead of OpenTelemetry tracing APIs\n */\n\nimport { SpanKind } from '@opentelemetry/api';\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport { getActiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, startInactiveSpan } from '@sentry/core';\nimport { AttributeNames } from './enums/AttributeNames';\nimport { SpanNames } from './enums/SpanNames';\nimport type {\n PgClientExtended,\n PgParsedConnectionParams,\n PgPoolCallback,\n PgPoolExtended,\n PgPoolOptionsParams,\n PostgresCallback,\n} from './internal-types';\nimport type { PgClient } from './pg-types';\nimport {\n ATTR_DB_CONNECTION_STRING,\n ATTR_DB_NAME,\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_DB_USER,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n DB_SYSTEM_VALUE_POSTGRESQL,\n} from './semconv';\n\n/* oxlint-disable typescript/no-deprecated */\n\nexport const ORIGIN = 'auto.db.otel.postgres';\n\n/**\n * Helper function to get a low cardinality span name from whatever info we have\n * about the query.\n *\n * This is tricky, because we don't have most of the information (table name,\n * operation name, etc) the spec recommends using to build a low-cardinality\n * value w/o parsing. So, we use db.name and assume that, if the query's a named\n * prepared statement, those `name` values will be low cardinality. If we don't\n * have a named prepared statement, we try to parse an operation (despite the\n * spec's warnings).\n *\n * @params dbName The name of the db against which this query is being issued,\n * which could be missing if no db name was given at the time that the\n * connection was established.\n * @params queryConfig Information we have about the query being issued, typed\n * to reflect only the validation we've actually done on the args to\n * `client.query()`. This will be undefined if `client.query()` was called\n * with invalid arguments.\n */\nexport function getQuerySpanName(dbName: string | undefined, queryConfig?: { text: string; name?: unknown }): string {\n // NB: when the query config is invalid, we omit the dbName too, so that\n // someone (or some tool) reading the span name doesn't misinterpret the\n // dbName as being a prepared statement or sql commit name.\n if (!queryConfig) return SpanNames.QUERY_PREFIX;\n\n // Either the name of a prepared statement; or an attempted parse\n // of the SQL command, normalized to uppercase; or unknown.\n const command =\n typeof queryConfig.name === 'string' && queryConfig.name\n ? queryConfig.name\n : parseNormalizedOperationName(queryConfig.text);\n\n return `${SpanNames.QUERY_PREFIX}:${command}${dbName ? ` ${dbName}` : ''}`;\n}\n\nexport function parseNormalizedOperationName(queryText: string): string {\n // Trim the query text to handle leading/trailing whitespace\n const trimmedQuery = queryText.trim();\n const indexOfFirstSpace = trimmedQuery.indexOf(' ');\n let sqlCommand = indexOfFirstSpace === -1 ? trimmedQuery : trimmedQuery.slice(0, indexOfFirstSpace);\n sqlCommand = sqlCommand.toUpperCase();\n\n // Handle query text being \"COMMIT;\", which has an extra semicolon before the space.\n return sqlCommand.endsWith(';') ? sqlCommand.slice(0, -1) : sqlCommand;\n}\n\nexport function parseAndMaskConnectionString(connectionString: string): string {\n try {\n // Parse the connection string\n const url = new URL(connectionString);\n\n // Remove all auth information (username and password)\n url.username = '';\n url.password = '';\n\n return url.toString();\n } catch {\n // If parsing fails, return a generic connection string\n return 'postgresql://localhost:5432/';\n }\n}\n\nexport function getConnectionString(params: PgParsedConnectionParams | PgPoolOptionsParams): string {\n if ('connectionString' in params && params.connectionString) {\n return parseAndMaskConnectionString(params.connectionString);\n }\n const host = params.host || 'localhost';\n const port = params.port || 5432;\n const database = params.database || '';\n return `postgresql://${host}:${port}/${database}`;\n}\n\nfunction getPort(port: number | undefined): number | undefined {\n // Port may be NaN as parseInt() is used on the value, passing null will result in NaN being parsed.\n // https://github.com/brianc/node-postgres/blob/2a8efbee09a284be12748ed3962bc9b816965e36/packages/pg/lib/connection-parameters.js#L66\n if (Number.isInteger(port)) {\n return port;\n }\n\n // Unable to find the default used in pg code, so falling back to 'undefined'.\n return undefined;\n}\n\nexport function getSemanticAttributesFromConnection(params: PgParsedConnectionParams): SpanAttributes {\n return {\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL,\n [ATTR_DB_NAME]: params.database,\n [ATTR_DB_CONNECTION_STRING]: getConnectionString(params),\n [ATTR_DB_USER]: params.user,\n [ATTR_NET_PEER_NAME]: params.host, // required\n [ATTR_NET_PEER_PORT]: getPort(params.port),\n };\n}\n\nexport function getSemanticAttributesFromPoolConnection(params: PgPoolOptionsParams): SpanAttributes {\n let url: URL | undefined;\n try {\n url = params.connectionString ? new URL(params.connectionString) : undefined;\n } catch {\n url = undefined;\n }\n\n return {\n [AttributeNames.IDLE_TIMEOUT_MILLIS]: params.idleTimeoutMillis,\n [AttributeNames.MAX_CLIENT]: params.maxClient,\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_POSTGRESQL,\n [ATTR_DB_NAME]: url?.pathname.slice(1) ?? params.database,\n [ATTR_DB_CONNECTION_STRING]: getConnectionString(params),\n [ATTR_NET_PEER_NAME]: url?.hostname ?? params.host,\n [ATTR_NET_PEER_PORT]: Number(url?.port) || getPort(params.port),\n [ATTR_DB_USER]: url?.username ?? params.user,\n };\n}\n\n/**\n * The SDK always requires a parent span (it sets `requireParentSpan: true`), so\n * we only instrument when there is an active span to parent the new span under.\n */\nexport function shouldSkipInstrumentation(): boolean {\n return getActiveSpan() === undefined;\n}\n\n// Create an (inactive) span from our normalized queryConfig object,\n// or return a basic span if no queryConfig was given/could be created.\nexport function handleConfigQuery(\n this: PgClientExtended,\n queryConfig?: { text: string; values?: unknown; name?: unknown },\n): Span {\n // Create child span.\n const { connectionParameters } = this;\n const dbName = connectionParameters.database;\n\n const spanName = getQuerySpanName(dbName, queryConfig);\n const span = startInactiveSpan({\n name: spanName,\n kind: SpanKind.CLIENT,\n attributes: {\n ...getSemanticAttributesFromConnection(connectionParameters),\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n },\n });\n\n if (!queryConfig) {\n return span;\n }\n\n // Set attributes\n if (queryConfig.text) {\n span.setAttribute(ATTR_DB_STATEMENT, queryConfig.text);\n }\n\n // Set plan name attribute, if present\n if (typeof queryConfig.name === 'string') {\n span.setAttribute(AttributeNames.PG_PLAN, queryConfig.name);\n }\n\n return span;\n}\n\nexport function patchCallback(span: Span, cb: PostgresCallback): PostgresCallback {\n return function patchedCallback(this: PgClientExtended, err: Error, res: object) {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });\n }\n span.end();\n cb.call(this, err, res);\n };\n}\n\nexport function patchCallbackPGPool(span: Span, cb: PgPoolCallback): PgPoolCallback {\n return function patchedCallback(this: PgPoolExtended, err: Error, res: object, done: any) {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });\n }\n span.end();\n cb.call(this, err, res, done);\n };\n}\n\nexport function patchClientConnectCallback(span: Span, cb: (...args: unknown[]) => void): (...args: unknown[]) => void {\n return function patchedClientConnectCallback(this: PgClient, ...args: unknown[]) {\n const err = args[0];\n if (err instanceof Error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });\n }\n span.end();\n cb.apply(this, args);\n };\n}\n\n/**\n * Attempt to get a message string from a thrown value, while being quite\n * defensive, to recognize the fact that, in JS, any kind of value (even\n * primitives) can be thrown.\n */\nexport function getErrorMessage(e: unknown): string | undefined {\n return typeof e === 'object' && e !== null && 'message' in e\n ? String((e as { message?: unknown }).message)\n : undefined;\n}\n\nexport function isObjectWithTextString(it: unknown): it is ObjectWithText {\n return typeof it === 'object' && typeof (it as null | { text?: unknown })?.text === 'string';\n}\n\nexport type ObjectWithText = {\n text: string;\n [k: string]: unknown;\n};\n"],"names":[],"mappings":";;;;;;AAsCO,MAAM,MAAA,GAAS;AAqBf,SAAS,gBAAA,CAAiB,QAA4B,WAAA,EAAwD;AAInH,EAAA,IAAI,CAAC,WAAA,EAAa,OAAO,SAAA,CAAU,YAAA;AAInC,EAAA,MAAM,OAAA,GACJ,OAAO,WAAA,CAAY,IAAA,KAAS,QAAA,IAAY,WAAA,CAAY,IAAA,GAChD,WAAA,CAAY,IAAA,GACZ,4BAAA,CAA6B,WAAA,CAAY,IAAI,CAAA;AAEnD,EAAA,OAAO,CAAA,EAAG,SAAA,CAAU,YAAY,CAAA,CAAA,EAAI,OAAO,GAAG,MAAA,GAAS,CAAA,CAAA,EAAI,MAAM,CAAA,CAAA,GAAK,EAAE,CAAA,CAAA;AAC1E;AAEO,SAAS,6BAA6B,SAAA,EAA2B;AAEtE,EAAA,MAAM,YAAA,GAAe,UAAU,IAAA,EAAK;AACpC,EAAA,MAAM,iBAAA,GAAoB,YAAA,CAAa,OAAA,CAAQ,GAAG,CAAA;AAClD,EAAA,IAAI,aAAa,iBAAA,KAAsB,EAAA,GAAK,eAAe,YAAA,CAAa,KAAA,CAAM,GAAG,iBAAiB,CAAA;AAClG,EAAA,UAAA,GAAa,WAAW,WAAA,EAAY;AAGpC,EAAA,OAAO,UAAA,CAAW,SAAS,GAAG,CAAA,GAAI,WAAW,KAAA,CAAM,CAAA,EAAG,EAAE,CAAA,GAAI,UAAA;AAC9D;AAE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,EAAK,IAAI,CAAA;AAAA,EAC9B,CAAA;AACF;AAEO,SAAS,0BAAA,CAA2B,MAAY,EAAA,EAAgE;AACrH,EAAA,OAAO,SAAS,gCAAgD,IAAA,EAAiB;AAC/E,IAAA,MAAM,GAAA,GAAM,KAAK,CAAC,CAAA;AAClB,IAAA,IAAI,eAAe,KAAA,EAAO;AACxB,MAAA,IAAA,CAAK,UAAU,EAAE,IAAA,EAAM,mBAAmB,OAAA,EAAS,GAAA,CAAI,SAAS,CAAA;AAAA,IAClE;AACA,IAAA,IAAA,CAAK,GAAA,EAAI;AACT,IAAA,EAAA,CAAG,KAAA,CAAM,MAAM,IAAI,CAAA;AAAA,EACrB,CAAA;AACF;AAOO,SAAS,gBAAgB,CAAA,EAAgC;AAC9D,EAAA,OAAO,OAAO,CAAA,KAAM,QAAA,IAAY,CAAA,KAAM,IAAA,IAAQ,aAAa,CAAA,GACvD,MAAA,CAAQ,CAAA,CAA4B,OAAO,CAAA,GAC3C,MAAA;AACN;AAEO,SAAS,uBAAuB,EAAA,EAAmC;AACxE,EAAA,OAAO,OAAO,EAAA,KAAO,QAAA,IAAY,OAAQ,IAAkC,IAAA,KAAS,QAAA;AACtF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"active-tracing-helper.js","sources":["../../../../../../src/integrations/tracing/prisma/vendored/active-tracing-helper.ts"],"sourcesContent":["/*\n * Copyright Prisma\n
|
|
1
|
+
{"version":3,"file":"active-tracing-helper.js","sources":["../../../../../../src/integrations/tracing/prisma/vendored/active-tracing-helper.ts"],"sourcesContent":["/*\n * Copyright Prisma\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/prisma/prisma/tree/b6feea5565ec577545a79547d24273ccdd11b4c7/packages/instrumentation\n * - Upstream version: @prisma/instrumentation@7.8.0\n * - Replaced `@prisma/instrumentation-contract` imports with local vendored types\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable */\n\nimport {\n Attributes,\n Context,\n context as _context,\n Span,\n SpanKind,\n SpanOptions,\n trace,\n Tracer,\n TracerProvider,\n} from '@opentelemetry/api';\nimport type { EngineSpan, EngineSpanKind, ExtendedSpanOptions, SpanCallback, TracingHelper } from './types';\n\nconst showAllTraces = process.env.PRISMA_SHOW_ALL_TRACES === 'true';\n\nconst nonSampledTraceParent = `00-10-10-00`;\n\ntype Options = {\n tracerProvider: TracerProvider;\n ignoreSpanTypes: (string | RegExp)[];\n};\n\nfunction engineSpanKindToOtelSpanKind(engineSpanKind: EngineSpanKind): SpanKind {\n switch (engineSpanKind) {\n case 'client':\n return SpanKind.CLIENT;\n case 'internal':\n default:\n return SpanKind.INTERNAL;\n }\n}\n\nexport class ActiveTracingHelper implements TracingHelper {\n private tracerProvider: TracerProvider;\n private ignoreSpanTypes: (string | RegExp)[];\n\n constructor({ tracerProvider, ignoreSpanTypes }: Options) {\n this.tracerProvider = tracerProvider;\n this.ignoreSpanTypes = ignoreSpanTypes;\n }\n\n isEnabled(): boolean {\n return true;\n }\n\n getTraceParent(context?: Context | undefined): string {\n const span = trace.getSpanContext(context ?? _context.active());\n if (span) {\n return `00-${span.traceId}-${span.spanId}-0${span.traceFlags}`;\n }\n return nonSampledTraceParent;\n }\n\n dispatchEngineSpans(spans: EngineSpan[]): void {\n const tracer = this.tracerProvider.getTracer('prisma');\n const linkIds = new Map<string, string>();\n const roots = spans.filter(span => span.parentId === null);\n\n for (const root of roots) {\n dispatchEngineSpan(tracer, root, spans, linkIds, this.ignoreSpanTypes);\n }\n }\n\n getActiveContext(): Context | undefined {\n return _context.active();\n }\n\n runInChildSpan<R>(options: string | ExtendedSpanOptions, callback: SpanCallback<R>): R {\n if (typeof options === 'string') {\n options = { name: options };\n }\n\n if (options.internal && !showAllTraces) {\n return callback();\n }\n\n const tracer = this.tracerProvider.getTracer('prisma');\n const context = options.context ?? this.getActiveContext();\n const name = `prisma:client:${options.name}`;\n\n if (shouldIgnoreSpan(name, this.ignoreSpanTypes)) {\n return callback();\n }\n\n if (options.active === false) {\n const span = tracer.startSpan(name, options, context);\n return endSpan(span, callback(span, context));\n }\n\n return tracer.startActiveSpan(name, options, span => endSpan(span, callback(span, context)));\n }\n}\n\nfunction dispatchEngineSpan(\n tracer: Tracer,\n engineSpan: EngineSpan,\n allSpans: EngineSpan[],\n linkIds: Map<string, string>,\n ignoreSpanTypes: (string | RegExp)[],\n) {\n if (shouldIgnoreSpan(engineSpan.name, ignoreSpanTypes)) return;\n\n const spanOptions = {\n attributes: engineSpan.attributes as Attributes,\n kind: engineSpanKindToOtelSpanKind(engineSpan.kind),\n startTime: engineSpan.startTime,\n } satisfies SpanOptions;\n\n tracer.startActiveSpan(engineSpan.name, spanOptions, span => {\n linkIds.set(engineSpan.id, span.spanContext().spanId);\n\n if (engineSpan.links) {\n span.addLinks(\n engineSpan.links.flatMap(link => {\n const linkedId = linkIds.get(link);\n if (!linkedId) {\n return [];\n }\n return {\n context: {\n spanId: linkedId,\n traceId: span.spanContext().traceId,\n traceFlags: span.spanContext().traceFlags,\n },\n };\n }),\n );\n }\n\n const children = allSpans.filter(s => s.parentId === engineSpan.id);\n for (const child of children) {\n dispatchEngineSpan(tracer, child, allSpans, linkIds, ignoreSpanTypes);\n }\n\n span.end(engineSpan.endTime);\n });\n}\n\nfunction endSpan<T>(span: Span, result: T): T {\n if (isPromiseLike(result)) {\n return result.then(\n value => {\n span.end();\n return value;\n },\n reason => {\n span.end();\n throw reason;\n },\n ) as T;\n }\n span.end();\n return result;\n}\n\nfunction isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n return value != null && typeof (value as Record<string, unknown>)['then'] === 'function';\n}\n\nfunction shouldIgnoreSpan(spanName: string, ignoreSpanTypes: (string | RegExp)[]): boolean {\n return ignoreSpanTypes.some(pattern => (typeof pattern === 'string' ? pattern === spanName : pattern.test(spanName)));\n}\n"],"names":["context","_context"],"mappings":";;AAyBA,MAAM,aAAA,GAAgB,OAAA,CAAQ,G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,CAAA;AACH;AAEA,SAAS,OAAA,CAAW,MAAY,MAAA,EAAc;AAC5C,EAAA,IAAI,aAAA,CAAc,MAAM,CAAA,EAAG;AACzB,IAAA,OAAO,MAAA,CAAO,IAAA;AAAA,MACZ,CAAA,KAAA,KAAS;AACP,QAAA,IAAA,CAAK,GAAA,EAAI;AACT,QAAA,OAAO,KAAA;AAAA,MACT,CAAA;AAAA,MACA,CAAA,MAAA,KAAU;AACR,QAAA,IAAA,CAAK,GAAA,EAAI;AACT,QAAA,MAAM,MAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACA,EAAA,IAAA,CAAK,GAAA,EAAI;AACT,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,cAAc,KAAA,EAA+C;AACpE,EAAA,OAAO,KAAA,IAAS,IAAA,IAAQ,OAAQ,KAAA,CAAkC,MAAM,CAAA,KAAM,UAAA;AAChF;AAEA,SAAS,gBAAA,CAAiB,UAAkB,eAAA,EAA+C;AACzF,EAAA,OAAO,eAAA,CAAgB,IAAA,CAAK,CAAA,OAAA,KAAY,OAAO,OAAA,KAAY,QAAA,GAAW,OAAA,KAAY,QAAA,GAAW,OAAA,CAAQ,IAAA,CAAK,QAAQ,CAAE,CAAA;AACtH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../../../../../src/integrations/tracing/prisma/vendored/constants.ts"],"sourcesContent":["/*\n * Copyright Prisma\n
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../../../../../src/integrations/tracing/prisma/vendored/constants.ts"],"sourcesContent":["/*\n * Copyright Prisma\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/prisma/prisma/tree/b6feea5565ec577545a79547d24273ccdd11b4c7/packages/instrumentation\n * - Upstream version: @prisma/instrumentation@7.8.0\n * - Replaced `import packageJson from '../package.json'` with hardcoded values\n */\n/* eslint-disable */\n\nimport { SDK_VERSION } from '@sentry/core';\n\nexport const VERSION = SDK_VERSION;\n\nexport const NAME = '@sentry/instrumentation-prisma';\n\nexport const MODULE_NAME = '@prisma/client';\n\nexport const SUPPORTED_MODULE_VERSIONS = ['>=5.0.0'];\n"],"names":[],"mappings":";;AAaO,MAAM,OAAA,GAAU;AAEhB,MAAM,IAAA,GAAO;AAEb,MAAM,WAAA,GAAc;AAEpB,MAAM,yBAAA,GAA4B,CAAC,SAAS;;;;"}
|