@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.
Files changed (360) hide show
  1. package/README.md +5 -4
  2. package/build/cjs/integrations/tracing-channel/dataloader.js +17 -7
  3. package/build/cjs/integrations/tracing-channel/dataloader.js.map +1 -1
  4. package/build/cjs/integrations/tracing-channel/fastify/index.js +2 -4
  5. package/build/cjs/integrations/tracing-channel/fastify/index.js.map +1 -1
  6. package/build/cjs/integrations/tracing-channel/fastify/utils.js.map +1 -1
  7. package/build/cjs/integrations/tracing-channel/firebase/firestore.js +78 -0
  8. package/build/cjs/integrations/tracing-channel/firebase/firestore.js.map +1 -0
  9. package/build/cjs/integrations/tracing-channel/firebase/functions.js +67 -0
  10. package/build/cjs/integrations/tracing-channel/firebase/functions.js.map +1 -0
  11. package/build/cjs/integrations/tracing-channel/firebase/index.js +24 -0
  12. package/build/cjs/integrations/tracing-channel/firebase/index.js.map +1 -0
  13. package/build/cjs/integrations/tracing-channel/firebase/instrumentation.js +66 -0
  14. package/build/cjs/integrations/tracing-channel/firebase/instrumentation.js.map +1 -0
  15. package/build/cjs/orchestrion/bundler/esbuild.js +24 -1
  16. package/build/cjs/orchestrion/bundler/esbuild.js.map +1 -1
  17. package/build/cjs/orchestrion/bundler/options.js +16 -2
  18. package/build/cjs/orchestrion/bundler/options.js.map +1 -1
  19. package/build/cjs/orchestrion/bundler/rollup.js +11 -1
  20. package/build/cjs/orchestrion/bundler/rollup.js.map +1 -1
  21. package/build/cjs/orchestrion/bundler/subscribeInjection.js +40 -0
  22. package/build/cjs/orchestrion/bundler/subscribeInjection.js.map +1 -0
  23. package/build/cjs/orchestrion/bundler/vite.js +13 -0
  24. package/build/cjs/orchestrion/bundler/vite.js.map +1 -1
  25. package/build/cjs/orchestrion/bundler/webpack.js +32 -1
  26. package/build/cjs/orchestrion/bundler/webpack.js.map +1 -1
  27. package/build/cjs/orchestrion/channels.js +0 -4
  28. package/build/cjs/orchestrion/channels.js.map +1 -1
  29. package/build/cjs/orchestrion/config/amqplib.js +4 -0
  30. package/build/cjs/orchestrion/config/amqplib.js.map +1 -1
  31. package/build/cjs/orchestrion/config/anthropic-ai.js +4 -0
  32. package/build/cjs/orchestrion/config/anthropic-ai.js.map +1 -1
  33. package/build/cjs/orchestrion/config/aws-sdk.js +4 -0
  34. package/build/cjs/orchestrion/config/aws-sdk.js.map +1 -1
  35. package/build/cjs/orchestrion/config/channel-integration-definitions.js +29 -0
  36. package/build/cjs/orchestrion/config/channel-integration-definitions.js.map +1 -0
  37. package/build/cjs/orchestrion/config/dataloader.js +4 -0
  38. package/build/cjs/orchestrion/config/dataloader.js.map +1 -1
  39. package/build/cjs/orchestrion/config/express.js +4 -0
  40. package/build/cjs/orchestrion/config/express.js.map +1 -1
  41. package/build/cjs/orchestrion/config/firebase.js +79 -2
  42. package/build/cjs/orchestrion/config/firebase.js.map +1 -1
  43. package/build/cjs/orchestrion/config/generic-pool.js +4 -0
  44. package/build/cjs/orchestrion/config/generic-pool.js.map +1 -1
  45. package/build/cjs/orchestrion/config/google-genai.js +4 -0
  46. package/build/cjs/orchestrion/config/google-genai.js.map +1 -1
  47. package/build/cjs/orchestrion/config/graphql.js +4 -0
  48. package/build/cjs/orchestrion/config/graphql.js.map +1 -1
  49. package/build/cjs/orchestrion/config/hapi.js +4 -0
  50. package/build/cjs/orchestrion/config/hapi.js.map +1 -1
  51. package/build/cjs/orchestrion/config/index.js +33 -5
  52. package/build/cjs/orchestrion/config/index.js.map +1 -1
  53. package/build/cjs/orchestrion/config/ioredis.js +4 -0
  54. package/build/cjs/orchestrion/config/ioredis.js.map +1 -1
  55. package/build/cjs/orchestrion/config/kafkajs.js +4 -0
  56. package/build/cjs/orchestrion/config/kafkajs.js.map +1 -1
  57. package/build/cjs/orchestrion/config/knex.js +4 -0
  58. package/build/cjs/orchestrion/config/knex.js.map +1 -1
  59. package/build/cjs/orchestrion/config/koa.js +4 -0
  60. package/build/cjs/orchestrion/config/koa.js.map +1 -1
  61. package/build/cjs/orchestrion/config/langchain.js +4 -0
  62. package/build/cjs/orchestrion/config/langchain.js.map +1 -1
  63. package/build/cjs/orchestrion/config/langgraph.js +4 -0
  64. package/build/cjs/orchestrion/config/langgraph.js.map +1 -1
  65. package/build/cjs/orchestrion/config/lru-memoizer.js +4 -0
  66. package/build/cjs/orchestrion/config/lru-memoizer.js.map +1 -1
  67. package/build/cjs/orchestrion/config/mongodb.js +4 -0
  68. package/build/cjs/orchestrion/config/mongodb.js.map +1 -1
  69. package/build/cjs/orchestrion/config/mongoose.js +4 -0
  70. package/build/cjs/orchestrion/config/mongoose.js.map +1 -1
  71. package/build/cjs/orchestrion/config/mysql.js +4 -0
  72. package/build/cjs/orchestrion/config/mysql.js.map +1 -1
  73. package/build/cjs/orchestrion/config/mysql2.js +4 -0
  74. package/build/cjs/orchestrion/config/mysql2.js.map +1 -1
  75. package/build/cjs/orchestrion/config/nestjs.js +4 -0
  76. package/build/cjs/orchestrion/config/nestjs.js.map +1 -1
  77. package/build/cjs/orchestrion/config/openai.js +4 -0
  78. package/build/cjs/orchestrion/config/openai.js.map +1 -1
  79. package/build/cjs/orchestrion/config/pg.js +4 -0
  80. package/build/cjs/orchestrion/config/pg.js.map +1 -1
  81. package/build/cjs/orchestrion/config/postgres.js +4 -0
  82. package/build/cjs/orchestrion/config/postgres.js.map +1 -1
  83. package/build/cjs/orchestrion/config/redis.js +4 -0
  84. package/build/cjs/orchestrion/config/redis.js.map +1 -1
  85. package/build/cjs/orchestrion/config/remix.js +4 -0
  86. package/build/cjs/orchestrion/config/remix.js.map +1 -1
  87. package/build/cjs/orchestrion/config/subscribe-injection.js +25 -0
  88. package/build/cjs/orchestrion/config/subscribe-injection.js.map +1 -0
  89. package/build/cjs/orchestrion/config/tedious.js +4 -0
  90. package/build/cjs/orchestrion/config/tedious.js.map +1 -1
  91. package/build/cjs/orchestrion/config/vercel-ai.js +4 -0
  92. package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -1
  93. package/build/cjs/orchestrion/index.js +12 -7
  94. package/build/cjs/orchestrion/index.js.map +1 -1
  95. package/build/cjs/orchestrion/registerChannelIntegration.js +13 -0
  96. package/build/cjs/orchestrion/registerChannelIntegration.js.map +1 -0
  97. package/build/cjs/vercel-ai/index.js.map +1 -1
  98. package/build/esm/integrations/tracing-channel/dataloader.js +17 -7
  99. package/build/esm/integrations/tracing-channel/dataloader.js.map +1 -1
  100. package/build/esm/integrations/tracing-channel/fastify/index.js +2 -4
  101. package/build/esm/integrations/tracing-channel/fastify/index.js.map +1 -1
  102. package/build/esm/integrations/tracing-channel/fastify/utils.js.map +1 -1
  103. package/build/esm/integrations/tracing-channel/firebase/firestore.js +75 -0
  104. package/build/esm/integrations/tracing-channel/firebase/firestore.js.map +1 -0
  105. package/build/esm/integrations/tracing-channel/firebase/functions.js +65 -0
  106. package/build/esm/integrations/tracing-channel/firebase/functions.js.map +1 -0
  107. package/build/esm/integrations/tracing-channel/firebase/index.js +22 -0
  108. package/build/esm/integrations/tracing-channel/firebase/index.js.map +1 -0
  109. package/build/esm/integrations/tracing-channel/firebase/instrumentation.js +64 -0
  110. package/build/esm/integrations/tracing-channel/firebase/instrumentation.js.map +1 -0
  111. package/build/esm/orchestrion/bundler/esbuild.js +25 -2
  112. package/build/esm/orchestrion/bundler/esbuild.js.map +1 -1
  113. package/build/esm/orchestrion/bundler/options.js +15 -3
  114. package/build/esm/orchestrion/bundler/options.js.map +1 -1
  115. package/build/esm/orchestrion/bundler/rollup.js +12 -2
  116. package/build/esm/orchestrion/bundler/rollup.js.map +1 -1
  117. package/build/esm/orchestrion/bundler/subscribeInjection.js +38 -0
  118. package/build/esm/orchestrion/bundler/subscribeInjection.js.map +1 -0
  119. package/build/esm/orchestrion/bundler/vite.js +14 -1
  120. package/build/esm/orchestrion/bundler/vite.js.map +1 -1
  121. package/build/esm/orchestrion/bundler/webpack.js +33 -3
  122. package/build/esm/orchestrion/bundler/webpack.js.map +1 -1
  123. package/build/esm/orchestrion/channels.js +0 -4
  124. package/build/esm/orchestrion/channels.js.map +1 -1
  125. package/build/esm/orchestrion/config/amqplib.js +4 -1
  126. package/build/esm/orchestrion/config/amqplib.js.map +1 -1
  127. package/build/esm/orchestrion/config/anthropic-ai.js +4 -1
  128. package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -1
  129. package/build/esm/orchestrion/config/aws-sdk.js +4 -1
  130. package/build/esm/orchestrion/config/aws-sdk.js.map +1 -1
  131. package/build/esm/orchestrion/config/channel-integration-definitions.js +26 -0
  132. package/build/esm/orchestrion/config/channel-integration-definitions.js.map +1 -0
  133. package/build/esm/orchestrion/config/dataloader.js +4 -1
  134. package/build/esm/orchestrion/config/dataloader.js.map +1 -1
  135. package/build/esm/orchestrion/config/express.js +4 -1
  136. package/build/esm/orchestrion/config/express.js.map +1 -1
  137. package/build/esm/orchestrion/config/firebase.js +79 -3
  138. package/build/esm/orchestrion/config/firebase.js.map +1 -1
  139. package/build/esm/orchestrion/config/generic-pool.js +4 -1
  140. package/build/esm/orchestrion/config/generic-pool.js.map +1 -1
  141. package/build/esm/orchestrion/config/google-genai.js +4 -1
  142. package/build/esm/orchestrion/config/google-genai.js.map +1 -1
  143. package/build/esm/orchestrion/config/graphql.js +4 -1
  144. package/build/esm/orchestrion/config/graphql.js.map +1 -1
  145. package/build/esm/orchestrion/config/hapi.js +4 -1
  146. package/build/esm/orchestrion/config/hapi.js.map +1 -1
  147. package/build/esm/orchestrion/config/index.js +61 -34
  148. package/build/esm/orchestrion/config/index.js.map +1 -1
  149. package/build/esm/orchestrion/config/ioredis.js +4 -1
  150. package/build/esm/orchestrion/config/ioredis.js.map +1 -1
  151. package/build/esm/orchestrion/config/kafkajs.js +4 -1
  152. package/build/esm/orchestrion/config/kafkajs.js.map +1 -1
  153. package/build/esm/orchestrion/config/knex.js +4 -1
  154. package/build/esm/orchestrion/config/knex.js.map +1 -1
  155. package/build/esm/orchestrion/config/koa.js +4 -1
  156. package/build/esm/orchestrion/config/koa.js.map +1 -1
  157. package/build/esm/orchestrion/config/langchain.js +4 -1
  158. package/build/esm/orchestrion/config/langchain.js.map +1 -1
  159. package/build/esm/orchestrion/config/langgraph.js +4 -1
  160. package/build/esm/orchestrion/config/langgraph.js.map +1 -1
  161. package/build/esm/orchestrion/config/lru-memoizer.js +4 -1
  162. package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -1
  163. package/build/esm/orchestrion/config/mongodb.js +4 -1
  164. package/build/esm/orchestrion/config/mongodb.js.map +1 -1
  165. package/build/esm/orchestrion/config/mongoose.js +4 -1
  166. package/build/esm/orchestrion/config/mongoose.js.map +1 -1
  167. package/build/esm/orchestrion/config/mysql.js +4 -1
  168. package/build/esm/orchestrion/config/mysql.js.map +1 -1
  169. package/build/esm/orchestrion/config/mysql2.js +4 -1
  170. package/build/esm/orchestrion/config/mysql2.js.map +1 -1
  171. package/build/esm/orchestrion/config/nestjs.js +4 -1
  172. package/build/esm/orchestrion/config/nestjs.js.map +1 -1
  173. package/build/esm/orchestrion/config/openai.js +4 -1
  174. package/build/esm/orchestrion/config/openai.js.map +1 -1
  175. package/build/esm/orchestrion/config/pg.js +4 -1
  176. package/build/esm/orchestrion/config/pg.js.map +1 -1
  177. package/build/esm/orchestrion/config/postgres.js +4 -1
  178. package/build/esm/orchestrion/config/postgres.js.map +1 -1
  179. package/build/esm/orchestrion/config/redis.js +4 -1
  180. package/build/esm/orchestrion/config/redis.js.map +1 -1
  181. package/build/esm/orchestrion/config/remix.js +4 -1
  182. package/build/esm/orchestrion/config/remix.js.map +1 -1
  183. package/build/esm/orchestrion/config/subscribe-injection.js +22 -0
  184. package/build/esm/orchestrion/config/subscribe-injection.js.map +1 -0
  185. package/build/esm/orchestrion/config/tedious.js +4 -1
  186. package/build/esm/orchestrion/config/tedious.js.map +1 -1
  187. package/build/esm/orchestrion/config/vercel-ai.js +4 -1
  188. package/build/esm/orchestrion/config/vercel-ai.js.map +1 -1
  189. package/build/esm/orchestrion/index.js +5 -2
  190. package/build/esm/orchestrion/index.js.map +1 -1
  191. package/build/esm/orchestrion/registerChannelIntegration.js +11 -0
  192. package/build/esm/orchestrion/registerChannelIntegration.js.map +1 -0
  193. package/build/esm/package.json +1 -1
  194. package/build/esm/vercel-ai/index.js.map +1 -1
  195. package/build/types/index.d.ts +1 -1
  196. package/build/types/index.d.ts.map +1 -1
  197. package/build/types/integrations/tracing-channel/dataloader.d.ts.map +1 -1
  198. package/build/types/integrations/tracing-channel/fastify/index.d.ts +2 -2
  199. package/build/types/integrations/tracing-channel/fastify/index.d.ts.map +1 -1
  200. package/build/types/integrations/tracing-channel/fastify/utils.d.ts +1 -1
  201. package/build/types/integrations/tracing-channel/fastify/utils.d.ts.map +1 -1
  202. package/build/types/integrations/tracing-channel/firebase/firestore-types.d.ts +38 -0
  203. package/build/types/integrations/tracing-channel/firebase/firestore-types.d.ts.map +1 -0
  204. package/build/types/integrations/tracing-channel/firebase/firestore.d.ts +18 -0
  205. package/build/types/integrations/tracing-channel/firebase/firestore.d.ts.map +1 -0
  206. package/build/types/integrations/tracing-channel/firebase/functions.d.ts +15 -0
  207. package/build/types/integrations/tracing-channel/firebase/functions.d.ts.map +1 -0
  208. package/build/types/integrations/tracing-channel/firebase/index.d.ts +15 -0
  209. package/build/types/integrations/tracing-channel/firebase/index.d.ts.map +1 -0
  210. package/build/types/integrations/tracing-channel/firebase/instrumentation.d.ts +2 -0
  211. package/build/types/integrations/tracing-channel/firebase/instrumentation.d.ts.map +1 -0
  212. package/build/types/integrations/tracing-channel/vercel-ai.d.ts +1 -5
  213. package/build/types/integrations/tracing-channel/vercel-ai.d.ts.map +1 -1
  214. package/build/types/orchestrion/bundler/esbuild.d.ts +2 -3
  215. package/build/types/orchestrion/bundler/esbuild.d.ts.map +1 -1
  216. package/build/types/orchestrion/bundler/options.d.ts +34 -0
  217. package/build/types/orchestrion/bundler/options.d.ts.map +1 -1
  218. package/build/types/orchestrion/bundler/rollup.d.ts.map +1 -1
  219. package/build/types/orchestrion/bundler/subscribeInjection.d.ts +13 -0
  220. package/build/types/orchestrion/bundler/subscribeInjection.d.ts.map +1 -0
  221. package/build/types/orchestrion/bundler/vite.d.ts.map +1 -1
  222. package/build/types/orchestrion/bundler/webpack.d.ts +6 -1
  223. package/build/types/orchestrion/bundler/webpack.d.ts.map +1 -1
  224. package/build/types/orchestrion/channels.d.ts +15 -0
  225. package/build/types/orchestrion/channels.d.ts.map +1 -1
  226. package/build/types/orchestrion/config/amqplib.d.ts +2 -0
  227. package/build/types/orchestrion/config/amqplib.d.ts.map +1 -1
  228. package/build/types/orchestrion/config/anthropic-ai.d.ts +2 -0
  229. package/build/types/orchestrion/config/anthropic-ai.d.ts.map +1 -1
  230. package/build/types/orchestrion/config/aws-sdk.d.ts +2 -0
  231. package/build/types/orchestrion/config/aws-sdk.d.ts.map +1 -1
  232. package/build/types/orchestrion/config/channel-integration-definitions.d.ts +81 -0
  233. package/build/types/orchestrion/config/channel-integration-definitions.d.ts.map +1 -0
  234. package/build/types/orchestrion/config/dataloader.d.ts +2 -0
  235. package/build/types/orchestrion/config/dataloader.d.ts.map +1 -1
  236. package/build/types/orchestrion/config/express.d.ts +2 -0
  237. package/build/types/orchestrion/config/express.d.ts.map +1 -1
  238. package/build/types/orchestrion/config/firebase.d.ts +41 -2
  239. package/build/types/orchestrion/config/firebase.d.ts.map +1 -1
  240. package/build/types/orchestrion/config/generic-pool.d.ts +2 -0
  241. package/build/types/orchestrion/config/generic-pool.d.ts.map +1 -1
  242. package/build/types/orchestrion/config/google-genai.d.ts +2 -0
  243. package/build/types/orchestrion/config/google-genai.d.ts.map +1 -1
  244. package/build/types/orchestrion/config/graphql.d.ts +2 -0
  245. package/build/types/orchestrion/config/graphql.d.ts.map +1 -1
  246. package/build/types/orchestrion/config/hapi.d.ts +2 -0
  247. package/build/types/orchestrion/config/hapi.d.ts.map +1 -1
  248. package/build/types/orchestrion/config/index.d.ts +12 -0
  249. package/build/types/orchestrion/config/index.d.ts.map +1 -1
  250. package/build/types/orchestrion/config/ioredis.d.ts +1 -0
  251. package/build/types/orchestrion/config/ioredis.d.ts.map +1 -1
  252. package/build/types/orchestrion/config/kafkajs.d.ts +2 -0
  253. package/build/types/orchestrion/config/kafkajs.d.ts.map +1 -1
  254. package/build/types/orchestrion/config/knex.d.ts +1 -0
  255. package/build/types/orchestrion/config/knex.d.ts.map +1 -1
  256. package/build/types/orchestrion/config/koa.d.ts +2 -0
  257. package/build/types/orchestrion/config/koa.d.ts.map +1 -1
  258. package/build/types/orchestrion/config/langchain.d.ts +2 -0
  259. package/build/types/orchestrion/config/langchain.d.ts.map +1 -1
  260. package/build/types/orchestrion/config/langgraph.d.ts +2 -0
  261. package/build/types/orchestrion/config/langgraph.d.ts.map +1 -1
  262. package/build/types/orchestrion/config/lru-memoizer.d.ts +2 -0
  263. package/build/types/orchestrion/config/lru-memoizer.d.ts.map +1 -1
  264. package/build/types/orchestrion/config/mongodb.d.ts +2 -0
  265. package/build/types/orchestrion/config/mongodb.d.ts.map +1 -1
  266. package/build/types/orchestrion/config/mongoose.d.ts +2 -0
  267. package/build/types/orchestrion/config/mongoose.d.ts.map +1 -1
  268. package/build/types/orchestrion/config/mysql.d.ts +2 -0
  269. package/build/types/orchestrion/config/mysql.d.ts.map +1 -1
  270. package/build/types/orchestrion/config/mysql2.d.ts +2 -0
  271. package/build/types/orchestrion/config/mysql2.d.ts.map +1 -1
  272. package/build/types/orchestrion/config/nestjs.d.ts +1 -0
  273. package/build/types/orchestrion/config/nestjs.d.ts.map +1 -1
  274. package/build/types/orchestrion/config/openai.d.ts +2 -0
  275. package/build/types/orchestrion/config/openai.d.ts.map +1 -1
  276. package/build/types/orchestrion/config/pg.d.ts +2 -0
  277. package/build/types/orchestrion/config/pg.d.ts.map +1 -1
  278. package/build/types/orchestrion/config/postgres.d.ts +1 -0
  279. package/build/types/orchestrion/config/postgres.d.ts.map +1 -1
  280. package/build/types/orchestrion/config/redis.d.ts +2 -0
  281. package/build/types/orchestrion/config/redis.d.ts.map +1 -1
  282. package/build/types/orchestrion/config/remix.d.ts +1 -0
  283. package/build/types/orchestrion/config/remix.d.ts.map +1 -1
  284. package/build/types/orchestrion/config/subscribe-injection.d.ts +31 -0
  285. package/build/types/orchestrion/config/subscribe-injection.d.ts.map +1 -0
  286. package/build/types/orchestrion/config/tedious.d.ts +1 -0
  287. package/build/types/orchestrion/config/tedious.d.ts.map +1 -1
  288. package/build/types/orchestrion/config/vercel-ai.d.ts +1 -0
  289. package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -1
  290. package/build/types/orchestrion/index.d.ts +7 -6
  291. package/build/types/orchestrion/index.d.ts.map +1 -1
  292. package/build/types/orchestrion/registerChannelIntegration.d.ts +33 -0
  293. package/build/types/orchestrion/registerChannelIntegration.d.ts.map +1 -0
  294. package/build/types/vercel-ai/index.d.ts +2 -3
  295. package/build/types/vercel-ai/index.d.ts.map +1 -1
  296. package/build/types-ts3.8/index.d.ts +1 -1
  297. package/build/types-ts3.8/integrations/tracing-channel/fastify/index.d.ts +2 -2
  298. package/build/types-ts3.8/integrations/tracing-channel/fastify/utils.d.ts +1 -1
  299. package/build/types-ts3.8/integrations/tracing-channel/firebase/firestore-types.d.ts +38 -0
  300. package/build/types-ts3.8/integrations/tracing-channel/firebase/firestore.d.ts +18 -0
  301. package/build/types-ts3.8/integrations/tracing-channel/firebase/functions.d.ts +15 -0
  302. package/build/types-ts3.8/integrations/tracing-channel/firebase/index.d.ts +15 -0
  303. package/build/types-ts3.8/integrations/tracing-channel/firebase/instrumentation.d.ts +2 -0
  304. package/build/types-ts3.8/integrations/tracing-channel/vercel-ai.d.ts +1 -5
  305. package/build/types-ts3.8/orchestrion/bundler/esbuild.d.ts +2 -3
  306. package/build/types-ts3.8/orchestrion/bundler/options.d.ts +34 -0
  307. package/build/types-ts3.8/orchestrion/bundler/subscribeInjection.d.ts +13 -0
  308. package/build/types-ts3.8/orchestrion/bundler/webpack.d.ts +6 -1
  309. package/build/types-ts3.8/orchestrion/channels.d.ts +15 -0
  310. package/build/types-ts3.8/orchestrion/config/amqplib.d.ts +2 -0
  311. package/build/types-ts3.8/orchestrion/config/anthropic-ai.d.ts +2 -0
  312. package/build/types-ts3.8/orchestrion/config/aws-sdk.d.ts +2 -0
  313. package/build/types-ts3.8/orchestrion/config/channel-integration-definitions.d.ts +139 -0
  314. package/build/types-ts3.8/orchestrion/config/dataloader.d.ts +2 -0
  315. package/build/types-ts3.8/orchestrion/config/express.d.ts +2 -0
  316. package/build/types-ts3.8/orchestrion/config/firebase.d.ts +41 -2
  317. package/build/types-ts3.8/orchestrion/config/generic-pool.d.ts +2 -0
  318. package/build/types-ts3.8/orchestrion/config/google-genai.d.ts +2 -0
  319. package/build/types-ts3.8/orchestrion/config/graphql.d.ts +2 -0
  320. package/build/types-ts3.8/orchestrion/config/hapi.d.ts +2 -0
  321. package/build/types-ts3.8/orchestrion/config/index.d.ts +12 -0
  322. package/build/types-ts3.8/orchestrion/config/ioredis.d.ts +1 -0
  323. package/build/types-ts3.8/orchestrion/config/kafkajs.d.ts +2 -0
  324. package/build/types-ts3.8/orchestrion/config/knex.d.ts +1 -0
  325. package/build/types-ts3.8/orchestrion/config/koa.d.ts +2 -0
  326. package/build/types-ts3.8/orchestrion/config/langchain.d.ts +2 -0
  327. package/build/types-ts3.8/orchestrion/config/langgraph.d.ts +2 -0
  328. package/build/types-ts3.8/orchestrion/config/lru-memoizer.d.ts +2 -0
  329. package/build/types-ts3.8/orchestrion/config/mongodb.d.ts +2 -0
  330. package/build/types-ts3.8/orchestrion/config/mongoose.d.ts +2 -0
  331. package/build/types-ts3.8/orchestrion/config/mysql.d.ts +2 -0
  332. package/build/types-ts3.8/orchestrion/config/mysql2.d.ts +2 -0
  333. package/build/types-ts3.8/orchestrion/config/nestjs.d.ts +1 -0
  334. package/build/types-ts3.8/orchestrion/config/openai.d.ts +2 -0
  335. package/build/types-ts3.8/orchestrion/config/pg.d.ts +2 -0
  336. package/build/types-ts3.8/orchestrion/config/postgres.d.ts +1 -0
  337. package/build/types-ts3.8/orchestrion/config/redis.d.ts +2 -0
  338. package/build/types-ts3.8/orchestrion/config/remix.d.ts +1 -0
  339. package/build/types-ts3.8/orchestrion/config/subscribe-injection.d.ts +31 -0
  340. package/build/types-ts3.8/orchestrion/config/tedious.d.ts +1 -0
  341. package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +1 -0
  342. package/build/types-ts3.8/orchestrion/index.d.ts +7 -6
  343. package/build/types-ts3.8/orchestrion/registerChannelIntegration.d.ts +33 -0
  344. package/build/types-ts3.8/vercel-ai/index.d.ts +2 -3
  345. package/changes.json +7 -3
  346. package/package.json +11 -6
  347. package/build/cjs/orchestrion/config/prisma.js +0 -8
  348. package/build/cjs/orchestrion/config/prisma.js.map +0 -1
  349. package/build/cjs/orchestrion/config/react-router.js +0 -8
  350. package/build/cjs/orchestrion/config/react-router.js.map +0 -1
  351. package/build/esm/orchestrion/config/prisma.js +0 -5
  352. package/build/esm/orchestrion/config/prisma.js.map +0 -1
  353. package/build/esm/orchestrion/config/react-router.js +0 -5
  354. package/build/esm/orchestrion/config/react-router.js.map +0 -1
  355. package/build/types/orchestrion/config/prisma.d.ts +0 -4
  356. package/build/types/orchestrion/config/prisma.d.ts.map +0 -1
  357. package/build/types/orchestrion/config/react-router.d.ts +0 -4
  358. package/build/types/orchestrion/config/react-router.d.ts.map +0 -1
  359. package/build/types-ts3.8/orchestrion/config/prisma.d.ts +0 -4
  360. package/build/types-ts3.8/orchestrion/config/react-router.d.ts +0 -4
