@depup/sentry__server-utils 10.67.0-depup.0 → 10.68.0-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/build/cjs/integrations/tracing-channel/dataloader.js +17 -7
- package/build/cjs/integrations/tracing-channel/dataloader.js.map +1 -1
- package/build/cjs/integrations/tracing-channel/fastify/index.js +2 -4
- package/build/cjs/integrations/tracing-channel/fastify/index.js.map +1 -1
- package/build/cjs/integrations/tracing-channel/fastify/utils.js.map +1 -1
- package/build/cjs/integrations/tracing-channel/firebase/firestore.js +78 -0
- package/build/cjs/integrations/tracing-channel/firebase/firestore.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/firebase/functions.js +67 -0
- package/build/cjs/integrations/tracing-channel/firebase/functions.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/firebase/index.js +24 -0
- package/build/cjs/integrations/tracing-channel/firebase/index.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/firebase/instrumentation.js +66 -0
- package/build/cjs/integrations/tracing-channel/firebase/instrumentation.js.map +1 -0
- package/build/cjs/orchestrion/bundler/esbuild.js +24 -1
- package/build/cjs/orchestrion/bundler/esbuild.js.map +1 -1
- package/build/cjs/orchestrion/bundler/options.js +16 -2
- package/build/cjs/orchestrion/bundler/options.js.map +1 -1
- package/build/cjs/orchestrion/bundler/rollup.js +11 -1
- package/build/cjs/orchestrion/bundler/rollup.js.map +1 -1
- package/build/cjs/orchestrion/bundler/subscribeInjection.js +40 -0
- package/build/cjs/orchestrion/bundler/subscribeInjection.js.map +1 -0
- package/build/cjs/orchestrion/bundler/vite.js +13 -0
- package/build/cjs/orchestrion/bundler/vite.js.map +1 -1
- package/build/cjs/orchestrion/bundler/webpack.js +32 -1
- package/build/cjs/orchestrion/bundler/webpack.js.map +1 -1
- package/build/cjs/orchestrion/channels.js +0 -4
- package/build/cjs/orchestrion/channels.js.map +1 -1
- package/build/cjs/orchestrion/config/amqplib.js +4 -0
- package/build/cjs/orchestrion/config/amqplib.js.map +1 -1
- package/build/cjs/orchestrion/config/anthropic-ai.js +4 -0
- package/build/cjs/orchestrion/config/anthropic-ai.js.map +1 -1
- package/build/cjs/orchestrion/config/aws-sdk.js +4 -0
- package/build/cjs/orchestrion/config/aws-sdk.js.map +1 -1
- package/build/cjs/orchestrion/config/channel-integration-definitions.js +29 -0
- package/build/cjs/orchestrion/config/channel-integration-definitions.js.map +1 -0
- package/build/cjs/orchestrion/config/dataloader.js +4 -0
- package/build/cjs/orchestrion/config/dataloader.js.map +1 -1
- package/build/cjs/orchestrion/config/express.js +4 -0
- package/build/cjs/orchestrion/config/express.js.map +1 -1
- package/build/cjs/orchestrion/config/firebase.js +79 -2
- package/build/cjs/orchestrion/config/firebase.js.map +1 -1
- package/build/cjs/orchestrion/config/generic-pool.js +4 -0
- package/build/cjs/orchestrion/config/generic-pool.js.map +1 -1
- package/build/cjs/orchestrion/config/google-genai.js +4 -0
- package/build/cjs/orchestrion/config/google-genai.js.map +1 -1
- package/build/cjs/orchestrion/config/graphql.js +4 -0
- package/build/cjs/orchestrion/config/graphql.js.map +1 -1
- package/build/cjs/orchestrion/config/hapi.js +4 -0
- package/build/cjs/orchestrion/config/hapi.js.map +1 -1
- package/build/cjs/orchestrion/config/index.js +33 -5
- package/build/cjs/orchestrion/config/index.js.map +1 -1
- package/build/cjs/orchestrion/config/ioredis.js +4 -0
- package/build/cjs/orchestrion/config/ioredis.js.map +1 -1
- package/build/cjs/orchestrion/config/kafkajs.js +4 -0
- package/build/cjs/orchestrion/config/kafkajs.js.map +1 -1
- package/build/cjs/orchestrion/config/knex.js +4 -0
- package/build/cjs/orchestrion/config/knex.js.map +1 -1
- package/build/cjs/orchestrion/config/koa.js +4 -0
- package/build/cjs/orchestrion/config/koa.js.map +1 -1
- package/build/cjs/orchestrion/config/langchain.js +4 -0
- package/build/cjs/orchestrion/config/langchain.js.map +1 -1
- package/build/cjs/orchestrion/config/langgraph.js +4 -0
- package/build/cjs/orchestrion/config/langgraph.js.map +1 -1
- package/build/cjs/orchestrion/config/lru-memoizer.js +4 -0
- package/build/cjs/orchestrion/config/lru-memoizer.js.map +1 -1
- package/build/cjs/orchestrion/config/mongodb.js +4 -0
- package/build/cjs/orchestrion/config/mongodb.js.map +1 -1
- package/build/cjs/orchestrion/config/mongoose.js +4 -0
- package/build/cjs/orchestrion/config/mongoose.js.map +1 -1
- package/build/cjs/orchestrion/config/mysql.js +4 -0
- package/build/cjs/orchestrion/config/mysql.js.map +1 -1
- package/build/cjs/orchestrion/config/mysql2.js +4 -0
- package/build/cjs/orchestrion/config/mysql2.js.map +1 -1
- package/build/cjs/orchestrion/config/nestjs.js +4 -0
- package/build/cjs/orchestrion/config/nestjs.js.map +1 -1
- package/build/cjs/orchestrion/config/openai.js +4 -0
- package/build/cjs/orchestrion/config/openai.js.map +1 -1
- package/build/cjs/orchestrion/config/pg.js +4 -0
- package/build/cjs/orchestrion/config/pg.js.map +1 -1
- package/build/cjs/orchestrion/config/postgres.js +4 -0
- package/build/cjs/orchestrion/config/postgres.js.map +1 -1
- package/build/cjs/orchestrion/config/redis.js +4 -0
- package/build/cjs/orchestrion/config/redis.js.map +1 -1
- package/build/cjs/orchestrion/config/remix.js +4 -0
- package/build/cjs/orchestrion/config/remix.js.map +1 -1
- package/build/cjs/orchestrion/config/subscribe-injection.js +25 -0
- package/build/cjs/orchestrion/config/subscribe-injection.js.map +1 -0
- package/build/cjs/orchestrion/config/tedious.js +4 -0
- package/build/cjs/orchestrion/config/tedious.js.map +1 -1
- package/build/cjs/orchestrion/config/vercel-ai.js +4 -0
- package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -1
- package/build/cjs/orchestrion/index.js +12 -7
- package/build/cjs/orchestrion/index.js.map +1 -1
- package/build/cjs/orchestrion/registerChannelIntegration.js +13 -0
- package/build/cjs/orchestrion/registerChannelIntegration.js.map +1 -0
- package/build/cjs/vercel-ai/index.js.map +1 -1
- package/build/esm/integrations/tracing-channel/dataloader.js +17 -7
- package/build/esm/integrations/tracing-channel/dataloader.js.map +1 -1
- package/build/esm/integrations/tracing-channel/fastify/index.js +2 -4
- package/build/esm/integrations/tracing-channel/fastify/index.js.map +1 -1
- package/build/esm/integrations/tracing-channel/fastify/utils.js.map +1 -1
- package/build/esm/integrations/tracing-channel/firebase/firestore.js +75 -0
- package/build/esm/integrations/tracing-channel/firebase/firestore.js.map +1 -0
- package/build/esm/integrations/tracing-channel/firebase/functions.js +65 -0
- package/build/esm/integrations/tracing-channel/firebase/functions.js.map +1 -0
- package/build/esm/integrations/tracing-channel/firebase/index.js +22 -0
- package/build/esm/integrations/tracing-channel/firebase/index.js.map +1 -0
- package/build/esm/integrations/tracing-channel/firebase/instrumentation.js +64 -0
- package/build/esm/integrations/tracing-channel/firebase/instrumentation.js.map +1 -0
- package/build/esm/orchestrion/bundler/esbuild.js +25 -2
- package/build/esm/orchestrion/bundler/esbuild.js.map +1 -1
- package/build/esm/orchestrion/bundler/options.js +15 -3
- package/build/esm/orchestrion/bundler/options.js.map +1 -1
- package/build/esm/orchestrion/bundler/rollup.js +12 -2
- package/build/esm/orchestrion/bundler/rollup.js.map +1 -1
- package/build/esm/orchestrion/bundler/subscribeInjection.js +38 -0
- package/build/esm/orchestrion/bundler/subscribeInjection.js.map +1 -0
- package/build/esm/orchestrion/bundler/vite.js +14 -1
- package/build/esm/orchestrion/bundler/vite.js.map +1 -1
- package/build/esm/orchestrion/bundler/webpack.js +33 -3
- package/build/esm/orchestrion/bundler/webpack.js.map +1 -1
- package/build/esm/orchestrion/channels.js +0 -4
- package/build/esm/orchestrion/channels.js.map +1 -1
- package/build/esm/orchestrion/config/amqplib.js +4 -1
- package/build/esm/orchestrion/config/amqplib.js.map +1 -1
- package/build/esm/orchestrion/config/anthropic-ai.js +4 -1
- package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -1
- package/build/esm/orchestrion/config/aws-sdk.js +4 -1
- package/build/esm/orchestrion/config/aws-sdk.js.map +1 -1
- package/build/esm/orchestrion/config/channel-integration-definitions.js +26 -0
- package/build/esm/orchestrion/config/channel-integration-definitions.js.map +1 -0
- package/build/esm/orchestrion/config/dataloader.js +4 -1
- package/build/esm/orchestrion/config/dataloader.js.map +1 -1
- package/build/esm/orchestrion/config/express.js +4 -1
- package/build/esm/orchestrion/config/express.js.map +1 -1
- package/build/esm/orchestrion/config/firebase.js +79 -3
- package/build/esm/orchestrion/config/firebase.js.map +1 -1
- package/build/esm/orchestrion/config/generic-pool.js +4 -1
- package/build/esm/orchestrion/config/generic-pool.js.map +1 -1
- package/build/esm/orchestrion/config/google-genai.js +4 -1
- package/build/esm/orchestrion/config/google-genai.js.map +1 -1
- package/build/esm/orchestrion/config/graphql.js +4 -1
- package/build/esm/orchestrion/config/graphql.js.map +1 -1
- package/build/esm/orchestrion/config/hapi.js +4 -1
- package/build/esm/orchestrion/config/hapi.js.map +1 -1
- package/build/esm/orchestrion/config/index.js +61 -34
- package/build/esm/orchestrion/config/index.js.map +1 -1
- package/build/esm/orchestrion/config/ioredis.js +4 -1
- package/build/esm/orchestrion/config/ioredis.js.map +1 -1
- package/build/esm/orchestrion/config/kafkajs.js +4 -1
- package/build/esm/orchestrion/config/kafkajs.js.map +1 -1
- package/build/esm/orchestrion/config/knex.js +4 -1
- package/build/esm/orchestrion/config/knex.js.map +1 -1
- package/build/esm/orchestrion/config/koa.js +4 -1
- package/build/esm/orchestrion/config/koa.js.map +1 -1
- package/build/esm/orchestrion/config/langchain.js +4 -1
- package/build/esm/orchestrion/config/langchain.js.map +1 -1
- package/build/esm/orchestrion/config/langgraph.js +4 -1
- package/build/esm/orchestrion/config/langgraph.js.map +1 -1
- package/build/esm/orchestrion/config/lru-memoizer.js +4 -1
- package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -1
- package/build/esm/orchestrion/config/mongodb.js +4 -1
- package/build/esm/orchestrion/config/mongodb.js.map +1 -1
- package/build/esm/orchestrion/config/mongoose.js +4 -1
- package/build/esm/orchestrion/config/mongoose.js.map +1 -1
- package/build/esm/orchestrion/config/mysql.js +4 -1
- package/build/esm/orchestrion/config/mysql.js.map +1 -1
- package/build/esm/orchestrion/config/mysql2.js +4 -1
- package/build/esm/orchestrion/config/mysql2.js.map +1 -1
- package/build/esm/orchestrion/config/nestjs.js +4 -1
- package/build/esm/orchestrion/config/nestjs.js.map +1 -1
- package/build/esm/orchestrion/config/openai.js +4 -1
- package/build/esm/orchestrion/config/openai.js.map +1 -1
- package/build/esm/orchestrion/config/pg.js +4 -1
- package/build/esm/orchestrion/config/pg.js.map +1 -1
- package/build/esm/orchestrion/config/postgres.js +4 -1
- package/build/esm/orchestrion/config/postgres.js.map +1 -1
- package/build/esm/orchestrion/config/redis.js +4 -1
- package/build/esm/orchestrion/config/redis.js.map +1 -1
- package/build/esm/orchestrion/config/remix.js +4 -1
- package/build/esm/orchestrion/config/remix.js.map +1 -1
- package/build/esm/orchestrion/config/subscribe-injection.js +22 -0
- package/build/esm/orchestrion/config/subscribe-injection.js.map +1 -0
- package/build/esm/orchestrion/config/tedious.js +4 -1
- package/build/esm/orchestrion/config/tedious.js.map +1 -1
- package/build/esm/orchestrion/config/vercel-ai.js +4 -1
- package/build/esm/orchestrion/config/vercel-ai.js.map +1 -1
- package/build/esm/orchestrion/index.js +5 -2
- package/build/esm/orchestrion/index.js.map +1 -1
- package/build/esm/orchestrion/registerChannelIntegration.js +11 -0
- package/build/esm/orchestrion/registerChannelIntegration.js.map +1 -0
- package/build/esm/package.json +1 -1
- package/build/esm/vercel-ai/index.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/tracing-channel/dataloader.d.ts.map +1 -1
- package/build/types/integrations/tracing-channel/fastify/index.d.ts +2 -2
- package/build/types/integrations/tracing-channel/fastify/index.d.ts.map +1 -1
- package/build/types/integrations/tracing-channel/fastify/utils.d.ts +1 -1
- package/build/types/integrations/tracing-channel/fastify/utils.d.ts.map +1 -1
- package/build/types/integrations/tracing-channel/firebase/firestore-types.d.ts +38 -0
- package/build/types/integrations/tracing-channel/firebase/firestore-types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/firebase/firestore.d.ts +18 -0
- package/build/types/integrations/tracing-channel/firebase/firestore.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/firebase/functions.d.ts +15 -0
- package/build/types/integrations/tracing-channel/firebase/functions.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/firebase/index.d.ts +15 -0
- package/build/types/integrations/tracing-channel/firebase/index.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/firebase/instrumentation.d.ts +2 -0
- package/build/types/integrations/tracing-channel/firebase/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/vercel-ai.d.ts +1 -5
- package/build/types/integrations/tracing-channel/vercel-ai.d.ts.map +1 -1
- package/build/types/orchestrion/bundler/esbuild.d.ts +2 -3
- package/build/types/orchestrion/bundler/esbuild.d.ts.map +1 -1
- package/build/types/orchestrion/bundler/options.d.ts +34 -0
- package/build/types/orchestrion/bundler/options.d.ts.map +1 -1
- package/build/types/orchestrion/bundler/rollup.d.ts.map +1 -1
- package/build/types/orchestrion/bundler/subscribeInjection.d.ts +13 -0
- package/build/types/orchestrion/bundler/subscribeInjection.d.ts.map +1 -0
- package/build/types/orchestrion/bundler/vite.d.ts.map +1 -1
- package/build/types/orchestrion/bundler/webpack.d.ts +6 -1
- package/build/types/orchestrion/bundler/webpack.d.ts.map +1 -1
- package/build/types/orchestrion/channels.d.ts +15 -0
- package/build/types/orchestrion/channels.d.ts.map +1 -1
- package/build/types/orchestrion/config/amqplib.d.ts +2 -0
- package/build/types/orchestrion/config/amqplib.d.ts.map +1 -1
- package/build/types/orchestrion/config/anthropic-ai.d.ts +2 -0
- package/build/types/orchestrion/config/anthropic-ai.d.ts.map +1 -1
- package/build/types/orchestrion/config/aws-sdk.d.ts +2 -0
- package/build/types/orchestrion/config/aws-sdk.d.ts.map +1 -1
- package/build/types/orchestrion/config/channel-integration-definitions.d.ts +81 -0
- package/build/types/orchestrion/config/channel-integration-definitions.d.ts.map +1 -0
- package/build/types/orchestrion/config/dataloader.d.ts +2 -0
- package/build/types/orchestrion/config/dataloader.d.ts.map +1 -1
- package/build/types/orchestrion/config/express.d.ts +2 -0
- package/build/types/orchestrion/config/express.d.ts.map +1 -1
- package/build/types/orchestrion/config/firebase.d.ts +41 -2
- package/build/types/orchestrion/config/firebase.d.ts.map +1 -1
- package/build/types/orchestrion/config/generic-pool.d.ts +2 -0
- package/build/types/orchestrion/config/generic-pool.d.ts.map +1 -1
- package/build/types/orchestrion/config/google-genai.d.ts +2 -0
- package/build/types/orchestrion/config/google-genai.d.ts.map +1 -1
- package/build/types/orchestrion/config/graphql.d.ts +2 -0
- package/build/types/orchestrion/config/graphql.d.ts.map +1 -1
- package/build/types/orchestrion/config/hapi.d.ts +2 -0
- package/build/types/orchestrion/config/hapi.d.ts.map +1 -1
- package/build/types/orchestrion/config/index.d.ts +12 -0
- package/build/types/orchestrion/config/index.d.ts.map +1 -1
- package/build/types/orchestrion/config/ioredis.d.ts +1 -0
- package/build/types/orchestrion/config/ioredis.d.ts.map +1 -1
- package/build/types/orchestrion/config/kafkajs.d.ts +2 -0
- package/build/types/orchestrion/config/kafkajs.d.ts.map +1 -1
- package/build/types/orchestrion/config/knex.d.ts +1 -0
- package/build/types/orchestrion/config/knex.d.ts.map +1 -1
- package/build/types/orchestrion/config/koa.d.ts +2 -0
- package/build/types/orchestrion/config/koa.d.ts.map +1 -1
- package/build/types/orchestrion/config/langchain.d.ts +2 -0
- package/build/types/orchestrion/config/langchain.d.ts.map +1 -1
- package/build/types/orchestrion/config/langgraph.d.ts +2 -0
- package/build/types/orchestrion/config/langgraph.d.ts.map +1 -1
- package/build/types/orchestrion/config/lru-memoizer.d.ts +2 -0
- package/build/types/orchestrion/config/lru-memoizer.d.ts.map +1 -1
- package/build/types/orchestrion/config/mongodb.d.ts +2 -0
- package/build/types/orchestrion/config/mongodb.d.ts.map +1 -1
- package/build/types/orchestrion/config/mongoose.d.ts +2 -0
- package/build/types/orchestrion/config/mongoose.d.ts.map +1 -1
- package/build/types/orchestrion/config/mysql.d.ts +2 -0
- package/build/types/orchestrion/config/mysql.d.ts.map +1 -1
- package/build/types/orchestrion/config/mysql2.d.ts +2 -0
- package/build/types/orchestrion/config/mysql2.d.ts.map +1 -1
- package/build/types/orchestrion/config/nestjs.d.ts +1 -0
- package/build/types/orchestrion/config/nestjs.d.ts.map +1 -1
- package/build/types/orchestrion/config/openai.d.ts +2 -0
- package/build/types/orchestrion/config/openai.d.ts.map +1 -1
- package/build/types/orchestrion/config/pg.d.ts +2 -0
- package/build/types/orchestrion/config/pg.d.ts.map +1 -1
- package/build/types/orchestrion/config/postgres.d.ts +1 -0
- package/build/types/orchestrion/config/postgres.d.ts.map +1 -1
- package/build/types/orchestrion/config/redis.d.ts +2 -0
- package/build/types/orchestrion/config/redis.d.ts.map +1 -1
- package/build/types/orchestrion/config/remix.d.ts +1 -0
- package/build/types/orchestrion/config/remix.d.ts.map +1 -1
- package/build/types/orchestrion/config/subscribe-injection.d.ts +31 -0
- package/build/types/orchestrion/config/subscribe-injection.d.ts.map +1 -0
- package/build/types/orchestrion/config/tedious.d.ts +1 -0
- package/build/types/orchestrion/config/tedious.d.ts.map +1 -1
- package/build/types/orchestrion/config/vercel-ai.d.ts +1 -0
- package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -1
- package/build/types/orchestrion/index.d.ts +7 -6
- package/build/types/orchestrion/index.d.ts.map +1 -1
- package/build/types/orchestrion/registerChannelIntegration.d.ts +33 -0
- package/build/types/orchestrion/registerChannelIntegration.d.ts.map +1 -0
- package/build/types/vercel-ai/index.d.ts +2 -3
- package/build/types/vercel-ai/index.d.ts.map +1 -1
- package/build/types-ts3.8/index.d.ts +1 -1
- package/build/types-ts3.8/integrations/tracing-channel/fastify/index.d.ts +2 -2
- package/build/types-ts3.8/integrations/tracing-channel/fastify/utils.d.ts +1 -1
- package/build/types-ts3.8/integrations/tracing-channel/firebase/firestore-types.d.ts +38 -0
- package/build/types-ts3.8/integrations/tracing-channel/firebase/firestore.d.ts +18 -0
- package/build/types-ts3.8/integrations/tracing-channel/firebase/functions.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing-channel/firebase/index.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing-channel/firebase/instrumentation.d.ts +2 -0
- package/build/types-ts3.8/integrations/tracing-channel/vercel-ai.d.ts +1 -5
- package/build/types-ts3.8/orchestrion/bundler/esbuild.d.ts +2 -3
- package/build/types-ts3.8/orchestrion/bundler/options.d.ts +34 -0
- package/build/types-ts3.8/orchestrion/bundler/subscribeInjection.d.ts +13 -0
- package/build/types-ts3.8/orchestrion/bundler/webpack.d.ts +6 -1
- package/build/types-ts3.8/orchestrion/channels.d.ts +15 -0
- package/build/types-ts3.8/orchestrion/config/amqplib.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/anthropic-ai.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/aws-sdk.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/channel-integration-definitions.d.ts +139 -0
- package/build/types-ts3.8/orchestrion/config/dataloader.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/express.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/firebase.d.ts +41 -2
- package/build/types-ts3.8/orchestrion/config/generic-pool.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/google-genai.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/graphql.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/hapi.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/index.d.ts +12 -0
- package/build/types-ts3.8/orchestrion/config/ioredis.d.ts +1 -0
- package/build/types-ts3.8/orchestrion/config/kafkajs.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/knex.d.ts +1 -0
- package/build/types-ts3.8/orchestrion/config/koa.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/langchain.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/langgraph.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/lru-memoizer.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/mongodb.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/mongoose.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/mysql.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/mysql2.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/nestjs.d.ts +1 -0
- package/build/types-ts3.8/orchestrion/config/openai.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/pg.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/postgres.d.ts +1 -0
- package/build/types-ts3.8/orchestrion/config/redis.d.ts +2 -0
- package/build/types-ts3.8/orchestrion/config/remix.d.ts +1 -0
- package/build/types-ts3.8/orchestrion/config/subscribe-injection.d.ts +31 -0
- package/build/types-ts3.8/orchestrion/config/tedious.d.ts +1 -0
- package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +1 -0
- package/build/types-ts3.8/orchestrion/index.d.ts +7 -6
- package/build/types-ts3.8/orchestrion/registerChannelIntegration.d.ts +33 -0
- package/build/types-ts3.8/vercel-ai/index.d.ts +2 -3
- package/changes.json +7 -3
- package/package.json +11 -6
- package/build/cjs/orchestrion/config/prisma.js +0 -8
- package/build/cjs/orchestrion/config/prisma.js.map +0 -1
- package/build/cjs/orchestrion/config/react-router.js +0 -8
- package/build/cjs/orchestrion/config/react-router.js.map +0 -1
- package/build/esm/orchestrion/config/prisma.js +0 -5
- package/build/esm/orchestrion/config/prisma.js.map +0 -1
- package/build/esm/orchestrion/config/react-router.js +0 -5
- package/build/esm/orchestrion/config/react-router.js.map +0 -1
- package/build/types/orchestrion/config/prisma.d.ts +0 -4
- package/build/types/orchestrion/config/prisma.d.ts.map +0 -1
- package/build/types/orchestrion/config/react-router.d.ts +0 -4
- package/build/types/orchestrion/config/react-router.d.ts.map +0 -1
- package/build/types-ts3.8/orchestrion/config/prisma.d.ts +0 -4
- package/build/types-ts3.8/orchestrion/config/react-router.d.ts +0 -4
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
+
const subscribeInjection = require('./subscribe-injection.js');
|
|
4
|
+
|
|
3
5
|
const vercelAiConfig = [
|
|
4
6
|
// Vercel AI v6: mirror the v7 native `ai:telemetry` channel by injecting
|
|
5
7
|
// channels into the top-level entry points. `resolveLanguageModel` is wrapped
|
|
@@ -42,7 +44,9 @@ function vercelAiEntries(versionRange, channelName, functionName, kind) {
|
|
|
42
44
|
functionQuery: { functionName, kind }
|
|
43
45
|
}));
|
|
44
46
|
}
|
|
47
|
+
const vercelAiSubscribeInjection = subscribeInjection.toSubscribeInjections(vercelAiConfig);
|
|
45
48
|
|
|
46
49
|
exports.vercelAiChannels = vercelAiChannels;
|
|
47
50
|
exports.vercelAiConfig = vercelAiConfig;
|
|
51
|
+
exports.vercelAiSubscribeInjection = vercelAiSubscribeInjection;
|
|
48
52
|
//# sourceMappingURL=vercel-ai.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vercel-ai.js","sources":["../../../../src/orchestrion/config/vercel-ai.ts"],"sourcesContent":["import type { InstrumentationConfig } from '..';\n\nexport const vercelAiConfig = [\n // Vercel AI v6: mirror the v7 native `ai:telemetry` channel by injecting\n // channels into the top-level entry points. `resolveLanguageModel` is wrapped\n // not to span it, but so the subscriber can monkey-patch `doGenerate`/\n // `doStream` on the returned model (the only way to span the model call,\n // which is an inline call with no injectable definition in `ai`).\n // `streamText` returns its result synchronously (streaming is lazy), so it's\n // `Sync`; the subscriber binds the span via `bindTracingChannelToSpan`, which\n // ends it when the (synchronous) call returns.\n\n // The majority of entrypoints are present in all versions we support\n ...vercelAiEntries('>=4.0.0 <7.0.0', 'generateText', 'generateText', 'Async'),\n ...vercelAiEntries('>=4.0.0 <7.0.0', 'streamText', 'streamText', 'Sync'),\n ...vercelAiEntries('>=4.0.0 <7.0.0', 'generateObject', 'generateObject', 'Async'),\n ...vercelAiEntries('>=4.0.0 <7.0.0', 'embed', 'embed', 'Async'),\n ...vercelAiEntries('>=4.0.0 <7.0.0', 'embedMany', 'embedMany', 'Async'),\n\n // The following entry is only present in v5 and later\n ...vercelAiEntries('>=5.0.0 <7.0.0', 'resolveLanguageModel', 'resolveLanguageModel', 'Sync'),\n\n // The following entry is only present in v6 and later\n ...vercelAiEntries('>=6.0.0 <7.0.0', 'executeToolCall', 'executeToolCall', 'Async'),\n] satisfies InstrumentationConfig[];\n\nexport const vercelAiChannels = {\n // Vercel AI (`ai`): orchestrion injects these so the same channel-based\n // integration that consumes `ai`'s native `ai:telemetry` channel (v7) can\n // also instrument v4/v5/v6. Each maps to a top-level function in `ai`'s bundle.\n // All three versions share the same channel names (the subscriber is version-agnostic);\n // `VERCEL_AI_EXECUTE_TOOL_CALL` is v6-only (v4/v5 have no `executeToolCall` export) and\n // `VERCEL_AI_RESOLVE_LANGUAGE_MODEL` is v5/v6-only (v4 has no such chokepoint).\n VERCEL_AI_GENERATE_TEXT: 'orchestrion:ai:generateText',\n VERCEL_AI_STREAM_TEXT: 'orchestrion:ai:streamText',\n VERCEL_AI_GENERATE_OBJECT: 'orchestrion:ai:generateObject',\n VERCEL_AI_EMBED: 'orchestrion:ai:embed',\n VERCEL_AI_EMBED_MANY: 'orchestrion:ai:embedMany',\n VERCEL_AI_EXECUTE_TOOL_CALL: 'orchestrion:ai:executeToolCall',\n VERCEL_AI_RESOLVE_LANGUAGE_MODEL: 'orchestrion:ai:resolveLanguageModel',\n} as const;\n\n/**\n * The central list of channel injections orchestrion should perform.\n *\n * This module has NO side effects — it's the only thing both the runtime hook\n * (`runtime/import-hook.mjs`) and the bundler plugins (`bundler/vite.ts`, …)\n * import from. Adding a new instrumented method is one entry here plus one\n * subscriber in `integrations/<lib>/tracing-channel.ts`.\n *\n * `channelName` here is the unprefixed suffix; the actual diagnostics_channel\n * name is `orchestrion:${module.name}:${channelName}` (see `channels.ts`).\n */\n/**\n * `ai` ships a single bundled entry per module system, so each instrumented\n * function needs one config entry per file (the app loads whichever matches its\n * module system). This expands a single target into both.\n */\nfunction vercelAiEntries(\n versionRange: string,\n channelName: string,\n functionName: string,\n kind: 'Async' | 'Sync',\n): InstrumentationConfig[] {\n return ['dist/index.js', 'dist/index.mjs'].map(filePath => ({\n channelName,\n module: { name: 'ai', versionRange, filePath },\n functionQuery: { functionName, kind },\n }));\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vercel-ai.js","sources":["../../../../src/orchestrion/config/vercel-ai.ts"],"sourcesContent":["import type { InstrumentationConfig } from '..';\nimport { toSubscribeInjections } from './subscribe-injection';\n\nexport const vercelAiConfig = [\n // Vercel AI v6: mirror the v7 native `ai:telemetry` channel by injecting\n // channels into the top-level entry points. `resolveLanguageModel` is wrapped\n // not to span it, but so the subscriber can monkey-patch `doGenerate`/\n // `doStream` on the returned model (the only way to span the model call,\n // which is an inline call with no injectable definition in `ai`).\n // `streamText` returns its result synchronously (streaming is lazy), so it's\n // `Sync`; the subscriber binds the span via `bindTracingChannelToSpan`, which\n // ends it when the (synchronous) call returns.\n\n // The majority of entrypoints are present in all versions we support\n ...vercelAiEntries('>=4.0.0 <7.0.0', 'generateText', 'generateText', 'Async'),\n ...vercelAiEntries('>=4.0.0 <7.0.0', 'streamText', 'streamText', 'Sync'),\n ...vercelAiEntries('>=4.0.0 <7.0.0', 'generateObject', 'generateObject', 'Async'),\n ...vercelAiEntries('>=4.0.0 <7.0.0', 'embed', 'embed', 'Async'),\n ...vercelAiEntries('>=4.0.0 <7.0.0', 'embedMany', 'embedMany', 'Async'),\n\n // The following entry is only present in v5 and later\n ...vercelAiEntries('>=5.0.0 <7.0.0', 'resolveLanguageModel', 'resolveLanguageModel', 'Sync'),\n\n // The following entry is only present in v6 and later\n ...vercelAiEntries('>=6.0.0 <7.0.0', 'executeToolCall', 'executeToolCall', 'Async'),\n] satisfies InstrumentationConfig[];\n\nexport const vercelAiChannels = {\n // Vercel AI (`ai`): orchestrion injects these so the same channel-based\n // integration that consumes `ai`'s native `ai:telemetry` channel (v7) can\n // also instrument v4/v5/v6. Each maps to a top-level function in `ai`'s bundle.\n // All three versions share the same channel names (the subscriber is version-agnostic);\n // `VERCEL_AI_EXECUTE_TOOL_CALL` is v6-only (v4/v5 have no `executeToolCall` export) and\n // `VERCEL_AI_RESOLVE_LANGUAGE_MODEL` is v5/v6-only (v4 has no such chokepoint).\n VERCEL_AI_GENERATE_TEXT: 'orchestrion:ai:generateText',\n VERCEL_AI_STREAM_TEXT: 'orchestrion:ai:streamText',\n VERCEL_AI_GENERATE_OBJECT: 'orchestrion:ai:generateObject',\n VERCEL_AI_EMBED: 'orchestrion:ai:embed',\n VERCEL_AI_EMBED_MANY: 'orchestrion:ai:embedMany',\n VERCEL_AI_EXECUTE_TOOL_CALL: 'orchestrion:ai:executeToolCall',\n VERCEL_AI_RESOLVE_LANGUAGE_MODEL: 'orchestrion:ai:resolveLanguageModel',\n} as const;\n\n/**\n * The central list of channel injections orchestrion should perform.\n *\n * This module has NO side effects — it's the only thing both the runtime hook\n * (`runtime/import-hook.mjs`) and the bundler plugins (`bundler/vite.ts`, …)\n * import from. Adding a new instrumented method is one entry here plus one\n * subscriber in `integrations/<lib>/tracing-channel.ts`.\n *\n * `channelName` here is the unprefixed suffix; the actual diagnostics_channel\n * name is `orchestrion:${module.name}:${channelName}` (see `channels.ts`).\n */\n/**\n * `ai` ships a single bundled entry per module system, so each instrumented\n * function needs one config entry per file (the app loads whichever matches its\n * module system). This expands a single target into both.\n */\nfunction vercelAiEntries(\n versionRange: string,\n channelName: string,\n functionName: string,\n kind: 'Async' | 'Sync',\n): InstrumentationConfig[] {\n return ['dist/index.js', 'dist/index.mjs'].map(filePath => ({\n channelName,\n module: { name: 'ai', versionRange, filePath },\n functionQuery: { functionName, kind },\n }));\n}\n\nexport const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AAA,EAAM,cAAc,QAAA,EAAS;AAAA,IAC7C,aAAA,EAAe,EAAE,YAAA,EAAc,IAAA;AAAK,GACtC,CAAE,CAAA;AACJ;AAEO,MAAM,0BAAA,GAA6BA,yCAAsB,cAAc;;;;;;"}
|
|
@@ -6,11 +6,11 @@ const index = require('../integrations/tracing-channel/aws-sdk/index.js');
|
|
|
6
6
|
const dataloader = require('../integrations/tracing-channel/dataloader.js');
|
|
7
7
|
const genericPool = require('../integrations/tracing-channel/generic-pool.js');
|
|
8
8
|
const googleGenai = require('../integrations/tracing-channel/google-genai.js');
|
|
9
|
-
const index$
|
|
9
|
+
const index$3 = require('../integrations/tracing-channel/graphql/index.js');
|
|
10
10
|
const hapi = require('../integrations/tracing-channel/hapi.js');
|
|
11
11
|
const koa = require('../integrations/tracing-channel/koa.js');
|
|
12
12
|
const ioredis = require('../integrations/tracing-channel/ioredis.js');
|
|
13
|
-
const index$
|
|
13
|
+
const index$4 = require('../integrations/tracing-channel/kafkajs/index.js');
|
|
14
14
|
const knex = require('../integrations/tracing-channel/knex.js');
|
|
15
15
|
const langchain = require('../integrations/tracing-channel/langchain.js');
|
|
16
16
|
const langgraph = require('../integrations/tracing-channel/langgraph.js');
|
|
@@ -25,7 +25,9 @@ const postgresJs = require('../integrations/tracing-channel/postgres-js.js');
|
|
|
25
25
|
const tedious = require('../integrations/tracing-channel/tedious.js');
|
|
26
26
|
const vercelAi = require('../integrations/tracing-channel/vercel-ai.js');
|
|
27
27
|
const index$1 = require('../integrations/tracing-channel/express/index.js');
|
|
28
|
+
const index$2 = require('../integrations/tracing-channel/firebase/index.js');
|
|
28
29
|
const detect = require('./detect.js');
|
|
30
|
+
const registerChannelIntegration = require('./registerChannelIntegration.js');
|
|
29
31
|
const nestjs = require('./config/nestjs.js');
|
|
30
32
|
const remix = require('./config/remix.js');
|
|
31
33
|
const redis = require('../integrations/tracing-channel/redis.js');
|
|
@@ -49,10 +51,11 @@ const channelIntegrations = {
|
|
|
49
51
|
hapiIntegration: hapi.hapiChannelIntegration,
|
|
50
52
|
koaIntegration: koa.koaChannelIntegration,
|
|
51
53
|
expressIntegration: index$1.expressChannelIntegration,
|
|
52
|
-
graphqlIntegration: index$
|
|
53
|
-
kafkajsIntegration: index$
|
|
54
|
+
graphqlIntegration: index$3.graphqlDiagnosticsChannelIntegration,
|
|
55
|
+
kafkajsIntegration: index$4.kafkajsChannelIntegration,
|
|
54
56
|
tediousIntegration: tedious.tediousChannelIntegration,
|
|
55
|
-
awsIntegration: index.awsChannelIntegration
|
|
57
|
+
awsIntegration: index.awsChannelIntegration,
|
|
58
|
+
firebaseIntegration: index$2.firebaseChannelIntegration
|
|
56
59
|
};
|
|
57
60
|
|
|
58
61
|
exports.amqplibChannelIntegration = amqplib.amqplibChannelIntegration;
|
|
@@ -61,11 +64,11 @@ exports.awsChannelIntegration = index.awsChannelIntegration;
|
|
|
61
64
|
exports.dataloaderChannelIntegration = dataloader.dataloaderChannelIntegration;
|
|
62
65
|
exports.genericPoolChannelIntegration = genericPool.genericPoolChannelIntegration;
|
|
63
66
|
exports.googleGenAIChannelIntegration = googleGenai.googleGenAIChannelIntegration;
|
|
64
|
-
exports.graphqlChannelIntegration = index$
|
|
67
|
+
exports.graphqlChannelIntegration = index$3.graphqlChannelIntegration;
|
|
65
68
|
exports.hapiChannelIntegration = hapi.hapiChannelIntegration;
|
|
66
69
|
exports.koaChannelIntegration = koa.koaChannelIntegration;
|
|
67
70
|
exports.ioredisChannelIntegration = ioredis.ioredisChannelIntegration;
|
|
68
|
-
exports.kafkajsChannelIntegration = index$
|
|
71
|
+
exports.kafkajsChannelIntegration = index$4.kafkajsChannelIntegration;
|
|
69
72
|
exports.knexChannelIntegration = knex.knexChannelIntegration;
|
|
70
73
|
exports.langChainChannelIntegration = langchain.langChainChannelIntegration;
|
|
71
74
|
exports.langGraphChannelIntegration = langgraph.langGraphChannelIntegration;
|
|
@@ -80,8 +83,10 @@ exports.postgresJsChannelIntegration = postgresJs.postgresJsChannelIntegration;
|
|
|
80
83
|
exports.tediousChannelIntegration = tedious.tediousChannelIntegration;
|
|
81
84
|
exports.vercelAiChannelIntegration = vercelAi.vercelAiChannelIntegration;
|
|
82
85
|
exports.expressChannelIntegration = index$1.expressChannelIntegration;
|
|
86
|
+
exports.firebaseChannelIntegration = index$2.firebaseChannelIntegration;
|
|
83
87
|
exports.detectOrchestrionSetup = detect.detectOrchestrionSetup;
|
|
84
88
|
exports.isOrchestrionInjected = detect.isOrchestrionInjected;
|
|
89
|
+
exports.registerOrchestrionChannelIntegration = registerChannelIntegration.registerOrchestrionChannelIntegration;
|
|
85
90
|
exports.nestjsChannels = nestjs.nestjsChannels;
|
|
86
91
|
exports.remixChannels = remix.remixChannels;
|
|
87
92
|
exports.redisChannelIntegration = redis.redisChannelIntegration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/orchestrion/index.ts"],"sourcesContent":["import { amqplibChannelIntegration } from '../integrations/tracing-channel/amqplib';\nimport { anthropicChannelIntegration } from '../integrations/tracing-channel/anthropic';\nimport { awsChannelIntegration } from '../integrations/tracing-channel/aws-sdk';\nimport { dataloaderChannelIntegration } from '../integrations/tracing-channel/dataloader';\nimport { genericPoolChannelIntegration } from '../integrations/tracing-channel/generic-pool';\nimport { googleGenAIChannelIntegration } from '../integrations/tracing-channel/google-genai';\nimport {\n graphqlChannelIntegration,\n graphqlDiagnosticsChannelIntegration,\n} from '../integrations/tracing-channel/graphql';\nimport { hapiChannelIntegration } from '../integrations/tracing-channel/hapi';\nimport { koaChannelIntegration } from '../integrations/tracing-channel/koa';\nimport { ioredisChannelIntegration } from '../integrations/tracing-channel/ioredis';\nimport { kafkajsChannelIntegration } from '../integrations/tracing-channel/kafkajs';\nimport { knexChannelIntegration } from '../integrations/tracing-channel/knex';\nimport { langChainChannelIntegration } from '../integrations/tracing-channel/langchain';\nimport { langGraphChannelIntegration } from '../integrations/tracing-channel/langgraph';\nimport { lruMemoizerChannelIntegration } from '../integrations/tracing-channel/lru-memoizer';\nimport { mongodbChannelIntegration } from '../integrations/tracing-channel/mongodb';\nimport { mongooseChannelIntegration } from '../integrations/tracing-channel/mongoose';\nimport { mysqlChannelIntegration } from '../integrations/tracing-channel/mysql';\nimport { mysql2ChannelIntegration } from '../integrations/tracing-channel/mysql2';\nimport { openaiChannelIntegration } from '../integrations/tracing-channel/openai';\nimport { postgresChannelIntegration } from '../integrations/tracing-channel/postgres';\nimport { postgresJsChannelIntegration } from '../integrations/tracing-channel/postgres-js';\nimport { tediousChannelIntegration } from '../integrations/tracing-channel/tedious';\nimport { vercelAiChannelIntegration } from '../integrations/tracing-channel/vercel-ai';\nimport { expressChannelIntegration } from '../integrations/tracing-channel/express';\n\nexport { detectOrchestrionSetup, isOrchestrionInjected } from './detect';\n// The `@nestjs/*` channel names live here alongside their transform config; the\n// listener that subscribes to them lives in `@sentry/nestjs`, which imports this.\nexport { nestjsChannels } from './config/nestjs';\n// The remix channel names live here alongside their transform config; the\n// listener that subscribes to them lives in `@sentry/remix`, which imports this.\nexport { remixChannels } from './config/remix';\nexport {\n amqplibChannelIntegration,\n anthropicChannelIntegration,\n awsChannelIntegration,\n dataloaderChannelIntegration,\n genericPoolChannelIntegration,\n googleGenAIChannelIntegration,\n graphqlChannelIntegration,\n hapiChannelIntegration,\n koaChannelIntegration,\n ioredisChannelIntegration,\n kafkajsChannelIntegration,\n knexChannelIntegration,\n langChainChannelIntegration,\n langGraphChannelIntegration,\n lruMemoizerChannelIntegration,\n mongodbChannelIntegration,\n mongooseChannelIntegration,\n mysqlChannelIntegration,\n mysql2ChannelIntegration,\n openaiChannelIntegration,\n postgresChannelIntegration,\n postgresJsChannelIntegration,\n tediousChannelIntegration,\n vercelAiChannelIntegration,\n expressChannelIntegration,\n};\nexport type { KoaChannelIntegrationOptions } from '../integrations/tracing-channel/koa';\nexport type { IORedisChannelIntegrationOptions, IORedisResponseHook } from '../integrations/tracing-channel/ioredis';\nexport type { PostgresJsChannelIntegrationOptions } from '../integrations/tracing-channel/postgres-js';\nexport { redisChannelIntegration } from '../integrations/tracing-channel/redis';\nexport type { RedisChannelIntegrationOptions, RedisResponseHook } from '../integrations/tracing-channel/redis';\nexport type { InstrumentationConfig, CustomTransform } from '@apm-js-collab/code-transformer-bundler-plugins/core';\n\n// The structural `graphql` package types are the single source of truth shared with `@sentry/node`'s\n// vendored OTel graphql instrumentation (re-exported from here so the two can't drift).\nexport type * from '../integrations/tracing-channel/graphql/graphql-types';\n\n/**\n * The canonical set of orchestrion diagnostics-channel integrations, keyed by their public\n * (OTel-parity) factory name.\n *\n * Single source of truth: add a new channel integration here and every consumer — the `@sentry/node`\n * opt-in helper (`experimentalUseDiagnosticsChannelInjection`) and its public\n * `diagnosticsChannelInjectionIntegrations()` map — picks it up automatically, so there's no separate\n * list to keep in sync.\n *\n * NOTE: `ioredisChannelIntegration` and `redisChannelIntegration` are intentionally NOT here. They\n * only partially replace the composite OTel `Redis` integration and need the node SDK's redis cache\n * `responseHook` (which can't live in `server-utils`), so `@sentry/node` wires them up separately.\n *\n * Framework SDKs that own their own channel listener (e.g. `@sentry/nestjs`'s `Nest`) are NOT here\n * either: their transform config is still in `SENTRY_INSTRUMENTATIONS`, but the listener lives in\n * their package and picks the channel-vs-OTel path itself at `setupOnce`, so it needs no central swap.\n *\n * NOTE: `dataloaderChannelIntegration` is also NOT here. Everything in this map is auto-appended to\n * the default integrations, but the OTel `Dataloader` integration is opt-in (never a default). Like\n * `@sentry/nestjs`'s `Nest`, its `@sentry/node` factory picks the channel-vs-OTel path itself at\n * `setupOnce` (via `isOrchestrionInjected()`), so there's nothing for the central swap to do.\n */\nexport const channelIntegrations = {\n postgresIntegration: postgresChannelIntegration,\n postgresJsIntegration: postgresJsChannelIntegration,\n mongoIntegration: mongodbChannelIntegration,\n mysqlIntegration: mysqlChannelIntegration,\n mysql2Integration: mysql2ChannelIntegration,\n genericPoolIntegration: genericPoolChannelIntegration,\n mongooseIntegration: mongooseChannelIntegration,\n lruMemoizerIntegration: lruMemoizerChannelIntegration,\n openaiIntegration: openaiChannelIntegration,\n anthropicIntegration: anthropicChannelIntegration,\n googleGenAIIntegration: googleGenAIChannelIntegration,\n langChainIntegration: langChainChannelIntegration,\n langGraphIntegration: langGraphChannelIntegration,\n vercelAiIntegration: vercelAiChannelIntegration,\n amqplibIntegration: amqplibChannelIntegration,\n hapiIntegration: hapiChannelIntegration,\n koaIntegration: koaChannelIntegration,\n expressIntegration: expressChannelIntegration,\n graphqlIntegration: graphqlDiagnosticsChannelIntegration,\n kafkajsIntegration: kafkajsChannelIntegration,\n tediousIntegration: tediousChannelIntegration,\n awsIntegration: awsChannelIntegration,\n} as const;\n"],"names":["postgresChannelIntegration","postgresJsChannelIntegration","mongodbChannelIntegration","mysqlChannelIntegration","mysql2ChannelIntegration","genericPoolChannelIntegration","mongooseChannelIntegration","lruMemoizerChannelIntegration","openaiChannelIntegration","anthropicChannelIntegration","googleGenAIChannelIntegration","langChainChannelIntegration","langGraphChannelIntegration","vercelAiChannelIntegration","amqplibChannelIntegration","hapiChannelIntegration","koaChannelIntegration","expressChannelIntegration","graphqlDiagnosticsChannelIntegration","kafkajsChannelIntegration","tediousChannelIntegration","awsChannelIntegration"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/orchestrion/index.ts"],"sourcesContent":["import { amqplibChannelIntegration } from '../integrations/tracing-channel/amqplib';\nimport { anthropicChannelIntegration } from '../integrations/tracing-channel/anthropic';\nimport { awsChannelIntegration } from '../integrations/tracing-channel/aws-sdk';\nimport { dataloaderChannelIntegration } from '../integrations/tracing-channel/dataloader';\nimport { genericPoolChannelIntegration } from '../integrations/tracing-channel/generic-pool';\nimport { googleGenAIChannelIntegration } from '../integrations/tracing-channel/google-genai';\nimport {\n graphqlChannelIntegration,\n graphqlDiagnosticsChannelIntegration,\n} from '../integrations/tracing-channel/graphql';\nimport { hapiChannelIntegration } from '../integrations/tracing-channel/hapi';\nimport { koaChannelIntegration } from '../integrations/tracing-channel/koa';\nimport { ioredisChannelIntegration } from '../integrations/tracing-channel/ioredis';\nimport { kafkajsChannelIntegration } from '../integrations/tracing-channel/kafkajs';\nimport { knexChannelIntegration } from '../integrations/tracing-channel/knex';\nimport { langChainChannelIntegration } from '../integrations/tracing-channel/langchain';\nimport { langGraphChannelIntegration } from '../integrations/tracing-channel/langgraph';\nimport { lruMemoizerChannelIntegration } from '../integrations/tracing-channel/lru-memoizer';\nimport { mongodbChannelIntegration } from '../integrations/tracing-channel/mongodb';\nimport { mongooseChannelIntegration } from '../integrations/tracing-channel/mongoose';\nimport { mysqlChannelIntegration } from '../integrations/tracing-channel/mysql';\nimport { mysql2ChannelIntegration } from '../integrations/tracing-channel/mysql2';\nimport { openaiChannelIntegration } from '../integrations/tracing-channel/openai';\nimport { postgresChannelIntegration } from '../integrations/tracing-channel/postgres';\nimport { postgresJsChannelIntegration } from '../integrations/tracing-channel/postgres-js';\nimport { tediousChannelIntegration } from '../integrations/tracing-channel/tedious';\nimport { vercelAiChannelIntegration } from '../integrations/tracing-channel/vercel-ai';\nimport { expressChannelIntegration } from '../integrations/tracing-channel/express';\nimport { firebaseChannelIntegration } from '../integrations/tracing-channel/firebase';\n\nexport { detectOrchestrionSetup, isOrchestrionInjected } from './detect';\n// The runtime target of the subscribe-injection snippet: instrumented modules\n// import this to self-register their channel subscriber on the global marker\n// (used by bundler-only SDKs).\nexport { registerOrchestrionChannelIntegration } from './registerChannelIntegration';\n// The `@nestjs/*` channel names live here alongside their transform config; the\n// listener that subscribes to them lives in `@sentry/nestjs`, which imports this.\nexport { nestjsChannels } from './config/nestjs';\n// The remix channel names live here alongside their transform config; the\n// listener that subscribes to them lives in `@sentry/remix`, which imports this.\nexport { remixChannels } from './config/remix';\nexport {\n amqplibChannelIntegration,\n anthropicChannelIntegration,\n awsChannelIntegration,\n dataloaderChannelIntegration,\n genericPoolChannelIntegration,\n googleGenAIChannelIntegration,\n graphqlChannelIntegration,\n hapiChannelIntegration,\n koaChannelIntegration,\n ioredisChannelIntegration,\n kafkajsChannelIntegration,\n knexChannelIntegration,\n langChainChannelIntegration,\n langGraphChannelIntegration,\n lruMemoizerChannelIntegration,\n mongodbChannelIntegration,\n mongooseChannelIntegration,\n mysqlChannelIntegration,\n mysql2ChannelIntegration,\n openaiChannelIntegration,\n postgresChannelIntegration,\n postgresJsChannelIntegration,\n tediousChannelIntegration,\n vercelAiChannelIntegration,\n expressChannelIntegration,\n firebaseChannelIntegration,\n};\nexport type { KoaChannelIntegrationOptions } from '../integrations/tracing-channel/koa';\nexport type { IORedisChannelIntegrationOptions, IORedisResponseHook } from '../integrations/tracing-channel/ioredis';\nexport type { PostgresJsChannelIntegrationOptions } from '../integrations/tracing-channel/postgres-js';\nexport { redisChannelIntegration } from '../integrations/tracing-channel/redis';\nexport type { RedisChannelIntegrationOptions, RedisResponseHook } from '../integrations/tracing-channel/redis';\nexport type { InstrumentationConfig, CustomTransform } from '@apm-js-collab/code-transformer-bundler-plugins/core';\n\n// The structural `graphql` package types are the single source of truth shared with `@sentry/node`'s\n// vendored OTel graphql instrumentation (re-exported from here so the two can't drift).\nexport type * from '../integrations/tracing-channel/graphql/graphql-types';\n\n/**\n * The canonical set of orchestrion diagnostics-channel integrations, keyed by their public\n * (OTel-parity) factory name.\n *\n * Single source of truth: add a new channel integration here and every consumer — the `@sentry/node`\n * opt-in helper (`experimentalUseDiagnosticsChannelInjection`) and its public\n * `diagnosticsChannelInjectionIntegrations()` map — picks it up automatically, so there's no separate\n * list to keep in sync.\n *\n * NOTE: `ioredisChannelIntegration` and `redisChannelIntegration` are intentionally NOT here. They\n * only partially replace the composite OTel `Redis` integration and need the node SDK's redis cache\n * `responseHook` (which can't live in `server-utils`), so `@sentry/node` wires them up separately.\n *\n * Framework SDKs that own their own channel listener (e.g. `@sentry/nestjs`'s `Nest`) are NOT here\n * either: their transform config is still in `SENTRY_INSTRUMENTATIONS`, but the listener lives in\n * their package and picks the channel-vs-OTel path itself at `setupOnce`, so it needs no central swap.\n *\n * NOTE: `dataloaderChannelIntegration` is also NOT here. Everything in this map is auto-appended to\n * the default integrations, but the OTel `Dataloader` integration is opt-in (never a default). Like\n * `@sentry/nestjs`'s `Nest`, its `@sentry/node` factory picks the channel-vs-OTel path itself at\n * `setupOnce` (via `isOrchestrionInjected()`), so there's nothing for the central swap to do.\n */\nexport const channelIntegrations = {\n postgresIntegration: postgresChannelIntegration,\n postgresJsIntegration: postgresJsChannelIntegration,\n mongoIntegration: mongodbChannelIntegration,\n mysqlIntegration: mysqlChannelIntegration,\n mysql2Integration: mysql2ChannelIntegration,\n genericPoolIntegration: genericPoolChannelIntegration,\n mongooseIntegration: mongooseChannelIntegration,\n lruMemoizerIntegration: lruMemoizerChannelIntegration,\n openaiIntegration: openaiChannelIntegration,\n anthropicIntegration: anthropicChannelIntegration,\n googleGenAIIntegration: googleGenAIChannelIntegration,\n langChainIntegration: langChainChannelIntegration,\n langGraphIntegration: langGraphChannelIntegration,\n vercelAiIntegration: vercelAiChannelIntegration,\n amqplibIntegration: amqplibChannelIntegration,\n hapiIntegration: hapiChannelIntegration,\n koaIntegration: koaChannelIntegration,\n expressIntegration: expressChannelIntegration,\n graphqlIntegration: graphqlDiagnosticsChannelIntegration,\n kafkajsIntegration: kafkajsChannelIntegration,\n tediousIntegration: tediousChannelIntegration,\n awsIntegration: awsChannelIntegration,\n firebaseIntegration: firebaseChannelIntegration,\n} as const;\n"],"names":["postgresChannelIntegration","postgresJsChannelIntegration","mongodbChannelIntegration","mysqlChannelIntegration","mysql2ChannelIntegration","genericPoolChannelIntegration","mongooseChannelIntegration","lruMemoizerChannelIntegration","openaiChannelIntegration","anthropicChannelIntegration","googleGenAIChannelIntegration","langChainChannelIntegration","langGraphChannelIntegration","vercelAiChannelIntegration","amqplibChannelIntegration","hapiChannelIntegration","koaChannelIntegration","expressChannelIntegration","graphqlDiagnosticsChannelIntegration","kafkajsChannelIntegration","tediousChannelIntegration","awsChannelIntegration","firebaseChannelIntegration"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsGO,MAAM,mBAAA,GAAsB;AAAA,EACjC,mBAAA,EAAqBA,mCAAA;AAAA,EACrB,qBAAA,EAAuBC,uCAAA;AAAA,EACvB,gBAAA,EAAkBC,iCAAA;AAAA,EAClB,gBAAA,EAAkBC,6BAAA;AAAA,EAClB,iBAAA,EAAmBC,+BAAA;AAAA,EACnB,sBAAA,EAAwBC,yCAAA;AAAA,EACxB,mBAAA,EAAqBC,mCAAA;AAAA,EACrB,sBAAA,EAAwBC,yCAAA;AAAA,EACxB,iBAAA,EAAmBC,+BAAA;AAAA,EACnB,oBAAA,EAAsBC,qCAAA;AAAA,EACtB,sBAAA,EAAwBC,yCAAA;AAAA,EACxB,oBAAA,EAAsBC,qCAAA;AAAA,EACtB,oBAAA,EAAsBC,qCAAA;AAAA,EACtB,mBAAA,EAAqBC,mCAAA;AAAA,EACrB,kBAAA,EAAoBC,iCAAA;AAAA,EACpB,eAAA,EAAiBC,2BAAA;AAAA,EACjB,cAAA,EAAgBC,yBAAA;AAAA,EAChB,kBAAA,EAAoBC,iCAAA;AAAA,EACpB,kBAAA,EAAoBC,4CAAA;AAAA,EACpB,kBAAA,EAAoBC,iCAAA;AAAA,EACpB,kBAAA,EAAoBC,iCAAA;AAAA,EACpB,cAAA,EAAgBC,2BAAA;AAAA,EAChB,mBAAA,EAAqBC;AACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/core');
|
|
4
|
+
|
|
5
|
+
function registerOrchestrionChannelIntegration(name, integrationFn) {
|
|
6
|
+
var _a;
|
|
7
|
+
const marker = (_a = core.GLOBAL_OBJ).__SENTRY_ORCHESTRION__ ?? (_a.__SENTRY_ORCHESTRION__ = {});
|
|
8
|
+
(marker.integrations ?? (marker.integrations = /* @__PURE__ */ new Map())).set(name, integrationFn);
|
|
9
|
+
core.getClient()?.addIntegration(integrationFn());
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.registerOrchestrionChannelIntegration = registerOrchestrionChannelIntegration;
|
|
13
|
+
//# sourceMappingURL=registerChannelIntegration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registerChannelIntegration.js","sources":["../../../src/orchestrion/registerChannelIntegration.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { getClient, GLOBAL_OBJ } from '@sentry/core';\n\n/**\n * Register an orchestrion channel-subscriber integration from an instrumented\n * module. This is the runtime target of the snippet the subscribe-injection\n * transform splices into each transformed package (see\n * `bundler/subscribeInjection.ts`), so a bundler-only SDK (e.g.\n * `@sentry/cloudflare`, running in workerd where requires can't be\n * monkey-patched) wires up subscribers with no runtime module hook.\n *\n * It does two things, covering the two disjoint timing cases:\n *\n * 1. Stores the factory on the global orchestrion marker under `name`, so a\n * later `init()` (a fresh isolate, or a client created after this module\n * loads) picks it up via `getDefaultIntegrations()`.\n * 2. If a client already exists, registers the integration on it right away.\n * This is what makes the mechanism robust against module load order:\n * bundler-only SDKs call `init()` per request, but a package like `mysql`\n * loads its instrumented file lazily on first use, i.e. AFTER that request's\n * `init()` already snapshotted the marker. Without the live add, the first\n * request that touches such a package would publish to a channel nobody\n * subscribed to yet.\n *\n * `addIntegration` dedupes by integration name and only runs `setupOnce` once,\n * so storing AND live-adding never double-subscribes.\n *\n * The marker is a `Map` keyed by `name` (the factory's export name) so a package\n * split across several instrumented files (e.g. `pg`'s JS and native clients, or\n * openai's per-resource `.js`/`.mjs` files) registers its one subscriber once,\n * no matter how many of its files land in the bundle. `.set` on the shared key\n * is idempotent.\n */\nexport function registerOrchestrionChannelIntegration(name: string, integrationFn: () => Integration): void {\n const marker = (GLOBAL_OBJ.__SENTRY_ORCHESTRION__ ??= {});\n (marker.integrations ??= new Map()).set(name, integrationFn);\n getClient()?.addIntegration(integrationFn());\n}\n"],"names":["GLOBAL_OBJ","getClient"],"mappings":";;;;AAiCO,SAAS,qCAAA,CAAsC,MAAc,aAAA,EAAwC;AAjC5G,EAAA,IAAA,EAAA;AAkCE,EAAA,MAAM,MAAA,GAAA,CAAU,EAAA,GAAAA,eAAA,EAAW,sBAAA,KAAX,EAAA,CAAW,yBAA2B,EAAC,CAAA;AACvD,EAAA,CAAC,MAAA,CAAO,iBAAP,MAAA,CAAO,YAAA,uBAAqB,GAAA,EAAI,CAAA,EAAG,GAAA,CAAI,IAAA,EAAM,aAAa,CAAA;AAC3D,EAAAC,cAAA,EAAU,EAAG,cAAA,CAAe,aAAA,EAAe,CAAA;AAC7C;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/vercel-ai/index.ts"],"sourcesContent":["import { defineIntegration, waitForTracingChannelBinding, type IntegrationFn } from '@sentry/core';\nimport { subscribeVercelAiTracingChannel } from './vercel-ai-dc-subscriber';\nimport * as dc from 'node:diagnostics_channel';\n\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/vercel-ai/index.ts"],"sourcesContent":["import { defineIntegration, waitForTracingChannelBinding, type IntegrationFn } from '@sentry/core';\nimport { subscribeVercelAiTracingChannel } from './vercel-ai-dc-subscriber';\nimport * as dc from 'node:diagnostics_channel';\n\nexport interface VercelAiOptions {\n /**\n * Enable or disable input recording. Enabled if `dataCollection.genAI.inputs` (or the deprecated `sendDefaultPii` option) is `true`\n * or if you set `isEnabled` to `true` in your ai SDK method telemetry settings.\n * Integration-level options take precedence over global `dataCollection` config.\n */\n recordInputs?: boolean;\n\n /**\n * Enable or disable output recording. Enabled if `dataCollection.genAI.outputs` (or the deprecated `sendDefaultPii` option) is `true`\n * or if you set `isEnabled` to `true` in your ai SDK method telemetry settings.\n * Integration-level options take precedence over global `dataCollection` config.\n */\n recordOutputs?: boolean;\n\n /**\n * Enable or disable truncation of recorded input messages.\n * Defaults to `true`.\n */\n enableTruncation?: boolean;\n}\n\nconst _vercelAiIntegration = ((options: VercelAiOptions = {}) => {\n return {\n name: 'VercelAI' as const,\n setupOnce() {\n // Bail if this is not available\n if (!dc.tracingChannel) {\n return;\n }\n\n // Subscribe to the `ai` SDK's native telemetry tracing channel (ai >= 7).\n // This is a no-op on versions that don't publish to the channel, so it is always safe to call.\n waitForTracingChannelBinding(() => {\n subscribeVercelAiTracingChannel(dc.tracingChannel, options);\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Auto-instrument the `ai` SDK's native telemetry tracing channel (ai >= 7).\n */\nexport const vercelAiIntegration = defineIntegration(_vercelAiIntegration);\n"],"names":["dc","waitForTracingChannelBinding","subscribeVercelAiTracingChannel","defineIntegration"],"mappings":";;;;;;AA0BA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,UAAA;AAAA,IACN,SAAA,GAAY;AAEV,MAAA,IAAI,CAACA,mBAAG,cAAA,EAAgB;AACtB,QAAA;AAAA,MACF;AAIA,MAAAC,iCAAA,CAA6B,MAAM;AACjC,QAAAC,oDAAA,CAAgCF,kBAAA,CAAG,gBAAgB,OAAO,CAAA;AAAA,MAC5D,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAA,CAAA;AAKO,MAAM,mBAAA,GAAsBG,uBAAkB,oBAAoB;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as diagnosticsChannel from 'node:diagnostics_channel';
|
|
2
|
+
import { CACHE_KEY } from '@sentry/conventions/attributes';
|
|
2
3
|
import { defineIntegration, debug, waitForTracingChannelBinding, startSpan, startInactiveSpan, SPAN_KIND, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
|
|
3
4
|
import { DEBUG_BUILD } from '../../debug-build.js';
|
|
4
5
|
import { CHANNELS } from '../../orchestrion/channels.js';
|
|
@@ -13,7 +14,13 @@ function getSpanName(loader, operation) {
|
|
|
13
14
|
const name = loader?.name;
|
|
14
15
|
return name ? `${MODULE_NAME}.${operation} ${name}` : `${MODULE_NAME}.${operation}`;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function getCacheKey(keyArg) {
|
|
18
|
+
if (Array.isArray(keyArg)) {
|
|
19
|
+
return keyArg.map((key) => String(key));
|
|
20
|
+
}
|
|
21
|
+
return keyArg == null ? void 0 : [String(keyArg)];
|
|
22
|
+
}
|
|
23
|
+
function makeSpanOptions(loader, operation, keyArg) {
|
|
17
24
|
const isCacheGet = operation === "load" || operation === "loadMany" || operation === "batch";
|
|
18
25
|
return {
|
|
19
26
|
name: getSpanName(loader, operation),
|
|
@@ -24,7 +31,8 @@ function makeSpanOptions(loader, operation) {
|
|
|
24
31
|
op: isCacheGet ? CACHE_GET_OP : void 0,
|
|
25
32
|
onlyIfParent: true,
|
|
26
33
|
attributes: {
|
|
27
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
|
|
34
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
|
|
35
|
+
[CACHE_KEY]: isCacheGet ? getCacheKey(keyArg) : void 0
|
|
28
36
|
}
|
|
29
37
|
};
|
|
30
38
|
}
|
|
@@ -57,7 +65,7 @@ function subscribeConstruct() {
|
|
|
57
65
|
const original = batchLoadFn;
|
|
58
66
|
const wrapped = function(...args) {
|
|
59
67
|
return startSpan(
|
|
60
|
-
{ ...makeSpanOptions(this, "batch"), links: this._batch?.spanLinks },
|
|
68
|
+
{ ...makeSpanOptions(this, "batch", args[0]), links: this._batch?.spanLinks },
|
|
61
69
|
() => original.apply(this, args)
|
|
62
70
|
);
|
|
63
71
|
};
|
|
@@ -67,7 +75,9 @@ function subscribeConstruct() {
|
|
|
67
75
|
}
|
|
68
76
|
function subscribeLoad() {
|
|
69
77
|
const channel = diagnosticsChannel.tracingChannel(CHANNELS.DATALOADER_LOAD);
|
|
70
|
-
bindTracingChannelToSpan(channel, (data) => startInactiveSpanFor(data.self, "load"), {
|
|
78
|
+
bindTracingChannelToSpan(channel, (data) => startInactiveSpanFor(data.self, "load", data.arguments[0]), {
|
|
79
|
+
requiresParentSpan: true
|
|
80
|
+
});
|
|
71
81
|
channel.end.subscribe((message) => {
|
|
72
82
|
const data = message;
|
|
73
83
|
const span = data._sentrySpan;
|
|
@@ -80,12 +90,12 @@ function subscribeLoad() {
|
|
|
80
90
|
function subscribeSimpleOperation(channelName, operation) {
|
|
81
91
|
bindTracingChannelToSpan(
|
|
82
92
|
diagnosticsChannel.tracingChannel(channelName),
|
|
83
|
-
(data) => startInactiveSpanFor(data.self, operation),
|
|
93
|
+
(data) => startInactiveSpanFor(data.self, operation, data.arguments[0]),
|
|
84
94
|
{ requiresParentSpan: true }
|
|
85
95
|
);
|
|
86
96
|
}
|
|
87
|
-
function startInactiveSpanFor(loader, operation) {
|
|
88
|
-
return startInactiveSpan(makeSpanOptions(loader, operation));
|
|
97
|
+
function startInactiveSpanFor(loader, operation, keyArg) {
|
|
98
|
+
return startInactiveSpan(makeSpanOptions(loader, operation, keyArg));
|
|
89
99
|
}
|
|
90
100
|
const dataloaderChannelIntegration = defineIntegration(_dataloaderChannelIntegration);
|
|
91
101
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataloader.js","sources":["../../../../src/integrations/tracing-channel/dataloader.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn, Span, StartSpanOptions } from '@sentry/core';\nimport {\n debug,\n defineIntegration,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n startInactiveSpan,\n startSpan,\n waitForTracingChannelBinding,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport type { ChannelName } from '../../orchestrion/channels';\nimport { CHANNELS } from '../../orchestrion/channels';\nimport type { TracingChannelPayloadWithSpan } from '../../tracing-channel';\nimport { bindTracingChannelToSpan } from '../../tracing-channel';\n\n// NOTE: this uses the same name as the OTel integration by design.\n// When enabled, the OTel 'Dataloader' integration is omitted from the default set.\nconst INTEGRATION_NAME = 'Dataloader' as const;\n\nconst MODULE_NAME = 'dataloader';\nconst ORIGIN = 'auto.db.orchestrion.dataloader';\n\n// `load`, `loadMany` and `batch` are cache reads; the rest are cache mutations that get no `op`.\nconst CACHE_GET_OP = 'cache.get';\n\ntype Operation = 'load' | 'loadMany' | 'batch' | 'prime' | 'clear' | 'clearAll';\n\n// The link shape shared between a `load` span and the `batch` span it triggers.\ntype DataLoaderSpanLink = { context: ReturnType<Span['spanContext']> };\n\n// The private batch object `dataloader` stores on the loader. We stash the pending `load` span links\n// here (matching the vendored OTel instrumentation) so the batch span can link back to them.\ninterface DataLoaderBatch {\n spanLinks?: DataLoaderSpanLink[];\n}\n\ninterface DataLoaderInstance {\n name?: string | null;\n _batch?: DataLoaderBatch | null;\n}\n\n/**\n * The shape orchestrion's transform attaches to the tracing-channel `context`. Documented here rather\n * than imported because orchestrion's runtime doesn't export it.\n */\ninterface DataLoaderChannelContext {\n arguments: unknown[];\n self?: DataLoaderInstance;\n result?: unknown;\n error?: unknown;\n}\n\n// Marks a wrapped `batchLoadFn` so a re-used loader (or a double construct) isn't wrapped twice.\nconst WRAPPED = Symbol('sentry.dataloader.wrapped');\n\nfunction getSpanName(loader: DataLoaderInstance | undefined, operation: Operation): string {\n const name = loader?.name;\n\n return name ? `${MODULE_NAME}.${operation} ${name}` : `${MODULE_NAME}.${operation}`;\n}\n\nfunction makeSpanOptions(loader: DataLoaderInstance | undefined, operation: Operation): StartSpanOptions {\n const isCacheGet = operation === 'load' || operation === 'loadMany' || operation === 'batch';\n\n return {\n name: getSpanName(loader, operation),\n // Every direct operation (`load`/`loadMany`/`prime`/`clear`/`clearAll`) is a client call, matching\n // the vendored OTel instrumentation. The `batch` runs off a deferred tick with no obvious network\n // peer, so it gets no kind.\n kind: operation === 'batch' ? undefined : SPAN_KIND.CLIENT,\n op: isCacheGet ? CACHE_GET_OP : undefined,\n onlyIfParent: true,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n },\n };\n}\n\nconst _dataloaderChannelIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // `tracingChannel` is unavailable before Node 18.19 so do nothing in that case.\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n DEBUG_BUILD && debug.log('[orchestrion:dataloader] subscribing to dataloader tracing channels');\n\n waitForTracingChannelBinding(() => {\n subscribeConstruct();\n subscribeLoad();\n subscribeSimpleOperation(CHANNELS.DATALOADER_LOAD_MANY, 'loadMany');\n subscribeSimpleOperation(CHANNELS.DATALOADER_PRIME, 'prime');\n subscribeSimpleOperation(CHANNELS.DATALOADER_CLEAR, 'clear');\n subscribeSimpleOperation(CHANNELS.DATALOADER_CLEAR_ALL, 'clearAll');\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Wraps the user's `batchLoadFn` (constructor arg 0) so the batch span opens when it runs on the\n * deferred dispatch tick. The span links back to the `load` calls that populated the batch.\n */\nfunction subscribeConstruct(): void {\n diagnosticsChannel\n .tracingChannel<DataLoaderChannelContext>(CHANNELS.DATALOADER_CONSTRUCT)\n .start.subscribe(message => {\n const data = message as DataLoaderChannelContext;\n const batchLoadFn = data.arguments[0];\n if (typeof batchLoadFn !== 'function' || (batchLoadFn as { [WRAPPED]?: boolean })[WRAPPED]) {\n return;\n }\n\n const original = batchLoadFn as (...args: unknown[]) => unknown;\n const wrapped = function (this: DataLoaderInstance, ...args: unknown[]): unknown {\n return startSpan({ ...makeSpanOptions(this, 'batch'), links: this._batch?.spanLinks }, () =>\n original.apply(this, args),\n );\n };\n (wrapped as { [WRAPPED]?: boolean })[WRAPPED] = true;\n data.arguments[0] = wrapped;\n });\n}\n\n/**\n * `load` is a cache read that additionally records its span so the batch it feeds into can link back.\n *\n * The span itself is `Async` (ends on `asyncEnd`, so its duration covers the awaited load). But the\n * link has to be recorded earlier, on the synchronous `end` (fired when `load` returns): the batch\n * dispatches on a deferred tick and reads `spanLinks` at batch-span creation, which happens BEFORE\n * `load`'s promise resolves (`asyncEnd`) — so recording at span end would be too late and drop the\n * link. The sync `end` runs after `dataloader` has assigned `this._batch` in `load`'s body and before\n * the deferred dispatch, so the link lands in time.\n */\nfunction subscribeLoad(): void {\n const channel = diagnosticsChannel.tracingChannel<DataLoaderChannelContext>(CHANNELS.DATALOADER_LOAD);\n\n bindTracingChannelToSpan(channel, data => startInactiveSpanFor(data.self, 'load'), { requiresParentSpan: true });\n\n channel.end.subscribe(message => {\n const data = message as TracingChannelPayloadWithSpan<DataLoaderChannelContext>;\n const span = data._sentrySpan;\n const batch = data.self?._batch;\n if (span && batch && span.isRecording()) {\n (batch.spanLinks ??= []).push({ context: span.spanContext() });\n }\n });\n}\n\nfunction subscribeSimpleOperation(channelName: ChannelName, operation: Operation): void {\n bindTracingChannelToSpan(\n diagnosticsChannel.tracingChannel<DataLoaderChannelContext>(channelName),\n data => startInactiveSpanFor(data.self, operation),\n { requiresParentSpan: true },\n );\n}\n\nfunction startInactiveSpanFor(loader: DataLoaderInstance | undefined, operation: Operation): Span {\n return startInactiveSpan(makeSpanOptions(loader, operation));\n}\n\n/**\n * EXPERIMENTAL: orchestrion-driven `dataloader` integration.\n *\n * Subscribes to the `orchestrion:dataloader:*` diagnostics_channels that the orchestrion code\n * transform injects into `dataloader`'s constructor and prototype methods. Requires the orchestrion\n * runtime hook or bundler plugin to be active.\n */\nexport const dataloaderChannelIntegration = defineIntegration(_dataloaderChannelIntegration);\n"],"names":[],"mappings":";;;;;;AAmBA,MAAM,gBAAA,GAAmB,YAAA;AAEzB,MAAM,WAAA,GAAc,YAAA;AACpB,MAAM,MAAA,GAAS,gCAAA;AAGf,MAAM,YAAA,GAAe,WAAA;AA8BrB,MAAM,OAAA,0BAAiB,2BAA2B,CAAA;AAElD,SAAS,WAAA,CAAY,QAAwC,SAAA,EAA8B;AACzF,EAAA,MAAM,O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AClB,IAAA,MAAM,KAAA,GAAQ,KAAK,IAAA,EAAM,MAAA;AACzB,IAAA,IAAI,IAAA,IAAQ,KAAA,IAAS,IAAA,CAAK,WAAA,EAAY,EAAG;AACvC,MAAA,CAAC,KAAA,CAAM,SAAA,KAAN,KAAA,CAAM,SAAA,GAAc,EAAC,CAAA,EAAG,IAAA,CAAK,EAAE,OAAA,EAAS,IAAA,CAAK,WAAA,EAAY,EAAG,CAAA;AAAA,IAC/D;AAAA,EACF,CAAC,CAAA;AACH;AAEA,SAAS,wBAAA,CAAyB,aAA0B,SAAA,EAA4B;AACtF,EAAA,wBAAA;AAAA,IACE,kBAAA,CAAmB,eAAyC,WAAW,CAAA;AAAA,IACvE,CAAA,IAAA,KAAQ,oBAAA,CAAqB,IAAA,CAAK,IAAA,EAAM,SAAS,CAAA;AAAA,IACjD,EAAE,oBAAoB,IAAA;AAAK,GAC7B;AACF;AAEA,SAAS,oBAAA,CAAqB,QAAwC,SAAA,EAA4B;AAChG,EAAA,OAAO,iBAAA,CAAkB,eAAA,CAAgB,MAAA,EAAQ,SAAS,CAAC,CAAA;AAC7D;AASO,MAAM,4BAAA,GAA+B,kBAAkB,6BAA6B;;;;"}
|
|
1
|
+
{"version":3,"file":"dataloader.js","sources":["../../../../src/integrations/tracing-channel/dataloader.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport { CACHE_KEY } from '@sentry/conventions/attributes';\nimport type { IntegrationFn, Span, StartSpanOptions } from '@sentry/core';\nimport {\n debug,\n defineIntegration,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n startInactiveSpan,\n startSpan,\n waitForTracingChannelBinding,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport type { ChannelName } from '../../orchestrion/channels';\nimport { CHANNELS } from '../../orchestrion/channels';\nimport type { TracingChannelPayloadWithSpan } from '../../tracing-channel';\nimport { bindTracingChannelToSpan } from '../../tracing-channel';\n\n// NOTE: this uses the same name as the OTel integration by design.\n// When enabled, the OTel 'Dataloader' integration is omitted from the default set.\nconst INTEGRATION_NAME = 'Dataloader' as const;\n\nconst MODULE_NAME = 'dataloader';\nconst ORIGIN = 'auto.db.orchestrion.dataloader';\n\n// `load`, `loadMany` and `batch` are cache reads; the rest are cache mutations that get no `op`.\nconst CACHE_GET_OP = 'cache.get';\n\ntype Operation = 'load' | 'loadMany' | 'batch' | 'prime' | 'clear' | 'clearAll';\n\n// The link shape shared between a `load` span and the `batch` span it triggers.\ntype DataLoaderSpanLink = { context: ReturnType<Span['spanContext']> };\n\n// The private batch object `dataloader` stores on the loader. We stash the pending `load` span links\n// here (matching the vendored OTel instrumentation) so the batch span can link back to them.\ninterface DataLoaderBatch {\n spanLinks?: DataLoaderSpanLink[];\n}\n\ninterface DataLoaderInstance {\n name?: string | null;\n _batch?: DataLoaderBatch | null;\n}\n\n/**\n * The shape orchestrion's transform attaches to the tracing-channel `context`. Documented here rather\n * than imported because orchestrion's runtime doesn't export it.\n */\ninterface DataLoaderChannelContext {\n arguments: unknown[];\n self?: DataLoaderInstance;\n result?: unknown;\n error?: unknown;\n}\n\n// Marks a wrapped `batchLoadFn` so a re-used loader (or a double construct) isn't wrapped twice.\nconst WRAPPED = Symbol('sentry.dataloader.wrapped');\n\nfunction getSpanName(loader: DataLoaderInstance | undefined, operation: Operation): string {\n const name = loader?.name;\n\n return name ? `${MODULE_NAME}.${operation} ${name}` : `${MODULE_NAME}.${operation}`;\n}\n\n// `load` receives a single key, `loadMany`/`batch` receive a key array. Normalize both to the\n// `string[]` shape `cache.key` expects.\nfunction getCacheKey(keyArg: unknown): string[] | undefined {\n if (Array.isArray(keyArg)) {\n return keyArg.map(key => String(key));\n }\n\n return keyArg == null ? undefined : [String(keyArg)];\n}\n\nfunction makeSpanOptions(\n loader: DataLoaderInstance | undefined,\n operation: Operation,\n keyArg?: unknown,\n): StartSpanOptions {\n const isCacheGet = operation === 'load' || operation === 'loadMany' || operation === 'batch';\n\n return {\n name: getSpanName(loader, operation),\n // Every direct operation (`load`/`loadMany`/`prime`/`clear`/`clearAll`) is a client call, matching\n // the vendored OTel instrumentation. The `batch` runs off a deferred tick with no obvious network\n // peer, so it gets no kind.\n kind: operation === 'batch' ? undefined : SPAN_KIND.CLIENT,\n op: isCacheGet ? CACHE_GET_OP : undefined,\n onlyIfParent: true,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [CACHE_KEY]: isCacheGet ? getCacheKey(keyArg) : undefined,\n },\n };\n}\n\nconst _dataloaderChannelIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // `tracingChannel` is unavailable before Node 18.19 so do nothing in that case.\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n DEBUG_BUILD && debug.log('[orchestrion:dataloader] subscribing to dataloader tracing channels');\n\n waitForTracingChannelBinding(() => {\n subscribeConstruct();\n subscribeLoad();\n subscribeSimpleOperation(CHANNELS.DATALOADER_LOAD_MANY, 'loadMany');\n subscribeSimpleOperation(CHANNELS.DATALOADER_PRIME, 'prime');\n subscribeSimpleOperation(CHANNELS.DATALOADER_CLEAR, 'clear');\n subscribeSimpleOperation(CHANNELS.DATALOADER_CLEAR_ALL, 'clearAll');\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Wraps the user's `batchLoadFn` (constructor arg 0) so the batch span opens when it runs on the\n * deferred dispatch tick. The span links back to the `load` calls that populated the batch.\n */\nfunction subscribeConstruct(): void {\n diagnosticsChannel\n .tracingChannel<DataLoaderChannelContext>(CHANNELS.DATALOADER_CONSTRUCT)\n .start.subscribe(message => {\n const data = message as DataLoaderChannelContext;\n const batchLoadFn = data.arguments[0];\n if (typeof batchLoadFn !== 'function' || (batchLoadFn as { [WRAPPED]?: boolean })[WRAPPED]) {\n return;\n }\n\n const original = batchLoadFn as (...args: unknown[]) => unknown;\n const wrapped = function (this: DataLoaderInstance, ...args: unknown[]): unknown {\n // `batchLoadFn` receives the batched keys as its first argument.\n return startSpan({ ...makeSpanOptions(this, 'batch', args[0]), links: this._batch?.spanLinks }, () =>\n original.apply(this, args),\n );\n };\n (wrapped as { [WRAPPED]?: boolean })[WRAPPED] = true;\n data.arguments[0] = wrapped;\n });\n}\n\n/**\n * `load` is a cache read that additionally records its span so the batch it feeds into can link back.\n *\n * The span itself is `Async` (ends on `asyncEnd`, so its duration covers the awaited load). But the\n * link has to be recorded earlier, on the synchronous `end` (fired when `load` returns): the batch\n * dispatches on a deferred tick and reads `spanLinks` at batch-span creation, which happens BEFORE\n * `load`'s promise resolves (`asyncEnd`) — so recording at span end would be too late and drop the\n * link. The sync `end` runs after `dataloader` has assigned `this._batch` in `load`'s body and before\n * the deferred dispatch, so the link lands in time.\n */\nfunction subscribeLoad(): void {\n const channel = diagnosticsChannel.tracingChannel<DataLoaderChannelContext>(CHANNELS.DATALOADER_LOAD);\n\n bindTracingChannelToSpan(channel, data => startInactiveSpanFor(data.self, 'load', data.arguments[0]), {\n requiresParentSpan: true,\n });\n\n channel.end.subscribe(message => {\n const data = message as TracingChannelPayloadWithSpan<DataLoaderChannelContext>;\n const span = data._sentrySpan;\n const batch = data.self?._batch;\n if (span && batch && span.isRecording()) {\n (batch.spanLinks ??= []).push({ context: span.spanContext() });\n }\n });\n}\n\nfunction subscribeSimpleOperation(channelName: ChannelName, operation: Operation): void {\n bindTracingChannelToSpan(\n diagnosticsChannel.tracingChannel<DataLoaderChannelContext>(channelName),\n data => startInactiveSpanFor(data.self, operation, data.arguments[0]),\n { requiresParentSpan: true },\n );\n}\n\nfunction startInactiveSpanFor(loader: DataLoaderInstance | undefined, operation: Operation, keyArg?: unknown): Span {\n return startInactiveSpan(makeSpanOptions(loader, operation, keyArg));\n}\n\n/**\n * EXPERIMENTAL: orchestrion-driven `dataloader` integration.\n *\n * Subscribes to the `orchestrion:dataloader:*` diagnostics_channels that the orchestrion code\n * transform injects into `dataloader`'s constructor and prototype methods. Requires the orchestrion\n * runtime hook or bundler plugin to be active.\n */\nexport const dataloaderChannelIntegration = defineIntegration(_dataloaderChannelIntegration);\n"],"names":[],"mappings":";;;;;;;AAoBA,MAAM,gBAAA,GAAmB,YAAA;AAEzB,MAAM,WAAA,GAAc,YAAA;AACpB,MAAM,MAAA,GAAS,gCAAA;AAGf,MAAM,YAAA,GAAe,WAAA;AA8BrB,MAAM,OAAA,0BAAiB,2BAA2B,CAAA;AAElD,SAAS,WAAA,CAAY,QAAwC,SAAA,EAA8B;AACzF,EAAA,MAAM,OAAO,MAAA,EAAQ,IAAA;AAErB,EAAA,OAAO,IAAA,GAAO,CAAA,EAAG,WAAW,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,GAAK,CAAA,EAAG,WAAW,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA;AACnF;AAIA,SAAS,YAAY,MAAA,EAAuC;AAC1D,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,MAAM,CAAA,EAAG;AACzB,IAAA,OAAO,MAAA,CAAO,GAAA,CAAI,CAAA,GAAA,KAAO,MAAA,CAAO,GAAG,CAAC,CAAA;AAAA,EACtC;AAEA,EAAA,OAAO,UAAU,IAAA,GAAO,MAAA,GAAY,CAAC,MAAA,CAAO,MAAM,CAAC,CAAA;AACrD;AAEA,SAAS,eAAA,CACP,MAAA,EACA,SAAA,EACA,MAAA,EACkB;AAClB,EAAA,MAAM,UAAA,GAAa,SAAA,KAAc,MAAA,IAAU,SAAA,KAAc,cAAc,SAAA,KAAc,OAAA;AAErF,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,WAAA,CAAY,MAAA,EAAQ,SAAS,CAAA;AAAA;AAAA;AAAA;AAAA,IAInC,IAAA,EAAM,SAAA,KAAc,OAAA,GAAU,MAAA,GAAY,SAAA,CAAU,MAAA;AAAA,IACpD,EAAA,EAAI,aAAa,YAAA,GAAe,MAAA;AAAA,IAChC,YAAA,EAAc,IAAA;AAAA,IACd,UAAA,EAAY;AAAA,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qB,IAAA,CAAK,IAAA,EAAM,WAAW,IAAA,CAAK,SAAA,CAAU,CAAC,CAAC,CAAA;AAAA,IACpE,EAAE,oBAAoB,IAAA;AAAK,GAC7B;AACF;AAEA,SAAS,oBAAA,CAAqB,MAAA,EAAwC,SAAA,EAAsB,MAAA,EAAwB;AAClH,EAAA,OAAO,iBAAA,CAAkB,eAAA,CAAgB,MAAA,EAAQ,SAAA,EAAW,MAAM,CAAC,CAAA;AACrE;AASO,MAAM,4BAAA,GAA+B,kBAAkB,6BAA6B;;;;"}
|
|
@@ -3,7 +3,7 @@ import { instrumentFastify as instrumentFastify$1 } from './instrumentation.js';
|
|
|
3
3
|
import { INTEGRATION_NAME, defaultShouldHandleError } from './utils.js';
|
|
4
4
|
import { subscribeToFastifyErrorChannel, handleFastifyError as handleFastifyError$1 } from './errors.js';
|
|
5
5
|
|
|
6
|
-
const _fastifyIntegration = (({ shouldHandleError }) => {
|
|
6
|
+
const _fastifyIntegration = (({ shouldHandleError } = {}) => {
|
|
7
7
|
let _shouldHandleError;
|
|
8
8
|
return {
|
|
9
9
|
name: INTEGRATION_NAME,
|
|
@@ -20,9 +20,7 @@ const _fastifyIntegration = (({ shouldHandleError }) => {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
});
|
|
23
|
-
const fastifyIntegration = defineIntegration(
|
|
24
|
-
(options = {}) => _fastifyIntegration(options)
|
|
25
|
-
);
|
|
23
|
+
const fastifyIntegration = defineIntegration(_fastifyIntegration);
|
|
26
24
|
const instrumentFastify = instrumentFastify$1;
|
|
27
25
|
const handleFastifyError = handleFastifyError$1;
|
|
28
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing-channel/fastify/index.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport type { FastifyIntegration, FastifyReply, FastifyRequest } from './types';\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing-channel/fastify/index.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport type { FastifyIntegration, FastifyReply, FastifyRequest } from './types';\nimport { instrumentFastify as _instrumentFastify } from './instrumentation';\nimport { defaultShouldHandleError, INTEGRATION_NAME } from './utils';\nimport { subscribeToFastifyErrorChannel, handleFastifyError as _handleFastifyError } from './errors';\n\n/**\n * Options for the Fastify integration.\n *\n * `shouldHandleError` - Callback method deciding whether error should be captured and sent to Sentry\n * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.\n * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.\n *\n * @example\n *\n * ```javascript\n * Sentry.init({\n * integrations: [\n * Sentry.fastifyIntegration({\n * shouldHandleError(_error, _request, reply) {\n * return reply.statusCode >= 500;\n * },\n * });\n * },\n * });\n * ```\n *\n */\ninterface FastifyIntegrationOptions {\n /**\n * Callback method deciding whether error should be captured and sent to Sentry\n * This is used on Fastify v5 where Sentry handles errors in the diagnostics channel.\n * Fastify v3 and v4 use `setupFastifyErrorHandler` instead.\n *\n * @param error Captured Fastify error\n * @param request Fastify request (or any object containing at least method, routeOptions.url, and routerPath)\n * @param reply Fastify reply (or any object containing at least statusCode)\n */\n shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;\n}\n\nconst _fastifyIntegration = (({ shouldHandleError }: Partial<FastifyIntegrationOptions> = {}) => {\n let _shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n _shouldHandleError = shouldHandleError || defaultShouldHandleError;\n\n subscribeToFastifyErrorChannel();\n _instrumentFastify();\n },\n getShouldHandleError() {\n return _shouldHandleError;\n },\n setShouldHandleError(shouldHandleError: (error: Error, request: FastifyRequest, reply: FastifyReply) => boolean) {\n _shouldHandleError = shouldHandleError;\n },\n } satisfies FastifyIntegration;\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).\n * This integration supports Fastify v5 only.\n *\n * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.fastifyIntegration()],\n * })\n * ```\n */\nexport const fastifyIntegration = defineIntegration(_fastifyIntegration);\n\n/**\n * @deprecated This export is deprecated and will not longer be exposed in the next major version.\n */\nexport const instrumentFastify = _instrumentFastify;\n\n/**\n * @deprecated This export is deprecated and will not longer be exposed in the next major version.\n */\nexport const handleFastifyError = _handleFastifyError;\n"],"names":["_instrumentFastify","shouldHandleError","_handleFastifyError"],"mappings":";;;;;AA0CA,MAAM,uBAAuB,CAAC,EAAE,iBAAA,EAAkB,GAAwC,EAAC,KAAM;AAC/F,EAAA,IAAI,kBAAA;AAEJ,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,kBAAA,GAAqB,iBAAA,IAAqB,wBAAA;AAE1C,MAAA,8BAAA,EAA+B;AAC/B,MAAAA,mBAAA,EAAmB;AAAA,IACrB,CAAA;AAAA,IACA,oBAAA,GAAuB;AACrB,MAAA,OAAO,kBAAA;AAAA,IACT,CAAA;AAAA,IACA,qBAAqBC,kBAAAA,EAA4F;AAC/G,MAAA,kBAAA,GAAqBA,kBAAAA;AAAA,IACvB;AAAA,GACF;AACF,CAAA,CAAA;AAiBO,MAAM,kBAAA,GAAqB,kBAAkB,mBAAmB;AAKhE,MAAM,iBAAA,GAAoBD;AAK1B,MAAM,kBAAA,GAAqBE;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../../../src/integrations/tracing-channel/fastify/utils.ts"],"sourcesContent":["import type { FastifyReply, FastifyRequest } from './types';\n\nexport const INTEGRATION_NAME = 'Fastify';\n\n/**\n * Default function to determine if an error should be sent to Sentry\n *\n * 3xx and 4xx errors are not sent by default.\n */\nexport function defaultShouldHandleError(_error: Error, _request: FastifyRequest, reply: FastifyReply): boolean {\n const statusCode = reply.statusCode;\n // 3xx and 4xx errors are not sent by default.\n return statusCode >= 500 || statusCode <= 299;\n}\n"],"names":[],"mappings":"AAEO,MAAM,gBAAA,GAAmB;AAOzB,SAAS,wBAAA,CAAyB,MAAA,EAAe,QAAA,EAA0B,KAAA,EAA8B;AAC9G,EAAA,MAAM,aAAa,KAAA,CAAM,UAAA;AAEzB,EAAA,OAAO,UAAA,IAAc,OAAO,UAAA,IAAc,GAAA;AAC5C;;;;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../../../src/integrations/tracing-channel/fastify/utils.ts"],"sourcesContent":["import type { FastifyReply, FastifyRequest } from './types';\n\nexport const INTEGRATION_NAME = 'Fastify' as const;\n\n/**\n * Default function to determine if an error should be sent to Sentry\n *\n * 3xx and 4xx errors are not sent by default.\n */\nexport function defaultShouldHandleError(_error: Error, _request: FastifyRequest, reply: FastifyReply): boolean {\n const statusCode = reply.statusCode;\n // 3xx and 4xx errors are not sent by default.\n return statusCode >= 500 || statusCode <= 299;\n}\n"],"names":[],"mappings":"AAEO,MAAM,gBAAA,GAAmB;AAOzB,SAAS,wBAAA,CAAyB,MAAA,EAAe,QAAA,EAA0B,KAAA,EAA8B;AAC9G,EAAA,MAAM,aAAa,KAAA,CAAM,UAAA;AAEzB,EAAA,OAAO,UAAA,IAAc,OAAO,UAAA,IAAc,GAAA;AAC5C;;;;"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as net from 'node:net';
|
|
2
|
+
import { DB_OPERATION_NAME, DB_NAMESPACE, DB_COLLECTION_NAME, DB_SYSTEM_NAME, SERVER_ADDRESS, SERVER_PORT } from '@sentry/conventions/attributes';
|
|
3
|
+
import { startInactiveSpan, SPAN_KIND, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
|
|
4
|
+
|
|
5
|
+
function startFirestoreSpan(spanName, reference) {
|
|
6
|
+
return startInactiveSpan({
|
|
7
|
+
name: `${spanName} ${reference.path}`,
|
|
8
|
+
op: "db.query",
|
|
9
|
+
kind: SPAN_KIND.CLIENT,
|
|
10
|
+
attributes: {
|
|
11
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.firebase.orchestrion.firestore",
|
|
12
|
+
[DB_OPERATION_NAME]: spanName,
|
|
13
|
+
...buildAttributes(reference)
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function getPortAndAddress(settings) {
|
|
18
|
+
let address;
|
|
19
|
+
let port;
|
|
20
|
+
if (typeof settings.host === "string") {
|
|
21
|
+
if (settings.host.startsWith("[")) {
|
|
22
|
+
if (settings.host.endsWith("]")) {
|
|
23
|
+
address = settings.host.replace(/^\[|\]$/g, "");
|
|
24
|
+
} else if (settings.host.includes("]:")) {
|
|
25
|
+
const lastColonIndex = settings.host.lastIndexOf(":");
|
|
26
|
+
if (lastColonIndex !== -1) {
|
|
27
|
+
address = settings.host.slice(1, lastColonIndex).replace(/^\[|\]$/g, "");
|
|
28
|
+
port = settings.host.slice(lastColonIndex + 1);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
if (net.isIPv6(settings.host)) {
|
|
33
|
+
address = settings.host;
|
|
34
|
+
} else {
|
|
35
|
+
const lastColonIndex = settings.host.lastIndexOf(":");
|
|
36
|
+
if (lastColonIndex !== -1) {
|
|
37
|
+
address = settings.host.slice(0, lastColonIndex);
|
|
38
|
+
port = settings.host.slice(lastColonIndex + 1);
|
|
39
|
+
} else {
|
|
40
|
+
address = settings.host;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
address,
|
|
47
|
+
port: port ? parseInt(port, 10) : void 0
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function buildAttributes(reference) {
|
|
51
|
+
const firestoreApp = reference.firestore.app;
|
|
52
|
+
const firestoreOptions = firestoreApp.options;
|
|
53
|
+
const settings = reference.firestore.toJSON()?.settings || {};
|
|
54
|
+
const attributes = {
|
|
55
|
+
[DB_COLLECTION_NAME]: reference.path,
|
|
56
|
+
[DB_NAMESPACE]: firestoreApp.name,
|
|
57
|
+
[DB_SYSTEM_NAME]: "firebase.firestore",
|
|
58
|
+
"firebase.firestore.type": reference.type,
|
|
59
|
+
"firebase.firestore.options.projectId": firestoreOptions.projectId,
|
|
60
|
+
"firebase.firestore.options.appId": firestoreOptions.appId,
|
|
61
|
+
"firebase.firestore.options.messagingSenderId": firestoreOptions.messagingSenderId,
|
|
62
|
+
"firebase.firestore.options.storageBucket": firestoreOptions.storageBucket
|
|
63
|
+
};
|
|
64
|
+
const { address, port } = getPortAndAddress(settings);
|
|
65
|
+
if (address) {
|
|
66
|
+
attributes[SERVER_ADDRESS] = address;
|
|
67
|
+
}
|
|
68
|
+
if (port) {
|
|
69
|
+
attributes[SERVER_PORT] = port;
|
|
70
|
+
}
|
|
71
|
+
return attributes;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { getPortAndAddress, startFirestoreSpan };
|
|
75
|
+
//# sourceMappingURL=firestore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firestore.js","sources":["../../../../../src/integrations/tracing-channel/firebase/firestore.ts"],"sourcesContent":["import * as net from 'node:net';\nimport {\n DB_COLLECTION_NAME,\n DB_NAMESPACE,\n DB_OPERATION_NAME,\n DB_SYSTEM_NAME,\n SERVER_ADDRESS,\n SERVER_PORT,\n} from '@sentry/conventions/attributes';\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_KIND, startInactiveSpan } from '@sentry/core';\nimport type { FirebaseApp, FirebaseOptions, FirestoreReference, FirestoreSettings } from './firestore-types';\n\n/**\n * Opens the inactive `db.query` span for a Firestore operation. `bindTracingChannelToSpan` makes it the\n * active span for the traced call and ends it when the call settles. Mirrors the OTel integration's span,\n * with a distinct `auto.firebase.orchestrion.firestore` origin.\n */\nexport function startFirestoreSpan(spanName: string, reference: FirestoreReference): Span {\n return startInactiveSpan({\n name: `${spanName} ${reference.path}`,\n op: 'db.query',\n kind: SPAN_KIND.CLIENT,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.firebase.orchestrion.firestore',\n [DB_OPERATION_NAME]: spanName,\n ...buildAttributes(reference),\n },\n });\n}\n\n/**\n * Gets the server address and port attributes from the Firestore settings.\n * It's best effort to extract the address and port from the settings, especially for IPv6.\n * @param settings - The Firestore settings containing host information.\n */\nexport function getPortAndAddress(settings: FirestoreSettings): {\n address?: string;\n port?: number;\n} {\n let address: string | undefined;\n let port: string | undefined;\n\n if (typeof settings.host === 'string') {\n if (settings.host.startsWith('[')) {\n // IPv6 addresses can be enclosed in square brackets, e.g., [2001:db8::1]:8080\n if (settings.host.endsWith(']')) {\n // IPv6 with square brackets without port\n address = settings.host.replace(/^\\[|\\]$/g, '');\n } else if (settings.host.includes(']:')) {\n // IPv6 with square brackets with port\n const lastColonIndex = settings.host.lastIndexOf(':');\n if (lastColonIndex !== -1) {\n address = settings.host.slice(1, lastColonIndex).replace(/^\\[|\\]$/g, '');\n port = settings.host.slice(lastColonIndex + 1);\n }\n }\n } else {\n // IPv4 or IPv6 without square brackets\n // If it's an IPv6 address without square brackets, we assume it does not have a port.\n if (net.isIPv6(settings.host)) {\n address = settings.host;\n }\n // If it's an IPv4 address, we can extract the port if it exists.\n else {\n const lastColonIndex = settings.host.lastIndexOf(':');\n if (lastColonIndex !== -1) {\n address = settings.host.slice(0, lastColonIndex);\n port = settings.host.slice(lastColonIndex + 1);\n } else {\n address = settings.host;\n }\n }\n }\n }\n return {\n address: address,\n port: port ? parseInt(port, 10) : undefined,\n };\n}\n\nfunction buildAttributes(reference: FirestoreReference): SpanAttributes {\n const firestoreApp: FirebaseApp = reference.firestore.app;\n const firestoreOptions: FirebaseOptions = firestoreApp.options;\n const settings: FirestoreSettings = reference.firestore.toJSON()?.settings || {};\n\n const attributes: SpanAttributes = {\n [DB_COLLECTION_NAME]: reference.path,\n [DB_NAMESPACE]: firestoreApp.name,\n [DB_SYSTEM_NAME]: 'firebase.firestore',\n 'firebase.firestore.type': reference.type,\n 'firebase.firestore.options.projectId': firestoreOptions.projectId,\n 'firebase.firestore.options.appId': firestoreOptions.appId,\n 'firebase.firestore.options.messagingSenderId': firestoreOptions.messagingSenderId,\n 'firebase.firestore.options.storageBucket': firestoreOptions.storageBucket,\n };\n\n const { address, port } = getPortAndAddress(settings);\n\n if (address) {\n attributes[SERVER_ADDRESS] = address;\n }\n if (port) {\n attributes[SERVER_PORT] = port;\n }\n\n return attributes;\n}\n"],"names":[],"mappings":";;;;AAkBO,SAAS,kBAAA,CAAmB,UAAkB,SAAA,EAAqC;AACxF,EAAA,OAAO,iBAAA,CAAkB;AAAA,IACvB,IAAA,EAAM,CAAA,EAAG,QAAQ,CAAA,CAAA,EAAI,UAAU,IAAI,CAAA,CAAA;AAAA,IACnC,EAAA,EAAI,UAAA;AAAA,IACJ,MAAM,SAAA,CAAU,MAAA;AAAA,IAChB,UAAA,EAAY;AAAA,MACV,CAAC,gCAAgC,GAAG,qCAAA;AAAA,MACpC,CAAC,iBAAiB,GAAG,QAAA;AAAA,MACrB,GAAG,gBAAgB,SAAS;AAAA;AAC9B,GACD,CAAA;AACH;AAOO,SAAS,kBAAkB,QAAA,EAGhC;AACA,EAAA,IAAI,OAAA;AACJ,EAAA,IAAI,IAAA;AAEJ,EAAA,IAAI,OAAO,QAAA,CAAS,IAAA,KAAS,QAAA,EAAU;AACrC,IAAA,IAAI,QAAA,CAAS,IAAA,CAAK,UAAA,CAAW,GAAG,CAAA,EAAG;AAEjC,MAAA,IAAI,QAAA,CAAS,IAAA,CAAK,QAAA,CAAS,GAAG,CAAA,EAAG;AAE/B,QAAA,OAAA,GAAU,QA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,GAA4B,UAAU,SAAA,CAAU,GAAA;AACtD,EAAA,MAAM,mBAAoC,YAAA,CAAa,OAAA;AACvD,EAAA,MAAM,WAA8B,SAAA,CAAU,SAAA,CAAU,MAAA,EAAO,EAAG,YAAY,EAAC;AAE/E,EAAA,MAAM,UAAA,GAA6B;AAAA,IACjC,CAAC,kBAAkB,GAAG,SAAA,CAAU,IAAA;AAAA,IAChC,CAAC,YAAY,GAAG,YAAA,CAAa,IAAA;AAAA,IAC7B,CAAC,cAAc,GAAG,oBAAA;AAAA,IAClB,2BAA2B,SAAA,CAAU,IAAA;AAAA,IACrC,wCAAwC,gBAAA,CAAiB,SAAA;AAAA,IACzD,oCAAoC,gBAAA,CAAiB,KAAA;AAAA,IACrD,gDAAgD,gBAAA,CAAiB,iBAAA;AAAA,IACjE,4CAA4C,gBAAA,CAAiB;AAAA,GAC/D;AAEA,EAAA,MAAM,EAAE,OAAA,EAAS,IAAA,EAAK,GAAI,kBAAkB,QAAQ,CAAA;AAEpD,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,UAAA,CAAW,cAAc,CAAA,GAAI,OAAA;AAAA,EAC/B;AACA,EAAA,IAAI,IAAA,EAAM;AACR,IAAA,UAAA,CAAW,WAAW,CAAA,GAAI,IAAA;AAAA,EAC5B;AAEA,EAAA,OAAO,UAAA;AACT;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { FAAS_TRIGGER, FAAS_NAME } from '@sentry/conventions/attributes';
|
|
2
|
+
import { startSpanManual, SPAN_KIND, SPAN_STATUS_ERROR, captureException, flush, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
|
|
3
|
+
|
|
4
|
+
const FUNCTIONS_ORIGIN = "auto.firebase.orchestrion.functions";
|
|
5
|
+
const WRAPPED = "__sentryFirebaseWrapped";
|
|
6
|
+
function wrapFunctionsRegistration(data, triggerType) {
|
|
7
|
+
const args = data.arguments;
|
|
8
|
+
if (!Array.isArray(args) || args.length === 0) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const handlerIndex = typeof args[0] === "function" ? 0 : 1;
|
|
12
|
+
const handler = args[handlerIndex];
|
|
13
|
+
if (typeof handler !== "function" || handler[WRAPPED]) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
args[handlerIndex] = wrapHandler(handler, triggerType);
|
|
17
|
+
}
|
|
18
|
+
function wrapHandler(handler, triggerType) {
|
|
19
|
+
const wrapped = async function(...handlerArgs) {
|
|
20
|
+
const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || "unknown";
|
|
21
|
+
const attributes = {
|
|
22
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: FUNCTIONS_ORIGIN,
|
|
23
|
+
[FAAS_NAME]: functionName,
|
|
24
|
+
[FAAS_TRIGGER]: triggerType,
|
|
25
|
+
"faas.provider": "firebase"
|
|
26
|
+
};
|
|
27
|
+
if (process.env.GCLOUD_PROJECT) {
|
|
28
|
+
attributes["cloud.project_id"] = process.env.GCLOUD_PROJECT;
|
|
29
|
+
}
|
|
30
|
+
if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) {
|
|
31
|
+
attributes["cloud.event_source"] = process.env.EVENTARC_CLOUD_EVENT_SOURCE;
|
|
32
|
+
}
|
|
33
|
+
return startSpanManual(
|
|
34
|
+
{
|
|
35
|
+
name: `firebase.function.${triggerType}`,
|
|
36
|
+
op: "function.firebase",
|
|
37
|
+
kind: SPAN_KIND.SERVER,
|
|
38
|
+
attributes
|
|
39
|
+
},
|
|
40
|
+
async (span) => {
|
|
41
|
+
try {
|
|
42
|
+
const result = await handler.apply(this, handlerArgs);
|
|
43
|
+
span.end();
|
|
44
|
+
return result;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
span.setStatus({ code: SPAN_STATUS_ERROR });
|
|
47
|
+
captureException(error, {
|
|
48
|
+
mechanism: {
|
|
49
|
+
type: FUNCTIONS_ORIGIN,
|
|
50
|
+
handled: false
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
span.end();
|
|
54
|
+
await flush(2e3);
|
|
55
|
+
throw error;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
wrapped[WRAPPED] = true;
|
|
61
|
+
return wrapped;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export { wrapFunctionsRegistration };
|
|
65
|
+
//# sourceMappingURL=functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.js","sources":["../../../../../src/integrations/tracing-channel/firebase/functions.ts"],"sourcesContent":["import { FAAS_NAME, FAAS_TRIGGER } from '@sentry/conventions/attributes';\nimport type { SpanAttributes } from '@sentry/core';\nimport {\n captureException,\n flush,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startSpanManual,\n} from '@sentry/core';\n\nconst FUNCTIONS_ORIGIN = 'auto.firebase.orchestrion.functions';\n\n// Set on a wrapped handler so re-entrant `start` events don't double-wrap it.\nconst WRAPPED = '__sentryFirebaseWrapped';\n\ntype Handler = (this: unknown, ...args: unknown[]) => unknown;\n\ninterface FunctionsChannelContext {\n // The live args of the `onX(...)` registration call. firebase-functions accepts either\n // `onX(handler)` or `onX(documentOrOptions, handler)`, so the handler is `arguments[0]` when it's a\n // function, otherwise `arguments[1]`. Mutating the entry here swaps in the wrapped handler.\n arguments: unknown[];\n self?: unknown;\n}\n\n/**\n * Rewrap the handler argument of a firebase-functions `onX(...)` registration so the returned cloud\n * function opens a `SERVER` span (and error boundary) each time it's invoked. Runs as the tracing\n * channel's `start` subscriber, before orchestrion forwards the (mutated) arguments to the real call.\n *\n * The registration call itself is trivial and synchronous, so — unlike the firestore path — this does\n * not bind a span to the channel; it only uses the channel as an injection point.\n */\nexport function wrapFunctionsRegistration(data: FunctionsChannelContext, triggerType: string): void {\n const args = data.arguments;\n if (!Array.isArray(args) || args.length === 0) {\n return;\n }\n\n const handlerIndex = typeof args[0] === 'function' ? 0 : 1;\n const handler = args[handlerIndex];\n\n if (typeof handler !== 'function' || (handler as unknown as Record<string, unknown>)[WRAPPED]) {\n return;\n }\n\n args[handlerIndex] = wrapHandler(handler as Handler, triggerType);\n}\n\nfunction wrapHandler(handler: Handler, triggerType: string): Handler {\n const wrapped = async function (this: unknown, ...handlerArgs: unknown[]): Promise<unknown> {\n const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || 'unknown';\n\n const attributes: SpanAttributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: FUNCTIONS_ORIGIN,\n [FAAS_NAME]: functionName,\n [FAAS_TRIGGER]: triggerType,\n 'faas.provider': 'firebase',\n };\n\n if (process.env.GCLOUD_PROJECT) {\n attributes['cloud.project_id'] = process.env.GCLOUD_PROJECT;\n }\n\n if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) {\n attributes['cloud.event_source'] = process.env.EVENTARC_CLOUD_EVENT_SOURCE;\n }\n\n // `startSpanManual` keeps the span active while still allowing us to end it before flushing on error.\n return startSpanManual(\n {\n name: `firebase.function.${triggerType}`,\n op: 'function.firebase',\n kind: SPAN_KIND.SERVER,\n attributes,\n },\n async span => {\n try {\n const result = await handler.apply(this, handlerArgs);\n span.end();\n return result;\n } catch (error) {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n captureException(error, {\n mechanism: {\n type: FUNCTIONS_ORIGIN,\n handled: false,\n },\n });\n span.end();\n await flush(2000);\n throw error;\n }\n },\n );\n };\n\n (wrapped as unknown as Record<string, unknown>)[WRAPPED] = true;\n return wrapped;\n}\n"],"names":[],"mappings":";;;AAWA,MAAM,gBAAA,GAAmB,qCAAA;AAGzB,MAAM,OAAA,GAAU,yBAAA;AAoBT,SAAS,yBAAA,CAA0B,MAA+B,WAAA,EAA2B;AAClG,EAAA,MAAM,OAAO,IAAA,CAAK,SAAA;AAClB,EAAA,IAAI,CAAC,KAAA,CAAM,OAAA,CAAQ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AAAA,MACA,OAAM,IAAA,KAAQ;AACZ,QAAA,IAAI;AACF,UAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,KAAA,CAAM,MAAM,WAAW,CAAA;AACpD,UAAA,IAAA,CAAK,GAAA,EAAI;AACT,UAAA,OAAO,MAAA;AAAA,QACT,SAAS,KAAA,EAAO;AACd,UAAA,IAAA,CAAK,SAAA,CAAU,EAAE,IAAA,EAAM,iBAAA,EAAmB,CAAA;AAC1C,UAAA,gBAAA,CAAiB,KAAA,EAAO;AAAA,YACtB,SAAA,EAAW;AAAA,cACT,IAAA,EAAM,gBAAA;AAAA,cACN,OAAA,EAAS;AAAA;AACX,WACD,CAAA;AACD,UAAA,IAAA,CAAK,GAAA,EAAI;AACT,UAAA,MAAM,MAAM,GAAI,CAAA;AAChB,UAAA,MAAM,KAAA;AAAA,QACR;AAAA,MACF;AAAA,KACF;AAAA,EACF,CAAA;AAEA,EAAC,OAAA,CAA+C,OAAO,CAAA,GAAI,IAAA;AAC3D,EAAA,OAAO,OAAA;AACT;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as diagnosticsChannel from 'node:diagnostics_channel';
|
|
2
|
+
import { defineIntegration, waitForTracingChannelBinding } from '@sentry/core';
|
|
3
|
+
import { instrumentFirebase } from './instrumentation.js';
|
|
4
|
+
|
|
5
|
+
const INTEGRATION_NAME = "Firebase";
|
|
6
|
+
const _firebaseChannelIntegration = (() => {
|
|
7
|
+
return {
|
|
8
|
+
name: INTEGRATION_NAME,
|
|
9
|
+
setupOnce() {
|
|
10
|
+
if (!diagnosticsChannel.tracingChannel) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
waitForTracingChannelBinding(() => {
|
|
14
|
+
instrumentFirebase();
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
const firebaseChannelIntegration = defineIntegration(_firebaseChannelIntegration);
|
|
20
|
+
|
|
21
|
+
export { firebaseChannelIntegration };
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing-channel/firebase/index.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, waitForTracingChannelBinding } from '@sentry/core';\nimport { instrumentFirebase } from './instrumentation';\n\nconst INTEGRATION_NAME = 'Firebase' as const;\n\nconst _firebaseChannelIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // `tracingChannel` is unavailable before Node 18.19 so do nothing in that case.\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n waitForTracingChannelBinding(() => {\n instrumentFirebase();\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * EXPERIMENTAL — orchestrion-driven firebase integration.\n *\n * Subscribes to the `orchestrion:@firebase/firestore:*` and `orchestrion:firebase-functions:*`\n * diagnostics_channels the orchestrion code transform injects into firestore's `addDoc`/`getDocs`/\n * `setDoc`/`deleteDoc` and firebase-functions' `onX` registration functions, emitting spans identical\n * to the OTel integration — with a distinct `auto.firebase.orchestrion.*` origin. Requires the\n * orchestrion runtime hook or bundler plugin — wire it up via `experimentalUseDiagnosticsChannelInjection()`.\n *\n * @experimental\n */\nexport const firebaseChannelIntegration = defineIntegration(_firebaseChannelIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,UAAA;AAEzB,MAAM,+BAA+B,MAAM;AACzC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AAEV,MAAA,IAAI,CAAC,mBAAmB,cAAA,EAAgB;AACtC,QAAA;AAAA,MACF;AAEA,MAAA,4BAAA,CAA6B,MAAM;AACjC,QAAA,kBAAA,EAAmB;AAAA,MACrB,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAA,CAAA;AAaO,MAAM,0BAAA,GAA6B,kBAAkB,2BAA2B;;;;"}
|