@sentry/server-utils 10.62.0 → 10.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.js +10 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/tracing-channel/anthropic.js +101 -0
- package/build/cjs/integrations/tracing-channel/anthropic.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/errors.js +42 -0
- package/build/cjs/integrations/tracing-channel/fastify/errors.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/index.js +34 -0
- package/build/cjs/integrations/tracing-channel/fastify/index.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js +279 -0
- package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/fastify/utils.js +11 -0
- package/build/cjs/integrations/tracing-channel/fastify/utils.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/hapi-types.js +30 -0
- package/build/cjs/integrations/tracing-channel/hapi-types.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/hapi-utils.js +177 -0
- package/build/cjs/integrations/tracing-channel/hapi-utils.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/hapi.js +52 -0
- package/build/cjs/integrations/tracing-channel/hapi.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/ioredis.js +96 -0
- package/build/cjs/integrations/tracing-channel/ioredis.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/lru-memoizer.js +31 -0
- package/build/cjs/integrations/tracing-channel/lru-memoizer.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/mysql.js +46 -83
- package/build/cjs/integrations/tracing-channel/mysql.js.map +1 -1
- package/build/cjs/integrations/tracing-channel/openai.js +83 -0
- package/build/cjs/integrations/tracing-channel/openai.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/postgres.js +170 -0
- package/build/cjs/integrations/tracing-channel/postgres.js.map +1 -0
- package/build/cjs/integrations/tracing-channel/vercel-ai.js +25 -0
- package/build/cjs/integrations/tracing-channel/vercel-ai.js.map +1 -0
- package/build/cjs/mongoose/index.js +23 -0
- package/build/cjs/mongoose/index.js.map +1 -0
- package/build/cjs/mongoose/mongoose-dc-subscriber.js +97 -0
- package/build/cjs/mongoose/mongoose-dc-subscriber.js.map +1 -0
- package/build/cjs/orchestrion/bundler/vite.js +3 -3
- package/build/cjs/orchestrion/bundler/vite.js.map +1 -1
- package/build/cjs/orchestrion/channels.js +17 -1
- package/build/cjs/orchestrion/channels.js.map +1 -1
- package/build/cjs/orchestrion/config/anthropic-ai.js +43 -0
- package/build/cjs/orchestrion/config/anthropic-ai.js.map +1 -0
- package/build/cjs/orchestrion/config/hapi.js +26 -0
- package/build/cjs/orchestrion/config/hapi.js.map +1 -0
- package/build/cjs/orchestrion/config/index.js +35 -0
- package/build/cjs/orchestrion/config/index.js.map +1 -0
- package/build/cjs/orchestrion/config/ioredis.js +35 -0
- package/build/cjs/orchestrion/config/ioredis.js.map +1 -0
- package/build/cjs/orchestrion/config/lru-memoizer.js +17 -0
- package/build/cjs/orchestrion/config/lru-memoizer.js.map +1 -0
- package/build/cjs/orchestrion/config/mysql.js +16 -0
- package/build/cjs/orchestrion/config/mysql.js.map +1 -0
- package/build/cjs/orchestrion/config/openai.js +40 -0
- package/build/cjs/orchestrion/config/openai.js.map +1 -0
- package/build/cjs/orchestrion/config/pg.js +51 -0
- package/build/cjs/orchestrion/config/pg.js.map +1 -0
- package/build/cjs/orchestrion/config/vercel-ai.js +44 -0
- package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -0
- package/build/cjs/orchestrion/detect.js +6 -1
- package/build/cjs/orchestrion/detect.js.map +1 -1
- package/build/cjs/orchestrion/index.js +27 -3
- package/build/cjs/orchestrion/index.js.map +1 -1
- package/build/cjs/orchestrion/runtime/register.js +10 -7
- package/build/cjs/orchestrion/runtime/register.js.map +1 -1
- package/build/cjs/redis/redis-statement-serializer.js +34 -0
- package/build/cjs/redis/redis-statement-serializer.js.map +1 -0
- package/build/cjs/tracing-channel.js +50 -11
- package/build/cjs/tracing-channel.js.map +1 -1
- package/build/cjs/vercel-ai/index.js +5 -3
- package/build/cjs/vercel-ai/index.js.map +1 -1
- package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js +11 -4
- package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
- package/build/cjs/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js +256 -0
- package/build/cjs/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js.map +1 -0
- package/build/esm/index.js +3 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/integrations/tracing-channel/anthropic.js +99 -0
- package/build/esm/integrations/tracing-channel/anthropic.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/errors.js +39 -0
- package/build/esm/integrations/tracing-channel/fastify/errors.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/index.js +30 -0
- package/build/esm/integrations/tracing-channel/fastify/index.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/instrumentation.js +277 -0
- package/build/esm/integrations/tracing-channel/fastify/instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing-channel/fastify/utils.js +8 -0
- package/build/esm/integrations/tracing-channel/fastify/utils.js.map +1 -0
- package/build/esm/integrations/tracing-channel/hapi-types.js +25 -0
- package/build/esm/integrations/tracing-channel/hapi-types.js.map +1 -0
- package/build/esm/integrations/tracing-channel/hapi-utils.js +172 -0
- package/build/esm/integrations/tracing-channel/hapi-utils.js.map +1 -0
- package/build/esm/integrations/tracing-channel/hapi.js +50 -0
- package/build/esm/integrations/tracing-channel/hapi.js.map +1 -0
- package/build/esm/integrations/tracing-channel/ioredis.js +94 -0
- package/build/esm/integrations/tracing-channel/ioredis.js.map +1 -0
- package/build/esm/integrations/tracing-channel/lru-memoizer.js +29 -0
- package/build/esm/integrations/tracing-channel/lru-memoizer.js.map +1 -0
- package/build/esm/integrations/tracing-channel/mysql.js +47 -84
- package/build/esm/integrations/tracing-channel/mysql.js.map +1 -1
- package/build/esm/integrations/tracing-channel/openai.js +81 -0
- package/build/esm/integrations/tracing-channel/openai.js.map +1 -0
- package/build/esm/integrations/tracing-channel/postgres.js +168 -0
- package/build/esm/integrations/tracing-channel/postgres.js.map +1 -0
- package/build/esm/integrations/tracing-channel/vercel-ai.js +23 -0
- package/build/esm/integrations/tracing-channel/vercel-ai.js.map +1 -0
- package/build/esm/mongoose/index.js +21 -0
- package/build/esm/mongoose/index.js.map +1 -0
- package/build/esm/mongoose/mongoose-dc-subscriber.js +89 -0
- package/build/esm/mongoose/mongoose-dc-subscriber.js.map +1 -0
- package/build/esm/orchestrion/bundler/vite.js +1 -1
- package/build/esm/orchestrion/channels.js +17 -1
- package/build/esm/orchestrion/channels.js.map +1 -1
- package/build/esm/orchestrion/config/anthropic-ai.js +40 -0
- package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -0
- package/build/esm/orchestrion/config/hapi.js +23 -0
- package/build/esm/orchestrion/config/hapi.js.map +1 -0
- package/build/esm/orchestrion/config/index.js +31 -0
- package/build/esm/orchestrion/config/index.js.map +1 -0
- package/build/esm/orchestrion/config/ioredis.js +32 -0
- package/build/esm/orchestrion/config/ioredis.js.map +1 -0
- package/build/esm/orchestrion/config/lru-memoizer.js +14 -0
- package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -0
- package/build/esm/orchestrion/config/mysql.js +13 -0
- package/build/esm/orchestrion/config/mysql.js.map +1 -0
- package/build/esm/orchestrion/config/openai.js +37 -0
- package/build/esm/orchestrion/config/openai.js.map +1 -0
- package/build/esm/orchestrion/config/pg.js +48 -0
- package/build/esm/orchestrion/config/pg.js.map +1 -0
- package/build/esm/orchestrion/config/vercel-ai.js +41 -0
- package/build/esm/orchestrion/config/vercel-ai.js.map +1 -0
- package/build/esm/orchestrion/detect.js +6 -2
- package/build/esm/orchestrion/detect.js.map +1 -1
- package/build/esm/orchestrion/index.js +21 -2
- package/build/esm/orchestrion/index.js.map +1 -1
- package/build/esm/orchestrion/runtime/register.js +8 -4
- package/build/esm/orchestrion/runtime/register.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/redis/redis-statement-serializer.js +32 -0
- package/build/esm/redis/redis-statement-serializer.js.map +1 -0
- package/build/esm/tracing-channel.js +51 -12
- package/build/esm/tracing-channel.js.map +1 -1
- package/build/esm/vercel-ai/index.js +6 -4
- package/build/esm/vercel-ai/index.js.map +1 -1
- package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js +14 -8
- package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
- package/build/esm/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js +254 -0
- package/build/esm/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js.map +1 -0
- package/build/types/index.d.ts +3 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/tracing-channel/anthropic.d.ts +10 -0
- package/build/types/integrations/tracing-channel/anthropic.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/errors.d.ts +12 -0
- package/build/types/integrations/tracing-channel/fastify/errors.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/index.d.ts +66 -0
- package/build/types/integrations/tracing-channel/fastify/index.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts +10 -0
- package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/types.d.ts +32 -0
- package/build/types/integrations/tracing-channel/fastify/types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/fastify/utils.d.ts +9 -0
- package/build/types/integrations/tracing-channel/fastify/utils.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/hapi-types.d.ts +53 -0
- package/build/types/integrations/tracing-channel/hapi-types.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/hapi-utils.d.ts +25 -0
- package/build/types/integrations/tracing-channel/hapi-utils.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/hapi.d.ts +9 -0
- package/build/types/integrations/tracing-channel/hapi.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/ioredis.d.ts +17 -0
- package/build/types/integrations/tracing-channel/ioredis.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/lru-memoizer.d.ts +10 -0
- package/build/types/integrations/tracing-channel/lru-memoizer.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/mysql.d.ts +3 -1
- package/build/types/integrations/tracing-channel/mysql.d.ts.map +1 -1
- package/build/types/integrations/tracing-channel/openai.d.ts +10 -0
- package/build/types/integrations/tracing-channel/openai.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/postgres.d.ts +15 -0
- package/build/types/integrations/tracing-channel/postgres.d.ts.map +1 -0
- package/build/types/integrations/tracing-channel/vercel-ai.d.ts +13 -0
- package/build/types/integrations/tracing-channel/vercel-ai.d.ts.map +1 -0
- package/build/types/mongoose/index.d.ts +11 -0
- package/build/types/mongoose/index.d.ts.map +1 -0
- package/build/types/mongoose/mongoose-dc-subscriber.d.ts +63 -0
- package/build/types/mongoose/mongoose-dc-subscriber.d.ts.map +1 -0
- package/build/types/orchestrion/channels.d.ts +21 -0
- package/build/types/orchestrion/channels.d.ts.map +1 -1
- package/build/types/orchestrion/config/anthropic-ai.d.ts +31 -0
- package/build/types/orchestrion/config/anthropic-ai.d.ts.map +1 -0
- package/build/types/orchestrion/config/hapi.d.ts +17 -0
- package/build/types/orchestrion/config/hapi.d.ts.map +1 -0
- package/build/types/orchestrion/{config.d.ts → config/index.d.ts} +1 -12
- package/build/types/orchestrion/config/index.d.ts.map +1 -0
- package/build/types/orchestrion/config/ioredis.d.ts +7 -0
- package/build/types/orchestrion/config/ioredis.d.ts.map +1 -0
- package/build/types/orchestrion/config/lru-memoizer.d.ts +16 -0
- package/build/types/orchestrion/config/lru-memoizer.d.ts.map +1 -0
- package/build/types/orchestrion/config/mysql.d.ts +16 -0
- package/build/types/orchestrion/config/mysql.d.ts.map +1 -0
- package/build/types/orchestrion/config/openai.d.ts +20 -0
- package/build/types/orchestrion/config/openai.d.ts.map +1 -0
- package/build/types/orchestrion/config/pg.d.ts +33 -0
- package/build/types/orchestrion/config/pg.d.ts.map +1 -0
- package/build/types/orchestrion/config/vercel-ai.d.ts +11 -0
- package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -0
- package/build/types/orchestrion/detect.d.ts +10 -0
- package/build/types/orchestrion/detect.d.ts.map +1 -1
- package/build/types/orchestrion/index.d.ts +53 -2
- package/build/types/orchestrion/index.d.ts.map +1 -1
- package/build/types/orchestrion/runtime/register.d.ts.map +1 -1
- package/build/types/redis/redis-statement-serializer.d.ts +6 -0
- package/build/types/redis/redis-statement-serializer.d.ts.map +1 -0
- package/build/types/tracing-channel.d.ts +22 -0
- package/build/types/tracing-channel.d.ts.map +1 -1
- package/build/types/vercel-ai/index.d.ts +3 -1
- package/build/types/vercel-ai/index.d.ts.map +1 -1
- package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts +10 -4
- package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -1
- package/build/types/vercel-ai/vercel-ai-orchestrion-v6-subscriber.d.ts +12 -0
- package/build/types/vercel-ai/vercel-ai-orchestrion-v6-subscriber.d.ts.map +1 -0
- package/build/types-ts3.8/index.d.ts +4 -0
- package/build/types-ts3.8/integrations/tracing-channel/anthropic.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/errors.d.ts +12 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/index.d.ts +66 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/instrumentation.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/types.d.ts +32 -0
- package/build/types-ts3.8/integrations/tracing-channel/fastify/utils.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing-channel/hapi-types.d.ts +65 -0
- package/build/types-ts3.8/integrations/tracing-channel/hapi-utils.d.ts +25 -0
- package/build/types-ts3.8/integrations/tracing-channel/hapi.d.ts +9 -0
- package/build/types-ts3.8/integrations/tracing-channel/ioredis.d.ts +17 -0
- package/build/types-ts3.8/integrations/tracing-channel/lru-memoizer.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/mysql.d.ts +3 -1
- package/build/types-ts3.8/integrations/tracing-channel/openai.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing-channel/postgres.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing-channel/vercel-ai.d.ts +13 -0
- package/build/types-ts3.8/mongoose/index.d.ts +11 -0
- package/build/types-ts3.8/mongoose/mongoose-dc-subscriber.d.ts +63 -0
- package/build/types-ts3.8/node-diagnostics-channel.d.ts +19 -0
- package/build/types-ts3.8/orchestrion/channels.d.ts +21 -0
- package/build/types-ts3.8/orchestrion/config/anthropic-ai.d.ts +31 -0
- package/build/types-ts3.8/orchestrion/config/hapi.d.ts +17 -0
- package/build/types-ts3.8/orchestrion/{config.d.ts → config/index.d.ts} +1 -12
- package/build/types-ts3.8/orchestrion/config/ioredis.d.ts +7 -0
- package/build/types-ts3.8/orchestrion/config/lru-memoizer.d.ts +16 -0
- package/build/types-ts3.8/orchestrion/config/mysql.d.ts +16 -0
- package/build/types-ts3.8/orchestrion/config/openai.d.ts +20 -0
- package/build/types-ts3.8/orchestrion/config/pg.d.ts +33 -0
- package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +11 -0
- package/build/types-ts3.8/orchestrion/detect.d.ts +10 -0
- package/build/types-ts3.8/orchestrion/index.d.ts +53 -2
- package/build/types-ts3.8/redis/redis-statement-serializer.d.ts +6 -0
- package/build/types-ts3.8/tracing-channel.d.ts +22 -0
- package/build/types-ts3.8/vercel-ai/index.d.ts +3 -1
- package/build/types-ts3.8/vercel-ai/vercel-ai-dc-subscriber.d.ts +10 -4
- package/build/types-ts3.8/vercel-ai/vercel-ai-orchestrion-v6-subscriber.d.ts +12 -0
- package/package.json +10 -10
- package/build/cjs/orchestrion/config.js +0 -38
- package/build/cjs/orchestrion/config.js.map +0 -1
- package/build/esm/orchestrion/config.js +0 -34
- package/build/esm/orchestrion/config.js.map +0 -1
- package/build/types/orchestrion/config.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","sources":["../../../../src/orchestrion/bundler/vite.ts"],"sourcesContent":["// EXPERIMENTAL — Vite plugin that runs the orchestrion code transform at build\n// time, injecting `diagnostics_channel.tracingChannel` calls into the libraries\n// listed in `SENTRY_INSTRUMENTATIONS`.\n//\n// This file is published ESM-only via the `@sentry/server-utils/orchestrion/vite`\n// subpath export. `@apm-js-collab/code-transformer-bundler-plugins` is\n// `\"type\": \"module\"`, so consuming it from a CJS build is intentionally\n// unsupported — vite.config.ts is almost always ESM in practice. The CJS\n// rollup variant still emits this file, but `package.json` only exposes the\n// ESM entry, so attempts to `require('@sentry/server-utils/orchestrion/vite')` will\n// fail at resolution time rather than producing a half-broken plugin.\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype UnknownPlugin = any;\n\nimport codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/vite';\nimport MagicString from 'magic-string';\nimport { INSTRUMENTED_MODULE_NAMES, SENTRY_INSTRUMENTATIONS } from '../config';\n\n// `vite` types live in the package's ESM-only subpath; under Node16 module\n// resolution with TS treating @sentry/server-utils as CJS, importing them produces a\n// false positive. We don't need the runtime value for typing — `UnknownPlugin`\n// is sufficient — so we omit the import entirely.\n\n/**\n * Vite plugin that runs the orchestrion code transform on the bundled output.\n *\n * Use when bundling a Node app with Vite (e.g. Vite SSR builds, Nuxt's Nitro\n * pipeline, SvelteKit). For unbundled Node processes use the runtime hook\n * instead (`node --import @sentry/node/orchestrion app.js`).\n *\n * Returns two plugins:\n * 1. `sentry-orchestrion-marker` — a `renderChunk` hook that prepends a\n * single-line banner to entry chunks. The banner sets\n * `globalThis.__SENTRY_ORCHESTRION__.bundler = true` at app boot, so the\n * `_experimentalSetupOrchestrion()` detector can confirm the bundler path\n * ran (rather than relying on a build-time flag that wouldn't be visible\n * to the runtime).\n * Also injects every instrumented package name into `ssr.noExternal` via\n * the `config` hook, since externalized deps are `require()`d at runtime\n * from `node_modules` and never pass through the transform.\n * 2. The upstream `@apm-js-collab/code-transformer-bundler-plugins/vite`\n * plugin, fed our central `SENTRY_INSTRUMENTATIONS` config.\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { sentryOrchestrionPlugin } from '@sentry/node/orchestrion/vite';\n * export default { plugins: [sentryOrchestrionPlugin()] };\n * ```\n */\nexport function sentryOrchestrionPlugin(): UnknownPlugin[] {\n const codeTransformerPlugins = codeTransformer({ instrumentations: SENTRY_INSTRUMENTATIONS });\n const codeTransformerArray: UnknownPlugin[] = Array.isArray(codeTransformerPlugins)\n ? codeTransformerPlugins\n : [codeTransformerPlugins];\n return [bundlerMarkerPlugin(), ...codeTransformerArray];\n}\n\nfunction bundlerMarkerPlugin(): UnknownPlugin {\n const banner = [\n 'globalThis.__SENTRY_ORCHESTRION__ = (globalThis.__SENTRY_ORCHESTRION__ || {});',\n 'globalThis.__SENTRY_ORCHESTRION__.bundler = true;',\n '',\n ].join('\\n');\n\n return {\n name: 'sentry-orchestrion-marker',\n enforce: 'pre' as const,\n config(): { ssr: { noExternal: string[] } } {\n // Force-bundle every instrumented package so the code transform actually\n // sees its source. Vite externalizes dependencies in SSR builds by\n // default, leaving them as bare `require()`/`import` calls resolved from\n // `node_modules` at runtime — those copies are untouched and the\n // diagnostics_channel calls never get injected. Vite merges array\n // `noExternal` entries with the user's config, so we don't overwrite\n // their additions.\n return { ssr: { noExternal: INSTRUMENTED_MODULE_NAMES } };\n },\n renderChunk(code: string, chunk: { isEntry: boolean }): { code: string; map: unknown } | null {\n if (!chunk.isEntry) return null;\n // Prepend via magic-string so the entry chunk's sourcemap stays aligned —\n // returning `map: null` here would shift every mapping by the banner's\n // line count and misattribute server stack traces.\n const ms = new MagicString(code);\n ms.prepend(banner);\n return { code: ms.toString(), map: ms.generateMap({ hires: true }) };\n },\n };\n}\n"],"names":["codeTransformer","SENTRY_INSTRUMENTATIONS","INSTRUMENTED_MODULE_NAMES","MagicString"],"mappings":";;;;;;AAmDO,SAAS,uBAAA,GAA2C;AACzD,EAAA,MAAM,sBAAA,GAAyBA,uBAAA,CAAgB,EAAE,gBAAA,EAAkBC,
|
|
1
|
+
{"version":3,"file":"vite.js","sources":["../../../../src/orchestrion/bundler/vite.ts"],"sourcesContent":["// EXPERIMENTAL — Vite plugin that runs the orchestrion code transform at build\n// time, injecting `diagnostics_channel.tracingChannel` calls into the libraries\n// listed in `SENTRY_INSTRUMENTATIONS`.\n//\n// This file is published ESM-only via the `@sentry/server-utils/orchestrion/vite`\n// subpath export. `@apm-js-collab/code-transformer-bundler-plugins` is\n// `\"type\": \"module\"`, so consuming it from a CJS build is intentionally\n// unsupported — vite.config.ts is almost always ESM in practice. The CJS\n// rollup variant still emits this file, but `package.json` only exposes the\n// ESM entry, so attempts to `require('@sentry/server-utils/orchestrion/vite')` will\n// fail at resolution time rather than producing a half-broken plugin.\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype UnknownPlugin = any;\n\nimport codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/vite';\nimport MagicString from 'magic-string';\nimport { INSTRUMENTED_MODULE_NAMES, SENTRY_INSTRUMENTATIONS } from '../config';\n\n// `vite` types live in the package's ESM-only subpath; under Node16 module\n// resolution with TS treating @sentry/server-utils as CJS, importing them produces a\n// false positive. We don't need the runtime value for typing — `UnknownPlugin`\n// is sufficient — so we omit the import entirely.\n\n/**\n * Vite plugin that runs the orchestrion code transform on the bundled output.\n *\n * Use when bundling a Node app with Vite (e.g. Vite SSR builds, Nuxt's Nitro\n * pipeline, SvelteKit). For unbundled Node processes use the runtime hook\n * instead (`node --import @sentry/node/orchestrion app.js`).\n *\n * Returns two plugins:\n * 1. `sentry-orchestrion-marker` — a `renderChunk` hook that prepends a\n * single-line banner to entry chunks. The banner sets\n * `globalThis.__SENTRY_ORCHESTRION__.bundler = true` at app boot, so the\n * `_experimentalSetupOrchestrion()` detector can confirm the bundler path\n * ran (rather than relying on a build-time flag that wouldn't be visible\n * to the runtime).\n * Also injects every instrumented package name into `ssr.noExternal` via\n * the `config` hook, since externalized deps are `require()`d at runtime\n * from `node_modules` and never pass through the transform.\n * 2. The upstream `@apm-js-collab/code-transformer-bundler-plugins/vite`\n * plugin, fed our central `SENTRY_INSTRUMENTATIONS` config.\n *\n * @example\n * ```ts\n * // vite.config.ts\n * import { sentryOrchestrionPlugin } from '@sentry/node/orchestrion/vite';\n * export default { plugins: [sentryOrchestrionPlugin()] };\n * ```\n */\nexport function sentryOrchestrionPlugin(): UnknownPlugin[] {\n const codeTransformerPlugins = codeTransformer({ instrumentations: SENTRY_INSTRUMENTATIONS });\n const codeTransformerArray: UnknownPlugin[] = Array.isArray(codeTransformerPlugins)\n ? codeTransformerPlugins\n : [codeTransformerPlugins];\n return [bundlerMarkerPlugin(), ...codeTransformerArray];\n}\n\nfunction bundlerMarkerPlugin(): UnknownPlugin {\n const banner = [\n 'globalThis.__SENTRY_ORCHESTRION__ = (globalThis.__SENTRY_ORCHESTRION__ || {});',\n 'globalThis.__SENTRY_ORCHESTRION__.bundler = true;',\n '',\n ].join('\\n');\n\n return {\n name: 'sentry-orchestrion-marker',\n enforce: 'pre' as const,\n config(): { ssr: { noExternal: string[] } } {\n // Force-bundle every instrumented package so the code transform actually\n // sees its source. Vite externalizes dependencies in SSR builds by\n // default, leaving them as bare `require()`/`import` calls resolved from\n // `node_modules` at runtime — those copies are untouched and the\n // diagnostics_channel calls never get injected. Vite merges array\n // `noExternal` entries with the user's config, so we don't overwrite\n // their additions.\n return { ssr: { noExternal: INSTRUMENTED_MODULE_NAMES } };\n },\n renderChunk(code: string, chunk: { isEntry: boolean }): { code: string; map: unknown } | null {\n if (!chunk.isEntry) return null;\n // Prepend via magic-string so the entry chunk's sourcemap stays aligned —\n // returning `map: null` here would shift every mapping by the banner's\n // line count and misattribute server stack traces.\n const ms = new MagicString(code);\n ms.prepend(banner);\n return { code: ms.toString(), map: ms.generateMap({ hires: true }) };\n },\n };\n}\n"],"names":["codeTransformer","SENTRY_INSTRUMENTATIONS","INSTRUMENTED_MODULE_NAMES","MagicString"],"mappings":";;;;;;AAmDO,SAAS,uBAAA,GAA2C;AACzD,EAAA,MAAM,sBAAA,GAAyBA,uBAAA,CAAgB,EAAE,gBAAA,EAAkBC,+BAAyB,CAAA;AAC5F,EAAA,MAAM,uBAAwC,KAAA,CAAM,OAAA,CAAQ,sBAAsB,CAAA,GAC9E,sBAAA,GACA,CAAC,sBAAsB,CAAA;AAC3B,EAAA,OAAO,CAAC,mBAAA,EAAoB,EAAG,GAAG,oBAAoB,CAAA;AACxD;AAEA,SAAS,mBAAA,GAAqC;AAC5C,EAAA,MAAM,MAAA,GAAS;AAAA,IACb,gFAAA;AAAA,IACA,mDAAA;AAAA,IACA;AAAA,GACF,CAAE,KAAK,IAAI,CAAA;AAEX,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,2BAAA;AAAA,IACN,OAAA,EAAS,KAAA;AAAA,IACT,MAAA,GAA4C;AAQ1C,MAAA,OAAO,EAAE,GAAA,EAAK,EAAE,UAAA,EAAYC,iCAA0B,EAAE;AAAA,IAC1D,CAAA;AAAA,IACA,WAAA,CAAY,MAAc,KAAA,EAAoE;AAC5F,MAAA,IAAI,CAAC,KAAA,CAAM,OAAA,EAAS,OAAO,IAAA;AAI3B,MAAA,MAAM,EAAA,GAAK,IAAIC,mBAAA,CAAY,IAAI,CAAA;AAC/B,MAAA,EAAA,CAAG,QAAQ,MAAM,CAAA;AACjB,MAAA,OAAO,EAAE,IAAA,EAAM,EAAA,CAAG,QAAA,EAAS,EAAG,GAAA,EAAK,EAAA,CAAG,WAAA,CAAY,EAAE,KAAA,EAAO,IAAA,EAAM,CAAA,EAAE;AAAA,IACrE;AAAA,GACF;AACF;;;;"}
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
+
const mysql = require('./config/mysql.js');
|
|
4
|
+
const lruMemoizer = require('./config/lru-memoizer.js');
|
|
5
|
+
const ioredis = require('./config/ioredis.js');
|
|
6
|
+
const pg = require('./config/pg.js');
|
|
7
|
+
const openai = require('./config/openai.js');
|
|
8
|
+
const anthropicAi = require('./config/anthropic-ai.js');
|
|
9
|
+
const vercelAi = require('./config/vercel-ai.js');
|
|
10
|
+
const hapi = require('./config/hapi.js');
|
|
11
|
+
|
|
3
12
|
const CHANNELS = {
|
|
4
|
-
|
|
13
|
+
...mysql.mysqlChannels,
|
|
14
|
+
...lruMemoizer.lruMemoizerChannels,
|
|
15
|
+
...ioredis.ioredisChannels,
|
|
16
|
+
...pg.pgChannels,
|
|
17
|
+
...openai.openaiChannels,
|
|
18
|
+
...anthropicAi.anthropicAiChannels,
|
|
19
|
+
...vercelAi.vercelAiChannels,
|
|
20
|
+
...hapi.hapiChannels
|
|
5
21
|
};
|
|
6
22
|
|
|
7
23
|
exports.CHANNELS = CHANNELS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.js","sources":["../../../src/orchestrion/channels.ts"],"sourcesContent":["/**\n * Fully-qualified `diagnostics_channel` names that orchestrion publishes to.\n *\n * Orchestrion's transform always prefixes the configured `channelName` with\n * `orchestrion:${module.name}:`. So a config of\n * `{ channelName: 'query', module: { name: 'mysql' } }`\n * publishes to `orchestrion:mysql:query`.\n *\n * Subscribers (`integrations/<lib>/tracing-channel.ts`) consume the full\n * prefixed string from this map; the config files set only the unprefixed\n * suffix in `channelName`. Keeping both pieces in one file is what guarantees\n * they don't drift apart and silently stop firing.\n */\nexport const CHANNELS = {\n
|
|
1
|
+
{"version":3,"file":"channels.js","sources":["../../../src/orchestrion/channels.ts"],"sourcesContent":["import { mysqlChannels } from './config/mysql';\nimport { lruMemoizerChannels } from './config/lru-memoizer';\nimport { ioredisChannels } from './config/ioredis';\nimport { pgChannels } from './config/pg';\nimport { openaiChannels } from './config/openai';\nimport { anthropicAiChannels } from './config/anthropic-ai';\nimport { vercelAiChannels } from './config/vercel-ai';\nimport { hapiChannels } from './config/hapi';\n\n/**\n * Fully-qualified `diagnostics_channel` names that orchestrion publishes to.\n *\n * Orchestrion's transform always prefixes the configured `channelName` with\n * `orchestrion:${module.name}:`. So a config of\n * `{ channelName: 'query', module: { name: 'mysql' } }`\n * publishes to `orchestrion:mysql:query`.\n *\n * Subscribers (`integrations/<lib>/tracing-channel.ts`) consume the full\n * prefixed string from this map; the config files set only the unprefixed\n * suffix in `channelName`. Keeping both pieces in one file is what guarantees\n * they don't drift apart and silently stop firing.\n */\nexport const CHANNELS = {\n ...mysqlChannels,\n ...lruMemoizerChannels,\n ...ioredisChannels,\n ...pgChannels,\n ...openaiChannels,\n ...anthropicAiChannels,\n ...vercelAiChannels,\n ...hapiChannels,\n} as const;\n\nexport type ChannelName = (typeof CHANNELS)[keyof typeof CHANNELS];\n"],"names":["mysqlChannels","lruMemoizerChannels","ioredisChannels","pgChannels","openaiChannels","anthropicAiChannels","vercelAiChannels","hapiChannels"],"mappings":";;;;;;;;;;;AAsBO,MAAM,QAAA,GAAW;AAAA,EACtB,GAAGA,mBAAA;AAAA,EACH,GAAGC,+BAAA;AAAA,EACH,GAAGC,uBAAA;AAAA,EACH,GAAGC,aAAA;AAAA,EACH,GAAGC,qBAAA;AAAA,EACH,GAAGC,+BAAA;AAAA,EACH,GAAGC,yBAAA;AAAA,EACH,GAAGC;AACL;;;;"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const anthropicAiConfig = [
|
|
4
|
+
// One entry each for CJS/ESM
|
|
5
|
+
...["resources/messages/messages.js", "resources/messages/messages.mjs"].flatMap(
|
|
6
|
+
(filePath) => ["create", "countTokens"].map((methodName) => ({
|
|
7
|
+
channelName: "chat",
|
|
8
|
+
module: { name: "@anthropic-ai/sdk", versionRange: ">=0.19.2 <1", filePath },
|
|
9
|
+
functionQuery: { className: "Messages", methodName, kind: "Auto" }
|
|
10
|
+
}))
|
|
11
|
+
),
|
|
12
|
+
...["resources/completions.js", "resources/completions.mjs"].map((filePath) => ({
|
|
13
|
+
channelName: "chat",
|
|
14
|
+
module: { name: "@anthropic-ai/sdk", versionRange: ">=0.19.2 <1", filePath },
|
|
15
|
+
functionQuery: { className: "Completions", methodName: "create", kind: "Auto" }
|
|
16
|
+
})),
|
|
17
|
+
...["resources/beta/messages/messages.js", "resources/beta/messages/messages.mjs"].map((filePath) => ({
|
|
18
|
+
channelName: "chat",
|
|
19
|
+
module: { name: "@anthropic-ai/sdk", versionRange: ">=0.19.2 <1", filePath },
|
|
20
|
+
functionQuery: { className: "Messages", methodName: "create", kind: "Auto" }
|
|
21
|
+
})),
|
|
22
|
+
...["resources/models.js", "resources/models.mjs"].map((filePath) => ({
|
|
23
|
+
channelName: "models",
|
|
24
|
+
module: { name: "@anthropic-ai/sdk", versionRange: ">=0.19.2 <1", filePath },
|
|
25
|
+
functionQuery: { className: "Models", methodName: "retrieve", kind: "Auto" }
|
|
26
|
+
})),
|
|
27
|
+
// `messages.stream()` returns a synchronous emitter, not a promise, so `kind: 'Sync'` is required:
|
|
28
|
+
// `Auto`'s promise wrapper never publishes `end` for a non-thenable return, so the span would never end.
|
|
29
|
+
...["resources/messages/messages.js", "resources/messages/messages.mjs"].map((filePath) => ({
|
|
30
|
+
channelName: "messages-stream",
|
|
31
|
+
module: { name: "@anthropic-ai/sdk", versionRange: ">=0.19.2 <1", filePath },
|
|
32
|
+
functionQuery: { className: "Messages", methodName: "stream", kind: "Sync" }
|
|
33
|
+
}))
|
|
34
|
+
];
|
|
35
|
+
const anthropicAiChannels = {
|
|
36
|
+
ANTHROPIC_CHAT: "orchestrion:@anthropic-ai/sdk:chat",
|
|
37
|
+
ANTHROPIC_MODELS: "orchestrion:@anthropic-ai/sdk:models",
|
|
38
|
+
ANTHROPIC_MESSAGES_STREAM: "orchestrion:@anthropic-ai/sdk:messages-stream"
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.anthropicAiChannels = anthropicAiChannels;
|
|
42
|
+
exports.anthropicAiConfig = anthropicAiConfig;
|
|
43
|
+
//# sourceMappingURL=anthropic-ai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anthropic-ai.js","sources":["../../../../src/orchestrion/config/anthropic-ai.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\nexport const anthropicAiConfig = [\n // One entry each for CJS/ESM\n ...['resources/messages/messages.js', 'resources/messages/messages.mjs'].flatMap(filePath =>\n (['create', 'countTokens'] as const).map(methodName => ({\n channelName: 'chat',\n module: { name: '@anthropic-ai/sdk', versionRange: '>=0.19.2 <1', filePath },\n functionQuery: { className: 'Messages', methodName, kind: 'Auto' as const },\n })),\n ),\n ...['resources/completions.js', 'resources/completions.mjs'].map(filePath => ({\n channelName: 'chat',\n module: { name: '@anthropic-ai/sdk', versionRange: '>=0.19.2 <1', filePath },\n functionQuery: { className: 'Completions', methodName: 'create', kind: 'Auto' as const },\n })),\n ...['resources/beta/messages/messages.js', 'resources/beta/messages/messages.mjs'].map(filePath => ({\n channelName: 'chat',\n module: { name: '@anthropic-ai/sdk', versionRange: '>=0.19.2 <1', filePath },\n functionQuery: { className: 'Messages', methodName: 'create', kind: 'Auto' as const },\n })),\n ...['resources/models.js', 'resources/models.mjs'].map(filePath => ({\n channelName: 'models',\n module: { name: '@anthropic-ai/sdk', versionRange: '>=0.19.2 <1', filePath },\n functionQuery: { className: 'Models', methodName: 'retrieve', kind: 'Auto' as const },\n })),\n // `messages.stream()` returns a synchronous emitter, not a promise, so `kind: 'Sync'` is required:\n // `Auto`'s promise wrapper never publishes `end` for a non-thenable return, so the span would never end.\n ...['resources/messages/messages.js', 'resources/messages/messages.mjs'].map(filePath => ({\n channelName: 'messages-stream',\n module: { name: '@anthropic-ai/sdk', versionRange: '>=0.19.2 <1', filePath },\n functionQuery: { className: 'Messages', methodName: 'stream', kind: 'Sync' as const },\n })),\n] satisfies InstrumentationConfig[];\n\nexport const anthropicAiChannels = {\n ANTHROPIC_CHAT: 'orchestrion:@anthropic-ai/sdk:chat',\n ANTHROPIC_MODELS: 'orchestrion:@anthropic-ai/sdk:models',\n ANTHROPIC_MESSAGES_STREAM: 'orchestrion:@anthropic-ai/sdk:messages-stream',\n} as const;\n"],"names":[],"mappings":";;AAEO,MAAM,iBAAA,GAAoB;AAAA;AAAA,EAE/B,GAAG,CAAC,gCAAA,EAAkC,iCAAiC,CAAA,CAAE,OAAA;AAAA,IAAQ,cAC9E,CAAC,QAAA,EAAU,aAAa,CAAA,CAAY,IAAI,CAAA,UAAA,MAAe;AAAA,MACtD,WAAA,EAAa,MAAA;AAAA,MACb,QAAQ,EAAE,IAAA,EAAM,mBAAA,EAAqB,YAAA,EAAc,eAAe,QAAA,EAAS;AAAA,MAC3E,eAAe,EAAE,SAAA,EAAW,UAAA,EAAY,UAAA,EAAY,MAAM,MAAA;AAAgB,KAC5E,CAAE;AAAA,GACJ;AAAA,EACA,GAAG,CAAC,0BAAA,EAA4B,2BAA2B,CAAA,CAAE,IAAI,CAAA,QAAA,MAAa;AAAA,IAC5E,WAAA,EAAa,MAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,mBAAA,EAAqB,YAAA,EAAc,eAAe,QAAA,EAAS;AAAA,IAC3E,eAAe,EAAE,SAAA,EAAW,eAAe,UAAA,EAAY,QAAA,EAAU,MAAM,MAAA;AAAgB,GACzF,CAAE,CAAA;AAAA,EACF,GAAG,CAAC,qCAAA,EAAuC,sCAAsC,CAAA,CAAE,IAAI,CAAA,QAAA,MAAa;AAAA,IAClG,WAAA,EAAa,MAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,mBAAA,EAAqB,YAAA,EAAc,eAAe,QAAA,EAAS;AAAA,IAC3E,eAAe,EAAE,SAAA,EAAW,YAAY,UAAA,EAAY,QAAA,EAAU,MAAM,MAAA;AAAgB,GACtF,CAAE,CAAA;AAAA,EACF,GAAG,CAAC,qBAAA,EAAuB,sBAAsB,CAAA,CAAE,IAAI,CAAA,QAAA,MAAa;AAAA,IAClE,WAAA,EAAa,QAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,mBAAA,EAAqB,YAAA,EAAc,eAAe,QAAA,EAAS;AAAA,IAC3E,eAAe,EAAE,SAAA,EAAW,UAAU,UAAA,EAAY,UAAA,EAAY,MAAM,MAAA;AAAgB,GACtF,CAAE,CAAA;AAAA;AAAA;AAAA,EAGF,GAAG,CAAC,gCAAA,EAAkC,iCAAiC,CAAA,CAAE,IAAI,CAAA,QAAA,MAAa;AAAA,IACxF,WAAA,EAAa,iBAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,mBAAA,EAAqB,YAAA,EAAc,eAAe,QAAA,EAAS;AAAA,IAC3E,eAAe,EAAE,SAAA,EAAW,YAAY,UAAA,EAAY,QAAA,EAAU,MAAM,MAAA;AAAgB,GACtF,CAAE;AACJ;AAEO,MAAM,mBAAA,GAAsB;AAAA,EACjC,cAAA,EAAgB,oCAAA;AAAA,EAChB,gBAAA,EAAkB,sCAAA;AAAA,EAClB,yBAAA,EAA2B;AAC7B;;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const hapiConfig = [
|
|
4
|
+
// hapi's `route`/`ext` live on an anonymous class (`internals.Server = class {}`),
|
|
5
|
+
// so `{className}` can't match — `{methodName}` targets them in lib/server.js. Both
|
|
6
|
+
// are synchronous void methods, so `Sync` suffices: we only use `start` to swap
|
|
7
|
+
// handlers in `ctx.arguments`. Shape verified across the whole range.
|
|
8
|
+
{
|
|
9
|
+
channelName: "route",
|
|
10
|
+
module: { name: "@hapi/hapi", versionRange: ">=17.0.0 <22.0.0", filePath: "lib/server.js" },
|
|
11
|
+
functionQuery: { methodName: "route", kind: "Sync" }
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
channelName: "ext",
|
|
15
|
+
module: { name: "@hapi/hapi", versionRange: ">=17.0.0 <22.0.0", filePath: "lib/server.js" },
|
|
16
|
+
functionQuery: { methodName: "ext", kind: "Sync" }
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
const hapiChannels = {
|
|
20
|
+
HAPI_ROUTE: "orchestrion:@hapi/hapi:route",
|
|
21
|
+
HAPI_EXT: "orchestrion:@hapi/hapi:ext"
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.hapiChannels = hapiChannels;
|
|
25
|
+
exports.hapiConfig = hapiConfig;
|
|
26
|
+
//# sourceMappingURL=hapi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hapi.js","sources":["../../../../src/orchestrion/config/hapi.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\nexport const hapiConfig = [\n // hapi's `route`/`ext` live on an anonymous class (`internals.Server = class {}`),\n // so `{className}` can't match — `{methodName}` targets them in lib/server.js. Both\n // are synchronous void methods, so `Sync` suffices: we only use `start` to swap\n // handlers in `ctx.arguments`. Shape verified across the whole range.\n {\n channelName: 'route',\n module: { name: '@hapi/hapi', versionRange: '>=17.0.0 <22.0.0', filePath: 'lib/server.js' },\n functionQuery: { methodName: 'route', kind: 'Sync' },\n },\n {\n channelName: 'ext',\n module: { name: '@hapi/hapi', versionRange: '>=17.0.0 <22.0.0', filePath: 'lib/server.js' },\n functionQuery: { methodName: 'ext', kind: 'Sync' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const hapiChannels = {\n HAPI_ROUTE: 'orchestrion:@hapi/hapi:route',\n HAPI_EXT: 'orchestrion:@hapi/hapi:ext',\n} as const;\n"],"names":[],"mappings":";;AAEO,MAAM,UAAA,GAAa;AAAA;AAAA;AAAA;AAAA;AAAA,EAKxB;AAAA,IACE,WAAA,EAAa,OAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,cAAc,YAAA,EAAc,kBAAA,EAAoB,UAAU,eAAA,EAAgB;AAAA,IAC1F,aAAA,EAAe,EAAE,UAAA,EAAY,OAAA,EAAS,MAAM,MAAA;AAAO,GACrD;AAAA,EACA;AAAA,IACE,WAAA,EAAa,KAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,cAAc,YAAA,EAAc,kBAAA,EAAoB,UAAU,eAAA,EAAgB;AAAA,IAC1F,aAAA,EAAe,EAAE,UAAA,EAAY,KAAA,EAAO,MAAM,MAAA;AAAO;AAErD;AAEO,MAAM,YAAA,GAAe;AAAA,EAC1B,UAAA,EAAY,8BAAA;AAAA,EACZ,QAAA,EAAU;AACZ;;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const mysql = require('./mysql.js');
|
|
4
|
+
const lruMemoizer = require('./lru-memoizer.js');
|
|
5
|
+
const ioredis = require('./ioredis.js');
|
|
6
|
+
const openai = require('./openai.js');
|
|
7
|
+
const pg = require('./pg.js');
|
|
8
|
+
const anthropicAi = require('./anthropic-ai.js');
|
|
9
|
+
const vercelAi = require('./vercel-ai.js');
|
|
10
|
+
const hapi = require('./hapi.js');
|
|
11
|
+
|
|
12
|
+
const SENTRY_INSTRUMENTATIONS = [
|
|
13
|
+
...mysql.mysqlConfig,
|
|
14
|
+
...lruMemoizer.lruMemoizerConfig,
|
|
15
|
+
...ioredis.ioredisConfig,
|
|
16
|
+
...openai.openaiConfig,
|
|
17
|
+
...pg.pgConfig,
|
|
18
|
+
...anthropicAi.anthropicAiConfig,
|
|
19
|
+
...vercelAi.vercelAiConfig,
|
|
20
|
+
...hapi.hapiConfig
|
|
21
|
+
];
|
|
22
|
+
const INSTRUMENTED_MODULE_NAMES = Array.from(new Set(SENTRY_INSTRUMENTATIONS.map((i) => i.module.name)));
|
|
23
|
+
function withoutInstrumentedExternals(external) {
|
|
24
|
+
if (!external) {
|
|
25
|
+
return void 0;
|
|
26
|
+
}
|
|
27
|
+
return external.filter(
|
|
28
|
+
(entry) => !INSTRUMENTED_MODULE_NAMES.some((name) => entry === name || entry.startsWith(`${name}/`))
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
exports.INSTRUMENTED_MODULE_NAMES = INSTRUMENTED_MODULE_NAMES;
|
|
33
|
+
exports.SENTRY_INSTRUMENTATIONS = SENTRY_INSTRUMENTATIONS;
|
|
34
|
+
exports.withoutInstrumentedExternals = withoutInstrumentedExternals;
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/orchestrion/config/index.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\nimport { mysqlConfig } from './mysql';\nimport { lruMemoizerConfig } from './lru-memoizer';\nimport { ioredisConfig } from './ioredis';\nimport { openaiConfig } from './openai';\nimport { pgConfig } from './pg';\nimport { anthropicAiConfig } from './anthropic-ai';\nimport { vercelAiConfig } from './vercel-ai';\nimport { hapiConfig } from './hapi';\n\nexport const SENTRY_INSTRUMENTATIONS: InstrumentationConfig[] = [\n ...mysqlConfig,\n ...lruMemoizerConfig,\n ...ioredisConfig,\n ...openaiConfig,\n ...pgConfig,\n ...anthropicAiConfig,\n ...vercelAiConfig,\n ...hapiConfig,\n];\n\n/**\n * The unique set of package names instrumented by `SENTRY_INSTRUMENTATIONS`\n * (e.g. `['mysql']`).\n *\n * Bundler plugins MUST ensure these are actually bundled rather than\n * externalized: an externalized dependency is resolved from `node_modules` at\n * runtime and never passes through the code transform's `onLoad`, so its\n * diagnostics_channel calls are silently never injected.\n */\nexport const INSTRUMENTED_MODULE_NAMES: string[] = Array.from(new Set(SENTRY_INSTRUMENTATIONS.map(i => i.module.name)));\n\n/**\n * Returns `external` with any instrumented packages removed, so a bundler that\n * uses an \"external\" denylist (esbuild, Bun, Rollup) still bundles — and thus\n * transforms — them. Matches an exact package name (`'mysql'`) or a subpath\n * (`'mysql/lib/...'`); wildcard/other patterns are left untouched. `undefined`\n * is returned unchanged.\n *\n * (Vite uses an `ssr.noExternal` allowlist instead, so it consumes\n * `INSTRUMENTED_MODULE_NAMES` directly rather than this helper.)\n */\nexport function withoutInstrumentedExternals(external: readonly string[] | undefined): string[] | undefined {\n if (!external) {\n return undefined;\n }\n return external.filter(\n entry => !INSTRUMENTED_MODULE_NAMES.some(name => entry === name || entry.startsWith(`${name}/`)),\n );\n}\n"],"names":["mysqlConfig","lruMemoizerConfig","ioredisConfig","openaiConfig","pgConfig","anthropicAiConfig","vercelAiConfig","hapiConfig"],"mappings":";;;;;;;;;;;AAUO,MAAM,uBAAA,GAAmD;AAAA,EAC9D,GAAGA,iBAAA;AAAA,EACH,GAAGC,6BAAA;AAAA,EACH,GAAGC,qBAAA;AAAA,EACH,GAAGC,mBAAA;AAAA,EACH,GAAGC,WAAA;AAAA,EACH,GAAGC,6BAAA;AAAA,EACH,GAAGC,uBAAA;AAAA,EACH,GAAGC;AACL;AAWO,MAAM,yBAAA,GAAsC,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,uBAAA,CAAwB,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,CAAO,IAAI,CAAC,CAAC;AAY/G,SAAS,6BAA6B,QAAA,EAA+D;AAC1G,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,QAAA,CAAS,MAAA;AAAA,IACd,CAAA,KAAA,KAAS,CAAC,yBAAA,CAA0B,IAAA,CAAK,CAAA,IAAA,KAAQ,KAAA,KAAU,IAAA,IAAQ,KAAA,CAAM,UAAA,CAAW,CAAA,EAAG,IAAI,CAAA,CAAA,CAAG,CAAC;AAAA,GACjG;AACF;;;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const ioredisConfig = [
|
|
4
|
+
// ioredis `<5.11.0` (>=5.11.0 publishes its own `ioredis:*` diagnostics_channel)
|
|
5
|
+
...["lib/redis.js", "built/redis.js", "built/redis/index.js"].flatMap((filePath) => [
|
|
6
|
+
{
|
|
7
|
+
channelName: "command",
|
|
8
|
+
module: { name: "ioredis", versionRange: ">=2.0.0 <5.0.0", filePath },
|
|
9
|
+
functionQuery: { expressionName: "sendCommand", kind: "Async" }
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
channelName: "connect",
|
|
13
|
+
module: { name: "ioredis", versionRange: ">=2.0.0 <5.0.0", filePath },
|
|
14
|
+
functionQuery: { expressionName: "connect", kind: "Async" }
|
|
15
|
+
}
|
|
16
|
+
]),
|
|
17
|
+
{
|
|
18
|
+
channelName: "command",
|
|
19
|
+
module: { name: "ioredis", versionRange: ">=5.0.0 <5.11.0", filePath: "built/Redis.js" },
|
|
20
|
+
functionQuery: { className: "Redis", methodName: "sendCommand", kind: "Async" }
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
channelName: "connect",
|
|
24
|
+
module: { name: "ioredis", versionRange: ">=5.0.0 <5.11.0", filePath: "built/Redis.js" },
|
|
25
|
+
functionQuery: { className: "Redis", methodName: "connect", kind: "Async" }
|
|
26
|
+
}
|
|
27
|
+
];
|
|
28
|
+
const ioredisChannels = {
|
|
29
|
+
IOREDIS_COMMAND: "orchestrion:ioredis:command",
|
|
30
|
+
IOREDIS_CONNECT: "orchestrion:ioredis:connect"
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.ioredisChannels = ioredisChannels;
|
|
34
|
+
exports.ioredisConfig = ioredisConfig;
|
|
35
|
+
//# sourceMappingURL=ioredis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ioredis.js","sources":["../../../../src/orchestrion/config/ioredis.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\nexport const ioredisConfig = [\n // ioredis `<5.11.0` (>=5.11.0 publishes its own `ioredis:*` diagnostics_channel)\n ...['lib/redis.js', 'built/redis.js', 'built/redis/index.js'].flatMap((filePath): InstrumentationConfig[] => [\n {\n channelName: 'command',\n module: { name: 'ioredis', versionRange: '>=2.0.0 <5.0.0', filePath },\n functionQuery: { expressionName: 'sendCommand', kind: 'Async' },\n },\n {\n channelName: 'connect',\n module: { name: 'ioredis', versionRange: '>=2.0.0 <5.0.0', filePath },\n functionQuery: { expressionName: 'connect', kind: 'Async' },\n },\n ]),\n {\n channelName: 'command',\n module: { name: 'ioredis', versionRange: '>=5.0.0 <5.11.0', filePath: 'built/Redis.js' },\n functionQuery: { className: 'Redis', methodName: 'sendCommand', kind: 'Async' },\n },\n {\n channelName: 'connect',\n module: { name: 'ioredis', versionRange: '>=5.0.0 <5.11.0', filePath: 'built/Redis.js' },\n functionQuery: { className: 'Redis', methodName: 'connect', kind: 'Async' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const ioredisChannels = {\n IOREDIS_COMMAND: 'orchestrion:ioredis:command',\n IOREDIS_CONNECT: 'orchestrion:ioredis:connect',\n} as const;\n"],"names":[],"mappings":";;AAEO,MAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B,GAAG,CAAC,cAAA,EAAgB,gBAAA,EAAkB,sBAAsB,CAAA,CAAE,OAAA,CAAQ,CAAC,QAAA,KAAsC;AAAA,IAC3G;AAAA,MACE,WAAA,EAAa,SAAA;AAAA,MACb,QAAQ,EAAE,IAAA,EAAM,SAAA,EAAW,YAAA,EAAc,kBAAkB,QAAA,EAAS;AAAA,MACpE,aAAA,EAAe,EAAE,cAAA,EAAgB,aAAA,EAAe,MAAM,OAAA;AAAQ,KAChE;AAAA,IACA;AAAA,MACE,WAAA,EAAa,SAAA;AAAA,MACb,QAAQ,EAAE,IAAA,EAAM,SAAA,EAAW,YAAA,EAAc,kBAAkB,QAAA,EAAS;AAAA,MACpE,aAAA,EAAe,EAAE,cAAA,EAAgB,SAAA,EAAW,MAAM,OAAA;AAAQ;AAC5D,GACD,CAAA;AAAA,EACD;AAAA,IACE,WAAA,EAAa,SAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,WAAW,YAAA,EAAc,iBAAA,EAAmB,UAAU,gBAAA,EAAiB;AAAA,IACvF,eAAe,EAAE,SAAA,EAAW,SAAS,UAAA,EAAY,aAAA,EAAe,MAAM,OAAA;AAAQ,GAChF;AAAA,EACA;AAAA,IACE,WAAA,EAAa,SAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,WAAW,YAAA,EAAc,iBAAA,EAAmB,UAAU,gBAAA,EAAiB;AAAA,IACvF,eAAe,EAAE,SAAA,EAAW,SAAS,UAAA,EAAY,SAAA,EAAW,MAAM,OAAA;AAAQ;AAE9E;AAEO,MAAM,eAAA,GAAkB;AAAA,EAC7B,eAAA,EAAiB,6BAAA;AAAA,EACjB,eAAA,EAAiB;AACnB;;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const lruMemoizerConfig = [
|
|
4
|
+
{
|
|
5
|
+
channelName: "load",
|
|
6
|
+
// `>=2.1.0` only: the named `function memoizedFunction()` the selector targets exists from 2.1.0
|
|
7
|
+
module: { name: "lru-memoizer", versionRange: ">=2.1.0 <4", filePath: "lib/async.js" },
|
|
8
|
+
functionQuery: { functionName: "memoizedFunction", kind: "Callback" }
|
|
9
|
+
}
|
|
10
|
+
];
|
|
11
|
+
const lruMemoizerChannels = {
|
|
12
|
+
LRU_MEMOIZER_LOAD: "orchestrion:lru-memoizer:load"
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.lruMemoizerChannels = lruMemoizerChannels;
|
|
16
|
+
exports.lruMemoizerConfig = lruMemoizerConfig;
|
|
17
|
+
//# sourceMappingURL=lru-memoizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lru-memoizer.js","sources":["../../../../src/orchestrion/config/lru-memoizer.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\nexport const lruMemoizerConfig = [\n {\n channelName: 'load',\n // `>=2.1.0` only: the named `function memoizedFunction()` the selector targets exists from 2.1.0\n module: { name: 'lru-memoizer', versionRange: '>=2.1.0 <4', filePath: 'lib/async.js' },\n functionQuery: { functionName: 'memoizedFunction', kind: 'Callback' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const lruMemoizerChannels = {\n LRU_MEMOIZER_LOAD: 'orchestrion:lru-memoizer:load',\n} as const;\n"],"names":[],"mappings":";;AAEO,MAAM,iBAAA,GAAoB;AAAA,EAC/B;AAAA,IACE,WAAA,EAAa,MAAA;AAAA;AAAA,IAEb,QAAQ,EAAE,IAAA,EAAM,gBAAgB,YAAA,EAAc,YAAA,EAAc,UAAU,cAAA,EAAe;AAAA,IACrF,aAAA,EAAe,EAAE,YAAA,EAAc,kBAAA,EAAoB,MAAM,UAAA;AAAW;AAExE;AAEO,MAAM,mBAAA,GAAsB;AAAA,EACjC,iBAAA,EAAmB;AACrB;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const mysqlConfig = [
|
|
4
|
+
{
|
|
5
|
+
channelName: "query",
|
|
6
|
+
module: { name: "mysql", versionRange: ">=2.0.0 <3", filePath: "lib/Connection.js" },
|
|
7
|
+
functionQuery: { expressionName: "query", kind: "Auto" }
|
|
8
|
+
}
|
|
9
|
+
];
|
|
10
|
+
const mysqlChannels = {
|
|
11
|
+
MYSQL_QUERY: "orchestrion:mysql:query"
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.mysqlChannels = mysqlChannels;
|
|
15
|
+
exports.mysqlConfig = mysqlConfig;
|
|
16
|
+
//# sourceMappingURL=mysql.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mysql.js","sources":["../../../../src/orchestrion/config/mysql.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\nexport const mysqlConfig = [\n {\n channelName: 'query',\n module: { name: 'mysql', versionRange: '>=2.0.0 <3', filePath: 'lib/Connection.js' },\n functionQuery: { expressionName: 'query', kind: 'Auto' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const mysqlChannels = {\n MYSQL_QUERY: 'orchestrion:mysql:query',\n} as const;\n"],"names":[],"mappings":";;AAEO,MAAM,WAAA,GAAc;AAAA,EACzB;AAAA,IACE,WAAA,EAAa,OAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,SAAS,YAAA,EAAc,YAAA,EAAc,UAAU,mBAAA,EAAoB;AAAA,IACnF,aAAA,EAAe,EAAE,cAAA,EAAgB,OAAA,EAAS,MAAM,MAAA;AAAO;AAE3D;AAEO,MAAM,aAAA,GAAgB;AAAA,EAC3B,WAAA,EAAa;AACf;;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const openaiConfig = [
|
|
4
|
+
// OpenAI chat completions. `Completions.create` returns a thenable `APIPromise` with no callback arg,
|
|
5
|
+
// so `kind: 'Auto'` resolves to `wrapPromise`. openai ships dual CJS/ESM and the matcher compares
|
|
6
|
+
// `filePath` exactly, hence one entry per built file (`.js` for `require`, `.mjs` for `import`).
|
|
7
|
+
...["resources/chat/completions/completions.js", "resources/chat/completions/completions.mjs"].map((filePath) => ({
|
|
8
|
+
channelName: "chat",
|
|
9
|
+
module: { name: "openai", versionRange: ">=4.0.0 <7", filePath },
|
|
10
|
+
functionQuery: { className: "Completions", methodName: "create", kind: "Auto" }
|
|
11
|
+
})),
|
|
12
|
+
// OpenAI responses API — same `create(body, options)` shape as chat completions.
|
|
13
|
+
...["resources/responses/responses.js", "resources/responses/responses.mjs"].map((filePath) => ({
|
|
14
|
+
channelName: "responses",
|
|
15
|
+
module: { name: "openai", versionRange: ">=4.0.0 <7", filePath },
|
|
16
|
+
functionQuery: { className: "Responses", methodName: "create", kind: "Auto" }
|
|
17
|
+
})),
|
|
18
|
+
// OpenAI embeddings API — same `create(body, options)` shape as chat completions.
|
|
19
|
+
...["resources/embeddings.js", "resources/embeddings.mjs"].map((filePath) => ({
|
|
20
|
+
channelName: "embeddings",
|
|
21
|
+
module: { name: "openai", versionRange: ">=4.0.0 <7", filePath },
|
|
22
|
+
functionQuery: { className: "Embeddings", methodName: "create", kind: "Auto" }
|
|
23
|
+
})),
|
|
24
|
+
// OpenAI conversations API — same `create(body, options)` shape as chat completions.
|
|
25
|
+
...["resources/conversations/conversations.js", "resources/conversations/conversations.mjs"].map((filePath) => ({
|
|
26
|
+
channelName: "conversations",
|
|
27
|
+
module: { name: "openai", versionRange: ">=4.0.0 <7", filePath },
|
|
28
|
+
functionQuery: { className: "Conversations", methodName: "create", kind: "Auto" }
|
|
29
|
+
}))
|
|
30
|
+
];
|
|
31
|
+
const openaiChannels = {
|
|
32
|
+
OPENAI_CHAT: "orchestrion:openai:chat",
|
|
33
|
+
OPENAI_RESPONSES: "orchestrion:openai:responses",
|
|
34
|
+
OPENAI_EMBEDDINGS: "orchestrion:openai:embeddings",
|
|
35
|
+
OPENAI_CONVERSATIONS: "orchestrion:openai:conversations"
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
exports.openaiChannels = openaiChannels;
|
|
39
|
+
exports.openaiConfig = openaiConfig;
|
|
40
|
+
//# sourceMappingURL=openai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openai.js","sources":["../../../../src/orchestrion/config/openai.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\nexport const openaiConfig = [\n // OpenAI chat completions. `Completions.create` returns a thenable `APIPromise` with no callback arg,\n // so `kind: 'Auto'` resolves to `wrapPromise`. openai ships dual CJS/ESM and the matcher compares\n // `filePath` exactly, hence one entry per built file (`.js` for `require`, `.mjs` for `import`).\n ...['resources/chat/completions/completions.js', 'resources/chat/completions/completions.mjs'].map(filePath => ({\n channelName: 'chat',\n module: { name: 'openai', versionRange: '>=4.0.0 <7', filePath },\n functionQuery: { className: 'Completions', methodName: 'create', kind: 'Auto' as const },\n })),\n // OpenAI responses API — same `create(body, options)` shape as chat completions.\n ...['resources/responses/responses.js', 'resources/responses/responses.mjs'].map(filePath => ({\n channelName: 'responses',\n module: { name: 'openai', versionRange: '>=4.0.0 <7', filePath },\n functionQuery: { className: 'Responses', methodName: 'create', kind: 'Auto' as const },\n })),\n // OpenAI embeddings API — same `create(body, options)` shape as chat completions.\n ...['resources/embeddings.js', 'resources/embeddings.mjs'].map(filePath => ({\n channelName: 'embeddings',\n module: { name: 'openai', versionRange: '>=4.0.0 <7', filePath },\n functionQuery: { className: 'Embeddings', methodName: 'create', kind: 'Auto' as const },\n })),\n // OpenAI conversations API — same `create(body, options)` shape as chat completions.\n ...['resources/conversations/conversations.js', 'resources/conversations/conversations.mjs'].map(filePath => ({\n channelName: 'conversations',\n module: { name: 'openai', versionRange: '>=4.0.0 <7', filePath },\n functionQuery: { className: 'Conversations', methodName: 'create', kind: 'Auto' as const },\n })),\n] satisfies InstrumentationConfig[];\n\nexport const openaiChannels = {\n OPENAI_CHAT: 'orchestrion:openai:chat',\n OPENAI_RESPONSES: 'orchestrion:openai:responses',\n OPENAI_EMBEDDINGS: 'orchestrion:openai:embeddings',\n OPENAI_CONVERSATIONS: 'orchestrion:openai:conversations',\n} as const;\n"],"names":[],"mappings":";;AAEO,MAAM,YAAA,GAAe;AAAA;AAAA;AAAA;AAAA,EAI1B,GAAG,CAAC,2CAAA,EAA6C,4CAA4C,CAAA,CAAE,IAAI,CAAA,QAAA,MAAa;AAAA,IAC9G,WAAA,EAAa,MAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,QAAA,EAAU,YAAA,EAAc,cAAc,QAAA,EAAS;AAAA,IAC/D,eAAe,EAAE,SAAA,EAAW,eAAe,UAAA,EAAY,QAAA,EAAU,MAAM,MAAA;AAAgB,GACzF,CAAE,CAAA;AAAA;AAAA,EAEF,GAAG,CAAC,kCAAA,EAAoC,mCAAmC,CAAA,CAAE,IAAI,CAAA,QAAA,MAAa;AAAA,IAC5F,WAAA,EAAa,WAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,QAAA,EAAU,YAAA,EAAc,cAAc,QAAA,EAAS;AAAA,IAC/D,eAAe,EAAE,SAAA,EAAW,aAAa,UAAA,EAAY,QAAA,EAAU,MAAM,MAAA;AAAgB,GACvF,CAAE,CAAA;AAAA;AAAA,EAEF,GAAG,CAAC,yBAAA,EAA2B,0BAA0B,CAAA,CAAE,IAAI,CAAA,QAAA,MAAa;AAAA,IAC1E,WAAA,EAAa,YAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,QAAA,EAAU,YAAA,EAAc,cAAc,QAAA,EAAS;AAAA,IAC/D,eAAe,EAAE,SAAA,EAAW,cAAc,UAAA,EAAY,QAAA,EAAU,MAAM,MAAA;AAAgB,GACxF,CAAE,CAAA;AAAA;AAAA,EAEF,GAAG,CAAC,0CAAA,EAA4C,2CAA2C,CAAA,CAAE,IAAI,CAAA,QAAA,MAAa;AAAA,IAC5G,WAAA,EAAa,eAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,QAAA,EAAU,YAAA,EAAc,cAAc,QAAA,EAAS;AAAA,IAC/D,eAAe,EAAE,SAAA,EAAW,iBAAiB,UAAA,EAAY,QAAA,EAAU,MAAM,MAAA;AAAgB,GAC3F,CAAE;AACJ;AAEO,MAAM,cAAA,GAAiB;AAAA,EAC5B,WAAA,EAAa,yBAAA;AAAA,EACb,gBAAA,EAAkB,8BAAA;AAAA,EAClB,iBAAA,EAAmB,+BAAA;AAAA,EACnB,oBAAA,EAAsB;AACxB;;;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const pgConfig = [
|
|
4
|
+
// `pg` (node-postgres).
|
|
5
|
+
// instruments `Client.prototype.query`/`connect` (both the JS and native
|
|
6
|
+
// clients) plus `pg-pool`'s `Pool.prototype.connect`.
|
|
7
|
+
// `Auto` covers the callback, promise, and streamable-`Submittable`
|
|
8
|
+
// call shapes (like mysql).
|
|
9
|
+
// `pg/lib/client.js` is `class Client { query() {...} connect() {...} }`,
|
|
10
|
+
// so `className`+`methodName` matches directly.
|
|
11
|
+
{
|
|
12
|
+
channelName: "query",
|
|
13
|
+
module: { name: "pg", versionRange: ">=8.0.3 <9", filePath: "lib/client.js" },
|
|
14
|
+
functionQuery: { className: "Client", methodName: "query", kind: "Auto" }
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
channelName: "connect",
|
|
18
|
+
module: { name: "pg", versionRange: ">=8.0.3 <9", filePath: "lib/client.js" },
|
|
19
|
+
functionQuery: { className: "Client", methodName: "connect", kind: "Auto" }
|
|
20
|
+
},
|
|
21
|
+
// The native client (`pg/lib/native/client.js`) is a constructor function,
|
|
22
|
+
// not a class.
|
|
23
|
+
// `Client.prototype.query = function (config, values, callback) {...}`
|
|
24
|
+
// so it needs `expressionName` (the mysql shape), publishing to the SAME
|
|
25
|
+
// `orchestrion:pg:query`/`:connect` channels as the JS client.
|
|
26
|
+
{
|
|
27
|
+
channelName: "query",
|
|
28
|
+
module: { name: "pg", versionRange: ">=8.0.3 <9", filePath: "lib/native/client.js" },
|
|
29
|
+
functionQuery: { expressionName: "query", kind: "Auto" }
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
channelName: "connect",
|
|
33
|
+
module: { name: "pg", versionRange: ">=8.0.3 <9", filePath: "lib/native/client.js" },
|
|
34
|
+
functionQuery: { expressionName: "connect", kind: "Auto" }
|
|
35
|
+
},
|
|
36
|
+
// `pg-pool` is `class Pool extends EventEmitter { connect(cb) {...} }`.
|
|
37
|
+
{
|
|
38
|
+
channelName: "connect",
|
|
39
|
+
module: { name: "pg-pool", versionRange: ">=2.0.0 <4", filePath: "index.js" },
|
|
40
|
+
functionQuery: { className: "Pool", methodName: "connect", kind: "Auto" }
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
const pgChannels = {
|
|
44
|
+
PG_QUERY: "orchestrion:pg:query",
|
|
45
|
+
PG_CONNECT: "orchestrion:pg:connect",
|
|
46
|
+
PGPOOL_CONNECT: "orchestrion:pg-pool:connect"
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
exports.pgChannels = pgChannels;
|
|
50
|
+
exports.pgConfig = pgConfig;
|
|
51
|
+
//# sourceMappingURL=pg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pg.js","sources":["../../../../src/orchestrion/config/pg.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\nexport const pgConfig = [\n // `pg` (node-postgres).\n // instruments `Client.prototype.query`/`connect` (both the JS and native\n // clients) plus `pg-pool`'s `Pool.prototype.connect`.\n // `Auto` covers the callback, promise, and streamable-`Submittable`\n // call shapes (like mysql).\n // `pg/lib/client.js` is `class Client { query() {...} connect() {...} }`,\n // so `className`+`methodName` matches directly.\n {\n channelName: 'query',\n module: { name: 'pg', versionRange: '>=8.0.3 <9', filePath: 'lib/client.js' },\n functionQuery: { className: 'Client', methodName: 'query', kind: 'Auto' },\n },\n {\n channelName: 'connect',\n module: { name: 'pg', versionRange: '>=8.0.3 <9', filePath: 'lib/client.js' },\n functionQuery: { className: 'Client', methodName: 'connect', kind: 'Auto' },\n },\n // The native client (`pg/lib/native/client.js`) is a constructor function,\n // not a class.\n // `Client.prototype.query = function (config, values, callback) {...}`\n // so it needs `expressionName` (the mysql shape), publishing to the SAME\n // `orchestrion:pg:query`/`:connect` channels as the JS client.\n {\n channelName: 'query',\n module: { name: 'pg', versionRange: '>=8.0.3 <9', filePath: 'lib/native/client.js' },\n functionQuery: { expressionName: 'query', kind: 'Auto' },\n },\n {\n channelName: 'connect',\n module: { name: 'pg', versionRange: '>=8.0.3 <9', filePath: 'lib/native/client.js' },\n functionQuery: { expressionName: 'connect', kind: 'Auto' },\n },\n // `pg-pool` is `class Pool extends EventEmitter { connect(cb) {...} }`.\n {\n channelName: 'connect',\n module: { name: 'pg-pool', versionRange: '>=2.0.0 <4', filePath: 'index.js' },\n functionQuery: { className: 'Pool', methodName: 'connect', kind: 'Auto' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const pgChannels = {\n PG_QUERY: 'orchestrion:pg:query',\n PG_CONNECT: 'orchestrion:pg:connect',\n PGPOOL_CONNECT: 'orchestrion:pg-pool:connect',\n} as const;\n"],"names":[],"mappings":";;AAEO,MAAM,QAAA,GAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQtB;AAAA,IACE,WAAA,EAAa,OAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,MAAM,YAAA,EAAc,YAAA,EAAc,UAAU,eAAA,EAAgB;AAAA,IAC5E,eAAe,EAAE,SAAA,EAAW,UAAU,UAAA,EAAY,OAAA,EAAS,MAAM,MAAA;AAAO,GAC1E;AAAA,EACA;AAAA,IACE,WAAA,EAAa,SAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,MAAM,YAAA,EAAc,YAAA,EAAc,UAAU,eAAA,EAAgB;AAAA,IAC5E,eAAe,EAAE,SAAA,EAAW,UAAU,UAAA,EAAY,SAAA,EAAW,MAAM,MAAA;AAAO,GAC5E;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA;AAAA,IACE,WAAA,EAAa,OAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,MAAM,YAAA,EAAc,YAAA,EAAc,UAAU,sBAAA,EAAuB;AAAA,IACnF,aAAA,EAAe,EAAE,cAAA,EAAgB,OAAA,EAAS,MAAM,MAAA;AAAO,GACzD;AAAA,EACA;AAAA,IACE,WAAA,EAAa,SAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,MAAM,YAAA,EAAc,YAAA,EAAc,UAAU,sBAAA,EAAuB;AAAA,IACnF,aAAA,EAAe,EAAE,cAAA,EAAgB,SAAA,EAAW,MAAM,MAAA;AAAO,GAC3D;AAAA;AAAA,EAEA;AAAA,IACE,WAAA,EAAa,SAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,WAAW,YAAA,EAAc,YAAA,EAAc,UAAU,UAAA,EAAW;AAAA,IAC5E,eAAe,EAAE,SAAA,EAAW,QAAQ,UAAA,EAAY,SAAA,EAAW,MAAM,MAAA;AAAO;AAE5E;AAEO,MAAM,UAAA,GAAa;AAAA,EACxB,QAAA,EAAU,sBAAA;AAAA,EACV,UAAA,EAAY,wBAAA;AAAA,EACZ,cAAA,EAAgB;AAClB;;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
const vercelAiConfig = [
|
|
4
|
+
// Vercel AI v6: mirror the v7 native `ai:telemetry` channel by injecting
|
|
5
|
+
// channels into the top-level entry points. `resolveLanguageModel` is wrapped
|
|
6
|
+
// not to span it, but so the subscriber can monkey-patch `doGenerate`/
|
|
7
|
+
// `doStream` on the returned model (the only way to span the model call,
|
|
8
|
+
// which is an inline call with no injectable definition in `ai`).
|
|
9
|
+
// `streamText` returns its result synchronously (streaming is lazy), so it's
|
|
10
|
+
// `Sync`; the subscriber binds the span via `bindTracingChannelToSpan`, which
|
|
11
|
+
// ends it when the (synchronous) call returns.
|
|
12
|
+
...vercelAiV6Entries("generateText", "generateText", "Async"),
|
|
13
|
+
...vercelAiV6Entries("streamText", "streamText", "Sync"),
|
|
14
|
+
...vercelAiV6Entries("embed", "embed", "Async"),
|
|
15
|
+
...vercelAiV6Entries("embedMany", "embedMany", "Async"),
|
|
16
|
+
...vercelAiV6Entries("executeToolCall", "executeToolCall", "Async"),
|
|
17
|
+
...vercelAiV6Entries("resolveLanguageModel", "resolveLanguageModel", "Sync")
|
|
18
|
+
];
|
|
19
|
+
const vercelAiChannels = {
|
|
20
|
+
// Vercel AI (`ai`) v6: orchestrion injects these so the same channel-based
|
|
21
|
+
// integration that consumes `ai`'s native `ai:telemetry` channel (v7) can
|
|
22
|
+
// also instrument v6. Each maps to a top-level function in `ai`'s bundle.
|
|
23
|
+
VERCEL_AI_GENERATE_TEXT: "orchestrion:ai:generateText",
|
|
24
|
+
VERCEL_AI_STREAM_TEXT: "orchestrion:ai:streamText",
|
|
25
|
+
VERCEL_AI_EMBED: "orchestrion:ai:embed",
|
|
26
|
+
VERCEL_AI_EMBED_MANY: "orchestrion:ai:embedMany",
|
|
27
|
+
VERCEL_AI_EXECUTE_TOOL_CALL: "orchestrion:ai:executeToolCall",
|
|
28
|
+
// `resolveLanguageModel` is the single chokepoint every model call flows
|
|
29
|
+
// through; we wrap it to monkey-patch `doGenerate`/`doStream` on the returned
|
|
30
|
+
// model (the model-call site itself is an inline call with no injectable
|
|
31
|
+
// definition).
|
|
32
|
+
VERCEL_AI_RESOLVE_LANGUAGE_MODEL: "orchestrion:ai:resolveLanguageModel"
|
|
33
|
+
};
|
|
34
|
+
function vercelAiV6Entries(channelName, functionName, kind) {
|
|
35
|
+
return ["dist/index.js", "dist/index.mjs"].map((filePath) => ({
|
|
36
|
+
channelName,
|
|
37
|
+
module: { name: "ai", versionRange: ">=6.0.0 <7.0.0", filePath },
|
|
38
|
+
functionQuery: { functionName, kind }
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
exports.vercelAiChannels = vercelAiChannels;
|
|
43
|
+
exports.vercelAiConfig = vercelAiConfig;
|
|
44
|
+
//# sourceMappingURL=vercel-ai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vercel-ai.js","sources":["../../../../src/orchestrion/config/vercel-ai.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\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 ...vercelAiV6Entries('generateText', 'generateText', 'Async'),\n ...vercelAiV6Entries('streamText', 'streamText', 'Sync'),\n ...vercelAiV6Entries('embed', 'embed', 'Async'),\n ...vercelAiV6Entries('embedMany', 'embedMany', 'Async'),\n ...vercelAiV6Entries('executeToolCall', 'executeToolCall', 'Async'),\n ...vercelAiV6Entries('resolveLanguageModel', 'resolveLanguageModel', 'Sync'),\n] satisfies InstrumentationConfig[];\n\nexport const vercelAiChannels = {\n // Vercel AI (`ai`) v6: orchestrion injects these so the same channel-based\n // integration that consumes `ai`'s native `ai:telemetry` channel (v7) can\n // also instrument v6. Each maps to a top-level function in `ai`'s bundle.\n VERCEL_AI_GENERATE_TEXT: 'orchestrion:ai:generateText',\n VERCEL_AI_STREAM_TEXT: 'orchestrion:ai:streamText',\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 // `resolveLanguageModel` is the single chokepoint every model call flows\n // through; we wrap it to monkey-patch `doGenerate`/`doStream` on the returned\n // model (the model-call site itself is an inline call with no injectable\n // definition).\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 vercelAiV6Entries(channelName: string, functionName: string, kind: 'Async' | 'Sync'): InstrumentationConfig[] {\n return ['dist/index.js', 'dist/index.mjs'].map(filePath => ({\n channelName,\n module: { name: 'ai', versionRange: '>=6.0.0 <7.0.0', filePath },\n functionQuery: { functionName, kind },\n }));\n}\n"],"names":[],"mappings":";;AAEO,MAAM,cAAA,GAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS5B,GAAG,iBAAA,CAAkB,cAAA,EAAgB,cAAA,EAAgB,OAAO,CAAA;AAAA,EAC5D,GAAG,iBAAA,CAAkB,YAAA,EAAc,YAAA,EAAc,MAAM,CAAA;AAAA,EACvD,GAAG,iBAAA,CAAkB,OAAA,EAAS,OAAA,EAAS,OAAO,CAAA;AAAA,EAC9C,GAAG,iBAAA,CAAkB,WAAA,EAAa,WAAA,EAAa,OAAO,CAAA;AAAA,EACtD,GAAG,iBAAA,CAAkB,iBAAA,EAAmB,iBAAA,EAAmB,OAAO,CAAA;AAAA,EAClE,GAAG,iBAAA,CAAkB,sBAAA,EAAwB,sBAAA,EAAwB,MAAM;AAC7E;AAEO,MAAM,gBAAA,GAAmB;AAAA;AAAA;AAAA;AAAA,EAI9B,uBAAA,EAAyB,6BAAA;AAAA,EACzB,qBAAA,EAAuB,2BAAA;AAAA,EACvB,eAAA,EAAiB,sBAAA;AAAA,EACjB,oBAAA,EAAsB,0BAAA;AAAA,EACtB,2BAAA,EAA6B,gCAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAK7B,gCAAA,EAAkC;AACpC;AAkBA,SAAS,iBAAA,CAAkB,WAAA,EAAqB,YAAA,EAAsB,IAAA,EAAiD;AACrH,EAAA,OAAO,CAAC,eAAA,EAAiB,gBAAgB,CAAA,CAAE,IAAI,CAAA,QAAA,MAAa;AAAA,IAC1D,WAAA;AAAA,IACA,QAAQ,EAAE,IAAA,EAAM,IAAA,EAAM,YAAA,EAAc,kBAAkB,QAAA,EAAS;AAAA,IAC/D,aAAA,EAAe,EAAE,YAAA,EAAc,IAAA;AAAK,GACtC,CAAE,CAAA;AACJ;;;;;"}
|
|
@@ -3,13 +3,17 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3
3
|
const core = require('@sentry/core');
|
|
4
4
|
const debugBuild = require('../debug-build.js');
|
|
5
5
|
|
|
6
|
+
function isOrchestrionInjected() {
|
|
7
|
+
const marker = globalThis.__SENTRY_ORCHESTRION__;
|
|
8
|
+
return !!(marker?.runtime || marker?.bundler);
|
|
9
|
+
}
|
|
6
10
|
function detectOrchestrionSetup() {
|
|
7
11
|
if (!debugBuild.DEBUG_BUILD) return;
|
|
8
12
|
const marker = globalThis.__SENTRY_ORCHESTRION__;
|
|
9
13
|
const runtime = !!marker?.runtime;
|
|
10
14
|
const bundler = !!marker?.bundler;
|
|
11
15
|
debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion] detect: runtime=${runtime} bundler=${bundler}`);
|
|
12
|
-
if (!
|
|
16
|
+
if (!isOrchestrionInjected()) {
|
|
13
17
|
debugBuild.DEBUG_BUILD && core.debug.warn(
|
|
14
18
|
"[Sentry] No diagnostics-channel injection detected. Channel-based integrations (mysql, \u2026) will not record spans. Make sure the diagnostics channels are injected via the runtime `--import` hook or a bundler plugin before the instrumented modules load."
|
|
15
19
|
);
|
|
@@ -17,4 +21,5 @@ function detectOrchestrionSetup() {
|
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
exports.detectOrchestrionSetup = detectOrchestrionSetup;
|
|
24
|
+
exports.isOrchestrionInjected = isOrchestrionInjected;
|
|
20
25
|
//# sourceMappingURL=detect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect.js","sources":["../../../src/orchestrion/detect.ts"],"sourcesContent":["import { debug } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var __SENTRY_ORCHESTRION__: { runtime?: boolean; bundler?: boolean } | undefined;\n}\n\n/**\n * Verifies that the diagnostics channels have been injected either by the\n * runtime `--import` hook (or init-time registration), a bundler plugin, or\n * both, and warns if not.\n *\n * Both injectors being active at once is fine: they operate on disjoint module\n * sets (a module is either loaded through Node's loader and transformed by the\n * runtime hook, or inlined by the bundler and transformed by the plugin), so\n * a single module can't be double-wrapped. A hybrid setup, with some deps\n * external and runtime-instrumented, others bundled and plugin-instrumented,\n * is fine.\n *\n * Note: intentionally does NOT warn in production, only in debug builds,\n * because production warnings are reserved for truly critical issues.\n */\nexport function detectOrchestrionSetup(): void {\n if (!DEBUG_BUILD) return;\n\n const marker = globalThis.__SENTRY_ORCHESTRION__;\n const runtime = !!marker?.runtime;\n const bundler = !!marker?.bundler;\n\n DEBUG_BUILD && debug.log(`[orchestrion] detect: runtime=${runtime} bundler=${bundler}`);\n\n if (!
|
|
1
|
+
{"version":3,"file":"detect.js","sources":["../../../src/orchestrion/detect.ts"],"sourcesContent":["import { debug } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var __SENTRY_ORCHESTRION__: { runtime?: boolean; bundler?: boolean } | undefined;\n}\n\n/**\n * Whether orchestrion has injected the diagnostics channels into this process,\n * either by the runtime `--import` hook / init-time registration (`runtime`)\n * or a bundler plugin (`bundler`). Both injectors set a flag on the\n * `globalThis.__SENTRY_ORCHESTRION__` marker.\n *\n * Use this to avoid wiring up channel-subscriber integrations when nothing\n * will ever publish to those channels.\n */\nexport function isOrchestrionInjected(): boolean {\n const marker = globalThis.__SENTRY_ORCHESTRION__;\n return !!(marker?.runtime || marker?.bundler);\n}\n\n/**\n * Verifies that the diagnostics channels have been injected either by the\n * runtime `--import` hook (or init-time registration), a bundler plugin, or\n * both, and warns if not.\n *\n * Both injectors being active at once is fine: they operate on disjoint module\n * sets (a module is either loaded through Node's loader and transformed by the\n * runtime hook, or inlined by the bundler and transformed by the plugin), so\n * a single module can't be double-wrapped. A hybrid setup, with some deps\n * external and runtime-instrumented, others bundled and plugin-instrumented,\n * is fine.\n *\n * Note: intentionally does NOT warn in production, only in debug builds,\n * because production warnings are reserved for truly critical issues.\n */\nexport function detectOrchestrionSetup(): void {\n if (!DEBUG_BUILD) return;\n\n const marker = globalThis.__SENTRY_ORCHESTRION__;\n const runtime = !!marker?.runtime;\n const bundler = !!marker?.bundler;\n\n DEBUG_BUILD && debug.log(`[orchestrion] detect: runtime=${runtime} bundler=${bundler}`);\n\n if (!isOrchestrionInjected()) {\n DEBUG_BUILD &&\n debug.warn(\n '[Sentry] No diagnostics-channel injection detected. Channel-based integrations ' +\n '(mysql, …) will not record spans. Make sure the diagnostics channels are injected ' +\n 'via the runtime `--import` hook or a bundler plugin before the instrumented modules load.',\n );\n }\n}\n"],"names":["DEBUG_BUILD","debug"],"mappings":";;;;;AAiBO,SAAS,qBAAA,GAAiC;AAC/C,EAAA,MAAM,SAAS,UAAA,CAAW,sBAAA;AAC1B,EAAA,OAAO,CAAC,EAAE,MAAA,EAAQ,OAAA,IAAW,MAAA,EAAQ,OAAA,CAAA;AACvC;AAiBO,SAAS,sBAAA,GAA+B;AAC7C,EAAA,IAAI,CAACA,sBAAA,EAAa;AAElB,EAAA,MAAM,SAAS,UAAA,CAAW,sBAAA;AAC1B,EAAA,MAAM,OAAA,GAAU,CAAC,CAAC,MAAA,EAAQ,OAAA;AAC1B,EAAA,MAAM,OAAA,GAAU,CAAC,CAAC,MAAA,EAAQ,OAAA;AAE1B,EAAAA,sBAAA,IAAeC,WAAM,GAAA,CAAI,CAAA,8BAAA,EAAiC,OAAO,CAAA,SAAA,EAAY,OAAO,CAAA,CAAE,CAAA;AAEtF,EAAA,IAAI,CAAC,uBAAsB,EAAG;AAC5B,IAAAD,sBAAA,IACEC,UAAA,CAAM,IAAA;AAAA,MACJ;AAAA,KAGF;AAAA,EACJ;AACF;;;;;"}
|
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const anthropic = require('../integrations/tracing-channel/anthropic.js');
|
|
4
|
+
const hapi = require('../integrations/tracing-channel/hapi.js');
|
|
5
|
+
const ioredis = require('../integrations/tracing-channel/ioredis.js');
|
|
6
|
+
const lruMemoizer = require('../integrations/tracing-channel/lru-memoizer.js');
|
|
4
7
|
const mysql = require('../integrations/tracing-channel/mysql.js');
|
|
8
|
+
const openai = require('../integrations/tracing-channel/openai.js');
|
|
9
|
+
const postgres = require('../integrations/tracing-channel/postgres.js');
|
|
10
|
+
const vercelAi = require('../integrations/tracing-channel/vercel-ai.js');
|
|
11
|
+
const detect = require('./detect.js');
|
|
5
12
|
|
|
13
|
+
const channelIntegrations = {
|
|
14
|
+
postgresIntegration: postgres.postgresChannelIntegration,
|
|
15
|
+
mysqlIntegration: mysql.mysqlChannelIntegration,
|
|
16
|
+
lruMemoizerIntegration: lruMemoizer.lruMemoizerChannelIntegration,
|
|
17
|
+
openaiIntegration: openai.openaiChannelIntegration,
|
|
18
|
+
anthropicIntegration: anthropic.anthropicChannelIntegration,
|
|
19
|
+
vercelAiIntegration: vercelAi.vercelAiChannelIntegration,
|
|
20
|
+
hapiIntegration: hapi.hapiChannelIntegration
|
|
21
|
+
};
|
|
6
22
|
|
|
7
|
-
|
|
8
|
-
exports.
|
|
23
|
+
exports.anthropicChannelIntegration = anthropic.anthropicChannelIntegration;
|
|
24
|
+
exports.hapiChannelIntegration = hapi.hapiChannelIntegration;
|
|
25
|
+
exports.ioredisChannelIntegration = ioredis.ioredisChannelIntegration;
|
|
26
|
+
exports.lruMemoizerChannelIntegration = lruMemoizer.lruMemoizerChannelIntegration;
|
|
9
27
|
exports.mysqlChannelIntegration = mysql.mysqlChannelIntegration;
|
|
28
|
+
exports.openaiChannelIntegration = openai.openaiChannelIntegration;
|
|
29
|
+
exports.postgresChannelIntegration = postgres.postgresChannelIntegration;
|
|
30
|
+
exports.vercelAiChannelIntegration = vercelAi.vercelAiChannelIntegration;
|
|
31
|
+
exports.detectOrchestrionSetup = detect.detectOrchestrionSetup;
|
|
32
|
+
exports.isOrchestrionInjected = detect.isOrchestrionInjected;
|
|
33
|
+
exports.channelIntegrations = channelIntegrations;
|
|
10
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/orchestrion/index.ts"],"sourcesContent":["import { anthropicChannelIntegration } from '../integrations/tracing-channel/anthropic';\nimport { hapiChannelIntegration } from '../integrations/tracing-channel/hapi';\nimport { ioredisChannelIntegration } from '../integrations/tracing-channel/ioredis';\nimport { lruMemoizerChannelIntegration } from '../integrations/tracing-channel/lru-memoizer';\nimport { mysqlChannelIntegration } from '../integrations/tracing-channel/mysql';\nimport { openaiChannelIntegration } from '../integrations/tracing-channel/openai';\nimport { postgresChannelIntegration } from '../integrations/tracing-channel/postgres';\nimport { vercelAiChannelIntegration } from '../integrations/tracing-channel/vercel-ai';\n\nexport { detectOrchestrionSetup, isOrchestrionInjected } from './detect';\nexport {\n anthropicChannelIntegration,\n hapiChannelIntegration,\n ioredisChannelIntegration,\n lruMemoizerChannelIntegration,\n mysqlChannelIntegration,\n openaiChannelIntegration,\n postgresChannelIntegration,\n vercelAiChannelIntegration,\n};\nexport type { IORedisChannelIntegrationOptions, IORedisResponseHook } from '../integrations/tracing-channel/ioredis';\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` is intentionally NOT here. It only partially replaces the\n * composite OTel `Redis` integration and needs the node SDK's redis cache `responseHook` (which\n * can't live in `server-utils`), so `@sentry/node` wires it up separately.\n */\nexport const channelIntegrations = {\n postgresIntegration: postgresChannelIntegration,\n mysqlIntegration: mysqlChannelIntegration,\n lruMemoizerIntegration: lruMemoizerChannelIntegration,\n openaiIntegration: openaiChannelIntegration,\n anthropicIntegration: anthropicChannelIntegration,\n vercelAiIntegration: vercelAiChannelIntegration,\n hapiIntegration: hapiChannelIntegration,\n} as const;\n"],"names":["postgresChannelIntegration","mysqlChannelIntegration","lruMemoizerChannelIntegration","openaiChannelIntegration","anthropicChannelIntegration","vercelAiChannelIntegration","hapiChannelIntegration"],"mappings":";;;;;;;;;;;;AAmCO,MAAM,mBAAA,GAAsB;AAAA,EACjC,mBAAA,EAAqBA,mCAAA;AAAA,EACrB,gBAAA,EAAkBC,6BAAA;AAAA,EAClB,sBAAA,EAAwBC,yCAAA;AAAA,EACxB,iBAAA,EAAmBC,+BAAA;AAAA,EACnB,oBAAA,EAAsBC,qCAAA;AAAA,EACtB,mBAAA,EAAqBC,mCAAA;AAAA,EACrB,eAAA,EAAiBC;AACnB;;;;;;;;;;;;;;"}
|
|
@@ -4,9 +4,8 @@ const core = require('@sentry/core');
|
|
|
4
4
|
const Module = require('node:module');
|
|
5
5
|
const node_url = require('node:url');
|
|
6
6
|
const debugBuild = require('../../debug-build.js');
|
|
7
|
-
const
|
|
7
|
+
const index = require('../config/index.js');
|
|
8
8
|
|
|
9
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
10
9
|
function registerDiagnosticsChannelInjection() {
|
|
11
10
|
const g = globalThis.__SENTRY_ORCHESTRION__ ?? (globalThis.__SENTRY_ORCHESTRION__ = {});
|
|
12
11
|
if (g.runtime || g.bundler) {
|
|
@@ -17,20 +16,24 @@ function registerDiagnosticsChannelInjection() {
|
|
|
17
16
|
const nodeVersion = parseVersion(process.versions.node ?? "0.0.0");
|
|
18
17
|
const denoVersion = parseVersion(globalAny.Deno?.version?.deno ?? "0.0.0");
|
|
19
18
|
const stableSyncHooks = (nodeVersion[0] ?? 0) > 25 || nodeVersion[0] === 25 && (nodeVersion[1] ?? 0) >= 1 || nodeVersion[0] === 24 && (nodeVersion[1] ?? 0) >= 13 || (denoVersion[0] ?? 0) > 2 || denoVersion[0] === 2 && (denoVersion[1] ?? 0) >= 8;
|
|
20
|
-
|
|
19
|
+
let nodeRequire;
|
|
20
|
+
nodeRequire = require;
|
|
21
21
|
const mod = Module;
|
|
22
22
|
try {
|
|
23
23
|
if (typeof mod.registerHooks === "function" && stableSyncHooks) {
|
|
24
24
|
const { initialize, resolve, load } = nodeRequire("@apm-js-collab/tracing-hooks/hook-sync.mjs");
|
|
25
|
-
initialize({ instrumentations:
|
|
25
|
+
initialize({ instrumentations: index.SENTRY_INSTRUMENTATIONS });
|
|
26
26
|
mod.registerHooks({ resolve, load });
|
|
27
27
|
debugBuild.DEBUG_BUILD && core.debug.log("[orchestrion] registered diagnostics-channel injection via Module.registerHooks()");
|
|
28
28
|
} else if (typeof mod.register === "function" && !globalAny.Bun && !globalAny.Deno) {
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
let parentURL;
|
|
30
|
+
parentURL = node_url.pathToFileURL(__filename).href;
|
|
31
|
+
mod.register("@apm-js-collab/tracing-hooks/hook.mjs", {
|
|
32
|
+
parentURL,
|
|
33
|
+
data: { instrumentations: index.SENTRY_INSTRUMENTATIONS }
|
|
31
34
|
});
|
|
32
35
|
const ModulePatch = nodeRequire("@apm-js-collab/tracing-hooks");
|
|
33
|
-
new ModulePatch({ instrumentations:
|
|
36
|
+
new ModulePatch({ instrumentations: index.SENTRY_INSTRUMENTATIONS }).patch();
|
|
34
37
|
debugBuild.DEBUG_BUILD && core.debug.log("[orchestrion] registered diagnostics-channel injection via Module.register()");
|
|
35
38
|
} else {
|
|
36
39
|
debugBuild.DEBUG_BUILD && core.debug.warn("[Sentry] No available Node API to register diagnostics-channel injection hooks; skipping.");
|