@@ -0,0 +1,64 @@
1
+ import * as diagnosticsChannel from 'node:diagnostics_channel';
2
+ import { debug } from '@sentry/core';
3
+ import { DEBUG_BUILD } from '../../../debug-build.js';
4
+ import { CHANNELS } from '../../../orchestrion/channels.js';
5
+ import { bindTracingChannelToSpan } from '../../../tracing-channel.js';
6
+ import { startFirestoreSpan } from './firestore.js';
7
+ import { wrapFunctionsRegistration } from './functions.js';
8
+
9
+ const FIRESTORE_OPERATIONS = [
10
+ { channel: CHANNELS.FIREBASE_FIRESTORE_ADD_DOC, spanName: "addDoc", useParent: false },
11
+ { channel: CHANNELS.FIREBASE_FIRESTORE_GET_DOCS, spanName: "getDocs", useParent: false },
12
+ { channel: CHANNELS.FIREBASE_FIRESTORE_SET_DOC, spanName: "setDoc", useParent: true },
13
+ { channel: CHANNELS.FIREBASE_FIRESTORE_DELETE_DOC, spanName: "deleteDoc", useParent: true }
14
+ ];
15
+ const FUNCTIONS_TRIGGERS = [
16
+ { channel: CHANNELS.FIREBASE_FUNCTIONS_HTTP_REQUEST, triggerType: "http.request" },
17
+ { channel: CHANNELS.FIREBASE_FUNCTIONS_HTTP_CALL, triggerType: "http.call" },
18
+ { channel: CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_CREATED, triggerType: "firestore.document.created" },
19
+ { channel: CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_UPDATED, triggerType: "firestore.document.updated" },
20
+ { channel: CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_DELETED, triggerType: "firestore.document.deleted" },
21
+ { channel: CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_WRITTEN, triggerType: "firestore.document.written" },
22
+ { channel: CHANNELS.FIREBASE_FUNCTIONS_SCHEDULER, triggerType: "scheduler.scheduled" },
23
+ { channel: CHANNELS.FIREBASE_FUNCTIONS_STORAGE_FINALIZED, triggerType: "storage.object.finalized" },
24
+ { channel: CHANNELS.FIREBASE_FUNCTIONS_STORAGE_ARCHIVED, triggerType: "storage.object.archived" },
25
+ { channel: CHANNELS.FIREBASE_FUNCTIONS_STORAGE_DELETED, triggerType: "storage.object.deleted" },
26
+ { channel: CHANNELS.FIREBASE_FUNCTIONS_STORAGE_METADATA_UPDATED, triggerType: "storage.object.metadataUpdated" }
27
+ ];
28
+ const NOOP = () => {
29
+ };
30
+ function safe(fn) {
31
+ try {
32
+ return fn();
33
+ } catch (error) {
34
+ DEBUG_BUILD && debug.warn("[orchestrion:firebase] error handling channel event", error);
35
+ return void 0;
36
+ }
37
+ }
38
+ function instrumentFirebase() {
39
+ for (const { channel, spanName, useParent } of FIRESTORE_OPERATIONS) {
40
+ bindTracingChannelToSpan(
41
+ diagnosticsChannel.tracingChannel(channel),
42
+ (data) => safe(() => {
43
+ const reference = data.arguments[0];
44
+ if (!reference) {
45
+ return void 0;
46
+ }
47
+ const spanReference = useParent ? reference.parent || reference : reference;
48
+ return startFirestoreSpan(spanName, spanReference);
49
+ })
50
+ );
51
+ }
52
+ for (const { channel, triggerType } of FUNCTIONS_TRIGGERS) {
53
+ diagnosticsChannel.tracingChannel(channel).subscribe({
54
+ start: (data) => void safe(() => wrapFunctionsRegistration(data, triggerType)),
55
+ end: NOOP,
56
+ asyncStart: NOOP,
57
+ asyncEnd: NOOP,
58
+ error: NOOP
59
+ });
60
+ }
61
+ }
62
+
63
+ export { instrumentFirebase };
64
+ //# sourceMappingURL=instrumentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/tracing-channel/firebase/instrumentation.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport { debug } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport { CHANNELS } from '../../../orchestrion/channels';\nimport { bindTracingChannelToSpan } from '../../../tracing-channel';\nimport type { FirestoreReference } from './firestore-types';\nimport { startFirestoreSpan } from './firestore';\nimport { wrapFunctionsRegistration } from './functions';\n\n// The context orchestrion's transform attaches to each firestore channel: `arguments` is the live args\n// of the wrapped `addDoc`/`getDocs`/`setDoc`/`deleteDoc` call, `arguments[0]` the reference.\ninterface FirestoreChannelContext {\n arguments: unknown[];\n self?: unknown;\n result?: unknown;\n error?: unknown;\n}\n\n// The firestore operations, keyed by channel. `useParent` mirrors the OTel integration: `setDoc`/\n// `deleteDoc` take a *document* reference but the span is named after its parent *collection*.\nconst FIRESTORE_OPERATIONS: Array<{ channel: string; spanName: string; useParent: boolean }> = [\n { channel: CHANNELS.FIREBASE_FIRESTORE_ADD_DOC, spanName: 'addDoc', useParent: false },\n { channel: CHANNELS.FIREBASE_FIRESTORE_GET_DOCS, spanName: 'getDocs', useParent: false },\n { channel: CHANNELS.FIREBASE_FIRESTORE_SET_DOC, spanName: 'setDoc', useParent: true },\n { channel: CHANNELS.FIREBASE_FIRESTORE_DELETE_DOC, spanName: 'deleteDoc', useParent: true },\n];\n\n// The firebase-functions triggers, keyed by channel. The value is the faas trigger type used for the\n// span name (`firebase.function.<trigger>`) and `faas.trigger` attribute.\nconst FUNCTIONS_TRIGGERS: Array<{ channel: string; triggerType: string }> = [\n { channel: CHANNELS.FIREBASE_FUNCTIONS_HTTP_REQUEST, triggerType: 'http.request' },\n { channel: CHANNELS.FIREBASE_FUNCTIONS_HTTP_CALL, triggerType: 'http.call' },\n { channel: CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_CREATED, triggerType: 'firestore.document.created' },\n { channel: CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_UPDATED, triggerType: 'firestore.document.updated' },\n { channel: CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_DELETED, triggerType: 'firestore.document.deleted' },\n { channel: CHANNELS.FIREBASE_FUNCTIONS_FIRESTORE_WRITTEN, triggerType: 'firestore.document.written' },\n { channel: CHANNELS.FIREBASE_FUNCTIONS_SCHEDULER, triggerType: 'scheduler.scheduled' },\n { channel: CHANNELS.FIREBASE_FUNCTIONS_STORAGE_FINALIZED, triggerType: 'storage.object.finalized' },\n { channel: CHANNELS.FIREBASE_FUNCTIONS_STORAGE_ARCHIVED, triggerType: 'storage.object.archived' },\n { channel: CHANNELS.FIREBASE_FUNCTIONS_STORAGE_DELETED, triggerType: 'storage.object.deleted' },\n { channel: CHANNELS.FIREBASE_FUNCTIONS_STORAGE_METADATA_UPDATED, triggerType: 'storage.object.metadataUpdated' },\n];\n\nconst NOOP = (): void => {};\n\n/**\n * Runs a span-building callback so a throw inside it can never break the user's firebase call: these run\n * inside the `tracingChannel(...)` machinery wrapping the real function, where an unguarded throw would\n * propagate into the traced call.\n */\nfunction safe<T>(fn: () => T): T | undefined {\n try {\n return fn();\n } catch (error) {\n DEBUG_BUILD && debug.warn('[orchestrion:firebase] error handling channel event', error);\n return undefined;\n }\n}\n\nexport function instrumentFirebase() {\n for (const { channel, spanName, useParent } of FIRESTORE_OPERATIONS) {\n bindTracingChannelToSpan(diagnosticsChannel.tracingChannel<FirestoreChannelContext>(channel), data =>\n safe(() => {\n const reference = data.arguments[0] as FirestoreReference | undefined;\n if (!reference) {\n return undefined;\n }\n const spanReference = useParent ? reference.parent || reference : reference;\n return startFirestoreSpan(spanName, spanReference);\n }),\n );\n }\n\n for (const { channel, triggerType } of FUNCTIONS_TRIGGERS) {\n // Functions are wrapped, not span-bound: the handler runs long after this synchronous\n // registration call, so we only rewrap the handler argument here (in `start`) and open the\n // span inside that wrapper. The other lifecycle events are irrelevant, so no-op them.\n diagnosticsChannel.tracingChannel(channel).subscribe({\n start: data => void safe(() => wrapFunctionsRegistration(data as { arguments: unknown[] }, triggerType)),\n end: NOOP,\n asyncStart: NOOP,\n asyncEnd: NOOP,\n error: NOOP,\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAoBA,MAAM,oBAAA,GAAyF;AAAA,EAC7F,EAAE,OAAA,EAAS,QAAA,CAAS,4BAA4B,QAAA,EAAU,QAAA,EAAU,WAAW,KAAA,EAAM;AAAA,EACrF,EAAE,OAAA,EAAS,QAAA,CAAS,6BAA6B,QAAA,EAAU,SAAA,EAAW,WAAW,KAAA,EAAM;AAAA,EACvF,EAAE,OAAA,EAAS,QAAA,CAAS,4BAA4B,QAAA,EAAU,QAAA,EAAU,WAAW,IAAA,EAAK;AAAA,EACpF,EAAE,OAAA,EAAS,QAAA,CAAS,+BAA+B,QAAA,EAAU,WAAA,EAAa,WAAW,IAAA;AACvF,CAAA;AAIA,MAAM,kBAAA,GAAsE;AAAA,EAC1E,EAAE,OAAA,EAAS,QAAA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AwC,OAAO,CAAA;AAAA,MAAG,CAAA,IAAA,KAC5F,KAAK,MAAM;AACT,QAAA,MAAM,SAAA,GAAY,IAAA,CAAK,SAAA,CAAU,CAAC,CAAA;AAClC,QAAA,IAAI,CAAC,SAAA,EAAW;AACd,UAAA,OAAO,KAAA,CAAA;AAAA,QACT;AACA,QAAA,MAAM,aAAA,GAAgB,SAAA,GAAY,SAAA,CAAU,MAAA,IAAU,SAAA,GAAY,SAAA;AAClE,QAAA,OAAO,kBAAA,CAAmB,UAAU,aAAa,CAAA;AAAA,MACnD,CAAC;AAAA,KACH;AAAA,EACF;AAEA,EAAA,KAAA,MAAW,EAAE,OAAA,EAAS,WAAA,EAAY,IAAK,kBAAA,EAAoB;AAIzD,IAAA,kBAAA,CAAmB,cAAA,CAAe,OAAO,CAAA,CAAE,SAAA,CAAU;AAAA,MACnD,KAAA,EAAO,UAAQ,KAAK,IAAA,CAAK,MAAM,yBAAA,CAA0B,IAAA,EAAkC,WAAW,CAAC,CAAA;AAAA,MACvG,GAAA,EAAK,IAAA;AAAA,MACL,UAAA,EAAY,IAAA;AAAA,MACZ,QAAA,EAAU,IAAA;AAAA,MACV,KAAA,EAAO;AAAA,KACR,CAAA;AAAA,EACH;AACF;;;;"}
@@ -1,8 +1,31 @@
1
1
  import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/esbuild';
