@sentry/server-utils 10.64.0 → 10.65.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 (279) hide show
  1. package/build/cjs/graphql/graphql-dc-subscriber.js +125 -0
  2. package/build/cjs/graphql/graphql-dc-subscriber.js.map +1 -0
  3. package/build/cjs/graphql/index.js +23 -0
  4. package/build/cjs/graphql/index.js.map +1 -0
  5. package/build/cjs/graphql/utils.js +86 -0
  6. package/build/cjs/graphql/utils.js.map +1 -0
  7. package/build/cjs/index.js +10 -11
  8. package/build/cjs/index.js.map +1 -1
  9. package/build/cjs/integrations/tracing-channel/amqplib.js +420 -0
  10. package/build/cjs/integrations/tracing-channel/amqplib.js.map +1 -0
  11. package/build/cjs/integrations/tracing-channel/express/index.js +24 -0
  12. package/build/cjs/integrations/tracing-channel/express/index.js.map +1 -0
  13. package/build/cjs/integrations/tracing-channel/express/instrumentation.js +173 -0
  14. package/build/cjs/integrations/tracing-channel/express/instrumentation.js.map +1 -0
  15. package/build/cjs/integrations/tracing-channel/express/route.js +76 -0
  16. package/build/cjs/integrations/tracing-channel/express/route.js.map +1 -0
  17. package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js +1 -1
  18. package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js.map +1 -1
  19. package/build/cjs/integrations/tracing-channel/google-genai.js +96 -0
  20. package/build/cjs/integrations/tracing-channel/google-genai.js.map +1 -0
  21. package/build/cjs/integrations/tracing-channel/graphql/constants.js +26 -0
  22. package/build/cjs/integrations/tracing-channel/graphql/constants.js.map +1 -0
  23. package/build/cjs/integrations/tracing-channel/graphql/index.js +66 -0
  24. package/build/cjs/integrations/tracing-channel/graphql/index.js.map +1 -0
  25. package/build/cjs/integrations/tracing-channel/graphql/resolvers.js +168 -0
  26. package/build/cjs/integrations/tracing-channel/graphql/resolvers.js.map +1 -0
  27. package/build/cjs/integrations/tracing-channel/graphql/spans.js +102 -0
  28. package/build/cjs/integrations/tracing-channel/graphql/spans.js.map +1 -0
  29. package/build/cjs/integrations/tracing-channel/ioredis.js +14 -14
  30. package/build/cjs/integrations/tracing-channel/ioredis.js.map +1 -1
  31. package/build/cjs/integrations/tracing-channel/mysql.js +1 -1
  32. package/build/cjs/integrations/tracing-channel/mysql.js.map +1 -1
  33. package/build/cjs/integrations/tracing-channel/openai.js.map +1 -1
  34. package/build/cjs/integrations/tracing-channel/postgres-js.js +191 -0
  35. package/build/cjs/integrations/tracing-channel/postgres-js.js.map +1 -0
  36. package/build/cjs/integrations/tracing-channel/postgres.js +5 -5
  37. package/build/cjs/integrations/tracing-channel/postgres.js.map +1 -1
  38. package/build/cjs/integrations/tracing-channel/redis.js +227 -0
  39. package/build/cjs/integrations/tracing-channel/redis.js.map +1 -0
  40. package/build/cjs/integrations/tracing-channel/vercel-ai.js +2 -2
  41. package/build/cjs/integrations/tracing-channel/vercel-ai.js.map +1 -1
  42. package/build/cjs/mongoose/mongoose-dc-subscriber.js +1 -1
  43. package/build/cjs/mongoose/mongoose-dc-subscriber.js.map +1 -1
  44. package/build/cjs/mysql2/index.js +23 -0
  45. package/build/cjs/mysql2/index.js.map +1 -0
  46. package/build/cjs/mysql2/mysql2-dc-subscriber.js +68 -0
  47. package/build/cjs/mysql2/mysql2-dc-subscriber.js.map +1 -0
  48. package/build/cjs/orchestrion/channels.js +13 -1
  49. package/build/cjs/orchestrion/channels.js.map +1 -1
  50. package/build/cjs/orchestrion/config/amqplib.js +81 -0
  51. package/build/cjs/orchestrion/config/amqplib.js.map +1 -0
  52. package/build/cjs/orchestrion/config/express.js +76 -0
  53. package/build/cjs/orchestrion/config/express.js.map +1 -0
  54. package/build/cjs/orchestrion/config/google-genai.js +38 -0
  55. package/build/cjs/orchestrion/config/google-genai.js.map +1 -0
  56. package/build/cjs/orchestrion/config/graphql.js +28 -0
  57. package/build/cjs/orchestrion/config/graphql.js.map +1 -0
  58. package/build/cjs/orchestrion/config/index.js +15 -2
  59. package/build/cjs/orchestrion/config/index.js.map +1 -1
  60. package/build/cjs/orchestrion/config/postgres.js +50 -0
  61. package/build/cjs/orchestrion/config/postgres.js.map +1 -0
  62. package/build/cjs/orchestrion/config/redis.js +76 -0
  63. package/build/cjs/orchestrion/config/redis.js.map +1 -0
  64. package/build/cjs/orchestrion/config/vercel-ai.js +18 -14
  65. package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -1
  66. package/build/cjs/orchestrion/index.js +18 -1
  67. package/build/cjs/orchestrion/index.js.map +1 -1
  68. package/build/cjs/redis/index.js +23 -0
  69. package/build/cjs/redis/index.js.map +1 -0
  70. package/build/cjs/redis/redis-dc-subscriber.js +23 -35
  71. package/build/cjs/redis/redis-dc-subscriber.js.map +1 -1
  72. package/build/cjs/tracing-channel.js +7 -6
  73. package/build/cjs/tracing-channel.js.map +1 -1
  74. package/build/cjs/vercel-ai/util.js +123 -0
  75. package/build/cjs/vercel-ai/util.js.map +1 -0
  76. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js +138 -74
  77. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  78. package/build/cjs/vercel-ai/{vercel-ai-orchestrion-v6-subscriber.js → vercel-ai-orchestrion-subscriber.js} +153 -23
  79. package/build/cjs/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -0
  80. package/build/esm/graphql/graphql-dc-subscriber.js +118 -0
  81. package/build/esm/graphql/graphql-dc-subscriber.js.map +1 -0
  82. package/build/esm/graphql/index.js +21 -0
  83. package/build/esm/graphql/index.js.map +1 -0
  84. package/build/esm/graphql/utils.js +81 -0
  85. package/build/esm/graphql/utils.js.map +1 -0
  86. package/build/esm/index.js +3 -1
  87. package/build/esm/index.js.map +1 -1
  88. package/build/esm/integrations/tracing-channel/amqplib.js +418 -0
  89. package/build/esm/integrations/tracing-channel/amqplib.js.map +1 -0
  90. package/build/esm/integrations/tracing-channel/anthropic.js +1 -1
  91. package/build/esm/integrations/tracing-channel/express/index.js +22 -0
  92. package/build/esm/integrations/tracing-channel/express/index.js.map +1 -0
  93. package/build/esm/integrations/tracing-channel/express/instrumentation.js +171 -0
  94. package/build/esm/integrations/tracing-channel/express/instrumentation.js.map +1 -0
  95. package/build/esm/integrations/tracing-channel/express/route.js +68 -0
  96. package/build/esm/integrations/tracing-channel/express/route.js.map +1 -0
  97. package/build/esm/integrations/tracing-channel/fastify/instrumentation.js +2 -2
  98. package/build/esm/integrations/tracing-channel/fastify/instrumentation.js.map +1 -1
  99. package/build/esm/integrations/tracing-channel/google-genai.js +94 -0
  100. package/build/esm/integrations/tracing-channel/google-genai.js.map +1 -0
  101. package/build/esm/integrations/tracing-channel/graphql/constants.js +14 -0
  102. package/build/esm/integrations/tracing-channel/graphql/constants.js.map +1 -0
  103. package/build/esm/integrations/tracing-channel/graphql/index.js +63 -0
  104. package/build/esm/integrations/tracing-channel/graphql/index.js.map +1 -0
  105. package/build/esm/integrations/tracing-channel/graphql/resolvers.js +164 -0
  106. package/build/esm/integrations/tracing-channel/graphql/resolvers.js.map +1 -0
  107. package/build/esm/integrations/tracing-channel/graphql/spans.js +96 -0
  108. package/build/esm/integrations/tracing-channel/graphql/spans.js.map +1 -0
  109. package/build/esm/integrations/tracing-channel/ioredis.js +15 -15
  110. package/build/esm/integrations/tracing-channel/ioredis.js.map +1 -1
  111. package/build/esm/integrations/tracing-channel/mysql.js +2 -2
  112. package/build/esm/integrations/tracing-channel/mysql.js.map +1 -1
  113. package/build/esm/integrations/tracing-channel/openai.js +1 -1
  114. package/build/esm/integrations/tracing-channel/openai.js.map +1 -1
  115. package/build/esm/integrations/tracing-channel/postgres-js.js +189 -0
  116. package/build/esm/integrations/tracing-channel/postgres-js.js.map +1 -0
  117. package/build/esm/integrations/tracing-channel/postgres.js +6 -6
  118. package/build/esm/integrations/tracing-channel/postgres.js.map +1 -1
  119. package/build/esm/integrations/tracing-channel/redis.js +225 -0
  120. package/build/esm/integrations/tracing-channel/redis.js.map +1 -0
  121. package/build/esm/integrations/tracing-channel/vercel-ai.js +1 -1
  122. package/build/esm/integrations/tracing-channel/vercel-ai.js.map +1 -1
  123. package/build/esm/mongoose/mongoose-dc-subscriber.js +2 -2
  124. package/build/esm/mongoose/mongoose-dc-subscriber.js.map +1 -1
  125. package/build/esm/mysql2/index.js +21 -0
  126. package/build/esm/mysql2/index.js.map +1 -0
  127. package/build/esm/mysql2/mysql2-dc-subscriber.js +62 -0
  128. package/build/esm/mysql2/mysql2-dc-subscriber.js.map +1 -0
  129. package/build/esm/orchestrion/channels.js +13 -1
  130. package/build/esm/orchestrion/channels.js.map +1 -1
  131. package/build/esm/orchestrion/config/amqplib.js +78 -0
  132. package/build/esm/orchestrion/config/amqplib.js.map +1 -0
  133. package/build/esm/orchestrion/config/express.js +73 -0
  134. package/build/esm/orchestrion/config/express.js.map +1 -0
  135. package/build/esm/orchestrion/config/google-genai.js +35 -0
  136. package/build/esm/orchestrion/config/google-genai.js.map +1 -0
  137. package/build/esm/orchestrion/config/graphql.js +25 -0
  138. package/build/esm/orchestrion/config/graphql.js.map +1 -0
  139. package/build/esm/orchestrion/config/index.js +15 -2
  140. package/build/esm/orchestrion/config/index.js.map +1 -1
  141. package/build/esm/orchestrion/config/postgres.js +47 -0
  142. package/build/esm/orchestrion/config/postgres.js.map +1 -0
  143. package/build/esm/orchestrion/config/redis.js +73 -0
  144. package/build/esm/orchestrion/config/redis.js.map +1 -0
  145. package/build/esm/orchestrion/config/vercel-ai.js +18 -14
  146. package/build/esm/orchestrion/config/vercel-ai.js.map +1 -1
  147. package/build/esm/orchestrion/index.js +14 -2
  148. package/build/esm/orchestrion/index.js.map +1 -1
  149. package/build/esm/package.json +1 -1
  150. package/build/esm/redis/index.js +21 -0
  151. package/build/esm/redis/index.js.map +1 -0
  152. package/build/esm/redis/redis-dc-subscriber.js +24 -36
  153. package/build/esm/redis/redis-dc-subscriber.js.map +1 -1
  154. package/build/esm/tracing-channel.js +8 -7
  155. package/build/esm/tracing-channel.js.map +1 -1
  156. package/build/esm/vercel-ai/util.js +116 -0
  157. package/build/esm/vercel-ai/util.js.map +1 -0
  158. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js +112 -50
  159. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  160. package/build/esm/vercel-ai/{vercel-ai-orchestrion-v6-subscriber.js → vercel-ai-orchestrion-subscriber.js} +153 -23
  161. package/build/esm/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -0
  162. package/build/types/graphql/graphql-dc-subscriber.d.ts +94 -0
  163. package/build/types/graphql/graphql-dc-subscriber.d.ts.map +1 -0
  164. package/build/types/graphql/index.d.ts +12 -0
  165. package/build/types/graphql/index.d.ts.map +1 -0
  166. package/build/types/graphql/utils.d.ts +40 -0
  167. package/build/types/graphql/utils.d.ts.map +1 -0
  168. package/build/types/index.d.ts +4 -2
  169. package/build/types/index.d.ts.map +1 -1
  170. package/build/types/integrations/tracing-channel/amqplib.d.ts +11 -0
  171. package/build/types/integrations/tracing-channel/amqplib.d.ts.map +1 -0
  172. package/build/types/integrations/tracing-channel/express/index.d.ts +18 -0
  173. package/build/types/integrations/tracing-channel/express/index.d.ts.map +1 -0
  174. package/build/types/integrations/tracing-channel/express/instrumentation.d.ts +4 -0
  175. package/build/types/integrations/tracing-channel/express/instrumentation.d.ts.map +1 -0
  176. package/build/types/integrations/tracing-channel/express/route.d.ts +28 -0
  177. package/build/types/integrations/tracing-channel/express/route.d.ts.map +1 -0
  178. package/build/types/integrations/tracing-channel/express/types.d.ts +64 -0
  179. package/build/types/integrations/tracing-channel/express/types.d.ts.map +1 -0
  180. package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts.map +1 -1
  181. package/build/types/integrations/tracing-channel/google-genai.d.ts +12 -0
  182. package/build/types/integrations/tracing-channel/google-genai.d.ts.map +1 -0
  183. package/build/types/integrations/tracing-channel/graphql/constants.d.ts +12 -0
  184. package/build/types/integrations/tracing-channel/graphql/constants.d.ts.map +1 -0
  185. package/build/types/integrations/tracing-channel/graphql/graphql-types.d.ts +135 -0
  186. package/build/types/integrations/tracing-channel/graphql/graphql-types.d.ts.map +1 -0
  187. package/build/types/integrations/tracing-channel/graphql/index.d.ts +28 -0
  188. package/build/types/integrations/tracing-channel/graphql/index.d.ts.map +1 -0
  189. package/build/types/integrations/tracing-channel/graphql/resolvers.d.ts +13 -0
  190. package/build/types/integrations/tracing-channel/graphql/resolvers.d.ts.map +1 -0
  191. package/build/types/integrations/tracing-channel/graphql/spans.d.ts +17 -0
  192. package/build/types/integrations/tracing-channel/graphql/spans.d.ts.map +1 -0
  193. package/build/types/integrations/tracing-channel/graphql/types.d.ts +25 -0
  194. package/build/types/integrations/tracing-channel/graphql/types.d.ts.map +1 -0
  195. package/build/types/integrations/tracing-channel/ioredis.d.ts.map +1 -1
  196. package/build/types/integrations/tracing-channel/mysql.d.ts.map +1 -1
  197. package/build/types/integrations/tracing-channel/openai.d.ts.map +1 -1
  198. package/build/types/integrations/tracing-channel/postgres-js.d.ts +26 -0
  199. package/build/types/integrations/tracing-channel/postgres-js.d.ts.map +1 -0
  200. package/build/types/integrations/tracing-channel/postgres.d.ts.map +1 -1
  201. package/build/types/integrations/tracing-channel/redis.d.ts +16 -0
  202. package/build/types/integrations/tracing-channel/redis.d.ts.map +1 -0
  203. package/build/types/integrations/tracing-channel/vercel-ai.d.ts +1 -1
  204. package/build/types/mongoose/mongoose-dc-subscriber.d.ts.map +1 -1
  205. package/build/types/mysql2/index.d.ts +11 -0
  206. package/build/types/mysql2/index.d.ts.map +1 -0
  207. package/build/types/mysql2/mysql2-dc-subscriber.d.ts +59 -0
  208. package/build/types/mysql2/mysql2-dc-subscriber.d.ts.map +1 -0
  209. package/build/types/orchestrion/channels.d.ts +34 -0
  210. package/build/types/orchestrion/channels.d.ts.map +1 -1
  211. package/build/types/orchestrion/config/amqplib.d.ts +66 -0
  212. package/build/types/orchestrion/config/amqplib.d.ts.map +1 -0
  213. package/build/types/orchestrion/config/express.d.ts +32 -0
  214. package/build/types/orchestrion/config/express.d.ts.map +1 -0
  215. package/build/types/orchestrion/config/google-genai.d.ts +30 -0
  216. package/build/types/orchestrion/config/google-genai.d.ts.map +1 -0
  217. package/build/types/orchestrion/config/graphql.d.ts +29 -0
  218. package/build/types/orchestrion/config/graphql.d.ts.map +1 -0
  219. package/build/types/orchestrion/config/index.d.ts.map +1 -1
  220. package/build/types/orchestrion/config/postgres.d.ts +9 -0
  221. package/build/types/orchestrion/config/postgres.d.ts.map +1 -0
  222. package/build/types/orchestrion/config/redis.d.ts +37 -0
  223. package/build/types/orchestrion/config/redis.d.ts.map +1 -0
  224. package/build/types/orchestrion/config/vercel-ai.d.ts +1 -0
  225. package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -1
  226. package/build/types/orchestrion/index.d.ts +31 -4
  227. package/build/types/orchestrion/index.d.ts.map +1 -1
  228. package/build/types/redis/index.d.ts +18 -0
  229. package/build/types/redis/index.d.ts.map +1 -0
  230. package/build/types/redis/redis-dc-subscriber.d.ts +0 -5
  231. package/build/types/redis/redis-dc-subscriber.d.ts.map +1 -1
  232. package/build/types/tracing-channel.d.ts +5 -0
  233. package/build/types/tracing-channel.d.ts.map +1 -1
  234. package/build/types/vercel-ai/util.d.ts +32 -0
  235. package/build/types/vercel-ai/util.d.ts.map +1 -0
  236. package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts +6 -2
  237. package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -1
  238. package/build/types/vercel-ai/{vercel-ai-orchestrion-v6-subscriber.d.ts → vercel-ai-orchestrion-subscriber.d.ts} +1 -1
  239. package/build/types/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts.map +1 -0
  240. package/build/types-ts3.8/graphql/graphql-dc-subscriber.d.ts +94 -0
  241. package/build/types-ts3.8/graphql/index.d.ts +12 -0
  242. package/build/types-ts3.8/graphql/utils.d.ts +40 -0
  243. package/build/types-ts3.8/index.d.ts +4 -2
  244. package/build/types-ts3.8/integrations/tracing-channel/amqplib.d.ts +11 -0
  245. package/build/types-ts3.8/integrations/tracing-channel/express/index.d.ts +18 -0
  246. package/build/types-ts3.8/integrations/tracing-channel/express/instrumentation.d.ts +4 -0
  247. package/build/types-ts3.8/integrations/tracing-channel/express/route.d.ts +28 -0
  248. package/build/types-ts3.8/integrations/tracing-channel/express/types.d.ts +64 -0
  249. package/build/types-ts3.8/integrations/tracing-channel/google-genai.d.ts +12 -0
  250. package/build/types-ts3.8/integrations/tracing-channel/graphql/constants.d.ts +12 -0
  251. package/build/types-ts3.8/integrations/tracing-channel/graphql/graphql-types.d.ts +135 -0
  252. package/build/types-ts3.8/integrations/tracing-channel/graphql/index.d.ts +30 -0
  253. package/build/types-ts3.8/integrations/tracing-channel/graphql/resolvers.d.ts +13 -0
  254. package/build/types-ts3.8/integrations/tracing-channel/graphql/spans.d.ts +17 -0
  255. package/build/types-ts3.8/integrations/tracing-channel/graphql/types.d.ts +25 -0
  256. package/build/types-ts3.8/integrations/tracing-channel/postgres-js.d.ts +26 -0
  257. package/build/types-ts3.8/integrations/tracing-channel/redis.d.ts +16 -0
  258. package/build/types-ts3.8/integrations/tracing-channel/vercel-ai.d.ts +1 -1
  259. package/build/types-ts3.8/mysql2/index.d.ts +11 -0
  260. package/build/types-ts3.8/mysql2/mysql2-dc-subscriber.d.ts +59 -0
  261. package/build/types-ts3.8/orchestrion/channels.d.ts +34 -0
  262. package/build/types-ts3.8/orchestrion/config/amqplib.d.ts +66 -0
  263. package/build/types-ts3.8/orchestrion/config/express.d.ts +32 -0
  264. package/build/types-ts3.8/orchestrion/config/google-genai.d.ts +30 -0
  265. package/build/types-ts3.8/orchestrion/config/graphql.d.ts +29 -0
  266. package/build/types-ts3.8/orchestrion/config/postgres.d.ts +9 -0
  267. package/build/types-ts3.8/orchestrion/config/redis.d.ts +37 -0
  268. package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +1 -0
  269. package/build/types-ts3.8/orchestrion/index.d.ts +33 -4
  270. package/build/types-ts3.8/redis/index.d.ts +18 -0
  271. package/build/types-ts3.8/redis/redis-dc-subscriber.d.ts +0 -5
  272. package/build/types-ts3.8/tracing-channel.d.ts +5 -0
  273. package/build/types-ts3.8/vercel-ai/util.d.ts +32 -0
  274. package/build/types-ts3.8/vercel-ai/vercel-ai-dc-subscriber.d.ts +6 -2
  275. package/build/types-ts3.8/vercel-ai/{vercel-ai-orchestrion-v6-subscriber.d.ts → vercel-ai-orchestrion-subscriber.d.ts} +1 -1
  276. package/package.json +2 -2
  277. package/build/cjs/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js.map +0 -1
  278. package/build/esm/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js.map +0 -1
  279. package/build/types/vercel-ai/vercel-ai-orchestrion-v6-subscriber.d.ts.map +0 -1
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
3
  const core = require('@sentry/core');
