@depup/sentry__server-utils 10.67.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/build/cjs/debug-build.js +6 -0
- package/build/cjs/debug-build.js.map +1 -0
- package/build/cjs/graphql/graphql-dc-subscriber.js +123 -0
- package/build/cjs/graphql/graphql-dc-subscriber.js.map +1 -0
- package/build/cjs/graphql/index.js +23 -0
- package/build/cjs/graphql/index.js.map +1 -0
- package/build/cjs/graphql/utils.js +92 -0
- package/build/cjs/graphql/utils.js.map +1 -0
- package/build/cjs/index.js +34 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/amqplib.js +420 -0
- package/build/cjs/integrations/tracing-channel/amqplib.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/anthropic.js +101 -0
- package/build/cjs/integrations/tracing-channel/anthropic.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/constants.js +16 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/constants.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/index.js +154 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/index.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js +46 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js +47 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js +419 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/dynamodb.js +131 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/dynamodb.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/kinesis.js +21 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/kinesis.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/lambda.js +64 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/lambda.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/s3.js +21 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/s3.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/secretsmanager.js +27 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/secretsmanager.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/sns.js +63 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/sns.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/sqs.js +116 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/sqs.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/stepfunctions.js +25 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/services/stepfunctions.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/utils.js +30 -0
- package/build/cjs/integrations/tracing-channel/aws-sdk/utils.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/dataloader.js +95 -0
- package/build/cjs/integrations/tracing-channel/dataloader.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/express/index.js +24 -0
- package/build/cjs/integrations/tracing-channel/express/index.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/express/instrumentation.js +168 -0
- package/build/cjs/integrations/tracing-channel/express/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/express/route.js +76 -0
- package/build/cjs/integrations/tracing-channel/express/route.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/errors.js +42 -0
- package/build/cjs/integrations/tracing-channel/fastify/errors.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/index.js +34 -0
- package/build/cjs/integrations/tracing-channel/fastify/index.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js +279 -0
- package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/utils.js +11 -0
- package/build/cjs/integrations/tracing-channel/fastify/utils.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/generic-pool.js +34 -0
- package/build/cjs/integrations/tracing-channel/generic-pool.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/google-genai.js +96 -0
- package/build/cjs/integrations/tracing-channel/google-genai.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/graphql/constants.js +26 -0
- package/build/cjs/integrations/tracing-channel/graphql/constants.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/graphql/index.js +66 -0
- package/build/cjs/integrations/tracing-channel/graphql/index.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/graphql/resolvers.js +168 -0
- package/build/cjs/integrations/tracing-channel/graphql/resolvers.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/graphql/spans.js +102 -0
- package/build/cjs/integrations/tracing-channel/graphql/spans.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/hapi-types.js +30 -0
- package/build/cjs/integrations/tracing-channel/hapi-types.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/hapi-utils.js +177 -0
- package/build/cjs/integrations/tracing-channel/hapi-utils.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/hapi.js +52 -0
- package/build/cjs/integrations/tracing-channel/hapi.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/ioredis.js +99 -0
- package/build/cjs/integrations/tracing-channel/ioredis.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/kafkajs/consumer.js +71 -0
- package/build/cjs/integrations/tracing-channel/kafkajs/consumer.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/kafkajs/index.js +70 -0
- package/build/cjs/integrations/tracing-channel/kafkajs/index.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/kafkajs/semconv.js +22 -0
- package/build/cjs/integrations/tracing-channel/kafkajs/semconv.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/kafkajs/spans.js +119 -0
- package/build/cjs/integrations/tracing-channel/kafkajs/spans.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/knex.js +188 -0
- package/build/cjs/integrations/tracing-channel/knex.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/koa.js +146 -0
- package/build/cjs/integrations/tracing-channel/koa.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/langchain.js +63 -0
- package/build/cjs/integrations/tracing-channel/langchain.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/langgraph.js +100 -0
- package/build/cjs/integrations/tracing-channel/langgraph.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/lru-memoizer.js +31 -0
- package/build/cjs/integrations/tracing-channel/lru-memoizer.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/mongodb.js +104 -0
- package/build/cjs/integrations/tracing-channel/mongodb.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/mongoose.js +110 -0
- package/build/cjs/integrations/tracing-channel/mongoose.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/mysql.js +107 -0
- package/build/cjs/integrations/tracing-channel/mysql.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/mysql2.js +83 -0
- package/build/cjs/integrations/tracing-channel/mysql2.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/openai.js +81 -0
- package/build/cjs/integrations/tracing-channel/openai.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/postgres-js.js +191 -0
- package/build/cjs/integrations/tracing-channel/postgres-js.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/postgres.js +170 -0
- package/build/cjs/integrations/tracing-channel/postgres.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/redis.js +218 -0
- package/build/cjs/integrations/tracing-channel/redis.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/tedious.js +145 -0
- package/build/cjs/integrations/tracing-channel/tedious.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/vercel-ai.js +25 -0
- package/build/cjs/integrations/tracing-channel/vercel-ai.js.map +1 -0
- package/build/cjs/mongodb/mongodb-span.js +133 -0
- package/build/cjs/mongodb/mongodb-span.js.map +1 -0
- package/build/cjs/mongoose/index.js +23 -0
- package/build/cjs/mongoose/index.js.map +1 -0
- package/build/cjs/mongoose/mongoose-dc-subscriber.js +97 -0
- package/build/cjs/mongoose/mongoose-dc-subscriber.js.map +1 -0
- package/build/cjs/mongoose/mongoose-legacy-span.js +40 -0
- package/build/cjs/mongoose/mongoose-legacy-span.js.map +1 -0
- package/build/cjs/mysql2/index.js +23 -0
- package/build/cjs/mysql2/index.js.map +1 -0
- package/build/cjs/mysql2/mysql2-dc-subscriber.js +68 -0
- package/build/cjs/mysql2/mysql2-dc-subscriber.js.map +1 -0
- package/build/cjs/orchestrion/bundler/esbuild.js +15 -0
- package/build/cjs/orchestrion/bundler/esbuild.js.map +1 -0
- package/build/cjs/orchestrion/bundler/options.js +24 -0
- package/build/cjs/orchestrion/bundler/options.js.map +1 -0
- package/build/cjs/orchestrion/bundler/rollup.js +15 -0
- package/build/cjs/orchestrion/bundler/rollup.js.map +1 -0
- package/build/cjs/orchestrion/bundler/vite.js +21 -0
- package/build/cjs/orchestrion/bundler/vite.js.map +1 -0
- package/build/cjs/orchestrion/bundler/webpack.js +36 -0
- package/build/cjs/orchestrion/bundler/webpack.js.map +1 -0
- package/build/cjs/orchestrion/channels.js +70 -0
- package/build/cjs/orchestrion/channels.js.map +1 -0
- package/build/cjs/orchestrion/config/amqplib.js +81 -0
- package/build/cjs/orchestrion/config/amqplib.js.map +1 -0
- package/build/cjs/orchestrion/config/anthropic-ai.js +43 -0
- package/build/cjs/orchestrion/config/anthropic-ai.js.map +1 -0
- package/build/cjs/orchestrion/config/aws-sdk.js +28 -0
- package/build/cjs/orchestrion/config/aws-sdk.js.map +1 -0
- package/build/cjs/orchestrion/config/dataloader.js +53 -0
- package/build/cjs/orchestrion/config/dataloader.js.map +1 -0
- package/build/cjs/orchestrion/config/express.js +77 -0
- package/build/cjs/orchestrion/config/express.js.map +1 -0
- package/build/cjs/orchestrion/config/firebase.js +8 -0
- package/build/cjs/orchestrion/config/firebase.js.map +1 -0
- package/build/cjs/orchestrion/config/generic-pool.js +21 -0
- package/build/cjs/orchestrion/config/generic-pool.js.map +1 -0
- package/build/cjs/orchestrion/config/google-genai.js +38 -0
- package/build/cjs/orchestrion/config/google-genai.js.map +1 -0
- package/build/cjs/orchestrion/config/graphql.js +28 -0
- package/build/cjs/orchestrion/config/graphql.js.map +1 -0
- package/build/cjs/orchestrion/config/hapi.js +26 -0
- package/build/cjs/orchestrion/config/hapi.js.map +1 -0
- package/build/cjs/orchestrion/config/index.js +89 -0
- package/build/cjs/orchestrion/config/index.js.map +1 -0
- package/build/cjs/orchestrion/config/ioredis.js +35 -0
- package/build/cjs/orchestrion/config/ioredis.js.map +1 -0
- package/build/cjs/orchestrion/config/kafkajs.js +30 -0
- package/build/cjs/orchestrion/config/kafkajs.js.map +1 -0
- package/build/cjs/orchestrion/config/knex.js +43 -0
- package/build/cjs/orchestrion/config/knex.js.map +1 -0
- package/build/cjs/orchestrion/config/koa.js +16 -0
- package/build/cjs/orchestrion/config/koa.js.map +1 -0
- package/build/cjs/orchestrion/config/langchain.js +52 -0
- package/build/cjs/orchestrion/config/langchain.js.map +1 -0
- package/build/cjs/orchestrion/config/langgraph.js +28 -0
- package/build/cjs/orchestrion/config/langgraph.js.map +1 -0
- package/build/cjs/orchestrion/config/lru-memoizer.js +17 -0
- package/build/cjs/orchestrion/config/lru-memoizer.js.map +1 -0
- package/build/cjs/orchestrion/config/mongodb.js +67 -0
- package/build/cjs/orchestrion/config/mongodb.js.map +1 -0
- package/build/cjs/orchestrion/config/mongoose.js +107 -0
- package/build/cjs/orchestrion/config/mongoose.js.map +1 -0
- package/build/cjs/orchestrion/config/mysql.js +16 -0
- package/build/cjs/orchestrion/config/mysql.js.map +1 -0
- package/build/cjs/orchestrion/config/mysql2.js +32 -0
- package/build/cjs/orchestrion/config/mysql2.js.map +1 -0
- package/build/cjs/orchestrion/config/nestjs.js +122 -0
- package/build/cjs/orchestrion/config/nestjs.js.map +1 -0
- package/build/cjs/orchestrion/config/openai.js +40 -0
- package/build/cjs/orchestrion/config/openai.js.map +1 -0
- package/build/cjs/orchestrion/config/pg.js +51 -0
- package/build/cjs/orchestrion/config/pg.js.map +1 -0
- package/build/cjs/orchestrion/config/postgres.js +50 -0
- package/build/cjs/orchestrion/config/postgres.js.map +1 -0
- package/build/cjs/orchestrion/config/prisma.js +8 -0
- package/build/cjs/orchestrion/config/prisma.js.map +1 -0
- package/build/cjs/orchestrion/config/react-router.js +8 -0
- package/build/cjs/orchestrion/config/react-router.js.map +1 -0
- package/build/cjs/orchestrion/config/redis.js +76 -0
- package/build/cjs/orchestrion/config/redis.js.map +1 -0
- package/build/cjs/orchestrion/config/remix.js +54 -0
- package/build/cjs/orchestrion/config/remix.js.map +1 -0
- package/build/cjs/orchestrion/config/tedious.js +24 -0
- package/build/cjs/orchestrion/config/tedious.js.map +1 -0
- package/build/cjs/orchestrion/config/vercel-ai.js +48 -0
- package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -0
- package/build/cjs/orchestrion/detect.js +26 -0
- package/build/cjs/orchestrion/detect.js.map +1 -0
- package/build/cjs/orchestrion/index.js +89 -0
- package/build/cjs/orchestrion/index.js.map +1 -0
- package/build/cjs/orchestrion/runtime/register.js +77 -0
- package/build/cjs/orchestrion/runtime/register.js.map +1 -0
- package/build/cjs/prisma/global.js +14 -0
- package/build/cjs/prisma/global.js.map +1 -0
- package/build/cjs/prisma/index.js +27 -0
- package/build/cjs/prisma/index.js.map +1 -0
- package/build/cjs/prisma/tracing-helper.js +211 -0
- package/build/cjs/prisma/tracing-helper.js.map +1 -0
- package/build/cjs/redis/index.js +23 -0
- package/build/cjs/redis/index.js.map +1 -0
- package/build/cjs/redis/redis-dc-subscriber.js +101 -0
- package/build/cjs/redis/redis-dc-subscriber.js.map +1 -0
- package/build/cjs/redis/redis-statement-serializer.js +34 -0
- package/build/cjs/redis/redis-statement-serializer.js.map +1 -0
- package/build/cjs/tracing-channel.js +134 -0
- package/build/cjs/tracing-channel.js.map +1 -0
- package/build/cjs/vercel-ai/index.js +23 -0
- package/build/cjs/vercel-ai/index.js.map +1 -0
- package/build/cjs/vercel-ai/util.js +112 -0
- package/build/cjs/vercel-ai/util.js.map +1 -0
- package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js +433 -0
- package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -0
- package/build/cjs/vercel-ai/vercel-ai-orchestrion-subscriber.js +399 -0
- package/build/cjs/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -0
- package/build/esm/debug-build.js +4 -0
- package/build/esm/debug-build.js.map +1 -0
- package/build/esm/graphql/graphql-dc-subscriber.js +116 -0
- package/build/esm/graphql/graphql-dc-subscriber.js.map +1 -0
- package/build/esm/graphql/index.js +21 -0
- package/build/esm/graphql/index.js.map +1 -0
- package/build/esm/graphql/utils.js +87 -0
- package/build/esm/graphql/utils.js.map +1 -0
- package/build/esm/index.js +12 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/integrations/tracing-channel/amqplib.js +418 -0
- package/build/esm/integrations/tracing-channel/amqplib.js.map +1 -0
- package/build/esm/integrations/tracing-channel/anthropic.js +99 -0
- package/build/esm/integrations/tracing-channel/anthropic.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/constants.js +9 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/constants.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/index.js +152 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/index.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js +41 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js +45 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js +417 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/dynamodb.js +129 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/dynamodb.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/kinesis.js +19 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/kinesis.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/lambda.js +62 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/lambda.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/s3.js +19 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/s3.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/secretsmanager.js +25 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/secretsmanager.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/sns.js +61 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/sns.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/sqs.js +114 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/sqs.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/stepfunctions.js +23 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/services/stepfunctions.js.map +1 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/utils.js +26 -0
- package/build/esm/integrations/tracing-channel/aws-sdk/utils.js.map +1 -0
- package/build/esm/integrations/tracing-channel/dataloader.js +93 -0
- package/build/esm/integrations/tracing-channel/dataloader.js.map +1 -0
- package/build/esm/integrations/tracing-channel/express/index.js +22 -0
- package/build/esm/integrations/tracing-channel/express/index.js.map +1 -0
- package/build/esm/integrations/tracing-channel/express/instrumentation.js +166 -0
- package/build/esm/integrations/tracing-channel/express/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing-channel/express/route.js +68 -0
- package/build/esm/integrations/tracing-channel/express/route.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/errors.js +39 -0
- package/build/esm/integrations/tracing-channel/fastify/errors.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/index.js +30 -0
- package/build/esm/integrations/tracing-channel/fastify/index.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/instrumentation.js +277 -0
- package/build/esm/integrations/tracing-channel/fastify/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/utils.js +8 -0
- package/build/esm/integrations/tracing-channel/fastify/utils.js.map +1 -0
- package/build/esm/integrations/tracing-channel/generic-pool.js +32 -0
- package/build/esm/integrations/tracing-channel/generic-pool.js.map +1 -0
- package/build/esm/integrations/tracing-channel/google-genai.js +94 -0
- package/build/esm/integrations/tracing-channel/google-genai.js.map +1 -0
- package/build/esm/integrations/tracing-channel/graphql/constants.js +14 -0
- package/build/esm/integrations/tracing-channel/graphql/constants.js.map +1 -0
- package/build/esm/integrations/tracing-channel/graphql/index.js +63 -0
- package/build/esm/integrations/tracing-channel/graphql/index.js.map +1 -0
- package/build/esm/integrations/tracing-channel/graphql/resolvers.js +164 -0
- package/build/esm/integrations/tracing-channel/graphql/resolvers.js.map +1 -0
- package/build/esm/integrations/tracing-channel/graphql/spans.js +96 -0
- package/build/esm/integrations/tracing-channel/graphql/spans.js.map +1 -0
- package/build/esm/integrations/tracing-channel/hapi-types.js +25 -0
- package/build/esm/integrations/tracing-channel/hapi-types.js.map +1 -0
- package/build/esm/integrations/tracing-channel/hapi-utils.js +172 -0
- package/build/esm/integrations/tracing-channel/hapi-utils.js.map +1 -0
- package/build/esm/integrations/tracing-channel/hapi.js +50 -0
- package/build/esm/integrations/tracing-channel/hapi.js.map +1 -0
- package/build/esm/integrations/tracing-channel/ioredis.js +96 -0
- package/build/esm/integrations/tracing-channel/ioredis.js.map +1 -0
- package/build/esm/integrations/tracing-channel/kafkajs/consumer.js +67 -0
- package/build/esm/integrations/tracing-channel/kafkajs/consumer.js.map +1 -0
- package/build/esm/integrations/tracing-channel/kafkajs/index.js +68 -0
- package/build/esm/integrations/tracing-channel/kafkajs/index.js.map +1 -0
- package/build/esm/integrations/tracing-channel/kafkajs/semconv.js +12 -0
- package/build/esm/integrations/tracing-channel/kafkajs/semconv.js.map +1 -0
- package/build/esm/integrations/tracing-channel/kafkajs/spans.js +112 -0
- package/build/esm/integrations/tracing-channel/kafkajs/spans.js.map +1 -0
- package/build/esm/integrations/tracing-channel/knex.js +186 -0
- package/build/esm/integrations/tracing-channel/knex.js.map +1 -0
- package/build/esm/integrations/tracing-channel/koa.js +144 -0
- package/build/esm/integrations/tracing-channel/koa.js.map +1 -0
- package/build/esm/integrations/tracing-channel/langchain.js +61 -0
- package/build/esm/integrations/tracing-channel/langchain.js.map +1 -0
- package/build/esm/integrations/tracing-channel/langgraph.js +98 -0
- package/build/esm/integrations/tracing-channel/langgraph.js.map +1 -0
- package/build/esm/integrations/tracing-channel/lru-memoizer.js +29 -0
- package/build/esm/integrations/tracing-channel/lru-memoizer.js.map +1 -0
- package/build/esm/integrations/tracing-channel/mongodb.js +102 -0
- package/build/esm/integrations/tracing-channel/mongodb.js.map +1 -0
- package/build/esm/integrations/tracing-channel/mongoose.js +108 -0
- package/build/esm/integrations/tracing-channel/mongoose.js.map +1 -0
- package/build/esm/integrations/tracing-channel/mysql.js +105 -0
- package/build/esm/integrations/tracing-channel/mysql.js.map +1 -0
- package/build/esm/integrations/tracing-channel/mysql2.js +81 -0
- package/build/esm/integrations/tracing-channel/mysql2.js.map +1 -0
- package/build/esm/integrations/tracing-channel/openai.js +79 -0
- package/build/esm/integrations/tracing-channel/openai.js.map +1 -0
- package/build/esm/integrations/tracing-channel/postgres-js.js +189 -0
- package/build/esm/integrations/tracing-channel/postgres-js.js.map +1 -0
- package/build/esm/integrations/tracing-channel/postgres.js +168 -0
- package/build/esm/integrations/tracing-channel/postgres.js.map +1 -0
- package/build/esm/integrations/tracing-channel/redis.js +216 -0
- package/build/esm/integrations/tracing-channel/redis.js.map +1 -0
- package/build/esm/integrations/tracing-channel/tedious.js +143 -0
- package/build/esm/integrations/tracing-channel/tedious.js.map +1 -0
- package/build/esm/integrations/tracing-channel/vercel-ai.js +23 -0
- package/build/esm/integrations/tracing-channel/vercel-ai.js.map +1 -0
- package/build/esm/mongodb/mongodb-span.js +126 -0
- package/build/esm/mongodb/mongodb-span.js.map +1 -0
- package/build/esm/mongoose/index.js +21 -0
- package/build/esm/mongoose/index.js.map +1 -0
- package/build/esm/mongoose/mongoose-dc-subscriber.js +89 -0
- package/build/esm/mongoose/mongoose-dc-subscriber.js.map +1 -0
- package/build/esm/mongoose/mongoose-legacy-span.js +38 -0
- package/build/esm/mongoose/mongoose-legacy-span.js.map +1 -0
- package/build/esm/mysql2/index.js +21 -0
- package/build/esm/mysql2/index.js.map +1 -0
- package/build/esm/mysql2/mysql2-dc-subscriber.js +62 -0
- package/build/esm/mysql2/mysql2-dc-subscriber.js.map +1 -0
- package/build/esm/orchestrion/bundler/esbuild.js +9 -0
- package/build/esm/orchestrion/bundler/esbuild.js.map +1 -0
- package/build/esm/orchestrion/bundler/options.js +22 -0
- package/build/esm/orchestrion/bundler/options.js.map +1 -0
- package/build/esm/orchestrion/bundler/rollup.js +9 -0
- package/build/esm/orchestrion/bundler/rollup.js.map +1 -0
- package/build/esm/orchestrion/bundler/vite.js +15 -0
- package/build/esm/orchestrion/bundler/vite.js.map +1 -0
- package/build/esm/orchestrion/bundler/webpack.js +27 -0
- package/build/esm/orchestrion/bundler/webpack.js.map +1 -0
- package/build/esm/orchestrion/channels.js +68 -0
- package/build/esm/orchestrion/channels.js.map +1 -0
- package/build/esm/orchestrion/config/amqplib.js +78 -0
- package/build/esm/orchestrion/config/amqplib.js.map +1 -0
- package/build/esm/orchestrion/config/anthropic-ai.js +40 -0
- package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -0
- package/build/esm/orchestrion/config/aws-sdk.js +25 -0
- package/build/esm/orchestrion/config/aws-sdk.js.map +1 -0
- package/build/esm/orchestrion/config/dataloader.js +50 -0
- package/build/esm/orchestrion/config/dataloader.js.map +1 -0
- package/build/esm/orchestrion/config/express.js +74 -0
- package/build/esm/orchestrion/config/express.js.map +1 -0
- package/build/esm/orchestrion/config/firebase.js +5 -0
- package/build/esm/orchestrion/config/firebase.js.map +1 -0
- package/build/esm/orchestrion/config/generic-pool.js +18 -0
- package/build/esm/orchestrion/config/generic-pool.js.map +1 -0
- package/build/esm/orchestrion/config/google-genai.js +35 -0
- package/build/esm/orchestrion/config/google-genai.js.map +1 -0
- package/build/esm/orchestrion/config/graphql.js +25 -0
- package/build/esm/orchestrion/config/graphql.js.map +1 -0
- package/build/esm/orchestrion/config/hapi.js +23 -0
- package/build/esm/orchestrion/config/hapi.js.map +1 -0
- package/build/esm/orchestrion/config/index.js +84 -0
- package/build/esm/orchestrion/config/index.js.map +1 -0
- package/build/esm/orchestrion/config/ioredis.js +32 -0
- package/build/esm/orchestrion/config/ioredis.js.map +1 -0
- package/build/esm/orchestrion/config/kafkajs.js +27 -0
- package/build/esm/orchestrion/config/kafkajs.js.map +1 -0
- package/build/esm/orchestrion/config/knex.js +40 -0
- package/build/esm/orchestrion/config/knex.js.map +1 -0
- package/build/esm/orchestrion/config/koa.js +13 -0
- package/build/esm/orchestrion/config/koa.js.map +1 -0
- package/build/esm/orchestrion/config/langchain.js +48 -0
- package/build/esm/orchestrion/config/langchain.js.map +1 -0
- package/build/esm/orchestrion/config/langgraph.js +25 -0
- package/build/esm/orchestrion/config/langgraph.js.map +1 -0
- package/build/esm/orchestrion/config/lru-memoizer.js +14 -0
- package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -0
- package/build/esm/orchestrion/config/mongodb.js +64 -0
- package/build/esm/orchestrion/config/mongodb.js.map +1 -0
- package/build/esm/orchestrion/config/mongoose.js +103 -0
- package/build/esm/orchestrion/config/mongoose.js.map +1 -0
- package/build/esm/orchestrion/config/mysql.js +13 -0
- package/build/esm/orchestrion/config/mysql.js.map +1 -0
- package/build/esm/orchestrion/config/mysql2.js +29 -0
- package/build/esm/orchestrion/config/mysql2.js.map +1 -0
- package/build/esm/orchestrion/config/nestjs.js +119 -0
- package/build/esm/orchestrion/config/nestjs.js.map +1 -0
- package/build/esm/orchestrion/config/openai.js +37 -0
- package/build/esm/orchestrion/config/openai.js.map +1 -0
- package/build/esm/orchestrion/config/pg.js +48 -0
- package/build/esm/orchestrion/config/pg.js.map +1 -0
- package/build/esm/orchestrion/config/postgres.js +47 -0
- package/build/esm/orchestrion/config/postgres.js.map +1 -0
- package/build/esm/orchestrion/config/prisma.js +5 -0
- package/build/esm/orchestrion/config/prisma.js.map +1 -0
- package/build/esm/orchestrion/config/react-router.js +5 -0
- package/build/esm/orchestrion/config/react-router.js.map +1 -0
- package/build/esm/orchestrion/config/redis.js +73 -0
- package/build/esm/orchestrion/config/redis.js.map +1 -0
- package/build/esm/orchestrion/config/remix.js +51 -0
- package/build/esm/orchestrion/config/remix.js.map +1 -0
- package/build/esm/orchestrion/config/tedious.js +21 -0
- package/build/esm/orchestrion/config/tedious.js.map +1 -0
- package/build/esm/orchestrion/config/vercel-ai.js +45 -0
- package/build/esm/orchestrion/config/vercel-ai.js.map +1 -0
- package/build/esm/orchestrion/detect.js +23 -0
- package/build/esm/orchestrion/detect.js.map +1 -0
- package/build/esm/orchestrion/index.js +58 -0
- package/build/esm/orchestrion/index.js.map +1 -0
- package/build/esm/orchestrion/runtime/register.js +76 -0
- package/build/esm/orchestrion/runtime/register.js.map +1 -0
- package/build/esm/package.json +1 -0
- package/build/esm/prisma/global.js +12 -0
- package/build/esm/prisma/global.js.map +1 -0
- package/build/esm/prisma/index.js +24 -0
- package/build/esm/prisma/index.js.map +1 -0
- package/build/esm/prisma/tracing-helper.js +209 -0
- package/build/esm/prisma/tracing-helper.js.map +1 -0
- package/build/esm/redis/index.js +21 -0
- package/build/esm/redis/index.js.map +1 -0
- package/build/esm/redis/redis-dc-subscriber.js +94 -0
- package/build/esm/redis/redis-dc-subscriber.js.map +1 -0
- package/build/esm/redis/redis-statement-serializer.js +32 -0
- package/build/esm/redis/redis-statement-serializer.js.map +1 -0
- package/build/esm/tracing-channel.js +132 -0
- package/build/esm/tracing-channel.js.map +1 -0
- package/build/esm/vercel-ai/index.js +21 -0
- package/build/esm/vercel-ai/index.js.map +1 -0
- package/build/esm/vercel-ai/util.js +106 -0
- package/build/esm/vercel-ai/util.js.map +1 -0
- package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js +425 -0
- package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -0
- package/build/esm/vercel-ai/vercel-ai-orchestrion-subscriber.js +397 -0
- package/build/esm/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -0
- package/build/orchestrion/import-hook.mjs +19 -0
- package/build/types/debug-build.d.ts +7 -0
- package/build/types/debug-build.d.ts.map +1 -0
- package/build/types/graphql/graphql-dc-subscriber.d.ts +94 -0
- package/build/types/graphql/graphql-dc-subscriber.d.ts.map +1 -0
- package/build/types/graphql/index.d.ts +12 -0
- package/build/types/graphql/index.d.ts.map +1 -0
- package/build/types/graphql/utils.d.ts +36 -0
- package/build/types/graphql/utils.d.ts.map +1 -0
- package/build/types/index.d.ts +22 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/amqplib.d.ts +11 -0
- package/build/types/integrations/tracing-channel/amqplib.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/anthropic.d.ts +10 -0
- package/build/types/integrations/tracing-channel/anthropic.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/aws-sdk.types.d.ts +43 -0
- package/build/types/integrations/tracing-channel/aws-sdk/aws-sdk.types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/constants.d.ts +15 -0
- package/build/types/integrations/tracing-channel/aws-sdk/constants.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/index.d.ts +15 -0
- package/build/types/integrations/tracing-channel/aws-sdk/index.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/MessageAttributes.d.ts +23 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/MessageAttributes.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/ServiceExtension.d.ts +9 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/ServiceExtension.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.d.ts +10 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.d.ts +14 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/dynamodb.d.ts +8 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/dynamodb.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/index.d.ts +2 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/index.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/kinesis.d.ts +6 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/kinesis.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/lambda.d.ts +9 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/lambda.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/s3.d.ts +6 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/s3.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/secretsmanager.d.ts +8 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/secretsmanager.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/sns.d.ts +9 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/sns.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/sqs.d.ts +9 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/sqs.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/stepfunctions.d.ts +6 -0
- package/build/types/integrations/tracing-channel/aws-sdk/services/stepfunctions.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/types.d.ts +26 -0
- package/build/types/integrations/tracing-channel/aws-sdk/types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/aws-sdk/utils.d.ts +5 -0
- package/build/types/integrations/tracing-channel/aws-sdk/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/dataloader.d.ts +11 -0
- package/build/types/integrations/tracing-channel/dataloader.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/express/index.d.ts +18 -0
- package/build/types/integrations/tracing-channel/express/index.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/express/instrumentation.d.ts +4 -0
- package/build/types/integrations/tracing-channel/express/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/express/route.d.ts +28 -0
- package/build/types/integrations/tracing-channel/express/route.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/express/types.d.ts +64 -0
- package/build/types/integrations/tracing-channel/express/types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/errors.d.ts +12 -0
- package/build/types/integrations/tracing-channel/fastify/errors.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/index.d.ts +66 -0
- package/build/types/integrations/tracing-channel/fastify/index.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts +10 -0
- package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/types.d.ts +32 -0
- package/build/types/integrations/tracing-channel/fastify/types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/utils.d.ts +9 -0
- package/build/types/integrations/tracing-channel/fastify/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/generic-pool.d.ts +10 -0
- package/build/types/integrations/tracing-channel/generic-pool.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/google-genai.d.ts +12 -0
- package/build/types/integrations/tracing-channel/google-genai.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/graphql/constants.d.ts +12 -0
- package/build/types/integrations/tracing-channel/graphql/constants.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/graphql/graphql-types.d.ts +135 -0
- package/build/types/integrations/tracing-channel/graphql/graphql-types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/graphql/index.d.ts +28 -0
- package/build/types/integrations/tracing-channel/graphql/index.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/graphql/resolvers.d.ts +13 -0
- package/build/types/integrations/tracing-channel/graphql/resolvers.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/graphql/spans.d.ts +17 -0
- package/build/types/integrations/tracing-channel/graphql/spans.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/graphql/types.d.ts +25 -0
- package/build/types/integrations/tracing-channel/graphql/types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/hapi-types.d.ts +53 -0
- package/build/types/integrations/tracing-channel/hapi-types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/hapi-utils.d.ts +25 -0
- package/build/types/integrations/tracing-channel/hapi-utils.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/hapi.d.ts +9 -0
- package/build/types/integrations/tracing-channel/hapi.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/ioredis.d.ts +37 -0
- package/build/types/integrations/tracing-channel/ioredis.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/kafkajs/consumer.d.ts +8 -0
- package/build/types/integrations/tracing-channel/kafkajs/consumer.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/kafkajs/index.d.ts +17 -0
- package/build/types/integrations/tracing-channel/kafkajs/index.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/kafkajs/semconv.d.ts +10 -0
- package/build/types/integrations/tracing-channel/kafkajs/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/kafkajs/spans.d.ts +38 -0
- package/build/types/integrations/tracing-channel/kafkajs/spans.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/kafkajs/types.d.ts +40 -0
- package/build/types/integrations/tracing-channel/kafkajs/types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/knex.d.ts +11 -0
- package/build/types/integrations/tracing-channel/knex.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/koa.d.ts +14 -0
- package/build/types/integrations/tracing-channel/koa.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/langchain.d.ts +10 -0
- package/build/types/integrations/tracing-channel/langchain.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/langgraph.d.ts +10 -0
- package/build/types/integrations/tracing-channel/langgraph.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/lru-memoizer.d.ts +10 -0
- package/build/types/integrations/tracing-channel/lru-memoizer.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/mongodb.d.ts +12 -0
- package/build/types/integrations/tracing-channel/mongodb.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/mongoose.d.ts +15 -0
- package/build/types/integrations/tracing-channel/mongoose.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/mysql.d.ts +12 -0
- package/build/types/integrations/tracing-channel/mysql.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/mysql2.d.ts +15 -0
- package/build/types/integrations/tracing-channel/mysql2.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/openai.d.ts +10 -0
- package/build/types/integrations/tracing-channel/openai.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/postgres-js.d.ts +26 -0
- package/build/types/integrations/tracing-channel/postgres-js.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/postgres.d.ts +15 -0
- package/build/types/integrations/tracing-channel/postgres.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/redis.d.ts +16 -0
- package/build/types/integrations/tracing-channel/redis.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/tedious.d.ts +11 -0
- package/build/types/integrations/tracing-channel/tedious.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/vercel-ai.d.ts +13 -0
- package/build/types/integrations/tracing-channel/vercel-ai.d.ts.map +1 -0
- package/build/types/mongodb/mongodb-span.d.ts +66 -0
- package/build/types/mongodb/mongodb-span.d.ts.map +1 -0
- package/build/types/mongoose/index.d.ts +13 -0
- package/build/types/mongoose/index.d.ts.map +1 -0
- package/build/types/mongoose/mongoose-dc-subscriber.d.ts +63 -0
- package/build/types/mongoose/mongoose-dc-subscriber.d.ts.map +1 -0
- package/build/types/mongoose/mongoose-legacy-span.d.ts +29 -0
- package/build/types/mongoose/mongoose-legacy-span.d.ts.map +1 -0
- package/build/types/mysql2/index.d.ts +11 -0
- package/build/types/mysql2/index.d.ts.map +1 -0
- package/build/types/mysql2/mysql2-dc-subscriber.d.ts +59 -0
- package/build/types/mysql2/mysql2-dc-subscriber.d.ts.map +1 -0
- package/build/types/orchestrion/bundler/esbuild.d.ts +21 -0
- package/build/types/orchestrion/bundler/esbuild.d.ts.map +1 -0
- package/build/types/orchestrion/bundler/options.d.ts +29 -0
- package/build/types/orchestrion/bundler/options.d.ts.map +1 -0
- package/build/types/orchestrion/bundler/rollup.d.ts +17 -0
- package/build/types/orchestrion/bundler/rollup.d.ts.map +1 -0
- package/build/types/orchestrion/bundler/vite.d.ts +18 -0
- package/build/types/orchestrion/bundler/vite.d.ts.map +1 -0
- package/build/types/orchestrion/bundler/webpack.d.ts +19 -0
- package/build/types/orchestrion/bundler/webpack.d.ts.map +1 -0
- package/build/types/orchestrion/channels.d.ts +130 -0
- package/build/types/orchestrion/channels.d.ts.map +1 -0
- package/build/types/orchestrion/config/amqplib.d.ts +66 -0
- package/build/types/orchestrion/config/amqplib.d.ts.map +1 -0
- package/build/types/orchestrion/config/anthropic-ai.d.ts +31 -0
- package/build/types/orchestrion/config/anthropic-ai.d.ts.map +1 -0
- package/build/types/orchestrion/config/aws-sdk.d.ts +19 -0
- package/build/types/orchestrion/config/aws-sdk.d.ts.map +1 -0
- package/build/types/orchestrion/config/dataloader.d.ts +46 -0
- package/build/types/orchestrion/config/dataloader.d.ts.map +1 -0
- package/build/types/orchestrion/config/express.d.ts +30 -0
- package/build/types/orchestrion/config/express.d.ts.map +1 -0
- package/build/types/orchestrion/config/firebase.d.ts +4 -0
- package/build/types/orchestrion/config/firebase.d.ts.map +1 -0
- package/build/types/orchestrion/config/generic-pool.d.ts +31 -0
- package/build/types/orchestrion/config/generic-pool.d.ts.map +1 -0
- package/build/types/orchestrion/config/google-genai.d.ts +30 -0
- package/build/types/orchestrion/config/google-genai.d.ts.map +1 -0
- package/build/types/orchestrion/config/graphql.d.ts +29 -0
- package/build/types/orchestrion/config/graphql.d.ts.map +1 -0
- package/build/types/orchestrion/config/hapi.d.ts +17 -0
- package/build/types/orchestrion/config/hapi.d.ts.map +1 -0
- package/build/types/orchestrion/config/index.d.ts +37 -0
- package/build/types/orchestrion/config/index.d.ts.map +1 -0
- package/build/types/orchestrion/config/ioredis.d.ts +7 -0
- package/build/types/orchestrion/config/ioredis.d.ts.map +1 -0
- package/build/types/orchestrion/config/kafkajs.d.ts +17 -0
- package/build/types/orchestrion/config/kafkajs.d.ts.map +1 -0
- package/build/types/orchestrion/config/knex.d.ts +9 -0
- package/build/types/orchestrion/config/knex.d.ts.map +1 -0
- package/build/types/orchestrion/config/koa.d.ts +17 -0
- package/build/types/orchestrion/config/koa.d.ts.map +1 -0
- package/build/types/orchestrion/config/langchain.d.ts +18 -0
- package/build/types/orchestrion/config/langchain.d.ts.map +1 -0
- package/build/types/orchestrion/config/langgraph.d.ts +21 -0
- package/build/types/orchestrion/config/langgraph.d.ts.map +1 -0
- package/build/types/orchestrion/config/lru-memoizer.d.ts +16 -0
- package/build/types/orchestrion/config/lru-memoizer.d.ts.map +1 -0
- package/build/types/orchestrion/config/mongodb.d.ts +59 -0
- package/build/types/orchestrion/config/mongodb.d.ts.map +1 -0
- package/build/types/orchestrion/config/mongoose.d.ts +40 -0
- package/build/types/orchestrion/config/mongoose.d.ts.map +1 -0
- package/build/types/orchestrion/config/mysql.d.ts +16 -0
- package/build/types/orchestrion/config/mysql.d.ts.map +1 -0
- package/build/types/orchestrion/config/mysql2.d.ts +18 -0
- package/build/types/orchestrion/config/mysql2.d.ts.map +1 -0
- package/build/types/orchestrion/config/nestjs.d.ts +24 -0
- package/build/types/orchestrion/config/nestjs.d.ts.map +1 -0
- package/build/types/orchestrion/config/openai.d.ts +18 -0
- package/build/types/orchestrion/config/openai.d.ts.map +1 -0
- package/build/types/orchestrion/config/pg.d.ts +33 -0
- package/build/types/orchestrion/config/pg.d.ts.map +1 -0
- package/build/types/orchestrion/config/postgres.d.ts +9 -0
- package/build/types/orchestrion/config/postgres.d.ts.map +1 -0
- package/build/types/orchestrion/config/prisma.d.ts +4 -0
- package/build/types/orchestrion/config/prisma.d.ts.map +1 -0
- package/build/types/orchestrion/config/react-router.d.ts +4 -0
- package/build/types/orchestrion/config/react-router.d.ts.map +1 -0
- package/build/types/orchestrion/config/redis.d.ts +37 -0
- package/build/types/orchestrion/config/redis.d.ts.map +1 -0
- package/build/types/orchestrion/config/remix.d.ts +9 -0
- package/build/types/orchestrion/config/remix.d.ts.map +1 -0
- package/build/types/orchestrion/config/tedious.d.ts +12 -0
- package/build/types/orchestrion/config/tedious.d.ts.map +1 -0
- package/build/types/orchestrion/config/vercel-ai.d.ts +12 -0
- package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -0
- package/build/types/orchestrion/detect.d.ts +26 -0
- package/build/types/orchestrion/detect.d.ts.map +1 -0
- package/build/types/orchestrion/index.d.ts +136 -0
- package/build/types/orchestrion/index.d.ts.map +1 -0
- package/build/types/orchestrion/runtime/register.d.ts +25 -0
- package/build/types/orchestrion/runtime/register.d.ts.map +1 -0
- package/build/types/prisma/global.d.ts +5 -0
- package/build/types/prisma/global.d.ts.map +1 -0
- package/build/types/prisma/index.d.ts +45 -0
- package/build/types/prisma/index.d.ts.map +1 -0
- package/build/types/prisma/tracing-helper.d.ts +46 -0
- package/build/types/prisma/tracing-helper.d.ts.map +1 -0
- package/build/types/prisma/types.d.ts +37 -0
- package/build/types/prisma/types.d.ts.map +1 -0
- package/build/types/redis/index.d.ts +18 -0
- package/build/types/redis/index.d.ts.map +1 -0
- package/build/types/redis/redis-dc-subscriber.d.ts +89 -0
- package/build/types/redis/redis-dc-subscriber.d.ts.map +1 -0
- package/build/types/redis/redis-statement-serializer.d.ts +6 -0
- package/build/types/redis/redis-statement-serializer.d.ts.map +1 -0
- package/build/types/tracing-channel.d.ts +73 -0
- package/build/types/tracing-channel.d.ts.map +1 -0
- package/build/types/vercel-ai/index.d.ts +27 -0
- package/build/types/vercel-ai/index.d.ts.map +1 -0
- package/build/types/vercel-ai/util.d.ts +30 -0
- package/build/types/vercel-ai/util.d.ts.map +1 -0
- package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts +72 -0
- package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -0
- package/build/types/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts +12 -0
- package/build/types/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts.map +1 -0
- package/build/types-ts3.8/debug-build.d.ts +7 -0
- package/build/types-ts3.8/graphql/graphql-dc-subscriber.d.ts +94 -0
- package/build/types-ts3.8/graphql/index.d.ts +12 -0
- package/build/types-ts3.8/graphql/utils.d.ts +36 -0
- package/build/types-ts3.8/index.d.ts +23 -0
- package/build/types-ts3.8/integrations/tracing-channel/amqplib.d.ts +11 -0
- package/build/types-ts3.8/integrations/tracing-channel/anthropic.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/aws-sdk.types.d.ts +43 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/constants.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/index.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/MessageAttributes.d.ts +23 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/ServiceExtension.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.d.ts +14 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/dynamodb.d.ts +8 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/index.d.ts +2 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/kinesis.d.ts +6 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/lambda.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/s3.d.ts +6 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/secretsmanager.d.ts +8 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/sns.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/sqs.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/stepfunctions.d.ts +6 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/types.d.ts +26 -0
- package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/utils.d.ts +5 -0
- package/build/types-ts3.8/integrations/tracing-channel/dataloader.d.ts +11 -0
- package/build/types-ts3.8/integrations/tracing-channel/express/index.d.ts +18 -0
- package/build/types-ts3.8/integrations/tracing-channel/express/instrumentation.d.ts +4 -0
- package/build/types-ts3.8/integrations/tracing-channel/express/route.d.ts +28 -0
- package/build/types-ts3.8/integrations/tracing-channel/express/types.d.ts +64 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/errors.d.ts +12 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/index.d.ts +66 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/instrumentation.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/types.d.ts +32 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/utils.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing-channel/generic-pool.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/google-genai.d.ts +12 -0
- package/build/types-ts3.8/integrations/tracing-channel/graphql/constants.d.ts +12 -0
- package/build/types-ts3.8/integrations/tracing-channel/graphql/graphql-types.d.ts +135 -0
- package/build/types-ts3.8/integrations/tracing-channel/graphql/index.d.ts +30 -0
- package/build/types-ts3.8/integrations/tracing-channel/graphql/resolvers.d.ts +13 -0
- package/build/types-ts3.8/integrations/tracing-channel/graphql/spans.d.ts +17 -0
- package/build/types-ts3.8/integrations/tracing-channel/graphql/types.d.ts +25 -0
- package/build/types-ts3.8/integrations/tracing-channel/hapi-types.d.ts +65 -0
- package/build/types-ts3.8/integrations/tracing-channel/hapi-utils.d.ts +25 -0
- package/build/types-ts3.8/integrations/tracing-channel/hapi.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing-channel/ioredis.d.ts +37 -0
- package/build/types-ts3.8/integrations/tracing-channel/kafkajs/consumer.d.ts +8 -0
- package/build/types-ts3.8/integrations/tracing-channel/kafkajs/index.d.ts +17 -0
- package/build/types-ts3.8/integrations/tracing-channel/kafkajs/semconv.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/kafkajs/spans.d.ts +38 -0
- package/build/types-ts3.8/integrations/tracing-channel/kafkajs/types.d.ts +40 -0
- package/build/types-ts3.8/integrations/tracing-channel/knex.d.ts +11 -0
- package/build/types-ts3.8/integrations/tracing-channel/koa.d.ts +14 -0
- package/build/types-ts3.8/integrations/tracing-channel/langchain.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/langgraph.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/lru-memoizer.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/mongodb.d.ts +12 -0
- package/build/types-ts3.8/integrations/tracing-channel/mongoose.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing-channel/mysql.d.ts +12 -0
- package/build/types-ts3.8/integrations/tracing-channel/mysql2.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing-channel/openai.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/postgres-js.d.ts +26 -0
- package/build/types-ts3.8/integrations/tracing-channel/postgres.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing-channel/redis.d.ts +16 -0
- package/build/types-ts3.8/integrations/tracing-channel/tedious.d.ts +11 -0
- package/build/types-ts3.8/integrations/tracing-channel/vercel-ai.d.ts +13 -0
- package/build/types-ts3.8/mongodb/mongodb-span.d.ts +66 -0
- package/build/types-ts3.8/mongoose/index.d.ts +13 -0
- package/build/types-ts3.8/mongoose/mongoose-dc-subscriber.d.ts +63 -0
- package/build/types-ts3.8/mongoose/mongoose-legacy-span.d.ts +29 -0
- package/build/types-ts3.8/mysql2/index.d.ts +11 -0
- package/build/types-ts3.8/mysql2/mysql2-dc-subscriber.d.ts +59 -0
- package/build/types-ts3.8/node-diagnostics-channel.d.ts +19 -0
- package/build/types-ts3.8/orchestrion/bundler/esbuild.d.ts +21 -0
- package/build/types-ts3.8/orchestrion/bundler/options.d.ts +29 -0
- package/build/types-ts3.8/orchestrion/bundler/rollup.d.ts +17 -0
- package/build/types-ts3.8/orchestrion/bundler/vite.d.ts +18 -0
- package/build/types-ts3.8/orchestrion/bundler/webpack.d.ts +19 -0
- package/build/types-ts3.8/orchestrion/channels.d.ts +130 -0
- package/build/types-ts3.8/orchestrion/config/amqplib.d.ts +66 -0
- package/build/types-ts3.8/orchestrion/config/anthropic-ai.d.ts +31 -0
- package/build/types-ts3.8/orchestrion/config/aws-sdk.d.ts +19 -0
- package/build/types-ts3.8/orchestrion/config/dataloader.d.ts +46 -0
- package/build/types-ts3.8/orchestrion/config/express.d.ts +30 -0
- package/build/types-ts3.8/orchestrion/config/firebase.d.ts +4 -0
- package/build/types-ts3.8/orchestrion/config/generic-pool.d.ts +31 -0
- package/build/types-ts3.8/orchestrion/config/google-genai.d.ts +30 -0
- package/build/types-ts3.8/orchestrion/config/graphql.d.ts +29 -0
- package/build/types-ts3.8/orchestrion/config/hapi.d.ts +17 -0
- package/build/types-ts3.8/orchestrion/config/index.d.ts +37 -0
- package/build/types-ts3.8/orchestrion/config/ioredis.d.ts +7 -0
- package/build/types-ts3.8/orchestrion/config/kafkajs.d.ts +17 -0
- package/build/types-ts3.8/orchestrion/config/knex.d.ts +9 -0
- package/build/types-ts3.8/orchestrion/config/koa.d.ts +17 -0
- package/build/types-ts3.8/orchestrion/config/langchain.d.ts +18 -0
- package/build/types-ts3.8/orchestrion/config/langgraph.d.ts +21 -0
- package/build/types-ts3.8/orchestrion/config/lru-memoizer.d.ts +16 -0
- package/build/types-ts3.8/orchestrion/config/mongodb.d.ts +59 -0
- package/build/types-ts3.8/orchestrion/config/mongoose.d.ts +40 -0
- package/build/types-ts3.8/orchestrion/config/mysql.d.ts +16 -0
- package/build/types-ts3.8/orchestrion/config/mysql2.d.ts +18 -0
- package/build/types-ts3.8/orchestrion/config/nestjs.d.ts +24 -0
- package/build/types-ts3.8/orchestrion/config/openai.d.ts +18 -0
- package/build/types-ts3.8/orchestrion/config/pg.d.ts +33 -0
- package/build/types-ts3.8/orchestrion/config/postgres.d.ts +9 -0
- package/build/types-ts3.8/orchestrion/config/prisma.d.ts +4 -0
- package/build/types-ts3.8/orchestrion/config/react-router.d.ts +4 -0
- package/build/types-ts3.8/orchestrion/config/redis.d.ts +37 -0
- package/build/types-ts3.8/orchestrion/config/remix.d.ts +9 -0
- package/build/types-ts3.8/orchestrion/config/tedious.d.ts +12 -0
- package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +12 -0
- package/build/types-ts3.8/orchestrion/detect.d.ts +26 -0
- package/build/types-ts3.8/orchestrion/index.d.ts +138 -0
- package/build/types-ts3.8/orchestrion/runtime/register.d.ts +25 -0
- package/build/types-ts3.8/prisma/global.d.ts +5 -0
- package/build/types-ts3.8/prisma/index.d.ts +45 -0
- package/build/types-ts3.8/prisma/tracing-helper.d.ts +52 -0
- package/build/types-ts3.8/prisma/types.d.ts +40 -0
- package/build/types-ts3.8/redis/index.d.ts +18 -0
- package/build/types-ts3.8/redis/redis-dc-subscriber.d.ts +89 -0
- package/build/types-ts3.8/redis/redis-statement-serializer.d.ts +6 -0
- package/build/types-ts3.8/tracing-channel.d.ts +73 -0
- package/build/types-ts3.8/vercel-ai/index.d.ts +27 -0
- package/build/types-ts3.8/vercel-ai/util.d.ts +30 -0
- package/build/types-ts3.8/vercel-ai/vercel-ai-dc-subscriber.d.ts +72 -0
- package/build/types-ts3.8/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts +12 -0
- package/changes.json +14 -0
- package/package.json +189 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis.js","sources":["../../../../src/integrations/tracing-channel/redis.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-deprecated -- we intentionally emit the OLD db/net semconv\n to match `@opentelemetry/instrumentation-redis`. TODO(v11): switch to the non-deprecated\n `db.system.name`/`db.query.text`/`server.address`/`server.port` conventions and drop this disable. */\nimport * as diagnosticsChannel from 'node:diagnostics_channel';\nimport {\n DB_OPERATION_BATCH_SIZE,\n DB_STATEMENT,\n DB_SYSTEM,\n DB_SYSTEM_NAME,\n NET_PEER_NAME,\n NET_PEER_PORT,\n SERVER_ADDRESS,\n SERVER_PORT,\n} from '@sentry/conventions/attributes';\nimport type { IntegrationFn, Span, SpanAttributes } from '@sentry/core';\nimport {\n isObjectLike,\n debug,\n defineIntegration,\n getActiveSpan,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n waitForTracingChannelBinding,\n withActiveSpan,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { CHANNELS } from '../../orchestrion/channels';\nimport { defaultDbStatementSerializer } from '../../redis/redis-statement-serializer';\nimport { bindTracingChannelToSpan } from '../../tracing-channel';\n\n// A distinct name from the composite OTel `Redis` integration — they can't share one, and\n// `Redis` stays in the set for its native diagnostics_channel subscriber (node-redis >=5.12 /\n// ioredis >=5.11). When this integration is active, the OTel `RedisInstrumentation` monkey-patch\n// is fully gated off in the node SDK.\nconst INTEGRATION_NAME = 'RedisChannel' as const;\n\nconst ORIGIN = 'auto.db.orchestrion.redis';\n\n// todo(v11): drop this — it is already covered by host and port.\nconst ATTR_DB_CONNECTION_STRING = 'db.connection_string';\nconst DB_SYSTEM_VALUE_REDIS = 'redis';\n\n/** Mirrors `@opentelemetry/instrumentation-redis`' response hook. Not called for failed commands. */\nexport type RedisResponseHook = (span: Span, command: string, args: Array<string | Buffer>, result: unknown) => void;\n\nexport interface RedisChannelIntegrationOptions {\n responseHook?: RedisResponseHook;\n}\n\n/** Structural type for a node-redis (`@redis/client`) command definition. */\ninterface RedisCommandDefinition {\n transformArguments?: (...args: unknown[]) => Array<string | Buffer>;\n}\n\n/** Structural type for the `command_obj` `redis` v2-v3 passes to `internal_send_command`. */\ninterface LegacyRedisCommand {\n command: string;\n args: Array<string | Buffer>;\n callback?: (err: Error | null | undefined, reply: unknown) => unknown;\n}\n\ninterface LegacyRedisClient {\n connection_options?: { host?: string; port?: number };\n address?: string;\n}\n\ninterface NodeRedisClientOptions {\n socket?: { host?: string; port?: number };\n url?: string;\n}\n\ninterface NodeRedisClient {\n options?: NodeRedisClientOptions;\n}\n\ninterface CommandContext {\n arguments?: unknown[];\n self?: unknown;\n result?: unknown;\n error?: unknown;\n}\n\nfunction endSpan(span: Span, err: unknown): void {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err instanceof Error ? err.message : String(err) });\n }\n span.end();\n}\n\nfunction runResponseHook(\n hook: RedisResponseHook | undefined,\n span: Span,\n command: string,\n args: Array<string | Buffer>,\n result: unknown,\n): void {\n if (!hook) {\n return;\n }\n try {\n hook(span, command, args, result);\n } catch {\n // never let a user-provided response hook break instrumentation\n }\n}\n\n// Strip a leading `commandOptions(...)` object (tagged with a `Symbol`) before\n// deriving the wire arguments, mirroring `@redis/client`'s `transformCommandArguments`.\nfunction stripCommandOptions(args: unknown[]): unknown[] {\n const first = args[0];\n if (isObjectLike(first) && Object.getOwnPropertySymbols(first).length > 0) {\n return args.slice(1);\n }\n return args;\n}\n\nfunction removeCredentialsFromConnectionString(url: string | undefined): string | undefined {\n if (typeof url !== 'string' || !url) {\n return undefined;\n }\n try {\n const parsed = new URL(url);\n parsed.searchParams.delete('user_pwd');\n parsed.username = '';\n parsed.password = '';\n return parsed.href;\n } catch {\n return undefined;\n }\n}\n\nfunction nodeRedisAttributes(options: NodeRedisClientOptions | undefined): SpanAttributes {\n return {\n [DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n [NET_PEER_NAME]: options?.socket?.host,\n [NET_PEER_PORT]: options?.socket?.port,\n [ATTR_DB_CONNECTION_STRING]: removeCredentialsFromConnectionString(options?.url),\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n };\n}\n\nfunction startCommandSpan(commandName: string, commandArgs: Array<string | Buffer>, attributes: SpanAttributes): Span {\n return startInactiveSpan({\n name: `redis-${commandName}`,\n kind: SPAN_KIND.CLIENT,\n attributes: {\n ...attributes,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n [DB_STATEMENT]: defaultDbStatementSerializer(commandName, commandArgs),\n },\n });\n}\n\n// --- redis v2-v3: `RedisClient.prototype.internal_send_command(command_obj)` ---\n\n// Settles via `command_obj.callback`, not the sync return — so instead of\n// `bindTracingChannelToSpan` we open the span in `start`, wrap the callback to end it, and end on `error` for sync throws.\nfunction subscribeLegacyRedisCommand(responseHook: RedisResponseHook | undefined): void {\n const channel = diagnosticsChannel.tracingChannel<CommandContext>(CHANNELS.REDIS_COMMAND);\n const noop = (): void => {};\n channel.subscribe({\n end: noop,\n asyncStart: noop,\n asyncEnd: noop,\n start(data) {\n const command = data.arguments?.[0] as LegacyRedisCommand | undefined;\n if (!command || typeof command !== 'object') {\n return;\n }\n // The span is ended via the wrapped callback (or the sync-throw `error` path). A\n // command with no callback has no completion signal to end it on, so don't open one.\n const originalCallback = command.callback;\n if (typeof originalCallback !== 'function') {\n return;\n }\n const client = data.self as LegacyRedisClient | undefined;\n const attributes: SpanAttributes = {\n [DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n };\n\n attributes[NET_PEER_NAME] = client?.connection_options?.host;\n attributes[NET_PEER_PORT] = client?.connection_options?.port;\n\n if (client?.address) {\n attributes[ATTR_DB_CONNECTION_STRING] = `redis://${client.address}`;\n }\n const span = startCommandSpan(command.command, command.args ?? [], attributes);\n (data as CommandContext & { _sentrySpan?: Span })._sentrySpan = span;\n\n const parentSpan = getActiveSpan();\n command.callback = function (this: unknown, err: Error | null | undefined, reply: unknown) {\n if (!err) {\n runResponseHook(responseHook, span, command.command, command.args ?? [], reply);\n }\n endSpan(span, err);\n // eslint-disable-next-line prefer-rest-params\n const args = arguments as unknown as [Error | null | undefined, unknown];\n return withActiveSpan(parentSpan ?? null, () => originalCallback.apply(this, args));\n };\n },\n error(data) {\n // Synchronous throw: the wrapped callback never fires, so end here instead.\n const span = (data as CommandContext & { _sentrySpan?: Span })._sentrySpan;\n if (span) {\n endSpan(span, data.error);\n }\n },\n });\n}\n\n// --- node-redis v4/v5 (`@redis/client`) ---\n\nfunction bindNodeRedisCommandChannel(\n channelName: string,\n getWireArgs: (data: CommandContext) => Array<string | Buffer> | undefined,\n responseHook: RedisResponseHook | undefined,\n): void {\n const channel = diagnosticsChannel.tracingChannel<CommandContext, CommandContext>(channelName);\n bindTracingChannelToSpan(\n channel,\n data => {\n const wireArgs = getWireArgs(data);\n if (!wireArgs?.length) {\n return undefined;\n }\n const commandName = String(wireArgs[0]);\n const options = (data.self as NodeRedisClient | undefined)?.options;\n return startCommandSpan(commandName, wireArgs.slice(1), nodeRedisAttributes(options));\n },\n {\n beforeSpanEnd(span, data) {\n if ('error' in data || !responseHook) {\n return;\n }\n const wireArgs = getWireArgs(data);\n if (wireArgs?.length) {\n runResponseHook(responseHook, span, String(wireArgs[0]), wireArgs.slice(1), data.result);\n }\n },\n },\n );\n}\n\n// `sendCommand(args, options)` — `args` are already the wire arguments.\nfunction getSendCommandArgs(data: CommandContext): Array<string | Buffer> | undefined {\n const args = data.arguments?.[0];\n return Array.isArray(args) ? (args as Array<string | Buffer>) : undefined;\n}\n\n// `commandsExecutor(command, jsArgs)` — derive the wire arguments the same way\n// `@redis/client` does internally, via `command.transformArguments`.\nfunction getExecutorArgs(data: CommandContext): Array<string | Buffer> | undefined {\n const command = data.arguments?.[0] as RedisCommandDefinition | undefined;\n const jsArgs = data.arguments?.[1];\n if (typeof command?.transformArguments !== 'function' || !Array.isArray(jsArgs)) {\n return undefined;\n }\n try {\n return command.transformArguments(...stripCommandOptions(jsArgs));\n } catch {\n return undefined;\n }\n}\n\nfunction bindNodeRedisConnectChannel(): void {\n const channel = diagnosticsChannel.tracingChannel<CommandContext, CommandContext>(CHANNELS.NODE_REDIS_CONNECT);\n bindTracingChannelToSpan(channel, data => {\n const options = (data.self as NodeRedisClient | undefined)?.options;\n return startInactiveSpan({\n name: 'redis-connect',\n kind: SPAN_KIND.CLIENT,\n attributes: { ...nodeRedisAttributes(options), [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db' },\n });\n });\n}\n\n// Batch (multi/pipeline): one span per `exec`. Batched commands bypass `sendCommand`, so\n// the executor's `ctx.arguments[0]` (the queued commands) gives the batch size. Span shape\n// mirrors the native `node-redis:batch` span (see `redis-dc-subscriber.ts`).\nfunction bindNodeRedisBatchChannel(channelName: string, getOperation: (data: CommandContext) => string): void {\n const channel = diagnosticsChannel.tracingChannel<CommandContext, CommandContext>(channelName);\n bindTracingChannelToSpan(channel, data => {\n const commands = data.arguments?.[0];\n const size = Array.isArray(commands) ? commands.length : undefined;\n const socket = (data.self as NodeRedisClient | undefined)?.options?.socket;\n return startInactiveSpan({\n name: getOperation(data),\n kind: SPAN_KIND.CLIENT,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db.redis',\n [DB_SYSTEM_NAME]: DB_SYSTEM_VALUE_REDIS,\n ...(size && size > 1 ? { [DB_OPERATION_BATCH_SIZE]: size } : {}),\n ...(socket?.host != null ? { [SERVER_ADDRESS]: socket.host } : {}),\n ...(socket?.port != null ? { [SERVER_PORT]: socket.port } : {}),\n },\n });\n });\n}\n\nconst _redisChannelIntegration = ((options: RedisChannelIntegrationOptions = {}) => {\n const responseHook = options.responseHook;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n DEBUG_BUILD &&\n debug.log(`[orchestrion:redis] subscribing to \"${CHANNELS.REDIS_COMMAND}\" and node-redis channels`);\n\n // redis v2-v3 uses a nested callback rather than `bindStore`, so it can be\n // subscribed synchronously here.\n subscribeLegacyRedisCommand(responseHook);\n\n waitForTracingChannelBinding(() => {\n bindNodeRedisCommandChannel(CHANNELS.NODE_REDIS_COMMAND, getSendCommandArgs, responseHook);\n bindNodeRedisCommandChannel(CHANNELS.NODE_REDIS_EXECUTOR, getExecutorArgs, responseHook);\n bindNodeRedisConnectChannel();\n bindNodeRedisBatchChannel(CHANNELS.NODE_REDIS_MULTI, () => 'MULTI');\n bindNodeRedisBatchChannel(CHANNELS.NODE_REDIS_PIPELINE, () => 'PIPELINE');\n bindNodeRedisBatchChannel(CHANNELS.NODE_REDIS_BATCH, data =>\n data.arguments?.[2] !== undefined ? 'MULTI' : 'PIPELINE',\n );\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * EXPERIMENTAL — orchestrion-driven redis integration for `redis` v2-v3 and\n * node-redis v4/v5 `<5.12.0` (`@redis/client`). Covers single commands, `connect`,\n * and multi/pipeline batches, fully replacing `@opentelemetry/instrumentation-redis`.\n * Requires the orchestrion runtime hook or bundler plugin.\n */\nexport const redisChannelIntegration = defineIntegration(_redisChannelIntegration);\n"],"names":["SPAN_STATUS_ERROR","isObjectLike","DB_SYSTEM","NET_PEER_NAME","NET_PEER_PORT","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","attributes","startInactiveSpan","SPAN_KIND","SEMANTIC_ATTRIBUTE_SENTRY_OP","DB_STATEMENT","defaultDbStatementSerializer","CHANNELS","getActiveSpan","withActiveSpan","bindTracingChannelToSpan","DB_SYSTEM_NAME","DB_OPERATION_BATCH_SIZE","SERVER_ADDRESS","SERVER_PORT","DEBUG_BUILD","debug","waitForTracingChannelBinding","defineIntegration"],"mappings":";;;;;;;;;;AAqCA,MAAM,gBAAA,GAAmB,cAAA;AAEzB,MAAM,MAAA,GAAS,2BAAA;AAGf,MAAM,yBAAA,GAA4B,sBAAA;AAClC,MAAM,qBAAA,GAAwB,OAAA;AA0C9B,SAAS,OAAA,CAAQ,MAAY,GAAA,EAAoB;AAC/C,EAAA,IAAI,GAAA,EAAK;AACP,IAAA,IAAA,CAAK,SAAA,CAAU,EAAE,IAAA,EAAMA,sBAAA,EAAmB,OAAA,EAAS,GAAA,YAAe,KAAA,GAAQ,GAAA,CAAI,OAAA,GAAU,MAAA,CAAO,GAAG,CAAA,EAAG,CAAA;AAAA,EACvG;AACA,EAAA,IAAA,CAAK,GAAA,EAAI;AACX;AAEA,SAAS,eAAA,CACP,IAAA,EACA,IAAA,EACA,OAAA,EACA,MACA,MAAA,EACM;AACN,EAAA,IAAI,CAAC,IAAA,EAAM;AACT,IAAA;AAAA,EACF;AACA,EAAA,IAAI;AACF,IAAA,IAAA,CAAK,IAA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gBAAA;AAAA,UAAkB,UACnD,IAAA,CAAK,SAAA,GAAY,CAAC,CAAA,KAAM,SAAY,OAAA,GAAU;AAAA,SAChD;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAA,CAAA;AAQO,MAAM,uBAAA,GAA0BW,uBAAkB,wBAAwB;;;;"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const node_events = require('node:events');
|
|
4
|
+
const diagnosticsChannel = require('node:diagnostics_channel');
|
|
5
|
+
const core = require('@sentry/core');
|
|
6
|
+
const attributes = require('@sentry/conventions/attributes');
|
|
7
|
+
const debugBuild = require('../../debug-build.js');
|
|
8
|
+
const channels = require('../../orchestrion/channels.js');
|
|
9
|
+
|
|
10
|
+
const INTEGRATION_NAME = "Tedious";
|
|
11
|
+
const ORIGIN = "auto.db.orchestrion.tedious";
|
|
12
|
+
const DB_SYSTEM_VALUE_MSSQL = "mssql";
|
|
13
|
+
const ATTR_DB_SQL_TABLE = "db.sql.table";
|
|
14
|
+
const currentDatabaseSymbol = /* @__PURE__ */ Symbol("sentry.orchestrion.tedious.current-database");
|
|
15
|
+
function setDatabase(databaseName) {
|
|
16
|
+
Object.defineProperty(this, currentDatabaseSymbol, { value: databaseName, writable: true, configurable: true });
|
|
17
|
+
}
|
|
18
|
+
function removeDatabaseListener() {
|
|
19
|
+
this.removeListener("databaseChange", setDatabase);
|
|
20
|
+
}
|
|
21
|
+
function subscribeConnect() {
|
|
22
|
+
diagnosticsChannel.tracingChannel(channels.CHANNELS.TEDIOUS_CONNECT).start.subscribe((message) => {
|
|
23
|
+
const connection = message.self;
|
|
24
|
+
if (!connection) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
setDatabase.call(connection, connection.config?.options?.database);
|
|
28
|
+
connection.removeListener("databaseChange", setDatabase);
|
|
29
|
+
connection.on("databaseChange", setDatabase);
|
|
30
|
+
connection.removeListener("end", removeDatabaseListener);
|
|
31
|
+
connection.once("end", removeDatabaseListener);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function subscribeQuery(channelName, operation) {
|
|
35
|
+
diagnosticsChannel.tracingChannel(channelName).start.subscribe((message) => {
|
|
36
|
+
const data = message;
|
|
37
|
+
const connection = data.self;
|
|
38
|
+
const request = data.arguments[0];
|
|
39
|
+
if (!connection || !(request instanceof node_events.EventEmitter)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
let procCount = 0;
|
|
43
|
+
let statementCount = 0;
|
|
44
|
+
const incrementStatementCount = () => {
|
|
45
|
+
statementCount++;
|
|
46
|
+
};
|
|
47
|
+
const incrementProcCount = () => {
|
|
48
|
+
procCount++;
|
|
49
|
+
};
|
|
50
|
+
const databaseName = connection[currentDatabaseSymbol];
|
|
51
|
+
const sql = extractSql(request);
|
|
52
|
+
const attributes$1 = {
|
|
53
|
+
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
|
|
54
|
+
[attributes.DB_SYSTEM]: DB_SYSTEM_VALUE_MSSQL,
|
|
55
|
+
[attributes.DB_NAME]: databaseName,
|
|
56
|
+
// `>=4` uses the `authentication` object; older versions expose `userName` directly.
|
|
57
|
+
[attributes.DB_USER]: connection.config?.userName ?? connection.config?.authentication?.options?.userName,
|
|
58
|
+
[attributes.DB_STATEMENT]: sql,
|
|
59
|
+
[ATTR_DB_SQL_TABLE]: request.table,
|
|
60
|
+
[attributes.NET_PEER_NAME]: connection.config?.server,
|
|
61
|
+
[attributes.NET_PEER_PORT]: connection.config?.options?.port
|
|
62
|
+
};
|
|
63
|
+
const span = core.startInactiveSpan({
|
|
64
|
+
name: getSpanName(operation, databaseName, sql, request.table),
|
|
65
|
+
kind: core.SPAN_KIND.CLIENT,
|
|
66
|
+
op: "db",
|
|
67
|
+
attributes: attributes$1
|
|
68
|
+
});
|
|
69
|
+
const endSpan = once((err) => {
|
|
70
|
+
request.removeListener("done", incrementStatementCount);
|
|
71
|
+
request.removeListener("doneInProc", incrementStatementCount);
|
|
72
|
+
request.removeListener("doneProc", incrementProcCount);
|
|
73
|
+
request.removeListener("error", endSpan);
|
|
74
|
+
connection.removeListener("end", endSpan);
|
|
75
|
+
span.setAttribute("tedious.procedure_count", procCount);
|
|
76
|
+
span.setAttribute("tedious.statement_count", statementCount);
|
|
77
|
+
if (err) {
|
|
78
|
+
span.setStatus({ code: core.SPAN_STATUS_ERROR, message: err.message });
|
|
79
|
+
}
|
|
80
|
+
span.end();
|
|
81
|
+
});
|
|
82
|
+
request.on("done", incrementStatementCount);
|
|
83
|
+
request.on("doneInProc", incrementStatementCount);
|
|
84
|
+
request.on("doneProc", incrementProcCount);
|
|
85
|
+
request.once("error", endSpan);
|
|
86
|
+
connection.on("end", endSpan);
|
|
87
|
+
if (typeof request.callback === "function") {
|
|
88
|
+
const originalCallback = request.callback;
|
|
89
|
+
request.callback = function(...args) {
|
|
90
|
+
endSpan(args[0]);
|
|
91
|
+
return originalCallback.apply(this, args);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function extractSql(request) {
|
|
97
|
+
if (request.sqlTextOrProcedure === "sp_prepare" && request.parametersByName?.stmt?.value != null) {
|
|
98
|
+
const value = request.parametersByName.stmt.value;
|
|
99
|
+
return typeof value === "string" ? value : void 0;
|
|
100
|
+
}
|
|
101
|
+
return request.sqlTextOrProcedure;
|
|
102
|
+
}
|
|
103
|
+
function getSpanName(operation, db, sql, bulkLoadTable) {
|
|
104
|
+
if (operation === "execBulkLoad" && bulkLoadTable && db) {
|
|
105
|
+
return `${operation} ${bulkLoadTable} ${db}`;
|
|
106
|
+
}
|
|
107
|
+
if (operation === "callProcedure") {
|
|
108
|
+
return db ? `${operation} ${sql} ${db}` : `${operation} ${sql}`;
|
|
109
|
+
}
|
|
110
|
+
return db ? `${operation} ${db}` : operation;
|
|
111
|
+
}
|
|
112
|
+
function once(fn) {
|
|
113
|
+
let called = false;
|
|
114
|
+
return (...args) => {
|
|
115
|
+
if (called) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
called = true;
|
|
119
|
+
fn(...args);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
const _tediousChannelIntegration = (() => {
|
|
123
|
+
return {
|
|
124
|
+
name: INTEGRATION_NAME,
|
|
125
|
+
setupOnce() {
|
|
126
|
+
if (!diagnosticsChannel.tracingChannel) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:tedious] subscribing to channel "${channels.CHANNELS.TEDIOUS_EXEC_SQL}"`);
|
|
130
|
+
core.waitForTracingChannelBinding(() => {
|
|
131
|
+
subscribeConnect();
|
|
132
|
+
subscribeQuery(channels.CHANNELS.TEDIOUS_EXEC_SQL, "execSql");
|
|
133
|
+
subscribeQuery(channels.CHANNELS.TEDIOUS_EXEC_SQL_BATCH, "execSqlBatch");
|
|
134
|
+
subscribeQuery(channels.CHANNELS.TEDIOUS_CALL_PROCEDURE, "callProcedure");
|
|
135
|
+
subscribeQuery(channels.CHANNELS.TEDIOUS_EXEC_BULK_LOAD, "execBulkLoad");
|
|
136
|
+
subscribeQuery(channels.CHANNELS.TEDIOUS_PREPARE, "prepare");
|
|
137
|
+
subscribeQuery(channels.CHANNELS.TEDIOUS_EXECUTE, "execute");
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
const tediousChannelIntegration = core.defineIntegration(_tediousChannelIntegration);
|
|
143
|
+
|
|
144
|
+
exports.tediousChannelIntegration = tediousChannelIntegration;
|
|
145
|
+
//# sourceMappingURL=tedious.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tedious.js","sources":["../../../../src/integrations/tracing-channel/tedious.ts"],"sourcesContent":["// The `@sentry/conventions` db/net attribute keys are deprecated (superseded by newer semconv), but we\n// emit them deliberately to preserve parity with what `@opentelemetry/instrumentation-tedious` produced.\n/* oxlint-disable typescript/no-deprecated */\n\nimport { EventEmitter } from 'node:events';\nimport * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn, SpanAttributes } from '@sentry/core';\nimport {\n debug,\n defineIntegration,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n waitForTracingChannelBinding,\n} from '@sentry/core';\nimport {\n DB_NAME,\n DB_STATEMENT,\n DB_SYSTEM,\n DB_USER,\n NET_PEER_NAME,\n NET_PEER_PORT,\n} from '@sentry/conventions/attributes';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { CHANNELS } from '../../orchestrion/channels';\n\n// NOTE: this uses the same name as the OTel integration by design. When orchestrion injection is active,\n// `_init` swaps the OTel `Tedious` integration out of the defaults and appends this one (matched by name).\nconst INTEGRATION_NAME = 'Tedious' as const;\nconst ORIGIN = 'auto.db.orchestrion.tedious';\n\n// OTel db/net semantic-convention values/keys not exported by `@sentry/conventions`, inlined to match\n// what `@opentelemetry/instrumentation-tedious` emitted.\nconst DB_SYSTEM_VALUE_MSSQL = 'mssql';\nconst ATTR_DB_SQL_TABLE = 'db.sql.table';\n\n// Tracks the connection's active database (updated on `databaseChange`), read into `db.name` when a query\n// runs. Mirrors the `CURRENT_DATABASE` symbol the vendored OTel instrumentation stashed on the connection.\nconst currentDatabaseSymbol = Symbol('sentry.orchestrion.tedious.current-database');\n\ntype UnknownFunction = (...args: unknown[]) => unknown;\n\ninterface TediousConnectionConfig {\n server?: string;\n userName?: string;\n authentication?: { options?: { userName?: string } };\n options?: { database?: string; port?: number };\n}\n\ninterface TediousConnection extends EventEmitter {\n config?: TediousConnectionConfig;\n [currentDatabaseSymbol]?: string;\n}\n\ninterface TediousRequest extends EventEmitter {\n sqlTextOrProcedure?: string;\n callback?: UnknownFunction;\n table?: string;\n parametersByName?: Record<string, { value?: unknown } | undefined>;\n}\n\n/** Context orchestrion attaches to the query channels (wrapping the `Connection` request methods). */\ninterface TediousQueryChannelContext {\n // `arguments[0]` is the `Request` (or `BulkLoad` for `execBulkLoad`), both `EventEmitter`s.\n arguments: [TediousRequest?, ...unknown[]];\n self?: TediousConnection;\n moduleVersion?: string;\n}\n\n/** Context orchestrion attaches to the `Connection.connect` channel. */\ninterface TediousConnectChannelContext {\n arguments: unknown[];\n self?: TediousConnection;\n}\n\n// Used both to seed the initial database and as the `databaseChange` listener, where `this` is the\n// connection (a non-arrow listener). Keeping one shared reference lets `removeListener` find it again.\nfunction setDatabase(this: TediousConnection, databaseName: string | undefined): void {\n Object.defineProperty(this, currentDatabaseSymbol, { value: databaseName, writable: true, configurable: true });\n}\n\n// The `end` cleanup listener, where `this` is the connection (a non-arrow listener). Named (like\n// `setDatabase`) so repeated `connect` calls can `removeListener` it rather than accumulate anonymous ones.\nfunction removeDatabaseListener(this: TediousConnection): void {\n this.removeListener('databaseChange', setDatabase);\n}\n\nfunction subscribeConnect(): void {\n diagnosticsChannel.tracingChannel(CHANNELS.TEDIOUS_CONNECT).start.subscribe(message => {\n const connection = (message as TediousConnectChannelContext).self;\n if (!connection) {\n return;\n }\n\n setDatabase.call(connection, connection.config?.options?.database);\n\n // Remove first in case `connect` runs more than once on the same connection, so neither listener\n // accumulates across reconnects.\n connection.removeListener('databaseChange', setDatabase);\n connection.on('databaseChange', setDatabase);\n connection.removeListener('end', removeDatabaseListener);\n connection.once('end', removeDatabaseListener);\n });\n}\n\nfunction subscribeQuery(channelName: string, operation: string): void {\n diagnosticsChannel.tracingChannel(channelName).start.subscribe(message => {\n const data = message as TediousQueryChannelContext;\n const connection = data.self;\n const request = data.arguments[0];\n\n // The vendored instrumentation only traced when the first argument is an `EventEmitter` (a `Request`\n // or `BulkLoad`); anything else is left untouched.\n if (!connection || !(request instanceof EventEmitter)) {\n return;\n }\n\n let procCount = 0;\n let statementCount = 0;\n const incrementStatementCount = (): void => {\n statementCount++;\n };\n const incrementProcCount = (): void => {\n procCount++;\n };\n\n const databaseName = connection[currentDatabaseSymbol];\n const sql = extractSql(request);\n\n const attributes: SpanAttributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [DB_SYSTEM]: DB_SYSTEM_VALUE_MSSQL,\n [DB_NAME]: databaseName,\n // `>=4` uses the `authentication` object; older versions expose `userName` directly.\n [DB_USER]: connection.config?.userName ?? connection.config?.authentication?.options?.userName,\n [DB_STATEMENT]: sql,\n [ATTR_DB_SQL_TABLE]: request.table,\n [NET_PEER_NAME]: connection.config?.server,\n [NET_PEER_PORT]: connection.config?.options?.port,\n };\n\n const span = startInactiveSpan({\n name: getSpanName(operation, databaseName, sql, request.table),\n kind: SPAN_KIND.CLIENT,\n op: 'db',\n attributes,\n });\n\n const endSpan = once((err?: { message?: string }): void => {\n request.removeListener('done', incrementStatementCount);\n request.removeListener('doneInProc', incrementStatementCount);\n request.removeListener('doneProc', incrementProcCount);\n request.removeListener('error', endSpan);\n connection.removeListener('end', endSpan);\n\n span.setAttribute('tedious.procedure_count', procCount);\n span.setAttribute('tedious.statement_count', statementCount);\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });\n }\n\n span.end();\n });\n\n request.on('done', incrementStatementCount);\n request.on('doneInProc', incrementStatementCount);\n request.on('doneProc', incrementProcCount);\n request.once('error', endSpan);\n connection.on('end', endSpan);\n\n // tedious invokes `request.callback` when the request settles (passing the error, if any). Wrapping it\n // here (at `start`, before the method body dispatches) is the completion signal. A failed non-preparing\n // request reports its error only through this callback, not via an `'error'` event.\n if (typeof request.callback === 'function') {\n const originalCallback = request.callback;\n request.callback = function (this: unknown, ...args: unknown[]): unknown {\n endSpan(args[0] as { message?: string } | undefined);\n\n return originalCallback.apply(this, args);\n };\n }\n });\n}\n\nfunction extractSql(request: TediousRequest): string | undefined {\n // Required for <11.0.9: the SQL for a prepared statement is carried in the `stmt` parameter.\n if (request.sqlTextOrProcedure === 'sp_prepare' && request.parametersByName?.stmt?.value != null) {\n const value = request.parametersByName.stmt.value;\n\n return typeof value === 'string' ? value : undefined;\n }\n\n return request.sqlTextOrProcedure;\n}\n\n/**\n * The span name is a low-cardinality label for the operation; the SDK's db-span inference later renames\n * the span description off `db.statement` when present. Mirrors the vendored OTel `getSpanName`.\n */\nfunction getSpanName(\n operation: string,\n db: string | undefined,\n sql: string | undefined,\n bulkLoadTable: string | undefined,\n): string {\n if (operation === 'execBulkLoad' && bulkLoadTable && db) {\n return `${operation} ${bulkLoadTable} ${db}`;\n }\n if (operation === 'callProcedure') {\n // `sql` refers to the procedure name for `callProcedure`.\n return db ? `${operation} ${sql} ${db}` : `${operation} ${sql}`;\n }\n // Avoid `sql` in the general case because of its high cardinality.\n return db ? `${operation} ${db}` : operation;\n}\n\nfunction once<Args extends unknown[]>(fn: (...args: Args) => void): (...args: Args) => void {\n let called = false;\n\n return (...args: Args): void => {\n if (called) {\n return;\n }\n called = true;\n fn(...args);\n };\n}\n\nconst _tediousChannelIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // `tracingChannel` is unavailable before Node 18.19 so do nothing in that case.\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n DEBUG_BUILD && debug.log(`[orchestrion:tedious] subscribing to channel \"${CHANNELS.TEDIOUS_EXEC_SQL}\"`);\n\n waitForTracingChannelBinding(() => {\n subscribeConnect();\n subscribeQuery(CHANNELS.TEDIOUS_EXEC_SQL, 'execSql');\n subscribeQuery(CHANNELS.TEDIOUS_EXEC_SQL_BATCH, 'execSqlBatch');\n subscribeQuery(CHANNELS.TEDIOUS_CALL_PROCEDURE, 'callProcedure');\n subscribeQuery(CHANNELS.TEDIOUS_EXEC_BULK_LOAD, 'execBulkLoad');\n subscribeQuery(CHANNELS.TEDIOUS_PREPARE, 'prepare');\n subscribeQuery(CHANNELS.TEDIOUS_EXECUTE, 'execute');\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * EXPERIMENTAL - orchestrion-driven tedious integration.\n *\n * Subscribes to the `orchestrion:tedious:*` diagnostics_channels that the orchestrion code transform\n * injects into tedious's `Connection` request methods (each traced as one db span) and `Connection.connect`\n * (active-database bookkeeping). Requires the orchestrion runtime hook or bundler plugin to be active.\n */\nexport const tediousChannelIntegration = defineIntegration(_tediousChannelIntegration);\n"],"names":["CHANNELS","EventEmitter","attributes","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","DB_SYSTEM","DB_NAME","DB_USER","DB_STATEMENT","NET_PEER_NAME","NET_PEER_PORT","startInactiveSpan","SPAN_KIND","SPAN_STATUS_ERROR","DEBUG_BUILD","debug","waitForTracingChannelBinding","defineIntegration"],"mappings":";;;;;;;;;AA6BA,MAAM,gBAAA,GAAmB,SAAA;AACzB,MAAM,MAAA,GAAS,6BAAA;AAIf,MAAM,qBAAA,GAAwB,OAAA;AAC9B,MAAM,iBAAA,GAAoB,cAAA;AAI1B,MAAM,qBAAA,0BAA+B,6CAA6C,CAAA;AAuClF,SAAS,YAAqC,YAAA,EAAwC;AACpF,EAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,qBAAA,EAAuB,EAAE,KAAA,EAAO,cAAc,QAAA,EAAU,IAAA,EAAM,YAAA,EAAc,IAAA,EAAM,CAAA;AAChH;AAIA,SAAS,sBAAA,GAAsD;AAC7D,EAAA,IAAA,CAAK,cAAA,CAAe,kBAAkB,WAAW,CAAA;AACnD;AAEA,SAAS,gBAAA,GAAyB;AAChC,EAAA,kBAAA,CAAmB,eAAeA,iBAAA,CAAS,eAAe,CAAA,CAAE,KAAA,CAAM,UAAU,CAAA,OAAA,KAAW;AACrF,IAAA,MAAM,aAAc,OAAA,CAAyC,IAAA;AAC7D,IAAA,IAAI,CAAC,UAAA,EAAY;AACf,MAAA;AAAA,IACF;AAEA,IAAA,WAAA,CAAY,IAAA,CAAK,UAAA,EAAY,UAAA,CAAW,MAAA,EAAQ,SAAS,QAAQ,CAAA;AAIjE,IAA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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const index = require('../../vercel-ai/index.js');
|
|
5
|
+
const diagnosticsChannel = require('node:diagnostics_channel');
|
|
6
|
+
const vercelAiOrchestrionSubscriber = require('../../vercel-ai/vercel-ai-orchestrion-subscriber.js');
|
|
7
|
+
|
|
8
|
+
const _vercelAiChannelIntegration = ((options = {}) => {
|
|
9
|
+
const parentIntegration = index.vercelAiIntegration(options);
|
|
10
|
+
return core.extendIntegration(parentIntegration, {
|
|
11
|
+
options,
|
|
12
|
+
setupOnce() {
|
|
13
|
+
if (!diagnosticsChannel.tracingChannel) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
core.waitForTracingChannelBinding(() => {
|
|
17
|
+
vercelAiOrchestrionSubscriber.subscribeVercelAiOrchestrionChannels(diagnosticsChannel.tracingChannel, options);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
const vercelAiChannelIntegration = core.defineIntegration(_vercelAiChannelIntegration);
|
|
23
|
+
|
|
24
|
+
exports.vercelAiChannelIntegration = vercelAiChannelIntegration;
|
|
25
|
+
//# sourceMappingURL=vercel-ai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel-ai.js","sources":["../../../../src/integrations/tracing-channel/vercel-ai.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration, waitForTracingChannelBinding } from '@sentry/core';\nimport { vercelAiIntegration as baseVercelAiIntegration } from '../../vercel-ai';\nimport * as dc from 'node:diagnostics_channel';\nimport { subscribeVercelAiOrchestrionChannels } from '../../vercel-ai/vercel-ai-orchestrion-subscriber';\n\ntype VercelAiOptions = Parameters<typeof baseVercelAiIntegration>[0];\n\n// In channel-based (orchestrion) mode we emit our own `gen_ai.*` spans from the\n// diagnostics channels. The `ai` SDK would otherwise emit its own native\n// OpenTelemetry spans whenever the user enables `experimental_telemetry`, which\n// would be duplicates. Rather than dropping those after the fact, the v6\n// subscriber suppresses them at the source: it flips the wrapped call's\n// `experimental_telemetry.isEnabled` to `false`, so `ai` falls back to its\n// internal no-op tracer and never creates the native spans in the first place.\n// See `subscribeVercelAiOrchestrionChannels`.\nconst _vercelAiChannelIntegration = ((options: VercelAiOptions = {}) => {\n const parentIntegration = baseVercelAiIntegration(options);\n\n return extendIntegration(parentIntegration, {\n options,\n setupOnce() {\n // Bail if this is not available\n if (!dc.tracingChannel) {\n return;\n }\n\n waitForTracingChannelBinding(() => {\n subscribeVercelAiOrchestrionChannels(dc.tracingChannel, options);\n });\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Auto-instrument the `ai` SDK. Supported are:\n * - v7 via native `ai:telemetry` tracing channel\n * - v4, v5 & v6 via orchestrion `orchestrion:ai:*` channels\n */\nexport const vercelAiChannelIntegration = defineIntegration(_vercelAiChannelIntegration);\n"],"names":["baseVercelAiIntegration","extendIntegration","dc","waitForTracingChannelBinding","subscribeVercelAiOrchestrionChannels","defineIntegration"],"mappings":";;;;;;;AAgBA,MAAM,2BAAA,IAA+B,CAAC,OAAA,GAA2B,EAAC,KAAM;AACtE,EAAA,MAAM,iBAAA,GAAoBA,0BAAwB,OAAO,CAAA;AAEzD,EAAA,OAAOC,uBAAkB,iBAAA,EAAmB;AAAA,IAC1C,OAAA;AAAA,IACA,SAAA,GAAY;AAEV,MAAA,IAAI,CAACC,mBAAG,cAAA,EAAgB;AACtB,QAAA;AAAA,MACF;AAEA,MAAAC,iCAAA,CAA6B,MAAM;AACjC,QAAAC,kEAAA,CAAqCF,kBAAA,CAAG,gBAAgB,OAAO,CAAA;AAAA,MACjE,CAAC,CAAA;AAAA,IACH;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAOO,MAAM,0BAAA,GAA6BG,uBAAkB,2BAA2B;;;;"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
|
|
5
|
+
const ATTR_DB_SYSTEM = "db.system";
|
|
6
|
+
const ATTR_DB_NAME = "db.name";
|
|
7
|
+
const ATTR_DB_OPERATION = "db.operation";
|
|
8
|
+
const ATTR_DB_STATEMENT = "db.statement";
|
|
9
|
+
const ATTR_DB_MONGODB_COLLECTION = "db.mongodb.collection";
|
|
10
|
+
const ATTR_DB_CONNECTION_STRING = "db.connection_string";
|
|
11
|
+
const ATTR_NET_PEER_NAME = "net.peer.name";
|
|
12
|
+
const ATTR_NET_PEER_PORT = "net.peer.port";
|
|
13
|
+
const DB_SYSTEM_VALUE_MONGODB = "mongodb";
|
|
14
|
+
function serializeDbStatement(commandObj) {
|
|
15
|
+
return JSON.stringify(scrubStatement(commandObj));
|
|
16
|
+
}
|
|
17
|
+
function scrubStatement(value) {
|
|
18
|
+
if (Array.isArray(value)) {
|
|
19
|
+
return value.map((element) => scrubStatement(element));
|
|
20
|
+
}
|
|
21
|
+
if (isCommandObj(value)) {
|
|
22
|
+
const initial = {};
|
|
23
|
+
return Object.entries(value).map(([key, element]) => [key, scrubStatement(element)]).reduce((prev, current) => {
|
|
24
|
+
if (isCommandEntry(current)) {
|
|
25
|
+
prev[current[0]] = current[1];
|
|
26
|
+
}
|
|
27
|
+
return prev;
|
|
28
|
+
}, initial);
|
|
29
|
+
}
|
|
30
|
+
return "?";
|
|
31
|
+
}
|
|
32
|
+
function isCommandObj(value) {
|
|
33
|
+
return core.isObjectLike(value) && !isBuffer(value);
|
|
34
|
+
}
|
|
35
|
+
function isBuffer(value) {
|
|
36
|
+
return typeof Buffer !== "undefined" && Buffer.isBuffer(value);
|
|
37
|
+
}
|
|
38
|
+
function isCommandEntry(value) {
|
|
39
|
+
return Array.isArray(value);
|
|
40
|
+
}
|
|
41
|
+
function getV4SpanAttributes(connectionCtx, ns, command, operation, origin) {
|
|
42
|
+
let host;
|
|
43
|
+
let port;
|
|
44
|
+
if (connectionCtx) {
|
|
45
|
+
const hostParts = typeof connectionCtx.address === "string" ? connectionCtx.address.split(":") : "";
|
|
46
|
+
if (hostParts.length === 2) {
|
|
47
|
+
host = hostParts[0];
|
|
48
|
+
port = hostParts[1];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
let commandObj;
|
|
52
|
+
if (command?.documents?.[0]) {
|
|
53
|
+
commandObj = command.documents[0];
|
|
54
|
+
} else if (command?.cursors) {
|
|
55
|
+
commandObj = command.cursors;
|
|
56
|
+
} else {
|
|
57
|
+
commandObj = command;
|
|
58
|
+
}
|
|
59
|
+
return getSpanAttributes(ns.db, ns.collection, host, port, commandObj, operation, origin);
|
|
60
|
+
}
|
|
61
|
+
function getSpanAttributes(dbName, dbCollection, host, port, commandObj, operation, origin) {
|
|
62
|
+
const attributes = {
|
|
63
|
+
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin,
|
|
64
|
+
[ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_MONGODB,
|
|
65
|
+
[ATTR_DB_NAME]: dbName,
|
|
66
|
+
[ATTR_DB_MONGODB_COLLECTION]: dbCollection,
|
|
67
|
+
[ATTR_DB_OPERATION]: operation,
|
|
68
|
+
[ATTR_DB_CONNECTION_STRING]: `mongodb://${host}:${port}/${dbName}`
|
|
69
|
+
};
|
|
70
|
+
if (host && port) {
|
|
71
|
+
attributes[ATTR_NET_PEER_NAME] = host;
|
|
72
|
+
const portNumber = parseInt(port, 10);
|
|
73
|
+
if (!isNaN(portNumber)) {
|
|
74
|
+
attributes[ATTR_NET_PEER_PORT] = portNumber;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (commandObj) {
|
|
78
|
+
try {
|
|
79
|
+
attributes[ATTR_DB_STATEMENT] = serializeDbStatement(commandObj);
|
|
80
|
+
} catch {
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return attributes;
|
|
84
|
+
}
|
|
85
|
+
function getV3CommandOperation(command) {
|
|
86
|
+
if (command.createIndexes !== void 0) {
|
|
87
|
+
return "createIndexes";
|
|
88
|
+
} else if (command.findandmodify !== void 0) {
|
|
89
|
+
return "findAndModify";
|
|
90
|
+
} else if (command.ismaster !== void 0) {
|
|
91
|
+
return "isMaster";
|
|
92
|
+
} else if (command.count !== void 0) {
|
|
93
|
+
return "count";
|
|
94
|
+
} else if (command.aggregate !== void 0) {
|
|
95
|
+
return "aggregate";
|
|
96
|
+
}
|
|
97
|
+
return void 0;
|
|
98
|
+
}
|
|
99
|
+
function getV3SpanAttributes(ns, topology, command, operation, origin) {
|
|
100
|
+
let host;
|
|
101
|
+
let port;
|
|
102
|
+
if (topology?.s) {
|
|
103
|
+
host = topology.s.options?.host ?? topology.s.host;
|
|
104
|
+
port = (topology.s.options?.port ?? topology.s.port)?.toString();
|
|
105
|
+
if (host == null || port == null) {
|
|
106
|
+
const address = topology.description?.address;
|
|
107
|
+
if (address) {
|
|
108
|
+
const segments = address.split(":");
|
|
109
|
+
host = segments[0];
|
|
110
|
+
port = segments[1];
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const [dbName, dbCollection] = ns.toString().split(".");
|
|
115
|
+
const commandObj = command?.query ?? command?.q ?? command;
|
|
116
|
+
return getSpanAttributes(dbName, dbCollection, host, port, commandObj, operation, origin);
|
|
117
|
+
}
|
|
118
|
+
function startMongoSpan(attributes) {
|
|
119
|
+
return core.startInactiveSpan({
|
|
120
|
+
name: `mongodb.${attributes[ATTR_DB_OPERATION] || "command"}`,
|
|
121
|
+
op: "db",
|
|
122
|
+
kind: core.SPAN_KIND.CLIENT,
|
|
123
|
+
attributes
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
exports.getSpanAttributes = getSpanAttributes;
|
|
128
|
+
exports.getV3CommandOperation = getV3CommandOperation;
|
|
129
|
+
exports.getV3SpanAttributes = getV3SpanAttributes;
|
|
130
|
+
exports.getV4SpanAttributes = getV4SpanAttributes;
|
|
131
|
+
exports.serializeDbStatement = serializeDbStatement;
|
|
132
|
+
exports.startMongoSpan = startMongoSpan;
|
|
133
|
+
//# sourceMappingURL=mongodb-span.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongodb-span.js","sources":["../../../src/mongodb/mongodb-span.ts"],"sourcesContent":["import type { Span, SpanAttributes } from '@sentry/core';\nimport { isObjectLike, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_KIND, startInactiveSpan } from '@sentry/core';\n\n// OTel \"OLD\" db/net semantic-conventions, reproduced from the vendored\n// `@opentelemetry/instrumentation-mongodb` span shape so the orchestrion\n// spans match the OTel ones byte-for-byte. Inlined as literals to avoid\n// importing the deprecated convention constants.\nconst ATTR_DB_SYSTEM = 'db.system';\nconst ATTR_DB_NAME = 'db.name';\nconst ATTR_DB_OPERATION = 'db.operation';\nconst ATTR_DB_STATEMENT = 'db.statement';\nconst ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection';\nconst ATTR_DB_CONNECTION_STRING = 'db.connection_string';\nconst ATTR_NET_PEER_NAME = 'net.peer.name';\nconst ATTR_NET_PEER_PORT = 'net.peer.port';\nconst DB_SYSTEM_VALUE_MONGODB = 'mongodb';\n\n/**\n * The db/collection namespace mongodb (v4+) passes to `Connection.command`\n */\nexport interface MongodbNamespace {\n db: string;\n collection?: string;\n}\n\ninterface V4Command {\n documents?: unknown[];\n cursors?: unknown;\n [key: string]: unknown;\n}\n\n/**\n * Replaces every leaf value in the command object with '?', keeping keys\n * and Mongo operators. hides PII and improves grouping. Reproduced from\n * the OTel instrumentation.\n */\nexport function serializeDbStatement(commandObj: Record<string, unknown>): string {\n return JSON.stringify(scrubStatement(commandObj));\n}\n\nfunction scrubStatement(value: unknown): unknown {\n if (Array.isArray(value)) {\n return value.map(element => scrubStatement(element));\n }\n\n if (isCommandObj(value)) {\n const initial: Record<string, unknown> = {};\n return Object.entries(value)\n .map(([key, element]) => [key, scrubStatement(element)])\n .reduce((prev, current) => {\n if (isCommandEntry(current)) {\n prev[current[0]] = current[1];\n }\n return prev;\n }, initial);\n }\n\n // A value like string or number, possibly contains PII, scrub it.\n return '?';\n}\n\nfunction isCommandObj(value: unknown): value is Record<string, unknown> {\n return isObjectLike(value) && !isBuffer(value);\n}\n\nfunction isBuffer(value: unknown): boolean {\n return typeof Buffer !== 'undefined' && Buffer.isBuffer(value);\n}\n\nfunction isCommandEntry(value: unknown): value is [string, unknown] {\n return Array.isArray(value);\n}\n\n/**\n * Build span attributes for a mongodb v4+ command from the connection\n * context, namespace and command.\n */\nexport function getV4SpanAttributes(\n connectionCtx: { address?: string } | undefined,\n ns: MongodbNamespace,\n command: V4Command | undefined,\n operation: string | undefined,\n origin: string,\n): SpanAttributes {\n let host: string | undefined;\n let port: string | undefined;\n if (connectionCtx) {\n const hostParts = typeof connectionCtx.address === 'string' ? connectionCtx.address.split(':') : '';\n if (hostParts.length === 2) {\n host = hostParts[0];\n port = hostParts[1];\n }\n }\n\n let commandObj: Record<string, unknown> | undefined;\n if (command?.documents?.[0]) {\n commandObj = command.documents[0] as Record<string, unknown>;\n } else if (command?.cursors) {\n commandObj = command.cursors as Record<string, unknown>;\n } else {\n commandObj = command;\n }\n\n return getSpanAttributes(ns.db, ns.collection, host, port, commandObj, operation, origin);\n}\n\n/**\n * Shared attribute builder used by both the v3 topology path and the v4+\n * connection path.\n */\nexport function getSpanAttributes(\n dbName: string | undefined,\n dbCollection: string | undefined,\n host: string | undefined,\n port: string | undefined,\n commandObj: Record<string, unknown> | undefined,\n operation: string | undefined,\n origin: string,\n): SpanAttributes {\n const attributes: SpanAttributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin,\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_MONGODB,\n [ATTR_DB_NAME]: dbName,\n [ATTR_DB_MONGODB_COLLECTION]: dbCollection,\n [ATTR_DB_OPERATION]: operation,\n [ATTR_DB_CONNECTION_STRING]: `mongodb://${host}:${port}/${dbName}`,\n };\n\n if (host && port) {\n attributes[ATTR_NET_PEER_NAME] = host;\n const portNumber = parseInt(port, 10);\n if (!isNaN(portNumber)) {\n attributes[ATTR_NET_PEER_PORT] = portNumber;\n }\n }\n\n if (commandObj) {\n try {\n attributes[ATTR_DB_STATEMENT] = serializeDbStatement(commandObj);\n } catch {\n // ignore serialization errors — the statement is best-effort metadata\n }\n }\n\n return attributes;\n}\n\n/** The v3 driver topology, from which host/port are read (mongodb 3.x). */\nexport interface MongoV3Topology {\n s?: {\n options?: { host?: string; port?: number };\n host?: string;\n port?: number;\n };\n description?: { address?: string };\n}\n\n/**\n * Determine the operation name for a mongodb v3 `command` from the command\n * document, mirroring the vendored instrumentation. Returns `undefined` for\n * commands it doesn't classify (e.g. `endSessions`).\n */\nexport function getV3CommandOperation(command: Record<string, unknown>): string | undefined {\n if (command.createIndexes !== undefined) {\n return 'createIndexes';\n } else if (command.findandmodify !== undefined) {\n return 'findAndModify';\n } else if (command.ismaster !== undefined) {\n return 'isMaster';\n } else if (command.count !== undefined) {\n return 'count';\n } else if (command.aggregate !== undefined) {\n return 'aggregate';\n }\n return undefined;\n}\n\n/**\n * Build span attributes for a mongodb v3 operation from the topology,\n * namespace string and command.\n */\nexport function getV3SpanAttributes(\n ns: string,\n topology: MongoV3Topology | undefined,\n command: Record<string, unknown> | undefined,\n operation: string | undefined,\n origin: string,\n): SpanAttributes {\n let host: string | undefined;\n let port: string | undefined;\n if (topology?.s) {\n host = topology.s.options?.host ?? topology.s.host;\n port = (topology.s.options?.port ?? topology.s.port)?.toString();\n if (host == null || port == null) {\n const address = topology.description?.address;\n if (address) {\n const segments = address.split(':');\n host = segments[0];\n port = segments[1];\n }\n }\n }\n\n // The namespace is `[db].[collection-or-index]`; coerce to string\n // (might be a MongoDBNamespace)\n const [dbName, dbCollection] = ns.toString().split('.');\n const commandObj =\n (command?.query as Record<string, unknown> | undefined) ??\n (command?.q as Record<string, unknown> | undefined) ??\n command;\n\n return getSpanAttributes(dbName, dbCollection, host, port, commandObj, operation, origin);\n}\n\n/**\n * Start a mongodb client span with the legacy (pre-stable) db/net semantic\n * conventions.\n *\n * `op: 'db'` is set explicitly rather than relying on `inferDbSpanData`,\n * to support platforms that lack it (ie, Deno).\n */\nexport function startMongoSpan(attributes: SpanAttributes): Span {\n return startInactiveSpan({\n name: `mongodb.${attributes[ATTR_DB_OPERATION] || 'command'}`,\n op: 'db',\n kind: SPAN_KIND.CLIENT,\n attributes,\n });\n}\n"],"names":["isObjectLike","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","startInactiveSpan","SPAN_KIND"],"mappings":";;;;AAOA,MAAM,cAAA,GAAiB,WAAA;AACvB,MAAM,YAAA,GAAe,SAAA;AACrB,MAAM,iBAAA,GAAoB,cAAA;AAC1B,MAAM,iBAAA,GAAoB,cAAA;AAC1B,MAAM,0BAAA,GAA6B,uBAAA;AACnC,MAAM,yBAAA,GAA4B,sBAAA;AAClC,MAAM,kBAAA,GAAqB,eAAA;AAC3B,MAAM,kBAAA,GAAqB,eAAA;AAC3B,MAAM,uBAAA,GAA0B,SAAA;AAqBzB,SAAS,qBAAqB,UAAA,EAA6C;AAChF,EAAA,OAAO,IAAA,CAAK,SAAA,CAAU,cAAA,CAAe,UAAU,CAAC,CAAA;AAClD;AAEA,SAAS,eAAe,KAAA,EAAyB;AAC/C,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,IAAA,OAAO,KAAA,CAAM,GAAA,CAAI,CAAA,OAAA,KAAW,cAAA,CAAe,OAAO,CAAC,CAAA;AAAA,EACrD;AAEA,EAAA,IAAI,YAAA,CAAa,KAAK,CAAA,EAAG;AACvB,IAAA,MAAM,UAAmC,EAAC;AAC1C,IAAA,OAAO,MAAA,CAAO,QAAQ,KAAK,CAAA,CACxB,IAAI,CAAC,CAAC,KAAK,OAAO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AAA,EAAS,CAAE,MAAM,GAAG,CAAA;AACtD,EAAA,MAAM,UAAA,GACH,OAAA,EAAS,KAAA,IACT,OAAA,EAAS,CAAA,IACV,OAAA;AAEF,EAAA,OAAO,kBAAkB,MAAA,EAAQ,YAAA,EAAc,MAAM,IAAA,EAAM,UAAA,EAAY,WAAW,MAAM,CAAA;AAC1F;AASO,SAAS,eAAe,UAAA,EAAkC;AAC/D,EAAA,OAAOC,sBAAA,CAAkB;AAAA,IACvB,IAAA,EAAM,CAAA,QAAA,EAAW,UAAA,CAAW,iBAAiB,KAAK,SAAS,CAAA,CAAA;AAAA,IAC3D,EAAA,EAAI,IAAA;AAAA,IACJ,MAAMC,cAAA,CAAU,MAAA;AAAA,IAChB;AAAA,GACD,CAAA;AACH;;;;;;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const diagnosticsChannel = require('node:diagnostics_channel');
|
|
5
|
+
const mongooseDcSubscriber = require('./mongoose-dc-subscriber.js');
|
|
6
|
+
|
|
7
|
+
const _mongooseIntegration = (() => {
|
|
8
|
+
return {
|
|
9
|
+
name: "Mongoose",
|
|
10
|
+
setupOnce() {
|
|
11
|
+
if (!diagnosticsChannel.tracingChannel) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
core.waitForTracingChannelBinding(() => {
|
|
15
|
+
mongooseDcSubscriber.subscribeMongooseDiagnosticChannels(diagnosticsChannel.tracingChannel);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
const mongooseIntegration = core.defineIntegration(_mongooseIntegration);
|
|
21
|
+
|
|
22
|
+
exports.mongooseIntegration = mongooseIntegration;
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/mongoose/index.ts"],"sourcesContent":["import { defineIntegration, type IntegrationFn, waitForTracingChannelBinding } from '@sentry/core';\nimport * as dc from 'node:diagnostics_channel';\nimport { subscribeMongooseDiagnosticChannels } from './mongoose-dc-subscriber';\n\nexport type { MongooseLegacyCollection, StartMongooseLegacySpanOptions } from './mongoose-legacy-span';\nexport { startMongooseLegacySpan } from './mongoose-legacy-span';\n\nconst _mongooseIntegration = (() => {\n return {\n name: 'Mongoose',\n setupOnce() {\n // Bail on Node <= 18.18.0, where `tracingChannel` does not exist.\n if (!dc.tracingChannel) {\n return;\n }\n\n // Subscribe to mongoose's native tracing channels (mongoose >= 9.7).\n // This is a no-op on versions that don't publish to the channels, so it is always safe to call.\n waitForTracingChannelBinding(() => {\n subscribeMongooseDiagnosticChannels(dc.tracingChannel);\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Auto-instrument the [mongoose](https://www.npmjs.com/package/mongoose) library via its native\n * `node:diagnostics_channel` tracing channels (mongoose >= 9.7).\n *\n * On older mongoose versions the channels are never published to, so this integration is inert and\n * the IITM-based patcher (gated to `< 9.7.0`) handles instrumentation instead.\n */\nexport const mongooseIntegration = defineIntegration(_mongooseIntegration);\n"],"names":["dc","waitForTracingChannelBinding","subscribeMongooseDiagnosticChannels","defineIntegration"],"mappings":";;;;;;AAOA,MAAM,wBAAwB,MAAM;AAClC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,UAAA;AAAA,IACN,SAAA,GAAY;AAEV,MAAA,IAAI,CAACA,mBAAG,cAAA,EAAgB;AACtB,QAAA;AAAA,MACF;AAIA,MAAAC,iCAAA,CAA6B,MAAM;AACjC,QAAAC,wDAAA,CAAoCF,mBAAG,cAAc,CAAA;AAAA,MACvD,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAA,CAAA;AASO,MAAM,mBAAA,GAAsBG,uBAAkB,oBAAoB;;;;"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const attributes = require('@sentry/conventions/attributes');
|
|
4
|
+
const core = require('@sentry/core');
|
|
5
|
+
const debugBuild = require('../debug-build.js');
|
|
6
|
+
const tracingChannel = require('../tracing-channel.js');
|
|
7
|
+
|
|
8
|
+
const MONGOOSE_DC_CHANNEL_QUERY = "mongoose:query";
|
|
9
|
+
const MONGOOSE_DC_CHANNEL_AGGREGATE = "mongoose:aggregate";
|
|
10
|
+
const MONGOOSE_DC_CHANNEL_MODEL_SAVE = "mongoose:model:save";
|
|
11
|
+
const MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY = "mongoose:model:insertMany";
|
|
12
|
+
const MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE = "mongoose:model:bulkWrite";
|
|
13
|
+
const MONGOOSE_DC_CHANNEL_CURSOR_NEXT = "mongoose:cursor:next";
|
|
14
|
+
const ORIGIN = "auto.db.mongoose.diagnostic_channel";
|
|
15
|
+
const DB_SYSTEM_NAME_VALUE_MONGODB = "mongodb";
|
|
16
|
+
const MAX_REDACTION_DEPTH = 10;
|
|
17
|
+
let subscribed = false;
|
|
18
|
+
function subscribeMongooseDiagnosticChannels(tracingChannel) {
|
|
19
|
+
if (subscribed) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
subscribed = true;
|
|
23
|
+
try {
|
|
24
|
+
setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_QUERY);
|
|
25
|
+
setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_AGGREGATE);
|
|
26
|
+
setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_SAVE);
|
|
27
|
+
setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY);
|
|
28
|
+
setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE);
|
|
29
|
+
setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_CURSOR_NEXT);
|
|
30
|
+
} catch {
|
|
31
|
+
debugBuild.DEBUG_BUILD && core.debug.log("Mongoose node:diagnostics_channel subscription failed.");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function setupChannel(tracingChannel$1, channelName) {
|
|
35
|
+
tracingChannel.bindTracingChannelToSpan(tracingChannel$1(channelName), (data) => {
|
|
36
|
+
const collection = data.collection;
|
|
37
|
+
const queryText = redactMongoQuery(data.args?.pipeline ?? data.args?.filter);
|
|
38
|
+
const batchSize = getBatchSize(data);
|
|
39
|
+
return core.startInactiveSpan({
|
|
40
|
+
name: collection ? `mongoose.${collection}.${data.operation}` : `mongoose.${data.operation}`,
|
|
41
|
+
attributes: {
|
|
42
|
+
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
|
|
43
|
+
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db",
|
|
44
|
+
[attributes.DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_MONGODB,
|
|
45
|
+
[attributes.DB_OPERATION_NAME]: data.operation,
|
|
46
|
+
[attributes.DB_COLLECTION_NAME]: collection ?? void 0,
|
|
47
|
+
[attributes.DB_NAMESPACE]: data.database ?? void 0,
|
|
48
|
+
[attributes.DB_QUERY_TEXT]: queryText ?? void 0,
|
|
49
|
+
[attributes.DB_OPERATION_BATCH_SIZE]: batchSize ?? void 0,
|
|
50
|
+
[attributes.SERVER_ADDRESS]: data.serverAddress ?? void 0,
|
|
51
|
+
[attributes.SERVER_PORT]: data.serverPort ?? void 0
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function getBatchSize(data) {
|
|
57
|
+
const args = data.args;
|
|
58
|
+
const batch = data.operation === "insertMany" ? args?.docs : data.operation === "bulkWrite" ? args?.ops : void 0;
|
|
59
|
+
return Array.isArray(batch) && batch.length > 1 ? batch.length : void 0;
|
|
60
|
+
}
|
|
61
|
+
function redactMongoQuery(value) {
|
|
62
|
+
if (value == null) {
|
|
63
|
+
return void 0;
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
const redacted = redactValue(value, 0);
|
|
67
|
+
const text = JSON.stringify(redacted);
|
|
68
|
+
return text == null || text === "{}" || text === "[]" ? void 0 : text;
|
|
69
|
+
} catch {
|
|
70
|
+
return void 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function redactValue(value, depth) {
|
|
74
|
+
if (depth > MAX_REDACTION_DEPTH) {
|
|
75
|
+
return "?";
|
|
76
|
+
}
|
|
77
|
+
if (Array.isArray(value)) {
|
|
78
|
+
return value.map((item) => redactValue(item, depth + 1));
|
|
79
|
+
}
|
|
80
|
+
if (core.isObjectLike(value)) {
|
|
81
|
+
const out = {};
|
|
82
|
+
for (const key of Object.keys(value)) {
|
|
83
|
+
out[key] = redactValue(value[key], depth + 1);
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
return "?";
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
exports.MONGOOSE_DC_CHANNEL_AGGREGATE = MONGOOSE_DC_CHANNEL_AGGREGATE;
|
|
91
|
+
exports.MONGOOSE_DC_CHANNEL_CURSOR_NEXT = MONGOOSE_DC_CHANNEL_CURSOR_NEXT;
|
|
92
|
+
exports.MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE = MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE;
|
|
93
|
+
exports.MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY = MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY;
|
|
94
|
+
exports.MONGOOSE_DC_CHANNEL_MODEL_SAVE = MONGOOSE_DC_CHANNEL_MODEL_SAVE;
|
|
95
|
+
exports.MONGOOSE_DC_CHANNEL_QUERY = MONGOOSE_DC_CHANNEL_QUERY;
|
|
96
|
+
exports.subscribeMongooseDiagnosticChannels = subscribeMongooseDiagnosticChannels;
|
|
97
|
+
//# sourceMappingURL=mongoose-dc-subscriber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongoose-dc-subscriber.js","sources":["../../../src/mongoose/mongoose-dc-subscriber.ts"],"sourcesContent":["import type { TracingChannel } from 'node:diagnostics_channel';\nimport {\n DB_COLLECTION_NAME,\n DB_NAMESPACE,\n DB_OPERATION_BATCH_SIZE,\n DB_OPERATION_NAME,\n DB_QUERY_TEXT,\n DB_SYSTEM_NAME,\n SERVER_ADDRESS,\n SERVER_PORT,\n} from '@sentry/conventions/attributes';\nimport {\n isObjectLike,\n debug,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n startInactiveSpan,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { bindTracingChannelToSpan } from '../tracing-channel';\n\n// Channel names published by mongoose >= 9.7.0 (see mongoose `lib/tracing.js`,\n// `lib/query.js`, `lib/aggregate.js`, `lib/model.js` and `lib/cursor/*`).\n// Hardcoded so the subscriber does not have to import mongoose — the channels\n// just have to be subscribed to before the user's mongoose code publishes.\nexport const MONGOOSE_DC_CHANNEL_QUERY = 'mongoose:query';\nexport const MONGOOSE_DC_CHANNEL_AGGREGATE = 'mongoose:aggregate';\nexport const MONGOOSE_DC_CHANNEL_MODEL_SAVE = 'mongoose:model:save';\nexport const MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY = 'mongoose:model:insertMany';\nexport const MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE = 'mongoose:model:bulkWrite';\nexport const MONGOOSE_DC_CHANNEL_CURSOR_NEXT = 'mongoose:cursor:next';\n\nconst ORIGIN = 'auto.db.mongoose.diagnostic_channel';\nconst DB_SYSTEM_NAME_VALUE_MONGODB = 'mongodb';\n\n// Cap recursion so a self-referential or pathologically deep query can never\n// stall (or blow the stack in) instrumentation.\nconst MAX_REDACTION_DEPTH = 10;\n\n/**\n * Shape of the context object mongoose >= 9.7.0 publishes on its tracing\n * channels (mongoose's `TracingContext`, see `types/tracing.d.ts`).\n *\n * Node's `tracePromise` mutates this same object with `result`/`error` once the\n * operation settles, which `bindTracingChannelToSpan` reads in its lifecycle\n * handlers — hence both are declared optional here.\n *\n * Unlike redis/ioredis, mongoose does NOT pre-sanitize the payload, so `args`\n * carries the raw user query. We redact it before emitting `db.query.text`.\n */\nexport interface MongooseTracingData {\n operation: string;\n /** Absent for connection-level `aggregate()` calls, which have no model/collection. */\n collection?: string;\n database?: string;\n serverAddress?: string;\n serverPort?: number;\n /** Cursor channels only: the cursor's fetch batch size and tailable flag. */\n batchSize?: number;\n tailable?: boolean;\n /**\n * Operation-specific arguments. `filter` (queries/cursors) and `pipeline`\n * (aggregations) carry the query shape; `docs`/`ops` carry batch payloads.\n */\n args?: {\n filter?: unknown;\n pipeline?: unknown;\n docs?: unknown;\n ops?: unknown;\n [key: string]: unknown;\n };\n result?: unknown;\n error?: Error;\n}\n\n/**\n * Platform-provided factory that creates a native tracing channel for the given name. The\n * subscriber binds the span and its lifecycle onto the channel via `bindTracingChannelToSpan`,\n * which propagates the active span through the runtime's async context.\n *\n * Node passes `node:diagnostics_channel`'s `tracingChannel` directly.\n */\nexport type MongooseTracingChannelFactory = <T extends object>(name: string) => TracingChannel<T, T>;\n\nlet subscribed = false;\n\n/**\n * Subscribe Sentry span handlers to mongoose's diagnostics-channel events\n * (`mongoose:query`, `:aggregate`, `:model:save`, `:model:insertMany`,\n * `:model:bulkWrite`, `:cursor:next`), published by mongoose >= 9.7.0.\n *\n * On older mongoose versions the channels are never published to, so the\n * subscribers are inert — there is no double-instrumentation against the\n * IITM-based vendored patcher, which is gated to `< 9.7.0`.\n *\n * Idempotent: subsequent calls are a no-op.\n */\nexport function subscribeMongooseDiagnosticChannels(tracingChannel: MongooseTracingChannelFactory): void {\n if (subscribed) {\n return;\n }\n subscribed = true;\n\n try {\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_QUERY);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_AGGREGATE);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_SAVE);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_CURSOR_NEXT);\n } catch {\n // The factory relies on `node:diagnostics_channel`, which isn't always\n // available. Fail closed; the SDK simply won't emit mongoose spans here.\n DEBUG_BUILD && debug.log('Mongoose node:diagnostics_channel subscription failed.');\n }\n}\n\nfunction setupChannel(tracingChannel: MongooseTracingChannelFactory, channelName: string): void {\n bindTracingChannelToSpan(tracingChannel<MongooseTracingData>(channelName), data => {\n const collection = data.collection;\n const queryText = redactMongoQuery(data.args?.pipeline ?? data.args?.filter);\n const batchSize = getBatchSize(data);\n\n return startInactiveSpan({\n name: collection ? `mongoose.${collection}.${data.operation}` : `mongoose.${data.operation}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n [DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_MONGODB,\n [DB_OPERATION_NAME]: data.operation,\n [DB_COLLECTION_NAME]: collection ?? undefined,\n [DB_NAMESPACE]: data.database ?? undefined,\n [DB_QUERY_TEXT]: queryText ?? undefined,\n [DB_OPERATION_BATCH_SIZE]: batchSize ?? undefined,\n [SERVER_ADDRESS]: data.serverAddress ?? undefined,\n [SERVER_PORT]: data.serverPort ?? undefined,\n },\n });\n });\n}\n\n/**\n * `db.operation.batch.size` is only meaningful for genuine batch operations.\n * Mongoose's cursor `batchSize` is a fetch-tuning option, not a batch operation\n * size, so it is intentionally excluded here.\n */\nfunction getBatchSize(data: MongooseTracingData): number | undefined {\n const args = data.args;\n const batch = data.operation === 'insertMany' ? args?.docs : data.operation === 'bulkWrite' ? args?.ops : undefined;\n\n return Array.isArray(batch) && batch.length > 1 ? batch.length : undefined;\n}\n\n/**\n * Serialize a mongoose filter/pipeline into `db.query.text` while stripping every\n * value: keys and Mongo operators (`$gt`, `$in`, …) are preserved, leaf values\n * become `'?'`. Mongoose does not sanitize its channel payload, so this prevents\n * raw user data (potential PII) from leaving the process. Returns `undefined`\n * (rather than throwing) on anything it cannot serialize.\n */\nfunction redactMongoQuery(value: unknown): string | undefined {\n if (value == null) {\n return undefined;\n }\n\n try {\n const redacted = redactValue(value, 0);\n const text = JSON.stringify(redacted);\n\n // Skip empty/uninformative shapes (e.g. a `findOne()` with no filter).\n return text == null || text === '{}' || text === '[]' ? undefined : text;\n } catch {\n return undefined;\n }\n}\n\nfunction redactValue(value: unknown, depth: number): unknown {\n if (depth > MAX_REDACTION_DEPTH) {\n return '?';\n }\n\n if (Array.isArray(value)) {\n return value.map(item => redactValue(item, depth + 1));\n }\n\n if (isObjectLike(value)) {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(value as Record<string, unknown>)) {\n out[key] = redactValue((value as Record<string, unknown>)[key], depth + 1);\n }\n\n return out;\n }\n\n return '?';\n}\n"],"names":["DEBUG_BUILD","debug","tracingChannel","bindTracingChannelToSpan","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_OP","DB_SYSTEM_NAME","DB_OPERATION_NAME","DB_COLLECTION_NAME","DB_NAMESPACE","DB_QUERY_TEXT","DB_OPERATION_BATCH_SIZE","SERVER_ADDRESS","SERVER_PORT","isObjectLike"],"mappings":";;;;;;;AAyBO,MAAM,yBAAA,GAA4B;AAClC,MAAM,6BAAA,GAAgC;AACtC,MAAM,8BAAA,GAAiC;AACvC,MAAM,qCAAA,GAAwC;AAC9C,MAAM,oCAAA,GAAuC;AAC7C,MAAM,+BAAA,GAAkC;AAE/C,MAAM,MAAA,GAAS,qCAAA;AACf,MAAM,4BAAA,GAA+B,SAAA;AAIrC,MAAM,mBAAA,GAAsB,EAAA;AA+C5B,IAA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,QAAQ,mBAAA,EAAqB;AAC/B,IAAA,OAAO,GAAA;AAAA,EACT;AAEA,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,IAAA,OAAO,MAAM,GAAA,CAAI,CAAA,IAAA,KAAQ,YAAY,IAAA,EAAM,KAAA,GAAQ,CAAC,CAAC,CAAA;AAAA,EACvD;AAEA,EAAA,IAAIC,iBAAA,CAAa,KAAK,CAAA,EAAG;AACvB,IAAA,MAAM,MAA+B,EAAC;AACtC,IAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,KAAgC,CAAA,EAAG;AAC/D,MAAA,GAAA,CAAI,GAAG,CAAA,GAAI,WAAA,CAAa,MAAkC,GAAG,CAAA,EAAG,QAAQ,CAAC,CAAA;AAAA,IAC3E;AAEA,IAAA,OAAO,GAAA;AAAA,EACT;AAEA,EAAA,OAAO,GAAA;AACT;;;;;;;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
|
|
5
|
+
const ATTR_DB_MONGODB_COLLECTION = "db.mongodb.collection";
|
|
6
|
+
const ATTR_DB_NAME = "db.name";
|
|
7
|
+
const ATTR_DB_USER = "db.user";
|
|
8
|
+
const ATTR_NET_PEER_NAME = "net.peer.name";
|
|
9
|
+
const ATTR_NET_PEER_PORT = "net.peer.port";
|
|
10
|
+
const ATTR_DB_OPERATION = "db.operation";
|
|
11
|
+
const ATTR_DB_SYSTEM = "db.system";
|
|
12
|
+
function startMongooseLegacySpan({
|
|
13
|
+
collection,
|
|
14
|
+
modelName,
|
|
15
|
+
operation,
|
|
16
|
+
origin,
|
|
17
|
+
parentSpan
|
|
18
|
+
}) {
|
|
19
|
+
const attributes = {
|
|
20
|
+
[ATTR_DB_MONGODB_COLLECTION]: collection?.name,
|
|
21
|
+
[ATTR_DB_NAME]: collection?.conn?.name,
|
|
22
|
+
[ATTR_DB_USER]: collection?.conn?.user,
|
|
23
|
+
[ATTR_NET_PEER_NAME]: collection?.conn?.host,
|
|
24
|
+
[ATTR_NET_PEER_PORT]: collection?.conn?.port,
|
|
25
|
+
[ATTR_DB_OPERATION]: operation,
|
|
26
|
+
[ATTR_DB_SYSTEM]: "mongoose",
|
|
27
|
+
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin
|
|
28
|
+
};
|
|
29
|
+
return core.startInactiveSpan({
|
|
30
|
+
name: `mongoose.${modelName}.${operation}`,
|
|
31
|
+
// Set this explicitly, for platforms lacking `inferDbSpanData`
|
|
32
|
+
op: "db",
|
|
33
|
+
kind: core.SPAN_KIND.CLIENT,
|
|
34
|
+
attributes,
|
|
35
|
+
parentSpan
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.startMongooseLegacySpan = startMongooseLegacySpan;
|
|
40
|
+
//# sourceMappingURL=mongoose-legacy-span.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongoose-legacy-span.js","sources":["../../../src/mongoose/mongoose-legacy-span.ts"],"sourcesContent":["import type { Span, SpanAttributes } from '@sentry/core';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_KIND, startInactiveSpan } from '@sentry/core';\n\n// OTel \"OLD\" db/net semantic-conventions, reproduced from the vendored\n// `@opentelemetry/instrumentation-mongoose` span shape. Inlined as literals to\n// avoid importing the deprecated convention constants.\nconst ATTR_DB_MONGODB_COLLECTION = 'db.mongodb.collection';\nconst ATTR_DB_NAME = 'db.name';\nconst ATTR_DB_USER = 'db.user';\nconst ATTR_NET_PEER_NAME = 'net.peer.name';\nconst ATTR_NET_PEER_PORT = 'net.peer.port';\nconst ATTR_DB_OPERATION = 'db.operation';\nconst ATTR_DB_SYSTEM = 'db.system';\n\n/** The subset of mongoose's `Collection` that the legacy span shape reads. */\nexport interface MongooseLegacyCollection {\n name?: string;\n conn?: { name?: string; user?: string; host?: string; port?: number };\n}\n\nexport interface StartMongooseLegacySpanOptions {\n collection: MongooseLegacyCollection | undefined;\n modelName: string | undefined;\n operation: string;\n /** Span origin: distinguishes the OTel/IITM caller from orchestrion */\n origin: string;\n parentSpan?: Span;\n}\n\n/**\n * Start a mongoose client span with the legacy (pre-stable) db/net semantic\n * conventions.\n *\n * Shared by the vendored OTel/IITM instrumentation (`@sentry/node`) and the\n * orchestrion channel subscriber so the two emit an identical span shape,\n * differing only by `origin`.\n */\nexport function startMongooseLegacySpan({\n collection,\n modelName,\n operation,\n origin,\n parentSpan,\n}: StartMongooseLegacySpanOptions): Span {\n const attributes: SpanAttributes = {\n [ATTR_DB_MONGODB_COLLECTION]: collection?.name,\n [ATTR_DB_NAME]: collection?.conn?.name,\n [ATTR_DB_USER]: collection?.conn?.user,\n [ATTR_NET_PEER_NAME]: collection?.conn?.host,\n [ATTR_NET_PEER_PORT]: collection?.conn?.port,\n [ATTR_DB_OPERATION]: operation,\n [ATTR_DB_SYSTEM]: 'mongoose',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: origin,\n };\n\n return startInactiveSpan({\n name: `mongoose.${modelName}.${operation}`,\n // Set this explicitly, for platforms lacking `inferDbSpanData`\n op: 'db',\n kind: SPAN_KIND.CLIENT,\n attributes,\n parentSpan,\n });\n}\n"],"names":["SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","startInactiveSpan","SPAN_KIND"],"mappings":";;;;AAMA,MAAM,0BAAA,GAA6B,uBAAA;AACnC,MAAM,YAAA,GAAe,SAAA;AACrB,MAAM,YAAA,GAAe,SAAA;AACrB,MAAM,kBAAA,GAAqB,eAAA;AAC3B,MAAM,kBAAA,GAAqB,eAAA;AAC3B,MAAM,iBAAA,GAAoB,cAAA;AAC1B,MAAM,cAAA,GAAiB,WAAA;AAyBhB,SAAS,uBAAA,CAAwB;AAAA,EACtC,UAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAAyC;AACvC,EAAA,MAAM,UAAA,GAA6B;AAAA,IACjC,CAAC,0BAA0B,GAAG,UAAA,EAAY,IAAA;AAAA,IAC1C,CAAC,YAAY,GAAG,UAAA,EAAY,IAAA,EAAM,IAAA;AAAA,IAClC,CAAC,YAAY,GAAG,UAAA,EAAY,IAAA,EAAM,IAAA;AAAA,IAClC,CAAC,kBAAkB,GAAG,UAAA,EAAY,IAAA,EAAM,IAAA;AAAA,IACxC,CAAC,kBAAkB,GAAG,UAAA,EAAY,IAAA,EAAM,IAAA;AAAA,IACxC,CAAC,iBAAiB,GAAG,SAAA;AAAA,IACrB,CAAC,cAAc,GAAG,UAAA;AAAA,IAClB,CAACA,qCAAgC,GAAG;AAAA,GACtC;AAEA,EAAA,OAAOC,sBAAA,CAAkB;AAAA,IACvB,IAAA,EAAM,CAAA,SAAA,EAAY,SAAS,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA;AAAA;AAAA,IAExC,EAAA,EAAI,IAAA;AAAA,IACJ,MAAMC,cAAA,CAAU,MAAA;AAAA,IAChB,UAAA;AAAA,IACA;AAAA,GACD,CAAA;AACH;;;;"}
|