2
- import { orchestrionTransformOptions } from './options.js';
2
+ import { escapeStringForRegex } from '@sentry/core';
3
+ import { instrumentedModuleNames } from '../config/index.js';
4
+ import { orchestrionTransformOptions, externalizedModulesWarning, externalEntryMatchesModule } from './options.js';
3
5
 
6
+ function matchesEsbuildExternal(entry, moduleName) {
7
+ if (entry.includes("*")) {
8
+ return new RegExp(`^${entry.split("*").map(escapeStringForRegex).join(".*")}$`).test(moduleName);
9
+ }
10
+ return externalEntryMatchesModule(entry, moduleName);
11
+ }
4
12
  function sentryOrchestrionPlugin(options = {}) {
5
- return codeTransformer(orchestrionTransformOptions(options));
13
+ const plugin = codeTransformer(orchestrionTransformOptions(options));
14
+ const moduleNames = instrumentedModuleNames(options.instrumentations);
15
+ const setup = plugin.setup;
16
+ return {
17
+ ...plugin,
18
+ setup(build) {
19
+ const external = build.initialOptions.external || [];
20
+ const externalizedModules = moduleNames.filter(
21
+ (name) => external.some((entry) => matchesEsbuildExternal(entry, name))
22
+ );
23
+ if (externalizedModules.length > 0) {
24
+ build.onStart(() => ({ warnings: [{ text: externalizedModulesWarning(externalizedModules) }] }));
25
+ }
26
+ return setup(build);
27
+ }
28
+ };
6
29
  }
7
30
 
8
31
  export { sentryOrchestrionPlugin };
@@ -1 +1 @@
1
- {"version":3,"file":"esbuild.js","sources":["../../../../src/orchestrion/bundler/esbuild.ts"],"sourcesContent":["import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/esbuild';\nimport type { PluginOptions } from './options';\nimport { orchestrionTransformOptions } from './options';\n\n/**\n * esbuild plugin that runs the orchestrion code transform on the bundled output.\n *\n * Use when bundling a Node app with esbuild. For unbundled Node processes use the\n * runtime hook instead (`node --import @sentry/node/orchestrion app.js`).\n *\n * esbuild does not flatten nested `plugins` arrays, so this returns a single\n * plugin that strips instrumented packages from an `external` denylist before\n * delegating to the upstream transform.\n *\n * @example\n * ```ts\n * // build.mjs\n * import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/esbuild';\n * await esbuild.build({ plugins: [sentryOrchestrionPlugin()] });\n * ```\n */\nexport function sentryOrchestrionPlugin(options: PluginOptions = {}): ReturnType<typeof codeTransformer> {\n return codeTransformer(orchestrionTransformOptions(options));\n}\n"],"names":[],"mappings":";;;AAqBO,SAAS,uBAAA,CAAwB,OAAA,GAAyB,EAAC,EAAuC;AACvG,EAAA,OAAO,eAAA,CAAgB,2BAAA,CAA4B,OAAO,CAAC,CAAA;AAC7D;;;;"}
1
+ {"version":3,"file":"esbuild.js","sources":["../../../../src/orchestrion/bundler/esbuild.ts"],"sourcesContent":["import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/esbuild';\nimport { escapeStringForRegex } from '@sentry/core';\nimport { instrumentedModuleNames } from '../config';\nimport type { PluginOptions } from './options';\nimport { externalEntryMatchesModule, externalizedModulesWarning, orchestrionTransformOptions } from './options';\n\n// esbuild `external` entries may contain `*` wildcards.\nfunction matchesEsbuildExternal(entry: string, moduleName: string): boolean {\n if (entry.includes('*')) {\n return new RegExp(`^${entry.split('*').map(escapeStringForRegex).join('.*')}$`).test(moduleName);\n }\n return externalEntryMatchesModule(entry, moduleName);\n}\n\n/**\n * esbuild plugin that runs the orchestrion code transform on the bundled output.\n *\n * Use when bundling a Node app with esbuild. For unbundled Node processes use the\n * runtime hook instead (`node --import @sentry/node/orchestrion app.js`).\n *\n * Instrumented packages marked as `external` never pass through the code\n * transform, so a build warning is emitted for them.\n *\n * @example\n * ```ts\n * // build.mjs\n * import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/esbuild';\n * await esbuild.build({ plugins: [sentryOrchestrionPlugin()] });\n * ```\n */\nexport function sentryOrchestrionPlugin(options: PluginOptions = {}): ReturnType<typeof codeTransformer> {\n const plugin = codeTransformer(orchestrionTransformOptions(options));\n const moduleNames = instrumentedModuleNames(options.instrumentations);\n const setup = plugin.setup;\n\n return {\n ...plugin,\n setup(build): ReturnType<typeof setup> {\n const external = build.initialOptions.external || [];\n const externalizedModules = moduleNames.filter(name =>\n external.some(entry => matchesEsbuildExternal(entry, name)),\n );\n if (externalizedModules.length > 0) {\n build.onStart(() => ({ warnings: [{ text: externalizedModulesWarning(externalizedModules) }] }));\n }\n return setup(build);\n },\n };\n}\n"],"names":[],"mappings":";;;;;AAOA,SAAS,sBAAA,CAAuB,OAAe,UAAA,EAA6B;AAC1E,EAAA,IAAI,KAAA,CAAM,QAAA,CAAS,GAAG,CAAA,EAAG;AACvB,IAAA,OAAO,IAAI,MAAA,CAAO,CAAA,CAAA,EAAI,KAAA,CAAM,KAAA,CAAM,GAAG,CAAA,CAAE,GAAA,CAAI,oBAAoB,CAAA,CAAE,KAAK,IAAI,CAAC,CAAA,CAAA,CAAG,CAAA,CAAE,KAAK,UAAU,CAAA;AAAA,EACjG;AACA,EAAA,OAAO,0BAAA,CAA2B,OAAO,UAAU,CAAA;AACrD;AAkBO,SAAS,uBAAA,CAAwB,OAAA,GAAyB,EAAC,EAAuC;AACvG,EAAA,MAAM,MAAA,GAAS,eAAA,CAAgB,2BAAA,CAA4B,OAAO,CAAC,CAAA;AACnE,EAAA,MAAM,WAAA,GAAc,uBAAA,CAAwB,OAAA,CAAQ,gBAAgB,CAAA;AACpE,EAAA,MAAM,QAAQ,MAAA,CAAO,KAAA;AAErB,EAAA,OAAO;AAAA,IACL,GAAG,MAAA;AAAA,IACH,MAAM,KAAA,EAAiC;AACrC,MAAA,MAAM,QAAA,GAAW,KAAA,CAAM,cAAA,CAAe,QAAA,IAAY,EAAC;AACnD,MAAA,MAAM,sBAAsB,WAAA,CAAY,MAAA;AAAA,QAAO,UAC7C,QAAA,CAAS,IAAA,CAAK,WAAS,sBAAA,CAAuB,KAAA,EAAO,IAAI,CAAC;AAAA,OAC5D;AACA,MAAA,IAAI,mBAAA,CAAoB,SAAS,CAAA,EAAG;AAClC,QAAA,KAAA,CAAM,OAAA,CAAQ,OAAO,EAAE,QAAA,EAAU,CAAC,EAAE,IAAA,EAAM,0BAAA,CAA2B,mBAAmB,CAAA,EAAG,CAAA,EAAE,CAAE,CAAA;AAAA,MACjG;AACA,MAAA,OAAO,MAAM,KAAK,CAAA;AAAA,IACpB;AAAA,GACF;AACF;;;;"}
@@ -1,8 +1,20 @@
1
1
  import { SENTRY_INSTRUMENTATIONS } from '../config/index.js';
