@sentry/server-utils 10.66.0 → 10.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +7 -0
- package/build/cjs/index.js.map +1 -1
- 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/express/instrumentation.js +1 -6
- package/build/cjs/integrations/tracing-channel/express/instrumentation.js.map +1 -1
- 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/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/openai.js +1 -3
- package/build/cjs/integrations/tracing-channel/openai.js.map +1 -1
- package/build/cjs/integrations/tracing-channel/redis.js +25 -34
- package/build/cjs/integrations/tracing-channel/redis.js.map +1 -1
- package/build/cjs/integrations/tracing-channel/tedious.js +145 -0
- package/build/cjs/integrations/tracing-channel/tedious.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.map +1 -1
- package/build/cjs/mongoose/mongoose-legacy-span.js +40 -0
- package/build/cjs/mongoose/mongoose-legacy-span.js.map +1 -0
- package/build/cjs/orchestrion/bundler/esbuild.js +5 -1
- package/build/cjs/orchestrion/bundler/esbuild.js.map +1 -1
- package/build/cjs/orchestrion/bundler/options.js +10 -1
- package/build/cjs/orchestrion/bundler/options.js.map +1 -1
- package/build/cjs/orchestrion/bundler/rollup.js +5 -1
- package/build/cjs/orchestrion/bundler/rollup.js.map +1 -1
- package/build/cjs/orchestrion/bundler/vite.js +5 -1
- package/build/cjs/orchestrion/bundler/vite.js.map +1 -1
- package/build/cjs/orchestrion/bundler/webpack.js +8 -4
- package/build/cjs/orchestrion/bundler/webpack.js.map +1 -1
- package/build/cjs/orchestrion/channels.js +4 -0
- package/build/cjs/orchestrion/channels.js.map +1 -1
- package/build/cjs/orchestrion/config/amqplib.js.map +1 -1
- package/build/cjs/orchestrion/config/anthropic-ai.js.map +1 -1
- 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.map +1 -1
- package/build/cjs/orchestrion/config/express.js +9 -8
- package/build/cjs/orchestrion/config/express.js.map +1 -1
- package/build/cjs/orchestrion/config/firebase.js.map +1 -1
- package/build/cjs/orchestrion/config/generic-pool.js.map +1 -1
- package/build/cjs/orchestrion/config/google-genai.js.map +1 -1
- package/build/cjs/orchestrion/config/graphql.js.map +1 -1
- package/build/cjs/orchestrion/config/hapi.js.map +1 -1
- package/build/cjs/orchestrion/config/index.js +10 -1
- package/build/cjs/orchestrion/config/index.js.map +1 -1
- package/build/cjs/orchestrion/config/ioredis.js.map +1 -1
- package/build/cjs/orchestrion/config/kafkajs.js.map +1 -1
- package/build/cjs/orchestrion/config/knex.js.map +1 -1
- 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 +46 -2
- package/build/cjs/orchestrion/config/langchain.js.map +1 -1
- package/build/cjs/orchestrion/config/langgraph.js +22 -2
- package/build/cjs/orchestrion/config/langgraph.js.map +1 -1
- package/build/cjs/orchestrion/config/lru-memoizer.js.map +1 -1
- package/build/cjs/orchestrion/config/mongodb.js +61 -2
- package/build/cjs/orchestrion/config/mongodb.js.map +1 -1
- package/build/cjs/orchestrion/config/mongoose.js +101 -2
- package/build/cjs/orchestrion/config/mongoose.js.map +1 -1
- package/build/cjs/orchestrion/config/mysql.js.map +1 -1
- package/build/cjs/orchestrion/config/mysql2.js.map +1 -1
- package/build/cjs/orchestrion/config/nestjs.js.map +1 -1
- package/build/cjs/orchestrion/config/openai.js +5 -5
- package/build/cjs/orchestrion/config/openai.js.map +1 -1
- package/build/cjs/orchestrion/config/pg.js.map +1 -1
- package/build/cjs/orchestrion/config/postgres.js.map +1 -1
- package/build/cjs/orchestrion/config/prisma.js.map +1 -1
- package/build/cjs/orchestrion/config/react-router.js.map +1 -1
- package/build/cjs/orchestrion/config/redis.js.map +1 -1
- package/build/cjs/orchestrion/config/remix.js +48 -2
- package/build/cjs/orchestrion/config/remix.js.map +1 -1
- package/build/cjs/orchestrion/config/tedious.js +18 -2
- package/build/cjs/orchestrion/config/tedious.js.map +1 -1
- package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -1
- package/build/cjs/orchestrion/index.js +32 -9
- package/build/cjs/orchestrion/index.js.map +1 -1
- package/build/cjs/orchestrion/runtime/register.js +25 -12
- package/build/cjs/orchestrion/runtime/register.js.map +1 -1
- package/build/cjs/redis/redis-dc-subscriber.js +27 -38
- package/build/cjs/redis/redis-dc-subscriber.js.map +1 -1
- package/build/cjs/vercel-ai/vercel-ai-orchestrion-subscriber.js +16 -3
- package/build/cjs/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -1
- package/build/esm/index.js +2 -0
- package/build/esm/index.js.map +1 -1
- 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/express/instrumentation.js +1 -6
- package/build/esm/integrations/tracing-channel/express/instrumentation.js.map +1 -1
- 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/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/openai.js +1 -3
- package/build/esm/integrations/tracing-channel/openai.js.map +1 -1
- package/build/esm/integrations/tracing-channel/redis.js +25 -34
- package/build/esm/integrations/tracing-channel/redis.js.map +1 -1
- package/build/esm/integrations/tracing-channel/tedious.js +143 -0
- package/build/esm/integrations/tracing-channel/tedious.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.map +1 -1
- package/build/esm/mongoose/mongoose-legacy-span.js +38 -0
- package/build/esm/mongoose/mongoose-legacy-span.js.map +1 -0
- package/build/esm/orchestrion/bundler/options.js +10 -1
- package/build/esm/orchestrion/bundler/options.js.map +1 -1
- package/build/esm/orchestrion/bundler/webpack.js +4 -4
- package/build/esm/orchestrion/bundler/webpack.js.map +1 -1
- package/build/esm/orchestrion/channels.js +4 -0
- package/build/esm/orchestrion/channels.js.map +1 -1
- package/build/esm/orchestrion/config/amqplib.js.map +1 -1
- package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -1
- 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.map +1 -1
- package/build/esm/orchestrion/config/express.js +9 -8
- package/build/esm/orchestrion/config/express.js.map +1 -1
- package/build/esm/orchestrion/config/firebase.js.map +1 -1
- package/build/esm/orchestrion/config/generic-pool.js.map +1 -1
- package/build/esm/orchestrion/config/google-genai.js.map +1 -1
- package/build/esm/orchestrion/config/graphql.js.map +1 -1
- package/build/esm/orchestrion/config/hapi.js.map +1 -1
- package/build/esm/orchestrion/config/index.js +10 -1
- package/build/esm/orchestrion/config/index.js.map +1 -1
- package/build/esm/orchestrion/config/ioredis.js.map +1 -1
- package/build/esm/orchestrion/config/kafkajs.js.map +1 -1
- package/build/esm/orchestrion/config/knex.js.map +1 -1
- 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 +46 -3
- package/build/esm/orchestrion/config/langchain.js.map +1 -1
- package/build/esm/orchestrion/config/langgraph.js +22 -2
- package/build/esm/orchestrion/config/langgraph.js.map +1 -1
- package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -1
- package/build/esm/orchestrion/config/mongodb.js +61 -2
- package/build/esm/orchestrion/config/mongodb.js.map +1 -1
- package/build/esm/orchestrion/config/mongoose.js +101 -3
- package/build/esm/orchestrion/config/mongoose.js.map +1 -1
- package/build/esm/orchestrion/config/mysql.js.map +1 -1
- package/build/esm/orchestrion/config/mysql2.js.map +1 -1
- package/build/esm/orchestrion/config/nestjs.js.map +1 -1
- package/build/esm/orchestrion/config/openai.js +5 -5
- package/build/esm/orchestrion/config/openai.js.map +1 -1
- package/build/esm/orchestrion/config/pg.js.map +1 -1
- package/build/esm/orchestrion/config/postgres.js.map +1 -1
- package/build/esm/orchestrion/config/prisma.js.map +1 -1
- package/build/esm/orchestrion/config/react-router.js.map +1 -1
- package/build/esm/orchestrion/config/redis.js.map +1 -1
- package/build/esm/orchestrion/config/remix.js +48 -2
- package/build/esm/orchestrion/config/remix.js.map +1 -1
- package/build/esm/orchestrion/config/tedious.js +18 -2
- package/build/esm/orchestrion/config/tedious.js.map +1 -1
- package/build/esm/orchestrion/config/vercel-ai.js.map +1 -1
- package/build/esm/orchestrion/index.js +17 -2
- package/build/esm/orchestrion/index.js.map +1 -1
- package/build/esm/orchestrion/runtime/register.js +25 -12
- package/build/esm/orchestrion/runtime/register.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/redis/redis-dc-subscriber.js +27 -38
- package/build/esm/redis/redis-dc-subscriber.js.map +1 -1
- package/build/esm/vercel-ai/vercel-ai-orchestrion-subscriber.js +17 -4
- package/build/esm/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -1
- package/build/types/index.d.ts +5 -1
- package/build/types/index.d.ts.map +1 -1
- 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/express/instrumentation.d.ts.map +1 -1
- 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/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/openai.d.ts.map +1 -1
- package/build/types/integrations/tracing-channel/redis.d.ts.map +1 -1
- 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/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 +2 -0
- package/build/types/mongoose/index.d.ts.map +1 -1
- 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/orchestrion/bundler/options.d.ts +13 -3
- package/build/types/orchestrion/bundler/options.d.ts.map +1 -1
- package/build/types/orchestrion/bundler/webpack.d.ts +5 -5
- package/build/types/orchestrion/bundler/webpack.d.ts.map +1 -1
- package/build/types/orchestrion/channels.d.ts +36 -6
- package/build/types/orchestrion/channels.d.ts.map +1 -1
- 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/express.d.ts +2 -4
- package/build/types/orchestrion/config/express.d.ts.map +1 -1
- package/build/types/orchestrion/config/firebase.d.ts +1 -1
- package/build/types/orchestrion/config/firebase.d.ts.map +1 -1
- package/build/types/orchestrion/config/index.d.ts +1 -1
- package/build/types/orchestrion/config/index.d.ts.map +1 -1
- package/build/types/orchestrion/config/ioredis.d.ts +1 -1
- package/build/types/orchestrion/config/ioredis.d.ts.map +1 -1
- package/build/types/orchestrion/config/knex.d.ts +1 -1
- package/build/types/orchestrion/config/knex.d.ts.map +1 -1
- 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 +17 -3
- package/build/types/orchestrion/config/langchain.d.ts.map +1 -1
- package/build/types/orchestrion/config/langgraph.d.ts +20 -3
- package/build/types/orchestrion/config/langgraph.d.ts.map +1 -1
- package/build/types/orchestrion/config/mongodb.d.ts +58 -3
- package/build/types/orchestrion/config/mongodb.d.ts.map +1 -1
- package/build/types/orchestrion/config/mongoose.d.ts +39 -3
- package/build/types/orchestrion/config/mongoose.d.ts.map +1 -1
- package/build/types/orchestrion/config/nestjs.d.ts +1 -1
- package/build/types/orchestrion/config/nestjs.d.ts.map +1 -1
- package/build/types/orchestrion/config/openai.d.ts +0 -2
- package/build/types/orchestrion/config/openai.d.ts.map +1 -1
- package/build/types/orchestrion/config/postgres.d.ts +1 -1
- package/build/types/orchestrion/config/postgres.d.ts.map +1 -1
- package/build/types/orchestrion/config/prisma.d.ts +1 -1
- package/build/types/orchestrion/config/prisma.d.ts.map +1 -1
- package/build/types/orchestrion/config/react-router.d.ts +1 -1
- package/build/types/orchestrion/config/react-router.d.ts.map +1 -1
- package/build/types/orchestrion/config/remix.d.ts +7 -2
- package/build/types/orchestrion/config/remix.d.ts.map +1 -1
- package/build/types/orchestrion/config/tedious.d.ts +10 -2
- package/build/types/orchestrion/config/tedious.d.ts.map +1 -1
- package/build/types/orchestrion/config/vercel-ai.d.ts +1 -1
- package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -1
- package/build/types/orchestrion/index.d.ts +32 -1
- package/build/types/orchestrion/index.d.ts.map +1 -1
- package/build/types/orchestrion/runtime/register.d.ts.map +1 -1
- package/build/types/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts.map +1 -1
- package/build/types-ts3.8/index.d.ts +5 -1
- 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/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/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/tedious.d.ts +11 -0
- package/build/types-ts3.8/mongodb/mongodb-span.d.ts +66 -0
- package/build/types-ts3.8/mongoose/index.d.ts +2 -0
- package/build/types-ts3.8/mongoose/mongoose-legacy-span.d.ts +29 -0
- package/build/types-ts3.8/orchestrion/bundler/options.d.ts +13 -3
- package/build/types-ts3.8/orchestrion/bundler/webpack.d.ts +5 -5
- package/build/types-ts3.8/orchestrion/channels.d.ts +36 -6
- package/build/types-ts3.8/orchestrion/config/aws-sdk.d.ts +19 -0
- package/build/types-ts3.8/orchestrion/config/express.d.ts +2 -4
- package/build/types-ts3.8/orchestrion/config/firebase.d.ts +1 -1
- package/build/types-ts3.8/orchestrion/config/index.d.ts +1 -1
- package/build/types-ts3.8/orchestrion/config/ioredis.d.ts +1 -1
- package/build/types-ts3.8/orchestrion/config/knex.d.ts +1 -1
- package/build/types-ts3.8/orchestrion/config/koa.d.ts +17 -0
- package/build/types-ts3.8/orchestrion/config/langchain.d.ts +17 -3
- package/build/types-ts3.8/orchestrion/config/langgraph.d.ts +20 -3
- package/build/types-ts3.8/orchestrion/config/mongodb.d.ts +58 -3
- package/build/types-ts3.8/orchestrion/config/mongoose.d.ts +39 -3
- package/build/types-ts3.8/orchestrion/config/nestjs.d.ts +1 -1
- package/build/types-ts3.8/orchestrion/config/openai.d.ts +0 -2
- package/build/types-ts3.8/orchestrion/config/postgres.d.ts +1 -1
- package/build/types-ts3.8/orchestrion/config/prisma.d.ts +1 -1
- package/build/types-ts3.8/orchestrion/config/react-router.d.ts +1 -1
- package/build/types-ts3.8/orchestrion/config/remix.d.ts +7 -2
- package/build/types-ts3.8/orchestrion/config/tedious.d.ts +10 -2
- package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +1 -1
- package/build/types-ts3.8/orchestrion/index.d.ts +32 -1
- package/package.json +3 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamodb.js","sources":["../../../../../../src/integrations/tracing-channel/aws-sdk/services/dynamodb.ts"],"sourcesContent":["import type { Span } from '@sentry/core';\nimport { SPAN_KIND } from '@sentry/core';\nimport {\n AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS as ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS,\n AWS_DYNAMODB_CONSISTENT_READ as ATTR_AWS_DYNAMODB_CONSISTENT_READ,\n AWS_DYNAMODB_CONSUMED_CAPACITY as ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY,\n AWS_DYNAMODB_COUNT as ATTR_AWS_DYNAMODB_COUNT,\n AWS_DYNAMODB_EXCLUSIVE_START_TABLE as ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE,\n AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES as ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES,\n AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES as ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES,\n AWS_DYNAMODB_INDEX_NAME as ATTR_AWS_DYNAMODB_INDEX_NAME,\n AWS_DYNAMODB_ITEM_COLLECTION_METRICS as ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS,\n AWS_DYNAMODB_LIMIT as ATTR_AWS_DYNAMODB_LIMIT,\n AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES as ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES,\n AWS_DYNAMODB_PROJECTION as ATTR_AWS_DYNAMODB_PROJECTION,\n AWS_DYNAMODB_PROVISIONED_READ_CAPACITY as ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY,\n AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY as ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY,\n AWS_DYNAMODB_SCAN_FORWARD as ATTR_AWS_DYNAMODB_SCAN_FORWARD,\n AWS_DYNAMODB_SCANNED_COUNT as ATTR_AWS_DYNAMODB_SCANNED_COUNT,\n AWS_DYNAMODB_SEGMENT as ATTR_AWS_DYNAMODB_SEGMENT,\n AWS_DYNAMODB_SELECT as ATTR_AWS_DYNAMODB_SELECT,\n AWS_DYNAMODB_TABLE_COUNT as ATTR_AWS_DYNAMODB_TABLE_COUNT,\n AWS_DYNAMODB_TABLE_NAMES as ATTR_AWS_DYNAMODB_TABLE_NAMES,\n AWS_DYNAMODB_TOTAL_SEGMENTS as ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS,\n DB_NAME,\n DB_OPERATION,\n DB_SYSTEM,\n} from '@sentry/conventions/attributes';\nimport { DB_SYSTEM_VALUE_DYNAMODB } from '../constants';\nimport type { NormalizedRequest, NormalizedResponse } from '../types';\nimport type { RequestMetadata, ServiceExtension } from './ServiceExtension';\n\nfunction toArray<T>(values: T | T[]): T[] {\n return Array.isArray(values) ? values : [values];\n}\n\nexport class DynamodbServiceExtension implements ServiceExtension {\n public requestPreSpanHook(normalizedRequest: NormalizedRequest): RequestMetadata {\n const operation = normalizedRequest.commandName;\n const tableName = normalizedRequest.commandInput?.TableName;\n\n const spanAttributes: Record<string, unknown> = {};\n\n /* oxlint-disable typescript/no-deprecated -- old-semconv db.* attributes, matched to the OTel aws-sdk integration */\n spanAttributes[DB_SYSTEM] = DB_SYSTEM_VALUE_DYNAMODB;\n spanAttributes[DB_NAME] = tableName;\n spanAttributes[DB_OPERATION] = operation;\n /* oxlint-enable typescript/no-deprecated */\n\n // `RequestItems` is undefined when no table names are returned; its keys are the table names.\n if (normalizedRequest.commandInput?.TableName) {\n // Necessary for commands with only 1 table name (e.g. CreateTable). Attribute is `TableName`, not keys of `RequestItems`.\n spanAttributes[ATTR_AWS_DYNAMODB_TABLE_NAMES] = [normalizedRequest.commandInput.TableName];\n } else if (normalizedRequest.commandInput?.RequestItems) {\n spanAttributes[ATTR_AWS_DYNAMODB_TABLE_NAMES] = Object.keys(normalizedRequest.commandInput.RequestItems);\n }\n\n if (operation === 'CreateTable' || operation === 'UpdateTable') {\n // only check for ProvisionedThroughput since ReadCapacityUnits and WriteCapacityUnits are required attributes\n if (normalizedRequest.commandInput?.ProvisionedThroughput) {\n spanAttributes[ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY] =\n normalizedRequest.commandInput.ProvisionedThroughput.ReadCapacityUnits;\n spanAttributes[ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY] =\n normalizedRequest.commandInput.ProvisionedThroughput.WriteCapacityUnits;\n }\n }\n\n if (operation === 'GetItem' || operation === 'Scan' || operation === 'Query') {\n if (normalizedRequest.commandInput?.ConsistentRead) {\n spanAttributes[ATTR_AWS_DYNAMODB_CONSISTENT_READ] = normalizedRequest.commandInput.ConsistentRead;\n }\n }\n\n if (operation === 'Query' || operation === 'Scan') {\n if (normalizedRequest.commandInput?.ProjectionExpression) {\n spanAttributes[ATTR_AWS_DYNAMODB_PROJECTION] = normalizedRequest.commandInput.ProjectionExpression;\n }\n }\n\n if (operation === 'CreateTable') {\n if (normalizedRequest.commandInput?.GlobalSecondaryIndexes) {\n spanAttributes[ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES] = toArray(\n normalizedRequest.commandInput.GlobalSecondaryIndexes,\n ).map((x: unknown) => JSON.stringify(x));\n }\n\n if (normalizedRequest.commandInput?.LocalSecondaryIndexes) {\n spanAttributes[ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES] = toArray(\n normalizedRequest.commandInput.LocalSecondaryIndexes,\n ).map((x: unknown) => JSON.stringify(x));\n }\n }\n\n if (operation === 'ListTables' || operation === 'Query' || operation === 'Scan') {\n if (normalizedRequest.commandInput?.Limit) {\n spanAttributes[ATTR_AWS_DYNAMODB_LIMIT] = normalizedRequest.commandInput.Limit;\n }\n }\n\n if (operation === 'ListTables') {\n if (normalizedRequest.commandInput?.ExclusiveStartTableName) {\n spanAttributes[ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE] =\n normalizedRequest.commandInput.ExclusiveStartTableName;\n }\n }\n\n if (operation === 'Query') {\n if (normalizedRequest.commandInput?.ScanIndexForward) {\n spanAttributes[ATTR_AWS_DYNAMODB_SCAN_FORWARD] = normalizedRequest.commandInput.ScanIndexForward;\n }\n\n if (normalizedRequest.commandInput?.IndexName) {\n spanAttributes[ATTR_AWS_DYNAMODB_INDEX_NAME] = normalizedRequest.commandInput.IndexName;\n }\n\n if (normalizedRequest.commandInput?.Select) {\n spanAttributes[ATTR_AWS_DYNAMODB_SELECT] = normalizedRequest.commandInput.Select;\n }\n }\n\n if (operation === 'Scan') {\n if (normalizedRequest.commandInput?.Segment) {\n spanAttributes[ATTR_AWS_DYNAMODB_SEGMENT] = normalizedRequest.commandInput?.Segment;\n }\n\n if (normalizedRequest.commandInput?.TotalSegments) {\n spanAttributes[ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS] = normalizedRequest.commandInput?.TotalSegments;\n }\n\n if (normalizedRequest.commandInput?.IndexName) {\n spanAttributes[ATTR_AWS_DYNAMODB_INDEX_NAME] = normalizedRequest.commandInput.IndexName;\n }\n\n if (normalizedRequest.commandInput?.Select) {\n spanAttributes[ATTR_AWS_DYNAMODB_SELECT] = normalizedRequest.commandInput.Select;\n }\n }\n\n if (operation === 'UpdateTable') {\n if (normalizedRequest.commandInput?.AttributeDefinitions) {\n spanAttributes[ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS] = toArray(\n normalizedRequest.commandInput.AttributeDefinitions,\n ).map((x: unknown) => JSON.stringify(x));\n }\n\n if (normalizedRequest.commandInput?.GlobalSecondaryIndexUpdates) {\n spanAttributes[ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES] = toArray(\n normalizedRequest.commandInput.GlobalSecondaryIndexUpdates,\n ).map((x: unknown) => JSON.stringify(x));\n }\n }\n\n return {\n spanAttributes,\n spanKind: SPAN_KIND.CLIENT,\n // Matches what the exporter infers from `db.system` for the OTel DynamoDB spans.\n spanOp: 'db',\n };\n }\n\n public responseHook(response: NormalizedResponse, span: Span): void {\n if (response.data?.ConsumedCapacity) {\n span.setAttribute(\n ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY,\n toArray(response.data.ConsumedCapacity).map((x: unknown) => JSON.stringify(x)),\n );\n }\n\n if (response.data?.ItemCollectionMetrics) {\n span.setAttribute(\n ATTR_AWS_DYNAMODB_ITEM_COLLECTION_METRICS,\n toArray(response.data.ItemCollectionMetrics).map((x: unknown) => JSON.stringify(x)),\n );\n }\n\n if (response.data?.TableNames) {\n span.setAttribute(ATTR_AWS_DYNAMODB_TABLE_COUNT, response.data?.TableNames.length);\n }\n\n if (response.data?.Count) {\n span.setAttribute(ATTR_AWS_DYNAMODB_COUNT, response.data?.Count);\n }\n\n if (response.data?.ScannedCount) {\n span.setAttribute(ATTR_AWS_DYNAMODB_SCANNED_COUNT, response.data?.ScannedCount);\n }\n }\n}\n"],"names":["DB_SYSTEM","DB_SYSTEM_VALUE_DYNAMODB","DB_NAME","DB_OPERATION","ATTR_AWS_DYNAMODB_TABLE_NAMES","ATTR_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY","ATTR_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY","ATTR_AWS_DYNAMODB_CONSISTENT_READ","ATTR_AWS_DYNAMODB_PROJECTION","ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES","ATTR_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES","ATTR_AWS_DYNAMODB_LIMIT","ATTR_AWS_DYNAMODB_EXCLUSIVE_START_TABLE","ATTR_AWS_DYNAMODB_SCAN_FORWARD","ATTR_AWS_DYNAMODB_INDEX_NAME","ATTR_AWS_DYNAMODB_SELECT","ATTR_AWS_DYNAMODB_SEGMENT","ATTR_AWS_DYNAMODB_TOTAL_SEGMENTS","ATTR_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS","ATTR_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES","SPAN_KIND","ATTR_AWS_DYNAMODB_CONSUMED_CAPACITY","ATTR_AWS_DYN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CAAC;AAAA,OACpF;AAAA,IACF;AAEA,IAAA,IAAI,QAAA,CAAS,MAAM,UAAA,EAAY;AAC7B,MAAA,IAAA,CAAK,YAAA,CAAaC,mCAAA,EAA+B,QAAA,CAAS,IAAA,EAAM,WAAW,MAAM,CAAA;AAAA,IACnF;AAEA,IAAA,IAAI,QAAA,CAAS,MAAM,KAAA,EAAO;AACxB,MAAA,IAAA,CAAK,YAAA,CAAaC,6BAAA,EAAyB,QAAA,CAAS,IAAA,EAAM,KAAK,CAAA;AAAA,IACjE;AAEA,IAAA,IAAI,QAAA,CAAS,MAAM,YAAA,EAAc;AAC/B,MAAA,IAAA,CAAK,YAAA,CAAaC,qCAAA,EAAiC,QAAA,CAAS,IAAA,EAAM,YAAY,CAAA;AAAA,IAChF;AAAA,EACF;AACF;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const attributes = require('@sentry/conventions/attributes');
|
|
5
|
+
|
|
6
|
+
class KinesisServiceExtension {
|
|
7
|
+
requestPreSpanHook(request) {
|
|
8
|
+
const streamName = request.commandInput?.StreamName;
|
|
9
|
+
const spanAttributes = {};
|
|
10
|
+
if (streamName) {
|
|
11
|
+
spanAttributes[attributes._AWS_KINESIS_STREAM_NAME] = streamName;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
spanAttributes,
|
|
15
|
+
spanKind: core.SPAN_KIND.CLIENT
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.KinesisServiceExtension = KinesisServiceExtension;
|
|
21
|
+
//# sourceMappingURL=kinesis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kinesis.js","sources":["../../../../../../src/integrations/tracing-channel/aws-sdk/services/kinesis.ts"],"sourcesContent":["import { SPAN_KIND } from '@sentry/core';\nimport { _AWS_KINESIS_STREAM_NAME as AWS_KINESIS_STREAM_NAME } from '@sentry/conventions/attributes';\nimport type { NormalizedRequest } from '../types';\nimport type { RequestMetadata, ServiceExtension } from './ServiceExtension';\n\nexport class KinesisServiceExtension implements ServiceExtension {\n public requestPreSpanHook(request: NormalizedRequest): RequestMetadata {\n const streamName = request.commandInput?.StreamName;\n const spanAttributes: Record<string, unknown> = {};\n\n if (streamName) {\n // oxlint-disable-next-line typescript/no-deprecated -- old-semconv aws.kinesis.stream.name, matched to the OTel aws-sdk integration\n spanAttributes[AWS_KINESIS_STREAM_NAME] = streamName;\n }\n\n return {\n spanAttributes,\n spanKind: SPAN_KIND.CLIENT,\n };\n }\n}\n"],"names":["AWS_KINESIS_STREAM_NAME","SPAN_KIND"],"mappings":";;;;;AAKO,MAAM,uBAAA,CAAoD;AAAA,EACxD,mBAAmB,OAAA,EAA6C;AACrE,IAAA,MAAM,UAAA,GAAa,QAAQ,YAAA,EAAc,UAAA;AACzC,IAAA,MAAM,iBAA0C,EAAC;AAEjD,IAAA,IAAI,UAAA,EAAY;AAEd,MAAA,cAAA,CAAeA,mCAAuB,CAAA,GAAI,UAAA;AAAA,IAC5C;AAEA,IAAA,OAAO;AAAA,MACL,cAAA;AAAA,MACA,UAAUC,cAAA,CAAU;AAAA,KACtB;AAAA,EACF;AACF;;;;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const attributes = require('@sentry/conventions/attributes');
|
|
5
|
+
const debugBuild = require('../../../../debug-build.js');
|
|
6
|
+
|
|
7
|
+
const INVOKE_COMMAND = "Invoke";
|
|
8
|
+
class LambdaServiceExtension {
|
|
9
|
+
requestPreSpanHook(request) {
|
|
10
|
+
const functionName = request.commandInput?.FunctionName;
|
|
11
|
+
const spanAttributes = {};
|
|
12
|
+
let spanName;
|
|
13
|
+
if (request.commandName === INVOKE_COMMAND) {
|
|
14
|
+
spanAttributes[attributes.FAAS_INVOKED_NAME] = functionName;
|
|
15
|
+
spanAttributes[attributes.FAAS_INVOKED_PROVIDER] = "aws";
|
|
16
|
+
spanName = `${functionName} ${INVOKE_COMMAND}`;
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
spanAttributes,
|
|
20
|
+
spanKind: core.SPAN_KIND.CLIENT,
|
|
21
|
+
spanName
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
requestPostSpanHook(request, span) {
|
|
25
|
+
if (request.commandName === INVOKE_COMMAND && request.commandInput) {
|
|
26
|
+
request.commandInput.ClientContext = injectLambdaPropagationContext(request.commandInput.ClientContext, span);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
responseHook(response, span) {
|
|
30
|
+
if (response.request.commandName === INVOKE_COMMAND) {
|
|
31
|
+
span.setAttribute(attributes.FAAS_EXECUTION, response.requestId);
|
|
32
|
+
if (response.request.region) {
|
|
33
|
+
span.setAttribute(attributes.FAAS_INVOKED_REGION, response.request.region);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function injectLambdaPropagationContext(clientContext, span) {
|
|
39
|
+
try {
|
|
40
|
+
const propagatedContext = core.getTraceData({ span });
|
|
41
|
+
const parsedClientContext = clientContext ? JSON.parse(Buffer.from(clientContext, "base64").toString("utf8")) : {};
|
|
42
|
+
const updatedClientContext = {
|
|
43
|
+
...parsedClientContext,
|
|
44
|
+
custom: {
|
|
45
|
+
...parsedClientContext.custom,
|
|
46
|
+
...propagatedContext
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const encodedClientContext = Buffer.from(JSON.stringify(updatedClientContext)).toString("base64");
|
|
50
|
+
if (encodedClientContext.length > 3583) {
|
|
51
|
+
debugBuild.DEBUG_BUILD && core.debug.warn(
|
|
52
|
+
"[orchestrion:aws-sdk] cannot set trace propagation on lambda invoke parameters due to ClientContext length limitations."
|
|
53
|
+
);
|
|
54
|
+
return clientContext;
|
|
55
|
+
}
|
|
56
|
+
return encodedClientContext;
|
|
57
|
+
} catch (e) {
|
|
58
|
+
debugBuild.DEBUG_BUILD && core.debug.log("[orchestrion:aws-sdk] failed to set trace propagation on lambda ClientContext", e);
|
|
59
|
+
return clientContext;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
exports.LambdaServiceExtension = LambdaServiceExtension;
|
|
64
|
+
//# sourceMappingURL=lambda.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lambda.js","sources":["../../../../../../src/integrations/tracing-channel/aws-sdk/services/lambda.ts"],"sourcesContent":["import type { Span } from '@sentry/core';\nimport { debug, getTraceData, SPAN_KIND } from '@sentry/core';\nimport {\n FAAS_EXECUTION as ATTR_FAAS_EXECUTION,\n FAAS_INVOKED_NAME as ATTR_FAAS_INVOKED_NAME,\n FAAS_INVOKED_PROVIDER as ATTR_FAAS_INVOKED_PROVIDER,\n FAAS_INVOKED_REGION as ATTR_FAAS_INVOKED_REGION,\n} from '@sentry/conventions/attributes';\nimport { DEBUG_BUILD } from '../../../../debug-build';\nimport type { NormalizedRequest, NormalizedResponse } from '../types';\nimport type { RequestMetadata, ServiceExtension } from './ServiceExtension';\n\nconst INVOKE_COMMAND = 'Invoke';\n\nexport class LambdaServiceExtension implements ServiceExtension {\n public requestPreSpanHook(request: NormalizedRequest): RequestMetadata {\n const functionName = request.commandInput?.FunctionName;\n\n const spanAttributes: Record<string, unknown> = {};\n let spanName: string | undefined;\n\n if (request.commandName === INVOKE_COMMAND) {\n spanAttributes[ATTR_FAAS_INVOKED_NAME] = functionName;\n spanAttributes[ATTR_FAAS_INVOKED_PROVIDER] = 'aws';\n spanName = `${functionName} ${INVOKE_COMMAND}`;\n }\n\n return {\n spanAttributes,\n spanKind: SPAN_KIND.CLIENT,\n spanName,\n };\n }\n\n public requestPostSpanHook(request: NormalizedRequest, span: Span): void {\n if (request.commandName === INVOKE_COMMAND && request.commandInput) {\n request.commandInput.ClientContext = injectLambdaPropagationContext(request.commandInput.ClientContext, span);\n }\n }\n\n public responseHook(response: NormalizedResponse, span: Span): void {\n if (response.request.commandName === INVOKE_COMMAND) {\n // oxlint-disable-next-line typescript/no-deprecated -- old-semconv faas.execution, matched to the OTel aws-sdk integration\n span.setAttribute(ATTR_FAAS_EXECUTION, response.requestId);\n // Region resolves asynchronously after `requestPreSpanHook`, so it's backfilled onto the\n // normalized request and read here (same timing as `cloud.region`).\n if (response.request.region) {\n span.setAttribute(ATTR_FAAS_INVOKED_REGION, response.request.region);\n }\n }\n }\n}\n\nfunction injectLambdaPropagationContext(clientContext: string | undefined, span: Span): string | undefined {\n try {\n const propagatedContext = getTraceData({ span });\n\n const parsedClientContext = clientContext ? JSON.parse(Buffer.from(clientContext, 'base64').toString('utf8')) : {};\n\n const updatedClientContext = {\n ...parsedClientContext,\n custom: {\n ...parsedClientContext.custom,\n ...propagatedContext,\n },\n };\n\n const encodedClientContext = Buffer.from(JSON.stringify(updatedClientContext)).toString('base64');\n\n // The length of client context is capped at 3583 bytes of base64 encoded data\n // (https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html#API_Invoke_RequestSyntax)\n if (encodedClientContext.length > 3583) {\n DEBUG_BUILD &&\n debug.warn(\n '[orchestrion:aws-sdk] cannot set trace propagation on lambda invoke parameters due to ClientContext length limitations.',\n );\n return clientContext;\n }\n\n return encodedClientContext;\n } catch (e) {\n DEBUG_BUILD && debug.log('[orchestrion:aws-sdk] failed to set trace propagation on lambda ClientContext', e);\n return clientContext;\n }\n}\n"],"names":["ATTR_FAAS_INVOKED_NAME","ATTR_FAAS_INVOKED_PROVIDER","SPAN_KIND","ATTR_FAAS_EXECUTION","ATTR_FAAS_INVOKED_REGION","getTraceData","DEBUG_BUILD","debug"],"mappings":";;;;;;AAYA,MAAM,cAAA,GAAiB,QAAA;AAEhB,MAAM,sBAAA,CAAmD;AAAA,EACv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EAAE,IAAA,EAAM,CAAA;AAE/C,IAAA,MAAM,mBAAA,GAAsB,aAAA,GAAgB,IAAA,CAAK,KAAA,CAAM,MAAA,CAAO,IAAA,CAAK,aAAA,EAAe,QAAQ,CAAA,CAAE,QAAA,CAAS,MAAM,CAAC,IAAI,EAAC;AAEjH,IAAA,MAAM,oBAAA,GAAuB;AAAA,MAC3B,GAAG,mBAAA;AAAA,MACH,MAAA,EAAQ;AAAA,QACN,GAAG,mBAAA,CAAoB,MAAA;AAAA,QACvB,GAAG;AAAA;AACL,KACF;AAEA,IAAA,MAAM,oBAAA,GAAuB,OAAO,IAAA,CAAK,IAAA,CAAK,UAAU,oBAAoB,CAAC,CAAA,CAAE,QAAA,CAAS,QAAQ,CAAA;AAIhG,IAAA,IAAI,oBAAA,CAAqB,SAAS,IAAA,EAAM;AACtC,MAAAC,sBAAA,IACEC,UAAA,CAAM,IAAA;AAAA,QACJ;AAAA,OACF;AACF,MAAA,OAAO,aAAA;AAAA,IACT;AAEA,IAAA,OAAO,oBAAA;AAAA,EACT,SAAS,CAAA,EAAG;AACV,IAAAD,sBAAA,IAAeC,UAAA,CAAM,GAAA,CAAI,+EAAA,EAAiF,CAAC,CAAA;AAC3G,IAAA,OAAO,aAAA;AAAA,EACT;AACF;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const attributes = require('@sentry/conventions/attributes');
|
|
5
|
+
|
|
6
|
+
class S3ServiceExtension {
|
|
7
|
+
requestPreSpanHook(request) {
|
|
8
|
+
const bucketName = request.commandInput?.Bucket;
|
|
9
|
+
const spanAttributes = {};
|
|
10
|
+
if (bucketName) {
|
|
11
|
+
spanAttributes[attributes.AWS_S3_BUCKET] = bucketName;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
spanAttributes,
|
|
15
|
+
spanKind: core.SPAN_KIND.CLIENT
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
exports.S3ServiceExtension = S3ServiceExtension;
|
|
21
|
+
//# sourceMappingURL=s3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3.js","sources":["../../../../../../src/integrations/tracing-channel/aws-sdk/services/s3.ts"],"sourcesContent":["import { SPAN_KIND } from '@sentry/core';\nimport { AWS_S3_BUCKET } from '@sentry/conventions/attributes';\nimport type { NormalizedRequest } from '../types';\nimport type { RequestMetadata, ServiceExtension } from './ServiceExtension';\n\nexport class S3ServiceExtension implements ServiceExtension {\n public requestPreSpanHook(request: NormalizedRequest): RequestMetadata {\n const bucketName = request.commandInput?.Bucket;\n const spanAttributes: Record<string, unknown> = {};\n\n if (bucketName) {\n spanAttributes[AWS_S3_BUCKET] = bucketName;\n }\n\n return {\n spanAttributes,\n spanKind: SPAN_KIND.CLIENT,\n };\n }\n}\n"],"names":["AWS_S3_BUCKET","SPAN_KIND"],"mappings":";;;;;AAKO,MAAM,kBAAA,CAA+C;AAAA,EACnD,mBAAmB,OAAA,EAA6C;AACrE,IAAA,MAAM,UAAA,GAAa,QAAQ,YAAA,EAAc,MAAA;AACzC,IAAA,MAAM,iBAA0C,EAAC;AAEjD,IAAA,IAAI,UAAA,EAAY;AACd,MAAA,cAAA,CAAeA,wBAAa,CAAA,GAAI,UAAA;AAAA,IAClC;AAEA,IAAA,OAAO;AAAA,MACL,cAAA;AAAA,MACA,UAAUC,cAAA,CAAU;AAAA,KACtB;AAAA,EACF;AACF;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const attributes = require('@sentry/conventions/attributes');
|
|
5
|
+
|
|
6
|
+
class SecretsManagerServiceExtension {
|
|
7
|
+
requestPreSpanHook(request) {
|
|
8
|
+
const secretId = request.commandInput?.SecretId;
|
|
9
|
+
const spanAttributes = {};
|
|
10
|
+
if (typeof secretId === "string" && secretId.startsWith("arn:aws:secretsmanager:")) {
|
|
11
|
+
spanAttributes[attributes.AWS_SECRETSMANAGER_SECRET_ARN] = secretId;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
spanAttributes,
|
|
15
|
+
spanKind: core.SPAN_KIND.CLIENT
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
responseHook(response, span) {
|
|
19
|
+
const secretArn = response.data?.ARN;
|
|
20
|
+
if (secretArn) {
|
|
21
|
+
span.setAttribute(attributes.AWS_SECRETSMANAGER_SECRET_ARN, secretArn);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.SecretsManagerServiceExtension = SecretsManagerServiceExtension;
|
|
27
|
+
//# sourceMappingURL=secretsmanager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secretsmanager.js","sources":["../../../../../../src/integrations/tracing-channel/aws-sdk/services/secretsmanager.ts"],"sourcesContent":["import type { Span } from '@sentry/core';\nimport { SPAN_KIND } from '@sentry/core';\nimport { AWS_SECRETSMANAGER_SECRET_ARN as ATTR_AWS_SECRETSMANAGER_SECRET_ARN } from '@sentry/conventions/attributes';\nimport type { NormalizedRequest, NormalizedResponse } from '../types';\nimport type { RequestMetadata, ServiceExtension } from './ServiceExtension';\n\nexport class SecretsManagerServiceExtension implements ServiceExtension {\n public requestPreSpanHook(request: NormalizedRequest): RequestMetadata {\n const secretId = request.commandInput?.SecretId;\n const spanAttributes: Record<string, unknown> = {};\n if (typeof secretId === 'string' && secretId.startsWith('arn:aws:secretsmanager:')) {\n spanAttributes[ATTR_AWS_SECRETSMANAGER_SECRET_ARN] = secretId;\n }\n\n return {\n spanAttributes,\n spanKind: SPAN_KIND.CLIENT,\n };\n }\n\n public responseHook(response: NormalizedResponse, span: Span): void {\n const secretArn = response.data?.ARN;\n if (secretArn) {\n span.setAttribute(ATTR_AWS_SECRETSMANAGER_SECRET_ARN, secretArn);\n }\n }\n}\n"],"names":["ATTR_AWS_SECRETSMANAGER_SECRET_ARN","SPAN_KIND"],"mappings":";;;;;AAMO,MAAM,8BAAA,CAA2D;AAAA,EAC/D,mBAAmB,OAAA,EAA6C;AACrE,IAAA,MAAM,QAAA,GAAW,QAAQ,YAAA,EAAc,QAAA;AACvC,IAAA,MAAM,iBAA0C,EAAC;AACjD,IAAA,IAAI,OAAO,QAAA,KAAa,QAAA,IAAY,QAAA,CAAS,UAAA,CAAW,yBAAyB,CAAA,EAAG;AAClF,MAAA,cAAA,CAAeA,wCAAkC,CAAA,GAAI,QAAA;AAAA,IACvD;AAEA,IAAA,OAAO;AAAA,MACL,cAAA;AAAA,MACA,UAAUC,cAAA,CAAU;AAAA,KACtB;AAAA,EACF;AAAA,EAEO,YAAA,CAAa,UAA8B,IAAA,EAAkB;AAClE,IAAA,MAAM,SAAA,GAAY,SAAS,IAAA,EAAM,GAAA;AACjC,IAAA,IAAI,SAAA,EAAW;AACb,MAAA,IAAA,CAAK,YAAA,CAAaD,0CAAoC,SAAS,CAAA;AAAA,IACjE;AAAA,EACF;AACF;;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const attributes = require('@sentry/conventions/attributes');
|
|
5
|
+
const constants = require('../constants.js');
|
|
6
|
+
const MessageAttributes = require('./MessageAttributes.js');
|
|
7
|
+
|
|
8
|
+
class SnsServiceExtension {
|
|
9
|
+
requestPreSpanHook(request) {
|
|
10
|
+
let spanKind = core.SPAN_KIND.CLIENT;
|
|
11
|
+
let spanName = `SNS ${request.commandName}`;
|
|
12
|
+
const spanAttributes = {
|
|
13
|
+
[attributes.MESSAGING_SYSTEM]: "aws.sns"
|
|
14
|
+
};
|
|
15
|
+
if (request.commandName === "Publish") {
|
|
16
|
+
spanKind = core.SPAN_KIND.PRODUCER;
|
|
17
|
+
spanAttributes[constants.ATTR_MESSAGING_DESTINATION_KIND] = constants.MESSAGING_DESTINATION_KIND_VALUE_TOPIC;
|
|
18
|
+
const { TopicArn, TargetArn, PhoneNumber } = request.commandInput;
|
|
19
|
+
const destinationName = extractDestinationName(TopicArn, TargetArn, PhoneNumber);
|
|
20
|
+
spanAttributes[attributes.MESSAGING_DESTINATION] = destinationName;
|
|
21
|
+
spanAttributes[attributes.MESSAGING_DESTINATION_NAME] = TopicArn || TargetArn || PhoneNumber || "unknown";
|
|
22
|
+
spanName = `${PhoneNumber ? "phone_number" : destinationName} send`;
|
|
23
|
+
}
|
|
24
|
+
const topicArn = request.commandInput?.TopicArn;
|
|
25
|
+
if (topicArn) {
|
|
26
|
+
spanAttributes[attributes.AWS_SNS_TOPIC_ARN] = topicArn;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
spanAttributes,
|
|
30
|
+
spanKind,
|
|
31
|
+
spanName
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
requestPostSpanHook(request, span) {
|
|
35
|
+
if (request.commandName === "Publish") {
|
|
36
|
+
const origMessageAttributes = request.commandInput.MessageAttributes ?? {};
|
|
37
|
+
request.commandInput.MessageAttributes = MessageAttributes.injectPropagationContext(origMessageAttributes, core.getTraceData({ span }));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
responseHook(response, span) {
|
|
41
|
+
const topicArn = response.data?.TopicArn;
|
|
42
|
+
if (topicArn) {
|
|
43
|
+
span.setAttribute(attributes.AWS_SNS_TOPIC_ARN, topicArn);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function extractDestinationName(topicArn, targetArn, phoneNumber) {
|
|
48
|
+
if (topicArn || targetArn) {
|
|
49
|
+
const arn = topicArn ?? targetArn;
|
|
50
|
+
try {
|
|
51
|
+
return arn.substring(arn.lastIndexOf(":") + 1);
|
|
52
|
+
} catch {
|
|
53
|
+
return arn;
|
|
54
|
+
}
|
|
55
|
+
} else if (phoneNumber) {
|
|
56
|
+
return phoneNumber;
|
|
57
|
+
} else {
|
|
58
|
+
return "unknown";
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
exports.SnsServiceExtension = SnsServiceExtension;
|
|
63
|
+
//# sourceMappingURL=sns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sns.js","sources":["../../../../../../src/integrations/tracing-channel/aws-sdk/services/sns.ts"],"sourcesContent":["import type { Span, SpanKindValue } from '@sentry/core';\nimport { getTraceData, SPAN_KIND } from '@sentry/core';\nimport {\n AWS_SNS_TOPIC_ARN as ATTR_AWS_SNS_TOPIC_ARN,\n MESSAGING_DESTINATION as ATTR_MESSAGING_DESTINATION,\n MESSAGING_DESTINATION_NAME,\n MESSAGING_SYSTEM,\n} from '@sentry/conventions/attributes';\nimport { ATTR_MESSAGING_DESTINATION_KIND, MESSAGING_DESTINATION_KIND_VALUE_TOPIC } from '../constants';\nimport type { NormalizedRequest, NormalizedResponse } from '../types';\nimport { injectPropagationContext } from './MessageAttributes';\nimport type { RequestMetadata, ServiceExtension } from './ServiceExtension';\n\nexport class SnsServiceExtension implements ServiceExtension {\n public requestPreSpanHook(request: NormalizedRequest): RequestMetadata {\n let spanKind: SpanKindValue = SPAN_KIND.CLIENT;\n let spanName = `SNS ${request.commandName}`;\n const spanAttributes: Record<string, unknown> = {\n [MESSAGING_SYSTEM]: 'aws.sns',\n };\n\n if (request.commandName === 'Publish') {\n spanKind = SPAN_KIND.PRODUCER;\n\n spanAttributes[ATTR_MESSAGING_DESTINATION_KIND] = MESSAGING_DESTINATION_KIND_VALUE_TOPIC;\n const { TopicArn, TargetArn, PhoneNumber } = request.commandInput;\n const destinationName = extractDestinationName(TopicArn, TargetArn, PhoneNumber);\n // oxlint-disable-next-line typescript/no-deprecated -- old-semconv messaging.destination, matched to the OTel aws-sdk integration\n spanAttributes[ATTR_MESSAGING_DESTINATION] = destinationName;\n spanAttributes[MESSAGING_DESTINATION_NAME] = TopicArn || TargetArn || PhoneNumber || 'unknown';\n\n spanName = `${PhoneNumber ? 'phone_number' : destinationName} send`;\n }\n\n const topicArn = request.commandInput?.TopicArn;\n if (topicArn) {\n spanAttributes[ATTR_AWS_SNS_TOPIC_ARN] = topicArn;\n }\n\n return {\n spanAttributes,\n spanKind,\n spanName,\n };\n }\n\n public requestPostSpanHook(request: NormalizedRequest, span: Span): void {\n if (request.commandName === 'Publish') {\n const origMessageAttributes = request.commandInput.MessageAttributes ?? {};\n request.commandInput.MessageAttributes = injectPropagationContext(origMessageAttributes, getTraceData({ span }));\n }\n }\n\n public responseHook(response: NormalizedResponse, span: Span): void {\n const topicArn = response.data?.TopicArn;\n if (topicArn) {\n span.setAttribute(ATTR_AWS_SNS_TOPIC_ARN, topicArn);\n }\n }\n}\n\nfunction extractDestinationName(topicArn: string, targetArn: string, phoneNumber: string): string {\n if (topicArn || targetArn) {\n const arn = topicArn ?? targetArn;\n try {\n return arn.substring(arn.lastIndexOf(':') + 1);\n } catch {\n return arn;\n }\n } else if (phoneNumber) {\n return phoneNumber;\n } else {\n return 'unknown';\n }\n}\n"],"names":["SPAN_KIND","MESSAGING_SYSTEM","ATTR_MESSAGING_DESTINATION_KIND","MESSAGING_DESTINATION_KIND_VALUE_TOPIC","ATTR_MESSAGING_DESTINATION","MESSAGING_DESTINATION_NAME","ATTR_AWS_SNS_TOPIC_ARN","injectPropagationContext","getTraceData"],"mappings":";;;;;;;AAaO,MAAM,mBAAA,CAAgD;AAAA,EACpD,mBAAmB,OAAA,EAA6C;AACrE,IAAA,IAAI,WAA0BA,cAAA,CAAU,MAAA;AACxC,IAAA,IAAI,QAAA,GAAW,CAAA,IAAA,EAAO,OAAA,CAAQ,WAAW,CAAA,CAAA;AACzC,IAAA,MAAM,cAAA,GAA0C;AAAA,MAC9C,CAACC,2BAAgB,GAAG;AAA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EAAU;AACZ,MAAA,IAAA,CAAK,YAAA,CAAaF,8BAAwB,QAAQ,CAAA;AAAA,IACpD;AAAA,EACF;AACF;AAEA,SAAS,sBAAA,CAAuB,QAAA,EAAkB,SAAA,EAAmB,WAAA,EAA6B;AAChG,EAAA,IAAI,YAAY,SAAA,EAAW;AACzB,IAAA,MAAM,MAAM,QAAA,IAAY,SAAA;AACxB,IAAA,IAAI;AACF,MAAA,OAAO,IAAI,SAAA,CAAU,GAAA,CAAI,WAAA,CAAY,GAAG,IAAI,CAAC,CAAA;AAAA,IAC/C,CAAA,CAAA,MAAQ;AACN,MAAA,OAAO,GAAA;AAAA,IACT;AAAA,EACF,WAAW,WAAA,EAAa;AACtB,IAAA,OAAO,WAAA;AAAA,EACT,CAAA,MAAO;AACL,IAAA,OAAO,SAAA;AAAA,EACT;AACF;;;;"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const attributes = require('@sentry/conventions/attributes');
|
|
5
|
+
const MessageAttributes = require('./MessageAttributes.js');
|
|
6
|
+
|
|
7
|
+
class SqsServiceExtension {
|
|
8
|
+
requestPreSpanHook(request) {
|
|
9
|
+
const queueUrl = extractQueueUrl(request.commandInput);
|
|
10
|
+
const queueName = extractQueueNameFromUrl(queueUrl);
|
|
11
|
+
let spanKind = core.SPAN_KIND.CLIENT;
|
|
12
|
+
let spanName;
|
|
13
|
+
const spanAttributes = {
|
|
14
|
+
[attributes.MESSAGING_SYSTEM]: "aws_sqs",
|
|
15
|
+
[attributes.MESSAGING_DESTINATION_NAME]: queueName,
|
|
16
|
+
[attributes.URL_FULL]: queueUrl
|
|
17
|
+
};
|
|
18
|
+
switch (request.commandName) {
|
|
19
|
+
case "ReceiveMessage":
|
|
20
|
+
{
|
|
21
|
+
spanKind = core.SPAN_KIND.CONSUMER;
|
|
22
|
+
spanName = `${queueName} receive`;
|
|
23
|
+
spanAttributes[attributes.MESSAGING_OPERATION_TYPE] = "receive";
|
|
24
|
+
request.commandInput.MessageAttributeNames = MessageAttributes.addPropagationFieldsToAttributeNames(
|
|
25
|
+
request.commandInput.MessageAttributeNames
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
break;
|
|
29
|
+
case "SendMessage":
|
|
30
|
+
case "SendMessageBatch":
|
|
31
|
+
spanKind = core.SPAN_KIND.PRODUCER;
|
|
32
|
+
spanName = `${queueName} send`;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
spanAttributes,
|
|
37
|
+
spanKind,
|
|
38
|
+
spanName
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
requestPostSpanHook(request, span) {
|
|
42
|
+
switch (request.commandName) {
|
|
43
|
+
case "SendMessage":
|
|
44
|
+
{
|
|
45
|
+
const origMessageAttributes = request.commandInput.MessageAttributes ?? {};
|
|
46
|
+
request.commandInput.MessageAttributes = MessageAttributes.injectPropagationContext(
|
|
47
|
+
origMessageAttributes,
|
|
48
|
+
core.getTraceData({ span })
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
case "SendMessageBatch":
|
|
53
|
+
{
|
|
54
|
+
const entries = request.commandInput?.Entries;
|
|
55
|
+
if (Array.isArray(entries)) {
|
|
56
|
+
const traceData = core.getTraceData({ span });
|
|
57
|
+
entries.forEach((messageParams) => {
|
|
58
|
+
messageParams.MessageAttributes = MessageAttributes.injectPropagationContext(
|
|
59
|
+
messageParams.MessageAttributes ?? {},
|
|
60
|
+
traceData
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
responseHook(response, span) {
|
|
69
|
+
switch (response.request.commandName) {
|
|
70
|
+
case "SendMessage":
|
|
71
|
+
span.setAttribute(attributes.MESSAGING_MESSAGE_ID, response?.data?.MessageId);
|
|
72
|
+
break;
|
|
73
|
+
case "SendMessageBatch":
|
|
74
|
+
break;
|
|
75
|
+
case "ReceiveMessage": {
|
|
76
|
+
const messages = response?.data?.Messages || [];
|
|
77
|
+
span.setAttribute(attributes.MESSAGING_BATCH_MESSAGE_COUNT, messages.length);
|
|
78
|
+
for (const message of messages) {
|
|
79
|
+
linkReceivedMessageToProducer(span, message);
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function linkReceivedMessageToProducer(span, message) {
|
|
87
|
+
const headers = MessageAttributes.extractPropagationHeaders(message);
|
|
88
|
+
if (!headers) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const { parentSpanId, traceId, sampled } = core.propagationContextFromHeaders(headers.sentryTrace, headers.baggage);
|
|
92
|
+
if (traceId && parentSpanId) {
|
|
93
|
+
span.addLink({
|
|
94
|
+
context: {
|
|
95
|
+
traceId,
|
|
96
|
+
spanId: parentSpanId,
|
|
97
|
+
traceFlags: sampled ? 1 : 0
|
|
98
|
+
},
|
|
99
|
+
attributes: {
|
|
100
|
+
[attributes.MESSAGING_MESSAGE_ID]: message.MessageId
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function extractQueueUrl(commandInput) {
|
|
106
|
+
return commandInput?.QueueUrl;
|
|
107
|
+
}
|
|
108
|
+
function extractQueueNameFromUrl(queueUrl) {
|
|
109
|
+
if (!queueUrl) return void 0;
|
|
110
|
+
const segments = queueUrl.split("/");
|
|
111
|
+
if (segments.length === 0) return void 0;
|
|
112
|
+
return segments[segments.length - 1];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
exports.SqsServiceExtension = SqsServiceExtension;
|
|
116
|
+
//# sourceMappingURL=sqs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqs.js","sources":["../../../../../../src/integrations/tracing-channel/aws-sdk/services/sqs.ts"],"sourcesContent":["import type { Span, SpanKindValue } from '@sentry/core';\nimport { getTraceData, propagationContextFromHeaders, SPAN_KIND } from '@sentry/core';\nimport {\n MESSAGING_BATCH_MESSAGE_COUNT,\n MESSAGING_DESTINATION_NAME,\n MESSAGING_MESSAGE_ID,\n MESSAGING_OPERATION_TYPE,\n MESSAGING_SYSTEM,\n URL_FULL,\n} from '@sentry/conventions/attributes';\nimport type { SQS } from '../aws-sdk.types';\nimport type { CommandInput, NormalizedRequest, NormalizedResponse } from '../types';\nimport {\n addPropagationFieldsToAttributeNames,\n extractPropagationHeaders,\n injectPropagationContext,\n} from './MessageAttributes';\nimport type { RequestMetadata, ServiceExtension } from './ServiceExtension';\n\nexport class SqsServiceExtension implements ServiceExtension {\n public requestPreSpanHook(request: NormalizedRequest): RequestMetadata {\n const queueUrl = extractQueueUrl(request.commandInput);\n const queueName = extractQueueNameFromUrl(queueUrl);\n let spanKind: SpanKindValue = SPAN_KIND.CLIENT;\n let spanName: string | undefined;\n\n const spanAttributes: Record<string, unknown> = {\n [MESSAGING_SYSTEM]: 'aws_sqs',\n [MESSAGING_DESTINATION_NAME]: queueName,\n [URL_FULL]: queueUrl,\n };\n\n switch (request.commandName) {\n case 'ReceiveMessage':\n {\n spanKind = SPAN_KIND.CONSUMER;\n spanName = `${queueName} receive`;\n spanAttributes[MESSAGING_OPERATION_TYPE] = 'receive';\n\n request.commandInput.MessageAttributeNames = addPropagationFieldsToAttributeNames(\n request.commandInput.MessageAttributeNames,\n );\n }\n break;\n\n case 'SendMessage':\n case 'SendMessageBatch':\n spanKind = SPAN_KIND.PRODUCER;\n spanName = `${queueName} send`;\n break;\n }\n\n return {\n spanAttributes,\n spanKind,\n spanName,\n };\n }\n\n public requestPostSpanHook(request: NormalizedRequest, span: Span): void {\n switch (request.commandName) {\n case 'SendMessage':\n {\n const origMessageAttributes = request.commandInput.MessageAttributes ?? {};\n request.commandInput.MessageAttributes = injectPropagationContext(\n origMessageAttributes,\n getTraceData({ span }),\n );\n }\n break;\n\n case 'SendMessageBatch':\n {\n const entries = request.commandInput?.Entries;\n if (Array.isArray(entries)) {\n // Serialized once; the headers are identical for every entry of the batch.\n const traceData = getTraceData({ span });\n entries.forEach((messageParams: { MessageAttributes: SQS.MessageBodyAttributeMap }) => {\n messageParams.MessageAttributes = injectPropagationContext(\n messageParams.MessageAttributes ?? {},\n traceData,\n );\n });\n }\n }\n break;\n }\n }\n\n public responseHook(response: NormalizedResponse, span: Span): void {\n switch (response.request.commandName) {\n case 'SendMessage':\n span.setAttribute(MESSAGING_MESSAGE_ID, response?.data?.MessageId);\n break;\n\n case 'SendMessageBatch':\n break;\n\n case 'ReceiveMessage': {\n const messages: SQS.Message[] = response?.data?.Messages || [];\n\n span.setAttribute(MESSAGING_BATCH_MESSAGE_COUNT, messages.length);\n\n for (const message of messages) {\n linkReceivedMessageToProducer(span, message);\n }\n break;\n }\n }\n }\n}\n\n/**\n * Link a received SQS message's span back to the producer trace carried in its propagation headers.\n * No-op when the message has no (valid) `sentry-trace`/`baggage` attributes.\n */\nfunction linkReceivedMessageToProducer(span: Span, message: SQS.Message): void {\n const headers = extractPropagationHeaders(message);\n if (!headers) {\n return;\n }\n\n const { parentSpanId, traceId, sampled } = propagationContextFromHeaders(headers.sentryTrace, headers.baggage);\n if (traceId && parentSpanId) {\n span.addLink({\n context: {\n traceId,\n spanId: parentSpanId,\n traceFlags: sampled ? 1 : 0,\n },\n attributes: {\n [MESSAGING_MESSAGE_ID]: message.MessageId,\n },\n });\n }\n}\n\nfunction extractQueueUrl(commandInput: CommandInput): string {\n return commandInput?.QueueUrl;\n}\n\nfunction extractQueueNameFromUrl(queueUrl: string): string | undefined {\n if (!queueUrl) return undefined;\n\n const segments = queueUrl.split('/');\n if (segments.length === 0) return undefined;\n\n return segments[segments.length - 1];\n}\n"],"names":["SPAN_KIND","MESSAGING_SYSTEM","MESSAGING_DESTINATION_NAME","URL_FULL","MESSAGING_OPERATION_TYPE","addPropagationFieldsToAttributeNames","injectPropagationContext","getTraceData","MESSAGING_MESSAGE_ID","MESSAGING_BATCH_MESSAGE_COUNT","extractPropagationHeaders","propagationContextFromHeaders"],"mappings":";;;;;;AAmBO,MAAM,mBAAA,CAAgD;AAAA,EACpD,mBAAmB,OAAA,EAA6C;AACrE,IAAA,MAAM,QAAA,GAAW,eAAA,CAAgB,OAAA,CAAQ,YAAY,CAAA;AACrD,IAAA,MAAM,SAAA,GAAY,wBAAwB,QAAQ,CAAA;AAClD,IAAA,IAAI,WAA0BA,cAAA,CAAU,MAAA;AACxC,IAAA,IAAI,QAAA;AAEJ,IAAA,MAAM,cAAA,GAA0C;AAAA,MAC9C,CAACC,2BAAgB,GAAG,SAAA;AAAA,MACpB,CAACC,qCAA0B,GAAG,SAAA;AAAA,MAC9B,CAACC,mBAAQ,GAAG;AAAA,KACd;AAEA,IAAA,QAAQ,QAAQ,WAAA;AAAa,MAC3B,KAAK,gBAAA;AACH,QAAA;AACE,UAAA,QAAA,GAAWH,cAAA,CAAU,QAAA;AACrB,UAAA,QAAA,GAAW,GAAG,SAAS,CAAA,QAAA,CAAA;AACvB,UAAA,cAAA,CAAeI,mCAAwB,CAAA,GAAI,SAAA;AAE3C,UAAA,OAAA,CAAQ,aAAa,qBAAA,GAAwBC,sDAAA;AAAA,YAC3C,QAAQ,YAAA,CAAa;AAAA,WACvB;AAAA,QACF;AACA,QAAA;AAAA,MAEF,KAAK,aAAA;AAAA,MACL,KAAK,kBAAA;AACH,QAAA,QAAA,GAAWL,cAAA,CAAU,QAAA;AACrB,QAAA,QAAA,GAAW,GAAG,SAAS,CAAA,KAAA,CAAA;AACvB,QAAA;AAAA;AAGJ,IAAA,OAAO;AAAA,MACL,cAAA;AAAA,MACA,QAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEO,mBAAA,CAAoB,SAA4B,IAAA,EAAkB;AACvE,IAAA,QAAQ,QAAQ,WAAA;AAAa,MAC3B,KAAK,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QAC7C;AACA,QAAA;AAAA,MACF;AAAA;AACF,EACF;AACF;AAMA,SAAS,6BAAA,CAA8B,MAAY,OAAA,EAA4B;AAC7E,EAAA,MAAM,OAAA,GAAUC,4CAA0B,OAAO,CAAA;AACjD,EAAA,IAAI,CAAC,OAAA,EAAS;AACZ,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,EAAE,cAAc,OAAA,EAAS,OAAA,KAAYC,kCAAA,CAA8B,OAAA,CAAQ,WAAA,EAAa,OAAA,CAAQ,OAAO,CAAA;AAC7G,EAAA,IAAI,WAAW,YAAA,EAAc;AAC3B,IAAA,IAAA,CAAK,OAAA,CAAQ;AAAA,MACX,OAAA,EAAS;AAAA,QACP,OAAA;AAAA,QACA,MAAA,EAAQ,YAAA;AAAA,QACR,UAAA,EAAY,UAAU,CAAA,GAAI;AAAA,OAC5B;AAAA,MACA,UAAA,EAAY;AAAA,QACV,CAACH,+BAAoB,GAAG,OAAA,CAAQ;AAAA;AAClC,KACD,CAAA;AAAA,EACH;AACF;AAEA,SAAS,gBAAgB,YAAA,EAAoC;AAC3D,EAAA,OAAO,YAAA,EAAc,QAAA;AACvB;AAEA,SAAS,wBAAwB,QAAA,EAAsC;AACrE,EAAA,IAAI,CAAC,UAAU,OAAO,MAAA;AAEtB,EAAA,MAAM,QAAA,GAAW,QAAA,CAAS,KAAA,CAAM,GAAG,CAAA;AACnC,EAAA,IAAI,QAAA,CAAS,MAAA,KAAW,CAAA,EAAG,OAAO,MAAA;AAElC,EAAA,OAAO,QAAA,CAAS,QAAA,CAAS,MAAA,GAAS,CAAC,CAAA;AACrC;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
const attributes = require('@sentry/conventions/attributes');
|
|
5
|
+
|
|
6
|
+
class StepFunctionsServiceExtension {
|
|
7
|
+
requestPreSpanHook(request) {
|
|
8
|
+
const stateMachineArn = request.commandInput?.stateMachineArn;
|
|
9
|
+
const activityArn = request.commandInput?.activityArn;
|
|
10
|
+
const spanAttributes = {};
|
|
11
|
+
if (stateMachineArn) {
|
|
12
|
+
spanAttributes[attributes.AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN] = stateMachineArn;
|
|
13
|
+
}
|
|
14
|
+
if (activityArn) {
|
|
15
|
+
spanAttributes[attributes.AWS_STEP_FUNCTIONS_ACTIVITY_ARN] = activityArn;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
spanAttributes,
|
|
19
|
+
spanKind: core.SPAN_KIND.CLIENT
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.StepFunctionsServiceExtension = StepFunctionsServiceExtension;
|
|
25
|
+
//# sourceMappingURL=stepfunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepfunctions.js","sources":["../../../../../../src/integrations/tracing-channel/aws-sdk/services/stepfunctions.ts"],"sourcesContent":["import { SPAN_KIND } from '@sentry/core';\nimport {\n AWS_STEP_FUNCTIONS_ACTIVITY_ARN as ATTR_AWS_STEP_FUNCTIONS_ACTIVITY_ARN,\n AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN as ATTR_AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN,\n} from '@sentry/conventions/attributes';\nimport type { NormalizedRequest } from '../types';\nimport type { RequestMetadata, ServiceExtension } from './ServiceExtension';\n\nexport class StepFunctionsServiceExtension implements ServiceExtension {\n public requestPreSpanHook(request: NormalizedRequest): RequestMetadata {\n const stateMachineArn = request.commandInput?.stateMachineArn;\n const activityArn = request.commandInput?.activityArn;\n const spanAttributes: Record<string, unknown> = {};\n\n if (stateMachineArn) {\n spanAttributes[ATTR_AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN] = stateMachineArn;\n }\n\n if (activityArn) {\n spanAttributes[ATTR_AWS_STEP_FUNCTIONS_ACTIVITY_ARN] = activityArn;\n }\n\n return {\n spanAttributes,\n spanKind: SPAN_KIND.CLIENT,\n };\n }\n}\n"],"names":["ATTR_AWS_STEP_FUNCTIONS_STATE_MACHINE_ARN","ATTR_AWS_STEP_FUNCTIONS_ACTIVITY_ARN","SPAN_KIND"],"mappings":";;;;;AAQO,MAAM,6BAAA,CAA0D;AAAA,EAC9D,mBAAmB,OAAA,EAA6C;AACrE,IAAA,MAAM,eAAA,GAAkB,QAAQ,YAAA,EAAc,eAAA;AAC9C,IAAA,MAAM,WAAA,GAAc,QAAQ,YAAA,EAAc,WAAA;AAC1C,IAAA,MAAM,iBAA0C,EAAC;AAEjD,IAAA,IAAI,eAAA,EAAiB;AACnB,MAAA,cAAA,CAAeA,+CAAyC,CAAA,GAAI,eAAA;AAAA,IAC9D;AAEA,IAAA,IAAI,WAAA,EAAa;AACf,MAAA,cAAA,CAAeC,0CAAoC,CAAA,GAAI,WAAA;AAAA,IACzD;AAEA,IAAA,OAAO;AAAA,MACL,cAAA;AAAA,MACA,UAAUC,cAAA,CAAU;AAAA,KACtB;AAAA,EACF;AACF;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const attributes = require('@sentry/conventions/attributes');
|
|
4
|
+
|
|
5
|
+
function removeSuffixFromStringIfExists(str, suffixToRemove) {
|
|
6
|
+
const suffixLength = suffixToRemove.length;
|
|
7
|
+
return str?.slice(-suffixLength) === suffixToRemove ? str.slice(0, -suffixLength) : str;
|
|
8
|
+
}
|
|
9
|
+
function normalizeV3Request(serviceName, commandNameWithSuffix, commandInput, region) {
|
|
10
|
+
return {
|
|
11
|
+
serviceName: serviceName?.replace(/\s+/g, ""),
|
|
12
|
+
commandName: removeSuffixFromStringIfExists(commandNameWithSuffix, "Command"),
|
|
13
|
+
commandInput,
|
|
14
|
+
region
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function extractAttributesFromNormalizedRequest(normalizedRequest) {
|
|
18
|
+
return {
|
|
19
|
+
// oxlint-disable-next-line typescript/no-deprecated -- old-semconv rpc.system, matched to the OTel aws-sdk integration
|
|
20
|
+
[attributes.RPC_SYSTEM]: "aws-api",
|
|
21
|
+
[attributes.RPC_METHOD]: normalizedRequest.commandName,
|
|
22
|
+
[attributes.RPC_SERVICE]: normalizedRequest.serviceName,
|
|
23
|
+
[attributes.CLOUD_REGION]: normalizedRequest.region
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
exports.extractAttributesFromNormalizedRequest = extractAttributesFromNormalizedRequest;
|
|
28
|
+
exports.normalizeV3Request = normalizeV3Request;
|
|
29
|
+
exports.removeSuffixFromStringIfExists = removeSuffixFromStringIfExists;
|
|
30
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../src/integrations/tracing-channel/aws-sdk/utils.ts"],"sourcesContent":["import { CLOUD_REGION, RPC_METHOD, RPC_SERVICE, RPC_SYSTEM } from '@sentry/conventions/attributes';\nimport type { CommandInput, NormalizedRequest } from './types';\n\nexport function removeSuffixFromStringIfExists(str: string, suffixToRemove: string): string {\n const suffixLength = suffixToRemove.length;\n return str?.slice(-suffixLength) === suffixToRemove ? str.slice(0, -suffixLength) : str;\n}\n\nexport function normalizeV3Request(\n serviceName: string,\n commandNameWithSuffix: string,\n commandInput: CommandInput,\n region: string | undefined,\n): NormalizedRequest {\n return {\n serviceName: serviceName?.replace(/\\s+/g, ''),\n commandName: removeSuffixFromStringIfExists(commandNameWithSuffix, 'Command'),\n commandInput,\n region,\n };\n}\n\nexport function extractAttributesFromNormalizedRequest(normalizedRequest: NormalizedRequest): Record<string, unknown> {\n return {\n // oxlint-disable-next-line typescript/no-deprecated -- old-semconv rpc.system, matched to the OTel aws-sdk integration\n [RPC_SYSTEM]: 'aws-api',\n [RPC_METHOD]: normalizedRequest.commandName,\n [RPC_SERVICE]: normalizedRequest.serviceName,\n [CLOUD_REGION]: normalizedRequest.region,\n };\n}\n"],"names":["RPC_SYSTEM","RPC_METHOD","RPC_SERVICE","CLOUD_REGION"],"mappings":";;;;AAGO,SAAS,8BAAA,CAA+B,KAAa,cAAA,EAAgC;AAC1F,EAAA,MAAM,eAAe,cAAA,CAAe,MAAA;AACpC,EAAA,OAAO,GAAA,EAAK,KAAA,CAAM,CAAC,YAAY,CAAA,KAAM,cAAA,GAAiB,GAAA,CAAI,KAAA,CAAM,CAAA,EAAG,CAAC,YAAY,CAAA,GAAI,GAAA;AACtF;AAEO,SAAS,kBAAA,CACd,WAAA,EACA,qBAAA,EACA,YAAA,EACA,MAAA,EACmB;AACnB,EAAA,OAAO;AAAA,IACL,WAAA,EAAa,WAAA,EAAa,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA;AAAA,IAC5C,WAAA,EAAa,8BAAA,CAA+B,qBAAA,EAAuB,SAAS,CAAA;AAAA,IAC5E,YAAA;AAAA,IACA;AAAA,GACF;AACF;AAEO,SAAS,uCAAuC,iBAAA,EAA+D;AACpH,EAAA,OAAO;AAAA;AAAA,IAEL,CAACA,qBAAU,GAAG,SAAA;AAAA,IACd,CAACC,qBAAU,GAAG,iBAAA,CAAkB,WAAA;AAAA,IAChC,CAACC,sBAAW,GAAG,iBAAA,CAAkB,WAAA;AAAA,IACjC,CAACC,uBAAY,GAAG,iBAAA,CAAkB;AAAA,GACpC;AACF;;;;;;"}
|
|
@@ -18,12 +18,7 @@ function instrumentExpress(options, tracingChannel$1) {
|
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
_isInstrumented = true;
|
|
21
|
-
for (const channelName of [
|
|
22
|
-
channels.CHANNELS.EXPRESS_ROUTE,
|
|
23
|
-
channels.CHANNELS.EXPRESS_USE,
|
|
24
|
-
channels.CHANNELS.ROUTER_ROUTE,
|
|
25
|
-
channels.CHANNELS.ROUTER_USE
|
|
26
|
-
]) {
|
|
21
|
+
for (const channelName of [channels.CHANNELS.EXPRESS_REGISTER, channels.CHANNELS.ROUTER_REGISTER]) {
|
|
27
22
|
tracingChannel$1(channelName).subscribe({
|
|
28
23
|
start: NOOP,
|
|
29
24
|
asyncStart: NOOP,
|
|
@@ -1 +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 [\n CHANNELS.EXPRESS_ROUTE,\n CHANNELS.EXPRESS_USE,\n CHANNELS.ROUTER_ROUTE,\n CHANNELS.ROUTER_USE,\n ]) {\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":["tracingChannel","CHANNELS","DEBUG_BUILD","debug","bindTracingChannelToSpan","setLayerRegisteredPath","getLayerPath","popLayerPath","getActiveSpan","getLayerRegisteredPath","pushLayerPath","getConstructedRoute","getActualMatchedRoute","getIsolationScope","getDefaultIsolationScope","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_OP","HTTP_ROUTE","getRootSpan","spanToJSON","stringMatchesSomePattern"],"mappings":";;;;;;;;;AAqCA,MAAM,MAAA,GAAS,mBAAA;AAKf,MAAM,iBAAA,GAAoB,cAAA;AAC1B,MAAM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ACT;AAQA,SAAS,uBAAuB,KAAA,EAAqB;AACnD,EAAA,MAAM,aAAaV,kBAAA,EAAc;AACjC,EAAA,MAAM,QAAA,GAAW,UAAA,IAAcW,gBAAA,CAAY,UAAU,CAAA;AACrD,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA;AAAA,EACF;AACA,EAAA,IAAIC,gBAAW,QAAQ,CAAA,CAAE,IAAA,CAAKH,iCAA4B,MAAM,aAAA,EAAe;AAC7E,IAAA;AAAA,EACF;AACA,EAAA,QAAA,CAAS,YAAA,CAAaC,uBAAY,KAAK,CAAA;AACzC;AAQA,SAAS,cAAA,CAAe,IAAA,EAAc,IAAA,EAAwB,OAAA,EAA6C;AACzG,EAAA,MAAM,EAAE,YAAA,EAAc,gBAAA,EAAiB,GAAI,OAAA;AAE3C,EAAA,IAAI,MAAM,OAAA,CAAQ,gBAAgB,KAAK,gBAAA,CAAiB,QAAA,CAAS,IAAI,CAAA,EAAG;AACtE,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,IAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,YAAY,CAAA,EAAG;AAChC,IAAA,OAAO,KAAA;AAAA,EACT;AAEA,EAAA,IAAI;AACF,IAAA,OAAOG,6BAAA,CAAyB,IAAA,EAAM,YAAA,EAAc,IAAI,CAAA;AAAA,EAC1D,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF;;;;"}
|
|
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":["tracingChannel","CHANNELS","DEBUG_BUILD","debug","bindTracingChannelToSpan","setLayerRegisteredPath","getLayerPath","popLayerPath","getActiveSpan","getLayerRegisteredPath","pushLayerPath","getConstructedRoute","getActualMatchedRoute","getIsolationScope","getDefaultIsolationScope","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_OP","HTTP_ROUTE","getRootSpan","spanToJSON","stringMatchesSomePattern"],"mappings":";;;;;;;;;AAqCA,MAAM,MAAA,GAAS,mBAAA;AAKf,MAAM,iBAAA,GAAoB,cAAA;AAC1B,MAAM,iBAAA,GAAoB,cAAA;AAE1B,MAAM,OAAO,MAAY;AAAC,CAAA;AAE1B,IAAI,eAAA,GAAkB,KAAA;AAEf,SAAS,iBAAA,CACd,SACAA,gBAAA,EACM;AACN,EAAA,IAAI,eAAA,EAAiB;AACnB,IAAA;AAAA,EACF;AACA,EAAA,eAAA,GAAkB,IAAA;AAMlB,EAAA,KAAA,MAAW,eAAe,CAACC,iBAAA,CAAS,gBAAA,EAAkBA,iBAAA,CAAS,eAAe,CAAA,EAAG;AAC/E,IAAAD,gBAAA,CAA2C,WAAW,EAAE,SAAA,CAAU;AAAA,MAChE,KAAA,EAAO,IAAA;AAAA,MACP,UAAA,EAAY,IAAA;AAAA,MACZ,QAAA,EAAU,IAAA;AAAA,MACV,KAAA,EAAO,IAAA;AAAA,MACP,GAAA,EAAK;AAAA,KACN,CAAA;AAAA,EACH;AAEA,EAAA,KAAA,MAAW,eAAe,CAACC,i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