@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":"semconv.js","sources":["../../../../../src/integrations/tracing-channel/kafkajs/semconv.ts"],"sourcesContent":["/*\n * Unstable OTel semantic-convention keys/values without a `@sentry/conventions` constant, inlined to\n * keep this integration free of `@opentelemetry/*` deps. Values are byte-identical to the vendored OTel\n * instrumentation (`@sentry/node`'s `integrations/tracing/kafka/vendored/semconv.ts`) for span parity.\n */\n\nexport const ATTR_MESSAGING_DESTINATION_PARTITION_ID = 'messaging.destination.partition.id' as const;\nexport const ATTR_MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message.key' as const;\nexport const ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = 'messaging.kafka.message.tombstone' as const;\nexport const ATTR_MESSAGING_KAFKA_OFFSET = 'messaging.kafka.offset' as const;\nexport const MESSAGING_OPERATION_TYPE_VALUE_PROCESS = 'process' as const;\nexport const MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = 'receive' as const;\nexport const MESSAGING_OPERATION_TYPE_VALUE_SEND = 'send' as const;\nexport const MESSAGING_SYSTEM_VALUE_KAFKA = 'kafka' as const;\n\n// `_OTHER` is OTel's fallback bucket when no more specific `error.type` is known.\nexport const ERROR_TYPE_VALUE_OTHER = '_OTHER' as const;\n"],"names":[],"mappings":"AAMO,MAAM,uCAAA,GAA0C;AAChD,MAAM,gCAAA,GAAmC;AACzC,MAAM,sCAAA,GAAyC;AAC/C,MAAM,2BAAA,GAA8B;AACpC,MAAM,sCAAA,GAAyC;AAC/C,MAAM,sCAAA,GAAyC;AAC/C,MAAM,mCAAA,GAAsC;AAC5C,MAAM,4BAAA,GAA+B;AAGrC,MAAM,sBAAA,GAAyB;;;;"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ERROR_TYPE, MESSAGING_OPERATION_TYPE, MESSAGING_OPERATION_NAME, MESSAGING_DESTINATION_NAME, MESSAGING_SYSTEM } from '@sentry/conventions/attributes';
|
|
2
|
+
import { SPAN_STATUS_ERROR, startInactiveSpan, SPAN_KIND, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getTraceData, propagationContextFromHeaders } from '@sentry/core';
|
|
3
|
+
import { ERROR_TYPE_VALUE_OTHER, MESSAGING_OPERATION_TYPE_VALUE_SEND, MESSAGING_SYSTEM_VALUE_KAFKA, ATTR_MESSAGING_DESTINATION_PARTITION_ID, ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE, ATTR_MESSAGING_KAFKA_MESSAGE_KEY, ATTR_MESSAGING_KAFKA_OFFSET, MESSAGING_OPERATION_TYPE_VALUE_RECEIVE } from './semconv.js';
|
|
4
|
+
|
|
5
|
+
const PRODUCER_ORIGIN = "auto.kafkajs.orchestrion.producer";
|
|
6
|
+
const CONSUMER_ORIGIN = "auto.kafkajs.orchestrion.consumer";
|
|
7
|
+
const TRACE_FLAG_SAMPLED = 1;
|
|
8
|
+
const TRACE_FLAG_NONE = 0;
|
|
9
|
+
function getHeaderAsString(headers, key) {
|
|
10
|
+
const value = headers?.[key];
|
|
11
|
+
if (value == null) {
|
|
12
|
+
return void 0;
|
|
13
|
+
}
|
|
14
|
+
return Array.isArray(value) ? value[0]?.toString() : value.toString();
|
|
15
|
+
}
|
|
16
|
+
function getLinksFromHeaders(headers) {
|
|
17
|
+
const sentryTrace = getHeaderAsString(headers, "sentry-trace");
|
|
18
|
+
if (!sentryTrace) {
|
|
19
|
+
return void 0;
|
|
20
|
+
}
|
|
21
|
+
const { traceId, parentSpanId, sampled } = propagationContextFromHeaders(
|
|
22
|
+
sentryTrace,
|
|
23
|
+
getHeaderAsString(headers, "baggage")
|
|
24
|
+
);
|
|
25
|
+
if (!parentSpanId) {
|
|
26
|
+
return void 0;
|
|
27
|
+
}
|
|
28
|
+
return [
|
|
29
|
+
{
|
|
30
|
+
context: {
|
|
31
|
+
traceId,
|
|
32
|
+
spanId: parentSpanId,
|
|
33
|
+
isRemote: true,
|
|
34
|
+
traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
function startConsumerSpan({ topic, message, operationType, links, attributes }) {
|
|
40
|
+
const operationName = operationType === MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? "poll" : operationType;
|
|
41
|
+
return startInactiveSpan({
|
|
42
|
+
name: `${operationName} ${topic}`,
|
|
43
|
+
// todo(v11): Use https://getsentry.github.io/sentry-conventions/ops/#messaging
|
|
44
|
+
op: "message",
|
|
45
|
+
kind: operationType === MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? SPAN_KIND.CLIENT : SPAN_KIND.CONSUMER,
|
|
46
|
+
links,
|
|
47
|
+
attributes: {
|
|
48
|
+
...attributes,
|
|
49
|
+
[MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,
|
|
50
|
+
[MESSAGING_DESTINATION_NAME]: topic,
|
|
51
|
+
[MESSAGING_OPERATION_TYPE]: operationType,
|
|
52
|
+
[MESSAGING_OPERATION_NAME]: operationName,
|
|
53
|
+
[ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message?.key ? String(message.key) : void 0,
|
|
54
|
+
[ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message?.key && message.value === null ? true : void 0,
|
|
55
|
+
[ATTR_MESSAGING_KAFKA_OFFSET]: message?.offset,
|
|
56
|
+
// Mirror the upstream behavior of only tagging per-message processing spans (not the batch
|
|
57
|
+
// receiving span, which carries no message) with the auto origin.
|
|
58
|
+
...message ? { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: CONSUMER_ORIGIN } : {}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function startProducerSpan(topic, message) {
|
|
63
|
+
const span = startInactiveSpan({
|
|
64
|
+
name: `send ${topic}`,
|
|
65
|
+
op: "message",
|
|
66
|
+
kind: SPAN_KIND.PRODUCER,
|
|
67
|
+
attributes: {
|
|
68
|
+
[MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,
|
|
69
|
+
[MESSAGING_DESTINATION_NAME]: topic,
|
|
70
|
+
[ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message.key ? String(message.key) : void 0,
|
|
71
|
+
[ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message.key && message.value === null ? true : void 0,
|
|
72
|
+
[ATTR_MESSAGING_DESTINATION_PARTITION_ID]: message.partition !== void 0 ? String(message.partition) : void 0,
|
|
73
|
+
[MESSAGING_OPERATION_NAME]: "send",
|
|
74
|
+
[MESSAGING_OPERATION_TYPE]: MESSAGING_OPERATION_TYPE_VALUE_SEND,
|
|
75
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PRODUCER_ORIGIN
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
message.headers = message.headers ?? {};
|
|
79
|
+
const traceData = getTraceData({ span });
|
|
80
|
+
if (traceData["sentry-trace"]) {
|
|
81
|
+
message.headers["sentry-trace"] = traceData["sentry-trace"];
|
|
82
|
+
}
|
|
83
|
+
if (traceData.baggage) {
|
|
84
|
+
message.headers["baggage"] = traceData.baggage;
|
|
85
|
+
}
|
|
86
|
+
return span;
|
|
87
|
+
}
|
|
88
|
+
function applyErrorToSpans(spans, reason) {
|
|
89
|
+
let errorMessage;
|
|
90
|
+
let errorType = ERROR_TYPE_VALUE_OTHER;
|
|
91
|
+
if (typeof reason === "string" || reason === void 0) {
|
|
92
|
+
errorMessage = reason;
|
|
93
|
+
} else if (typeof reason === "object" && reason !== null && Object.prototype.hasOwnProperty.call(reason, "message")) {
|
|
94
|
+
errorMessage = reason.message;
|
|
95
|
+
errorType = reason.constructor.name;
|
|
96
|
+
}
|
|
97
|
+
spans.forEach((span) => {
|
|
98
|
+
span.setAttribute(ERROR_TYPE, errorType);
|
|
99
|
+
span.setStatus({ code: SPAN_STATUS_ERROR, message: errorMessage });
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function endSpansOnPromise(spans, promise) {
|
|
103
|
+
return Promise.resolve(promise).catch((reason) => {
|
|
104
|
+
applyErrorToSpans(spans, reason);
|
|
105
|
+
throw reason;
|
|
106
|
+
}).finally(() => {
|
|
107
|
+
spans.forEach((span) => span.end());
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export { applyErrorToSpans, endSpansOnPromise, getHeaderAsString, getLinksFromHeaders, startConsumerSpan, startProducerSpan };
|
|
112
|
+
//# sourceMappingURL=spans.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spans.js","sources":["../../../../../src/integrations/tracing-channel/kafkajs/spans.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-kafkajs\n * - Upstream version: @opentelemetry/instrumentation-kafkajs@0.27.0\n * - Span builders migrated to the `@sentry/core` span API. Kept byte-identical in span name/attributes\n * for parity with the OTel integration this replaces; only the origin changes to\n * `auto.kafkajs.orchestrion.*` to mark the injection path.\n */\n\nimport {\n ERROR_TYPE,\n MESSAGING_DESTINATION_NAME,\n MESSAGING_OPERATION_NAME,\n MESSAGING_OPERATION_TYPE,\n MESSAGING_SYSTEM,\n} from '@sentry/conventions/attributes';\nimport type { Span, SpanAttributes, SpanLink } from '@sentry/core';\nimport {\n getTraceData,\n propagationContextFromHeaders,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n} from '@sentry/core';\nimport type { KafkaMessage, Message } from './types';\nimport {\n ATTR_MESSAGING_DESTINATION_PARTITION_ID,\n ATTR_MESSAGING_KAFKA_MESSAGE_KEY,\n ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE,\n ATTR_MESSAGING_KAFKA_OFFSET,\n ERROR_TYPE_VALUE_OTHER,\n MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,\n MESSAGING_OPERATION_TYPE_VALUE_SEND,\n MESSAGING_SYSTEM_VALUE_KAFKA,\n} from './semconv';\n\nconst PRODUCER_ORIGIN = 'auto.kafkajs.orchestrion.producer';\nconst CONSUMER_ORIGIN = 'auto.kafkajs.orchestrion.consumer';\n\n// `@opentelemetry/api` `TraceFlags`, inlined to avoid an OTel dep: SAMPLED = 0x1, NONE = 0x0.\nconst TRACE_FLAG_SAMPLED = 1;\nconst TRACE_FLAG_NONE = 0;\n\ninterface ConsumerSpanOptions {\n topic: string;\n message: KafkaMessage | undefined;\n operationType: string;\n attributes: SpanAttributes;\n links?: SpanLink[];\n}\n\n/**\n * Reads a header value off a kafkajs message as a string. kafkajs delivers headers as `Buffer`s (or\n * arrays of them), so we normalize to a string before handing them to Sentry's trace helpers.\n */\nexport function getHeaderAsString(headers: KafkaMessage['headers'], key: string): string | undefined {\n const value = headers?.[key];\n if (value == null) {\n return undefined;\n }\n return Array.isArray(value) ? value[0]?.toString() : value.toString();\n}\n\n/**\n * Builds a span link to the producer span carried in the message headers, mirroring the upstream\n * behavior of linking each batch-processed message to its originating producer span.\n */\nexport function getLinksFromHeaders(headers: KafkaMessage['headers']): SpanLink[] | undefined {\n const sentryTrace = getHeaderAsString(headers, 'sentry-trace');\n if (!sentryTrace) {\n return undefined;\n }\n\n const { traceId, parentSpanId, sampled } = propagationContextFromHeaders(\n sentryTrace,\n getHeaderAsString(headers, 'baggage'),\n );\n if (!parentSpanId) {\n return undefined;\n }\n\n return [\n {\n context: {\n traceId,\n spanId: parentSpanId,\n isRemote: true,\n traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE,\n },\n },\n ];\n}\n\n/** Starts an inactive consumer (process/receive) span carrying the kafkajs messaging attributes. */\nexport function startConsumerSpan({ topic, message, operationType, links, attributes }: ConsumerSpanOptions): Span {\n // The batch \"receive\" span is named `poll`; per-message spans use the operation type verbatim.\n const operationName = operationType === MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? 'poll' : operationType;\n\n return startInactiveSpan({\n name: `${operationName} ${topic}`,\n // todo(v11): Use https://getsentry.github.io/sentry-conventions/ops/#messaging\n op: 'message',\n kind: operationType === MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? SPAN_KIND.CLIENT : SPAN_KIND.CONSUMER,\n links,\n attributes: {\n ...attributes,\n [MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [MESSAGING_DESTINATION_NAME]: topic,\n [MESSAGING_OPERATION_TYPE]: operationType,\n [MESSAGING_OPERATION_NAME]: operationName,\n [ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message?.key ? String(message.key) : undefined,\n [ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message?.key && message.value === null ? true : undefined,\n [ATTR_MESSAGING_KAFKA_OFFSET]: message?.offset as string | undefined,\n // Mirror the upstream behavior of only tagging per-message processing spans (not the batch\n // receiving span, which carries no message) with the auto origin.\n ...(message ? { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: CONSUMER_ORIGIN } : {}),\n },\n });\n}\n\n/** Starts an inactive producer span and propagates its trace into the message headers. */\nexport function startProducerSpan(topic: string, message: Message): Span {\n const span = startInactiveSpan({\n name: `send ${topic}`,\n op: 'message',\n kind: SPAN_KIND.PRODUCER,\n attributes: {\n [MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [MESSAGING_DESTINATION_NAME]: topic,\n [ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message.key ? String(message.key) : undefined,\n [ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message.key && message.value === null ? true : undefined,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]:\n message.partition !== undefined ? String(message.partition) : undefined,\n [MESSAGING_OPERATION_NAME]: 'send',\n [MESSAGING_OPERATION_TYPE]: MESSAGING_OPERATION_TYPE_VALUE_SEND,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PRODUCER_ORIGIN,\n },\n });\n\n // Propagate the producer span's trace to consumers via the message headers.\n message.headers = message.headers ?? {};\n const traceData = getTraceData({ span });\n if (traceData['sentry-trace']) {\n message.headers['sentry-trace'] = traceData['sentry-trace'];\n }\n if (traceData.baggage) {\n message.headers['baggage'] = traceData.baggage;\n }\n\n return span;\n}\n\n/**\n * Marks all `spans` with the error status and `error.type` derived from a settle-time `reason`,\n * WITHOUT ending them. Mirrors the vendored `endSpansOnPromise` catch block. The producer path (which\n * receives discrete `error`/`asyncEnd` channel events) applies the error on `error` and ends on\n * `asyncEnd`; the consumer path folds this into `endSpansOnPromise`.\n */\nexport function applyErrorToSpans(spans: Span[], reason: unknown): void {\n let errorMessage: string | undefined;\n let errorType: string = ERROR_TYPE_VALUE_OTHER;\n if (typeof reason === 'string' || reason === undefined) {\n errorMessage = reason;\n } else if (typeof reason === 'object' && reason !== null && Object.prototype.hasOwnProperty.call(reason, 'message')) {\n errorMessage = (reason as { message?: string }).message;\n errorType = (reason as { constructor: { name: string } }).constructor.name;\n }\n\n spans.forEach(span => {\n span.setAttribute(ERROR_TYPE, errorType);\n span.setStatus({ code: SPAN_STATUS_ERROR, message: errorMessage });\n });\n}\n\n/**\n * Resolves once `promise` settles, applying the error status to all `spans` on failure and ending\n * them regardless. Used by the consumer path, which invokes the user callback directly (and so holds a\n * real promise). Verbatim from the vendored `endSpansOnPromise`.\n */\nexport function endSpansOnPromise<T>(spans: Span[], promise: Promise<T>): Promise<T> {\n return Promise.resolve(promise)\n .catch(reason => {\n applyErrorToSpans(spans, reason);\n throw reason;\n })\n .finally(() => {\n spans.forEach(span => span.end());\n });\n}\n"],"names":[],"mappings":";;;;AAwCA,MAAM,eAAA,GAAkB,mCAAA;AACxB,MAAM,eAAA,GAAkB,mCAAA;AAGxB,MAAM,kBAAA,GAAqB,CAAA;AAC3B,MAAM,eAAA,GAAkB,CAAA;AAcjB,SAAS,iBAAA,CAAkB,SAAkC,GAAA,EAAiC;AACnG,EAAA,MAAM,KAAA,GAAQ,UAAU,GAAG,CAAA;AAC3B,EAAA,IAAI,SAAS,IAAA,EAAM;AACjB,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,GAAI,KAAA,CAAM,CAAC,CAAA,EAAG,QAAA,EAAS,GAAI,KAAA,CAAM,QAAA,EAAS;AACtE;AAMO,SAAS,oBAAoB,OAAA,EAA0D;AAC5F,EAAA,MAAM,WAAA,GAAc,iBAAA,CAAkB,OAAA,EAAS,cAAc,CAAA;AAC7D,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,MAAM,EAAE,OAAA,EAAS,YAAA,EAAc,OAAA,EAAQ,GAAI,6BAAA;AAAA,IACzC,WAAA;AAAA,IACA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ACT;AAQO,SAAS,iBAAA,CAAkB,OAAe,MAAA,EAAuB;AACtE,EAAA,IAAI,YAAA;AACJ,EAAA,IAAI,SAAA,GAAoB,sBAAA;AACxB,EAAA,IAAI,OAAO,MAAA,KAAW,QAAA,IAAY,MAAA,KAAW,MAAA,EAAW;AACtD,IAAA,YAAA,GAAe,MAAA;AAAA,EACjB,CAAA,MAAA,IAAW,OAAO,MAAA,KAAW,QAAA,IAAY,MAAA,KAAW,IAAA,IAAQ,MAAA,CAAO,SAAA,CAAU,cAAA,CAAe,IAAA,CAAK,MAAA,EAAQ,SAAS,CAAA,EAAG;AACnH,IAAA,YAAA,GAAgB,MAAA,CAAgC,OAAA;AAChD,IAAA,SAAA,GAAa,OAA6C,WAAA,CAAY,IAAA;AAAA,EACxE;AAEA,EAAA,KAAA,CAAM,QAAQ,CAAA,IAAA,KAAQ;AACpB,IAAA,IAAA,CAAK,YAAA,CAAa,YAAY,SAAS,CAAA;AACvC,IAAA,IAAA,CAAK,UAAU,EAAE,IAAA,EAAM,iBAAA,EAAmB,OAAA,EAAS,cAAc,CAAA;AAAA,EACnE,CAAC,CAAA;AACH;AAOO,SAAS,iBAAA,CAAqB,OAAe,OAAA,EAAiC;AACnF,EAAA,OAAO,OAAA,CAAQ,OAAA,CAAQ,OAAO,CAAA,CAC3B,MAAM,CAAA,MAAA,KAAU;AACf,IAAA,iBAAA,CAAkB,OAAO,MAAM,CAAA;AAC/B,IAAA,MAAM,MAAA;AAAA,EACR,CAAC,CAAA,CACA,OAAA,CAAQ,MAAM;AACb,IAAA,KAAA,CAAM,OAAA,CAAQ,CAAA,IAAA,KAAQ,IAAA,CAAK,GAAA,EAAK,CAAA;AAAA,EAClC,CAAC,CAAA;AACL;;;;"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import * as diagnosticsChannel from 'node:diagnostics_channel';
|
|
2
|
+
import { defineIntegration, debug, waitForTracingChannelBinding, getActiveSpan, SPAN_STATUS_ERROR, truncate, startInactiveSpan, SPAN_KIND, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
|
|
3
|
+
import { DB_STATEMENT, NET_TRANSPORT, NET_PEER_PORT, NET_PEER_NAME, DB_USER, DB_SYSTEM, DB_NAME, DB_OPERATION } from '@sentry/conventions/attributes';
|
|
4
|
+
import { DEBUG_BUILD } from '../../debug-build.js';
|
|
5
|
+
import { CHANNELS } from '../../orchestrion/channels.js';
|
|
6
|
+
import { bindTracingChannelToSpan } from '../../tracing-channel.js';
|
|
7
|
+
|
|
8
|
+
const INTEGRATION_NAME = "Knex";
|
|
9
|
+
const ORIGIN = "auto.db.orchestrion.knex";
|
|
10
|
+
const MAX_QUERY_LENGTH = 1021;
|
|
11
|
+
const ATTR_DB_SQL_TABLE = "db.sql.table";
|
|
12
|
+
const DB_SYSTEM_SQLITE = "sqlite";
|
|
13
|
+
const DB_SYSTEM_POSTGRESQL = "postgresql";
|
|
14
|
+
const parentSpanSymbol = /* @__PURE__ */ Symbol("sentry.orchestrion.knex.parent-span");
|
|
15
|
+
const _knexChannelIntegration = (() => {
|
|
16
|
+
return {
|
|
17
|
+
name: INTEGRATION_NAME,
|
|
18
|
+
setupOnce() {
|
|
19
|
+
if (!diagnosticsChannel.tracingChannel) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
DEBUG_BUILD && debug.log(`[orchestrion:knex] subscribing to channel "${CHANNELS.KNEX_QUERY}"`);
|
|
23
|
+
waitForTracingChannelBinding(() => {
|
|
24
|
+
subscribeBuilder(CHANNELS.KNEX_QUERY_BUILDER);
|
|
25
|
+
subscribeBuilder(CHANNELS.KNEX_SCHEMA_BUILDER);
|
|
26
|
+
subscribeBuilder(CHANNELS.KNEX_RAW);
|
|
27
|
+
subscribeQuery();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
function subscribeBuilder(channelName) {
|
|
33
|
+
diagnosticsChannel.tracingChannel(channelName).end.subscribe((message) => {
|
|
34
|
+
const builder = message.result;
|
|
35
|
+
if (!builder || typeof builder !== "object" || parentSpanSymbol in builder) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const activeSpan = getActiveSpan();
|
|
39
|
+
if (!activeSpan) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
Object.defineProperty(builder, parentSpanSymbol, { value: activeSpan });
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function subscribeQuery() {
|
|
46
|
+
bindTracingChannelToSpan(
|
|
47
|
+
diagnosticsChannel.tracingChannel(CHANNELS.KNEX_QUERY),
|
|
48
|
+
(data) => {
|
|
49
|
+
const runner = data.self;
|
|
50
|
+
const builder = runner?.builder;
|
|
51
|
+
const parentSpan = builder?.[parentSpanSymbol] ?? getActiveSpan();
|
|
52
|
+
if (!parentSpan) {
|
|
53
|
+
return void 0;
|
|
54
|
+
}
|
|
55
|
+
const query = data.arguments[0];
|
|
56
|
+
const client = runner?.client;
|
|
57
|
+
const connection = client?.config?.connection;
|
|
58
|
+
const connectionString = connection?.connectionString;
|
|
59
|
+
const table = extractTableName(builder);
|
|
60
|
+
const operation = query?.method;
|
|
61
|
+
const name = connection?.filename || connection?.database || extractDatabaseFromConnectionString(connectionString);
|
|
62
|
+
const attributes = {
|
|
63
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
|
|
64
|
+
"knex.version": data.moduleVersion,
|
|
65
|
+
[DB_SYSTEM]: mapSystem(client?.driverName),
|
|
66
|
+
[ATTR_DB_SQL_TABLE]: table,
|
|
67
|
+
[DB_OPERATION]: operation,
|
|
68
|
+
[DB_USER]: connection?.user,
|
|
69
|
+
[DB_NAME]: name,
|
|
70
|
+
[NET_PEER_NAME]: connection?.host ?? extractHostFromConnectionString(connectionString),
|
|
71
|
+
[NET_PEER_PORT]: connection?.port ?? extractPortFromConnectionString(connectionString),
|
|
72
|
+
[NET_TRANSPORT]: connection?.filename === ":memory:" ? "inproc" : void 0,
|
|
73
|
+
[DB_STATEMENT]: query?.sql != null ? truncate(query.sql, MAX_QUERY_LENGTH) : void 0
|
|
74
|
+
};
|
|
75
|
+
return startInactiveSpan({
|
|
76
|
+
name: getName(name, operation, table) ?? "knex.query",
|
|
77
|
+
kind: SPAN_KIND.CLIENT,
|
|
78
|
+
op: "db",
|
|
79
|
+
parentSpan,
|
|
80
|
+
attributes
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
beforeSpanEnd(span, data) {
|
|
85
|
+
if ("error" in data) {
|
|
86
|
+
const message = cleanErrorMessage(data);
|
|
87
|
+
if (message !== void 0) {
|
|
88
|
+
span.setStatus({ code: SPAN_STATUS_ERROR, message });
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
function cleanErrorMessage(data) {
|
|
96
|
+
const error = data.error;
|
|
97
|
+
if (!error || typeof error !== "object" || typeof error.message !== "string") {
|
|
98
|
+
return void 0;
|
|
99
|
+
}
|
|
100
|
+
const rawMessage = error.message;
|
|
101
|
+
const query = data.arguments[0];
|
|
102
|
+
if (!query?.sql) {
|
|
103
|
+
return rawMessage;
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
const formatter = getFormatter(data.self);
|
|
107
|
+
const fullQuery = formatter(query.sql, query.bindings || []);
|
|
108
|
+
return rawMessage.replace(`${fullQuery} - `, "");
|
|
109
|
+
} catch {
|
|
110
|
+
return rawMessage;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function getFormatter(runner) {
|
|
114
|
+
if (runner) {
|
|
115
|
+
const client = runner.client;
|
|
116
|
+
if (client) {
|
|
117
|
+
if (client._formatQuery) {
|
|
118
|
+
return client._formatQuery.bind(client);
|
|
119
|
+
} else if (client.SqlString) {
|
|
120
|
+
return client.SqlString.format.bind(client.SqlString);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (runner.builder?.toString) {
|
|
124
|
+
return runner.builder.toString.bind(runner.builder);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return () => "<noop formatter>";
|
|
128
|
+
}
|
|
129
|
+
function mapSystem(driverName) {
|
|
130
|
+
if (driverName === "sqlite3") {
|
|
131
|
+
return DB_SYSTEM_SQLITE;
|
|
132
|
+
}
|
|
133
|
+
if (driverName === "pg") {
|
|
134
|
+
return DB_SYSTEM_POSTGRESQL;
|
|
135
|
+
}
|
|
136
|
+
return driverName;
|
|
137
|
+
}
|
|
138
|
+
function getName(db, operation, table) {
|
|
139
|
+
if (operation && db) {
|
|
140
|
+
return table ? `${operation} ${db}.${table}` : `${operation} ${db}`;
|
|
141
|
+
}
|
|
142
|
+
return db;
|
|
143
|
+
}
|
|
144
|
+
function extractTableName(builder) {
|
|
145
|
+
const table = builder?._single?.table;
|
|
146
|
+
if (table && typeof table === "object") {
|
|
147
|
+
return extractTableName(table);
|
|
148
|
+
}
|
|
149
|
+
return typeof table === "string" ? table : void 0;
|
|
150
|
+
}
|
|
151
|
+
function extractDatabaseFromConnectionString(connectionString) {
|
|
152
|
+
if (!connectionString) {
|
|
153
|
+
return void 0;
|
|
154
|
+
}
|
|
155
|
+
try {
|
|
156
|
+
const db = new URL(connectionString).pathname?.replace(/^\//, "");
|
|
157
|
+
return db || void 0;
|
|
158
|
+
} catch {
|
|
159
|
+
return void 0;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function extractHostFromConnectionString(connectionString) {
|
|
163
|
+
if (!connectionString) {
|
|
164
|
+
return void 0;
|
|
165
|
+
}
|
|
166
|
+
try {
|
|
167
|
+
return new URL(connectionString).hostname || void 0;
|
|
168
|
+
} catch {
|
|
169
|
+
return void 0;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
function extractPortFromConnectionString(connectionString) {
|
|
173
|
+
if (!connectionString) {
|
|
174
|
+
return void 0;
|
|
175
|
+
}
|
|
176
|
+
try {
|
|
177
|
+
const port = new URL(connectionString).port;
|
|
178
|
+
return port ? parseInt(port, 10) : void 0;
|
|
179
|
+
} catch {
|
|
180
|
+
return void 0;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const knexChannelIntegration = defineIntegration(_knexChannelIntegration);
|
|
184
|
+
|
|
185
|
+
export { knexChannelIntegration };
|
|
186
|
+
//# sourceMappingURL=knex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knex.js","sources":["../../../../src/integrations/tracing-channel/knex.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-knex` produced.\n/* oxlint-disable typescript/no-deprecated */\n\nimport * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn, Span, SpanAttributes } from '@sentry/core';\nimport {\n debug,\n defineIntegration,\n getActiveSpan,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n truncate,\n waitForTracingChannelBinding,\n} from '@sentry/core';\nimport {\n DB_NAME,\n DB_OPERATION,\n DB_STATEMENT,\n DB_SYSTEM,\n DB_USER,\n NET_PEER_NAME,\n NET_PEER_PORT,\n NET_TRANSPORT,\n} from '@sentry/conventions/attributes';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { CHANNELS } from '../../orchestrion/channels';\nimport { bindTracingChannelToSpan } from '../../tracing-channel';\n\n// NOTE: this uses the same name as the OTel integration by design. `@sentry/node`'s `knexIntegration`\n// picks this subscriber over the vendored OTel path when orchestrion injection is active.\nconst INTEGRATION_NAME = 'Knex' as const;\nconst ORIGIN = 'auto.db.orchestrion.knex';\n\n// Max length of the query text captured in `db.statement`; \"...\" is appended when truncated, so the\n// truncated statement caps at 1024 chars (1 KiB), matching `@opentelemetry/instrumentation-knex`.\nconst MAX_QUERY_LENGTH = 1021;\n\n// `db.sql.table` is deprecated and not exported by `@sentry/conventions`, so keep it local. Matches\n// what `@opentelemetry/instrumentation-knex` emitted.\nconst ATTR_DB_SQL_TABLE = 'db.sql.table';\n\nconst DB_SYSTEM_SQLITE = 'sqlite';\nconst DB_SYSTEM_POSTGRESQL = 'postgresql';\n\n// The span active when a builder is created, reused as the parent when the query runs later (the query\n// often executes in a different async context than the builder was created in).\nconst parentSpanSymbol = Symbol('sentry.orchestrion.knex.parent-span');\n\ninterface KnexQuery {\n sql?: string;\n method?: string;\n bindings?: unknown[];\n}\n\ninterface KnexConnectionConfig {\n filename?: string;\n database?: string;\n user?: string;\n host?: string;\n port?: number;\n connectionString?: string;\n}\n\ninterface KnexBuilder {\n _single?: { table?: unknown };\n toString?: () => string;\n [parentSpanSymbol]?: Span;\n}\n\ninterface KnexClient {\n driverName?: string;\n config?: { connection?: KnexConnectionConfig };\n _formatQuery?: (sql: string, bindings: unknown[]) => string;\n SqlString?: { format: (sql: string, bindings: unknown[]) => string };\n}\n\ninterface KnexRunner {\n client?: KnexClient;\n builder?: KnexBuilder;\n}\n\n/** Context orchestrion attaches to the `orchestrion:knex:query` channel (wrapping `Runner.query`). */\ninterface KnexQueryChannelContext {\n // `arguments[0]` is the query object (`{ sql, method, bindings }`).\n arguments: [KnexQuery?];\n self?: KnexRunner;\n moduleVersion?: string;\n result?: unknown;\n error?: unknown;\n}\n\n/** Context orchestrion attaches to the `Client.queryBuilder`/`schemaBuilder`/`raw` channels. */\ninterface KnexBuilderChannelContext {\n arguments: unknown[];\n self?: unknown;\n // The builder returned by the wrapped method.\n result?: KnexBuilder;\n}\n\nconst _knexChannelIntegration = (() => {\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:knex] subscribing to channel \"${CHANNELS.KNEX_QUERY}\"`);\n\n waitForTracingChannelBinding(() => {\n subscribeBuilder(CHANNELS.KNEX_QUERY_BUILDER);\n subscribeBuilder(CHANNELS.KNEX_SCHEMA_BUILDER);\n subscribeBuilder(CHANNELS.KNEX_RAW);\n subscribeQuery();\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Bookkeeping only: stash the span active at builder-creation time onto the returned builder. It is\n * read back as the parent when the query runs (see `subscribeQuery`), because the query often executes\n * in a different async context. A `Client` builder method is synchronous, so its `result` (the builder)\n * is available on the channel's `end`.\n */\nfunction subscribeBuilder(channelName: string): void {\n diagnosticsChannel.tracingChannel(channelName).end.subscribe(message => {\n const builder = (message as KnexBuilderChannelContext).result;\n if (!builder || typeof builder !== 'object' || parentSpanSymbol in builder) {\n return;\n }\n\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n\n Object.defineProperty(builder, parentSpanSymbol, { value: activeSpan });\n });\n}\n\nfunction subscribeQuery(): void {\n bindTracingChannelToSpan<KnexQueryChannelContext>(\n diagnosticsChannel.tracingChannel<KnexQueryChannelContext>(CHANNELS.KNEX_QUERY),\n data => {\n const runner = data.self;\n const builder = runner?.builder;\n\n // The builder captures the span active when it was created (see `subscribeBuilder`).\n // `onlyIfParent`: only instrument queries that run as part of an existing trace, matching OTel.\n const parentSpan = builder?.[parentSpanSymbol] ?? getActiveSpan();\n if (!parentSpan) {\n return undefined;\n }\n\n const query = data.arguments[0];\n const client = runner?.client;\n const connection = client?.config?.connection;\n const connectionString = connection?.connectionString;\n const table = extractTableName(builder);\n const operation = query?.method;\n const name =\n connection?.filename || connection?.database || extractDatabaseFromConnectionString(connectionString);\n\n const attributes: SpanAttributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n 'knex.version': data.moduleVersion,\n [DB_SYSTEM]: mapSystem(client?.driverName),\n [ATTR_DB_SQL_TABLE]: table,\n [DB_OPERATION]: operation,\n [DB_USER]: connection?.user,\n [DB_NAME]: name,\n [NET_PEER_NAME]: connection?.host ?? extractHostFromConnectionString(connectionString),\n [NET_PEER_PORT]: connection?.port ?? extractPortFromConnectionString(connectionString),\n [NET_TRANSPORT]: connection?.filename === ':memory:' ? 'inproc' : undefined,\n [DB_STATEMENT]: query?.sql != null ? truncate(query.sql, MAX_QUERY_LENGTH) : undefined,\n };\n\n return startInactiveSpan({\n name: getName(name, operation, table) ?? 'knex.query',\n kind: SPAN_KIND.CLIENT,\n op: 'db',\n parentSpan,\n attributes,\n });\n },\n {\n beforeSpanEnd(span, data) {\n // knex prefixes query errors with the full SQL (\"<query> - <error>\"). Strip it so the span\n // status message is just the driver error, matching the vendored OTel instrumentation.\n if ('error' in data) {\n const message = cleanErrorMessage(data);\n if (message !== undefined) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message });\n }\n }\n },\n },\n );\n}\n\nfunction cleanErrorMessage(data: KnexQueryChannelContext): string | undefined {\n const error = data.error;\n if (!error || typeof error !== 'object' || typeof (error as { message?: unknown }).message !== 'string') {\n return undefined;\n }\n\n const rawMessage = (error as { message: string }).message;\n const query = data.arguments[0];\n if (!query?.sql) {\n return rawMessage;\n }\n\n try {\n const formatter = getFormatter(data.self);\n const fullQuery = formatter(query.sql, query.bindings || []);\n return rawMessage.replace(`${fullQuery} - `, '');\n } catch {\n return rawMessage;\n }\n}\n\nfunction getFormatter(runner: KnexRunner | undefined): (sql: string, bindings: unknown[]) => string {\n if (runner) {\n const client = runner.client;\n if (client) {\n if (client._formatQuery) {\n return client._formatQuery.bind(client);\n } else if (client.SqlString) {\n return client.SqlString.format.bind(client.SqlString);\n }\n }\n if (runner.builder?.toString) {\n return runner.builder.toString.bind(runner.builder);\n }\n }\n\n return () => '<noop formatter>';\n}\n\nfunction mapSystem(driverName: string | undefined): string | undefined {\n if (driverName === 'sqlite3') {\n return DB_SYSTEM_SQLITE;\n }\n if (driverName === 'pg') {\n return DB_SYSTEM_POSTGRESQL;\n }\n return driverName;\n}\n\nfunction getName(db: string | undefined, operation?: string, table?: string): string | undefined {\n // `db` can be undefined when the database can't be determined from the knex config. Guard against\n // interpolating it (which would emit the literal \"undefined\") and let the call site fall back.\n if (operation && db) {\n return table ? `${operation} ${db}.${table}` : `${operation} ${db}`;\n }\n return db;\n}\n\nfunction extractTableName(builder: KnexBuilder | undefined): string | undefined {\n const table = builder?._single?.table;\n if (table && typeof table === 'object') {\n return extractTableName(table as KnexBuilder);\n }\n return typeof table === 'string' ? table : undefined;\n}\n\nfunction extractDatabaseFromConnectionString(connectionString: string | undefined): string | undefined {\n if (!connectionString) {\n return undefined;\n }\n try {\n const db = new URL(connectionString).pathname?.replace(/^\\//, '');\n return db || undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction extractHostFromConnectionString(connectionString: string | undefined): string | undefined {\n if (!connectionString) {\n return undefined;\n }\n try {\n return new URL(connectionString).hostname || undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction extractPortFromConnectionString(connectionString: string | undefined): number | undefined {\n if (!connectionString) {\n return undefined;\n }\n try {\n const port = new URL(connectionString).port;\n return port ? parseInt(port, 10) : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * EXPERIMENTAL - orchestrion-driven knex integration.\n *\n * Subscribes to the `orchestrion:knex:*` diagnostics_channels that the orchestrion code transform\n * injects into knex's `Runner.query` (span) and `Client.queryBuilder`/`schemaBuilder`/`raw` (parent-span\n * bookkeeping). Requires the orchestrion runtime hook or bundler plugin to be active.\n */\nexport const knexChannelIntegration = defineIntegration(_knexChannelIntegration);\n"],"names":[],"mappings":";;;;;;;AAiCA,MAAM,gBAAA,GAAmB,MAAA;AACzB,MAAM,MAAA,GAAS,0BAAA;AAIf,MAAM,gBAAA,GAAmB,IAAA;AAIzB,MAAM,iBAAA,GAAoB,cAAA;AAE1B,MAAM,gBAAA,GAAmB,QAAA;AACzB,MAAM,oBAAA,GAAuB,YAAA;AAI7B,MAAM,gBAAA,0BAA0B,qCAAqC,CAAA;AAqDrE,MAAM,2BAA2B,MAAM;AACrC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IAC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
+
import { defineIntegration, debug, getActiveSpan, startSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getIsolationScope, getDefaultIsolationScope, getRootSpan, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_OP } from '@sentry/core';
|
|
3
|
+
import { KOA_NAME, HTTP_ROUTE, KOA_TYPE, CODE_FUNCTION_NAME } from '@sentry/conventions/attributes';
|
|
4
|
+
import { DEBUG_BUILD } from '../../debug-build.js';
|
|
5
|
+
import { CHANNELS } from '../../orchestrion/channels.js';
|
|
6
|
+
|
|
7
|
+
const INTEGRATION_NAME = "Koa";
|
|
8
|
+
const ORIGIN = "auto.http.orchestrion.koa";
|
|
9
|
+
const LAYER_TYPE = {
|
|
10
|
+
ROUTER: "router",
|
|
11
|
+
MIDDLEWARE: "middleware"
|
|
12
|
+
};
|
|
13
|
+
const kLayerPatched = /* @__PURE__ */ Symbol("sentry.koa.layer-patched");
|
|
14
|
+
let subscribed = false;
|
|
15
|
+
const _koaChannelIntegration = ((options = {}) => {
|
|
16
|
+
const ignoreLayersType = options.ignoreLayersType ?? [];
|
|
17
|
+
return {
|
|
18
|
+
name: INTEGRATION_NAME,
|
|
19
|
+
setupOnce() {
|
|
20
|
+
if (!diagnosticsChannel.tracingChannel || subscribed) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
subscribed = true;
|
|
24
|
+
DEBUG_BUILD && debug.log(`[orchestrion:koa] subscribing to channel "${CHANNELS.KOA_USE}"`);
|
|
25
|
+
diagnosticsChannel.tracingChannel(CHANNELS.KOA_USE).subscribe({
|
|
26
|
+
start(rawCtx) {
|
|
27
|
+
handleUse(rawCtx, ignoreLayersType);
|
|
28
|
+
},
|
|
29
|
+
end() {
|
|
30
|
+
},
|
|
31
|
+
asyncStart() {
|
|
32
|
+
},
|
|
33
|
+
asyncEnd() {
|
|
34
|
+
},
|
|
35
|
+
error() {
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
function handleUse(ctx, ignoreLayersType) {
|
|
42
|
+
const middleware = ctx.arguments[0];
|
|
43
|
+
if (typeof middleware === "function") {
|
|
44
|
+
ctx.arguments[0] = patchUse(middleware, ignoreLayersType);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function patchUse(middleware, ignoreLayersType) {
|
|
48
|
+
return middleware.router ? patchRouterDispatch(middleware, ignoreLayersType) : patchLayer(middleware, false, ignoreLayersType);
|
|
49
|
+
}
|
|
50
|
+
function patchRouterDispatch(dispatchLayer, ignoreLayersType) {
|
|
51
|
+
const router = dispatchLayer.router;
|
|
52
|
+
const routesStack = router?.stack ?? [];
|
|
53
|
+
for (const pathLayer of routesStack) {
|
|
54
|
+
const path = pathLayer.path;
|
|
55
|
+
const pathStack = pathLayer.stack;
|
|
56
|
+
pathStack.forEach((routedMiddleware, j) => {
|
|
57
|
+
pathStack[j] = patchLayer(routedMiddleware, true, ignoreLayersType, path);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return dispatchLayer;
|
|
61
|
+
}
|
|
62
|
+
function patchLayer(middlewareLayer, isRouter, ignoreLayersType, layerPath) {
|
|
63
|
+
const layerType = isRouter ? LAYER_TYPE.ROUTER : LAYER_TYPE.MIDDLEWARE;
|
|
64
|
+
if (middlewareLayer[kLayerPatched] === true || ignoreLayersType.includes(layerType)) {
|
|
65
|
+
return middlewareLayer;
|
|
66
|
+
}
|
|
67
|
+
if (middlewareLayer.constructor.name === "GeneratorFunction" || middlewareLayer.constructor.name === "AsyncGeneratorFunction") {
|
|
68
|
+
return middlewareLayer;
|
|
69
|
+
}
|
|
70
|
+
middlewareLayer[kLayerPatched] = true;
|
|
71
|
+
return (context, next) => {
|
|
72
|
+
if (!getActiveSpan()) {
|
|
73
|
+
return middlewareLayer(context, next);
|
|
74
|
+
}
|
|
75
|
+
const metadata = getMiddlewareMetadata(context, middlewareLayer, isRouter, layerPath);
|
|
76
|
+
if (context._matchedRoute) {
|
|
77
|
+
setHttpServerSpanRouteAttribute(context._matchedRoute.toString());
|
|
78
|
+
}
|
|
79
|
+
const koaName = metadata.attributes[KOA_NAME];
|
|
80
|
+
const name = typeof koaName === "string" ? koaName || "< unknown >" : metadata.name;
|
|
81
|
+
return startSpan(
|
|
82
|
+
{
|
|
83
|
+
name,
|
|
84
|
+
op: `${layerType}.koa`,
|
|
85
|
+
attributes: {
|
|
86
|
+
...metadata.attributes,
|
|
87
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
() => {
|
|
91
|
+
const route = metadata.attributes[HTTP_ROUTE];
|
|
92
|
+
if (getIsolationScope() === getDefaultIsolationScope()) {
|
|
93
|
+
DEBUG_BUILD && debug.warn("Isolation scope is default isolation scope - skipping setting transactionName");
|
|
94
|
+
} else if (route) {
|
|
95
|
+
const method = context.request?.method?.toUpperCase() || "GET";
|
|
96
|
+
getIsolationScope().setTransactionName(`${method} ${route}`);
|
|
97
|
+
}
|
|
98
|
+
return middlewareLayer(context, next);
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function getMiddlewareMetadata(context, layer, isRouter, layerPath) {
|
|
104
|
+
if (isRouter) {
|
|
105
|
+
return {
|
|
106
|
+
attributes: {
|
|
107
|
+
// oxlint-disable-next-line typescript/no-deprecated
|
|
108
|
+
[KOA_NAME]: layerPath?.toString(),
|
|
109
|
+
// TODO(v11): remove, replaced by http.route
|
|
110
|
+
[KOA_TYPE]: LAYER_TYPE.ROUTER,
|
|
111
|
+
[HTTP_ROUTE]: layerPath?.toString()
|
|
112
|
+
},
|
|
113
|
+
name: context._matchedRouteName || `router - ${layerPath}`
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
attributes: {
|
|
118
|
+
// oxlint-disable-next-line typescript/no-deprecated
|
|
119
|
+
[KOA_NAME]: layer.name || "middleware",
|
|
120
|
+
// TODO(v11): remove, replaced by code.function.name
|
|
121
|
+
[KOA_TYPE]: LAYER_TYPE.MIDDLEWARE,
|
|
122
|
+
[CODE_FUNCTION_NAME]: layer.name || "middleware"
|
|
123
|
+
},
|
|
124
|
+
name: `middleware - ${layer.name}`
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function setHttpServerSpanRouteAttribute(route) {
|
|
128
|
+
const activeSpan = getActiveSpan();
|
|
129
|
+
if (!activeSpan) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const rootSpan = getRootSpan(activeSpan);
|
|
133
|
+
if (!rootSpan) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (spanToJSON(rootSpan).data[SEMANTIC_ATTRIBUTE_SENTRY_OP] !== "http.server") {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
rootSpan.setAttribute(HTTP_ROUTE, route);
|
|
140
|
+
}
|
|
141
|
+
const koaChannelIntegration = defineIntegration(_koaChannelIntegration);
|
|
142
|
+
|
|
143
|
+
export { koaChannelIntegration };
|
|
144
|
+
//# sourceMappingURL=koa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"koa.js","sources":["../../../../src/integrations/tracing-channel/koa.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n debug,\n defineIntegration,\n getActiveSpan,\n getDefaultIsolationScope,\n getIsolationScope,\n getRootSpan,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n startSpan,\n} from '@sentry/core';\n// oxlint-disable-next-line typescript/no-deprecated\nimport { CODE_FUNCTION_NAME, HTTP_ROUTE, KOA_NAME, KOA_TYPE } from '@sentry/conventions/attributes';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { CHANNELS } from '../../orchestrion/channels';\n\n// Same name as the OTel integration. When enabled, the OTel 'Koa' integration is omitted from the default set.\nconst INTEGRATION_NAME = 'Koa' as const;\n\nconst ORIGIN = 'auto.http.orchestrion.koa';\n\nconst LAYER_TYPE = {\n ROUTER: 'router',\n MIDDLEWARE: 'middleware',\n} as const;\ntype KoaLayerType = (typeof LAYER_TYPE)[keyof typeof LAYER_TYPE];\n\n// Keeps wrapping idempotent — the same middleware instance can be registered on\n// multiple routes (mirrors the vendored OTel instrumentation's symbol).\nconst kLayerPatched: unique symbol = Symbol('sentry.koa.layer-patched');\n\n// Core dedupes `setupOnce` by integration name, but the Deno SDK also runs this\n// under the name `DenoKoa` (via `extendIntegration`), so guard against a second\n// subscription here.\nlet subscribed = false;\n\ntype Next = () => Promise<unknown>;\n\ninterface KoaContext {\n [key: string]: unknown;\n _matchedRoute?: string | RegExp;\n _matchedRouteName?: string;\n request?: { method?: string };\n}\n\ninterface Layer {\n path: string | RegExp;\n stack: KoaMiddleware[];\n}\n\ninterface Router {\n stack: Layer[];\n}\n\ntype KoaMiddleware = ((context: KoaContext, next: Next) => unknown) & {\n router?: Router;\n [kLayerPatched]?: boolean;\n};\n\ntype KoaSpanAttributes = Record<string, string | undefined>;\n\ninterface KoaMiddlewareMetadata {\n attributes: KoaSpanAttributes;\n name: string;\n}\n\ninterface KoaUseContext {\n arguments: unknown[];\n}\n\nexport interface KoaChannelIntegrationOptions {\n /** Ignore layers of the specified types (`'middleware'` and/or `'router'`). */\n ignoreLayersType?: Array<'middleware' | 'router'>;\n}\n\nconst _koaChannelIntegration = ((options: KoaChannelIntegrationOptions = {}) => {\n const ignoreLayersType = options.ignoreLayersType ?? [];\n\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 || subscribed) {\n return;\n }\n subscribed = true;\n DEBUG_BUILD && debug.log(`[orchestrion:koa] subscribing to channel \"${CHANNELS.KOA_USE}\"`);\n\n diagnosticsChannel.tracingChannel(CHANNELS.KOA_USE).subscribe({\n start(rawCtx) {\n handleUse(rawCtx as KoaUseContext, ignoreLayersType);\n },\n end() {},\n asyncStart() {},\n asyncEnd() {},\n error() {},\n });\n },\n };\n}) satisfies IntegrationFn;\n\nfunction handleUse(ctx: KoaUseContext, ignoreLayersType: KoaLayerType[]): void {\n const middleware = ctx.arguments[0];\n if (typeof middleware === 'function') {\n ctx.arguments[0] = patchUse(middleware as KoaMiddleware, ignoreLayersType);\n }\n}\n\n/**\n * Wrap a registered koa middleware. A `@koa/router` dispatch layer\n * (`router.routes()`) exposes a `.router`, in which case we patch each routed\n * middleware in its stack (in place) and leave the dispatch itself unwrapped;\n * everything else is a plain middleware.\n */\nfunction patchUse(middleware: KoaMiddleware, ignoreLayersType: KoaLayerType[]): KoaMiddleware {\n return middleware.router\n ? patchRouterDispatch(middleware, ignoreLayersType)\n : patchLayer(middleware, false, ignoreLayersType);\n}\n\n/**\n * Patches the dispatch function used by `@koa/router`, wrapping each routed\n * middleware in the router's stack so routed spans carry their matched path.\n */\nfunction patchRouterDispatch(dispatchLayer: KoaMiddleware, ignoreLayersType: KoaLayerType[]): KoaMiddleware {\n const router = dispatchLayer.router;\n const routesStack = router?.stack ?? [];\n for (const pathLayer of routesStack) {\n const path = pathLayer.path;\n const pathStack = pathLayer.stack;\n pathStack.forEach((routedMiddleware, j) => {\n pathStack[j] = patchLayer(routedMiddleware, true, ignoreLayersType, path);\n });\n }\n return dispatchLayer;\n}\n\n/**\n * Wraps an individual middleware layer so it opens a span when invoked. No span\n * is created when there is no active (parent) span, matching the vendored OTel\n * instrumentation's `api.trace.getSpan(api.context.active())` guard.\n */\nfunction patchLayer(\n middlewareLayer: KoaMiddleware,\n isRouter: boolean,\n ignoreLayersType: KoaLayerType[],\n layerPath?: string | RegExp,\n): KoaMiddleware {\n const layerType = isRouter ? LAYER_TYPE.ROUTER : LAYER_TYPE.MIDDLEWARE;\n // Skip patching the layer if it's ignored by config or already wrapped.\n if (middlewareLayer[kLayerPatched] === true || ignoreLayersType.includes(layerType)) {\n return middlewareLayer;\n }\n\n if (\n middlewareLayer.constructor.name === 'GeneratorFunction' ||\n middlewareLayer.constructor.name === 'AsyncGeneratorFunction'\n ) {\n return middlewareLayer;\n }\n\n middlewareLayer[kLayerPatched] = true;\n\n return (context: KoaContext, next: Next) => {\n if (!getActiveSpan()) {\n return middlewareLayer(context, next);\n }\n const metadata = getMiddlewareMetadata(context, middlewareLayer, isRouter, layerPath);\n\n if (context._matchedRoute) {\n setHttpServerSpanRouteAttribute(context._matchedRoute.toString());\n }\n\n // oxlint-disable-next-line typescript/no-deprecated\n const koaName = metadata.attributes[KOA_NAME];\n // Somehow, name is sometimes `''` for middleware spans.\n // See: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2220\n const name = typeof koaName === 'string' ? koaName || '< unknown >' : metadata.name;\n\n return startSpan(\n {\n name,\n op: `${layerType}.koa`,\n attributes: {\n ...metadata.attributes,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n },\n },\n () => {\n const route = metadata.attributes[HTTP_ROUTE];\n if (getIsolationScope() === getDefaultIsolationScope()) {\n DEBUG_BUILD && debug.warn('Isolation scope is default isolation scope - skipping setting transactionName');\n } else if (route) {\n const method = context.request?.method?.toUpperCase() || 'GET';\n getIsolationScope().setTransactionName(`${method} ${route}`);\n }\n return middlewareLayer(context, next);\n },\n );\n };\n}\n\nfunction getMiddlewareMetadata(\n context: KoaContext,\n layer: KoaMiddleware,\n isRouter: boolean,\n layerPath?: string | RegExp,\n): KoaMiddlewareMetadata {\n if (isRouter) {\n return {\n attributes: {\n // oxlint-disable-next-line typescript/no-deprecated\n [KOA_NAME]: layerPath?.toString(), // TODO(v11): remove, replaced by http.route\n [KOA_TYPE]: LAYER_TYPE.ROUTER,\n [HTTP_ROUTE]: layerPath?.toString(),\n },\n name: context._matchedRouteName || `router - ${layerPath}`,\n };\n }\n return {\n attributes: {\n // oxlint-disable-next-line typescript/no-deprecated\n [KOA_NAME]: layer.name || 'middleware', // TODO(v11): remove, replaced by code.function.name\n [KOA_TYPE]: LAYER_TYPE.MIDDLEWARE,\n [CODE_FUNCTION_NAME]: layer.name || 'middleware',\n },\n name: `middleware - ${layer.name}`,\n };\n}\n\n/**\n * Set the `http.route` attribute on the root HTTP server span for the current trace.\n *\n * No-op when there is no active span, no root span, or the root span is not an\n * `http.server` span — so this can be called unconditionally without risking\n * attribute pollution on non-HTTP root spans.\n */\nfunction setHttpServerSpanRouteAttribute(route: string): void {\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n const rootSpan = getRootSpan(activeSpan);\n if (!rootSpan) {\n return;\n }\n if (spanToJSON(rootSpan).data[SEMANTIC_ATTRIBUTE_SENTRY_OP] !== 'http.server') {\n return;\n }\n rootSpan.setAttribute(HTTP_ROUTE, route);\n}\n\n/**\n * EXPERIMENTAL — orchestrion-driven koa integration. Subscribes to the\n * `orchestrion:koa:use` channel injected into `Application.prototype.use` and\n * wraps each registered middleware/router layer in a span-creating proxy.\n * Requires the orchestrion runtime hook or bundler plugin.\n */\nexport const koaChannelIntegration = defineIntegration(_koaChannelIntegration);\n"],"names":[],"mappings":";;;;;;AAoBA,MAAM,gBAAA,GAAmB,KAAA;AAEzB,MAAM,MAAA,GAAS,2BAAA;AAEf,MAAM,UAAA,GAAa;AAAA,EACjB,MAAA,EAAQ,QAAA;AAAA,EACR,UAAA,EAAY;AACd,CAAA;AAKA,MAAM,aAAA,0BAAsC,0BAA0B,CAAA;AAKtE,IAAI,UAAA,GAAa,KAAA;AAyCjB,MAAM,sBAAA,IAA0B,CAAC,OAAA,GAAwC,EAAC,KAAM;AAC9E,EAAA,MAAM,gBAAA,GAAmB,OAAA,CAAQ,gBAAA,IAAoB,EAAC;AAEtD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AAEV,MAAA,IAAI,CAAC,kBAAA,CAAmB,cAAA,IAAkB,UAAA,EAAY;AAC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AA;AAAA,MAEV,CAAC,QAAQ,GAAG,KAAA,CAAM,IAAA,IAAQ,YAAA;AAAA;AAAA,MAC1B,CAAC,QAAQ,GAAG,UAAA,CAAW,UAAA;AAAA,MACvB,CAAC,kBAAkB,GAAG,KAAA,CAAM,IAAA,IAAQ;AAAA,KACtC;AAAA,IACA,IAAA,EAAM,CAAA,aAAA,EAAgB,KAAA,CAAM,IAAI,CAAA;AAAA,GAClC;AACF;AASA,SAAS,gCAAgC,KAAA,EAAqB;AAC5D,EAAA,MAAM,aAAa,aAAA,EAAc;AACjC,EAAA,IAAI,CAAC,UAAA,EAAY;AACf,IAAA;AAAA,EACF;AACA,EAAA,MAAM,QAAA,GAAW,YAAY,UAAU,CAAA;AACvC,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA;AAAA,EACF;AACA,EAAA,IAAI,WAAW,QAAQ,CAAA,CAAE,IAAA,CAAK,4BAA4B,MAAM,aAAA,EAAe;AAC7E,IAAA;AAAA,EACF;AACA,EAAA,QAAA,CAAS,YAAA,CAAa,YAAY,KAAK,CAAA;AACzC;AAQO,MAAM,qBAAA,GAAwB,kBAAkB,sBAAsB;;;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as diagnosticsChannel from 'node:diagnostics_channel';
|
|
2
|
+
import { defineIntegration, LANGCHAIN_INTEGRATION_NAME, createLangChainCallbackHandler, debug, waitForTracingChannelBinding, _INTERNAL_mergeLangChainCallbackHandler, startInactiveSpan, _INTERNAL_getLangChainEmbeddingsSpanOptions, _INTERNAL_skipAiProviderWrapping, OPENAI_INTEGRATION_NAME, ANTHROPIC_AI_INTEGRATION_NAME, GOOGLE_GENAI_INTEGRATION_NAME } from '@sentry/core';
|
|
3
|
+
import { DEBUG_BUILD } from '../../debug-build.js';
|
|
4
|
+
import { CHANNELS } from '../../orchestrion/channels.js';
|
|
5
|
+
import { langchainEmbeddingsChannels } from '../../orchestrion/config/langchain.js';
|
|
6
|
+
import { bindTracingChannelToSpan } from '../../tracing-channel.js';
|
|
7
|
+
|
|
8
|
+
const INTEGRATION_NAME = LANGCHAIN_INTEGRATION_NAME;
|
|
9
|
+
const SKIPPED_PROVIDERS = [OPENAI_INTEGRATION_NAME, ANTHROPIC_AI_INTEGRATION_NAME, GOOGLE_GENAI_INTEGRATION_NAME];
|
|
10
|
+
let subscribed = false;
|
|
11
|
+
function markProvidersSkipped() {
|
|
12
|
+
_INTERNAL_skipAiProviderWrapping(SKIPPED_PROVIDERS);
|
|
13
|
+
}
|
|
14
|
+
const _langChainChannelIntegration = ((options = {}) => {
|
|
15
|
+
return {
|
|
16
|
+
name: INTEGRATION_NAME,
|
|
17
|
+
setupOnce() {
|
|
18
|
+
if (!diagnosticsChannel.tracingChannel || subscribed) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
subscribed = true;
|
|
22
|
+
const sentryHandler = createLangChainCallbackHandler(options);
|
|
23
|
+
const injectHandler = (message) => {
|
|
24
|
+
markProvidersSkipped();
|
|
25
|
+
const args = message.arguments;
|
|
26
|
+
if (!Array.isArray(args)) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
let callOptions = args[1];
|
|
30
|
+
if (!callOptions || typeof callOptions !== "object" || Array.isArray(callOptions)) {
|
|
31
|
+
callOptions = {};
|
|
32
|
+
args[1] = callOptions;
|
|
33
|
+
}
|
|
34
|
+
callOptions.callbacks = _INTERNAL_mergeLangChainCallbackHandler(callOptions.callbacks, sentryHandler);
|
|
35
|
+
};
|
|
36
|
+
for (const channelName of [CHANNELS.LANGCHAIN_CHAT_MODEL_INVOKE, CHANNELS.LANGCHAIN_CHAT_MODEL_STREAM]) {
|
|
37
|
+
DEBUG_BUILD && debug.log(`[orchestrion:langchain] subscribing to channel "${channelName}"`);
|
|
38
|
+
diagnosticsChannel.tracingChannel(channelName).start.subscribe(injectHandler);
|
|
39
|
+
}
|
|
40
|
+
waitForTracingChannelBinding(() => {
|
|
41
|
+
for (const channelName of langchainEmbeddingsChannels) {
|
|
42
|
+
DEBUG_BUILD && debug.log(`[orchestrion:langchain] subscribing to channel "${channelName}"`);
|
|
43
|
+
bindTracingChannelToSpan(
|
|
44
|
+
diagnosticsChannel.tracingChannel(channelName),
|
|
45
|
+
(data) => createEmbeddingsSpan(data, options),
|
|
46
|
+
{ captureError: () => ({ mechanism: { handled: false, type: "auto.ai.langchain" } }) }
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
function createEmbeddingsSpan(data, options) {
|
|
54
|
+
markProvidersSkipped();
|
|
55
|
+
const input = (data.arguments ?? [])[0];
|
|
56
|
+
return startInactiveSpan(_INTERNAL_getLangChainEmbeddingsSpanOptions(data.self, input, options));
|
|
57
|
+
}
|
|
58
|
+
const langChainChannelIntegration = defineIntegration(_langChainChannelIntegration);
|
|
59
|
+
|
|
60
|
+
export { langChainChannelIntegration };
|
|
61
|
+
//# sourceMappingURL=langchain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"langchain.js","sources":["../../../../src/integrations/tracing-channel/langchain.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn, LangChainOptions, Span } from '@sentry/core';\nimport {\n _INTERNAL_getLangChainEmbeddingsSpanOptions,\n _INTERNAL_mergeLangChainCallbackHandler,\n _INTERNAL_skipAiProviderWrapping,\n ANTHROPIC_AI_INTEGRATION_NAME,\n createLangChainCallbackHandler,\n debug,\n defineIntegration,\n GOOGLE_GENAI_INTEGRATION_NAME,\n LANGCHAIN_INTEGRATION_NAME,\n OPENAI_INTEGRATION_NAME,\n startInactiveSpan,\n waitForTracingChannelBinding,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { CHANNELS } from '../../orchestrion/channels';\nimport { langchainEmbeddingsChannels } from '../../orchestrion/config/langchain';\nimport { bindTracingChannelToSpan } from '../../tracing-channel';\n\n// Same name as the OTel integration by design: when enabled, the OTel 'LangChain' integration is\n// dropped from the default set (see the Node opt-in loader).\nconst INTEGRATION_NAME = LANGCHAIN_INTEGRATION_NAME;\n\n// LangChain drives the underlying AI provider SDKs itself, so while it's active those providers must\n// not also instrument, or every call would produce two spans (mirrors the OTel path's skip list).\nconst SKIPPED_PROVIDERS = [OPENAI_INTEGRATION_NAME, ANTHROPIC_AI_INTEGRATION_NAME, GOOGLE_GENAI_INTEGRATION_NAME];\n\n// The chat-model channels carry the live args array of `invoke(input, options)` / `_streamIterator(input, options)`.\ninterface RunnableChannelContext {\n arguments: unknown[];\n}\n\n// The embeddings channels carry the instance (`self`) and the `embedQuery(text)` / `embedDocuments(texts)` args.\ninterface EmbeddingsChannelContext {\n self?: unknown;\n arguments: unknown[];\n}\n\nlet subscribed = false;\n\n// Registered lazily on the first LangChain call (not at `setupOnce`) so a direct provider call made\n// before any LangChain call still gets its own span — matches the OTel patch-on-import timing. It\n// also stops the underlying SDK from double-instrumenting embeddings, whose `embedQuery`/\n// `embedDocuments` call the provider SDK (e.g. `openai`) internally.\nfunction markProvidersSkipped(): void {\n _INTERNAL_skipAiProviderWrapping(SKIPPED_PROVIDERS);\n}\n\nconst _langChainChannelIntegration = ((options: LangChainOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // `tracingChannel` is unavailable before Node 18.19, and a second `init()` would double-subscribe.\n if (!diagnosticsChannel.tracingChannel || subscribed) {\n return;\n }\n subscribed = true;\n\n // One stateful handler tracks spans across the whole run tree, just like the OTel path.\n const sentryHandler = createLangChainCallbackHandler(options);\n\n // Chat models: inject the Sentry callback handler into the call options (arg 1). LangChain's own\n // callback dispatch then creates the spans, exactly as in the OTel path, so no span is opened\n // here — a `start` subscriber (which also makes orchestrion wrap the function) is enough.\n const injectHandler = (message: unknown): void => {\n markProvidersSkipped();\n\n const args = (message as RunnableChannelContext).arguments;\n if (!Array.isArray(args)) {\n return;\n }\n\n let callOptions = args[1] as Record<string, unknown> | undefined;\n if (!callOptions || typeof callOptions !== 'object' || Array.isArray(callOptions)) {\n callOptions = {};\n args[1] = callOptions;\n }\n\n callOptions.callbacks = _INTERNAL_mergeLangChainCallbackHandler(callOptions.callbacks, sentryHandler);\n };\n\n for (const channelName of [CHANNELS.LANGCHAIN_CHAT_MODEL_INVOKE, CHANNELS.LANGCHAIN_CHAT_MODEL_STREAM]) {\n DEBUG_BUILD && debug.log(`[orchestrion:langchain] subscribing to channel \"${channelName}\"`);\n diagnosticsChannel.tracingChannel<RunnableChannelContext>(channelName).start.subscribe(injectHandler);\n }\n\n // Embeddings don't use the callback system — the OTel path wraps the method in its own span, so\n // do the same here. `bindTracingChannelToSpan` needs the async-context binding that\n // `initOpenTelemetry()` registers after `setupOnce`, so wait for it before subscribing.\n waitForTracingChannelBinding(() => {\n for (const channelName of langchainEmbeddingsChannels) {\n DEBUG_BUILD && debug.log(`[orchestrion:langchain] subscribing to channel \"${channelName}\"`);\n bindTracingChannelToSpan(\n diagnosticsChannel.tracingChannel<EmbeddingsChannelContext>(channelName),\n data => createEmbeddingsSpan(data, options),\n { captureError: () => ({ mechanism: { handled: false, type: 'auto.ai.langchain' } }) },\n );\n }\n });\n },\n };\n}) satisfies IntegrationFn;\n\nfunction createEmbeddingsSpan(data: EmbeddingsChannelContext, options: LangChainOptions): Span {\n // `embedQuery`/`embedDocuments` call the provider SDK internally, so skip that SDK's own\n // instrumentation before its channel fires (the producer runs at the embeddings channel's `start`).\n markProvidersSkipped();\n\n const input = (data.arguments ?? [])[0];\n\n return startInactiveSpan(_INTERNAL_getLangChainEmbeddingsSpanOptions(data.self, input, options));\n}\n\n/**\n * EXPERIMENTAL — orchestrion-driven LangChain integration. Subscribes to the diagnostics_channels\n * injected into `@langchain/core`'s `BaseChatModel` (to inject the Sentry callback handler) and into\n * `@langchain/openai`'s embedding methods, so it requires the orchestrion runtime hook or bundler plugin.\n */\nexport const langChainChannelIntegration = defineIntegration(_langChainChannelIntegration);\n"],"names":[],"mappings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