2
+ import { subscribeInjectionOptions } from './subscribeInjection.js';
2
3
 
4
+ function externalEntryMatchesModule(entry, moduleName) {
5
+ return entry === moduleName || entry.startsWith(`${moduleName}/`);
6
+ }
7
+ function externalizedModulesWarning(externalizedModules) {
8
+ return `The following packages are marked as external in your bundler configuration but need to be bundled for Sentry instrumentation to work: ${externalizedModules.join(", ")}. Remove them from your bundler's "external" configuration, or use the Sentry Node SDK's runtime instrumentation instead.`;
9
+ }
3
10
  function orchestrionTransformOptions(options) {
4
- const instrumentations = [...SENTRY_INSTRUMENTATIONS, ...options.instrumentations || []];
5
- const customTransforms = options.customTransforms;
11
+ const subscribeInjection = options.injectChannelSubscribers ? subscribeInjectionOptions() : void 0;
12
+ const instrumentations = [
13
+ ...SENTRY_INSTRUMENTATIONS,
14
+ ...options.instrumentations || [],
15
+ ...subscribeInjection?.instrumentations || []
16
+ ];
17
+ const customTransforms = { ...options.customTransforms, ...subscribeInjection?.customTransforms };
6
18
  if (options.shouldInjectDiagnostics === false) {
7
19
  return {
8
20
  instrumentations,
@@ -18,5 +30,5 @@ function orchestrionTransformOptions(options) {
18
30
  };
19
31
  }
20
32
 
21
- export { orchestrionTransformOptions };
33
+ export { externalEntryMatchesModule, externalizedModulesWarning, orchestrionTransformOptions };
22
34
  //# sourceMappingURL=options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sources":["../../../../src/orchestrion/bundler/options.ts"],"sourcesContent":["import type { InstrumentationConfig, CustomTransform } from '..';\nimport { SENTRY_INSTRUMENTATIONS } from '../config';\nimport type { CodeTransformerPluginOptions } from '@apm-js-collab/code-transformer-bundler-plugins/core';\n\nexport type PluginOptions = {\n /**\n * Additional instrumentations to include with the default instrumentation.\n */\n instrumentations?: InstrumentationConfig[];\n /**\n * Custom transforms that can be applied using the `transform` option in each `InstrumentationConfig`.\n */\n customTransforms?: Record<string, CustomTransform>;\n /**\n * Whether to inject the global diagnostics.\n *\n * Defaults to `true`.\n */\n shouldInjectDiagnostics?: boolean;\n};\n\n/**\n * The `@apm-js-collab/code-transformer-bundler-plugins` options shared by every\n * orchestrion bundler plugin.\n *\n * `injectDiagnostics` sets `globalThis.__SENTRY_ORCHESTRION__.bundler = [\"mysql\"]` at\n * app boot so the `_experimentalSetupOrchestrion()` detector can confirm the\n * bundler path ran (rather than relying on a build-time flag that wouldn't be\n * visible to the runtime).\n */\nexport function orchestrionTransformOptions(options: PluginOptions): CodeTransformerPluginOptions {\n const instrumentations = [...SENTRY_INSTRUMENTATIONS, ...(options.instrumentations || [])];\n const customTransforms = options.customTransforms;\n\n if (options.shouldInjectDiagnostics === false) {\n return {\n instrumentations,\n customTransforms,\n };\n }\n\n return {\n instrumentations,\n customTransforms,\n injectDiagnostics: (diag: { transformedModules: string[]; failedModules: string[] }) => {\n return `(globalThis.__SENTRY_ORCHESTRION__=globalThis.__SENTRY_ORCHESTRION__||{}).bundler=${JSON.stringify(diag.transformedModules)};`;\n },\n };\n}\n"],"names":[],"mappings":";;AA8BO,SAAS,4BAA4B,OAAA,EAAsD;AAChG,EAAA,MAAM,gBAAA,GAAmB,CAAC,GAAG,uBAAA,EAAyB,GAAI,OAAA,CAAQ,gBAAA,IAAoB,EAAG,CAAA;AACzF,EAAA,MAAM,mBAAmB,OAAA,CAAQ,gBAAA;AAEjC,EAAA,IAAI,OAAA,CAAQ,4BAA4B,KAAA,EAAO;AAC7C,IAAA,OAAO;AAAA,MACL,gBAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,gBAAA;AAAA,IACA,gBAAA;AAAA,IACA,iBAAA,EAAmB,CAAC,IAAA,KAAoE;AACtF,MAAA,OAAO,CAAA,kFAAA,EAAqF,IAAA,CAAK,SAAA,CAAU,IAAA,CAAK,kBAAkB,CAAC,CAAA,CAAA,CAAA;AAAA,IACrI;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"options.js","sources":["../../../../src/orchestrion/bundler/options.ts"],"sourcesContent":["import type { InstrumentationConfig, CustomTransform } from '..';\nimport { SENTRY_INSTRUMENTATIONS } from '../config';\nimport { subscribeInjectionOptions } from './subscribeInjection';\nimport type { CodeTransformerPluginOptions } from '@apm-js-collab/code-transformer-bundler-plugins/core';\n\nexport type PluginOptions = {\n /**\n * Additional instrumentations to include with the default instrumentation.\n */\n instrumentations?: InstrumentationConfig[];\n /**\n * Custom transforms that can be applied using the `transform` option in each `InstrumentationConfig`.\n */\n customTransforms?: Record<string, CustomTransform>;\n /**\n * Whether to inject the global diagnostics.\n *\n * Defaults to `true`.\n */\n shouldInjectDiagnostics?: boolean;\n /**\n * Inject a small marker-push into each instrumented module that imports only\n * that package's channel-subscriber factory and pushes it onto\n * `globalThis.__SENTRY_ORCHESTRION__.integrations`. A bundler-only SDK reads\n * the marker at `init()` and instantiates the collected factories, so every\n * transformed package's subscriber is wired up with no runtime module hook.\n *\n * Because each site imports a single named factory, it tree-shakes: a bundle\n * carries subscriber code only for the packages actually transformed into it.\n *\n * This is what lets a bundler-only SDK (e.g. `@sentry/cloudflare`, which runs\n * in workerd where requires can't be monkey-patched) record channel spans,\n * but it is bundler-agnostic: any orchestrion bundler plugin can enable it.\n * Leave it off for SDKs that wire the integrations up through a static import\n * instead (e.g. `@sentry/node`'s `experimentalUseDiagnosticsChannelInjection()`),\n * so the subscribers aren't registered twice.\n *\n * Defaults to `false`.\n */\n injectChannelSubscribers?: boolean;\n};\n\n/**\n * Whether an \"external\" config entry covers an instrumented module: an exact\n * package name (`'mysql'`) or a subpath (`'mysql/lib/...'`) — the transform may\n * target exactly the file a subpath entry externalizes. Mirrors the matching in\n * `withoutInstrumentedExternals`.\n */\nexport function externalEntryMatchesModule(entry: string, moduleName: string): boolean {\n return entry === moduleName || entry.startsWith(`${moduleName}/`);\n}\n\n/**\n * Warning emitted when a bundler config externalizes packages that orchestrion\n * needs to transform. An externalized dependency is resolved from\n * `node_modules` at runtime and never passes through the code transform, so\n * its diagnostics_channel calls are silently never injected.\n */\nexport function externalizedModulesWarning(externalizedModules: string[]): string {\n return (\n `The following packages are marked as external in your bundler configuration but need to be bundled for Sentry ` +\n `instrumentation to work: ${externalizedModules.join(', ')}. Remove them from your bundler's \"external\" ` +\n `configuration, or use the Sentry Node SDK's runtime instrumentation instead.`\n );\n}\n\n/**\n * The `@apm-js-collab/code-transformer-bundler-plugins` options shared by every\n * orchestrion bundler plugin.\n *\n * `injectDiagnostics` sets `globalThis.__SENTRY_ORCHESTRION__.bundler = [\"mysql\"]` at\n * app boot so the `_experimentalSetupOrchestrion()` detector can confirm the\n * bundler path ran (rather than relying on a build-time flag that wouldn't be\n * visible to the runtime).\n */\nexport function orchestrionTransformOptions(options: PluginOptions): CodeTransformerPluginOptions {\n const subscribeInjection = options.injectChannelSubscribers ? subscribeInjectionOptions() : undefined;\n\n const instrumentations = [\n ...SENTRY_INSTRUMENTATIONS,\n ...(options.instrumentations || []),\n ...(subscribeInjection?.instrumentations || []),\n ];\n const customTransforms = { ...options.customTransforms, ...subscribeInjection?.customTransforms };\n\n if (options.shouldInjectDiagnostics === false) {\n return {\n instrumentations,\n customTransforms,\n };\n }\n\n return {\n instrumentations,\n customTransforms,\n injectDiagnostics: (diag: { transformedModules: string[]; failedModules: string[] }) => {\n return `(globalThis.__SENTRY_ORCHESTRION__=globalThis.__SENTRY_ORCHESTRION__||{}).bundler=${JSON.stringify(diag.transformedModules)};`;\n },\n };\n}\n"],"names":[],"mappings":";;;AAgDO,SAAS,0BAAA,CAA2B,OAAe,UAAA,EAA6B;AACrF,EAAA,OAAO,UAAU,UAAA,IAAc,KAAA,CAAM,UAAA,CAAW,CAAA,EAAG,UAAU,CAAA,CAAA,CAAG,CAAA;AAClE;AAQO,SAAS,2BAA2B,mBAAA,EAAuC;AAChF,EAAA,OACE,CAAA,uIAAA,EAC4B,mBAAA,CAAoB,IAAA,CAAK,IAAI,CAAC,CAAA,yHAAA,CAAA;AAG9D;AAWO,SAAS,4BAA4B,OAAA,EAAsD;AAChG,EAAA,MAAM,kBAAA,GAAqB,OAAA,CAAQ,wBAAA,GAA2B,yBAAA,EAA0B,GAAI,MAAA;AAE5F,EAAA,MAAM,gBAAA,GAAmB;AAAA,IACvB,GAAG,uBAAA;AAAA,IACH,GAAI,OAAA,CAAQ,gBAAA,IAAoB,EAAC;AAAA,IACjC,GAAI,kBAAA,EAAoB,gBAAA,IAAoB;AAAC,GAC/C;AACA,EAAA,MAAM,mBAAmB,EAAE,GAAG,QAAQ,gBAAA,EAAkB,GAAG,oBAAoB,gBAAA,EAAiB;AAEhG,EAAA,IAAI,OAAA,CAAQ,4BAA4B,KAAA,EAAO;AAC7C,IAAA,OAAO;AAAA,MACL,gBAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,gBAAA;AAAA,IACA,gBAAA;AAAA,IACA,iBAAA,EAAmB,CAAC,IAAA,KAAoE;AACtF,MAAA,OAAO,CAAA,kFAAA,EAAqF,IAAA,CAAK,SAAA,CAAU,IAAA,CAAK,kBAAkB,CAAC,CAAA,CAAA,CAAA;AAAA,IACrI;AAAA,GACF;AACF;;;;"}
@@ -1,8 +1,18 @@
1
1
  import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/rollup';
2
- import { orchestrionTransformOptions } from './options.js';
2
+ import { instrumentedModuleNames } from '../config/index.js';
3
+ import { externalizedModulesWarning, orchestrionTransformOptions } from './options.js';
3
4
 
4
5
  function sentryOrchestrionPlugin(options = {}) {
5
- return codeTransformer(orchestrionTransformOptions(options));
6
+ const moduleNames = instrumentedModuleNames(options.instrumentations);
7
+ return {
8
+ ...codeTransformer(orchestrionTransformOptions(options)),
9
+ buildStart(rollupOptions) {
10
+ const externalizedModules = moduleNames.filter((name) => rollupOptions.external(name, void 0, false));
11
+ if (externalizedModules.length > 0) {
12
+ this.warn(externalizedModulesWarning(externalizedModules));
13
+ }
14
+ }
15
+ };
6
16
  }
7
17
 
8
18
  export { sentryOrchestrionPlugin };
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.js","sources":["../../../../src/orchestrion/bundler/rollup.ts"],"sourcesContent":["import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/rollup';\nimport type { PluginOptions } from './options';\nimport { orchestrionTransformOptions } from './options';\n\n/**\n * Rollup plugin that runs the orchestrion code transform on the bundled output.\n *\n * Use when bundling a Node app with Rollup. For unbundled Node processes use the\n * runtime hook instead (`node --import @sentry/node/orchestrion app.js`).\n *\n * @example\n * ```ts\n * // rollup.config.js\n * import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/rollup';\n * export default { plugins: [sentryOrchestrionPlugin()] };\n * ```\n */\nexport function sentryOrchestrionPlugin(options: PluginOptions = {}): ReturnType<typeof codeTransformer> {\n return codeTransformer(orchestrionTransformOptions(options));\n}\n"],"names":[],"mappings":";;;AAiBO,SAAS,uBAAA,CAAwB,OAAA,GAAyB,EAAC,EAAuC;AACvG,EAAA,OAAO,eAAA,CAAgB,2BAAA,CAA4B,OAAO,CAAC,CAAA;AAC7D;;;;"}
1
+ {"version":3,"file":"rollup.js","sources":["../../../../src/orchestrion/bundler/rollup.ts"],"sourcesContent":["import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/rollup';\nimport type { NormalizedInputOptions, PluginContext } from 'rollup';\nimport { instrumentedModuleNames } from '../config';\nimport type { PluginOptions } from './options';\nimport { externalizedModulesWarning, orchestrionTransformOptions } from './options';\n\n/**\n * Rollup plugin that runs the orchestrion code transform on the bundled output.\n *\n * Use when bundling a Node app with Rollup. For unbundled Node processes use the\n * runtime hook instead (`node --import @sentry/node/orchestrion app.js`).\n *\n * @example\n * ```ts\n * // rollup.config.js\n * import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/rollup';\n * export default { plugins: [sentryOrchestrionPlugin()] };\n * ```\n */\nexport function sentryOrchestrionPlugin(options: PluginOptions = {}): ReturnType<typeof codeTransformer> {\n const moduleNames = instrumentedModuleNames(options.instrumentations);\n\n return {\n ...codeTransformer(orchestrionTransformOptions(options)),\n buildStart(this: PluginContext, rollupOptions: NormalizedInputOptions): void {\n // An externalized dependency never passes through the code transform, so\n // its diagnostics_channel calls are silently never injected. By the time\n // buildStart runs, Rollup has normalized `external` (string arrays,\n // RegExps or user functions) into a single predicate we can probe.\n const externalizedModules = moduleNames.filter(name => rollupOptions.external(name, undefined, false));\n if (externalizedModules.length > 0) {\n this.warn(externalizedModulesWarning(externalizedModules));\n }\n },\n };\n}\n"],"names":[],"mappings":";;;;AAmBO,SAAS,uBAAA,CAAwB,OAAA,GAAyB,EAAC,EAAuC;AACvG,EAAA,MAAM,WAAA,GAAc,uBAAA,CAAwB,OAAA,CAAQ,gBAAgB,CAAA;AAEpE,EAAA,OAAO;AAAA,IACL,GAAG,eAAA,CAAgB,2BAAA,CAA4B,OAAO,CAAC,CAAA;AAAA,IACvD,WAAgC,aAAA,EAA6C;AAK3E,MAAA,MAAM,mBAAA,GAAsB,YAAY,MAAA,CAAO,CAAA,IAAA,KAAQ,cAAc,QAAA,CAAS,IAAA,EAAM,MAAA,EAAW,KAAK,CAAC,CAAA;AACrG,MAAA,IAAI,mBAAA,CAAoB,SAAS,CAAA,EAAG;AAClC,QAAA,IAAA,CAAK,IAAA,CAAK,0BAAA,CAA2B,mBAAmB,CAAC,CAAA;AAAA,MAC3D;AAAA,IACF;AAAA,GACF;AACF;;;;"}
@@ -0,0 +1,38 @@
1
+ import { parse } from 'meriyah';
2
+ import { SUBSCRIBE_INJECTIONS } from '../config/index.js';
3
+ import { subscriberExportForModule } from '../config/channel-integration-definitions.js';
4
+ import { SUBSCRIBE_TRANSFORM_NAME } from '../config/subscribe-injection.js';
5
+
6
+ const injectedPrograms = /* @__PURE__ */ new WeakSet();
7
+ function subscribeSnippet(exportName, esm) {
8
+ const importStmt = esm ? `import { ${exportName}, registerOrchestrionChannelIntegration } from '@sentry/server-utils/orchestrion';` : `const { ${exportName}, registerOrchestrionChannelIntegration } = require('@sentry/server-utils/orchestrion');`;
9
+ return `${importStmt}
10
+ registerOrchestrionChannelIntegration(${JSON.stringify(exportName)}, ${exportName});`;
11
+ }
12
+ const injectSubscribe = (state, program) => {
13
+ const node = program;
14
+ if (injectedPrograms.has(node)) {
15
+ return;
16
+ }
17
+ const { moduleType, channelName } = state;
18
+ const exportName = channelName ? subscriberExportForModule(channelName) : void 0;
19
+ if (!exportName) {
20
+ return;
21
+ }
22
+ injectedPrograms.add(node);
23
+ const statements = parse(subscribeSnippet(exportName, moduleType === "esm"), {
24
+ module: moduleType === "esm",
25
+ next: true
26
+ }).body;
27
+ const directiveIndex = node.body.findIndex((n) => n.type === "ExpressionStatement" && n.directive === "use strict");
28
+ node.body.splice(directiveIndex + 1, 0, ...statements);
29
+ };
30
+ function subscribeInjectionOptions() {
31
+ return {
32
+ instrumentations: SUBSCRIBE_INJECTIONS,
33
+ customTransforms: { [SUBSCRIBE_TRANSFORM_NAME]: injectSubscribe }
34
+ };
35
+ }
36
+
37
+ export { subscribeInjectionOptions };
38
+ //# sourceMappingURL=subscribeInjection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscribeInjection.js","sources":["../../../../src/orchestrion/bundler/subscribeInjection.ts"],"sourcesContent":["import type { CustomTransform } from '@apm-js-collab/code-transformer';\nimport { parse } from 'meriyah';\nimport { SUBSCRIBE_INJECTIONS } from '../config';\nimport { subscriberExportForModule } from '../config/channel-integration-definitions';\nimport { SUBSCRIBE_TRANSFORM_NAME } from '../config/subscribe-injection';\nimport type { PluginOptions } from './options';\n\n// Tracks Program nodes we already injected into, so a package with several\n// instrumented files (or several configs pointing at one file) is injected only\n// once per file. A `WeakSet` keyed by the node avoids mutating the emitted AST.\nconst injectedPrograms = new WeakSet<object>();\n\ninterface ProgramNode {\n type: string;\n body: Array<{ type: string; directive?: string }>;\n}\n\n/**\n * Snippet injected into each instrumented module. It imports ONLY that package's\n * channel-subscriber factory (plus the `registerOrchestrionChannelIntegration`\n * helper) from `@sentry/server-utils/orchestrion`, and hands both to the helper,\n * which stores the factory on the global marker and live-registers it on any\n * existing client (see that helper for the load-order and dedup rationale).\n *\n * Importing the single named factory (rather than a central dispatch that pulls\n * in every subscriber) is what makes this tree-shake: a bundle carries only the\n * subscriber code for packages actually transformed into it. The same\n * \"only-active-when-bundled\" property the runtime module hook gives unbundled\n * Node, but without a hook (workerd can't monkey-patch requires). The helper is\n * generic (references no factory), so importing it alongside doesn't pull siblings.\n */\nfunction subscribeSnippet(exportName: string, esm: boolean): string {\n const importStmt = esm\n ? `import { ${exportName}, registerOrchestrionChannelIntegration } from '@sentry/server-utils/orchestrion';`\n : `const { ${exportName}, registerOrchestrionChannelIntegration } = require('@sentry/server-utils/orchestrion');`;\n\n return `${importStmt}\\nregisterOrchestrionChannelIntegration(${JSON.stringify(exportName)}, ${exportName});`;\n}\n\n/**\n * The custom transform registered under {@link SUBSCRIBE_TRANSFORM_NAME}. It is\n * invoked with the matched `Program` node and mutates it in place, splicing the\n * marker-push snippet in after any `'use strict'` directive.\n *\n * `state` carries the matched config spread with `{ moduleType }`; the config's\n * `channelName` carries the package name (see `toSubscribeInjections`), which\n * maps to the subscriber's export name.\n */\nconst injectSubscribe: CustomTransform = (state, program) => {\n const node = program as ProgramNode;\n if (injectedPrograms.has(node)) {\n return;\n }\n\n const { moduleType, channelName } = state as { moduleType?: string; channelName?: string };\n const exportName = channelName ? subscriberExportForModule(channelName) : undefined;\n if (!exportName) {\n return;\n }\n\n injectedPrograms.add(node);\n\n const statements = parse(subscribeSnippet(exportName, moduleType === 'esm'), {\n module: moduleType === 'esm',\n next: true,\n }).body as ProgramNode['body'];\n\n const directiveIndex = node.body.findIndex(n => n.type === 'ExpressionStatement' && n.directive === 'use strict');\n node.body.splice(directiveIndex + 1, 0, ...statements);\n};\n\n/**\n * The `instrumentations` + `customTransforms` a bundler plugin passes to\n * {@link orchestrionTransformOptions} to enable the marker-push subscribe\n * injection used by bundler-only SDKs (e.g. `@sentry/cloudflare`).\n *\n * The `SUBSCRIBE_INJECTIONS` configs ride alongside the real channel-publishing\n * configs, and `injectSubscribe` runs on each matched module, so every\n * transformed package self-registers its subscriber on the global marker\n * without a runtime module hook.\n */\nexport function subscribeInjectionOptions(): Pick<PluginOptions, 'instrumentations' | 'customTransforms'> {\n return {\n instrumentations: SUBSCRIBE_INJECTIONS,\n customTransforms: { [SUBSCRIBE_TRANSFORM_NAME]: injectSubscribe },\n };\n}\n"],"names":[],"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GAA0F;AACxG,EAAA,OAAO;AAAA,IACL,gBAAA,EAAkB,oBAAA;AAAA,IAClB,gBAAA,EAAkB,EAAE,CAAC,wBAAwB,GAAG,eAAA;AAAgB,GAClE;AACF;;;;"}
@@ -1,12 +1,25 @@
1
1
  import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/vite';
2
2
  import { instrumentedModuleNames } from '../config/index.js';
3
- import { orchestrionTransformOptions } from './options.js';
3
+ import { externalEntryMatchesModule, externalizedModulesWarning, orchestrionTransformOptions } from './options.js';
4
4
 
5
5
  function sentryOrchestrionPlugin(options = {}) {
6
6
  return {
7
7
  ...codeTransformer(orchestrionTransformOptions(options)),
8
8
  config() {
9
9
  return { ssr: { noExternal: instrumentedModuleNames(options.instrumentations) } };
10
+ },
11
+ configResolved(config) {
12
+ const external = config.ssr?.external;
13
+ if (!Array.isArray(external)) {
14
+ return;
15
+ }
16
+ const moduleNames = instrumentedModuleNames(options.instrumentations);
17
+ const externalizedModules = moduleNames.filter(
18
+ (name) => external.some((entry) => externalEntryMatchesModule(entry, name))
19
+ );
20
+ if (externalizedModules.length > 0) {
21
+ config.logger.warn(`[Sentry] ${externalizedModulesWarning(externalizedModules)}`);
22
+ }
10
23
  }
11
24
  };
12
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","sources":["../../../../src/orchestrion/bundler/vite.ts"],"sourcesContent":["import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/vite';\nimport { instrumentedModuleNames } from '../config';\nimport type { PluginOptions } from './options';\nimport { orchestrionTransformOptions } from './options';\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 * @example\n * ```ts\n * // vite.config.ts\n * import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/vite';\n * export default { plugins: [sentryOrchestrionPlugin()] };\n * ```\n */\nexport function sentryOrchestrionPlugin(options: PluginOptions = {}): ReturnType<typeof codeTransformer> {\n return {\n ...codeTransformer(orchestrionTransformOptions(options)),\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: instrumentedModuleNames(options.instrumentations) } };\n },\n };\n}\n"],"names":[],"mappings":";;;;AAmBO,SAAS,uBAAA,CAAwB,OAAA,GAAyB,EAAC,EAAuC;AACvG,EAAA,OAAO;AAAA,IACL,GAAG,eAAA,CAAgB,2BAAA,CAA4B,OAAO,CAAC,CAAA;AAAA,IACvD,MAAA,GAA4C;AAQ1C,MAAA,OAAO,EAAE,KAAK,EAAE,UAAA,EAAY,wBAAwB,OAAA,CAAQ,gBAAgB,GAAE,EAAE;AAAA,IAClF;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"vite.js","sources":["../../../../src/orchestrion/bundler/vite.ts"],"sourcesContent":["import codeTransformer from '@apm-js-collab/code-transformer-bundler-plugins/vite';\nimport type { ResolvedConfig } from 'vite';\nimport { instrumentedModuleNames } from '../config';\nimport type { PluginOptions } from './options';\nimport { externalEntryMatchesModule, externalizedModulesWarning, orchestrionTransformOptions } from './options';\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 * @example\n * ```ts\n * // vite.config.ts\n * import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/vite';\n * export default { plugins: [sentryOrchestrionPlugin()] };\n * ```\n */\nexport function sentryOrchestrionPlugin(options: PluginOptions = {}): ReturnType<typeof codeTransformer> {\n return {\n ...codeTransformer(orchestrionTransformOptions(options)),\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: instrumentedModuleNames(options.instrumentations) } };\n },\n configResolved(config: ResolvedConfig): void {\n // Explicit `ssr.external` string entries take priority over `noExternal`\n // in Vite, so they defeat the force-bundling above. (`ssr.external: true`\n // does not — `noExternal` entries still win there.)\n const external = config.ssr?.external;\n if (!Array.isArray(external)) {\n return;\n }\n const moduleNames = instrumentedModuleNames(options.instrumentations);\n const externalizedModules = moduleNames.filter(name =>\n external.some(entry => externalEntryMatchesModule(entry, name)),\n );\n if (externalizedModules.length > 0) {\n config.logger.warn(`[Sentry] ${externalizedModulesWarning(externalizedModules)}`);\n }\n },\n };\n}\n"],"names":[],"mappings":";;;;AAoBO,SAAS,uBAAA,CAAwB,OAAA,GAAyB,EAAC,EAAuC;AACvG,EAAA,OAAO;AAAA,IACL,GAAG,eAAA,CAAgB,2BAAA,CAA4B,OAAO,CAAC,CAAA;AAAA,IACvD,MAAA,GAA4C;AAQ1C,MAAA,OAAO,EAAE,KAAK,EAAE,UAAA,EAAY,wBAAwB,OAAA,CAAQ,gBAAgB,GAAE,EAAE;AAAA,IAClF,CAAA;AAAA,IACA,eAAe,MAAA,EAA8B;AAI3C,MAAA,MAAM,QAAA,GAAW,OAAO,GAAA,EAAK,QAAA;AAC7B,MAAA,IAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,QAAQ,CAAA,EAAG;AAC5B,QAAA;AAAA,MACF;AACA,MAAA,MAAM,WAAA,GAAc,uBAAA,CAAwB,OAAA,CAAQ,gBAAgB,CAAA;AACpE,MAAA,MAAM,sBAAsB,WAAA,CAAY,MAAA;AAAA,QAAO,UAC7C,QAAA,CAAS,IAAA,CAAK,WAAS,0BAAA,CAA2B,KAAA,EAAO,IAAI,CAAC;AAAA,OAChE;AACA,MAAA,IAAI,mBAAA,CAAoB,SAAS,CAAA,EAAG;AAClC,QAAA,MAAA,CAAO,OAAO,IAAA,CAAK,CAAA,SAAA,EAAY,0BAAA,CAA2B,mBAAmB,CAAC,CAAA,CAAE,CAAA;AAAA,MAClF;AAAA,IACF;AAAA,GACF;AACF;;;;"}
@@ -1,8 +1,9 @@
1
1
  import { createRequire } from 'node:module';
2
2
  import { dirname } from 'node:path';
3
- import { SENTRY_INSTRUMENTATIONS } from '../config/index.js';
3
+ import { SENTRY_INSTRUMENTATIONS, instrumentedModuleNames } from '../config/index.js';
4
4
  import codeTransformerWebpack from '@apm-js-collab/code-transformer-bundler-plugins/webpack';
5
- import { orchestrionTransformOptions } from './options.js';
5
+ export { serializeInstrumentations } from '@apm-js-collab/code-transformer-bundler-plugins/core';
6
+ import { orchestrionTransformOptions, externalizedModulesWarning, externalEntryMatchesModule } from './options.js';
6
7
 
7
8
  function getOrchestrionRequire() {
8
9
  let nodeRequire;
@@ -19,8 +20,37 @@ function getTracingHooksDirectory() {
19
20
  function getSentryInstrumentations() {
20
21
  return SENTRY_INSTRUMENTATIONS;
21
22
  }
23
+ function externalizedWebpackModules(externals, moduleNames) {
24
+ const entries = Array.isArray(externals) ? externals : [externals];
25
+ return moduleNames.filter(
26
+ (name) => entries.some((entry) => {
27
+ if (typeof entry === "string") {
28
+ return externalEntryMatchesModule(entry, name);
29
+ }
30
+ if (entry instanceof RegExp) {
31
+ return entry.test(name);
32
+ }
33
+ if (entry && typeof entry === "object") {
34
+ return name in entry;
35
+ }
36
+ return false;
37
+ })
38
+ );
39
+ }
22
40
  function sentryOrchestrionWebpackPlugin(options = {}) {
23
- return codeTransformerWebpack(orchestrionTransformOptions(options));
41
+ const plugin = codeTransformerWebpack(orchestrionTransformOptions(options));
42
+ const moduleNames = instrumentedModuleNames(options.instrumentations);
43
+ const apply = plugin.apply.bind(plugin);
44
+ plugin.apply = (compiler) => {
45
+ const externalizedModules = externalizedWebpackModules(compiler.options.externals, moduleNames);
46
+ if (externalizedModules.length > 0) {
47
+ compiler.hooks.thisCompilation.tap("SentryOrchestrionExternalsCheck", (compilation) => {
48
+ compilation.warnings.push(new compiler.webpack.WebpackError(externalizedModulesWarning(externalizedModules)));
49
+ });
50
+ }
51
+ apply(compiler);
52
+ };
53
+ return plugin;
24
54
  }
25
55
 
26
56
  export { getOrchestrionLoaderPath, getSentryInstrumentations, getTracingHooksDirectory, sentryOrchestrionWebpackPlugin };
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.js","sources":["../../../../src/orchestrion/bundler/webpack.ts"],"sourcesContent":["// EXPERIMENTAL — orchestrion code-transform loader + webpack plugin. The loader is exposed\n// separately because Turbopack can only take webpack loaders (via `turbopack.rules`), not plugins.\n\nimport { createRequire } from 'node:module';\nimport { dirname } from 'node:path';\nimport type { InstrumentationConfig } from '..';\nimport { SENTRY_INSTRUMENTATIONS } from '../config';\nimport codeTransformerWebpack from '@apm-js-collab/code-transformer-bundler-plugins/webpack';\nimport type { PluginOptions } from './options';\nimport { orchestrionTransformOptions } from './options';\n\n// Both branches use `createRequire` (never alias the CJS `require`) so bundlers consuming this\n// module don't emit a \"Critical dependency\" warning.\nfunction getOrchestrionRequire(): ReturnType<typeof createRequire> {\n let nodeRequire: ReturnType<typeof createRequire>;\n /*! rollup-include-cjs-only */\n nodeRequire = createRequire(__filename);\n /*! rollup-include-cjs-only-end */\n /*! rollup-include-esm-only */\n nodeRequire = createRequire(import.meta.url);\n /*! rollup-include-esm-only-end */\n return nodeRequire;\n}\n\n/** Absolute path to the code-transform loader (a webpack loader; also usable as a Turbopack loader). */\nexport function getOrchestrionLoaderPath(): string {\n return getOrchestrionRequire().resolve('@apm-js-collab/code-transformer-bundler-plugins/webpack-loader');\n}\n\n/**\n * Absolute path to the `@apm-js-collab/tracing-hooks` package directory, resolved from this\n * package's own dependency graph. SDKs inject it at build time so the runtime module hook can\n * load the package even where the bare specifier doesn't resolve (bundled SDK code under\n * isolated installs, e.g. pnpm).\n */\nexport function getTracingHooksDirectory(): string {\n const packageJsonPath = getOrchestrionRequire().resolve('@apm-js-collab/tracing-hooks/package.json');\n // This avoids any backslash-escaping concerns on Windows\n return dirname(packageJsonPath).replace(/\\\\/g, '/');\n}\n\n/** The central instrumentation config, to pass as the loader's `instrumentations` option. */\nexport function getSentryInstrumentations(): InstrumentationConfig[] {\n return SENTRY_INSTRUMENTATIONS;\n}\n\n/**\n * The code-transform webpack plugin, pre-fed the instrumentation config\n */\nexport function sentryOrchestrionWebpackPlugin(options: PluginOptions = {}): ReturnType<typeof codeTransformerWebpack> {\n return codeTransformerWebpack(orchestrionTransformOptions(options));\n}\n"],"names":[],"mappings":";;;;;;AAaA,SAAS,qBAAA,GAA0D;AACjE,EAAA,IAAI,WAAA;AAAA,EACJ,WAAA,GAAA,aAAA,CAAA,MAAA,CAAA,IAAA,CAAA,GAAA,CAAA;AACA,EAAA,OAAA;AAAsC;AAEtC,SAAA,wBAAA,GAAA;AACA,EAAA,OAAA,qBAA4B,2EAAe,CAAA;AAAA;AAE3C,SAAO,wBAAA,GAAA;AACT,EAAA,MAAA,eAAA,GAAA,qBAAA,EAAA,CAAA,OAAA,CAAA,2CAAA,CAAA;AAGO,EAAA,OAAA,OAAS,CAAA,eAAA,CAAA,CAAA,OAAA,CAAA,KAAmC,EAAA,GAAA,CAAA;AACjD;AACF,SAAA,yBAAA,GAAA;AAQO,EAAA,OAAA,uBAAS;AACd;AAEA,SAAO,sCAA2C,GAAA,EAAA,EAAA;AACpD,EAAA,OAAA,sBAAA,CAAA,2BAAA,CAAA,OAAA,CAAA,CAAA;AAGO;;;;"}
1
+ {"version":3,"file":"webpack.js","sources":["../../../../src/orchestrion/bundler/webpack.ts"],"sourcesContent":["// EXPERIMENTAL — orchestrion code-transform loader + webpack plugin. The loader is exposed\n// separately because Turbopack can only take webpack loaders (via `turbopack.rules`), not plugins.\n\nimport { createRequire } from 'node:module';\nimport { dirname } from 'node:path';\nimport type { Compiler } from 'webpack';\nimport type { InstrumentationConfig } from '..';\nimport { instrumentedModuleNames, SENTRY_INSTRUMENTATIONS } from '../config';\nimport codeTransformerWebpack from '@apm-js-collab/code-transformer-bundler-plugins/webpack';\nimport type { PluginOptions } from './options';\n\nexport { serializeInstrumentations } from '@apm-js-collab/code-transformer-bundler-plugins/core';\nexport type { SerializableInstrumentationConfig } from '@apm-js-collab/code-transformer-bundler-plugins/core';\nimport { externalEntryMatchesModule, externalizedModulesWarning, orchestrionTransformOptions } from './options';\n\n// Both branches use `createRequire` (never alias the CJS `require`) so bundlers consuming this\n// module don't emit a \"Critical dependency\" warning.\nfunction getOrchestrionRequire(): ReturnType<typeof createRequire> {\n let nodeRequire: ReturnType<typeof createRequire>;\n /*! rollup-include-cjs-only */\n nodeRequire = createRequire(__filename);\n /*! rollup-include-cjs-only-end */\n /*! rollup-include-esm-only */\n nodeRequire = createRequire(import.meta.url);\n /*! rollup-include-esm-only-end */\n return nodeRequire;\n}\n\n/** Absolute path to the code-transform loader (a webpack loader; also usable as a Turbopack loader). */\nexport function getOrchestrionLoaderPath(): string {\n return getOrchestrionRequire().resolve('@apm-js-collab/code-transformer-bundler-plugins/webpack-loader');\n}\n\n/**\n * Absolute path to the `@apm-js-collab/tracing-hooks` package directory, resolved from this\n * package's own dependency graph. SDKs inject it at build time so the runtime module hook can\n * load the package even where the bare specifier doesn't resolve (bundled SDK code under\n * isolated installs, e.g. pnpm).\n */\nexport function getTracingHooksDirectory(): string {\n const packageJsonPath = getOrchestrionRequire().resolve('@apm-js-collab/tracing-hooks/package.json');\n // This avoids any backslash-escaping concerns on Windows\n return dirname(packageJsonPath).replace(/\\\\/g, '/');\n}\n\n/** The central instrumentation config, to pass as the loader's `instrumentations` option. */\nexport function getSentryInstrumentations(): InstrumentationConfig[] {\n return SENTRY_INSTRUMENTATIONS;\n}\n\n// Handles the declarative `externals` shapes (string, RegExp, object, arrays\n// thereof). Function externals (e.g. webpack-node-externals) are skipped: they\n// may resolve asynchronously, so they can't be probed reliably here.\nfunction externalizedWebpackModules(externals: unknown, moduleNames: string[]): string[] {\n const entries = Array.isArray(externals) ? externals : [externals];\n return moduleNames.filter(name =>\n entries.some(entry => {\n if (typeof entry === 'string') {\n return externalEntryMatchesModule(entry, name);\n }\n if (entry instanceof RegExp) {\n return entry.test(name);\n }\n if (entry && typeof entry === 'object') {\n return name in entry;\n }\n return false;\n }),\n );\n}\n\n/**\n * The code-transform webpack plugin, pre-fed the instrumentation config.\n *\n * Instrumented packages marked as `externals` never pass through the code\n * transform, so a compilation warning is emitted for them.\n */\nexport function sentryOrchestrionWebpackPlugin(options: PluginOptions = {}): ReturnType<typeof codeTransformerWebpack> {\n const plugin = codeTransformerWebpack(orchestrionTransformOptions(options));\n const moduleNames = instrumentedModuleNames(options.instrumentations);\n // The upstream plugin is a class instance, so `apply` is overridden in place\n // rather than spread into a new object (which would lose prototype methods).\n const apply = plugin.apply.bind(plugin);\n plugin.apply = (compiler: Compiler): void => {\n const externalizedModules = externalizedWebpackModules(compiler.options.externals, moduleNames);\n if (externalizedModules.length > 0) {\n compiler.hooks.thisCompilation.tap('SentryOrchestrionExternalsCheck', compilation => {\n compilation.warnings.push(new compiler.webpack.WebpackError(externalizedModulesWarning(externalizedModules)));\n });\n }\n apply(compiler);\n };\n return plugin;\n}\n"],"names":[],"mappings":";;;;;;;AAiBA,SAAS,qBAAA,GAA0D;AACjE,EAAA,IAAI,WAAA;AAAA,EACJ,WAAA,GAAA,aAAA,CAAA,MAAA,CAAA,IAAA,CAAA,GAAA,CAAA;AACA,EAAA,OAAA;AAAsC;AAEtC,SAAA,wBAAA,GAAA;AACA,EAAA,OAAA,qBAA4B,2EAAe,CAAA;AAAA;AAE3C,SAAO,wBAAA,GAAA;AACT,EAAA,MAAA,eAAA,GAAA,qBAAA,EAAA,CAAA,OAAA,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AAA,CAAA,EAAuB;AACtC,MAAA,QAAM,CAAA,KAAA,CAAA,eAAc,CAAA,GAAA,CAAA,iCAAgD,EAAA,CAAA,WAAA,KAAA;AAGpE,QAAM,WAAQ,CAAA,QAAO,CAAM,IAAA,CAAK,IAAA,QAAM,CAAA,OAAA,CAAA,YAAA,CAAA,0BAAA,CAAA,mBAAA,CAAA,CAAA,CAAA;AACtC,MAAA,CAAA,CAAA;AACE,IAAA;AACA,IAAA,KAAI,CAAA,QAAA,CAAA;AACF,EAAA,CAAA;AACE,EAAA,OAAA,MAAA;AAA4G;;;;"}
@@ -23,8 +23,6 @@ import { nestjsChannels } from './config/nestjs.js';
23
23
  import { openaiChannels } from './config/openai.js';
24
24
  import { pgChannels } from './config/pg.js';
25
25
  import { postgresJsChannels } from './config/postgres.js';
26
- import { prismaChannels } from './config/prisma.js';
27
- import { reactRouterChannels } from './config/react-router.js';
28
26
  import { redisChannels } from './config/redis.js';
29
27
  import { remixChannels } from './config/remix.js';
30
28
  import { tediousChannels } from './config/tedious.js';
@@ -56,8 +54,6 @@ const CHANNELS = {
56
54
  ...openaiChannels,
57
55
  ...pgChannels,
58
56
  ...postgresJsChannels,
59
- ...prismaChannels,
60
- ...reactRouterChannels,
61
57
  ...redisChannels,
62
58
  ...remixChannels,
63
59
  ...tediousChannels,
@@ -1 +1 @@
1
- {"version":3,"file":"channels.js","sources":["../../../src/orchestrion/channels.ts"],"sourcesContent":["import { amqplibChannels } from './config/amqplib';\nimport { anthropicAiChannels } from './config/anthropic-ai';\nimport { awsSdkChannels } from './config/aws-sdk';\nimport { dataloaderChannels } from './config/dataloader';\nimport { expressChannels } from './config/express';\nimport { firebaseChannels } from './config/firebase';\nimport { genericPoolChannels } from './config/generic-pool';\nimport { googleGenAiChannels } from './config/google-genai';\nimport { graphqlChannels } from './config/graphql';\nimport { hapiChannels } from './config/hapi';\nimport { ioredisChannels } from './config/ioredis';\nimport { kafkajsChannels } from './config/kafkajs';\nimport { knexChannels } from './config/knex';\nimport { koaChannels } from './config/koa';\nimport { langchainChannels } from './config/langchain';\nimport { langgraphChannels } from './config/langgraph';\nimport { lruMemoizerChannels } from './config/lru-memoizer';\nimport { mongodbChannels } from './config/mongodb';\nimport { mongooseChannels } from './config/mongoose';\nimport { mysql2Channels } from './config/mysql2';\nimport { mysqlChannels } from './config/mysql';\nimport { nestjsChannels } from './config/nestjs';\nimport { openaiChannels } from './config/openai';\nimport { pgChannels } from './config/pg';\nimport { postgresJsChannels } from './config/postgres';\nimport { prismaChannels } from './config/prisma';\nimport { reactRouterChannels } from './config/react-router';\nimport { redisChannels } from './config/redis';\nimport { remixChannels } from './config/remix';\nimport { tediousChannels } from './config/tedious';\nimport { vercelAiChannels } from './config/vercel-ai';\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 *\n * Kept sorted alphabetically by module so concurrent additions insert at different\n * points rather than all appending to the end (fewer merge conflicts).\n */\nexport const CHANNELS = {\n ...amqplibChannels,\n ...anthropicAiChannels,\n ...awsSdkChannels,\n ...dataloaderChannels,\n ...expressChannels,\n ...firebaseChannels,\n ...genericPoolChannels,\n ...googleGenAiChannels,\n ...graphqlChannels,\n ...hapiChannels,\n ...ioredisChannels,\n ...kafkajsChannels,\n ...knexChannels,\n ...koaChannels,\n ...langchainChannels,\n ...langgraphChannels,\n ...lruMemoizerChannels,\n ...mongodbChannels,\n ...mongooseChannels,\n ...mysql2Channels,\n ...mysqlChannels,\n ...nestjsChannels,\n ...openaiChannels,\n ...pgChannels,\n ...postgresJsChannels,\n ...prismaChannels,\n ...reactRouterChannels,\n ...redisChannels,\n ...remixChannels,\n ...tediousChannels,\n ...vercelAiChannels,\n} as const;\n\nexport type ChannelName = (typeof CHANNELS)[keyof typeof CHANNELS];\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDO,MAAM,QAAA,GAAW;AAAA,EACtB,GAAG,eAAA;AAAA,EACH,GAAG,mBAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,kBAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,gBAAA;AAAA,EACH,GAAG,mBAAA;AAAA,EACH,GAAG,mBAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,WAAA;AAAA,EACH,GAAG,iBAAA;AAAA,EACH,GAAG,iBAAA;AAAA,EACH,GAAG,mBAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,gBAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,aAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,UAAA;AAAA,EACH,GAAG,kBAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,mBAAA;AAAA,EACH,GAAG,aAAA;AAAA,EACH,GAAG,aAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG;AACL;;;;"}
1
+ {"version":3,"file":"channels.js","sources":["../../../src/orchestrion/channels.ts"],"sourcesContent":["import { amqplibChannels } from './config/amqplib';\nimport { anthropicAiChannels } from './config/anthropic-ai';\nimport { awsSdkChannels } from './config/aws-sdk';\nimport { dataloaderChannels } from './config/dataloader';\nimport { expressChannels } from './config/express';\nimport { firebaseChannels } from './config/firebase';\nimport { genericPoolChannels } from './config/generic-pool';\nimport { googleGenAiChannels } from './config/google-genai';\nimport { graphqlChannels } from './config/graphql';\nimport { hapiChannels } from './config/hapi';\nimport { ioredisChannels } from './config/ioredis';\nimport { kafkajsChannels } from './config/kafkajs';\nimport { knexChannels } from './config/knex';\nimport { koaChannels } from './config/koa';\nimport { langchainChannels } from './config/langchain';\nimport { langgraphChannels } from './config/langgraph';\nimport { lruMemoizerChannels } from './config/lru-memoizer';\nimport { mongodbChannels } from './config/mongodb';\nimport { mongooseChannels } from './config/mongoose';\nimport { mysql2Channels } from './config/mysql2';\nimport { mysqlChannels } from './config/mysql';\nimport { nestjsChannels } from './config/nestjs';\nimport { openaiChannels } from './config/openai';\nimport { pgChannels } from './config/pg';\nimport { postgresJsChannels } from './config/postgres';\nimport { redisChannels } from './config/redis';\nimport { remixChannels } from './config/remix';\nimport { tediousChannels } from './config/tedious';\nimport { vercelAiChannels } from './config/vercel-ai';\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 *\n * Kept sorted alphabetically by module so concurrent additions insert at different\n * points rather than all appending to the end (fewer merge conflicts).\n */\nexport const CHANNELS = {\n ...amqplibChannels,\n ...anthropicAiChannels,\n ...awsSdkChannels,\n ...dataloaderChannels,\n ...expressChannels,\n ...firebaseChannels,\n ...genericPoolChannels,\n ...googleGenAiChannels,\n ...graphqlChannels,\n ...hapiChannels,\n ...ioredisChannels,\n ...kafkajsChannels,\n ...knexChannels,\n ...koaChannels,\n ...langchainChannels,\n ...langgraphChannels,\n ...lruMemoizerChannels,\n ...mongodbChannels,\n ...mongooseChannels,\n ...mysql2Channels,\n ...mysqlChannels,\n ...nestjsChannels,\n ...openaiChannels,\n ...pgChannels,\n ...postgresJsChannels,\n ...redisChannels,\n ...remixChannels,\n ...tediousChannels,\n ...vercelAiChannels,\n} as const;\n\nexport type ChannelName = (typeof CHANNELS)[keyof typeof CHANNELS];\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CO,MAAM,QAAA,GAAW;AAAA,EACtB,GAAG,eAAA;AAAA,EACH,GAAG,mBAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,kBAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,gBAAA;AAAA,EACH,GAAG,mBAAA;AAAA,EACH,GAAG,mBAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,YAAA;AAAA,EACH,GAAG,WAAA;AAAA,EACH,GAAG,iBAAA;AAAA,EACH,GAAG,iBAAA;AAAA,EACH,GAAG,mBAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG,gBAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,aAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,cAAA;AAAA,EACH,GAAG,UAAA;AAAA,EACH,GAAG,kBAAA;AAAA,EACH,GAAG,aAAA;AAAA,EACH,GAAG,aAAA;AAAA,EACH,GAAG,eAAA;AAAA,EACH,GAAG;AACL;;;;"}
@@ -1,3 +1,5 @@
1
+ import { toSubscribeInjections } from './subscribe-injection.js';
2
+
1
3
  const module$1 = { name: "amqplib", versionRange: ">=0.5.5 <2" };
2
4
  const amqplibConfig = [
3
5
  // Producer span + trace-header injection. `sendToQueue` delegates to `publish`, so it's covered.
@@ -73,6 +75,7 @@ const amqplibChannels = {
73
75
  AMQPLIB_NACK_ALL: "orchestrion:amqplib:nackAll",
74
76
  AMQPLIB_CONNECT: "orchestrion:amqplib:connect"
75
77
  };
78
+ const amqplibSubscribeInjection = toSubscribeInjections(amqplibConfig);
76
79
 
77
- export { amqplibChannels, amqplibConfig };
80
+ export { amqplibChannels, amqplibConfig, amqplibSubscribeInjection };
78
81
  //# sourceMappingURL=amqplib.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"amqplib.js","sources":["../../../../src/orchestrion/config/amqplib.ts"],"sourcesContent":["import type { InstrumentationConfig } from '..';\n\n// `amqplib` splits its API across three files:\n// - `lib/channel_model.js` holds `class Channel` (publish/consume/ack/nack/reject/…) and\n// `class ConfirmChannel extends Channel` (a `publish` that takes a broker-confirm callback).\n// - `lib/channel.js` holds `class BaseChannel` whose `dispatchMessage` invokes the registered\n// consumer callback once per delivered message — the natural per-message hook for consumer spans\n// (`Channel.consume` itself only registers the callback, it isn't called per message).\n// - `lib/connect.js` holds the `connect` function whose callback receives the open connection, used\n// to capture connection attributes.\n//\n// The version range mirrors `supportedVersions` in the vendored OTel instrumentation.\nconst module = { name: 'amqplib', versionRange: '>=0.5.5 <2' } as const;\n\nexport const amqplibConfig = [\n // Producer span + trace-header injection. `sendToQueue` delegates to `publish`, so it's covered.\n {\n channelName: 'publish',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'publish', kind: 'Sync' },\n },\n // Confirm-channel producer span; the trailing broker-confirm callback ends the span when the\n // broker acks/nacks. It internally calls `super.publish`, so the subscriber guards against the\n // base `publish` channel double-instrumenting.\n {\n channelName: 'confirmPublish',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'ConfirmChannel', methodName: 'publish', kind: 'Callback' },\n },\n // Records `consumerTag -> { noAck, queue }` so the per-message dispatch hook knows how to name and\n // when to end the consumer span.\n {\n channelName: 'consume',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'consume', kind: 'Async' },\n },\n // Per delivered message: creates the consumer span and runs the user callback under it.\n {\n channelName: 'dispatch',\n module: { ...module, filePath: 'lib/channel.js' },\n functionQuery: { className: 'BaseChannel', methodName: 'dispatchMessage', kind: 'Sync' },\n },\n // End the consumer span when the user settles the message.\n {\n channelName: 'ack',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'ack', kind: 'Sync' },\n },\n {\n channelName: 'nack',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'nack', kind: 'Sync' },\n },\n {\n channelName: 'reject',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'reject', kind: 'Sync' },\n },\n {\n channelName: 'ackAll',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'ackAll', kind: 'Sync' },\n },\n {\n channelName: 'nackAll',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'nackAll', kind: 'Sync' },\n },\n // Stashes connection attributes (url/host/port/protocol/server product) on the connection object\n // for span-time reads via `channel.connection`.\n {\n channelName: 'connect',\n module: { ...module, filePath: 'lib/connect.js' },\n functionQuery: { functionName: 'connect', kind: 'Callback' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const amqplibChannels = {\n AMQPLIB_PUBLISH: 'orchestrion:amqplib:publish',\n AMQPLIB_CONFIRM_PUBLISH: 'orchestrion:amqplib:confirmPublish',\n AMQPLIB_CONSUME: 'orchestrion:amqplib:consume',\n AMQPLIB_DISPATCH: 'orchestrion:amqplib:dispatch',\n AMQPLIB_ACK: 'orchestrion:amqplib:ack',\n AMQPLIB_NACK: 'orchestrion:amqplib:nack',\n AMQPLIB_REJECT: 'orchestrion:amqplib:reject',\n AMQPLIB_ACK_ALL: 'orchestrion:amqplib:ackAll',\n AMQPLIB_NACK_ALL: 'orchestrion:amqplib:nackAll',\n AMQPLIB_CONNECT: 'orchestrion:amqplib:connect',\n} as const;\n"],"names":["module"],"mappings":"AAYA,MAAMA,QAAA,GAAS,EAAE,IAAA,EAAM,SAAA,EAAW,cAAc,YAAA,EAAa;AAEtD,MAAM,aAAA,GAAgB;AAAA;AAAA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/orchestrion/config/amqplib.ts"],"sourcesContent":["import type { InstrumentationConfig } from '..';\nimport { toSubscribeInjections } from './subscribe-injection';\n\n// `amqplib` splits its API across three files:\n// - `lib/channel_model.js` holds `class Channel` (publish/consume/ack/nack/reject/…) and\n// `class ConfirmChannel extends Channel` (a `publish` that takes a broker-confirm callback).\n// - `lib/channel.js` holds `class BaseChannel` whose `dispatchMessage` invokes the registered\n// consumer callback once per delivered message — the natural per-message hook for consumer spans\n// (`Channel.consume` itself only registers the callback, it isn't called per message).\n// - `lib/connect.js` holds the `connect` function whose callback receives the open connection, used\n// to capture connection attributes.\n//\n// The version range mirrors `supportedVersions` in the vendored OTel instrumentation.\nconst module = { name: 'amqplib', versionRange: '>=0.5.5 <2' } as const;\n\nexport const amqplibConfig = [\n // Producer span + trace-header injection. `sendToQueue` delegates to `publish`, so it's covered.\n {\n channelName: 'publish',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'publish', kind: 'Sync' },\n },\n // Confirm-channel producer span; the trailing broker-confirm callback ends the span when the\n // broker acks/nacks. It internally calls `super.publish`, so the subscriber guards against the\n // base `publish` channel double-instrumenting.\n {\n channelName: 'confirmPublish',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'ConfirmChannel', methodName: 'publish', kind: 'Callback' },\n },\n // Records `consumerTag -> { noAck, queue }` so the per-message dispatch hook knows how to name and\n // when to end the consumer span.\n {\n channelName: 'consume',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'consume', kind: 'Async' },\n },\n // Per delivered message: creates the consumer span and runs the user callback under it.\n {\n channelName: 'dispatch',\n module: { ...module, filePath: 'lib/channel.js' },\n functionQuery: { className: 'BaseChannel', methodName: 'dispatchMessage', kind: 'Sync' },\n },\n // End the consumer span when the user settles the message.\n {\n channelName: 'ack',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'ack', kind: 'Sync' },\n },\n {\n channelName: 'nack',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'nack', kind: 'Sync' },\n },\n {\n channelName: 'reject',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'reject', kind: 'Sync' },\n },\n {\n channelName: 'ackAll',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'ackAll', kind: 'Sync' },\n },\n {\n channelName: 'nackAll',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'nackAll', kind: 'Sync' },\n },\n // Stashes connection attributes (url/host/port/protocol/server product) on the connection object\n // for span-time reads via `channel.connection`.\n {\n channelName: 'connect',\n module: { ...module, filePath: 'lib/connect.js' },\n functionQuery: { functionName: 'connect', kind: 'Callback' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const amqplibChannels = {\n AMQPLIB_PUBLISH: 'orchestrion:amqplib:publish',\n AMQPLIB_CONFIRM_PUBLISH: 'orchestrion:amqplib:confirmPublish',\n AMQPLIB_CONSUME: 'orchestrion:amqplib:consume',\n AMQPLIB_DISPATCH: 'orchestrion:amqplib:dispatch',\n AMQPLIB_ACK: 'orchestrion:amqplib:ack',\n AMQPLIB_NACK: 'orchestrion:amqplib:nack',\n AMQPLIB_REJECT: 'orchestrion:amqplib:reject',\n AMQPLIB_ACK_ALL: 'orchestrion:amqplib:ackAll',\n AMQPLIB_NACK_ALL: 'orchestrion:amqplib:nackAll',\n AMQPLIB_CONNECT: 'orchestrion:amqplib:connect',\n} as const;\n\nexport const amqplibSubscribeInjection = toSubscribeInjections(amqplibConfig);\n"],"names":["module"],"mappings":";;AAaA,MAAMA,QAAA,GAAS,EAAE,IAAA,EAAM,SAAA,EAAW,cAAc,YAAA,EAAa;AAEtD,MAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B;AAAA,IACE,WAAA,EAAa,SAAA;AAAA,IACb,MAAA,EAAQ,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+
1
3
  const anthropicAiConfig = [
2
4
  // One entry each for CJS/ESM
3
5
  ...["resources/messages/messages.js", "resources/messages/messages.mjs"].flatMap(
@@ -35,6 +37,7 @@ const anthropicAiChannels = {
35
37
  ANTHROPIC_MODELS: "orchestrion:@anthropic-ai/sdk:models",
36
38
  ANTHROPIC_MESSAGES_STREAM: "orchestrion:@anthropic-ai/sdk:messages-stream"
37
39
  };
40
+ const anthropicAiSubscribeInjection = toSubscribeInjections(anthropicAiConfig);
38
41
 
39
- export { anthropicAiChannels, anthropicAiConfig };
42
+ export { anthropicAiChannels, anthropicAiConfig, anthropicAiSubscribeInjection };
40
43
  //# sourceMappingURL=anthropic-ai.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"anthropic-ai.js","sources":["../../../../src/orchestrion/config/anthropic-ai.ts"],"sourcesContent":["import type { InstrumentationConfig } from '..';\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;;;;"}
1
+ {"version":3,"file":"anthropic-ai.js","sources":["../../../../src/orchestrion/config/anthropic-ai.ts"],"sourcesContent":["import type { InstrumentationConfig } from '..';\nimport { toSubscribeInjections } from './subscribe-injection';\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\nexport const anthropicAiSubscribeInjection = toSubscribeInjections(anthropicAiConfig);\n"],"names":[],"mappings":";;AAGO,MAAM,iBAAA,GAAoB;AAAA;AAAA,EAE/B,GAAG,CAAC,gCAAA,EAAkC,iCAAiC,CAAA,CAA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C,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;AAEO,MAAM,6BAAA,GAAgC,sBAAsB,iBAAiB;;;;"}
@@ -1,3 +1,5 @@
1
+ import { toSubscribeInjections } from './subscribe-injection.js';
2
+
1
3
  const awsSdkConfig = [
2
4
  {
3
5
  channelName: "send",
@@ -20,6 +22,7 @@ const awsSdkChannels = {
20
22
  AWS_SMITHY_CLIENT_SEND: "orchestrion:@smithy/smithy-client:send",
21
23
  AWS_SDK_SMITHY_CLIENT_SEND: "orchestrion:@aws-sdk/smithy-client:send"
22
24
  };
25
+ const awsSdkSubscribeInjection = toSubscribeInjections(awsSdkConfig);
23
26
 
24
- export { awsSdkChannels, awsSdkConfig };
27
+ export { awsSdkChannels, awsSdkConfig, awsSdkSubscribeInjection };
25
28
  //# sourceMappingURL=aws-sdk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aws-sdk.js","sources":["../../../../src/orchestrion/config/aws-sdk.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\n// The AWS SDK (v3) routes every command through the smithy `Client.prototype.send` method. Which\n// package hosts that `Client` class changed across versions, so we target all of them; only the one\n// the app's client actually extends is ever invoked.\n//\n// - `@smithy/core` >= 3.24.0: the `Client` class moved into the `client` submodule bundle.\n// - `@smithy/smithy-client`: the `Client` class for aws-sdk v3.363.0+ (pre-`@smithy/core` stack).\n// - `@aws-sdk/smithy-client`: the `Client` class for older aws-sdk v3 releases.\n//\n// `send` is `async send(command, options)` (returns a promise), so `kind: 'Async'`.\nexport const awsSdkConfig = [\n {\n channelName: 'send',\n module: { name: '@smithy/core', versionRange: '>=3.24.0 <4', filePath: 'dist-cjs/submodules/client/index.js' },\n functionQuery: { className: 'Client', methodName: 'send', kind: 'Async' },\n },\n {\n channelName: 'send',\n module: { name: '@smithy/smithy-client', versionRange: '>=1.0.3 <5', filePath: 'dist-cjs/index.js' },\n functionQuery: { className: 'Client', methodName: 'send', kind: 'Async' },\n },\n {\n channelName: 'send',\n module: { name: '@aws-sdk/smithy-client', versionRange: '^3.1.0', filePath: 'dist-cjs/index.js' },\n functionQuery: { className: 'Client', methodName: 'send', kind: 'Async' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const awsSdkChannels = {\n AWS_SMITHY_CORE_SEND: 'orchestrion:@smithy/core:send',\n AWS_SMITHY_CLIENT_SEND: 'orchestrion:@smithy/smithy-client:send',\n AWS_SDK_SMITHY_CLIENT_SEND: 'orchestrion:@aws-sdk/smithy-client:send',\n} as const;\n"],"names":[],"mappings":"AAWO,MAAM,YAAA,GAAe;AAAA,EAC1B;AAAA,IACE,WAAA,EAAa,MAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,gBAAgB,YAAA,EAAc,aAAA,EAAe,UAAU,qCAAA,EAAsC;AAAA,IAC7G,eAAe,EAAE,SAAA,EAAW,UAAU,UAAA,EAAY,MAAA,EAAQ,MAAM,OAAA;AAAQ,GAC1E;AAAA,EACA;AAAA,IACE,WAAA,EAAa,MAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,yBAAyB,YAAA,EAAc,YAAA,EAAc,UAAU,mBAAA,EAAoB;AAAA,IACnG,eAAe,EAAE,SAAA,EAAW,UAAU,UAAA,EAAY,MAAA,EAAQ,MAAM,OAAA;AAAQ,GAC1E;AAAA,EACA;AAAA,IACE,WAAA,EAAa,MAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,0BAA0B,YAAA,EAAc,QAAA,EAAU,UAAU,mBAAA,EAAoB;AAAA,IAChG,eAAe,EAAE,SAAA,EAAW,UAAU,UAAA,EAAY,MAAA,EAAQ,MAAM,OAAA;AAAQ;AAE5E;AAEO,MAAM,cAAA,GAAiB;AAAA,EAC5B,oBAAA,EAAsB,+BAAA;AAAA,EACtB,sBAAA,EAAwB,wCAAA;AAAA,EACxB,0BAAA,EAA4B;AAC9B;;;;"}
1
+ {"version":3,"file":"aws-sdk.js","sources":["../../../../src/orchestrion/config/aws-sdk.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\nimport { toSubscribeInjections } from './subscribe-injection';\n\n// The AWS SDK (v3) routes every command through the smithy `Client.prototype.send` method. Which\n// package hosts that `Client` class changed across versions, so we target all of them; only the one\n// the app's client actually extends is ever invoked.\n//\n// - `@smithy/core` >= 3.24.0: the `Client` class moved into the `client` submodule bundle.\n// - `@smithy/smithy-client`: the `Client` class for aws-sdk v3.363.0+ (pre-`@smithy/core` stack).\n// - `@aws-sdk/smithy-client`: the `Client` class for older aws-sdk v3 releases.\n//\n// `send` is `async send(command, options)` (returns a promise), so `kind: 'Async'`.\nexport const awsSdkConfig = [\n {\n channelName: 'send',\n module: { name: '@smithy/core', versionRange: '>=3.24.0 <4', filePath: 'dist-cjs/submodules/client/index.js' },\n functionQuery: { className: 'Client', methodName: 'send', kind: 'Async' },\n },\n {\n channelName: 'send',\n module: { name: '@smithy/smithy-client', versionRange: '>=1.0.3 <5', filePath: 'dist-cjs/index.js' },\n functionQuery: { className: 'Client', methodName: 'send', kind: 'Async' },\n },\n {\n channelName: 'send',\n module: { name: '@aws-sdk/smithy-client', versionRange: '^3.1.0', filePath: 'dist-cjs/index.js' },\n functionQuery: { className: 'Client', methodName: 'send', kind: 'Async' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const awsSdkChannels = {\n AWS_SMITHY_CORE_SEND: 'orchestrion:@smithy/core:send',\n AWS_SMITHY_CLIENT_SEND: 'orchestrion:@smithy/smithy-client:send',\n AWS_SDK_SMITHY_CLIENT_SEND: 'orchestrion:@aws-sdk/smithy-client:send',\n} as const;\n\nexport const awsSdkSubscribeInjection = toSubscribeInjections(awsSdkConfig);\n"],"names":[],"mappings":";;AAYO,MAAM,YAAA,GAAe;AAAA,EAC1B;AAAA,IACE,WAAA,EAAa,MAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,gBAAgB,YAAA,EAAc,aAAA,EAAe,UAAU,qCAAA,EAAsC;AAAA,IAC7G,eAAe,EAAE,SAAA,EAAW,UAAU,UAAA,EAAY,MAAA,EAAQ,MAAM,OAAA;AAAQ,GAC1E;AAAA,EACA;AAAA,IACE,WAAA,EAAa,MAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,yBAAyB,YAAA,EAAc,YAAA,EAAc,UAAU,mBAAA,EAAoB;AAAA,IACnG,eAAe,EAAE,SAAA,EAAW,UAAU,UAAA,EAAY,MAAA,EAAQ,MAAM,OAAA;AAAQ,GAC1E;AAAA,EACA;AAAA,IACE,WAAA,EAAa,MAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,0BAA0B,YAAA,EAAc,QAAA,EAAU,UAAU,mBAAA,EAAoB;AAAA,IAChG,eAAe,EAAE,SAAA,EAAW,UAAU,UAAA,EAAY,MAAA,EAAQ,MAAM,OAAA;AAAQ;AAE5E;AAEO,MAAM,cAAA,GAAiB;AAAA,EAC5B,oBAAA,EAAsB,+BAAA;AAAA,EACtB,sBAAA,EAAwB,wCAAA;AAAA,EACxB,0BAAA,EAA4B;AAC9B;AAEO,MAAM,wBAAA,GAA2B,sBAAsB,YAAY;;;;"}
@@ -0,0 +1,26 @@
1
+ const CHANNEL_INTEGRATION_DEFINITIONS = [
2
+ { exportName: "postgresChannelIntegration", modules: ["pg", "pg-pool"] },
3
+ { exportName: "postgresJsChannelIntegration", modules: ["postgres"] },
4
+ { exportName: "mysqlChannelIntegration", modules: ["mysql"] },
5
+ { exportName: "mysql2ChannelIntegration", modules: ["mysql2"] },
6
+ { exportName: "genericPoolChannelIntegration", modules: ["generic-pool"] },
7
+ { exportName: "lruMemoizerChannelIntegration", modules: ["lru-memoizer"] },
8
+ { exportName: "openaiChannelIntegration", modules: ["openai"] },
9
+ { exportName: "anthropicChannelIntegration", modules: ["@anthropic-ai/sdk"] },
10
+ { exportName: "googleGenAIChannelIntegration", modules: ["@google/genai"] },
11
+ { exportName: "vercelAiChannelIntegration", modules: ["ai"] },
12
+ { exportName: "amqplibChannelIntegration", modules: ["amqplib"] },
13
+ { exportName: "hapiChannelIntegration", modules: ["@hapi/hapi"] },
14
+ { exportName: "expressChannelIntegration", modules: ["express", "router"] },
15
+ { exportName: "graphqlChannelIntegration", modules: ["graphql"] },
16
+ { exportName: "kafkajsChannelIntegration", modules: ["kafkajs"] },
17
+ { exportName: "redisChannelIntegration", modules: ["redis", "@redis/client"] },
18
+ { exportName: "ioredisChannelIntegration", modules: ["ioredis"] },
19
+ { exportName: "dataloaderChannelIntegration", modules: ["dataloader"] }
20
+ ];
21
+ function subscriberExportForModule(moduleName) {
22
+ return CHANNEL_INTEGRATION_DEFINITIONS.find((d) => d.modules.includes(moduleName))?.exportName;
23
+ }
24
+
25
+ export { CHANNEL_INTEGRATION_DEFINITIONS, subscriberExportForModule };
26
+ //# sourceMappingURL=channel-integration-definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel-integration-definitions.js","sources":["../../../../src/orchestrion/config/channel-integration-definitions.ts"],"sourcesContent":["/**\n * Build-time metadata mapping each instrumented package (orchestrion\n * `module.name`) to the channel-subscriber integration that consumes the\n * channels injected into it — by the `exportName` it is published under from\n * `@sentry/server-utils/orchestrion`.\n *\n * Kept in a separate, factory-free module on purpose: the subscribe-injection\n * transform (reachable from every orchestrion bundler plugin) reads this to\n * generate the tiny snippet it injects into each instrumented file, and must\n * not drag any subscriber code — or its `@sentry/core` span machinery — into\n * the plugin's own build to do so.\n *\n * `exportName` must be a named export of `@sentry/server-utils/orchestrion`.\n * `modules` must match `module.name` values in `SENTRY_INSTRUMENTATIONS` — e.g.\n * `postgresChannelIntegration` covers both `pg` and `pg-pool`, and\n * `redisChannelIntegration` both `redis` and `@redis/client`.\n *\n * `redis`, `ioredis` and `dataloader` are included even though they're not in\n * the node SDK's `channelIntegrations` (they only partially replace an OTel\n * integration there): in a bundler-only runtime like Cloudflare Workers there\n * is no OTel integration to coordinate with, so subscribing whenever the\n * package is bundled is unconditionally correct.\n */\nexport const CHANNEL_INTEGRATION_DEFINITIONS = [\n { exportName: 'postgresChannelIntegration', modules: ['pg', 'pg-pool'] },\n { exportName: 'postgresJsChannelIntegration', modules: ['postgres'] },\n { exportName: 'mysqlChannelIntegration', modules: ['mysql'] },\n { exportName: 'mysql2ChannelIntegration', modules: ['mysql2'] },\n { exportName: 'genericPoolChannelIntegration', modules: ['generic-pool'] },\n { exportName: 'lruMemoizerChannelIntegration', modules: ['lru-memoizer'] },\n { exportName: 'openaiChannelIntegration', modules: ['openai'] },\n { exportName: 'anthropicChannelIntegration', modules: ['@anthropic-ai/sdk'] },\n { exportName: 'googleGenAIChannelIntegration', modules: ['@google/genai'] },\n { exportName: 'vercelAiChannelIntegration', modules: ['ai'] },\n { exportName: 'amqplibChannelIntegration', modules: ['amqplib'] },\n { exportName: 'hapiChannelIntegration', modules: ['@hapi/hapi'] },\n { exportName: 'expressChannelIntegration', modules: ['express', 'router'] },\n { exportName: 'graphqlChannelIntegration', modules: ['graphql'] },\n { exportName: 'kafkajsChannelIntegration', modules: ['kafkajs'] },\n { exportName: 'redisChannelIntegration', modules: ['redis', '@redis/client'] },\n { exportName: 'ioredisChannelIntegration', modules: ['ioredis'] },\n { exportName: 'dataloaderChannelIntegration', modules: ['dataloader'] },\n] as const satisfies ReadonlyArray<{ exportName: string; modules: readonly string[] }>;\n\n/** Look up the subscriber export name for an instrumented package, if any. */\nexport function subscriberExportForModule(moduleName: string): string | undefined {\n return CHANNEL_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