@sentry/server-utils 10.67.0 → 10.69.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 (363) hide show
  1. package/build/cjs/integrations/tracing-channel/dataloader.js +17 -7
  2. package/build/cjs/integrations/tracing-channel/dataloader.js.map +1 -1
  3. package/build/cjs/integrations/tracing-channel/fastify/index.js +2 -4
  4. package/build/cjs/integrations/tracing-channel/fastify/index.js.map +1 -1
  5. package/build/cjs/integrations/tracing-channel/fastify/utils.js.map +1 -1
  6. package/build/cjs/integrations/tracing-channel/firebase/firestore.js +78 -0
  7. package/build/cjs/integrations/tracing-channel/firebase/firestore.js.map +1 -0
  8. package/build/cjs/integrations/tracing-channel/firebase/functions.js +67 -0
  9. package/build/cjs/integrations/tracing-channel/firebase/functions.js.map +1 -0
  10. package/build/cjs/integrations/tracing-channel/firebase/index.js +24 -0
  11. package/build/cjs/integrations/tracing-channel/firebase/index.js.map +1 -0
  12. package/build/cjs/integrations/tracing-channel/firebase/instrumentation.js +66 -0
  13. package/build/cjs/integrations/tracing-channel/firebase/instrumentation.js.map +1 -0
  14. package/build/cjs/orchestrion/bundler/esbuild.js +24 -1
  15. package/build/cjs/orchestrion/bundler/esbuild.js.map +1 -1
  16. package/build/cjs/orchestrion/bundler/options.js +16 -2
  17. package/build/cjs/orchestrion/bundler/options.js.map +1 -1
  18. package/build/cjs/orchestrion/bundler/rollup.js +11 -1
  19. package/build/cjs/orchestrion/bundler/rollup.js.map +1 -1
  20. package/build/cjs/orchestrion/bundler/subscribeInjection.js +40 -0
  21. package/build/cjs/orchestrion/bundler/subscribeInjection.js.map +1 -0
  22. package/build/cjs/orchestrion/bundler/vite.js +16 -0
  23. package/build/cjs/orchestrion/bundler/vite.js.map +1 -1
  24. package/build/cjs/orchestrion/bundler/webpack.js +32 -1
  25. package/build/cjs/orchestrion/bundler/webpack.js.map +1 -1
  26. package/build/cjs/orchestrion/channels.js +0 -4
  27. package/build/cjs/orchestrion/channels.js.map +1 -1
  28. package/build/cjs/orchestrion/config/amqplib.js +4 -0
  29. package/build/cjs/orchestrion/config/amqplib.js.map +1 -1
  30. package/build/cjs/orchestrion/config/anthropic-ai.js +4 -0
  31. package/build/cjs/orchestrion/config/anthropic-ai.js.map +1 -1
  32. package/build/cjs/orchestrion/config/aws-sdk.js +4 -0
  33. package/build/cjs/orchestrion/config/aws-sdk.js.map +1 -1
  34. package/build/cjs/orchestrion/config/channel-integration-definitions.js +29 -0
  35. package/build/cjs/orchestrion/config/channel-integration-definitions.js.map +1 -0
  36. package/build/cjs/orchestrion/config/dataloader.js +4 -0
  37. package/build/cjs/orchestrion/config/dataloader.js.map +1 -1
  38. package/build/cjs/orchestrion/config/express.js +4 -0
  39. package/build/cjs/orchestrion/config/express.js.map +1 -1
  40. package/build/cjs/orchestrion/config/firebase.js +79 -2
  41. package/build/cjs/orchestrion/config/firebase.js.map +1 -1
  42. package/build/cjs/orchestrion/config/generic-pool.js +4 -0
  43. package/build/cjs/orchestrion/config/generic-pool.js.map +1 -1
  44. package/build/cjs/orchestrion/config/google-genai.js +4 -0
  45. package/build/cjs/orchestrion/config/google-genai.js.map +1 -1
  46. package/build/cjs/orchestrion/config/graphql.js +4 -0
  47. package/build/cjs/orchestrion/config/graphql.js.map +1 -1
  48. package/build/cjs/orchestrion/config/hapi.js +4 -0
  49. package/build/cjs/orchestrion/config/hapi.js.map +1 -1
  50. package/build/cjs/orchestrion/config/index.js +33 -5
  51. package/build/cjs/orchestrion/config/index.js.map +1 -1
  52. package/build/cjs/orchestrion/config/ioredis.js +4 -0
  53. package/build/cjs/orchestrion/config/ioredis.js.map +1 -1
  54. package/build/cjs/orchestrion/config/kafkajs.js +4 -0
  55. package/build/cjs/orchestrion/config/kafkajs.js.map +1 -1
  56. package/build/cjs/orchestrion/config/knex.js +4 -0
  57. package/build/cjs/orchestrion/config/knex.js.map +1 -1
  58. package/build/cjs/orchestrion/config/koa.js +4 -0
  59. package/build/cjs/orchestrion/config/koa.js.map +1 -1
  60. package/build/cjs/orchestrion/config/langchain.js +4 -0
  61. package/build/cjs/orchestrion/config/langchain.js.map +1 -1
  62. package/build/cjs/orchestrion/config/langgraph.js +4 -0
  63. package/build/cjs/orchestrion/config/langgraph.js.map +1 -1
  64. package/build/cjs/orchestrion/config/lru-memoizer.js +4 -0
  65. package/build/cjs/orchestrion/config/lru-memoizer.js.map +1 -1
  66. package/build/cjs/orchestrion/config/mongodb.js +4 -0
  67. package/build/cjs/orchestrion/config/mongodb.js.map +1 -1
  68. package/build/cjs/orchestrion/config/mongoose.js +4 -0
  69. package/build/cjs/orchestrion/config/mongoose.js.map +1 -1
  70. package/build/cjs/orchestrion/config/mysql.js +4 -0
  71. package/build/cjs/orchestrion/config/mysql.js.map +1 -1
  72. package/build/cjs/orchestrion/config/mysql2.js +4 -0
  73. package/build/cjs/orchestrion/config/mysql2.js.map +1 -1
  74. package/build/cjs/orchestrion/config/nestjs.js +4 -0
  75. package/build/cjs/orchestrion/config/nestjs.js.map +1 -1
  76. package/build/cjs/orchestrion/config/openai.js +4 -0
  77. package/build/cjs/orchestrion/config/openai.js.map +1 -1
  78. package/build/cjs/orchestrion/config/pg.js +4 -0
  79. package/build/cjs/orchestrion/config/pg.js.map +1 -1
  80. package/build/cjs/orchestrion/config/postgres.js +4 -0
  81. package/build/cjs/orchestrion/config/postgres.js.map +1 -1
  82. package/build/cjs/orchestrion/config/redis.js +4 -0
  83. package/build/cjs/orchestrion/config/redis.js.map +1 -1
  84. package/build/cjs/orchestrion/config/remix.js +4 -0
  85. package/build/cjs/orchestrion/config/remix.js.map +1 -1
  86. package/build/cjs/orchestrion/config/subscribe-injection.js +25 -0
  87. package/build/cjs/orchestrion/config/subscribe-injection.js.map +1 -0
  88. package/build/cjs/orchestrion/config/tedious.js +4 -0
  89. package/build/cjs/orchestrion/config/tedious.js.map +1 -1
  90. package/build/cjs/orchestrion/config/vercel-ai.js +4 -0
  91. package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -1
  92. package/build/cjs/orchestrion/index.js +12 -7
  93. package/build/cjs/orchestrion/index.js.map +1 -1
  94. package/build/cjs/orchestrion/registerChannelIntegration.js +13 -0
  95. package/build/cjs/orchestrion/registerChannelIntegration.js.map +1 -0
  96. package/build/cjs/vercel-ai/index.js.map +1 -1
  97. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js +2 -0
  98. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  99. package/build/esm/integrations/tracing-channel/dataloader.js +17 -7
  100. package/build/esm/integrations/tracing-channel/dataloader.js.map +1 -1
  101. package/build/esm/integrations/tracing-channel/fastify/index.js +2 -4
  102. package/build/esm/integrations/tracing-channel/fastify/index.js.map +1 -1
  103. package/build/esm/integrations/tracing-channel/fastify/utils.js.map +1 -1
  104. package/build/esm/integrations/tracing-channel/firebase/firestore.js +75 -0
  105. package/build/esm/integrations/tracing-channel/firebase/firestore.js.map +1 -0
  106. package/build/esm/integrations/tracing-channel/firebase/functions.js +65 -0
  107. package/build/esm/integrations/tracing-channel/firebase/functions.js.map +1 -0
  108. package/build/esm/integrations/tracing-channel/firebase/index.js +22 -0
  109. package/build/esm/integrations/tracing-channel/firebase/index.js.map +1 -0
  110. package/build/esm/integrations/tracing-channel/firebase/instrumentation.js +64 -0
  111. package/build/esm/integrations/tracing-channel/firebase/instrumentation.js.map +1 -0
  112. package/build/esm/orchestrion/bundler/esbuild.js +25 -2
  113. package/build/esm/orchestrion/bundler/esbuild.js.map +1 -1
  114. package/build/esm/orchestrion/bundler/options.js +15 -3
  115. package/build/esm/orchestrion/bundler/options.js.map +1 -1
  116. package/build/esm/orchestrion/bundler/rollup.js +12 -2
  117. package/build/esm/orchestrion/bundler/rollup.js.map +1 -1
  118. package/build/esm/orchestrion/bundler/subscribeInjection.js +38 -0
  119. package/build/esm/orchestrion/bundler/subscribeInjection.js.map +1 -0
  120. package/build/esm/orchestrion/bundler/vite.js +17 -1
  121. package/build/esm/orchestrion/bundler/vite.js.map +1 -1
  122. package/build/esm/orchestrion/bundler/webpack.js +33 -3
  123. package/build/esm/orchestrion/bundler/webpack.js.map +1 -1
  124. package/build/esm/orchestrion/channels.js +0 -4
  125. package/build/esm/orchestrion/channels.js.map +1 -1
  126. package/build/esm/orchestrion/config/amqplib.js +4 -1
  127. package/build/esm/orchestrion/config/amqplib.js.map +1 -1
  128. package/build/esm/orchestrion/config/anthropic-ai.js +4 -1
  129. package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -1
  130. package/build/esm/orchestrion/config/aws-sdk.js +4 -1
  131. package/build/esm/orchestrion/config/aws-sdk.js.map +1 -1
  132. package/build/esm/orchestrion/config/channel-integration-definitions.js +26 -0
  133. package/build/esm/orchestrion/config/channel-integration-definitions.js.map +1 -0
  134. package/build/esm/orchestrion/config/dataloader.js +4 -1
  135. package/build/esm/orchestrion/config/dataloader.js.map +1 -1
  136. package/build/esm/orchestrion/config/express.js +4 -1
  137. package/build/esm/orchestrion/config/express.js.map +1 -1
  138. package/build/esm/orchestrion/config/firebase.js +79 -3
  139. package/build/esm/orchestrion/config/firebase.js.map +1 -1
  140. package/build/esm/orchestrion/config/generic-pool.js +4 -1
  141. package/build/esm/orchestrion/config/generic-pool.js.map +1 -1
  142. package/build/esm/orchestrion/config/google-genai.js +4 -1
  143. package/build/esm/orchestrion/config/google-genai.js.map +1 -1
  144. package/build/esm/orchestrion/config/graphql.js +4 -1
  145. package/build/esm/orchestrion/config/graphql.js.map +1 -1
  146. package/build/esm/orchestrion/config/hapi.js +4 -1
  147. package/build/esm/orchestrion/config/hapi.js.map +1 -1
  148. package/build/esm/orchestrion/config/index.js +61 -34
  149. package/build/esm/orchestrion/config/index.js.map +1 -1
  150. package/build/esm/orchestrion/config/ioredis.js +4 -1
  151. package/build/esm/orchestrion/config/ioredis.js.map +1 -1
  152. package/build/esm/orchestrion/config/kafkajs.js +4 -1
  153. package/build/esm/orchestrion/config/kafkajs.js.map +1 -1
  154. package/build/esm/orchestrion/config/knex.js +4 -1
  155. package/build/esm/orchestrion/config/knex.js.map +1 -1
  156. package/build/esm/orchestrion/config/koa.js +4 -1
  157. package/build/esm/orchestrion/config/koa.js.map +1 -1
  158. package/build/esm/orchestrion/config/langchain.js +4 -1
  159. package/build/esm/orchestrion/config/langchain.js.map +1 -1
  160. package/build/esm/orchestrion/config/langgraph.js +4 -1
  161. package/build/esm/orchestrion/config/langgraph.js.map +1 -1
  162. package/build/esm/orchestrion/config/lru-memoizer.js +4 -1
  163. package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -1
  164. package/build/esm/orchestrion/config/mongodb.js +4 -1
  165. package/build/esm/orchestrion/config/mongodb.js.map +1 -1
  166. package/build/esm/orchestrion/config/mongoose.js +4 -1
  167. package/build/esm/orchestrion/config/mongoose.js.map +1 -1
  168. package/build/esm/orchestrion/config/mysql.js +4 -1
  169. package/build/esm/orchestrion/config/mysql.js.map +1 -1
  170. package/build/esm/orchestrion/config/mysql2.js +4 -1
  171. package/build/esm/orchestrion/config/mysql2.js.map +1 -1
  172. package/build/esm/orchestrion/config/nestjs.js +4 -1
  173. package/build/esm/orchestrion/config/nestjs.js.map +1 -1
  174. package/build/esm/orchestrion/config/openai.js +4 -1
  175. package/build/esm/orchestrion/config/openai.js.map +1 -1
  176. package/build/esm/orchestrion/config/pg.js +4 -1
  177. package/build/esm/orchestrion/config/pg.js.map +1 -1
  178. package/build/esm/orchestrion/config/postgres.js +4 -1
  179. package/build/esm/orchestrion/config/postgres.js.map +1 -1
  180. package/build/esm/orchestrion/config/redis.js +4 -1
  181. package/build/esm/orchestrion/config/redis.js.map +1 -1
  182. package/build/esm/orchestrion/config/remix.js +4 -1
  183. package/build/esm/orchestrion/config/remix.js.map +1 -1
  184. package/build/esm/orchestrion/config/subscribe-injection.js +22 -0
  185. package/build/esm/orchestrion/config/subscribe-injection.js.map +1 -0
  186. package/build/esm/orchestrion/config/tedious.js +4 -1
  187. package/build/esm/orchestrion/config/tedious.js.map +1 -1
  188. package/build/esm/orchestrion/config/vercel-ai.js +4 -1
  189. package/build/esm/orchestrion/config/vercel-ai.js.map +1 -1
  190. package/build/esm/orchestrion/index.js +5 -2
  191. package/build/esm/orchestrion/index.js.map +1 -1
  192. package/build/esm/orchestrion/registerChannelIntegration.js +11 -0
  193. package/build/esm/orchestrion/registerChannelIntegration.js.map +1 -0
  194. package/build/esm/package.json +1 -1
  195. package/build/esm/vercel-ai/index.js.map +1 -1
  196. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js +3 -1
  197. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  198. package/build/types/index.d.ts +1 -1
  199. package/build/types/index.d.ts.map +1 -1
  200. package/build/types/integrations/tracing-channel/dataloader.d.ts.map +1 -1
  201. package/build/types/integrations/tracing-channel/fastify/index.d.ts +2 -2
  202. package/build/types/integrations/tracing-channel/fastify/index.d.ts.map +1 -1
  203. package/build/types/integrations/tracing-channel/fastify/utils.d.ts +1 -1
  204. package/build/types/integrations/tracing-channel/fastify/utils.d.ts.map +1 -1
  205. package/build/types/integrations/tracing-channel/firebase/firestore-types.d.ts +38 -0
  206. package/build/types/integrations/tracing-channel/firebase/firestore-types.d.ts.map +1 -0
  207. package/build/types/integrations/tracing-channel/firebase/firestore.d.ts +18 -0
  208. package/build/types/integrations/tracing-channel/firebase/firestore.d.ts.map +1 -0
  209. package/build/types/integrations/tracing-channel/firebase/functions.d.ts +15 -0
  210. package/build/types/integrations/tracing-channel/firebase/functions.d.ts.map +1 -0
  211. package/build/types/integrations/tracing-channel/firebase/index.d.ts +15 -0
  212. package/build/types/integrations/tracing-channel/firebase/index.d.ts.map +1 -0
  213. package/build/types/integrations/tracing-channel/firebase/instrumentation.d.ts +2 -0
  214. package/build/types/integrations/tracing-channel/firebase/instrumentation.d.ts.map +1 -0
  215. package/build/types/integrations/tracing-channel/vercel-ai.d.ts +1 -5
  216. package/build/types/integrations/tracing-channel/vercel-ai.d.ts.map +1 -1
  217. package/build/types/orchestrion/bundler/esbuild.d.ts +2 -3
  218. package/build/types/orchestrion/bundler/esbuild.d.ts.map +1 -1
  219. package/build/types/orchestrion/bundler/options.d.ts +34 -0
  220. package/build/types/orchestrion/bundler/options.d.ts.map +1 -1
  221. package/build/types/orchestrion/bundler/rollup.d.ts.map +1 -1
  222. package/build/types/orchestrion/bundler/subscribeInjection.d.ts +13 -0
  223. package/build/types/orchestrion/bundler/subscribeInjection.d.ts.map +1 -0
  224. package/build/types/orchestrion/bundler/vite.d.ts.map +1 -1
  225. package/build/types/orchestrion/bundler/webpack.d.ts +6 -1
  226. package/build/types/orchestrion/bundler/webpack.d.ts.map +1 -1
  227. package/build/types/orchestrion/channels.d.ts +15 -0
  228. package/build/types/orchestrion/channels.d.ts.map +1 -1
  229. package/build/types/orchestrion/config/amqplib.d.ts +2 -0
  230. package/build/types/orchestrion/config/amqplib.d.ts.map +1 -1
  231. package/build/types/orchestrion/config/anthropic-ai.d.ts +2 -0
  232. package/build/types/orchestrion/config/anthropic-ai.d.ts.map +1 -1
  233. package/build/types/orchestrion/config/aws-sdk.d.ts +2 -0
  234. package/build/types/orchestrion/config/aws-sdk.d.ts.map +1 -1
  235. package/build/types/orchestrion/config/channel-integration-definitions.d.ts +81 -0
  236. package/build/types/orchestrion/config/channel-integration-definitions.d.ts.map +1 -0
  237. package/build/types/orchestrion/config/dataloader.d.ts +2 -0
  238. package/build/types/orchestrion/config/dataloader.d.ts.map +1 -1
  239. package/build/types/orchestrion/config/express.d.ts +2 -0
  240. package/build/types/orchestrion/config/express.d.ts.map +1 -1
  241. package/build/types/orchestrion/config/firebase.d.ts +41 -2
  242. package/build/types/orchestrion/config/firebase.d.ts.map +1 -1
  243. package/build/types/orchestrion/config/generic-pool.d.ts +2 -0
  244. package/build/types/orchestrion/config/generic-pool.d.ts.map +1 -1
  245. package/build/types/orchestrion/config/google-genai.d.ts +2 -0
  246. package/build/types/orchestrion/config/google-genai.d.ts.map +1 -1
  247. package/build/types/orchestrion/config/graphql.d.ts +2 -0
  248. package/build/types/orchestrion/config/graphql.d.ts.map +1 -1
  249. package/build/types/orchestrion/config/hapi.d.ts +2 -0
  250. package/build/types/orchestrion/config/hapi.d.ts.map +1 -1
  251. package/build/types/orchestrion/config/index.d.ts +12 -0
  252. package/build/types/orchestrion/config/index.d.ts.map +1 -1
  253. package/build/types/orchestrion/config/ioredis.d.ts +1 -0
  254. package/build/types/orchestrion/config/ioredis.d.ts.map +1 -1
  255. package/build/types/orchestrion/config/kafkajs.d.ts +2 -0
  256. package/build/types/orchestrion/config/kafkajs.d.ts.map +1 -1
  257. package/build/types/orchestrion/config/knex.d.ts +1 -0
  258. package/build/types/orchestrion/config/knex.d.ts.map +1 -1
  259. package/build/types/orchestrion/config/koa.d.ts +2 -0
  260. package/build/types/orchestrion/config/koa.d.ts.map +1 -1
  261. package/build/types/orchestrion/config/langchain.d.ts +2 -0
  262. package/build/types/orchestrion/config/langchain.d.ts.map +1 -1
  263. package/build/types/orchestrion/config/langgraph.d.ts +2 -0
  264. package/build/types/orchestrion/config/langgraph.d.ts.map +1 -1
  265. package/build/types/orchestrion/config/lru-memoizer.d.ts +2 -0
  266. package/build/types/orchestrion/config/lru-memoizer.d.ts.map +1 -1
  267. package/build/types/orchestrion/config/mongodb.d.ts +2 -0
  268. package/build/types/orchestrion/config/mongodb.d.ts.map +1 -1
  269. package/build/types/orchestrion/config/mongoose.d.ts +2 -0
  270. package/build/types/orchestrion/config/mongoose.d.ts.map +1 -1
  271. package/build/types/orchestrion/config/mysql.d.ts +2 -0
  272. package/build/types/orchestrion/config/mysql.d.ts.map +1 -1
  273. package/build/types/orchestrion/config/mysql2.d.ts +2 -0
  274. package/build/types/orchestrion/config/mysql2.d.ts.map +1 -1
  275. package/build/types/orchestrion/config/nestjs.d.ts +1 -0
  276. package/build/types/orchestrion/config/nestjs.d.ts.map +1 -1
  277. package/build/types/orchestrion/config/openai.d.ts +2 -0
  278. package/build/types/orchestrion/config/openai.d.ts.map +1 -1
  279. package/build/types/orchestrion/config/pg.d.ts +2 -0
  280. package/build/types/orchestrion/config/pg.d.ts.map +1 -1
  281. package/build/types/orchestrion/config/postgres.d.ts +1 -0
  282. package/build/types/orchestrion/config/postgres.d.ts.map +1 -1
  283. package/build/types/orchestrion/config/redis.d.ts +2 -0
  284. package/build/types/orchestrion/config/redis.d.ts.map +1 -1
  285. package/build/types/orchestrion/config/remix.d.ts +1 -0
  286. package/build/types/orchestrion/config/remix.d.ts.map +1 -1
  287. package/build/types/orchestrion/config/subscribe-injection.d.ts +31 -0
  288. package/build/types/orchestrion/config/subscribe-injection.d.ts.map +1 -0
  289. package/build/types/orchestrion/config/tedious.d.ts +1 -0
  290. package/build/types/orchestrion/config/tedious.d.ts.map +1 -1
  291. package/build/types/orchestrion/config/vercel-ai.d.ts +1 -0
  292. package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -1
  293. package/build/types/orchestrion/index.d.ts +7 -6
  294. package/build/types/orchestrion/index.d.ts.map +1 -1
  295. package/build/types/orchestrion/registerChannelIntegration.d.ts +33 -0
  296. package/build/types/orchestrion/registerChannelIntegration.d.ts.map +1 -0
  297. package/build/types/vercel-ai/index.d.ts +2 -3
  298. package/build/types/vercel-ai/index.d.ts.map +1 -1
  299. package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -1
  300. package/build/types-ts3.8/index.d.ts +1 -1
  301. package/build/types-ts3.8/integrations/tracing-channel/fastify/index.d.ts +2 -2
  302. package/build/types-ts3.8/integrations/tracing-channel/fastify/utils.d.ts +1 -1
  303. package/build/types-ts3.8/integrations/tracing-channel/firebase/firestore-types.d.ts +38 -0
  304. package/build/types-ts3.8/integrations/tracing-channel/firebase/firestore.d.ts +18 -0
  305. package/build/types-ts3.8/integrations/tracing-channel/firebase/functions.d.ts +15 -0
  306. package/build/types-ts3.8/integrations/tracing-channel/firebase/index.d.ts +15 -0
  307. package/build/types-ts3.8/integrations/tracing-channel/firebase/instrumentation.d.ts +2 -0
  308. package/build/types-ts3.8/integrations/tracing-channel/vercel-ai.d.ts +1 -5
  309. package/build/types-ts3.8/orchestrion/bundler/esbuild.d.ts +2 -3
  310. package/build/types-ts3.8/orchestrion/bundler/options.d.ts +34 -0
  311. package/build/types-ts3.8/orchestrion/bundler/subscribeInjection.d.ts +13 -0
  312. package/build/types-ts3.8/orchestrion/bundler/webpack.d.ts +6 -1
  313. package/build/types-ts3.8/orchestrion/channels.d.ts +15 -0
  314. package/build/types-ts3.8/orchestrion/config/amqplib.d.ts +2 -0
  315. package/build/types-ts3.8/orchestrion/config/anthropic-ai.d.ts +2 -0
  316. package/build/types-ts3.8/orchestrion/config/aws-sdk.d.ts +2 -0
  317. package/build/types-ts3.8/orchestrion/config/channel-integration-definitions.d.ts +139 -0
  318. package/build/types-ts3.8/orchestrion/config/dataloader.d.ts +2 -0
  319. package/build/types-ts3.8/orchestrion/config/express.d.ts +2 -0
  320. package/build/types-ts3.8/orchestrion/config/firebase.d.ts +41 -2
  321. package/build/types-ts3.8/orchestrion/config/generic-pool.d.ts +2 -0
  322. package/build/types-ts3.8/orchestrion/config/google-genai.d.ts +2 -0
  323. package/build/types-ts3.8/orchestrion/config/graphql.d.ts +2 -0
  324. package/build/types-ts3.8/orchestrion/config/hapi.d.ts +2 -0
  325. package/build/types-ts3.8/orchestrion/config/index.d.ts +12 -0
  326. package/build/types-ts3.8/orchestrion/config/ioredis.d.ts +1 -0
  327. package/build/types-ts3.8/orchestrion/config/kafkajs.d.ts +2 -0
  328. package/build/types-ts3.8/orchestrion/config/knex.d.ts +1 -0
  329. package/build/types-ts3.8/orchestrion/config/koa.d.ts +2 -0
  330. package/build/types-ts3.8/orchestrion/config/langchain.d.ts +2 -0
  331. package/build/types-ts3.8/orchestrion/config/langgraph.d.ts +2 -0
  332. package/build/types-ts3.8/orchestrion/config/lru-memoizer.d.ts +2 -0
  333. package/build/types-ts3.8/orchestrion/config/mongodb.d.ts +2 -0
  334. package/build/types-ts3.8/orchestrion/config/mongoose.d.ts +2 -0
  335. package/build/types-ts3.8/orchestrion/config/mysql.d.ts +2 -0
  336. package/build/types-ts3.8/orchestrion/config/mysql2.d.ts +2 -0
  337. package/build/types-ts3.8/orchestrion/config/nestjs.d.ts +1 -0
  338. package/build/types-ts3.8/orchestrion/config/openai.d.ts +2 -0
  339. package/build/types-ts3.8/orchestrion/config/pg.d.ts +2 -0
  340. package/build/types-ts3.8/orchestrion/config/postgres.d.ts +1 -0
  341. package/build/types-ts3.8/orchestrion/config/redis.d.ts +2 -0
  342. package/build/types-ts3.8/orchestrion/config/remix.d.ts +1 -0
  343. package/build/types-ts3.8/orchestrion/config/subscribe-injection.d.ts +31 -0
  344. package/build/types-ts3.8/orchestrion/config/tedious.d.ts +1 -0
  345. package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +1 -0
  346. package/build/types-ts3.8/orchestrion/index.d.ts +7 -6
  347. package/build/types-ts3.8/orchestrion/registerChannelIntegration.d.ts +33 -0
  348. package/build/types-ts3.8/vercel-ai/index.d.ts +2 -3
  349. package/package.json +4 -3
  350. package/build/cjs/orchestrion/config/prisma.js +0 -8
  351. package/build/cjs/orchestrion/config/prisma.js.map +0 -1
  352. package/build/cjs/orchestrion/config/react-router.js +0 -8
  353. package/build/cjs/orchestrion/config/react-router.js.map +0 -1
  354. package/build/esm/orchestrion/config/prisma.js +0 -5
  355. package/build/esm/orchestrion/config/prisma.js.map +0 -1
  356. package/build/esm/orchestrion/config/react-router.js +0 -5
  357. package/build/esm/orchestrion/config/react-router.js.map +0 -1
  358. package/build/types/orchestrion/config/prisma.d.ts +0 -4
  359. package/build/types/orchestrion/config/prisma.d.ts.map +0 -1
  360. package/build/types/orchestrion/config/react-router.d.ts +0 -4
  361. package/build/types/orchestrion/config/react-router.d.ts.map +0 -1
  362. package/build/types-ts3.8/orchestrion/config/prisma.d.ts +0 -4
  363. package/build/types-ts3.8/orchestrion/config/react-router.d.ts +0 -4
