@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,166 @@
|
|
|
1
|
+
import { HTTP_ROUTE } from '@sentry/conventions/attributes';
|
|
2
|
+
import { debug, getActiveSpan, getIsolationScope, getDefaultIsolationScope, startInactiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getRootSpan, spanToJSON, stringMatchesSomePattern } from '@sentry/core';
|
|
3
|
+
import { DEBUG_BUILD } from '../../../debug-build.js';
|
|
4
|
+
import { CHANNELS } from '../../../orchestrion/channels.js';
|
|
5
|
+
import { bindTracingChannelToSpan } from '../../../tracing-channel.js';
|
|
6
|
+
import { setLayerRegisteredPath, getLayerPath, getLayerRegisteredPath, pushLayerPath, getConstructedRoute, getActualMatchedRoute, popLayerPath } from './route.js';
|
|
7
|
+
|
|
8
|
+
const ORIGIN = "auto.http.express";
|
|
9
|
+
const ATTR_EXPRESS_NAME = "express.name";
|
|
10
|
+
const ATTR_EXPRESS_TYPE = "express.type";
|
|
11
|
+
const NOOP = () => {
|
|
12
|
+
};
|
|
13
|
+
let _isInstrumented = false;
|
|
14
|
+
function instrumentExpress(options, tracingChannel) {
|
|
15
|
+
if (_isInstrumented) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
_isInstrumented = true;
|
|
19
|
+
for (const channelName of [CHANNELS.EXPRESS_REGISTER, CHANNELS.ROUTER_REGISTER]) {
|
|
20
|
+
tracingChannel(channelName).subscribe({
|
|
21
|
+
start: NOOP,
|
|
22
|
+
asyncStart: NOOP,
|
|
23
|
+
asyncEnd: NOOP,
|
|
24
|
+
error: NOOP,
|
|
25
|
+
end: captureRegisteredLayerPath
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
for (const channelName of [CHANNELS.EXPRESS_HANDLE, CHANNELS.ROUTER_HANDLE]) {
|
|
29
|
+
DEBUG_BUILD && debug.log(`[orchestrion:express] subscribing to channel "${channelName}"`);
|
|
30
|
+
const channel = tracingChannel(channelName);
|
|
31
|
+
bindTracingChannelToSpan(channel, (data) => getSpanForLayer(data, options), {
|
|
32
|
+
beforeSpanEnd(_span, data) {
|
|
33
|
+
data._sentryCleanup?.();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
channel.subscribe({
|
|
37
|
+
start: NOOP,
|
|
38
|
+
asyncEnd: NOOP,
|
|
39
|
+
end: NOOP,
|
|
40
|
+
error: NOOP,
|
|
41
|
+
asyncStart: popLayerPathForLayer
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function captureRegisteredLayerPath(data) {
|
|
46
|
+
const stack = data.self?.stack;
|
|
47
|
+
if (!Array.isArray(stack)) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const layer = stack[stack.length - 1];
|
|
51
|
+
if (layer) {
|
|
52
|
+
setLayerRegisteredPath(layer, getLayerPath(data.arguments ?? []));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function popLayerPathForLayer(data) {
|
|
56
|
+
if (!data._sentryStoredLayer) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
data._sentryStoredLayer = false;
|
|
60
|
+
const req = data.arguments?.[0];
|
|
61
|
+
if (req) {
|
|
62
|
+
popLayerPath(req);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function getSpanForLayer(data, options) {
|
|
66
|
+
const layer = data.self;
|
|
67
|
+
const args = data.arguments;
|
|
68
|
+
if (!layer || !Array.isArray(args)) {
|
|
69
|
+
return void 0;
|
|
70
|
+
}
|
|
71
|
+
if (layer.handle?.length === 4) {
|
|
72
|
+
return void 0;
|
|
73
|
+
}
|
|
74
|
+
if (layer.method && !layer.route) {
|
|
75
|
+
return void 0;
|
|
76
|
+
}
|
|
77
|
+
const req = args[0];
|
|
78
|
+
const res = args[1];
|
|
79
|
+
if (!req) {
|
|
80
|
+
return void 0;
|
|
81
|
+
}
|
|
82
|
+
if (!getActiveSpan()) {
|
|
83
|
+
return void 0;
|
|
84
|
+
}
|
|
85
|
+
const type = getLayerType(layer);
|
|
86
|
+
const registeredPath = getLayerRegisteredPath(layer);
|
|
87
|
+
if (registeredPath != null) {
|
|
88
|
+
pushLayerPath(req, registeredPath);
|
|
89
|
+
data._sentryStoredLayer = true;
|
|
90
|
+
}
|
|
91
|
+
const constructedRoute = type === "request_handler" ? getConstructedRoute(req) : void 0;
|
|
92
|
+
const matchedRoute = type === "request_handler" && constructedRoute != null ? getActualMatchedRoute(req, constructedRoute) : void 0;
|
|
93
|
+
const name = type === "request_handler" ? constructedRoute || "request handler" : type === "router" ? layer.path ?? "/" : layer.name ?? "<anonymous>";
|
|
94
|
+
if (matchedRoute) {
|
|
95
|
+
setHttpServerSpanRoute(matchedRoute);
|
|
96
|
+
}
|
|
97
|
+
if (type === "request_handler" && constructedRoute) {
|
|
98
|
+
const isolationScope = getIsolationScope();
|
|
99
|
+
if (isolationScope !== getDefaultIsolationScope()) {
|
|
100
|
+
const method = typeof req.method === "string" ? req.method.toUpperCase() : "GET";
|
|
101
|
+
isolationScope.setTransactionName(`${method} ${constructedRoute}`);
|
|
102
|
+
} else {
|
|
103
|
+
DEBUG_BUILD && debug.warn(
|
|
104
|
+
"[orchestrion:express] Isolation scope is still default isolation scope - skipping transaction name"
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (isLayerIgnored(name, type, options)) {
|
|
109
|
+
return void 0;
|
|
110
|
+
}
|
|
111
|
+
const span = startInactiveSpan({
|
|
112
|
+
name,
|
|
113
|
+
attributes: {
|
|
114
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
|
|
115
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.express`,
|
|
116
|
+
[ATTR_EXPRESS_NAME]: name,
|
|
117
|
+
[ATTR_EXPRESS_TYPE]: type,
|
|
118
|
+
...matchedRoute ? { [HTTP_ROUTE]: matchedRoute } : {}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
if (res && typeof res.once === "function") {
|
|
122
|
+
const onFinish = () => {
|
|
123
|
+
span.end();
|
|
124
|
+
};
|
|
125
|
+
res.once("finish", onFinish);
|
|
126
|
+
data._sentryCleanup = () => res.removeListener("finish", onFinish);
|
|
127
|
+
}
|
|
128
|
+
return span;
|
|
129
|
+
}
|
|
130
|
+
function getLayerType(layer) {
|
|
131
|
+
if (layer.name === "router") {
|
|
132
|
+
return "router";
|
|
133
|
+
}
|
|
134
|
+
if (layer.name === "bound dispatch" || layer.name === "handle") {
|
|
135
|
+
return "request_handler";
|
|
136
|
+
}
|
|
137
|
+
return "middleware";
|
|
138
|
+
}
|
|
139
|
+
function setHttpServerSpanRoute(route) {
|
|
140
|
+
const activeSpan = getActiveSpan();
|
|
141
|
+
const rootSpan = activeSpan && getRootSpan(activeSpan);
|
|
142
|
+
if (!rootSpan) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (spanToJSON(rootSpan).data[SEMANTIC_ATTRIBUTE_SENTRY_OP] !== "http.server") {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
rootSpan.setAttribute(HTTP_ROUTE, route);
|
|
149
|
+
}
|
|
150
|
+
function isLayerIgnored(name, type, options) {
|
|
151
|
+
const { ignoreLayers, ignoreLayersType } = options;
|
|
152
|
+
if (Array.isArray(ignoreLayersType) && ignoreLayersType.includes(type)) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
if (!Array.isArray(ignoreLayers)) {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
try {
|
|
159
|
+
return stringMatchesSomePattern(name, ignoreLayers, true);
|
|
160
|
+
} catch {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export { instrumentExpress };
|
|
166
|
+
//# sourceMappingURL=instrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/tracing-channel/express/instrumentation.ts"],"sourcesContent":["import type * as diagnosticsChannel from 'node:diagnostics_channel';\nimport { HTTP_ROUTE } from '@sentry/conventions/attributes';\nimport type { Span } from '@sentry/core';\nimport {\n debug,\n getActiveSpan,\n getDefaultIsolationScope,\n getIsolationScope,\n getRootSpan,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n startInactiveSpan,\n stringMatchesSomePattern,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport { CHANNELS } from '../../../orchestrion/channels';\nimport { bindTracingChannelToSpan } from '../../../tracing-channel';\nimport {\n getActualMatchedRoute,\n getConstructedRoute,\n getLayerPath,\n getLayerRegisteredPath,\n popLayerPath,\n pushLayerPath,\n setLayerRegisteredPath,\n} from './route';\nimport type {\n ExpressIntegrationOptions,\n ExpressLayer,\n ExpressLayerType,\n ExpressRequest,\n ExpressResponse,\n HandleChannelContext,\n RegistrationChannelContext,\n} from './types';\n\nconst ORIGIN = 'auto.http.express';\n\n// `express.name`/`express.type` are Sentry-internal Express attributes (not part\n// of `@sentry/conventions`); kept in sync with `@sentry/core`'s OTel-derived\n// Express integration so the emitted spans are identical across both code paths.\nconst ATTR_EXPRESS_NAME = 'express.name';\nconst ATTR_EXPRESS_TYPE = 'express.type';\n\nconst NOOP = (): void => {};\n\nlet _isInstrumented = false;\n\nexport function instrumentExpress(\n options: ExpressIntegrationOptions,\n tracingChannel: typeof diagnosticsChannel.tracingChannel,\n): void {\n if (_isInstrumented) {\n return;\n }\n _isInstrumented = true;\n\n // Record each layer's registered path *pattern* as it is registered, so the\n // matched route can be reconstructed with its parameters intact at request\n // time. Only the `end` event matters (the layer is on the router's stack by\n // then); the others are required by the subscriber type, so no-op them.\n for (const channelName of [CHANNELS.EXPRESS_REGISTER, CHANNELS.ROUTER_REGISTER]) {\n tracingChannel<RegistrationChannelContext>(channelName).subscribe({\n start: NOOP,\n asyncStart: NOOP,\n asyncEnd: NOOP,\n error: NOOP,\n end: captureRegisteredLayerPath,\n });\n }\n\n for (const channelName of [CHANNELS.EXPRESS_HANDLE, CHANNELS.ROUTER_HANDLE]) {\n DEBUG_BUILD && debug.log(`[orchestrion:express] subscribing to channel \"${channelName}\"`);\n\n const channel = tracingChannel<HandleChannelContext>(channelName);\n\n bindTracingChannelToSpan(channel, data => getSpanForLayer(data, options), {\n beforeSpanEnd(_span, data) {\n data._sentryCleanup?.();\n },\n });\n\n // Pop the layer path when the layer hands off via `next`. `asyncStart` fires\n // when `next` is called and *before* the downstream layer runs, so the\n // per-request path chain reflects only the current chain when each layer\n // reconstructs its route. Only `asyncStart` is relevant here.\n channel.subscribe({\n start: NOOP,\n asyncEnd: NOOP,\n end: NOOP,\n error: NOOP,\n asyncStart: popLayerPathForLayer,\n });\n }\n}\n\n/** Record the freshly-registered layer's path pattern from a `route`/`use` call. */\nfunction captureRegisteredLayerPath(data: RegistrationChannelContext): void {\n const stack = data.self?.stack;\n if (!Array.isArray(stack)) {\n return;\n }\n const layer = stack[stack.length - 1];\n if (layer) {\n setLayerRegisteredPath(layer, getLayerPath(data.arguments ?? []));\n }\n}\n\n/** Pop the path a layer pushed once it hands control onward via `next`. */\nfunction popLayerPathForLayer(data: HandleChannelContext): void {\n if (!data._sentryStoredLayer) {\n return;\n }\n // Clear the marker first so a layer that (incorrectly) calls `next` more than\n // once can't pop again and take a parent's entry off the stack with it.\n data._sentryStoredLayer = false;\n const req = data.arguments?.[0] as ExpressRequest | undefined;\n if (req) {\n popLayerPath(req);\n }\n}\n\n/**\n * Open a span for one layer invocation. Returns `undefined` to opt the layer\n * out (error handlers, or a layer with no active parent trace) — the helper\n * then leaves the active context untouched.\n */\nfunction getSpanForLayer(data: HandleChannelContext, options: ExpressIntegrationOptions): Span | undefined {\n const layer = data.self;\n const args = data.arguments;\n if (!layer || !Array.isArray(args)) {\n return undefined;\n }\n\n // Express only treats a 4-arg handler as an error handler and skips it in\n // the normal request pipeline; match the OTel integration and don't trace it.\n if (layer.handle?.length === 4) {\n return undefined;\n }\n\n // A Route dispatches to its handlers via the same `handle_request` method,\n // but those inner layers already run inside the route-dispatch layer's\n // `request_handler` span. They carry `.method` (and no `.route`); skip them\n // so we emit one span per route, matching the OTel Express integration.\n if (layer.method && !layer.route) {\n return undefined;\n }\n\n const req = args[0] as ExpressRequest | undefined;\n const res = args[1] as ExpressResponse | undefined;\n if (!req) {\n return undefined;\n }\n\n // No active parent span means this request is being ignored (unsampled /\n // filtered), so don't open a span\n if (!getActiveSpan()) {\n return undefined;\n }\n\n const type = getLayerType(layer);\n\n // Push this layer's registered path onto the request's chain so a\n // `request_handler` can reconstruct the full route with parameters intact\n // (`req.baseUrl` only exposes the *resolved* mount prefix). The matching pop\n // happens on `asyncStart` when the layer hands off via `next`.\n const registeredPath = getLayerRegisteredPath(layer);\n if (registeredPath != null) {\n pushLayerPath(req, registeredPath);\n data._sentryStoredLayer = true;\n }\n\n // `constructedRoute` (the full registered pattern) names the span/transaction;\n // `matchedRoute` (validated against the request URL) is the `http.route`.\n const constructedRoute = type === 'request_handler' ? getConstructedRoute(req) : undefined;\n const matchedRoute =\n type === 'request_handler' && constructedRoute != null ? getActualMatchedRoute(req, constructedRoute) : undefined;\n\n const name =\n type === 'request_handler'\n ? constructedRoute || 'request handler'\n : type === 'router'\n ? (layer.path ?? '/')\n : (layer.name ?? '<anonymous>');\n\n // Propagate the route to the root `http.server` span *before* the ignore\n // check, so the transaction is still named even when the layer's own span is\n // ignored — matches the OTel Express integration's `onRouteResolved` timing.\n if (matchedRoute) {\n setHttpServerSpanRoute(matchedRoute);\n }\n\n if (type === 'request_handler' && constructedRoute) {\n const isolationScope = getIsolationScope();\n if (isolationScope !== getDefaultIsolationScope()) {\n const method = typeof req.method === 'string' ? req.method.toUpperCase() : 'GET';\n isolationScope.setTransactionName(`${method} ${constructedRoute}`);\n } else {\n DEBUG_BUILD &&\n debug.warn(\n '[orchestrion:express] Isolation scope is still default isolation scope - skipping transaction name',\n );\n }\n }\n\n // Honor `ignoreLayers`/`ignoreLayersType`: skip the span for matching layers.\n // We intentionally do NOT pop the pushed path here (unlike OTel Express, which\n // pops on ignore): the path is still popped on `asyncStart` when the layer\n // calls `next`, so a following sibling isn't polluted, while an ignored\n // *router* keeps its mount prefix on the stack for the sub-stack it dispatches\n // — so routes under an ignored router stay correct. The only entries that\n // never pop come from layers that end the response without `next()`, and those\n // sit on a per-request store that is discarded when the request ends.\n if (isLayerIgnored(name, type, options)) {\n return undefined;\n }\n\n const span = startInactiveSpan({\n name,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.express`,\n [ATTR_EXPRESS_NAME]: name,\n [ATTR_EXPRESS_TYPE]: type,\n ...(matchedRoute ? { [HTTP_ROUTE]: matchedRoute } : {}),\n },\n });\n\n // A layer that sends the response (route handlers, typically) never calls\n // `next`, so the channel's `asyncEnd` never fires. End on the response's\n // `finish` in that case. When `next` *is* called, the helper ends the span\n // (via `asyncEnd`) and `beforeSpanEnd` removes this now-redundant listener.\n if (res && typeof res.once === 'function') {\n const onFinish = (): void => {\n span.end();\n };\n res.once('finish', onFinish);\n data._sentryCleanup = () => res.removeListener('finish', onFinish);\n }\n\n return span;\n}\n\nfunction getLayerType(layer: ExpressLayer): ExpressLayerType {\n if (layer.name === 'router') {\n return 'router';\n }\n // `bound dispatch` (v4) / `handle` — the route-dispatch layer created by `router.route()`.\n if (layer.name === 'bound dispatch' || layer.name === 'handle') {\n return 'request_handler';\n }\n return 'middleware';\n}\n\n/**\n * Propagate the resolved route to the root `http.server` span so the\n * transaction gets a parameterized `http.route`. Mirrors `@sentry/node`'s\n * `setHttpServerSpanRouteAttribute`; inlined to keep this package free of\n * `@sentry/node` deps. No-op unless the root span is an `http.server` span.\n */\nfunction setHttpServerSpanRoute(route: string): void {\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan && 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 * Whether a layer should be skipped per the `ignoreLayers`/`ignoreLayersType`\n * options. Matches `@sentry/core`'s Express `isLayerIgnored`: `ignoreLayersType`\n * filters by layer type, `ignoreLayers` matches the layer's name against\n * string/RegExp/predicate patterns (exact string match).\n */\nfunction isLayerIgnored(name: string, type: ExpressLayerType, options: ExpressIntegrationOptions): boolean {\n const { ignoreLayers, ignoreLayersType } = options;\n\n if (Array.isArray(ignoreLayersType) && ignoreLayersType.includes(type)) {\n return true;\n }\n\n if (!Array.isArray(ignoreLayers)) {\n return false;\n }\n\n try {\n return stringMatchesSomePattern(name, ignoreLayers, true);\n } catch {\n return false;\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const layerRegisteredPaths = /* @__PURE__ */ new WeakMap();
|
|
2
|
+
function setLayerRegisteredPath(layer, path) {
|
|
3
|
+
layerRegisteredPaths.set(layer, path);
|
|
4
|
+
}
|
|
5
|
+
function getLayerRegisteredPath(layer) {
|
|
6
|
+
return layerRegisteredPaths.get(layer);
|
|
7
|
+
}
|
|
8
|
+
const requestLayerPaths = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
function getStore(req) {
|
|
10
|
+
let store = requestLayerPaths.get(req);
|
|
11
|
+
if (!store) {
|
|
12
|
+
store = [];
|
|
13
|
+
requestLayerPaths.set(req, store);
|
|
14
|
+
}
|
|
15
|
+
return store;
|
|
16
|
+
}
|
|
17
|
+
function pushLayerPath(req, path) {
|
|
18
|
+
getStore(req).push(path);
|
|
19
|
+
}
|
|
20
|
+
function popLayerPath(req) {
|
|
21
|
+
getStore(req).pop();
|
|
22
|
+
}
|
|
23
|
+
function getLayerPath(args) {
|
|
24
|
+
const firstArg = args[0];
|
|
25
|
+
if (Array.isArray(firstArg)) {
|
|
26
|
+
return firstArg.map((segment) => extractLayerPathSegment(segment) ?? "").join(",");
|
|
27
|
+
}
|
|
28
|
+
return extractLayerPathSegment(firstArg);
|
|
29
|
+
}
|
|
30
|
+
function extractLayerPathSegment(segment) {
|
|
31
|
+
return typeof segment === "string" ? segment : segment instanceof RegExp || typeof segment === "number" ? String(segment) : void 0;
|
|
32
|
+
}
|
|
33
|
+
function getConstructedRoute(req) {
|
|
34
|
+
const layersStore = getStore(req);
|
|
35
|
+
let constructedRoute = "";
|
|
36
|
+
for (const path of layersStore) {
|
|
37
|
+
if (path === "/" || path === "/*") {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
constructedRoute += !constructedRoute || constructedRoute.endsWith("/") ? path : `/${path}`;
|
|
41
|
+
}
|
|
42
|
+
return constructedRoute.replace(/\/{2,}/g, "/");
|
|
43
|
+
}
|
|
44
|
+
function getActualMatchedRoute(req, constructedRoute) {
|
|
45
|
+
const layersStore = getStore(req);
|
|
46
|
+
if (layersStore.length === 0) {
|
|
47
|
+
return void 0;
|
|
48
|
+
}
|
|
49
|
+
const originalUrl = typeof req.originalUrl === "string" ? req.originalUrl : "";
|
|
50
|
+
if (layersStore.every((path) => path === "/")) {
|
|
51
|
+
return originalUrl === "/" ? "/" : void 0;
|
|
52
|
+
}
|
|
53
|
+
if (constructedRoute === "*") {
|
|
54
|
+
return constructedRoute;
|
|
55
|
+
}
|
|
56
|
+
if (constructedRoute.includes("/") && (constructedRoute.includes(",") || constructedRoute.includes("\\") || constructedRoute.includes("*") || constructedRoute.includes("["))) {
|
|
57
|
+
return constructedRoute;
|
|
58
|
+
}
|
|
59
|
+
const normalizedRoute = constructedRoute.startsWith("/") ? constructedRoute : `/${constructedRoute}`;
|
|
60
|
+
const isValidRoute = normalizedRoute.length > 0 && (originalUrl === normalizedRoute || originalUrl.startsWith(normalizedRoute) || isRoutePattern(normalizedRoute));
|
|
61
|
+
return isValidRoute ? normalizedRoute : void 0;
|
|
62
|
+
}
|
|
63
|
+
function isRoutePattern(route) {
|
|
64
|
+
return route.includes(":") || route.includes("*");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { getActualMatchedRoute, getConstructedRoute, getLayerPath, getLayerRegisteredPath, popLayerPath, pushLayerPath, setLayerRegisteredPath };
|
|
68
|
+
//# sourceMappingURL=route.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.js","sources":["../../../../../src/integrations/tracing-channel/express/route.ts"],"sourcesContent":["import type { ExpressLayer, ExpressRequest } from './types';\n\n/**\n * Registered path *pattern* per routing `Layer`, captured when the layer is\n * registered via `Router.prototype.route`/`.use`. `undefined` means the layer\n * was registered without an explicit path (e.g. `app.use(mw)`), so it does not\n * contribute to the reconstructed route.\n *\n * This is the piece `req.baseUrl` can't provide: at request time `req.baseUrl`\n * holds the *resolved* mount prefix (`/api/v1`), whereas we want the registered\n * pattern (`/api/:version`).\n */\nconst layerRegisteredPaths = new WeakMap<ExpressLayer, string | undefined>();\n\n/** Record the path pattern a layer was registered with. */\nexport function setLayerRegisteredPath(layer: ExpressLayer, path: string | undefined): void {\n layerRegisteredPaths.set(layer, path);\n}\n\n/** Read the path pattern a layer was registered with, if any. */\nexport function getLayerRegisteredPath(layer: ExpressLayer): string | undefined {\n return layerRegisteredPaths.get(layer);\n}\n\n/**\n * Per-request ordered stack of the registered path patterns of the layers\n * currently on the matched chain. Layers push on entry and pop when they hand\n * off via `next`, so at any point it reflects the path from the app root down\n * to the currently-executing layer. `WeakMap` so entries are released with the\n * request.\n */\nconst requestLayerPaths = new WeakMap<ExpressRequest, string[]>();\n\nfunction getStore(req: ExpressRequest): string[] {\n let store = requestLayerPaths.get(req);\n if (!store) {\n store = [];\n requestLayerPaths.set(req, store);\n }\n return store;\n}\n\n/** Push a layer's registered path onto the request's chain. */\nexport function pushLayerPath(req: ExpressRequest, path: string): void {\n getStore(req).push(path);\n}\n\n/** Pop the most recently pushed layer path off the request's chain. */\nexport function popLayerPath(req: ExpressRequest): void {\n getStore(req).pop();\n}\n\n/**\n * The path pattern a `route`/`use` call registered, derived from its arguments.\n * A leading string/RegExp/number path becomes the pattern (arrays are joined\n * with `,`); a bare handler function yields `undefined`. Kept in sync with\n * `@sentry/core`'s Express `getLayerPath`.\n */\nexport function getLayerPath(args: unknown[]): string | undefined {\n const firstArg = args[0];\n if (Array.isArray(firstArg)) {\n return firstArg.map(segment => extractLayerPathSegment(segment) ?? '').join(',');\n }\n return extractLayerPathSegment(firstArg);\n}\n\nfunction extractLayerPathSegment(segment: unknown): string | undefined {\n return typeof segment === 'string'\n ? segment\n : segment instanceof RegExp || typeof segment === 'number'\n ? String(segment)\n : undefined;\n}\n\n/**\n * Concatenate the stored layer paths into the full route pattern (parameters\n * preserved), e.g. `/api/:version/user`. Mirrors `@sentry/core`.\n */\nexport function getConstructedRoute(req: ExpressRequest): string {\n const layersStore = getStore(req);\n\n let constructedRoute = '';\n for (const path of layersStore) {\n if (path === '/' || path === '/*') {\n continue;\n }\n constructedRoute += !constructedRoute || constructedRoute.endsWith('/') ? path : `/${path}`;\n }\n\n return constructedRoute.replace(/\\/{2,}/g, '/');\n}\n\n/**\n * Validate the constructed route against the request URL, returning it only\n * when it plausibly corresponds to a real match (otherwise `undefined`). Mirrors\n * `@sentry/core`'s `getActualMatchedRoute` — used for the `http.route` attribute.\n */\nexport function getActualMatchedRoute(req: ExpressRequest, constructedRoute: string): string | undefined {\n const layersStore = getStore(req);\n\n if (layersStore.length === 0) {\n return undefined;\n }\n\n const originalUrl = typeof req.originalUrl === 'string' ? req.originalUrl : '';\n\n // The layer store also includes root paths in case a non-existing url was requested.\n if (layersStore.every(path => path === '/')) {\n return originalUrl === '/' ? '/' : undefined;\n }\n\n if (constructedRoute === '*') {\n return constructedRoute;\n }\n\n // For RegExp routes or route arrays, return the constructed route as-is.\n if (\n constructedRoute.includes('/') &&\n (constructedRoute.includes(',') ||\n constructedRoute.includes('\\\\') ||\n constructedRoute.includes('*') ||\n constructedRoute.includes('['))\n ) {\n return constructedRoute;\n }\n\n const normalizedRoute = constructedRoute.startsWith('/') ? constructedRoute : `/${constructedRoute}`;\n\n const isValidRoute =\n normalizedRoute.length > 0 &&\n (originalUrl === normalizedRoute || originalUrl.startsWith(normalizedRoute) || isRoutePattern(normalizedRoute));\n\n return isValidRoute ? normalizedRoute : undefined;\n}\n\n/** Whether a route contains parameter/wildcard patterns (`:id`, `*`). */\nfunction isRoutePattern(route: string): boolean {\n return route.includes(':') || route.includes('*');\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as diagnosticsChannel from 'node:diagnostics_channel';
|
|
2
|
+
import { DEBUG_BUILD } from '../../../debug-build.js';
|
|
3
|
+
import { debug, captureException, getClient } from '@sentry/core';
|
|
4
|
+
import { defaultShouldHandleError, INTEGRATION_NAME } from './utils.js';
|
|
5
|
+
|
|
6
|
+
function getFastifyIntegration() {
|
|
7
|
+
const client = getClient();
|
|
8
|
+
return client?.getIntegrationByName(INTEGRATION_NAME);
|
|
9
|
+
}
|
|
10
|
+
function subscribeToFastifyErrorChannel() {
|
|
11
|
+
diagnosticsChannel.subscribe("tracing:fastify.request.handler:error", (message) => {
|
|
12
|
+
const { error, request, reply } = message;
|
|
13
|
+
handleFastifyError.call(handleFastifyError, error, request, reply, "diagnostics-channel");
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function handleFastifyError(error, request, reply, handlerOrigin) {
|
|
17
|
+
const shouldHandleError = getFastifyIntegration()?.getShouldHandleError() || defaultShouldHandleError;
|
|
18
|
+
if (handlerOrigin === "diagnostics-channel") {
|
|
19
|
+
this.diagnosticsChannelExists = true;
|
|
20
|
+
}
|
|
21
|
+
if (this.diagnosticsChannelExists && handlerOrigin === "onError-hook") {
|
|
22
|
+
DEBUG_BUILD && debug.warn(
|
|
23
|
+
"Fastify error handler was already registered via diagnostics channel.",
|
|
24
|
+
"You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options."
|
|
25
|
+
);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (shouldHandleError(error, request, reply)) {
|
|
29
|
+
captureException(error, {
|
|
30
|
+
mechanism: {
|
|
31
|
+
handled: false,
|
|
32
|
+
type: "auto.function.fastify"
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { handleFastifyError, subscribeToFastifyErrorChannel };
|
|
39
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sources":["../../../../../src/integrations/tracing-channel/fastify/errors.ts"],"sourcesContent":["import type { FastifyIntegration, FastifyReply, FastifyRequest } from './types';\nimport * as diagnosticsChannel from 'node:diagnostics_channel';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport { getClient, debug, captureException } from '@sentry/core';\nimport { defaultShouldHandleError, INTEGRATION_NAME } from './utils';\n\nfunction getFastifyIntegration(): FastifyIntegration | undefined {\n const client = getClient();\n return client?.getIntegrationByName(INTEGRATION_NAME);\n}\n\n/**\n * Subscribe to the Fastify v5 error diagnostics channel.\n */\nexport function subscribeToFastifyErrorChannel(): void {\n diagnosticsChannel.subscribe('tracing:fastify.request.handler:error', message => {\n const { error, request, reply } = message as {\n error: Error;\n request: FastifyRequest;\n reply: FastifyReply;\n };\n\n handleFastifyError.call(handleFastifyError, error, request, reply, 'diagnostics-channel');\n });\n}\n\n/**\n * Handle a Fastify error, and possibly send it to Sentry.\n */\nexport function handleFastifyError(\n this: {\n diagnosticsChannelExists?: boolean;\n },\n error: Error,\n request: FastifyRequest,\n reply: FastifyReply,\n handlerOrigin: 'diagnostics-channel' | 'onError-hook',\n): void {\n const shouldHandleError = getFastifyIntegration()?.getShouldHandleError() || defaultShouldHandleError;\n // Diagnostics channel runs before the onError hook, so we can use it to check if the handler was already registered\n if (handlerOrigin === 'diagnostics-channel') {\n this.diagnosticsChannelExists = true;\n }\n\n if (this.diagnosticsChannelExists && handlerOrigin === 'onError-hook') {\n DEBUG_BUILD &&\n debug.warn(\n 'Fastify error handler was already registered via diagnostics channel.',\n 'You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.',\n );\n\n // If the diagnostics channel already exists, we don't need to handle the error again\n return;\n }\n\n if (shouldHandleError(error, request, reply)) {\n captureException(error, {\n mechanism: {\n handled: false,\n type: 'auto.function.fastify',\n },\n });\n }\n}\n"],"names":[],"mappings":";;;;;AAMA,SAAS,qBAAA,GAAwD;AAC/D,EAAA,MAAM,SAAS,SAAA,EAAU;AACzB,EAAA,OAAO,MAAA,EAAQ,qBAAqB,gBAAgB,CAAA;AACtD;AAKO,SAAS,8BAAA,GAAuC;AACrD,EAAA,kBAAA,CAAmB,SAAA,CAAU,yCAAyC,CAAA,OAAA,KAAW;AAC/E,IAAA,MAAM,EAAE,KAAA,EAAO,OAAA,EAAS,KAAA,EAAM,GAAI,OAAA;AAMlC,IAAA,kBAAA,CAAmB,IAAA,CAAK,kBAAA,EAAoB,KAAA,EAAO,OAAA,EAAS,OAAO,qBAAqB,CAAA;AAAA,EAC1F,CAAC,CAAA;AACH;AAKO,SAAS,kBAAA,CAId,KAAA,EACA,OAAA,EACA,KAAA,EACA,aAAA,EACM;AACN,EAAA,MAAM,iBAAA,GAAoB,qBAAA,EAAsB,EAAG,oBAAA,EAAqB,IAAK,wBAAA;AAE7E,EAAA,IAAI,kBAAkB,qBAAA,EAAuB;AAC3C,IAAA,IAAA,CAAK,wBAAA,GAA2B,IAAA;AAAA,EAClC;AAEA,EAAA,IAAI,IAAA,CAAK,wBAAA,IAA4B,aAAA,KAAkB,cAAA,EAAgB;AACrE,IAAA,WAAA,IACE,KAAA,CAAM,IAAA;AAAA,MACJ,uEAAA;AAAA,MACA;AAAA,KACF;AAGF,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,iBAAA,CAAkB,KAAA,EAAO,OAAA,EAAS,KAAK,CAAA,EAAG;AAC5C,IAAA,gBAAA,CAAiB,KAAA,EAAO;AAAA,MACtB,SAAA,EAAW;AAAA,QACT,OAAA,EAAS,KAAA;AAAA,QACT,IAAA,EAAM;AAAA;AACR,KACD,CAAA;AAAA,EACH;AACF;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineIntegration } from '@sentry/core';
|
|
2
|
+
import { instrumentFastify as instrumentFastify$1 } from './instrumentation.js';
|
|
3
|
+
import { INTEGRATION_NAME, defaultShouldHandleError } from './utils.js';
|
|
4
|
+
import { subscribeToFastifyErrorChannel, handleFastifyError as handleFastifyError$1 } from './errors.js';
|
|
5
|
+
|
|
6
|
+
const _fastifyIntegration = (({ shouldHandleError }) => {
|
|
7
|
+
let _shouldHandleError;
|
|
8
|
+
return {
|
|
9
|
+
name: INTEGRATION_NAME,
|
|
10
|
+
setupOnce() {
|
|
11
|
+
_shouldHandleError = shouldHandleError || defaultShouldHandleError;
|
|
12
|
+
subscribeToFastifyErrorChannel();
|
|
13
|
+
instrumentFastify$1();
|
|
14
|
+
},
|
|
15
|
+
getShouldHandleError() {
|
|
16
|
+
return _shouldHandleError;
|
|
17
|
+
},
|
|
18
|
+
setShouldHandleError(shouldHandleError2) {
|
|
19
|
+
_shouldHandleError = shouldHandleError2;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
const fastifyIntegration = defineIntegration(
|
|
24
|
+
(options = {}) => _fastifyIntegration(options)
|
|
25
|
+
);
|
|
26
|
+
const instrumentFastify = instrumentFastify$1;
|
|
27
|
+
const handleFastifyError = handleFastifyError$1;
|
|
28
|
+
|
|
29
|
+
export { fastifyIntegration, handleFastifyError, instrumentFastify };
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing-channel/fastify/index.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport type { FastifyIntegration, FastifyReply, FastifyRequest } from './types';\n\nimport { instrumentFastify as _instrumentFastify } from './instrumentation';\nimport { defaultShouldHandleError, INTEGRATION_NAME } from './utils';\nimport { subscribeToFastifyErrorChannel, handleFastifyError as _handleFastifyError } from './errors';\n\n/**\n * Options for the Fastify integration.\n *\n * `shouldHandleError` - Callback method deciding whether error should be captured and sent to Sentry\n * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.\n * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.\n *\n * @example\n *\n * ```javascript\n * Sentry.init({\n * integrations: [\n * Sentry.fastifyIntegration({\n * shouldHandleError(_error, _request, reply) {\n * return reply.statusCode >= 500;\n * },\n * });\n * },\n * });\n * ```\n *\n */\ninterface FastifyIntegrationOptions {\n /**\n * Callback method deciding whether error should be captured and sent to Sentry\n * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.\n * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.\n *\n * @param error Captured Fastify error\n * @param request Fastify request (or any object containing at least method, routeOptions.url, and routerPath)\n * @param reply Fastify reply (or any object containing at least statusCode)\n */\n shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;\n}\n\nconst _fastifyIntegration = (({ shouldHandleError }: Partial<FastifyIntegrationOptions>) => {\n let _shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n _shouldHandleError = shouldHandleError || defaultShouldHandleError;\n\n subscribeToFastifyErrorChannel();\n _instrumentFastify();\n },\n getShouldHandleError() {\n return _shouldHandleError;\n },\n setShouldHandleError(shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean) {\n _shouldHandleError = shouldHandleError;\n },\n } satisfies FastifyIntegration;\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).\n * This integration supports Fastify v5 only.\n *\n * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.fastifyIntegration()],\n * })\n * ```\n */\nexport const fastifyIntegration = defineIntegration((options: Partial<FastifyIntegrationOptions> = {}) =>\n _fastifyIntegration(options),\n);\n\n/**\n * @deprecated This export is deprecated and will not longer be exposed in the next major version.\n */\nexport const instrumentFastify = _instrumentFastify;\n\n/**\n * @deprecated This export is deprecated and will not longer be exposed in the next major version.\n */\nexport const handleFastifyError = _handleFastifyError;\n"],"names":["_instrumentFastify","shouldHandleError","_handleFastifyError"],"mappings":";;;;;AA2CA,MAAM,mBAAA,IAAuB,CAAC,EAAE,iBAAA,EAAkB,KAA0C;AAC1F,EAAA,IAAI,kBAAA;AAEJ,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,kBAAA,GAAqB,iBAAA,IAAqB,wBAAA;AAE1C,MAAA,8BAAA,EAA+B;AAC/B,MAAAA,mBAAA,EAAmB;AAAA,IACrB,CAAA;AAAA,IACA,oBAAA,GAAuB;AACrB,MAAA,OAAO,kBAAA;AAAA,IACT,CAAA;AAAA,IACA,qBAAqBC,kBAAAA,EAA4F;AAC/G,MAAA,kBAAA,GAAqBA,kBAAAA;AAAA,IACvB;AAAA,GACF;AACF,CAAA,CAAA;AAiBO,MAAM,kBAAA,GAAqB,iBAAA;AAAA,EAAkB,CAAC,OAAA,GAA8C,EAAC,KAClG,oBAAoB,OAAO;AAC7B;AAKO,MAAM,iBAAA,GAAoBD;AAK1B,MAAM,kBAAA,GAAqBE;;;;"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import * as diagnosticsChannel from 'node:diagnostics_channel';
|
|
2
|
+
import { HTTP_ROUTE, URL_PATH, HTTP_REQUEST_METHOD, HTTP_RESPONSE_STATUS_CODE } from '@sentry/conventions/attributes';
|
|
3
|
+
import { debug, getIsolationScope, getActiveSpan, getRootSpan, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_OP, startInactiveSpan, withActiveSpan, startSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, isObjectLike, SPAN_STATUS_ERROR } from '@sentry/core';
|
|
4
|
+
import { DEBUG_BUILD } from '../../../debug-build.js';
|
|
5
|
+
|
|
6
|
+
const PACKAGE_NAME = "@sentry/instrumentation-fastify";
|
|
7
|
+
const SUPPORTED_VERSIONS = ">=3.21.0 <6";
|
|
8
|
+
const ORIGIN = "auto.http.otel.fastify";
|
|
9
|
+
const HOOK_OP = "hook.fastify";
|
|
10
|
+
const REQUEST_HANDLER_OP = "request_handler.fastify";
|
|
11
|
+
const FASTIFY_HOOKS = [
|
|
12
|
+
"onRequest",
|
|
13
|
+
"preParsing",
|
|
14
|
+
"preValidation",
|
|
15
|
+
"preHandler",
|
|
16
|
+
"preSerialization",
|
|
17
|
+
"onSend",
|
|
18
|
+
"onResponse",
|
|
19
|
+
"onError"
|
|
20
|
+
];
|
|
21
|
+
const ATTRIBUTE_HOOK_NAME = "hook.name";
|
|
22
|
+
const ATTRIBUTE_FASTIFY_TYPE = "fastify.type";
|
|
23
|
+
const ATTRIBUTE_HOOK_CALLBACK_NAME = "hook.callback.name";
|
|
24
|
+
const ATTRIBUTE_FASTIFY_ROOT = "fastify.root";
|
|
25
|
+
const HOOK_TYPE_ROUTE = "route-hook";
|
|
26
|
+
const HOOK_TYPE_INSTANCE = "hook";
|
|
27
|
+
const HOOK_TYPE_HANDLER = "request-handler";
|
|
28
|
+
const ANONYMOUS_FUNCTION_NAME = "anonymous";
|
|
29
|
+
const kRequestSpan = /* @__PURE__ */ Symbol("sentry fastify request span");
|
|
30
|
+
const kAddHookOriginal = /* @__PURE__ */ Symbol("sentry fastify addHook original");
|
|
31
|
+
const kSetNotFoundOriginal = /* @__PURE__ */ Symbol("sentry fastify setNotFoundHandler original");
|
|
32
|
+
function getRequestRouteUrl(request) {
|
|
33
|
+
return request.routeOptions?.url ?? request.routerPath;
|
|
34
|
+
}
|
|
35
|
+
function getRequestRouteConfig(request) {
|
|
36
|
+
return request.routeOptions?.config ?? request.routeConfig;
|
|
37
|
+
}
|
|
38
|
+
function isFastifyRequest(arg) {
|
|
39
|
+
return isObjectLike(arg) && !!arg.method && !!arg.url && (!!arg.routeOptions || "routerPath" in arg);
|
|
40
|
+
}
|
|
41
|
+
function fastifyOtelPlugin(instance, _opts, done) {
|
|
42
|
+
instance.decorate(kAddHookOriginal, instance.addHook);
|
|
43
|
+
instance.decorate(kSetNotFoundOriginal, instance.setNotFoundHandler);
|
|
44
|
+
instance.decorateRequest("opentelemetry", function opentelemetry() {
|
|
45
|
+
return { span: this[kRequestSpan] };
|
|
46
|
+
});
|
|
47
|
+
instance.decorateRequest(kRequestSpan, null);
|
|
48
|
+
instance.addHook("onRoute", otelWireRoute);
|
|
49
|
+
instance.addHook("onRequest", startRequestSpanHook);
|
|
50
|
+
instance.addHook("onResponse", finalizeNotFoundSpanHook);
|
|
51
|
+
instance.addHook = addHookPatched;
|
|
52
|
+
instance.setNotFoundHandler = setNotFoundHandlerPatched;
|
|
53
|
+
done();
|
|
54
|
+
}
|
|
55
|
+
const pluginSymbols = fastifyOtelPlugin;
|
|
56
|
+
pluginSymbols[/* @__PURE__ */ Symbol.for("skip-override")] = true;
|
|
57
|
+
pluginSymbols[/* @__PURE__ */ Symbol.for("fastify.display-name")] = PACKAGE_NAME;
|
|
58
|
+
pluginSymbols[/* @__PURE__ */ Symbol.for("plugin-meta")] = {
|
|
59
|
+
fastify: SUPPORTED_VERSIONS,
|
|
60
|
+
name: PACKAGE_NAME
|
|
61
|
+
};
|
|
62
|
+
function otelWireRoute(routeOptions) {
|
|
63
|
+
if (routeOptions.config?.otel === false) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
for (const hook of FASTIFY_HOOKS) {
|
|
67
|
+
const handlerLike = routeOptions[hook];
|
|
68
|
+
if (typeof handlerLike === "function") {
|
|
69
|
+
routeOptions[hook] = handlerWrapper(
|
|
70
|
+
handlerLike,
|
|
71
|
+
hook,
|
|
72
|
+
routeHookAttributes(this.pluginName, hook, handlerLike, routeOptions.url)
|
|
73
|
+
);
|
|
74
|
+
} else if (Array.isArray(handlerLike)) {
|
|
75
|
+
routeOptions[hook] = handlerLike.map(
|
|
76
|
+
(handler) => handlerWrapper(handler, hook, routeHookAttributes(this.pluginName, hook, handler, routeOptions.url))
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
routeOptions.onSend = appendRouteHook(routeOptions.onSend, finalizeResponseSpanHook);
|
|
81
|
+
routeOptions.onError = appendRouteHook(routeOptions.onError, recordErrorInSpanHook);
|
|
82
|
+
routeOptions.handler = handlerWrapper(routeOptions.handler, "handler", {
|
|
83
|
+
[ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - route-handler`,
|
|
84
|
+
[ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_HANDLER,
|
|
85
|
+
[HTTP_ROUTE]: routeOptions.url,
|
|
86
|
+
[ATTRIBUTE_HOOK_CALLBACK_NAME]: routeOptions.handler.name.length > 0 ? routeOptions.handler.name : ANONYMOUS_FUNCTION_NAME
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function routeHookAttributes(pluginName, hook, handler, url) {
|
|
90
|
+
return {
|
|
91
|
+
[ATTRIBUTE_HOOK_NAME]: `${pluginName} - route -> ${hook}`,
|
|
92
|
+
[ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_ROUTE,
|
|
93
|
+
[HTTP_ROUTE]: url,
|
|
94
|
+
[ATTRIBUTE_HOOK_CALLBACK_NAME]: handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function appendRouteHook(existing, hook) {
|
|
98
|
+
if (existing == null) {
|
|
99
|
+
return hook;
|
|
100
|
+
}
|
|
101
|
+
return Array.isArray(existing) ? [...existing, hook] : [existing, hook];
|
|
102
|
+
}
|
|
103
|
+
function startRequestSpanHook(request, _reply, hookDone) {
|
|
104
|
+
if (getRequestRouteConfig(request)?.otel === false) {
|
|
105
|
+
return hookDone();
|
|
106
|
+
}
|
|
107
|
+
const attributes = {
|
|
108
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
|
|
109
|
+
[ATTRIBUTE_FASTIFY_ROOT]: PACKAGE_NAME,
|
|
110
|
+
[HTTP_REQUEST_METHOD]: request.method,
|
|
111
|
+
[URL_PATH]: request.url
|
|
112
|
+
};
|
|
113
|
+
const route = getRequestRouteUrl(request);
|
|
114
|
+
if (route != null) {
|
|
115
|
+
attributes[HTTP_ROUTE] = route;
|
|
116
|
+
const activeSpan = getActiveSpan();
|
|
117
|
+
const rootSpan = activeSpan && getRootSpan(activeSpan);
|
|
118
|
+
if (rootSpan && spanToJSON(rootSpan).data[SEMANTIC_ATTRIBUTE_SENTRY_OP] === "http.server") {
|
|
119
|
+
rootSpan.setAttribute(HTTP_ROUTE, route);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const requestSpan = startInactiveSpan({ name: "request", op: REQUEST_HANDLER_OP, attributes });
|
|
123
|
+
request[kRequestSpan] = requestSpan;
|
|
124
|
+
withActiveSpan(requestSpan, () => {
|
|
125
|
+
hookDone();
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function finalizeNotFoundSpanHook(request, reply, hookDone) {
|
|
129
|
+
const span = request[kRequestSpan];
|
|
130
|
+
if (span != null) {
|
|
131
|
+
span.setAttributes({ [HTTP_RESPONSE_STATUS_CODE]: reply.statusCode });
|
|
132
|
+
span.end();
|
|
133
|
+
}
|
|
134
|
+
request[kRequestSpan] = null;
|
|
135
|
+
hookDone();
|
|
136
|
+
}
|
|
137
|
+
function finalizeResponseSpanHook(request, reply, payload, hookDone) {
|
|
138
|
+
const span = request[kRequestSpan];
|
|
139
|
+
if (span != null) {
|
|
140
|
+
if (reply.statusCode >= 500) {
|
|
141
|
+
span.setStatus({ code: SPAN_STATUS_ERROR });
|
|
142
|
+
}
|
|
143
|
+
span.setAttributes({ [HTTP_RESPONSE_STATUS_CODE]: reply.statusCode });
|
|
144
|
+
span.end();
|
|
145
|
+
}
|
|
146
|
+
request[kRequestSpan] = null;
|
|
147
|
+
hookDone(null, payload);
|
|
148
|
+
}
|
|
149
|
+
function recordErrorInSpanHook(request, _reply, error, hookDone) {
|
|
150
|
+
const span = request[kRequestSpan];
|
|
151
|
+
if (span != null) {
|
|
152
|
+
span.setStatus({ code: SPAN_STATUS_ERROR, message: error.message });
|
|
153
|
+
}
|
|
154
|
+
hookDone();
|
|
155
|
+
}
|
|
156
|
+
function addHookPatched(name, hook) {
|
|
157
|
+
const addHookOriginal = this[kAddHookOriginal];
|
|
158
|
+
if (FASTIFY_HOOKS.includes(name)) {
|
|
159
|
+
return addHookOriginal.call(
|
|
160
|
+
this,
|
|
161
|
+
name,
|
|
162
|
+
handlerWrapper(hook, name, {
|
|
163
|
+
[ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - ${name}`,
|
|
164
|
+
[ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_INSTANCE,
|
|
165
|
+
[ATTRIBUTE_HOOK_CALLBACK_NAME]: hook.name?.length > 0 ? hook.name : ANONYMOUS_FUNCTION_NAME
|
|
166
|
+
})
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
return addHookOriginal.call(this, name, hook);
|
|
170
|
+
}
|
|
171
|
+
function setNotFoundHandlerPatched(hooks, handler) {
|
|
172
|
+
const setNotFoundHandlerOriginal = this[kSetNotFoundOriginal];
|
|
173
|
+
if (typeof hooks === "function") {
|
|
174
|
+
setNotFoundHandlerOriginal.call(
|
|
175
|
+
this,
|
|
176
|
+
handlerWrapper(hooks, "notFoundHandler", {
|
|
177
|
+
[ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - not-found-handler`,
|
|
178
|
+
[ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_INSTANCE,
|
|
179
|
+
[ATTRIBUTE_HOOK_CALLBACK_NAME]: hooks.name?.length > 0 ? hooks.name : ANONYMOUS_FUNCTION_NAME
|
|
180
|
+
})
|
|
181
|
+
);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (hooks.preValidation != null) {
|
|
185
|
+
hooks.preValidation = handlerWrapper(hooks.preValidation, "notFoundHandler - preValidation", {
|
|
186
|
+
[ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - not-found-handler - preValidation`,
|
|
187
|
+
[ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_INSTANCE,
|
|
188
|
+
[ATTRIBUTE_HOOK_CALLBACK_NAME]: hooks.preValidation.name?.length > 0 ? hooks.preValidation.name : ANONYMOUS_FUNCTION_NAME
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
if (hooks.preHandler != null) {
|
|
192
|
+
hooks.preHandler = handlerWrapper(hooks.preHandler, "notFoundHandler - preHandler", {
|
|
193
|
+
[ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - not-found-handler - preHandler`,
|
|
194
|
+
[ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_INSTANCE,
|
|
195
|
+
[ATTRIBUTE_HOOK_CALLBACK_NAME]: hooks.preHandler.name?.length > 0 ? hooks.preHandler.name : ANONYMOUS_FUNCTION_NAME
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
if (handler == null) {
|
|
199
|
+
setNotFoundHandlerOriginal.call(this, hooks);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
setNotFoundHandlerOriginal.call(
|
|
203
|
+
this,
|
|
204
|
+
hooks,
|
|
205
|
+
handlerWrapper(handler, "notFoundHandler", {
|
|
206
|
+
[ATTRIBUTE_HOOK_NAME]: `${this.pluginName} - not-found-handler`,
|
|
207
|
+
[ATTRIBUTE_FASTIFY_TYPE]: HOOK_TYPE_INSTANCE,
|
|
208
|
+
[ATTRIBUTE_HOOK_CALLBACK_NAME]: handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME
|
|
209
|
+
})
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
function getRequestFromArgs(args) {
|
|
213
|
+
for (const arg of args) {
|
|
214
|
+
if (isFastifyRequest(arg)) {
|
|
215
|
+
return arg;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
function handlerWrapper(handler, hookName, spanAttributes = {}) {
|
|
221
|
+
return function handlerWrapped(...args) {
|
|
222
|
+
const request = getRequestFromArgs(args);
|
|
223
|
+
if (request === null || getRequestRouteConfig(request)?.otel === false) {
|
|
224
|
+
return handler.call(this, ...args);
|
|
225
|
+
}
|
|
226
|
+
const parentSpan = request[kRequestSpan] ?? void 0;
|
|
227
|
+
const handlerName = handler.name?.length > 0 ? handler.name : this.pluginName ?? ANONYMOUS_FUNCTION_NAME;
|
|
228
|
+
const hookType = spanAttributes[ATTRIBUTE_FASTIFY_TYPE];
|
|
229
|
+
const op = hookType === HOOK_TYPE_INSTANCE ? HOOK_OP : hookType === HOOK_TYPE_HANDLER ? REQUEST_HANDLER_OP : void 0;
|
|
230
|
+
const name = op ? stripFastifyPrefix(spanAttributes[ATTRIBUTE_HOOK_NAME]) : `${hookName} - ${handlerName}`;
|
|
231
|
+
return startSpan(
|
|
232
|
+
{
|
|
233
|
+
name,
|
|
234
|
+
op,
|
|
235
|
+
attributes: {
|
|
236
|
+
...spanAttributes,
|
|
237
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
|
|
238
|
+
},
|
|
239
|
+
parentSpan
|
|
240
|
+
},
|
|
241
|
+
() => handler.call(this, ...args)
|
|
242
|
+
);
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function stripFastifyPrefix(hookName = "") {
|
|
246
|
+
return hookName.replace(/^fastify -> /, "").replace(/^@fastify\/otel -> /, "").replace(/^@sentry\/instrumentation-fastify -> /, "");
|
|
247
|
+
}
|
|
248
|
+
function instrumentOnRequest(fastify) {
|
|
249
|
+
fastify.addHook("onRequest", async (request, _reply) => {
|
|
250
|
+
const routeName = getRequestRouteUrl(request);
|
|
251
|
+
const method = request.method || "GET";
|
|
252
|
+
getIsolationScope().setTransactionName(`${method} ${routeName}`);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
let _isInstrumented = false;
|
|
256
|
+
const instrumentFastify = Object.assign(
|
|
257
|
+
function instrumentFastify2() {
|
|
258
|
+
if (_isInstrumented) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
_isInstrumented = true;
|
|
262
|
+
diagnosticsChannel.subscribe("fastify.initialization", (message) => {
|
|
263
|
+
const fastifyInstance = message.fastify;
|
|
264
|
+
fastifyInstance?.register(fastifyOtelPlugin).after((err) => {
|
|
265
|
+
if (err) {
|
|
266
|
+
DEBUG_BUILD && debug.error("Failed to setup Fastify instrumentation", err);
|
|
267
|
+
} else if (fastifyInstance) {
|
|
268
|
+
instrumentOnRequest(fastifyInstance);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
},
|
|
273
|
+
{ id: "Fastify.v5" }
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
export { instrumentFastify };
|
|
277
|
+
//# sourceMappingURL=instrumentation.js.map
|