4
4
  const index = require('../../vercel-ai/index.js');
5
5
  const diagnosticsChannel = require('node:diagnostics_channel');
6
- const vercelAiOrchestrionV6Subscriber = require('../../vercel-ai/vercel-ai-orchestrion-v6-subscriber.js');
6
+ const vercelAiOrchestrionSubscriber = require('../../vercel-ai/vercel-ai-orchestrion-subscriber.js');
7
7
 
8
8
  const _vercelAiChannelIntegration = ((options = {}) => {
9
9
  const parentIntegration = index.vercelAiIntegration(options);
@@ -14,7 +14,7 @@ const _vercelAiChannelIntegration = ((options = {}) => {
14
14
  return;
15
15
  }
16
16
  core.waitForTracingChannelBinding(() => {
17
- vercelAiOrchestrionV6Subscriber.subscribeVercelAiOrchestrionChannels(diagnosticsChannel.tracingChannel, options);
17
+ vercelAiOrchestrionSubscriber.subscribeVercelAiOrchestrionChannels(diagnosticsChannel.tracingChannel, options);
18
18
  });
19
19
  }
20
20
  });
@@ -1 +1 @@
1
- {"version":3,"file":"vercel-ai.js","sources":["../../../../src/integrations/tracing-channel/vercel-ai.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration, waitForTracingChannelBinding } from '@sentry/core';\nimport { vercelAiIntegration as baseVercelAiIntegration } from '../../vercel-ai';\nimport * as dc from 'node:diagnostics_channel';\nimport { subscribeVercelAiOrchestrionChannels } from '../../vercel-ai/vercel-ai-orchestrion-v6-subscriber';\n\ntype VercelAiOptions = Parameters<typeof baseVercelAiIntegration>[0];\n\n// In channel-based (orchestrion) mode we emit our own `gen_ai.*` spans from the\n// diagnostics channels. The `ai` SDK would otherwise emit its own native\n// OpenTelemetry spans whenever the user enables `experimental_telemetry`, which\n// would be duplicates. Rather than dropping those after the fact, the v6\n// subscriber suppresses them at the source: it flips the wrapped call's\n// `experimental_telemetry.isEnabled` to `false`, so `ai` falls back to its\n// internal no-op tracer and never creates the native spans in the first place.\n// See `subscribeVercelAiOrchestrionChannels`.\nconst _vercelAiChannelIntegration = ((options: VercelAiOptions = {}) => {\n const parentIntegration = baseVercelAiIntegration(options);\n\n return extendIntegration(parentIntegration, {\n options,\n setupOnce() {\n // Bail if this is not available\n if (!dc.tracingChannel) {\n return;\n }\n\n waitForTracingChannelBinding(() => {\n subscribeVercelAiOrchestrionChannels(dc.tracingChannel, options);\n });\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Auto-instrument the `ai` SDK. Supported are:\n * - v7 via native `ai:telemetry` tracing channel\n * - v6 via orchestrion `orchestrion:ai:*` channels\n */\nexport const vercelAiChannelIntegration = defineIntegration(_vercelAiChannelIntegration);\n"],"names":["baseVercelAiIntegration","extendIntegration","dc","waitForTracingChannelBinding","subscribeVercelAiOrchestrionChannels","defineIntegration"],"mappings":";;;;;;;AAgBA,MAAM,2BAAA,IAA+B,CAAC,OAAA,GAA2B,EAAC,KAAM;AACtE,EAAA,MAAM,iBAAA,GAAoBA,0BAAwB,OAAO,CAAA;AAEzD,EAAA,OAAOC,uBAAkB,iBAAA,EAAmB;AAAA,IAC1C,OAAA;AAAA,IACA,SAAA,GAAY;AAEV,MAAA,IAAI,CAACC,mBAAG,cAAA,EAAgB;AACtB,QAAA;AAAA,MACF;AAEA,MAAAC,iCAAA,CAA6B,MAAM;AACjC,QAAAC,oEAAA,CAAqCF,kBAAA,CAAG,gBAAgB,OAAO,CAAA;AAAA,MACjE,CAAC,CAAA;AAAA,IACH;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAOO,MAAM,0BAAA,GAA6BG,uBAAkB,2BAA2B;;;;"}
1
+ {"version":3,"file":"vercel-ai.js","sources":["../../../../src/integrations/tracing-channel/vercel-ai.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, extendIntegration, waitForTracingChannelBinding } from '@sentry/core';\nimport { vercelAiIntegration as baseVercelAiIntegration } from '../../vercel-ai';\nimport * as dc from 'node:diagnostics_channel';\nimport { subscribeVercelAiOrchestrionChannels } from '../../vercel-ai/vercel-ai-orchestrion-subscriber';\n\ntype VercelAiOptions = Parameters<typeof baseVercelAiIntegration>[0];\n\n// In channel-based (orchestrion) mode we emit our own `gen_ai.*` spans from the\n// diagnostics channels. The `ai` SDK would otherwise emit its own native\n// OpenTelemetry spans whenever the user enables `experimental_telemetry`, which\n// would be duplicates. Rather than dropping those after the fact, the v6\n// subscriber suppresses them at the source: it flips the wrapped call's\n// `experimental_telemetry.isEnabled` to `false`, so `ai` falls back to its\n// internal no-op tracer and never creates the native spans in the first place.\n// See `subscribeVercelAiOrchestrionChannels`.\nconst _vercelAiChannelIntegration = ((options: VercelAiOptions = {}) => {\n const parentIntegration = baseVercelAiIntegration(options);\n\n return extendIntegration(parentIntegration, {\n options,\n setupOnce() {\n // Bail if this is not available\n if (!dc.tracingChannel) {\n return;\n }\n\n waitForTracingChannelBinding(() => {\n subscribeVercelAiOrchestrionChannels(dc.tracingChannel, options);\n });\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Auto-instrument the `ai` SDK. Supported are:\n * - v7 via native `ai:telemetry` tracing channel\n * - v4, v5 & v6 via orchestrion `orchestrion:ai:*` channels\n */\nexport const vercelAiChannelIntegration = defineIntegration(_vercelAiChannelIntegration);\n"],"names":["baseVercelAiIntegration","extendIntegration","dc","waitForTracingChannelBinding","subscribeVercelAiOrchestrionChannels","defineIntegration"],"mappings":";;;;;;;AAgBA,MAAM,2BAAA,IAA+B,CAAC,OAAA,GAA2B,EAAC,KAAM;AACtE,EAAA,MAAM,iBAAA,GAAoBA,0BAAwB,OAAO,CAAA;AAEzD,EAAA,OAAOC,uBAAkB,iBAAA,EAAmB;AAAA,IAC1C,OAAA;AAAA,IACA,SAAA,GAAY;AAEV,MAAA,IAAI,CAACC,mBAAG,cAAA,EAAgB;AACtB,QAAA;AAAA,MACF;AAEA,MAAAC,iCAAA,CAA6B,MAAM;AACjC,QAAAC,kEAAA,CAAqCF,kBAAA,CAAG,gBAAgB,OAAO,CAAA;AAAA,MACjE,CAAC,CAAA;AAAA,IACH;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAOO,MAAM,0BAAA,GAA6BG,uBAAkB,2BAA2B;;;;"}
@@ -77,7 +77,7 @@ function redactValue(value, depth) {
77
77
  if (Array.isArray(value)) {
78
78
  return value.map((item) => redactValue(item, depth + 1));
79
79
  }
80
- if (value && typeof value === "object") {
80
+ if (core.isObjectLike(value)) {
81
81
  const out = {};
82
82
  for (const key of Object.keys(value)) {
83
83
  out[key] = redactValue(value[key], depth + 1);
@@ -1 +1 @@
1
- {"version":3,"file":"mongoose-dc-subscriber.js","sources":["../../../src/mongoose/mongoose-dc-subscriber.ts"],"sourcesContent":["import type { TracingChannel } from 'node:diagnostics_channel';\nimport {\n DB_COLLECTION_NAME,\n DB_NAMESPACE,\n DB_OPERATION_BATCH_SIZE,\n DB_OPERATION_NAME,\n DB_QUERY_TEXT,\n DB_SYSTEM_NAME,\n SERVER_ADDRESS,\n SERVER_PORT,\n} from '@sentry/conventions/attributes';\nimport { debug, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, startInactiveSpan } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { bindTracingChannelToSpan } from '../tracing-channel';\n\n// Channel names published by mongoose >= 9.7.0 (see mongoose `lib/tracing.js`,\n// `lib/query.js`, `lib/aggregate.js`, `lib/model.js` and `lib/cursor/*`).\n// Hardcoded so the subscriber does not have to import mongoose — the channels\n// just have to be subscribed to before the user's mongoose code publishes.\nexport const MONGOOSE_DC_CHANNEL_QUERY = 'mongoose:query';\nexport const MONGOOSE_DC_CHANNEL_AGGREGATE = 'mongoose:aggregate';\nexport const MONGOOSE_DC_CHANNEL_MODEL_SAVE = 'mongoose:model:save';\nexport const MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY = 'mongoose:model:insertMany';\nexport const MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE = 'mongoose:model:bulkWrite';\nexport const MONGOOSE_DC_CHANNEL_CURSOR_NEXT = 'mongoose:cursor:next';\n\nconst ORIGIN = 'auto.db.mongoose.diagnostic_channel';\nconst DB_SYSTEM_NAME_VALUE_MONGODB = 'mongodb';\n\n// Cap recursion so a self-referential or pathologically deep query can never\n// stall (or blow the stack in) instrumentation.\nconst MAX_REDACTION_DEPTH = 10;\n\n/**\n * Shape of the context object mongoose >= 9.7.0 publishes on its tracing\n * channels (mongoose's `TracingContext`, see `types/tracing.d.ts`).\n *\n * Node's `tracePromise` mutates this same object with `result`/`error` once the\n * operation settles, which `bindTracingChannelToSpan` reads in its lifecycle\n * handlers — hence both are declared optional here.\n *\n * Unlike redis/ioredis, mongoose does NOT pre-sanitize the payload, so `args`\n * carries the raw user query. We redact it before emitting `db.query.text`.\n */\nexport interface MongooseTracingData {\n operation: string;\n /** Absent for connection-level `aggregate()` calls, which have no model/collection. */\n collection?: string;\n database?: string;\n serverAddress?: string;\n serverPort?: number;\n /** Cursor channels only: the cursor's fetch batch size and tailable flag. */\n batchSize?: number;\n tailable?: boolean;\n /**\n * Operation-specific arguments. `filter` (queries/cursors) and `pipeline`\n * (aggregations) carry the query shape; `docs`/`ops` carry batch payloads.\n */\n args?: {\n filter?: unknown;\n pipeline?: unknown;\n docs?: unknown;\n ops?: unknown;\n [key: string]: unknown;\n };\n result?: unknown;\n error?: Error;\n}\n\n/**\n * Platform-provided factory that creates a native tracing channel for the given name. The\n * subscriber binds the span and its lifecycle onto the channel via `bindTracingChannelToSpan`,\n * which propagates the active span through the runtime's async context.\n *\n * Node passes `node:diagnostics_channel`'s `tracingChannel` directly.\n */\nexport type MongooseTracingChannelFactory = <T extends object>(name: string) => TracingChannel<T, T>;\n\nlet subscribed = false;\n\n/**\n * Subscribe Sentry span handlers to mongoose's diagnostics-channel events\n * (`mongoose:query`, `:aggregate`, `:model:save`, `:model:insertMany`,\n * `:model:bulkWrite`, `:cursor:next`), published by mongoose >= 9.7.0.\n *\n * On older mongoose versions the channels are never published to, so the\n * subscribers are inert — there is no double-instrumentation against the\n * IITM-based vendored patcher, which is gated to `< 9.7.0`.\n *\n * Idempotent: subsequent calls are a no-op.\n */\nexport function subscribeMongooseDiagnosticChannels(tracingChannel: MongooseTracingChannelFactory): void {\n if (subscribed) {\n return;\n }\n subscribed = true;\n\n try {\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_QUERY);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_AGGREGATE);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_SAVE);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_CURSOR_NEXT);\n } catch {\n // The factory relies on `node:diagnostics_channel`, which isn't always\n // available. Fail closed; the SDK simply won't emit mongoose spans here.\n DEBUG_BUILD && debug.log('Mongoose node:diagnostics_channel subscription failed.');\n }\n}\n\nfunction setupChannel(tracingChannel: MongooseTracingChannelFactory, channelName: string): void {\n bindTracingChannelToSpan(tracingChannel<MongooseTracingData>(channelName), data => {\n const collection = data.collection;\n const queryText = redactMongoQuery(data.args?.pipeline ?? data.args?.filter);\n const batchSize = getBatchSize(data);\n\n return startInactiveSpan({\n name: collection ? `mongoose.${collection}.${data.operation}` : `mongoose.${data.operation}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n [DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_MONGODB,\n [DB_OPERATION_NAME]: data.operation,\n [DB_COLLECTION_NAME]: collection ?? undefined,\n [DB_NAMESPACE]: data.database ?? undefined,\n [DB_QUERY_TEXT]: queryText ?? undefined,\n [DB_OPERATION_BATCH_SIZE]: batchSize ?? undefined,\n [SERVER_ADDRESS]: data.serverAddress ?? undefined,\n [SERVER_PORT]: data.serverPort ?? undefined,\n },\n });\n });\n}\n\n/**\n * `db.operation.batch.size` is only meaningful for genuine batch operations.\n * Mongoose's cursor `batchSize` is a fetch-tuning option, not a batch operation\n * size, so it is intentionally excluded here.\n */\nfunction getBatchSize(data: MongooseTracingData): number | undefined {\n const args = data.args;\n const batch = data.operation === 'insertMany' ? args?.docs : data.operation === 'bulkWrite' ? args?.ops : undefined;\n\n return Array.isArray(batch) && batch.length > 1 ? batch.length : undefined;\n}\n\n/**\n * Serialize a mongoose filter/pipeline into `db.query.text` while stripping every\n * value: keys and Mongo operators (`$gt`, `$in`, …) are preserved, leaf values\n * become `'?'`. Mongoose does not sanitize its channel payload, so this prevents\n * raw user data (potential PII) from leaving the process. Returns `undefined`\n * (rather than throwing) on anything it cannot serialize.\n */\nfunction redactMongoQuery(value: unknown): string | undefined {\n if (value == null) {\n return undefined;\n }\n\n try {\n const redacted = redactValue(value, 0);\n const text = JSON.stringify(redacted);\n\n // Skip empty/uninformative shapes (e.g. a `findOne()` with no filter).\n return text == null || text === '{}' || text === '[]' ? undefined : text;\n } catch {\n return undefined;\n }\n}\n\nfunction redactValue(value: unknown, depth: number): unknown {\n if (depth > MAX_REDACTION_DEPTH) {\n return '?';\n }\n\n if (Array.isArray(value)) {\n return value.map(item => redactValue(item, depth + 1));\n }\n\n if (value && typeof value === 'object') {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(value as Record<string, unknown>)) {\n out[key] = redactValue((value as Record<string, unknown>)[key], depth + 1);\n }\n\n return out;\n }\n\n return '?';\n}\n"],"names":["DEBUG_BUILD","debug","tracingChannel","bindTracingChannelToSpan","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_OP","DB_SYSTEM_NAME","DB_OPERATION_NAME","DB_COLLECTION_NAME","DB_NAMESPACE","DB_QUERY_TEXT","DB_OPERATION_BATCH_SIZE","SERVER_ADDRESS","SERVER_PORT"],"mappings":";;;;;;;AAmBO,MAAM,yBAAA,GAA4B;AAClC,MAAM,6BAAA,GAAgC;AACtC,MAAM,8BAAA,GAAiC;AACvC,MAAM,qCAAA,GAAwC;AAC9C,MAAM,oCAAA,GAAuC;AAC7C,MAAM,+BAAA,GAAkC;AAE/C,MAAM,MAAA,GAAS,qCAAA;AACf,MAAM,4BAAA,GAA+B,SAAA;AAIrC,MAAM,mBAAA,GAAsB,EAAA;AA+C5B,IAAI,UAAA,GAAa,KAAA;AAaV,SAAS,oCAAoC,cAAA,EAAqD;AACvG,EAAA,IAAI,UAAA,EAAY;AACd,IAAA;AAAA,EACF;AACA,EAAA,UAAA,GAAa,IAAA;AAEb,EAAA,IAAI;AACF,IAAA,YAAA,CAAa,gBAAgB,yBAAyB,CAAA;AACtD,IAAA,YAAA,CAAa,gBAAgB,6BAA6B,CAAA;AAC1D,IAAA,YAAA,CAAa,gBAAgB,8BAA8B,CAAA;AAC3D,IAAA,YAAA,CAAa,gBAAgB,qCAAqC,CAAA;AAClE,IAAA,YAAA,CAAa,gBAAgB,oCAAoC,CAAA;AACjE,IAAA,YAAA,CAAa,gBAAgB,+BAA+B,CAAA;AAAA,EAC9D,CAAA,CAAA,MAAQ;AAG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AAG,CAAA,EAAG,QAAQ,CAAC,CAAA;AAAA,IAC3E;AAEA,IAAA,OAAO,GAAA;AAAA,EACT;AAEA,EAAA,OAAO,GAAA;AACT;;;;;;;;;;"}
1
+ {"version":3,"file":"mongoose-dc-subscriber.js","sources":["../../../src/mongoose/mongoose-dc-subscriber.ts"],"sourcesContent":["import type { TracingChannel } from 'node:diagnostics_channel';\nimport {\n DB_COLLECTION_NAME,\n DB_NAMESPACE,\n DB_OPERATION_BATCH_SIZE,\n DB_OPERATION_NAME,\n DB_QUERY_TEXT,\n DB_SYSTEM_NAME,\n SERVER_ADDRESS,\n SERVER_PORT,\n} from '@sentry/conventions/attributes';\nimport {\n isObjectLike,\n debug,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n startInactiveSpan,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { bindTracingChannelToSpan } from '../tracing-channel';\n\n// Channel names published by mongoose >= 9.7.0 (see mongoose `lib/tracing.js`,\n// `lib/query.js`, `lib/aggregate.js`, `lib/model.js` and `lib/cursor/*`).\n// Hardcoded so the subscriber does not have to import mongoose — the channels\n// just have to be subscribed to before the user's mongoose code publishes.\nexport const MONGOOSE_DC_CHANNEL_QUERY = 'mongoose:query';\nexport const MONGOOSE_DC_CHANNEL_AGGREGATE = 'mongoose:aggregate';\nexport const MONGOOSE_DC_CHANNEL_MODEL_SAVE = 'mongoose:model:save';\nexport const MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY = 'mongoose:model:insertMany';\nexport const MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE = 'mongoose:model:bulkWrite';\nexport const MONGOOSE_DC_CHANNEL_CURSOR_NEXT = 'mongoose:cursor:next';\n\nconst ORIGIN = 'auto.db.mongoose.diagnostic_channel';\nconst DB_SYSTEM_NAME_VALUE_MONGODB = 'mongodb';\n\n// Cap recursion so a self-referential or pathologically deep query can never\n// stall (or blow the stack in) instrumentation.\nconst MAX_REDACTION_DEPTH = 10;\n\n/**\n * Shape of the context object mongoose >= 9.7.0 publishes on its tracing\n * channels (mongoose's `TracingContext`, see `types/tracing.d.ts`).\n *\n * Node's `tracePromise` mutates this same object with `result`/`error` once the\n * operation settles, which `bindTracingChannelToSpan` reads in its lifecycle\n * handlers — hence both are declared optional here.\n *\n * Unlike redis/ioredis, mongoose does NOT pre-sanitize the payload, so `args`\n * carries the raw user query. We redact it before emitting `db.query.text`.\n */\nexport interface MongooseTracingData {\n operation: string;\n /** Absent for connection-level `aggregate()` calls, which have no model/collection. */\n collection?: string;\n database?: string;\n serverAddress?: string;\n serverPort?: number;\n /** Cursor channels only: the cursor's fetch batch size and tailable flag. */\n batchSize?: number;\n tailable?: boolean;\n /**\n * Operation-specific arguments. `filter` (queries/cursors) and `pipeline`\n * (aggregations) carry the query shape; `docs`/`ops` carry batch payloads.\n */\n args?: {\n filter?: unknown;\n pipeline?: unknown;\n docs?: unknown;\n ops?: unknown;\n [key: string]: unknown;\n };\n result?: unknown;\n error?: Error;\n}\n\n/**\n * Platform-provided factory that creates a native tracing channel for the given name. The\n * subscriber binds the span and its lifecycle onto the channel via `bindTracingChannelToSpan`,\n * which propagates the active span through the runtime's async context.\n *\n * Node passes `node:diagnostics_channel`'s `tracingChannel` directly.\n */\nexport type MongooseTracingChannelFactory = <T extends object>(name: string) => TracingChannel<T, T>;\n\nlet subscribed = false;\n\n/**\n * Subscribe Sentry span handlers to mongoose's diagnostics-channel events\n * (`mongoose:query`, `:aggregate`, `:model:save`, `:model:insertMany`,\n * `:model:bulkWrite`, `:cursor:next`), published by mongoose >= 9.7.0.\n *\n * On older mongoose versions the channels are never published to, so the\n * subscribers are inert — there is no double-instrumentation against the\n * IITM-based vendored patcher, which is gated to `< 9.7.0`.\n *\n * Idempotent: subsequent calls are a no-op.\n */\nexport function subscribeMongooseDiagnosticChannels(tracingChannel: MongooseTracingChannelFactory): void {\n if (subscribed) {\n return;\n }\n subscribed = true;\n\n try {\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_QUERY);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_AGGREGATE);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_SAVE);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_INSERT_MANY);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_MODEL_BULK_WRITE);\n setupChannel(tracingChannel, MONGOOSE_DC_CHANNEL_CURSOR_NEXT);\n } catch {\n // The factory relies on `node:diagnostics_channel`, which isn't always\n // available. Fail closed; the SDK simply won't emit mongoose spans here.\n DEBUG_BUILD && debug.log('Mongoose node:diagnostics_channel subscription failed.');\n }\n}\n\nfunction setupChannel(tracingChannel: MongooseTracingChannelFactory, channelName: string): void {\n bindTracingChannelToSpan(tracingChannel<MongooseTracingData>(channelName), data => {\n const collection = data.collection;\n const queryText = redactMongoQuery(data.args?.pipeline ?? data.args?.filter);\n const batchSize = getBatchSize(data);\n\n return startInactiveSpan({\n name: collection ? `mongoose.${collection}.${data.operation}` : `mongoose.${data.operation}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n [DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_MONGODB,\n [DB_OPERATION_NAME]: data.operation,\n [DB_COLLECTION_NAME]: collection ?? undefined,\n [DB_NAMESPACE]: data.database ?? undefined,\n [DB_QUERY_TEXT]: queryText ?? undefined,\n [DB_OPERATION_BATCH_SIZE]: batchSize ?? undefined,\n [SERVER_ADDRESS]: data.serverAddress ?? undefined,\n [SERVER_PORT]: data.serverPort ?? undefined,\n },\n });\n });\n}\n\n/**\n * `db.operation.batch.size` is only meaningful for genuine batch operations.\n * Mongoose's cursor `batchSize` is a fetch-tuning option, not a batch operation\n * size, so it is intentionally excluded here.\n */\nfunction getBatchSize(data: MongooseTracingData): number | undefined {\n const args = data.args;\n const batch = data.operation === 'insertMany' ? args?.docs : data.operation === 'bulkWrite' ? args?.ops : undefined;\n\n return Array.isArray(batch) && batch.length > 1 ? batch.length : undefined;\n}\n\n/**\n * Serialize a mongoose filter/pipeline into `db.query.text` while stripping every\n * value: keys and Mongo operators (`$gt`, `$in`, …) are preserved, leaf values\n * become `'?'`. Mongoose does not sanitize its channel payload, so this prevents\n * raw user data (potential PII) from leaving the process. Returns `undefined`\n * (rather than throwing) on anything it cannot serialize.\n */\nfunction redactMongoQuery(value: unknown): string | undefined {\n if (value == null) {\n return undefined;\n }\n\n try {\n const redacted = redactValue(value, 0);\n const text = JSON.stringify(redacted);\n\n // Skip empty/uninformative shapes (e.g. a `findOne()` with no filter).\n return text == null || text === '{}' || text === '[]' ? undefined : text;\n } catch {\n return undefined;\n }\n}\n\nfunction redactValue(value: unknown, depth: number): unknown {\n if (depth > MAX_REDACTION_DEPTH) {\n return '?';\n }\n\n if (Array.isArray(value)) {\n return value.map(item => redactValue(item, depth + 1));\n }\n\n if (isObjectLike(value)) {\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(value as Record<string, unknown>)) {\n out[key] = redactValue((value as Record<string, unknown>)[key], depth + 1);\n }\n\n return out;\n }\n\n return '?';\n}\n"],"names":["DEBUG_BUILD","debug","tracingChannel","bindTracingChannelToSpan","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_OP","DB_SYSTEM_NAME","DB_OPERATION_NAME","DB_COLLECTION_NAME","DB_NAMESPACE","DB_QUERY_TEXT","DB_OPERATION_BATCH_SIZE","SERVER_ADDRESS","SERVER_PORT","isObjectLike"],"mappings":";;;;;;;AAyBO,MAAM,yBAAA,GAA4B;AAClC,MAAM,6BAAA,GAAgC;AACtC,MAAM,8BAAA,GAAiC;AACvC,MAAM,qCAAA,GAAwC;AAC9C,MAAM,oCAAA,GAAuC;AAC7C,MAAM,+BAAA,GAAkC;AAE/C,MAAM,MA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AA,OAAO,MAAA;AAAA,EACT;AACF;AAEA,SAAS,WAAA,CAAY,OAAgB,KAAA,EAAwB;AAC3D,EAAA,IAAI,QAAQ,mBAAA,EAAqB;AAC/B,IAAA,OAAO,GAAA;AAAA,EACT;AAEA,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,IAAA,OAAO,MAAM,GAAA,CAAI,CAAA,IAAA,KAAQ,YAAY,IAAA,EAAM,KAAA,GAAQ,CAAC,CAAC,CAAA;AAAA,EACvD;AAEA,EAAA,IAAIC,iBAAA,CAAa,KAAK,CAAA,EAAG;AACvB,IAAA,MAAM,MAA+B,EAAC;AACtC,IAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,KAAgC,CAAA,EAAG;AAC/D,MAAA,GAAA,CAAI,GAAG,CAAA,GAAI,WAAA,CAAa,MAAkC,GAAG,CAAA,EAAG,QAAQ,CAAC,CAAA;AAAA,IAC3E;AAEA,IAAA,OAAO,GAAA;AAAA,EACT;AAEA,EAAA,OAAO,GAAA;AACT;;;;;;;;;;"}
@@ -0,0 +1,23 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const core = require('@sentry/core');
4
+ const diagnosticsChannel = require('node:diagnostics_channel');
5
+ const mysql2DcSubscriber = require('./mysql2-dc-subscriber.js');
6
+
7
+ const _mysql2Integration = (() => {
8
+ return {
9
+ name: "Mysql2",
10
+ setupOnce() {
11
+ if (!diagnosticsChannel.tracingChannel) {
12
+ return;
13
+ }
14
+ core.waitForTracingChannelBinding(() => {
15
+ mysql2DcSubscriber.subscribeMysql2DiagnosticChannels(diagnosticsChannel.tracingChannel);
16
+ });
17
+ }
18
+ };
19
+ });
20
+ const mysql2Integration = core.defineIntegration(_mysql2Integration);
21
+
22
+ exports.mysql2Integration = mysql2Integration;
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/mysql2/index.ts"],"sourcesContent":["import { defineIntegration, type IntegrationFn, waitForTracingChannelBinding } from '@sentry/core';\nimport * as dc from 'node:diagnostics_channel';\nimport { subscribeMysql2DiagnosticChannels } from './mysql2-dc-subscriber';\n\nconst _mysql2Integration = (() => {\n return {\n name: 'Mysql2',\n setupOnce() {\n // Bail on Node <= 18.18.0, where `tracingChannel` does not exist.\n if (!dc.tracingChannel) {\n return;\n }\n\n // Subscribe to mysql2's native tracing channels (mysql2 >= 3.20.0).\n // This is a no-op on versions that don't publish to the channels, so it is always safe to call.\n waitForTracingChannelBinding(() => {\n subscribeMysql2DiagnosticChannels(dc.tracingChannel);\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Auto-instrument the [mysql2](https://www.npmjs.com/package/mysql2) library via its native\n * `node:diagnostics_channel` tracing channels (mysql2 >= 3.20.0).\n *\n * On older mysql2 versions the channels are never published to, so this integration is inert and\n * the vendored OTel instrumentation (gated to `< 3.20.0`) handles instrumentation instead.\n */\nexport const mysql2Integration = defineIntegration(_mysql2Integration);\n"],"names":["dc","waitForTracingChannelBinding","subscribeMysql2DiagnosticChannels","defineIntegration"],"mappings":";;;;;;AAIA,MAAM,sBAAsB,MAAM;AAChC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,QAAA;AAAA,IACN,SAAA,GAAY;AAEV,MAAA,IAAI,CAACA,mBAAG,cAAA,EAAgB;AACtB,QAAA;AAAA,MACF;AAIA,MAAAC,iCAAA,CAA6B,MAAM;AACjC,QAAAC,oDAAA,CAAkCF,mBAAG,cAAc,CAAA;AAAA,MACrD,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAA,CAAA;AASO,MAAM,iBAAA,GAAoBG,uBAAkB,kBAAkB;;;;"}
@@ -0,0 +1,68 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const attributes = require('@sentry/conventions/attributes');
4
+ const core = require('@sentry/core');
5
+ const tracingChannel = require('../tracing-channel.js');
6
+
7
+ const MYSQL2_DC_CHANNEL_QUERY = "mysql2:query";
8
+ const MYSQL2_DC_CHANNEL_EXECUTE = "mysql2:execute";
9
+ const MYSQL2_DC_CHANNEL_CONNECT = "mysql2:connect";
10
+ const MYSQL2_DC_CHANNEL_POOL_CONNECT = "mysql2:pool:connect";
11
+ const ORIGIN = "auto.db.mysql2.diagnostic_channel";
12
+ const DB_SYSTEM_NAME_VALUE_MYSQL = "mysql";
13
+ const SQL_OPERATION_RE = /^\s*(\w+)/;
14
+ function subscribeMysql2DiagnosticChannels(tracingChannel) {
15
+ setupQueryChannel(tracingChannel, MYSQL2_DC_CHANNEL_QUERY);
16
+ setupQueryChannel(tracingChannel, MYSQL2_DC_CHANNEL_EXECUTE);
17
+ setupConnectChannel(tracingChannel, MYSQL2_DC_CHANNEL_CONNECT, "mysql2.connect");
18
+ setupConnectChannel(tracingChannel, MYSQL2_DC_CHANNEL_POOL_CONNECT, "mysql2.pool.connect");
19
+ }
20
+ function setupQueryChannel(tracingChannel$1, channelName) {
21
+ tracingChannel.bindTracingChannelToSpan(
22
+ tracingChannel$1(channelName),
23
+ (data) => {
24
+ const queryText = data.query ? core._INTERNAL_sanitizeSqlQuery(data.query) : void 0;
25
+ const operation = queryText?.match(SQL_OPERATION_RE)?.[1]?.toUpperCase();
26
+ return core.startInactiveSpan({
27
+ name: queryText || "mysql2.query",
28
+ attributes: {
29
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
30
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db",
31
+ [attributes.DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_MYSQL,
32
+ [attributes.DB_QUERY_TEXT]: queryText,
33
+ [attributes.DB_OPERATION_NAME]: operation,
34
+ [attributes.DB_NAMESPACE]: data.database || void 0,
35
+ [attributes.SERVER_ADDRESS]: data.serverAddress,
36
+ [attributes.SERVER_PORT]: data.serverPort
37
+ }
38
+ });
39
+ },
40
+ { requiresParentSpan: true }
41
+ );
42
+ }
43
+ function setupConnectChannel(tracingChannel$1, channelName, spanName) {
44
+ tracingChannel.bindTracingChannelToSpan(
45
+ tracingChannel$1(channelName),
46
+ (data) => {
47
+ return core.startInactiveSpan({
48
+ name: spanName,
49
+ attributes: {
50
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
51
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db",
52
+ [attributes.DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_MYSQL,
53
+ [attributes.DB_NAMESPACE]: data.database || void 0,
54
+ [attributes.SERVER_ADDRESS]: data.serverAddress,
55
+ [attributes.SERVER_PORT]: data.serverPort
56
+ }
57
+ });
58
+ },
59
+ { requiresParentSpan: true }
60
+ );
61
+ }
62
+
63
+ exports.MYSQL2_DC_CHANNEL_CONNECT = MYSQL2_DC_CHANNEL_CONNECT;
64
+ exports.MYSQL2_DC_CHANNEL_EXECUTE = MYSQL2_DC_CHANNEL_EXECUTE;
65
+ exports.MYSQL2_DC_CHANNEL_POOL_CONNECT = MYSQL2_DC_CHANNEL_POOL_CONNECT;
66
+ exports.MYSQL2_DC_CHANNEL_QUERY = MYSQL2_DC_CHANNEL_QUERY;
67
+ exports.subscribeMysql2DiagnosticChannels = subscribeMysql2DiagnosticChannels;
68
+ //# sourceMappingURL=mysql2-dc-subscriber.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mysql2-dc-subscriber.js","sources":["../../../src/mysql2/mysql2-dc-subscriber.ts"],"sourcesContent":["import type { TracingChannel } from 'node:diagnostics_channel';\nimport {\n DB_NAMESPACE,\n DB_OPERATION_NAME,\n DB_QUERY_TEXT,\n DB_SYSTEM_NAME,\n SERVER_ADDRESS,\n SERVER_PORT,\n} from '@sentry/conventions/attributes';\nimport {\n _INTERNAL_sanitizeSqlQuery,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n startInactiveSpan,\n} from '@sentry/core';\nimport { bindTracingChannelToSpan } from '../tracing-channel';\n\n// Channel names published by mysql2 >= 3.20.0 (see mysql2 `lib/tracing.js`).\n// Hardcoded so the subscriber does not have to import mysql2 — the channels\n// just have to be subscribed to before the user's mysql2 code publishes.\nexport const MYSQL2_DC_CHANNEL_QUERY = 'mysql2:query';\nexport const MYSQL2_DC_CHANNEL_EXECUTE = 'mysql2:execute';\nexport const MYSQL2_DC_CHANNEL_CONNECT = 'mysql2:connect';\nexport const MYSQL2_DC_CHANNEL_POOL_CONNECT = 'mysql2:pool:connect';\n\nconst ORIGIN = 'auto.db.mysql2.diagnostic_channel';\nconst DB_SYSTEM_NAME_VALUE_MYSQL = 'mysql';\n\n// Leading keyword of a SQL statement (SELECT, INSERT, …) → `db.operation.name`.\nconst SQL_OPERATION_RE = /^\\s*(\\w+)/;\n\n/**\n * Shape of the context object mysql2 >= 3.20.0 publishes on its query/execute\n * tracing channels (see mysql2 `lib/base/connection.js`).\n *\n * Node's `traceCallback`/`tracePromise` mutate this same object with\n * `result`/`error` once the operation settles, which `bindTracingChannelToSpan`\n * reads in its lifecycle handlers — hence both are declared optional here.\n *\n * `query` is the SQL statement. On the `query` channel mysql2 has already\n * inlined `values` into it (`Connection.format`), so it carries raw user data;\n * on the `execute` channel it keeps `?` placeholders. Either way we sanitize it\n * before emitting `db.query.text` and never attach `values`.\n */\nexport interface MySQL2QueryData {\n query?: string;\n values?: unknown;\n database?: string;\n serverAddress?: string;\n /** Absent for unix-socket connections, where `serverAddress` is the socket path. */\n serverPort?: number;\n result?: unknown;\n error?: Error;\n}\n\n/**\n * Shape of the context object mysql2 >= 3.20.0 publishes on its\n * `connect`/`pool:connect` channels.\n */\nexport interface MySQL2ConnectData {\n database?: string;\n serverAddress?: string;\n serverPort?: number;\n user?: string;\n result?: unknown;\n error?: Error;\n}\n\n/**\n * Platform-provided factory that creates a native tracing channel for the given name. The\n * subscriber binds the span and its lifecycle onto the channel via `bindTracingChannelToSpan`,\n * which propagates the active span through the runtime's async context.\n *\n * Node passes `node:diagnostics_channel`'s `tracingChannel` directly.\n */\nexport type MySQL2TracingChannelFactory = <T extends object>(name: string) => TracingChannel<T, T>;\n\n/**\n * Subscribe Sentry span handlers to mysql2's diagnostics-channel events\n * (`mysql2:query`, `:execute`, `:connect`, `:pool:connect`), published by\n * mysql2 >= 3.20.0.\n *\n * On older mysql2 versions the channels are never published to, so the\n * subscribers are inert — there is no double-instrumentation against the\n * vendored OTel patcher, which is gated to `< 3.20.0`.\n */\nexport function subscribeMysql2DiagnosticChannels(tracingChannel: MySQL2TracingChannelFactory): void {\n setupQueryChannel(tracingChannel, MYSQL2_DC_CHANNEL_QUERY);\n setupQueryChannel(tracingChannel, MYSQL2_DC_CHANNEL_EXECUTE);\n setupConnectChannel(tracingChannel, MYSQL2_DC_CHANNEL_CONNECT, 'mysql2.connect');\n setupConnectChannel(tracingChannel, MYSQL2_DC_CHANNEL_POOL_CONNECT, 'mysql2.pool.connect');\n}\n\nfunction setupQueryChannel(tracingChannel: MySQL2TracingChannelFactory, channelName: string): void {\n bindTracingChannelToSpan(\n tracingChannel<MySQL2QueryData>(channelName),\n data => {\n // mysql2 does not sanitize its channel payload, so the statement may carry\n // raw user values (on the `query` channel they are inlined). Strip every\n // literal before it leaves the process; `values` is never attached.\n const queryText = data.query ? _INTERNAL_sanitizeSqlQuery(data.query) : undefined;\n const operation = queryText?.match(SQL_OPERATION_RE)?.[1]?.toUpperCase();\n\n return startInactiveSpan({\n name: queryText || 'mysql2.query',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n [DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_MYSQL,\n [DB_QUERY_TEXT]: queryText,\n [DB_OPERATION_NAME]: operation,\n [DB_NAMESPACE]: data.database || undefined,\n [SERVER_ADDRESS]: data.serverAddress,\n [SERVER_PORT]: data.serverPort,\n },\n });\n },\n { requiresParentSpan: true },\n );\n}\n\nfunction setupConnectChannel(tracingChannel: MySQL2TracingChannelFactory, channelName: string, spanName: string): void {\n bindTracingChannelToSpan(\n tracingChannel<MySQL2ConnectData>(channelName),\n data => {\n return startInactiveSpan({\n name: spanName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db',\n [DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_MYSQL,\n [DB_NAMESPACE]: data.database || undefined,\n [SERVER_ADDRESS]: data.serverAddress,\n [SERVER_PORT]: data.serverPort,\n },\n });\n },\n { requiresParentSpan: true },\n );\n}\n"],"names":["tracingChannel","bindTracingChannelToSpan","_INTERNAL_sanitizeSqlQuery","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_OP","DB_SYSTEM_NAME","DB_QUERY_TEXT","DB_OPERATION_NAME","DB_NAMESPACE","SERVER_ADDRESS","SERVER_PORT"],"mappings":";;;;;;AAoBO,MAAM,uBAAA,GAA0B;AAChC,MAAM,yBAAA,GAA4B;AAClC,MAAM,yBAAA,GAA4B;AAClC,MAAM,8BAAA,GAAiC;AAE9C,MAAM,MAAA,GAAS,mCAAA;AACf,MAAM,0BAAA,GAA6B,OAAA;AAGnC,MAAM,gBAAA,GAAmB,WAAA;AAyDlB,SAAS,kCAAkC,cAAA,EAAmD;AACnG,EAAA,iBAAA,CAAkB,gBAAgB,uBAAuB,CAAA;AACzD,EAAA,iBAAA,CAAkB,gBAAgB,yBAAyB,CAAA;AAC3D,EAAA,mBAAA,CAAoB,cAAA,EAAgB,2BAA2B,gBAAgB,CAAA;AAC/E,EAAA,mBAAA,CAAoB,cAAA,EAAgB,gCAAgC,qBAAqB,CAAA;AAC3F;AAEA,SAAS,iBAAA,CAAkBA,kBAA6C,WAAA,EAA2B;AACjG,EAAAC,uCAAA;AAAA,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AK,aAAA;AAAA,UACvB,CAACC,sBAAW,GAAG,IAAA,CAAK;AAAA;AACtB,OACD,CAAA;AAAA,IACH,CAAA;AAAA,IACA,EAAE,oBAAoB,IAAA;AAAK,GAC7B;AACF;;;;;;;;"}
@@ -4,20 +4,32 @@ const mysql = require('./config/mysql.js');
4
4
  const lruMemoizer = require('./config/lru-memoizer.js');
5
5
  const ioredis = require('./config/ioredis.js');
6
6
  const pg = require('./config/pg.js');
7
+ const postgres = require('./config/postgres.js');
7
8
  const openai = require('./config/openai.js');
8
9
  const anthropicAi = require('./config/anthropic-ai.js');
10
+ const googleGenai = require('./config/google-genai.js');
9
11
  const vercelAi = require('./config/vercel-ai.js');
12
+ const amqplib = require('./config/amqplib.js');
10
13
  const hapi = require('./config/hapi.js');
14
+ const redis = require('./config/redis.js');
15
+ const express = require('./config/express.js');
16
+ const graphql = require('./config/graphql.js');
11
17
 
12
18
  const CHANNELS = {
13
19
  ...mysql.mysqlChannels,
14
20
  ...lruMemoizer.lruMemoizerChannels,
15
21
  ...ioredis.ioredisChannels,
16
22
  ...pg.pgChannels,
23
+ ...postgres.postgresJsChannels,
17
24
  ...openai.openaiChannels,
18
25
  ...anthropicAi.anthropicAiChannels,
26
+ ...googleGenai.googleGenAiChannels,
19
27
  ...vercelAi.vercelAiChannels,
20
- ...hapi.hapiChannels
28
+ ...amqplib.amqplibChannels,
29
+ ...hapi.hapiChannels,
30
+ ...redis.redisChannels,
31
+ ...express.expressChannels,
32
+ ...graphql.graphqlChannels
21
33
  };
22
34
 
23
35
  exports.CHANNELS = CHANNELS;
@@ -1 +1 @@
1
- {"version":3,"file":"channels.js","sources":["../../../src/orchestrion/channels.ts"],"sourcesContent":["import { mysqlChannels } from './config/mysql';\nimport { lruMemoizerChannels } from './config/lru-memoizer';\nimport { ioredisChannels } from './config/ioredis';\nimport { pgChannels } from './config/pg';\nimport { openaiChannels } from './config/openai';\nimport { anthropicAiChannels } from './config/anthropic-ai';\nimport { vercelAiChannels } from './config/vercel-ai';\nimport { hapiChannels } from './config/hapi';\n\n/**\n * Fully-qualified `diagnostics_channel` names that orchestrion publishes to.\n *\n * Orchestrion's transform always prefixes the configured `channelName` with\n * `orchestrion:${module.name}:`. So a config of\n * `{ channelName: 'query', module: { name: 'mysql' } }`\n * publishes to `orchestrion:mysql:query`.\n *\n * Subscribers (`integrations/<lib>/tracing-channel.ts`) consume the full\n * prefixed string from this map; the config files set only the unprefixed\n * suffix in `channelName`. Keeping both pieces in one file is what guarantees\n * they don't drift apart and silently stop firing.\n */\nexport const CHANNELS = {\n ...mysqlChannels,\n ...lruMemoizerChannels,\n ...ioredisChannels,\n ...pgChannels,\n ...openaiChannels,\n ...anthropicAiChannels,\n ...vercelAiChannels,\n ...hapiChannels,\n} as const;\n\nexport type ChannelName = (typeof CHANNELS)[keyof typeof CHANNELS];\n"],"names":["mysqlChannels","lruMemoizerChannels","ioredisChannels","pgChannels","openaiChannels","anthropicAiChannels","vercelAiChannels","hapiChannels"],"mappings":";;;;;;;;;;;AAsBO,MAAM,QAAA,GAAW;AAAA,EACtB,GAAGA,mBAAA;AAAA,EACH,GAAGC,+BAAA;AAAA,EACH,GAAGC,uBAAA;AAAA,EACH,GAAGC,aAAA;AAAA,EACH,GAAGC,qBAAA;AAAA,EACH,GAAGC,+BAAA;AAAA,EACH,GAAGC,yBAAA;AAAA,EACH,GAAGC;AACL;;;;"}
1
+ {"version":3,"file":"channels.js","sources":["../../../src/orchestrion/channels.ts"],"sourcesContent":["import { mysqlChannels } from './config/mysql';\nimport { lruMemoizerChannels } from './config/lru-memoizer';\nimport { ioredisChannels } from './config/ioredis';\nimport { pgChannels } from './config/pg';\nimport { postgresJsChannels } from './config/postgres';\nimport { openaiChannels } from './config/openai';\nimport { anthropicAiChannels } from './config/anthropic-ai';\nimport { googleGenAiChannels } from './config/google-genai';\nimport { vercelAiChannels } from './config/vercel-ai';\nimport { amqplibChannels } from './config/amqplib';\nimport { hapiChannels } from './config/hapi';\nimport { redisChannels } from './config/redis';\nimport { expressChannels } from './config/express';\nimport { graphqlChannels } from './config/graphql';\n\n/**\n * Fully-qualified `diagnostics_channel` names that orchestrion publishes to.\n *\n * Orchestrion's transform always prefixes the configured `channelName` with\n * `orchestrion:${module.name}:`. So a config of\n * `{ channelName: 'query', module: { name: 'mysql' } }`\n * publishes to `orchestrion:mysql:query`.\n *\n * Subscribers (`integrations/<lib>/tracing-channel.ts`) consume the full\n * prefixed string from this map; the config files set only the unprefixed\n * suffix in `channelName`. Keeping both pieces in one file is what guarantees\n * they don't drift apart and silently stop firing.\n */\nexport const CHANNELS = {\n ...mysqlChannels,\n ...lruMemoizerChannels,\n ...ioredisChannels,\n ...pgChannels,\n ...postgresJsChannels,\n ...openaiChannels,\n ...anthropicAiChannels,\n ...googleGenAiChannels,\n ...vercelAiChannels,\n ...amqplibChannels,\n ...hapiChannels,\n ...redisChannels,\n ...expressChannels,\n ...graphqlChannels,\n} as const;\n\nexport type ChannelName = (typeof CHANNELS)[keyof typeof CHANNELS];\n"],"names":["mysqlChannels","lruMemoizerChannels","ioredisChannels","pgChannels","postgresJsChannels","openaiChannels","anthropicAiChannels","googleGenAiChannels","vercelAiChannels","amqplibChannels","hapiChannels","redisChannels","expressChannels","graphqlChannels"],"mappings":";;;;;;;;;;;;;;;;;AA4BO,MAAM,QAAA,GAAW;AAAA,EACtB,GAAGA,mBAAA;AAAA,EACH,GAAGC,+BAAA;AAAA,EACH,GAAGC,uBAAA;AAAA,EACH,GAAGC,aAAA;AAAA,EACH,GAAGC,2BAAA;AAAA,EACH,GAAGC,qBAAA;AAAA,EACH,GAAGC,+BAAA;AAAA,EACH,GAAGC,+BAAA;AAAA,EACH,GAAGC,yBAAA;AAAA,EACH,GAAGC,uBAAA;AAAA,EACH,GAAGC,iBAAA;AAAA,EACH,GAAGC,mBAAA;AAAA,EACH,GAAGC,uBAAA;AAAA,EACH,GAAGC;AACL;;;;"}
@@ -0,0 +1,81 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const module$1 = { name: "amqplib", versionRange: ">=0.5.5 <2" };
4
+ const amqplibConfig = [
5
+ // Producer span + trace-header injection. `sendToQueue` delegates to `publish`, so it's covered.
6
+ {
7
+ channelName: "publish",
8
+ module: { ...module$1, filePath: "lib/channel_model.js" },
9
+ functionQuery: { className: "Channel", methodName: "publish", kind: "Sync" }
10
+ },
11
+ // Confirm-channel producer span; the trailing broker-confirm callback ends the span when the
12
+ // broker acks/nacks. It internally calls `super.publish`, so the subscriber guards against the
13
+ // base `publish` channel double-instrumenting.
14
+ {
15
+ channelName: "confirmPublish",
16
+ module: { ...module$1, filePath: "lib/channel_model.js" },
17
+ functionQuery: { className: "ConfirmChannel", methodName: "publish", kind: "Callback" }
18
+ },
19
+ // Records `consumerTag -> { noAck, queue }` so the per-message dispatch hook knows how to name and
20
+ // when to end the consumer span.
21
+ {
22
+ channelName: "consume",
23
+ module: { ...module$1, filePath: "lib/channel_model.js" },
24
+ functionQuery: { className: "Channel", methodName: "consume", kind: "Async" }
25
+ },
26
+ // Per delivered message: creates the consumer span and runs the user callback under it.
27
+ {
28
+ channelName: "dispatch",
29
+ module: { ...module$1, filePath: "lib/channel.js" },
30
+ functionQuery: { className: "BaseChannel", methodName: "dispatchMessage", kind: "Sync" }
31
+ },
32
+ // End the consumer span when the user settles the message.
33
+ {
34
+ channelName: "ack",
35
+ module: { ...module$1, filePath: "lib/channel_model.js" },
36
+ functionQuery: { className: "Channel", methodName: "ack", kind: "Sync" }
37
+ },
38
+ {
39
+ channelName: "nack",
40
+ module: { ...module$1, filePath: "lib/channel_model.js" },
41
+ functionQuery: { className: "Channel", methodName: "nack", kind: "Sync" }
42
+ },
43
+ {
44
+ channelName: "reject",
45
+ module: { ...module$1, filePath: "lib/channel_model.js" },
46
+ functionQuery: { className: "Channel", methodName: "reject", kind: "Sync" }
47
+ },
48
+ {
49
+ channelName: "ackAll",
50
+ module: { ...module$1, filePath: "lib/channel_model.js" },
51
+ functionQuery: { className: "Channel", methodName: "ackAll", kind: "Sync" }
52
+ },
53
+ {
54
+ channelName: "nackAll",
55
+ module: { ...module$1, filePath: "lib/channel_model.js" },
56
+ functionQuery: { className: "Channel", methodName: "nackAll", kind: "Sync" }
57
+ },
58
+ // Stashes connection attributes (url/host/port/protocol/server product) on the connection object
59
+ // for span-time reads via `channel.connection`.
60
+ {
61
+ channelName: "connect",
62
+ module: { ...module$1, filePath: "lib/connect.js" },
63
+ functionQuery: { functionName: "connect", kind: "Callback" }
64
+ }
65
+ ];
66
+ const amqplibChannels = {
67
+ AMQPLIB_PUBLISH: "orchestrion:amqplib:publish",
68
+ AMQPLIB_CONFIRM_PUBLISH: "orchestrion:amqplib:confirmPublish",
69
+ AMQPLIB_CONSUME: "orchestrion:amqplib:consume",
70
+ AMQPLIB_DISPATCH: "orchestrion:amqplib:dispatch",
71
+ AMQPLIB_ACK: "orchestrion:amqplib:ack",
72
+ AMQPLIB_NACK: "orchestrion:amqplib:nack",
73
+ AMQPLIB_REJECT: "orchestrion:amqplib:reject",
74
+ AMQPLIB_ACK_ALL: "orchestrion:amqplib:ackAll",
75
+ AMQPLIB_NACK_ALL: "orchestrion:amqplib:nackAll",
76
+ AMQPLIB_CONNECT: "orchestrion:amqplib:connect"
77
+ };
78
+
79
+ exports.amqplibChannels = amqplibChannels;
80
+ exports.amqplibConfig = amqplibConfig;
81
+ //# sourceMappingURL=amqplib.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amqplib.js","sources":["../../../../src/orchestrion/config/amqplib.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\n// `amqplib` splits its API across three files:\n// - `lib/channel_model.js` holds `class Channel` (publish/consume/ack/nack/reject/…) and\n// `class ConfirmChannel extends Channel` (a `publish` that takes a broker-confirm callback).\n// - `lib/channel.js` holds `class BaseChannel` whose `dispatchMessage` invokes the registered\n// consumer callback once per delivered message — the natural per-message hook for consumer spans\n// (`Channel.consume` itself only registers the callback, it isn't called per message).\n// - `lib/connect.js` holds the `connect` function whose callback receives the open connection, used\n// to capture connection attributes.\n//\n// The version range mirrors `supportedVersions` in the vendored OTel instrumentation.\nconst module = { name: 'amqplib', versionRange: '>=0.5.5 <2' } as const;\n\nexport const amqplibConfig = [\n // Producer span + trace-header injection. `sendToQueue` delegates to `publish`, so it's covered.\n {\n channelName: 'publish',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'publish', kind: 'Sync' },\n },\n // Confirm-channel producer span; the trailing broker-confirm callback ends the span when the\n // broker acks/nacks. It internally calls `super.publish`, so the subscriber guards against the\n // base `publish` channel double-instrumenting.\n {\n channelName: 'confirmPublish',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'ConfirmChannel', methodName: 'publish', kind: 'Callback' },\n },\n // Records `consumerTag -> { noAck, queue }` so the per-message dispatch hook knows how to name and\n // when to end the consumer span.\n {\n channelName: 'consume',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'consume', kind: 'Async' },\n },\n // Per delivered message: creates the consumer span and runs the user callback under it.\n {\n channelName: 'dispatch',\n module: { ...module, filePath: 'lib/channel.js' },\n functionQuery: { className: 'BaseChannel', methodName: 'dispatchMessage', kind: 'Sync' },\n },\n // End the consumer span when the user settles the message.\n {\n channelName: 'ack',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'ack', kind: 'Sync' },\n },\n {\n channelName: 'nack',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'nack', kind: 'Sync' },\n },\n {\n channelName: 'reject',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'reject', kind: 'Sync' },\n },\n {\n channelName: 'ackAll',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'ackAll', kind: 'Sync' },\n },\n {\n channelName: 'nackAll',\n module: { ...module, filePath: 'lib/channel_model.js' },\n functionQuery: { className: 'Channel', methodName: 'nackAll', kind: 'Sync' },\n },\n // Stashes connection attributes (url/host/port/protocol/server product) on the connection object\n // for span-time reads via `channel.connection`.\n {\n channelName: 'connect',\n module: { ...module, filePath: 'lib/connect.js' },\n functionQuery: { functionName: 'connect', kind: 'Callback' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const amqplibChannels = {\n AMQPLIB_PUBLISH: 'orchestrion:amqplib:publish',\n AMQPLIB_CONFIRM_PUBLISH: 'orchestrion:amqplib:confirmPublish',\n AMQPLIB_CONSUME: 'orchestrion:amqplib:consume',\n AMQPLIB_DISPATCH: 'orchestrion:amqplib:dispatch',\n AMQPLIB_ACK: 'orchestrion:amqplib:ack',\n AMQPLIB_NACK: 'orchestrion:amqplib:nack',\n AMQPLIB_REJECT: 'orchestrion:amqplib:reject',\n AMQPLIB_ACK_ALL: 'orchestrion:amqplib:ackAll',\n AMQPLIB_NACK_ALL: 'orchestrion:amqplib:nackAll',\n AMQPLIB_CONNECT: 'orchestrion:amqplib:connect',\n} as const;\n"],"names":["module"],"mappings":";;AAYA,MAAMA,QAAA,GAAS,EAAE,IAAA,EAAM,SAAA,EAAW,cAAc,YAAA,EAAa;AAEtD,MAAM,aAAA,GAAgB;AAAA;AAAA,EAE3B;AAAA,IACE,WAAA,EAAa,SAAA;AAAA,IACb,MAAA,EAAQ,EAAE,GAAGA,QAAA,EAAQ,UAAU,sBAAA,EAAuB;AAAA,IACtD,eAAe,EAAE,SAAA,EAAW,WAAW,UAAA,EAAY,SAAA,EAAW,MAAM,MAAA;AAAO,GAC7E;AAAA;AAAA;AAAA;AAAA,EAIA;AAAA,IACE,WAAA,EAAa,gBAAA;AAAA,IACb,MAAA,EAAQ,EAAE,GAAGA,QAAA,EAAQ,UAAU,sBAAA,EAAuB;AAAA,IACtD,eAAe,EAAE,SAAA,EAAW,kBAAkB,UAAA,EAAY,SAAA,EAAW,MAAM,UAAA;AAAW,GACxF;AAAA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AC5E;AAAA,EACA;AAAA,IACE,WAAA,EAAa,SAAA;AAAA,IACb,MAAA,EAAQ,EAAE,GAAGA,QAAA,EAAQ,UAAU,sBAAA,EAAuB;AAAA,IACtD,eAAe,EAAE,SAAA,EAAW,WAAW,UAAA,EAAY,SAAA,EAAW,MAAM,MAAA;AAAO,GAC7E;AAAA;AAAA;AAAA,EAGA;AAAA,IACE,WAAA,EAAa,SAAA;AAAA,IACb,MAAA,EAAQ,EAAE,GAAGA,QAAA,EAAQ,UAAU,gBAAA,EAAiB;AAAA,IAChD,aAAA,EAAe,EAAE,YAAA,EAAc,SAAA,EAAW,MAAM,UAAA;AAAW;AAE/D;AAEO,MAAM,eAAA,GAAkB;AAAA,EAC7B,eAAA,EAAiB,6BAAA;AAAA,EACjB,uBAAA,EAAyB,oCAAA;AAAA,EACzB,eAAA,EAAiB,6BAAA;AAAA,EACjB,gBAAA,EAAkB,8BAAA;AAAA,EAClB,WAAA,EAAa,yBAAA;AAAA,EACb,YAAA,EAAc,0BAAA;AAAA,EACd,cAAA,EAAgB,4BAAA;AAAA,EAChB,eAAA,EAAiB,4BAAA;AAAA,EACjB,gBAAA,EAAkB,6BAAA;AAAA,EAClB,eAAA,EAAiB;AACnB;;;;;"}
@@ -0,0 +1,76 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const expressConfig = [
4
+ // Express funnels every middleware/route handler through a single method on
5
+ // its routing `Layer`, so instrumenting that one method covers the whole
6
+ // request pipeline. The `expressChannelIntegration` opens one span per layer
7
+ // invocation. Both are `Layer.prototype.<method> = function <fn>(req, res, next)`
8
+ // prototype assignments (not `class` methods), so `expressionName` (matching
9
+ // the assignment's `left.property.name`) is used. `Callback`: the handler's
10
+ // last argument is `next`, so the transform ends the traced operation when
11
+ // `next` is invoked (and publishes `error` when it's called with an error).
12
+ //
13
+ // Express v4 ships its own router in `express/lib/router/layer.js`.
14
+ {
15
+ channelName: "handle",
16
+ module: { name: "express", versionRange: ">=4.0.0 <5", filePath: "lib/router/layer.js" },
17
+ // v4's method is `Layer.prototype.handle_request = function handle(...)` —
18
+ // match the assigned property name, not the function name.
19
+ functionQuery: { expressionName: "handle_request", kind: "Callback" }
20
+ },
21
+ // Express v5 delegates routing to the standalone `router` package.
22
+ {
23
+ channelName: "handle",
24
+ module: { name: "router", versionRange: ">=2.0.0 <3", filePath: "lib/layer.js" },
25
+ functionQuery: { expressionName: "handleRequest", kind: "Callback" }
26
+ },
27
+ // Layer *registration* methods. `Router.prototype.route`/`.use` are called
28
+ // once per registered route/middleware (including internally by `app.get`/
29
+ // `app.use`), so subscribing here lets us record each layer's registered path
30
+ // *pattern* — which the handler path (`req.baseUrl`) can't recover for
31
+ // parameterized mounts. `Sync`: these return synchronously and, unlike a
32
+ // handler, `use`'s trailing function argument is a registration payload, not a
33
+ // callback — so `Callback` would misclassify it and never fire `end`.
34
+ //
35
+ // Express v4 ships its own router in `express/lib/router/index.js`.
36
+ {
37
+ channelName: "route",
38
+ module: { name: "express", versionRange: ">=4.0.0 <5", filePath: "lib/router/index.js" },
39
+ functionQuery: { expressionName: "route", kind: "Sync" }
40
+ },
41
+ {
42
+ channelName: "use",
43
+ module: { name: "express", versionRange: ">=4.0.0 <5", filePath: "lib/router/index.js" },
44
+ functionQuery: { expressionName: "use", kind: "Sync" }
45
+ },
46
+ // Express v5 delegates routing to the standalone `router` package.
47
+ {
48
+ channelName: "route",
49
+ module: { name: "router", versionRange: ">=2.0.0 <3", filePath: "index.js" },
50
+ functionQuery: { expressionName: "route", kind: "Sync" }
51
+ },
52
+ {
53
+ channelName: "use",
54
+ module: { name: "router", versionRange: ">=2.0.0 <3", filePath: "index.js" },
55
+ functionQuery: { expressionName: "use", kind: "Sync" }
56
+ }
57
+ ];
58
+ const expressChannels = {
59
+ // Express v4 runs each layer's handler through `Layer.prototype.handle_request`
60
+ // in the `express` module.
61
+ EXPRESS_HANDLE: "orchestrion:express:handle",
62
+ // Express v5 delegates routing to the standalone `router` package, where the
63
+ // equivalent method is `Layer.prototype.handleRequest`.
64
+ ROUTER_HANDLE: "orchestrion:router:handle",
65
+ // Layer *registration* (`Router.prototype.route`/`.use`), used to capture each
66
+ // layer's registered path pattern so the matched route can be reconstructed
67
+ // with its parameters intact (`req.baseUrl` only exposes the resolved prefix).
68
+ EXPRESS_ROUTE: "orchestrion:express:route",
69
+ EXPRESS_USE: "orchestrion:express:use",
70
+ ROUTER_ROUTE: "orchestrion:router:route",
71
+ ROUTER_USE: "orchestrion:router:use"
72
+ };
73
+
74
+ exports.expressChannels = expressChannels;
75
+ exports.expressConfig = expressConfig;
76
+ //# sourceMappingURL=express.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.js","sources":["../../../../src/orchestrion/config/express.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\nexport const expressConfig = [\n // Express funnels every middleware/route handler through a single method on\n // its routing `Layer`, so instrumenting that one method covers the whole\n // request pipeline. The `expressChannelIntegration` opens one span per layer\n // invocation. Both are `Layer.prototype.<method> = function <fn>(req, res, next)`\n // prototype assignments (not `class` methods), so `expressionName` (matching\n // the assignment's `left.property.name`) is used. `Callback`: the handler's\n // last argument is `next`, so the transform ends the traced operation when\n // `next` is invoked (and publishes `error` when it's called with an error).\n //\n // Express v4 ships its own router in `express/lib/router/layer.js`.\n {\n channelName: 'handle',\n module: { name: 'express', versionRange: '>=4.0.0 <5', filePath: 'lib/router/layer.js' },\n // v4's method is `Layer.prototype.handle_request = function handle(...)` —\n // match the assigned property name, not the function name.\n functionQuery: { expressionName: 'handle_request', kind: 'Callback' },\n },\n // Express v5 delegates routing to the standalone `router` package.\n {\n channelName: 'handle',\n module: { name: 'router', versionRange: '>=2.0.0 <3', filePath: 'lib/layer.js' },\n functionQuery: { expressionName: 'handleRequest', kind: 'Callback' },\n },\n // Layer *registration* methods. `Router.prototype.route`/`.use` are called\n // once per registered route/middleware (including internally by `app.get`/\n // `app.use`), so subscribing here lets us record each layer's registered path\n // *pattern* — which the handler path (`req.baseUrl`) can't recover for\n // parameterized mounts. `Sync`: these return synchronously and, unlike a\n // handler, `use`'s trailing function argument is a registration payload, not a\n // callback — so `Callback` would misclassify it and never fire `end`.\n //\n // Express v4 ships its own router in `express/lib/router/index.js`.\n {\n channelName: 'route',\n module: { name: 'express', versionRange: '>=4.0.0 <5', filePath: 'lib/router/index.js' },\n functionQuery: { expressionName: 'route', kind: 'Sync' },\n },\n {\n channelName: 'use',\n module: { name: 'express', versionRange: '>=4.0.0 <5', filePath: 'lib/router/index.js' },\n functionQuery: { expressionName: 'use', kind: 'Sync' },\n },\n // Express v5 delegates routing to the standalone `router` package.\n {\n channelName: 'route',\n module: { name: 'router', versionRange: '>=2.0.0 <3', filePath: 'index.js' },\n functionQuery: { expressionName: 'route', kind: 'Sync' },\n },\n {\n channelName: 'use',\n module: { name: 'router', versionRange: '>=2.0.0 <3', filePath: 'index.js' },\n functionQuery: { expressionName: 'use', kind: 'Sync' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const expressChannels = {\n // Express v4 runs each layer's handler through `Layer.prototype.handle_request`\n // in the `express` module.\n EXPRESS_HANDLE: 'orchestrion:express:handle',\n // Express v5 delegates routing to the standalone `router` package, where the\n // equivalent method is `Layer.prototype.handleRequest`.\n ROUTER_HANDLE: 'orchestrion:router:handle',\n // Layer *registration* (`Router.prototype.route`/`.use`), used to capture each\n // layer's registered path pattern so the matched route can be reconstructed\n // with its parameters intact (`req.baseUrl` only exposes the resolved prefix).\n EXPRESS_ROUTE: 'orchestrion:express:route',\n EXPRESS_USE: 'orchestrion:express:use',\n ROUTER_ROUTE: 'orchestrion:router:route',\n ROUTER_USE: 'orchestrion:router:use',\n} as const;\n"],"names":[],"mappings":";;AAEO,MAAM,aAAA,GAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW3B;AAAA,IACE,WAAA,EAAa,QAAA;AAAA,IACb,QAAQ,EAAE,IAAA,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AA;AAAO;AAEzD;AAEO,MAAM,eAAA,GAAkB;AAAA;AAAA;AAAA,EAG7B,cAAA,EAAgB,4BAAA;AAAA;AAAA;AAAA,EAGhB,aAAA,EAAe,2BAAA;AAAA;AAAA;AAAA;AAAA,EAIf,aAAA,EAAe,2BAAA;AAAA,EACf,WAAA,EAAa,yBAAA;AAAA,EACb,YAAA,EAAc,0BAAA;AAAA,EACd,UAAA,EAAY;AACd;;;;;"}
@@ -0,0 +1,38 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const NODE_DIST_FILES = ["dist/node/index.js", "dist/node/index.mjs", "dist/node/index.cjs"];
4
+ const googleGenAiConfig = [
5
+ // `generateContent`/`generateContentStream` are arrow properties assigned in the constructor, not class
6
+ // methods, so they need `expressionName` rather than `className`/`methodName`.
7
+ ...NODE_DIST_FILES.flatMap(
8
+ (filePath) => ["generateContent", "generateContentStream"].map((expressionName) => ({
9
+ channelName: "generate-content",
10
+ module: { name: "@google/genai", versionRange: ">=0.10.0 <2", filePath },
11
+ functionQuery: { expressionName, kind: "Auto" }
12
+ }))
13
+ ),
14
+ // `embedContent` and the `Chat` methods are real class methods.
15
+ ...NODE_DIST_FILES.map((filePath) => ({
16
+ channelName: "embed-content",
17
+ module: { name: "@google/genai", versionRange: ">=0.10.0 <2", filePath },
18
+ functionQuery: { className: "Models", methodName: "embedContent", kind: "Auto" }
19
+ })),
20
+ // `sendMessage`/`sendMessageStream` internally delegate to `Models.generateContent(Stream)`; the
21
+ // subscriber suppresses that nested `generate-content` event so a chat call yields a single span.
22
+ ...NODE_DIST_FILES.flatMap(
23
+ (filePath) => ["sendMessage", "sendMessageStream"].map((methodName) => ({
24
+ channelName: "chat",
25
+ module: { name: "@google/genai", versionRange: ">=0.10.0 <2", filePath },
26
+ functionQuery: { className: "Chat", methodName, kind: "Auto" }
27
+ }))
28
+ )
29
+ ];
30
+ const googleGenAiChannels = {
31
+ GOOGLE_GENAI_GENERATE_CONTENT: "orchestrion:@google/genai:generate-content",
32
+ GOOGLE_GENAI_EMBED_CONTENT: "orchestrion:@google/genai:embed-content",
33
+ GOOGLE_GENAI_CHAT: "orchestrion:@google/genai:chat"
34
+ };
35
+
36
+ exports.googleGenAiChannels = googleGenAiChannels;
37
+ exports.googleGenAiConfig = googleGenAiConfig;
38
+ //# sourceMappingURL=google-genai.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-genai.js","sources":["../../../../src/orchestrion/config/google-genai.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\n// `@google/genai` ships one bundled file per module format and the matcher compares `filePath` exactly,\n// so we list every file the `node` export condition resolves to across the supported range: `index.js`\n// (ESM+CJS for <0.15.0, CJS for <1.1.0), `index.mjs` (ESM for >=0.15.0), and `index.cjs` (CJS for >=1.1.0).\n// A file that doesn't exist in a given version simply never matches, so listing all three is safe.\nconst NODE_DIST_FILES = ['dist/node/index.js', 'dist/node/index.mjs', 'dist/node/index.cjs'];\n\nexport const googleGenAiConfig = [\n // `generateContent`/`generateContentStream` are arrow properties assigned in the constructor, not class\n // methods, so they need `expressionName` rather than `className`/`methodName`.\n ...NODE_DIST_FILES.flatMap(filePath =>\n (['generateContent', 'generateContentStream'] as const).map(expressionName => ({\n channelName: 'generate-content',\n module: { name: '@google/genai', versionRange: '>=0.10.0 <2', filePath },\n functionQuery: { expressionName, kind: 'Auto' as const },\n })),\n ),\n // `embedContent` and the `Chat` methods are real class methods.\n ...NODE_DIST_FILES.map(filePath => ({\n channelName: 'embed-content',\n module: { name: '@google/genai', versionRange: '>=0.10.0 <2', filePath },\n functionQuery: { className: 'Models', methodName: 'embedContent', kind: 'Auto' as const },\n })),\n // `sendMessage`/`sendMessageStream` internally delegate to `Models.generateContent(Stream)`; the\n // subscriber suppresses that nested `generate-content` event so a chat call yields a single span.\n ...NODE_DIST_FILES.flatMap(filePath =>\n (['sendMessage', 'sendMessageStream'] as const).map(methodName => ({\n channelName: 'chat',\n module: { name: '@google/genai', versionRange: '>=0.10.0 <2', filePath },\n functionQuery: { className: 'Chat', methodName, kind: 'Auto' as const },\n })),\n ),\n] satisfies InstrumentationConfig[];\n\nexport const googleGenAiChannels = {\n GOOGLE_GENAI_GENERATE_CONTENT: 'orchestrion:@google/genai:generate-content',\n GOOGLE_GENAI_EMBED_CONTENT: 'orchestrion:@google/genai:embed-content',\n GOOGLE_GENAI_CHAT: 'orchestrion:@google/genai:chat',\n} as const;\n"],"names":[],"mappings":";;AAMA,MAAM,eAAA,GAAkB,CAAC,oBAAA,EAAsB,qBAAA,EAAuB,qBAAqB,CAAA;AAEpF,MAAM,iBAAA,GAAoB;AAAA;AAAA;AAAA,EAG/B,GAAG,eAAA,CAAgB,OAAA;AAAA,IAAQ,cACxB,CAAC,iBAAA,EAAmB,uBAAuB,CAAA,CAAY,IAAI,CAAA,cAAA,MAAmB;AAAA,MAC7E,WAAA,EAAa,kBAAA;AAAA,MACb,QAAQ,EAAE,IAAA,EAAM,eAAA,EAAiB,YAAA,EAAc,eAAe,QAAA,EAAS;AAAA,MACvE,aAAA,EAAe,EAAE,cAAA,EAAgB,IAAA,EAAM,MAAA;AAAgB,KACzD,CAAE;AAAA,GACJ;AAAA;AAAA,EAEA,GAAG,eAAA,CAAgB,GAAA,CAAI,CAAA,QAAA,MAAa;AAAA,IAClC,WAAA,EAAa,eAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,eAAA,EAAiB,YAAA,EAAc,eAAe,QAAA,EAAS;AAAA,IACvE,eAAe,EAAE,SAAA,EAAW,UAAU,UAAA,EAAY,cAAA,EAAgB,MAAM,MAAA;AAAgB,GAC1F,CAAE,CAAA;AAAA;AAAA;AAAA,EAGF,GAAG,eAAA,CAAgB,OAAA;AAAA,IAAQ,cACxB,CAAC,aAAA,EAAe,mBAAmB,CAAA,CAAY,IAAI,CAAA,UAAA,MAAe;AAAA,MACjE,WAAA,EAAa,MAAA;AAAA,MACb,QAAQ,EAAE,IAAA,EAAM,eAAA,EAAiB,YAAA,EAAc,eAAe,QAAA,EAAS;AAAA,MACvE,eAAe,EAAE,SAAA,EAAW,MAAA,EAAQ,UAAA,EAAY,MAAM,MAAA;AAAgB,KACxE,CAAE;AAAA;AAEN;AAEO,MAAM,mBAAA,GAAsB;AAAA,EACjC,6BAAA,EAA+B,4CAAA;AAAA,EAC/B,0BAAA,EAA4B,yCAAA;AAAA,EAC5B,iBAAA,EAAmB;AACrB;;;;;"}
@@ -0,0 +1,28 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const graphqlConfig = [
4
+ {
5
+ channelName: "parse",
6
+ module: { name: "graphql", versionRange: ">=14.0.0 <17", filePath: "language/parser.js" },
7
+ functionQuery: { functionName: "parse", kind: "Sync" }
8
+ },
9
+ {
10
+ channelName: "validate",
11
+ module: { name: "graphql", versionRange: ">=14.0.0 <17", filePath: "validation/validate.js" },
12
+ functionQuery: { functionName: "validate", kind: "Sync" }
13
+ },
14
+ {
15
+ channelName: "execute",
16
+ module: { name: "graphql", versionRange: ">=14.0.0 <17", filePath: "execution/execute.js" },
17
+ functionQuery: { functionName: "execute", kind: "Auto" }
18
+ }
19
+ ];
20
+ const graphqlChannels = {
21
+ GRAPHQL_PARSE: "orchestrion:graphql:parse",
22
+ GRAPHQL_VALIDATE: "orchestrion:graphql:validate",
23
+ GRAPHQL_EXECUTE: "orchestrion:graphql:execute"
24
+ };
25
+
26
+ exports.graphqlChannels = graphqlChannels;
27
+ exports.graphqlConfig = graphqlConfig;
28
+ //# sourceMappingURL=graphql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql.js","sources":["../../../../src/orchestrion/config/graphql.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\n\n// `parse`/`validate`/`execute` are top-level named `function` declarations in graphql's compiled\n// files, stable across the supported majors, so `functionName` matches. `execute` returns\n// `PromiseOrValue`, so `Auto` covers both async (settles on `asyncEnd`) and sync (`end`) schemas.\nexport const graphqlConfig = [\n {\n channelName: 'parse',\n module: { name: 'graphql', versionRange: '>=14.0.0 <17', filePath: 'language/parser.js' },\n functionQuery: { functionName: 'parse', kind: 'Sync' },\n },\n {\n channelName: 'validate',\n module: { name: 'graphql', versionRange: '>=14.0.0 <17', filePath: 'validation/validate.js' },\n functionQuery: { functionName: 'validate', kind: 'Sync' },\n },\n {\n channelName: 'execute',\n module: { name: 'graphql', versionRange: '>=14.0.0 <17', filePath: 'execution/execute.js' },\n functionQuery: { functionName: 'execute', kind: 'Auto' },\n },\n] satisfies InstrumentationConfig[];\n\nexport const graphqlChannels = {\n GRAPHQL_PARSE: 'orchestrion:graphql:parse',\n GRAPHQL_VALIDATE: 'orchestrion:graphql:validate',\n GRAPHQL_EXECUTE: 'orchestrion:graphql:execute',\n} as const;\n"],"names":[],"mappings":";;AAKO,MAAM,aAAA,GAAgB;AAAA,EAC3B;AAAA,IACE,WAAA,EAAa,OAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,WAAW,YAAA,EAAc,cAAA,EAAgB,UAAU,oBAAA,EAAqB;AAAA,IACxF,aAAA,EAAe,EAAE,YAAA,EAAc,OAAA,EAAS,MAAM,MAAA;AAAO,GACvD;AAAA,EACA;AAAA,IACE,WAAA,EAAa,UAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,WAAW,YAAA,EAAc,cAAA,EAAgB,UAAU,wBAAA,EAAyB;AAAA,IAC5F,aAAA,EAAe,EAAE,YAAA,EAAc,UAAA,EAAY,MAAM,MAAA;AAAO,GAC1D;AAAA,EACA;AAAA,IACE,WAAA,EAAa,SAAA;AAAA,IACb,QAAQ,EAAE,IAAA,EAAM,WAAW,YAAA,EAAc,cAAA,EAAgB,UAAU,sBAAA,EAAuB;AAAA,IAC1F,aAAA,EAAe,EAAE,YAAA,EAAc,SAAA,EAAW,MAAM,MAAA;AAAO;AAE3D;AAEO,MAAM,eAAA,GAAkB;AAAA,EAC7B,aAAA,EAAe,2BAAA;AAAA,EACf,gBAAA,EAAkB,8BAAA;AAAA,EAClB,eAAA,EAAiB;AACnB;;;;;"}
@@ -1,13 +1,20 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
+ const core = require('@sentry/core');
3
4
  const mysql = require('./mysql.js');
4
5
  const lruMemoizer = require('./lru-memoizer.js');
5
6
  const ioredis = require('./ioredis.js');
6
7
  const openai = require('./openai.js');
7
8
  const pg = require('./pg.js');
9
+ const postgres = require('./postgres.js');
8
10
  const anthropicAi = require('./anthropic-ai.js');
11
+ const googleGenai = require('./google-genai.js');
9
12
  const vercelAi = require('./vercel-ai.js');
13
+ const amqplib = require('./amqplib.js');
10
14
  const hapi = require('./hapi.js');
15
+ const redis = require('./redis.js');
16
+ const express = require('./express.js');
17
+ const graphql = require('./graphql.js');
11
18
 
12
19
  const SENTRY_INSTRUMENTATIONS = [
13
20
  ...mysql.mysqlConfig,
@@ -15,11 +22,17 @@ const SENTRY_INSTRUMENTATIONS = [
15
22
  ...ioredis.ioredisConfig,
16
23
  ...openai.openaiConfig,
17
24
  ...pg.pgConfig,
25
+ ...postgres.postgresJsConfig,
18
26
  ...anthropicAi.anthropicAiConfig,
27
+ ...googleGenai.googleGenAiConfig,
19
28
  ...vercelAi.vercelAiConfig,
20
- ...hapi.hapiConfig
29
+ ...hapi.hapiConfig,
30
+ ...amqplib.amqplibConfig,
31
+ ...redis.redisConfig,
32
+ ...express.expressConfig,
33
+ ...graphql.graphqlConfig
21
34
  ];
22
- const INSTRUMENTED_MODULE_NAMES = Array.from(new Set(SENTRY_INSTRUMENTATIONS.map((i) => i.module.name)));
35
+ const INSTRUMENTED_MODULE_NAMES = core.uniq(SENTRY_INSTRUMENTATIONS.map((i) => i.module.name));
23
36
  function withoutInstrumentedExternals(external) {
24
37
  if (!external) {
25
38
  return void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/orchestrion/config/index.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\nimport { mysqlConfig } from './mysql';\nimport { lruMemoizerConfig } from './lru-memoizer';\nimport { ioredisConfig } from './ioredis';\nimport { openaiConfig } from './openai';\nimport { pgConfig } from './pg';\nimport { anthropicAiConfig } from './anthropic-ai';\nimport { vercelAiConfig } from './vercel-ai';\nimport { hapiConfig } from './hapi';\n\nexport const SENTRY_INSTRUMENTATIONS: InstrumentationConfig[] = [\n ...mysqlConfig,\n ...lruMemoizerConfig,\n ...ioredisConfig,\n ...openaiConfig,\n ...pgConfig,\n ...anthropicAiConfig,\n ...vercelAiConfig,\n ...hapiConfig,\n];\n\n/**\n * The unique set of package names instrumented by `SENTRY_INSTRUMENTATIONS`\n * (e.g. `['mysql']`).\n *\n * Bundler plugins MUST ensure these are actually bundled rather than\n * externalized: an externalized dependency is resolved from `node_modules` at\n * runtime and never passes through the code transform's `onLoad`, so its\n * diagnostics_channel calls are silently never injected.\n */\nexport const INSTRUMENTED_MODULE_NAMES: string[] = Array.from(new Set(SENTRY_INSTRUMENTATIONS.map(i => i.module.name)));\n\n/**\n * Returns `external` with any instrumented packages removed, so a bundler that\n * uses an \"external\" denylist (esbuild, Bun, Rollup) still bundles — and thus\n * transforms — them. Matches an exact package name (`'mysql'`) or a subpath\n * (`'mysql/lib/...'`); wildcard/other patterns are left untouched. `undefined`\n * is returned unchanged.\n *\n * (Vite uses an `ssr.noExternal` allowlist instead, so it consumes\n * `INSTRUMENTED_MODULE_NAMES` directly rather than this helper.)\n */\nexport function withoutInstrumentedExternals(external: readonly string[] | undefined): string[] | undefined {\n if (!external) {\n return undefined;\n }\n return external.filter(\n entry => !INSTRUMENTED_MODULE_NAMES.some(name => entry === name || entry.startsWith(`${name}/`)),\n );\n}\n"],"names":["mysqlConfig","lruMemoizerConfig","ioredisConfig","openaiConfig","pgConfig","anthropicAiConfig","vercelAiConfig","hapiConfig"],"mappings":";;;;;;;;;;;AAUO,MAAM,uBAAA,GAAmD;AAAA,EAC9D,GAAGA,iBAAA;AAAA,EACH,GAAGC,6BAAA;AAAA,EACH,GAAGC,qBAAA;AAAA,EACH,GAAGC,mBAAA;AAAA,EACH,GAAGC,WAAA;AAAA,EACH,GAAGC,6BAAA;AAAA,EACH,GAAGC,uBAAA;AAAA,EACH,GAAGC;AACL;AAWO,MAAM,yBAAA,GAAsC,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,uBAAA,CAAwB,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,CAAO,IAAI,CAAC,CAAC;AAY/G,SAAS,6BAA6B,QAAA,EAA+D;AAC1G,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,QAAA,CAAS,MAAA;AAAA,IACd,CAAA,KAAA,KAAS,CAAC,yBAAA,CAA0B,IAAA,CAAK,CAAA,IAAA,KAAQ,KAAA,KAAU,IAAA,IAAQ,KAAA,CAAM,UAAA,CAAW,CAAA,EAAG,IAAI,CAAA,CAAA,CAAG,CAAC;AAAA,GACjG;AACF;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/orchestrion/config/index.ts"],"sourcesContent":["import type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\nimport { uniq } from '@sentry/core';\nimport { mysqlConfig } from './mysql';\nimport { lruMemoizerConfig } from './lru-memoizer';\nimport { ioredisConfig } from './ioredis';\nimport { openaiConfig } from './openai';\nimport { pgConfig } from './pg';\nimport { postgresJsConfig } from './postgres';\nimport { anthropicAiConfig } from './anthropic-ai';\nimport { googleGenAiConfig } from './google-genai';\nimport { vercelAiConfig } from './vercel-ai';\nimport { amqplibConfig } from './amqplib';\nimport { hapiConfig } from './hapi';\nimport { redisConfig } from './redis';\nimport { expressConfig } from './express';\nimport { graphqlConfig } from './graphql';\n\nexport const SENTRY_INSTRUMENTATIONS: InstrumentationConfig[] = [\n ...mysqlConfig,\n ...lruMemoizerConfig,\n ...ioredisConfig,\n ...openaiConfig,\n ...pgConfig,\n ...postgresJsConfig,\n ...anthropicAiConfig,\n ...googleGenAiConfig,\n ...vercelAiConfig,\n ...hapiConfig,\n ...amqplibConfig,\n ...redisConfig,\n ...expressConfig,\n ...graphqlConfig,\n];\n\n/**\n * The unique set of package names instrumented by `SENTRY_INSTRUMENTATIONS`\n * (e.g. `['mysql']`).\n *\n * Bundler plugins MUST ensure these are actually bundled rather than\n * externalized: an externalized dependency is resolved from `node_modules` at\n * runtime and never passes through the code transform's `onLoad`, so its\n * diagnostics_channel calls are silently never injected.\n */\nexport const INSTRUMENTED_MODULE_NAMES: string[] = uniq(SENTRY_INSTRUMENTATIONS.map(i => i.module.name));\n\n/**\n * Returns `external` with any instrumented packages removed, so a bundler that\n * uses an \"external\" denylist (esbuild, Bun, Rollup) still bundles — and thus\n * transforms — them. Matches an exact package name (`'mysql'`) or a subpath\n * (`'mysql/lib/...'`); wildcard/other patterns are left untouched. `undefined`\n * is returned unchanged.\n *\n * (Vite uses an `ssr.noExternal` allowlist instead, so it consumes\n * `INSTRUMENTED_MODULE_NAMES` directly rather than this helper.)\n */\nexport function withoutInstrumentedExternals(external: readonly string[] | undefined): string[] | undefined {\n if (!external) {\n return undefined;\n }\n return external.filter(\n entry => !INSTRUMENTED_MODULE_NAMES.some(name => entry === name || entry.startsWith(`${name}/`)),\n );\n}\n"],"names":["mysqlConfig","lruMemoizerConfig","ioredisConfig","openaiConfig","pgConfig","postgresJsConfig","anthropicAiConfig","googleGenAiConfig","vercelAiConfig","hapiConfig","amqplibConfig","redisConfig","expressConfig","graphqlConfig","uniq"],"mappings":";;;;;;;;;;;;;;;;;;AAiBO,MAAM,uBAAA,GAAmD;AAAA,EAC9D,GAAGA,iBAAA;AAAA,EACH,GAAGC,6BAAA;AAAA,EACH,GAAGC,qBAAA;AAAA,EACH,GAAGC,mBAAA;AAAA,EACH,GAAGC,WAAA;AAAA,EACH,GAAGC,yBAAA;AAAA,EACH,GAAGC,6BAAA;AAAA,EACH,GAAGC,6BAAA;AAAA,EACH,GAAGC,uBAAA;AAAA,EACH,GAAGC,eAAA;AAAA,EACH,GAAGC,qBAAA;AAAA,EACH,GAAGC,iBAAA;AAAA,EACH,GAAGC,qBAAA;AAAA,EACH,GAAGC;AACL;AAWO,MAAM,yBAAA,GAAsCC,UAAK,uBAAA,CAAwB,GAAA,CAAI,OAAK,CAAA,CAAE,MAAA,CAAO,IAAI,CAAC;AAYhG,SAAS,6BAA6B,QAAA,EAA+D;AAC1G,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAO,QAAA,CAAS,MAAA;AAAA,IACd,CAAA,KAAA,KAAS,CAAC,yBAAA,CAA0B,IAAA,CAAK,CAAA,IAAA,KAAQ,KAAA,KAAU,IAAA,IAAQ,KAAA,CAAM,UAAA,CAAW,CAAA,EAAG,IAAI,CAAA,CAAA,CAAG,CAAC;AAAA,GACjG;AACF;;;;;;"}