@@ -0,0 +1,75 @@
1
+ import * as net from 'node:net';
2
+ import { DB_OPERATION_NAME, DB_NAMESPACE, DB_COLLECTION_NAME, DB_SYSTEM_NAME, SERVER_ADDRESS, SERVER_PORT } from '@sentry/conventions/attributes';
3
+ import { startInactiveSpan, SPAN_KIND, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
4
+
5
+ function startFirestoreSpan(spanName, reference) {
6
+ return startInactiveSpan({
7
+ name: `${spanName} ${reference.path}`,
8
+ op: "db.query",
9
+ kind: SPAN_KIND.CLIENT,
10
+ attributes: {
11
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.firebase.orchestrion.firestore",
12
+ [DB_OPERATION_NAME]: spanName,
13
+ ...buildAttributes(reference)
14
+ }
15
+ });
16
+ }
17
+ function getPortAndAddress(settings) {
18
+ let address;
19
+ let port;
20
+ if (typeof settings.host === "string") {
21
+ if (settings.host.startsWith("[")) {
22
+ if (settings.host.endsWith("]")) {
23
+ address = settings.host.replace(/^\[|\]$/g, "");
24
+ } else if (settings.host.includes("]:")) {
25
+ const lastColonIndex = settings.host.lastIndexOf(":");
26
+ if (lastColonIndex !== -1) {
27
+ address = settings.host.slice(1, lastColonIndex).replace(/^\[|\]$/g, "");
28
+ port = settings.host.slice(lastColonIndex + 1);
29
+ }
30
+ }
31
+ } else {
32
+ if (net.isIPv6(settings.host)) {
33
+ address = settings.host;
34
+ } else {
35
+ const lastColonIndex = settings.host.lastIndexOf(":");
36
+ if (lastColonIndex !== -1) {
37
+ address = settings.host.slice(0, lastColonIndex);
38
+ port = settings.host.slice(lastColonIndex + 1);
39
+ } else {
40
+ address = settings.host;
41
+ }
42
+ }
43
+ }
44
+ }
45
+ return {
46
+ address,
47
+ port: port ? parseInt(port, 10) : void 0
48
+ };
49
+ }
50
+ function buildAttributes(reference) {
51
+ const firestoreApp = reference.firestore.app;
52
+ const firestoreOptions = firestoreApp.options;
53
+ const settings = reference.firestore.toJSON()?.settings || {};
54
+ const attributes = {
55
+ [DB_COLLECTION_NAME]: reference.path,
56
+ [DB_NAMESPACE]: firestoreApp.name,
57
+ [DB_SYSTEM_NAME]: "firebase.firestore",
58
+ "firebase.firestore.type": reference.type,
59
+ "firebase.firestore.options.projectId": firestoreOptions.projectId,
60
+ "firebase.firestore.options.appId": firestoreOptions.appId,
61
+ "firebase.firestore.options.messagingSenderId": firestoreOptions.messagingSenderId,
62
+ "firebase.firestore.options.storageBucket": firestoreOptions.storageBucket
63
+ };
64
+ const { address, port } = getPortAndAddress(settings);
65
+ if (address) {
66
+ attributes[SERVER_ADDRESS] = address;
67
+ }
68
+ if (port) {
69
+ attributes[SERVER_PORT] = port;
70
+ }
71
+ return attributes;
72
+ }
73
+
74
+ export { getPortAndAddress, startFirestoreSpan };
75
+ //# sourceMappingURL=firestore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"firestore.js","sources":["../../../../../src/integrations/tracing-channel/firebase/firestore.ts"],"sourcesContent":["import * as net from 'node:net';\nimport {\n DB_COLLECTION_NAME,\n DB_NAMESPACE,\n DB_OPERATION_NAME,\n DB_SYSTEM_NAME,\n SERVER_ADDRESS,\n SERVER_PORT,\n} from '@sentry/conventions/attributes';\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_KIND, startInactiveSpan } from '@sentry/core';\nimport type { FirebaseApp, FirebaseOptions, FirestoreReference, FirestoreSettings } from './firestore-types';\n\n/**\n * Opens the inactive `db.query` span for a Firestore operation. `bindTracingChannelToSpan` makes it the\n * active span for the traced call and ends it when the call settles. Mirrors the OTel integration's span,\n * with a distinct `auto.firebase.orchestrion.firestore` origin.\n */\nexport function startFirestoreSpan(spanName: string, reference: FirestoreReference): Span {\n return startInactiveSpan({\n name: `${spanName} ${reference.path}`,\n op: 'db.query',\n kind: SPAN_KIND.CLIENT,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.firebase.orchestrion.firestore',\n [DB_OPERATION_NAME]: spanName,\n ...buildAttributes(reference),\n },\n });\n}\n\n/**\n * Gets the server address and port attributes from the Firestore settings.\n * It's best effort to extract the address and port from the settings, especially for IPv6.\n * @param settings - The Firestore settings containing host information.\n */\nexport function getPortAndAddress(settings: FirestoreSettings): {\n address?: string;\n port?: number;\n} {\n let address: string | undefined;\n let port: string | undefined;\n\n if (typeof settings.host === 'string') {\n if (settings.host.startsWith('[')) {\n // IPv6 addresses can be enclosed in square brackets, e.g., [2001:db8::1]:8080\n if (settings.host.endsWith(']')) {\n // IPv6 with square brackets without port\n address = settings.host.replace(/^\\[|\\]$/g, '');\n } else if (settings.host.includes(']:')) {\n // IPv6 with square brackets with port\n const lastColonIndex = settings.host.lastIndexOf(':');\n if (lastColonIndex !== -1) {\n address = settings.host.slice(1, lastColonIndex).replace(/^\\[|\\]$/g, '');\n port = settings.host.slice(lastColonIndex + 1);\n }\n }\n } else {\n // IPv4 or IPv6 without square brackets\n // If it's an IPv6 address without square brackets, we assume it does not have a port.\n if (net.isIPv6(settings.host)) {\n address = settings.host;\n }\n // If it's an IPv4 address, we can extract the port if it exists.\n else {\n const lastColonIndex = settings.host.lastIndexOf(':');\n if (lastColonIndex !== -1) {\n address = settings.host.slice(0, lastColonIndex);\n port = settings.host.slice(lastColonIndex + 1);\n } else {\n address = settings.host;\n }\n }\n }\n }\n return {\n address: address,\n port: port ? parseInt(port, 10) : undefined,\n };\n}\n\nfunction buildAttributes(reference: FirestoreReference): SpanAttributes {\n const firestoreApp: FirebaseApp = reference.firestore.app;\n const firestoreOptions: FirebaseOptions = firestoreApp.options;\n const settings: FirestoreSettings = reference.firestore.toJSON()?.settings || {};\n\n const attributes: SpanAttributes = {\n [DB_COLLECTION_NAME]: reference.path,\n [DB_NAMESPACE]: firestoreApp.name,\n [DB_SYSTEM_NAME]: 'firebase.firestore',\n 'firebase.firestore.type': reference.type,\n 'firebase.firestore.options.projectId': firestoreOptions.projectId,\n 'firebase.firestore.options.appId': firestoreOptions.appId,\n 'firebase.firestore.options.messagingSenderId': firestoreOptions.messagingSenderId,\n 'firebase.firestore.options.storageBucket': firestoreOptions.storageBucket,\n };\n\n const { address, port } = getPortAndAddress(settings);\n\n if (address) {\n attributes[SERVER_ADDRESS] = address;\n }\n if (port) {\n attributes[SERVER_PORT] = port;\n }\n\n return attributes;\n}\n"],"names":[],"mappings":"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"}
@@ -0,0 +1,65 @@
1
+ import { FAAS_TRIGGER, FAAS_NAME } from '@sentry/conventions/attributes';
2
+ import { startSpanManual, SPAN_KIND, SPAN_STATUS_ERROR, captureException, flush, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
3
+
4
+ const FUNCTIONS_ORIGIN = "auto.firebase.orchestrion.functions";
5
+ const WRAPPED = "__sentryFirebaseWrapped";
6
+ function wrapFunctionsRegistration(data, triggerType) {
7
+ const args = data.arguments;
8
+ if (!Array.isArray(args) || args.length === 0) {
9
+ return;
10
+ }
11
+ const handlerIndex = typeof args[0] === "function" ? 0 : 1;
12
+ const handler = args[handlerIndex];
13
+ if (typeof handler !== "function" || handler[WRAPPED]) {
14
+ return;
15
+ }
16
+ args[handlerIndex] = wrapHandler(handler, triggerType);
17
+ }
18
+ function wrapHandler(handler, triggerType) {
19
+ const wrapped = async function(...handlerArgs) {
20
+ const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || "unknown";
21
+ const attributes = {
22
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: FUNCTIONS_ORIGIN,
23
+ [FAAS_NAME]: functionName,
24
+ [FAAS_TRIGGER]: triggerType,
25
+ "faas.provider": "firebase"
26
+ };
27
+ if (process.env.GCLOUD_PROJECT) {
28
+ attributes["cloud.project_id"] = process.env.GCLOUD_PROJECT;
29
+ }
30
+ if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) {
31
+ attributes["cloud.event_source"] = process.env.EVENTARC_CLOUD_EVENT_SOURCE;
32
+ }
33
+ return startSpanManual(
34
+ {
35
+ name: `firebase.function.${triggerType}`,
36
+ op: "function.firebase",
37
+ kind: SPAN_KIND.SERVER,
38
+ attributes
39
+ },
40
+ async (span) => {
41
+ try {
42
+ const result = await handler.apply(this, handlerArgs);
43
+ span.end();
44
+ return result;
45
+ } catch (error) {
46
+ span.setStatus({ code: SPAN_STATUS_ERROR });
47
+ captureException(error, {
48
+ mechanism: {
49
+ type: FUNCTIONS_ORIGIN,
50
+ handled: false
51
+ }
52
+ });
53
+ span.end();
54
+ await flush(2e3);
55
+ throw error;
56
+ }
57
+ }
58
+ );
59
+ };
60
+ wrapped[WRAPPED] = true;
61
+ return wrapped;
62
+ }
63
+
64
+ export { wrapFunctionsRegistration };
65
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sources":["../../../../../src/integrations/tracing-channel/firebase/functions.ts"],"sourcesContent":["import { FAAS_NAME, FAAS_TRIGGER } from '@sentry/conventions/attributes';\nimport type { SpanAttributes } from '@sentry/core';\nimport {\n captureException,\n flush,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startSpanManual,\n} from '@sentry/core';\n\nconst FUNCTIONS_ORIGIN = 'auto.firebase.orchestrion.functions';\n\n// Set on a wrapped handler so re-entrant `start` events don't double-wrap it.\nconst WRAPPED = '__sentryFirebaseWrapped';\n\ntype Handler = (this: unknown, ...args: unknown[]) => unknown;\n\ninterface FunctionsChannelContext {\n // The live args of the `onX(...)` registration call. firebase-functions accepts either\n // `onX(handler)` or `onX(documentOrOptions, handler)`, so the handler is `arguments[0]` when it's a\n // function, otherwise `arguments[1]`. Mutating the entry here swaps in the wrapped handler.\n arguments: unknown[];\n self?: unknown;\n}\n\n/**\n * Rewrap the handler argument of a firebase-functions `onX(...)` registration so the returned cloud\n * function opens a `SERVER` span (and error boundary) each time it's invoked. Runs as the tracing\n * channel's `start` subscriber, before orchestrion forwards the (mutated) arguments to the real call.\n *\n * The registration call itself is trivial and synchronous, so — unlike the firestore path — this does\n * not bind a span to the channel; it only uses the channel as an injection point.\n */\nexport function wrapFunctionsRegistration(data: FunctionsChannelContext, triggerType: string): void {\n const args = data.arguments;\n if (!Array.isArray(args) || args.length === 0) {\n return;\n }\n\n const handlerIndex = typeof args[0] === 'function' ? 0 : 1;\n const handler = args[handlerIndex];\n\n if (typeof handler !== 'function' || (handler as unknown as Record<string, unknown>)[WRAPPED]) {\n return;\n }\n\n args[handlerIndex] = wrapHandler(handler as Handler, triggerType);\n}\n\nfunction wrapHandler(handler: Handler, triggerType: string): Handler {\n const wrapped = async function (this: unknown, ...handlerArgs: unknown[]): Promise<unknown> {\n const functionName = process.env.FUNCTION_TARGET || process.env.K_SERVICE || 'unknown';\n\n const attributes: SpanAttributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: FUNCTIONS_ORIGIN,\n [FAAS_NAME]: functionName,\n [FAAS_TRIGGER]: triggerType,\n 'faas.provider': 'firebase',\n };\n\n if (process.env.GCLOUD_PROJECT) {\n attributes['cloud.project_id'] = process.env.GCLOUD_PROJECT;\n }\n\n if (process.env.EVENTARC_CLOUD_EVENT_SOURCE) {\n attributes['cloud.event_source'] = process.env.EVENTARC_CLOUD_EVENT_SOURCE;\n }\n\n // `startSpanManual` keeps the span active while still allowing us to end it before flushing on error.\n return startSpanManual(\n {\n name: `firebase.function.${triggerType}`,\n op: 'function.firebase',\n kind: SPAN_KIND.SERVER,\n attributes,\n },\n async span => {\n try {\n const result = await handler.apply(this, handlerArgs);\n span.end();\n return result;\n } catch (error) {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n captureException(error, {\n mechanism: {\n type: FUNCTIONS_ORIGIN,\n handled: false,\n },\n });\n span.end();\n await flush(2000);\n throw error;\n }\n },\n );\n };\n\n (wrapped as unknown as Record<string, unknown>)[WRAPPED] = true;\n return wrapped;\n}\n"],"names":[],"mappings":";;;AAWA,MAAM,gBAAA,GAAmB,qCAAA;AAGzB,MAAM,OAAA,GAAU,yBAAA;AAoBT,SAAS,yBAAA,CAA0B,MAA+B,WAAA,EAA2B;AAClG,EAAA,MAAM,OAAO,IAAA,CAAK,SAAA;AAClB,EAAA,IAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,IAAK,IAAA,CAAK,WAAW,CAAA,EAAG;AAC7C,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,eAAe,OAAO,IAAA,CAAK,CAAC,CAAA,KAAM,aAAa,CAAA,GAAI,CAAA;AACzD,EAAA,MAAM,OAAA,GAAU,KAAK,YAAY,CAAA;AAEjC,EAAA,IAAI,OAAO,OAAA,KAAY,UAAA,IAAe,OAAA,CAA+C,OAAO,CAAA,EAAG;AAC7F,IAAA;AAAA,EACF;AAEA,EAAA,IAAA,CAAK,YAAY,CAAA,GAAI,WAAA,CAAY,OAAA,EAAoB,WAAW,CAAA;AAClE;AAEA,SAAS,WAAA,CAAY,SAAkB,WAAA,EAA8B;AACnE,EAAA,MAAM,OAAA,GAAU,kBAAkC,WAAA,EAA0C;AAC1F,IAAA,MAAM,eAAe,OAAA,CAAQ,GAAA,CAAI,eAAA,IAAmB,OAAA,CAAQ,IAAI,SAAA,IAAa,SAAA;AAE7E,IAAA,MAAM,UAAA,GAA6B;AAAA,MACjC,CAAC,gCAAgC,GAAG,gBAAA;AAAA,MACpC,CAAC,SAAS,GAAG,YAAA;AAAA,MACb,CAAC,YAAY,GAAG,WAAA;AAAA,MAChB,eAAA,EAAiB;AAAA,KACnB;AAEA,IAAA,IAAI,OAAA,CAAQ,IAAI,cAAA,EAAgB;AAC9B,MAAA,UAAA,CAAW,kBAAkB,CAAA,GAAI,OAAA,CAAQ,GAAA,CAAI,cAAA;AAAA,IAC/C;AAEA,IAAA,IAAI,OAAA,CAAQ,IAAI,2BAAA,EAA6B;AAC3C,MAAA,UAAA,CAAW,oBAAoB,CAAA,GAAI,OAAA,CAAQ,GAAA,CAAI,2BAAA;AAAA,IACjD;AAGA,IAAA,OAAO,eAAA;AAAA,MACL;AAAA,QACE,IAAA,EAAM,qBAAqB,WAAW,CAAA,CAAA;AAAA,QACtC,EAAA,EAAI,mBAAA;AAAA,QACJ,MAAM,SAAA,CAAU,MAAA;AAAA,QAChB;AAAA,OACF;AAAA,MACA,OAAM,IAAA,KAAQ;AACZ,QAAA,IAAI;AACF,UAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,KAAA,CAAM,MAAM,WAAW,CAAA;AACpD,UAAA,IAAA,CAAK,GAAA,EAAI;AACT,UAAA,OAAO,MAAA;AAAA,QACT,SAAS,KAAA,EAAO;AACd,UAAA,IAAA,CAAK,SAAA,CAAU,EAAE,IAAA,EAAM,iBAAA,EAAmB,CAAA;AAC1C,UAAA,gBAAA,CAAiB,KAAA,EAAO;AAAA,YACtB,SAAA,EAAW;AAAA,cACT,IAAA,EAAM,gBAAA;AAAA,cACN,OAAA,EAAS;AAAA;AACX,WACD,CAAA;AACD,UAAA,IAAA,CAAK,GAAA,EAAI;AACT,UAAA,MAAM,MAAM,GAAI,CAAA;AAChB,UAAA,MAAM,KAAA;AAAA,QACR;AAAA,MACF;AAAA,KACF;AAAA,EACF,CAAA;AAEA,EAAC,OAAA,CAA+C,OAAO,CAAA,GAAI,IAAA;AAC3D,EAAA,OAAO,OAAA;AACT;;;;"}
@@ -0,0 +1,22 @@
1
+ import * as diagnosticsChannel from 'node:diagnostics_channel';
2
+ import { defineIntegration, waitForTracingChannelBinding } from '@sentry/core';
3
+ import { instrumentFirebase } from './instrumentation.js';
4
+
5
+ const INTEGRATION_NAME = "Firebase";
6
+ const _firebaseChannelIntegration = (() => {
7
+ return {
8
+ name: INTEGRATION_NAME,
9
+ setupOnce() {
10
+ if (!diagnosticsChannel.tracingChannel) {
11
+ return;
12
+ }
13
+ waitForTracingChannelBinding(() => {
14
+ instrumentFirebase();
15
+ });
16
+ }
17
+ };
18
+ });
19
+ const firebaseChannelIntegration = defineIntegration(_firebaseChannelIntegration);
20
+
21
+ export { firebaseChannelIntegration };
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing-channel/firebase/index.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, waitForTracingChannelBinding } from '@sentry/core';\nimport { instrumentFirebase } from './instrumentation';\n\nconst INTEGRATION_NAME = 'Firebase' as const;\n\nconst _firebaseChannelIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // `tracingChannel` is unavailable before Node 18.19 so do nothing in that case.\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n waitForTracingChannelBinding(() => {\n instrumentFirebase();\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * EXPERIMENTAL — orchestrion-driven firebase integration.\n *\n * Subscribes to the `orchestrion:@firebase/firestore:*` and `orchestrion:firebase-functions:*`\n * diagnostics_channels the orchestrion code transform injects into firestore's `addDoc`/`getDocs`/\n * `setDoc`/`deleteDoc` and firebase-functions' `onX` registration functions, emitting spans identical\n * to the OTel integration — with a distinct `auto.firebase.orchestrion.*` origin. Requires the\n * orchestrion runtime hook or bundler plugin — wire it up via `experimentalUseDiagnosticsChannelInjection()`.\n *\n * @experimental\n */\nexport const firebaseChannelIntegration = defineIntegration(_firebaseChannelIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,UAAA;AAEzB,MAAM,+BAA+B,MAAM;AACzC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AAEV,MAAA,IAAI,CAAC,mBAAmB,cAAA,EAAgB;AACtC,QAAA;AAAA,MACF;AAEA,MAAA,4BAAA,CAA6B,MAAM;AACjC,QAAA,kBAAA,EAAmB;AAAA,MACrB,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAA,CAAA;AAaO,MAAM,0BAAA,GAA6B,kBAAkB,2BAA2B;;;;"}
@@ -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":"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"}
@@ -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":[],"mappings":";;;;;AAUA,MAAM,gBAAA,uBAAuB,OAAA,EAAgB;AAqB7C,SAAS,gBAAA,CAAiB,YAAoB,GAAA,EAAsB;AAClE,EAAA,MAAM,aAAa,GAAA,GACf,CAAA,SAAA,EAAY,UAAU,CAAA,kFAAA,CAAA,GACtB,WAAW,UAAU,CAAA,wFAAA,CAAA;AAEzB,EAAA,OAAO,GAAG,UAAU;AAAA,sCAAA,EAA2C,IAAA,CAAK,SAAA,CAAU,UAAU,CAAC,KAAK,UAAU,CAAA,EAAA,CAAA;AAC1G;AAWA,MAAM,eAAA,GAAmC,CAAC,KAAA,EAAO,OAAA,KAAY;AAC3D,EAAA,MAAM,IAAA,GAAO,OAAA;AACb,EAAA,IAAI,gBAAA,CAAiB,GAAA,CAAI,IAAI,CAAA,EAAG;AAC9B,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,EAAE,UAAA,EAAY,WAAA,EAAY,GAAI,KAAA;AACpC,EAAA,MAAM,UAAA,GAAa,WAAA,GAAc,yBAAA,CAA0B,WAAW,CAAA,GAAI,MAAA;AAC1E,EAAA,IAAI,CAAC,UAAA,EAAY;AACf,IAAA;AAAA,EACF;AAEA,EAAA,gBAAA,CAAiB,IAAI,IAAI,CAAA;AAEzB,EAAA,MAAM,aAAa,KAAA,CAAM,gBAAA,CAAiB,UAAA,EAAY,UAAA,KAAe,KAAK,CAAA,EAAG;AAAA,IAC3E,QAAQ,UAAA,KAAe,KAAA;AAAA,IACvB,IAAA,EAAM;AAAA,GACP,CAAA,CAAE,IAAA;AAEH,EAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,IAAA,CAAK,SAAA,CAAU,CAAA,CAAA,KAAK,EAAE,IAAA,KAAS,qBAAA,IAAyB,CAAA,CAAE,SAAA,KAAc,YAAY,CAAA;AAChH,EAAA,IAAA,CAAK,KAAK,MAAA,CAAO,cAAA,GAAiB,CAAA,EAAG,CAAA,EAAG,GAAG,UAAU,CAAA;AACvD,CAAA;AAYO,SAAS,yBAAA,GAA0F;AACxG,EAAA,OAAO;AAAA,IACL,gBAAA,EAAkB,oBAAA;AAAA,IAClB,gBAAA,EAAkB,EAAE,CAAC,wBAAwB,GAAG,eAAA;AAAgB,GAClE;AACF;;;;"}
@@ -1,12 +1,28 @@
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
+ applyToEnvironment(environment) {
9
+ return environment.config.consumer === "server";
10
+ },
8
11
  config() {
9
12
  return { ssr: { noExternal: instrumentedModuleNames(options.instrumentations) } };
13
+ },
14
+ configResolved(config) {
15
+ const external = config.ssr?.external;
16
+ if (!Array.isArray(external)) {
17
+ return;
18
+ }
19
+ const moduleNames = instrumentedModuleNames(options.instrumentations);
20
+ const externalizedModules = moduleNames.filter(
21
+ (name) => external.some((entry) => externalEntryMatchesModule(entry, name))
22
+ );
23
+ if (externalizedModules.length > 0) {
24
+ config.logger.warn(`[Sentry] ${externalizedModulesWarning(externalizedModules)}`);
25
+ }
10
26
  }
11
27
  };
12
28
  }
@@ -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 applyToEnvironment(environment) {\n // Orchestrion splices `node:diagnostics_channel` calls into instrumented modules, which only\n // exist server-side. Only apply to server-consumed environments so injected `tracingChannel`\n // calls never land in a browser (`client`) bundle (where they'd throw `X is not a function`).\n return environment.config.consumer === 'server';\n },\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,mBAAmB,WAAA,EAAa;AAI9B,MAAA,OAAO,WAAA,CAAY,OAAO,QAAA,KAAa,QAAA;AAAA,IACzC,CAAA;AAAA,IACA,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,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,0BAAyB,CAAA,sBAAkB,EAAA;AACpD,EAAA,MAAA,OAAA,GAAA,KAAA,CAAA,OAAA,CAAA,SAAA,CAAA,GAAA,SAAA,GAAA,CAAA,SAAA,CAAA;AAGO,EAAA,OAAA,WAAS,CAAA,MAAA;AACd,IAAA,CAAA,IAAO,KAAA,OAAA,CAAA,IAAA,CAAA,CAAA,KAAA,KAAA;AACT,MAAA,IAAA,OAAA,KAAA,KAAA,QAAA,EAAA;AAKA,QAAA,OAAS,gCAA+C,EAAA,IAAA,CAAA;AACtD,MAAA;AACA,MAAA,IAAO,KAAA,YAAY,MAAA,EAAA;AAAA,QAAO,OACxB,KAAA,CAAA,IAAQ,CAAA,IAAK,CAAA;AACX,MAAA;AACE,MAAA,IAAA,KAAO,IAAA,OAAA,KAAA,KAAA;AAAsC,QAC/C,OAAA,IAAA,IAAA,KAAA;AACA,MAAA;AACE,MAAA,OAAA,KAAO;AAAe,IAAA,CAAA;AAExB,GAAA;AACE;AACF,SAAA,8BAAA,CAAA,OAAA,GAAA,EAAA,EAAA;AACA,EAAA,MAAA,MAAO,GAAA,sBAAA,CAAA,2BAAA,CAAA,OAAA,CAAA,CAAA;AAAA,EAAA,MACR,WAAA,GAAA,uBAAA,CAAA,OAAA,CAAA,gBAAA,CAAA;AAAA,EACH,MAAA,KAAA,GAAA,MAAA,CAAA,KAAA,CAAA,IAAA,CAAA,MAAA,CAAA;AACF,EAAA,MAAA,CAAA,KAAA,GAAA,CAAA,QAAA,KAAA;AAQO,IAAA,MAAA,mBAAS,GAAA,0BAAyD,CAAA,QAA8C,CAAA,OAAA,CAAA,SAAA,EAAA,WAAA,CAAA;AACrH,IAAA,IAAM,mBAAS,CAAA,MAAA,GAAA,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,