@sentry/server-utils 10.64.0 → 10.66.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 (520) hide show
  1. package/build/cjs/graphql/graphql-dc-subscriber.js +123 -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 +92 -0
  6. package/build/cjs/graphql/utils.js.map +1 -0
  7. package/build/cjs/index.js +13 -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/dataloader.js +95 -0
  12. package/build/cjs/integrations/tracing-channel/dataloader.js.map +1 -0
  13. package/build/cjs/integrations/tracing-channel/express/index.js +24 -0
  14. package/build/cjs/integrations/tracing-channel/express/index.js.map +1 -0
  15. package/build/cjs/integrations/tracing-channel/express/instrumentation.js +173 -0
  16. package/build/cjs/integrations/tracing-channel/express/instrumentation.js.map +1 -0
  17. package/build/cjs/integrations/tracing-channel/express/route.js +76 -0
  18. package/build/cjs/integrations/tracing-channel/express/route.js.map +1 -0
  19. package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js +1 -1
  20. package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js.map +1 -1
  21. package/build/cjs/integrations/tracing-channel/generic-pool.js +34 -0
  22. package/build/cjs/integrations/tracing-channel/generic-pool.js.map +1 -0
  23. package/build/cjs/integrations/tracing-channel/google-genai.js +96 -0
  24. package/build/cjs/integrations/tracing-channel/google-genai.js.map +1 -0
  25. package/build/cjs/integrations/tracing-channel/graphql/constants.js +26 -0
  26. package/build/cjs/integrations/tracing-channel/graphql/constants.js.map +1 -0
  27. package/build/cjs/integrations/tracing-channel/graphql/index.js +66 -0
  28. package/build/cjs/integrations/tracing-channel/graphql/index.js.map +1 -0
  29. package/build/cjs/integrations/tracing-channel/graphql/resolvers.js +168 -0
  30. package/build/cjs/integrations/tracing-channel/graphql/resolvers.js.map +1 -0
  31. package/build/cjs/integrations/tracing-channel/graphql/spans.js +102 -0
  32. package/build/cjs/integrations/tracing-channel/graphql/spans.js.map +1 -0
  33. package/build/cjs/integrations/tracing-channel/ioredis.js +35 -32
  34. package/build/cjs/integrations/tracing-channel/ioredis.js.map +1 -1
  35. package/build/cjs/integrations/tracing-channel/kafkajs/consumer.js +71 -0
  36. package/build/cjs/integrations/tracing-channel/kafkajs/consumer.js.map +1 -0
  37. package/build/cjs/integrations/tracing-channel/kafkajs/index.js +70 -0
  38. package/build/cjs/integrations/tracing-channel/kafkajs/index.js.map +1 -0
  39. package/build/cjs/integrations/tracing-channel/kafkajs/semconv.js +22 -0
  40. package/build/cjs/integrations/tracing-channel/kafkajs/semconv.js.map +1 -0
  41. package/build/cjs/integrations/tracing-channel/kafkajs/spans.js +119 -0
  42. package/build/cjs/integrations/tracing-channel/kafkajs/spans.js.map +1 -0
  43. package/build/cjs/integrations/tracing-channel/knex.js +188 -0
  44. package/build/cjs/integrations/tracing-channel/knex.js.map +1 -0
  45. package/build/cjs/integrations/tracing-channel/mysql.js +1 -1
  46. package/build/cjs/integrations/tracing-channel/mysql.js.map +1 -1
  47. package/build/cjs/integrations/tracing-channel/mysql2.js +83 -0
  48. package/build/cjs/integrations/tracing-channel/mysql2.js.map +1 -0
  49. package/build/cjs/integrations/tracing-channel/openai.js.map +1 -1
  50. package/build/cjs/integrations/tracing-channel/postgres-js.js +191 -0
  51. package/build/cjs/integrations/tracing-channel/postgres-js.js.map +1 -0
  52. package/build/cjs/integrations/tracing-channel/postgres.js +5 -5
  53. package/build/cjs/integrations/tracing-channel/postgres.js.map +1 -1
  54. package/build/cjs/integrations/tracing-channel/redis.js +227 -0
  55. package/build/cjs/integrations/tracing-channel/redis.js.map +1 -0
  56. package/build/cjs/integrations/tracing-channel/vercel-ai.js +2 -2
  57. package/build/cjs/integrations/tracing-channel/vercel-ai.js.map +1 -1
  58. package/build/cjs/mongoose/mongoose-dc-subscriber.js +1 -1
  59. package/build/cjs/mongoose/mongoose-dc-subscriber.js.map +1 -1
  60. package/build/cjs/mysql2/index.js +23 -0
  61. package/build/cjs/mysql2/index.js.map +1 -0
  62. package/build/cjs/mysql2/mysql2-dc-subscriber.js +68 -0
  63. package/build/cjs/mysql2/mysql2-dc-subscriber.js.map +1 -0
  64. package/build/cjs/orchestrion/bundler/esbuild.js +11 -0
  65. package/build/cjs/orchestrion/bundler/esbuild.js.map +1 -0
  66. package/build/cjs/orchestrion/bundler/options.js +15 -0
  67. package/build/cjs/orchestrion/bundler/options.js.map +1 -0
  68. package/build/cjs/orchestrion/bundler/rollup.js +11 -0
  69. package/build/cjs/orchestrion/bundler/rollup.js.map +1 -0
  70. package/build/cjs/orchestrion/bundler/vite.js +4 -21
  71. package/build/cjs/orchestrion/bundler/vite.js.map +1 -1
  72. package/build/cjs/orchestrion/bundler/webpack.js +32 -0
  73. package/build/cjs/orchestrion/bundler/webpack.js.map +1 -0
  74. package/build/cjs/orchestrion/channels.js +53 -11
  75. package/build/cjs/orchestrion/channels.js.map +1 -1
  76. package/build/cjs/orchestrion/config/amqplib.js +81 -0
  77. package/build/cjs/orchestrion/config/amqplib.js.map +1 -0
  78. package/build/cjs/orchestrion/config/dataloader.js +53 -0
  79. package/build/cjs/orchestrion/config/dataloader.js.map +1 -0
  80. package/build/cjs/orchestrion/config/express.js +76 -0
  81. package/build/cjs/orchestrion/config/express.js.map +1 -0
  82. package/build/cjs/orchestrion/config/firebase.js +8 -0
  83. package/build/cjs/orchestrion/config/firebase.js.map +1 -0
  84. package/build/cjs/orchestrion/config/generic-pool.js +21 -0
  85. package/build/cjs/orchestrion/config/generic-pool.js.map +1 -0
  86. package/build/cjs/orchestrion/config/google-genai.js +38 -0
  87. package/build/cjs/orchestrion/config/google-genai.js.map +1 -0
  88. package/build/cjs/orchestrion/config/graphql.js +28 -0
  89. package/build/cjs/orchestrion/config/graphql.js.map +1 -0
  90. package/build/cjs/orchestrion/config/index.js +59 -14
  91. package/build/cjs/orchestrion/config/index.js.map +1 -1
  92. package/build/cjs/orchestrion/config/kafkajs.js +30 -0
  93. package/build/cjs/orchestrion/config/kafkajs.js.map +1 -0
  94. package/build/cjs/orchestrion/config/knex.js +43 -0
  95. package/build/cjs/orchestrion/config/knex.js.map +1 -0
  96. package/build/cjs/orchestrion/config/langchain.js +8 -0
  97. package/build/cjs/orchestrion/config/langchain.js.map +1 -0
  98. package/build/cjs/orchestrion/config/langgraph.js +8 -0
  99. package/build/cjs/orchestrion/config/langgraph.js.map +1 -0
  100. package/build/cjs/orchestrion/config/mongodb.js +8 -0
  101. package/build/cjs/orchestrion/config/mongodb.js.map +1 -0
  102. package/build/cjs/orchestrion/config/mongoose.js +8 -0
  103. package/build/cjs/orchestrion/config/mongoose.js.map +1 -0
  104. package/build/cjs/orchestrion/config/mysql2.js +32 -0
  105. package/build/cjs/orchestrion/config/mysql2.js.map +1 -0
  106. package/build/cjs/orchestrion/config/nestjs.js +122 -0
  107. package/build/cjs/orchestrion/config/nestjs.js.map +1 -0
  108. package/build/cjs/orchestrion/config/postgres.js +50 -0
  109. package/build/cjs/orchestrion/config/postgres.js.map +1 -0
  110. package/build/cjs/orchestrion/config/prisma.js +8 -0
  111. package/build/cjs/orchestrion/config/prisma.js.map +1 -0
  112. package/build/cjs/orchestrion/config/react-router.js +8 -0
  113. package/build/cjs/orchestrion/config/react-router.js.map +1 -0
  114. package/build/cjs/orchestrion/config/redis.js +76 -0
  115. package/build/cjs/orchestrion/config/redis.js.map +1 -0
  116. package/build/cjs/orchestrion/config/remix.js +8 -0
  117. package/build/cjs/orchestrion/config/remix.js.map +1 -0
  118. package/build/cjs/orchestrion/config/tedious.js +8 -0
  119. package/build/cjs/orchestrion/config/tedious.js.map +1 -0
  120. package/build/cjs/orchestrion/config/vercel-ai.js +18 -14
  121. package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -1
  122. package/build/cjs/orchestrion/detect.js +12 -11
  123. package/build/cjs/orchestrion/detect.js.map +1 -1
  124. package/build/cjs/orchestrion/index.js +33 -1
  125. package/build/cjs/orchestrion/index.js.map +1 -1
  126. package/build/cjs/orchestrion/runtime/register.js +25 -14
  127. package/build/cjs/orchestrion/runtime/register.js.map +1 -1
  128. package/build/cjs/prisma/global.js +14 -0
  129. package/build/cjs/prisma/global.js.map +1 -0
  130. package/build/cjs/prisma/index.js +27 -0
  131. package/build/cjs/prisma/index.js.map +1 -0
  132. package/build/cjs/prisma/tracing-helper.js +211 -0
  133. package/build/cjs/prisma/tracing-helper.js.map +1 -0
  134. package/build/cjs/redis/index.js +23 -0
  135. package/build/cjs/redis/index.js.map +1 -0
  136. package/build/cjs/redis/redis-dc-subscriber.js +23 -35
  137. package/build/cjs/redis/redis-dc-subscriber.js.map +1 -1
  138. package/build/cjs/tracing-channel.js +7 -6
  139. package/build/cjs/tracing-channel.js.map +1 -1
  140. package/build/cjs/vercel-ai/util.js +112 -0
  141. package/build/cjs/vercel-ai/util.js.map +1 -0
  142. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js +138 -74
  143. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  144. package/build/cjs/vercel-ai/{vercel-ai-orchestrion-v6-subscriber.js → vercel-ai-orchestrion-subscriber.js} +153 -23
  145. package/build/cjs/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -0
  146. package/build/esm/graphql/graphql-dc-subscriber.js +116 -0
  147. package/build/esm/graphql/graphql-dc-subscriber.js.map +1 -0
  148. package/build/esm/graphql/index.js +21 -0
  149. package/build/esm/graphql/index.js.map +1 -0
  150. package/build/esm/graphql/utils.js +87 -0
  151. package/build/esm/graphql/utils.js.map +1 -0
  152. package/build/esm/index.js +4 -1
  153. package/build/esm/index.js.map +1 -1
  154. package/build/esm/integrations/tracing-channel/amqplib.js +418 -0
  155. package/build/esm/integrations/tracing-channel/amqplib.js.map +1 -0
  156. package/build/esm/integrations/tracing-channel/anthropic.js +1 -1
  157. package/build/esm/integrations/tracing-channel/dataloader.js +93 -0
  158. package/build/esm/integrations/tracing-channel/dataloader.js.map +1 -0
  159. package/build/esm/integrations/tracing-channel/express/index.js +22 -0
  160. package/build/esm/integrations/tracing-channel/express/index.js.map +1 -0
  161. package/build/esm/integrations/tracing-channel/express/instrumentation.js +171 -0
  162. package/build/esm/integrations/tracing-channel/express/instrumentation.js.map +1 -0
  163. package/build/esm/integrations/tracing-channel/express/route.js +68 -0
  164. package/build/esm/integrations/tracing-channel/express/route.js.map +1 -0
  165. package/build/esm/integrations/tracing-channel/fastify/instrumentation.js +2 -2
  166. package/build/esm/integrations/tracing-channel/fastify/instrumentation.js.map +1 -1
  167. package/build/esm/integrations/tracing-channel/generic-pool.js +32 -0
  168. package/build/esm/integrations/tracing-channel/generic-pool.js.map +1 -0
  169. package/build/esm/integrations/tracing-channel/google-genai.js +94 -0
  170. package/build/esm/integrations/tracing-channel/google-genai.js.map +1 -0
  171. package/build/esm/integrations/tracing-channel/graphql/constants.js +14 -0
  172. package/build/esm/integrations/tracing-channel/graphql/constants.js.map +1 -0
  173. package/build/esm/integrations/tracing-channel/graphql/index.js +63 -0
  174. package/build/esm/integrations/tracing-channel/graphql/index.js.map +1 -0
  175. package/build/esm/integrations/tracing-channel/graphql/resolvers.js +164 -0
  176. package/build/esm/integrations/tracing-channel/graphql/resolvers.js.map +1 -0
  177. package/build/esm/integrations/tracing-channel/graphql/spans.js +96 -0
  178. package/build/esm/integrations/tracing-channel/graphql/spans.js.map +1 -0
  179. package/build/esm/integrations/tracing-channel/ioredis.js +36 -34
  180. package/build/esm/integrations/tracing-channel/ioredis.js.map +1 -1
  181. package/build/esm/integrations/tracing-channel/kafkajs/consumer.js +67 -0
  182. package/build/esm/integrations/tracing-channel/kafkajs/consumer.js.map +1 -0
  183. package/build/esm/integrations/tracing-channel/kafkajs/index.js +68 -0
  184. package/build/esm/integrations/tracing-channel/kafkajs/index.js.map +1 -0
  185. package/build/esm/integrations/tracing-channel/kafkajs/semconv.js +12 -0
  186. package/build/esm/integrations/tracing-channel/kafkajs/semconv.js.map +1 -0
  187. package/build/esm/integrations/tracing-channel/kafkajs/spans.js +112 -0
  188. package/build/esm/integrations/tracing-channel/kafkajs/spans.js.map +1 -0
  189. package/build/esm/integrations/tracing-channel/knex.js +186 -0
  190. package/build/esm/integrations/tracing-channel/knex.js.map +1 -0
  191. package/build/esm/integrations/tracing-channel/mysql.js +2 -2
  192. package/build/esm/integrations/tracing-channel/mysql.js.map +1 -1
  193. package/build/esm/integrations/tracing-channel/mysql2.js +81 -0
  194. package/build/esm/integrations/tracing-channel/mysql2.js.map +1 -0
  195. package/build/esm/integrations/tracing-channel/openai.js +1 -1
  196. package/build/esm/integrations/tracing-channel/openai.js.map +1 -1
  197. package/build/esm/integrations/tracing-channel/postgres-js.js +189 -0
  198. package/build/esm/integrations/tracing-channel/postgres-js.js.map +1 -0
  199. package/build/esm/integrations/tracing-channel/postgres.js +6 -6
  200. package/build/esm/integrations/tracing-channel/postgres.js.map +1 -1
  201. package/build/esm/integrations/tracing-channel/redis.js +225 -0
  202. package/build/esm/integrations/tracing-channel/redis.js.map +1 -0
  203. package/build/esm/integrations/tracing-channel/vercel-ai.js +1 -1
  204. package/build/esm/integrations/tracing-channel/vercel-ai.js.map +1 -1
  205. package/build/esm/mongoose/mongoose-dc-subscriber.js +2 -2
  206. package/build/esm/mongoose/mongoose-dc-subscriber.js.map +1 -1
  207. package/build/esm/mysql2/index.js +21 -0
  208. package/build/esm/mysql2/index.js.map +1 -0
  209. package/build/esm/mysql2/mysql2-dc-subscriber.js +62 -0
  210. package/build/esm/mysql2/mysql2-dc-subscriber.js.map +1 -0
  211. package/build/esm/orchestrion/bundler/esbuild.js +9 -0
  212. package/build/esm/orchestrion/bundler/esbuild.js.map +1 -0
  213. package/build/esm/orchestrion/bundler/options.js +13 -0
  214. package/build/esm/orchestrion/bundler/options.js.map +1 -0
  215. package/build/esm/orchestrion/bundler/rollup.js +9 -0
  216. package/build/esm/orchestrion/bundler/rollup.js.map +1 -0
  217. package/build/esm/orchestrion/bundler/vite.js +5 -22
  218. package/build/esm/orchestrion/bundler/vite.js.map +1 -1
  219. package/build/esm/orchestrion/bundler/webpack.js +27 -0
  220. package/build/esm/orchestrion/bundler/webpack.js.map +1 -0
  221. package/build/esm/orchestrion/channels.js +53 -11
  222. package/build/esm/orchestrion/channels.js.map +1 -1
  223. package/build/esm/orchestrion/config/amqplib.js +78 -0
  224. package/build/esm/orchestrion/config/amqplib.js.map +1 -0
  225. package/build/esm/orchestrion/config/dataloader.js +50 -0
  226. package/build/esm/orchestrion/config/dataloader.js.map +1 -0
  227. package/build/esm/orchestrion/config/express.js +73 -0
  228. package/build/esm/orchestrion/config/express.js.map +1 -0
  229. package/build/esm/orchestrion/config/firebase.js +5 -0
  230. package/build/esm/orchestrion/config/firebase.js.map +1 -0
  231. package/build/esm/orchestrion/config/generic-pool.js +18 -0
  232. package/build/esm/orchestrion/config/generic-pool.js.map +1 -0
  233. package/build/esm/orchestrion/config/google-genai.js +35 -0
  234. package/build/esm/orchestrion/config/google-genai.js.map +1 -0
  235. package/build/esm/orchestrion/config/graphql.js +25 -0
  236. package/build/esm/orchestrion/config/graphql.js.map +1 -0
  237. package/build/esm/orchestrion/config/index.js +59 -15
  238. package/build/esm/orchestrion/config/index.js.map +1 -1
  239. package/build/esm/orchestrion/config/kafkajs.js +27 -0
  240. package/build/esm/orchestrion/config/kafkajs.js.map +1 -0
  241. package/build/esm/orchestrion/config/knex.js +40 -0
  242. package/build/esm/orchestrion/config/knex.js.map +1 -0
  243. package/build/esm/orchestrion/config/langchain.js +5 -0
  244. package/build/esm/orchestrion/config/langchain.js.map +1 -0
  245. package/build/esm/orchestrion/config/langgraph.js +5 -0
  246. package/build/esm/orchestrion/config/langgraph.js.map +1 -0
  247. package/build/esm/orchestrion/config/mongodb.js +5 -0
  248. package/build/esm/orchestrion/config/mongodb.js.map +1 -0
  249. package/build/esm/orchestrion/config/mongoose.js +5 -0
  250. package/build/esm/orchestrion/config/mongoose.js.map +1 -0
  251. package/build/esm/orchestrion/config/mysql2.js +29 -0
  252. package/build/esm/orchestrion/config/mysql2.js.map +1 -0
  253. package/build/esm/orchestrion/config/nestjs.js +119 -0
  254. package/build/esm/orchestrion/config/nestjs.js.map +1 -0
  255. package/build/esm/orchestrion/config/postgres.js +47 -0
  256. package/build/esm/orchestrion/config/postgres.js.map +1 -0
  257. package/build/esm/orchestrion/config/prisma.js +5 -0
  258. package/build/esm/orchestrion/config/prisma.js.map +1 -0
  259. package/build/esm/orchestrion/config/react-router.js +5 -0
  260. package/build/esm/orchestrion/config/react-router.js.map +1 -0
  261. package/build/esm/orchestrion/config/redis.js +73 -0
  262. package/build/esm/orchestrion/config/redis.js.map +1 -0
  263. package/build/esm/orchestrion/config/remix.js +5 -0
  264. package/build/esm/orchestrion/config/remix.js.map +1 -0
  265. package/build/esm/orchestrion/config/tedious.js +5 -0
  266. package/build/esm/orchestrion/config/tedious.js.map +1 -0
  267. package/build/esm/orchestrion/config/vercel-ai.js +18 -14
  268. package/build/esm/orchestrion/config/vercel-ai.js.map +1 -1
  269. package/build/esm/orchestrion/detect.js +13 -12
  270. package/build/esm/orchestrion/detect.js.map +1 -1
  271. package/build/esm/orchestrion/index.js +23 -2
  272. package/build/esm/orchestrion/index.js.map +1 -1
  273. package/build/esm/orchestrion/runtime/register.js +27 -16
  274. package/build/esm/orchestrion/runtime/register.js.map +1 -1
  275. package/build/esm/package.json +1 -1
  276. package/build/esm/prisma/global.js +12 -0
  277. package/build/esm/prisma/global.js.map +1 -0
  278. package/build/esm/prisma/index.js +24 -0
  279. package/build/esm/prisma/index.js.map +1 -0
  280. package/build/esm/prisma/tracing-helper.js +209 -0
  281. package/build/esm/prisma/tracing-helper.js.map +1 -0
  282. package/build/esm/redis/index.js +21 -0
  283. package/build/esm/redis/index.js.map +1 -0
  284. package/build/esm/redis/redis-dc-subscriber.js +24 -36
  285. package/build/esm/redis/redis-dc-subscriber.js.map +1 -1
  286. package/build/esm/tracing-channel.js +8 -7
  287. package/build/esm/tracing-channel.js.map +1 -1
  288. package/build/esm/vercel-ai/util.js +106 -0
  289. package/build/esm/vercel-ai/util.js.map +1 -0
  290. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js +121 -59
  291. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -1
  292. package/build/esm/vercel-ai/{vercel-ai-orchestrion-v6-subscriber.js → vercel-ai-orchestrion-subscriber.js} +153 -23
  293. package/build/esm/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -0
  294. package/build/types/graphql/graphql-dc-subscriber.d.ts +94 -0
  295. package/build/types/graphql/graphql-dc-subscriber.d.ts.map +1 -0
  296. package/build/types/graphql/index.d.ts +12 -0
  297. package/build/types/graphql/index.d.ts.map +1 -0
  298. package/build/types/graphql/utils.d.ts +36 -0
  299. package/build/types/graphql/utils.d.ts.map +1 -0
  300. package/build/types/index.d.ts +6 -2
  301. package/build/types/index.d.ts.map +1 -1
  302. package/build/types/integrations/tracing-channel/amqplib.d.ts +11 -0
  303. package/build/types/integrations/tracing-channel/amqplib.d.ts.map +1 -0
  304. package/build/types/integrations/tracing-channel/dataloader.d.ts +11 -0
  305. package/build/types/integrations/tracing-channel/dataloader.d.ts.map +1 -0
  306. package/build/types/integrations/tracing-channel/express/index.d.ts +18 -0
  307. package/build/types/integrations/tracing-channel/express/index.d.ts.map +1 -0
  308. package/build/types/integrations/tracing-channel/express/instrumentation.d.ts +4 -0
  309. package/build/types/integrations/tracing-channel/express/instrumentation.d.ts.map +1 -0
  310. package/build/types/integrations/tracing-channel/express/route.d.ts +28 -0
  311. package/build/types/integrations/tracing-channel/express/route.d.ts.map +1 -0
  312. package/build/types/integrations/tracing-channel/express/types.d.ts +64 -0
  313. package/build/types/integrations/tracing-channel/express/types.d.ts.map +1 -0
  314. package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts.map +1 -1
  315. package/build/types/integrations/tracing-channel/generic-pool.d.ts +10 -0
  316. package/build/types/integrations/tracing-channel/generic-pool.d.ts.map +1 -0
  317. package/build/types/integrations/tracing-channel/google-genai.d.ts +12 -0
  318. package/build/types/integrations/tracing-channel/google-genai.d.ts.map +1 -0
  319. package/build/types/integrations/tracing-channel/graphql/constants.d.ts +12 -0
  320. package/build/types/integrations/tracing-channel/graphql/constants.d.ts.map +1 -0
  321. package/build/types/integrations/tracing-channel/graphql/graphql-types.d.ts +135 -0
  322. package/build/types/integrations/tracing-channel/graphql/graphql-types.d.ts.map +1 -0
  323. package/build/types/integrations/tracing-channel/graphql/index.d.ts +28 -0
  324. package/build/types/integrations/tracing-channel/graphql/index.d.ts.map +1 -0
  325. package/build/types/integrations/tracing-channel/graphql/resolvers.d.ts +13 -0
  326. package/build/types/integrations/tracing-channel/graphql/resolvers.d.ts.map +1 -0
  327. package/build/types/integrations/tracing-channel/graphql/spans.d.ts +17 -0
  328. package/build/types/integrations/tracing-channel/graphql/spans.d.ts.map +1 -0
  329. package/build/types/integrations/tracing-channel/graphql/types.d.ts +25 -0
  330. package/build/types/integrations/tracing-channel/graphql/types.d.ts.map +1 -0
  331. package/build/types/integrations/tracing-channel/ioredis.d.ts +20 -0
  332. package/build/types/integrations/tracing-channel/ioredis.d.ts.map +1 -1
  333. package/build/types/integrations/tracing-channel/kafkajs/consumer.d.ts +8 -0
  334. package/build/types/integrations/tracing-channel/kafkajs/consumer.d.ts.map +1 -0
  335. package/build/types/integrations/tracing-channel/kafkajs/index.d.ts +17 -0
  336. package/build/types/integrations/tracing-channel/kafkajs/index.d.ts.map +1 -0
  337. package/build/types/integrations/tracing-channel/kafkajs/semconv.d.ts +10 -0
  338. package/build/types/integrations/tracing-channel/kafkajs/semconv.d.ts.map +1 -0
  339. package/build/types/integrations/tracing-channel/kafkajs/spans.d.ts +38 -0
  340. package/build/types/integrations/tracing-channel/kafkajs/spans.d.ts.map +1 -0
  341. package/build/types/integrations/tracing-channel/kafkajs/types.d.ts +40 -0
  342. package/build/types/integrations/tracing-channel/kafkajs/types.d.ts.map +1 -0
  343. package/build/types/integrations/tracing-channel/knex.d.ts +11 -0
  344. package/build/types/integrations/tracing-channel/knex.d.ts.map +1 -0
  345. package/build/types/integrations/tracing-channel/mysql.d.ts.map +1 -1
  346. package/build/types/integrations/tracing-channel/mysql2.d.ts +15 -0
  347. package/build/types/integrations/tracing-channel/mysql2.d.ts.map +1 -0
  348. package/build/types/integrations/tracing-channel/openai.d.ts.map +1 -1
  349. package/build/types/integrations/tracing-channel/postgres-js.d.ts +26 -0
  350. package/build/types/integrations/tracing-channel/postgres-js.d.ts.map +1 -0
  351. package/build/types/integrations/tracing-channel/postgres.d.ts.map +1 -1
  352. package/build/types/integrations/tracing-channel/redis.d.ts +16 -0
  353. package/build/types/integrations/tracing-channel/redis.d.ts.map +1 -0
  354. package/build/types/integrations/tracing-channel/vercel-ai.d.ts +1 -1
  355. package/build/types/mongoose/mongoose-dc-subscriber.d.ts.map +1 -1
  356. package/build/types/mysql2/index.d.ts +11 -0
  357. package/build/types/mysql2/index.d.ts.map +1 -0
  358. package/build/types/mysql2/mysql2-dc-subscriber.d.ts +59 -0
  359. package/build/types/mysql2/mysql2-dc-subscriber.d.ts.map +1 -0
  360. package/build/types/orchestrion/bundler/esbuild.d.ts +21 -0
  361. package/build/types/orchestrion/bundler/esbuild.d.ts.map +1 -0
  362. package/build/types/orchestrion/bundler/options.d.ts +19 -0
  363. package/build/types/orchestrion/bundler/options.d.ts.map +1 -0
  364. package/build/types/orchestrion/bundler/rollup.d.ts +17 -0
  365. package/build/types/orchestrion/bundler/rollup.d.ts.map +1 -0
  366. package/build/types/orchestrion/bundler/vite.d.ts +4 -17
  367. package/build/types/orchestrion/bundler/vite.d.ts.map +1 -1
  368. package/build/types/orchestrion/bundler/webpack.d.ts +19 -0
  369. package/build/types/orchestrion/bundler/webpack.d.ts.map +1 -0
  370. package/build/types/orchestrion/channels.d.ts +71 -10
  371. package/build/types/orchestrion/channels.d.ts.map +1 -1
  372. package/build/types/orchestrion/config/amqplib.d.ts +66 -0
  373. package/build/types/orchestrion/config/amqplib.d.ts.map +1 -0
  374. package/build/types/orchestrion/config/dataloader.d.ts +46 -0
  375. package/build/types/orchestrion/config/dataloader.d.ts.map +1 -0
  376. package/build/types/orchestrion/config/express.d.ts +32 -0
  377. package/build/types/orchestrion/config/express.d.ts.map +1 -0
  378. package/build/types/orchestrion/config/firebase.d.ts +4 -0
  379. package/build/types/orchestrion/config/firebase.d.ts.map +1 -0
  380. package/build/types/orchestrion/config/generic-pool.d.ts +31 -0
  381. package/build/types/orchestrion/config/generic-pool.d.ts.map +1 -0
  382. package/build/types/orchestrion/config/google-genai.d.ts +30 -0
  383. package/build/types/orchestrion/config/google-genai.d.ts.map +1 -0
  384. package/build/types/orchestrion/config/graphql.d.ts +29 -0
  385. package/build/types/orchestrion/config/graphql.d.ts.map +1 -0
  386. package/build/types/orchestrion/config/index.d.ts +18 -5
  387. package/build/types/orchestrion/config/index.d.ts.map +1 -1
  388. package/build/types/orchestrion/config/kafkajs.d.ts +17 -0
  389. package/build/types/orchestrion/config/kafkajs.d.ts.map +1 -0
  390. package/build/types/orchestrion/config/knex.d.ts +9 -0
  391. package/build/types/orchestrion/config/knex.d.ts.map +1 -0
  392. package/build/types/orchestrion/config/langchain.d.ts +4 -0
  393. package/build/types/orchestrion/config/langchain.d.ts.map +1 -0
  394. package/build/types/orchestrion/config/langgraph.d.ts +4 -0
  395. package/build/types/orchestrion/config/langgraph.d.ts.map +1 -0
  396. package/build/types/orchestrion/config/mongodb.d.ts +4 -0
  397. package/build/types/orchestrion/config/mongodb.d.ts.map +1 -0
  398. package/build/types/orchestrion/config/mongoose.d.ts +4 -0
  399. package/build/types/orchestrion/config/mongoose.d.ts.map +1 -0
  400. package/build/types/orchestrion/config/mysql2.d.ts +18 -0
  401. package/build/types/orchestrion/config/mysql2.d.ts.map +1 -0
  402. package/build/types/orchestrion/config/nestjs.d.ts +24 -0
  403. package/build/types/orchestrion/config/nestjs.d.ts.map +1 -0
  404. package/build/types/orchestrion/config/postgres.d.ts +9 -0
  405. package/build/types/orchestrion/config/postgres.d.ts.map +1 -0
  406. package/build/types/orchestrion/config/prisma.d.ts +4 -0
  407. package/build/types/orchestrion/config/prisma.d.ts.map +1 -0
  408. package/build/types/orchestrion/config/react-router.d.ts +4 -0
  409. package/build/types/orchestrion/config/react-router.d.ts.map +1 -0
  410. package/build/types/orchestrion/config/redis.d.ts +37 -0
  411. package/build/types/orchestrion/config/redis.d.ts.map +1 -0
  412. package/build/types/orchestrion/config/remix.d.ts +4 -0
  413. package/build/types/orchestrion/config/remix.d.ts.map +1 -0
  414. package/build/types/orchestrion/config/tedious.d.ts +4 -0
  415. package/build/types/orchestrion/config/tedious.d.ts.map +1 -0
  416. package/build/types/orchestrion/config/vercel-ai.d.ts +1 -0
  417. package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -1
  418. package/build/types/orchestrion/detect.d.ts +3 -10
  419. package/build/types/orchestrion/detect.d.ts.map +1 -1
  420. package/build/types/orchestrion/index.d.ts +55 -4
  421. package/build/types/orchestrion/index.d.ts.map +1 -1
  422. package/build/types/orchestrion/runtime/register.d.ts +11 -9
  423. package/build/types/orchestrion/runtime/register.d.ts.map +1 -1
  424. package/build/types/prisma/global.d.ts +5 -0
  425. package/build/types/prisma/global.d.ts.map +1 -0
  426. package/build/types/prisma/index.d.ts +45 -0
  427. package/build/types/prisma/index.d.ts.map +1 -0
  428. package/build/types/prisma/tracing-helper.d.ts +46 -0
  429. package/build/types/prisma/tracing-helper.d.ts.map +1 -0
  430. package/build/types/prisma/types.d.ts +37 -0
  431. package/build/types/prisma/types.d.ts.map +1 -0
  432. package/build/types/redis/index.d.ts +18 -0
  433. package/build/types/redis/index.d.ts.map +1 -0
  434. package/build/types/redis/redis-dc-subscriber.d.ts +0 -5
  435. package/build/types/redis/redis-dc-subscriber.d.ts.map +1 -1
  436. package/build/types/tracing-channel.d.ts +5 -0
  437. package/build/types/tracing-channel.d.ts.map +1 -1
  438. package/build/types/vercel-ai/util.d.ts +30 -0
  439. package/build/types/vercel-ai/util.d.ts.map +1 -0
  440. package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts +6 -2
  441. package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -1
  442. package/build/types/vercel-ai/{vercel-ai-orchestrion-v6-subscriber.d.ts → vercel-ai-orchestrion-subscriber.d.ts} +1 -1
  443. package/build/types/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts.map +1 -0
  444. package/build/types-ts3.8/graphql/graphql-dc-subscriber.d.ts +94 -0
  445. package/build/types-ts3.8/graphql/index.d.ts +12 -0
  446. package/build/types-ts3.8/graphql/utils.d.ts +36 -0
  447. package/build/types-ts3.8/index.d.ts +6 -2
  448. package/build/types-ts3.8/integrations/tracing-channel/amqplib.d.ts +11 -0
  449. package/build/types-ts3.8/integrations/tracing-channel/dataloader.d.ts +11 -0
  450. package/build/types-ts3.8/integrations/tracing-channel/express/index.d.ts +18 -0
  451. package/build/types-ts3.8/integrations/tracing-channel/express/instrumentation.d.ts +4 -0
  452. package/build/types-ts3.8/integrations/tracing-channel/express/route.d.ts +28 -0
  453. package/build/types-ts3.8/integrations/tracing-channel/express/types.d.ts +64 -0
  454. package/build/types-ts3.8/integrations/tracing-channel/generic-pool.d.ts +10 -0
  455. package/build/types-ts3.8/integrations/tracing-channel/google-genai.d.ts +12 -0
  456. package/build/types-ts3.8/integrations/tracing-channel/graphql/constants.d.ts +12 -0
  457. package/build/types-ts3.8/integrations/tracing-channel/graphql/graphql-types.d.ts +135 -0
  458. package/build/types-ts3.8/integrations/tracing-channel/graphql/index.d.ts +30 -0
  459. package/build/types-ts3.8/integrations/tracing-channel/graphql/resolvers.d.ts +13 -0
  460. package/build/types-ts3.8/integrations/tracing-channel/graphql/spans.d.ts +17 -0
  461. package/build/types-ts3.8/integrations/tracing-channel/graphql/types.d.ts +25 -0
  462. package/build/types-ts3.8/integrations/tracing-channel/ioredis.d.ts +20 -0
  463. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/consumer.d.ts +8 -0
  464. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/index.d.ts +17 -0
  465. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/semconv.d.ts +10 -0
  466. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/spans.d.ts +38 -0
  467. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/types.d.ts +40 -0
  468. package/build/types-ts3.8/integrations/tracing-channel/knex.d.ts +11 -0
  469. package/build/types-ts3.8/integrations/tracing-channel/mysql2.d.ts +15 -0
  470. package/build/types-ts3.8/integrations/tracing-channel/postgres-js.d.ts +26 -0
  471. package/build/types-ts3.8/integrations/tracing-channel/redis.d.ts +16 -0
  472. package/build/types-ts3.8/integrations/tracing-channel/vercel-ai.d.ts +1 -1
  473. package/build/types-ts3.8/mysql2/index.d.ts +11 -0
  474. package/build/types-ts3.8/mysql2/mysql2-dc-subscriber.d.ts +59 -0
  475. package/build/types-ts3.8/orchestrion/bundler/esbuild.d.ts +21 -0
  476. package/build/types-ts3.8/orchestrion/bundler/options.d.ts +19 -0
  477. package/build/types-ts3.8/orchestrion/bundler/rollup.d.ts +17 -0
  478. package/build/types-ts3.8/orchestrion/bundler/vite.d.ts +4 -17
  479. package/build/types-ts3.8/orchestrion/bundler/webpack.d.ts +19 -0
  480. package/build/types-ts3.8/orchestrion/channels.d.ts +71 -10
  481. package/build/types-ts3.8/orchestrion/config/amqplib.d.ts +66 -0
  482. package/build/types-ts3.8/orchestrion/config/dataloader.d.ts +46 -0
  483. package/build/types-ts3.8/orchestrion/config/express.d.ts +32 -0
  484. package/build/types-ts3.8/orchestrion/config/firebase.d.ts +4 -0
  485. package/build/types-ts3.8/orchestrion/config/generic-pool.d.ts +31 -0
  486. package/build/types-ts3.8/orchestrion/config/google-genai.d.ts +30 -0
  487. package/build/types-ts3.8/orchestrion/config/graphql.d.ts +29 -0
  488. package/build/types-ts3.8/orchestrion/config/index.d.ts +18 -5
  489. package/build/types-ts3.8/orchestrion/config/kafkajs.d.ts +17 -0
  490. package/build/types-ts3.8/orchestrion/config/knex.d.ts +9 -0
  491. package/build/types-ts3.8/orchestrion/config/langchain.d.ts +4 -0
  492. package/build/types-ts3.8/orchestrion/config/langgraph.d.ts +4 -0
  493. package/build/types-ts3.8/orchestrion/config/mongodb.d.ts +4 -0
  494. package/build/types-ts3.8/orchestrion/config/mongoose.d.ts +4 -0
  495. package/build/types-ts3.8/orchestrion/config/mysql2.d.ts +18 -0
  496. package/build/types-ts3.8/orchestrion/config/nestjs.d.ts +24 -0
  497. package/build/types-ts3.8/orchestrion/config/postgres.d.ts +9 -0
  498. package/build/types-ts3.8/orchestrion/config/prisma.d.ts +4 -0
  499. package/build/types-ts3.8/orchestrion/config/react-router.d.ts +4 -0
  500. package/build/types-ts3.8/orchestrion/config/redis.d.ts +37 -0
  501. package/build/types-ts3.8/orchestrion/config/remix.d.ts +4 -0
  502. package/build/types-ts3.8/orchestrion/config/tedious.d.ts +4 -0
  503. package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +1 -0
  504. package/build/types-ts3.8/orchestrion/detect.d.ts +3 -10
  505. package/build/types-ts3.8/orchestrion/index.d.ts +57 -4
  506. package/build/types-ts3.8/orchestrion/runtime/register.d.ts +11 -9
  507. package/build/types-ts3.8/prisma/global.d.ts +5 -0
  508. package/build/types-ts3.8/prisma/index.d.ts +45 -0
  509. package/build/types-ts3.8/prisma/tracing-helper.d.ts +52 -0
  510. package/build/types-ts3.8/prisma/types.d.ts +40 -0
  511. package/build/types-ts3.8/redis/index.d.ts +18 -0
  512. package/build/types-ts3.8/redis/redis-dc-subscriber.d.ts +0 -5
  513. package/build/types-ts3.8/tracing-channel.d.ts +5 -0
  514. package/build/types-ts3.8/vercel-ai/util.d.ts +30 -0
  515. package/build/types-ts3.8/vercel-ai/vercel-ai-dc-subscriber.d.ts +6 -2
  516. package/build/types-ts3.8/vercel-ai/{vercel-ai-orchestrion-v6-subscriber.d.ts → vercel-ai-orchestrion-subscriber.d.ts} +1 -1
  517. package/package.json +41 -8
  518. package/build/cjs/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js.map +0 -1
  519. package/build/esm/vercel-ai/vercel-ai-orchestrion-v6-subscriber.js.map +0 -1
  520. package/build/types/vercel-ai/vercel-ai-orchestrion-v6-subscriber.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"detect.js","sources":["../../../src/orchestrion/detect.ts"],"sourcesContent":["import { debug } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var __SENTRY_ORCHESTRION__: { runtime?: boolean; bundler?: boolean } | undefined;\n}\n\n/**\n * Whether orchestrion has injected the diagnostics channels into this process,\n * either by the runtime `--import` hook / init-time registration (`runtime`)\n * or a bundler plugin (`bundler`). Both injectors set a flag on the\n * `globalThis.__SENTRY_ORCHESTRION__` marker.\n *\n * Use this to avoid wiring up channel-subscriber integrations when nothing\n * will ever publish to those channels.\n */\nexport function isOrchestrionInjected(): boolean {\n const marker = globalThis.__SENTRY_ORCHESTRION__;\n return !!(marker?.runtime || marker?.bundler);\n}\n\n/**\n * Verifies that the diagnostics channels have been injected either by the\n * runtime `--import` hook (or init-time registration), a bundler plugin, or\n * both, and warns if not.\n *\n * Both injectors being active at once is fine: they operate on disjoint module\n * sets (a module is either loaded through Node's loader and transformed by the\n * runtime hook, or inlined by the bundler and transformed by the plugin), so\n * a single module can't be double-wrapped. A hybrid setup, with some deps\n * external and runtime-instrumented, others bundled and plugin-instrumented,\n * is fine.\n *\n * Note: intentionally does NOT warn in production, only in debug builds,\n * because production warnings are reserved for truly critical issues.\n */\nexport function detectOrchestrionSetup(): void {\n if (!DEBUG_BUILD) return;\n\n const marker = globalThis.__SENTRY_ORCHESTRION__;\n const runtime = !!marker?.runtime;\n const bundler = !!marker?.bundler;\n\n DEBUG_BUILD && debug.log(`[orchestrion] detect: runtime=${runtime} bundler=${bundler}`);\n\n if (!isOrchestrionInjected()) {\n DEBUG_BUILD &&\n debug.warn(\n '[Sentry] No diagnostics-channel injection detected. Channel-based integrations ' +\n '(mysql, …) will not record spans. Make sure the diagnostics channels are injected ' +\n 'via the runtime `--import` hook or a bundler plugin before the instrumented modules load.',\n );\n }\n}\n"],"names":[],"mappings":";;;AAiBO,SAAS,qBAAA,GAAiC;AAC/C,EAAA,MAAM,SAAS,UAAA,CAAW,sBAAA;AAC1B,EAAA,OAAO,CAAC,EAAE,MAAA,EAAQ,OAAA,IAAW,MAAA,EAAQ,OAAA,CAAA;AACvC;AAiBO,SAAS,sBAAA,GAA+B;AAC7C,EAAA,IAAI,CAAC,WAAA,EAAa;AAElB,EAAA,MAAM,SAAS,UAAA,CAAW,sBAAA;AAC1B,EAAA,MAAM,OAAA,GAAU,CAAC,CAAC,MAAA,EAAQ,OAAA;AAC1B,EAAA,MAAM,OAAA,GAAU,CAAC,CAAC,MAAA,EAAQ,OAAA;AAE1B,EAAA,WAAA,IAAe,MAAM,GAAA,CAAI,CAAA,8BAAA,EAAiC,OAAO,CAAA,SAAA,EAAY,OAAO,CAAA,CAAE,CAAA;AAEtF,EAAA,IAAI,CAAC,uBAAsB,EAAG;AAC5B,IAAA,WAAA,IACE,KAAA,CAAM,IAAA;AAAA,MACJ;AAAA,KAGF;AAAA,EACJ;AACF;;;;"}
1
+ {"version":3,"file":"detect.js","sources":["../../../src/orchestrion/detect.ts"],"sourcesContent":["import { debug, GLOBAL_OBJ } from '@sentry/core';\n\n/**\n * Whether orchestrion has injected the diagnostics channels into this process,\n * either by the runtime `--import` hook / init-time registration (`runtime`)\n * or a bundler plugin (`bundler`). Both injectors set a flag on the\n * `globalThis.__SENTRY_ORCHESTRION__` marker.\n *\n * Use this to avoid wiring up channel-subscriber integrations when nothing\n * will ever publish to those channels.\n */\nexport function isOrchestrionInjected(): boolean {\n return !!GLOBAL_OBJ.__SENTRY_ORCHESTRION__;\n}\n\n/**\n * Verifies that the diagnostics channels have been injected either by the\n * runtime `--import` hook (or init-time registration), a bundler plugin, or\n * both, and warns if not. When at least one injector is active, logs for each\n * mechanism whether it hooked (a defined array, even empty, means it did) and\n * which libraries it injected.\n *\n * Both injectors being active at once is fine: they operate on disjoint module\n * sets (a module is either loaded through Node's loader and transformed by the\n * runtime hook, or inlined by the bundler and transformed by the plugin), so\n * a single module can't be double-wrapped. A hybrid setup, with some deps\n * external and runtime-instrumented, others bundled and plugin-instrumented,\n * is fine.\n */\nexport function detectOrchestrionSetup(): void {\n const { runtime, bundler } = GLOBAL_OBJ.__SENTRY_ORCHESTRION__ ?? {};\n\n if (!runtime && !bundler) {\n debug.warn(\n '[Sentry] No diagnostics-channel injection detected. Channel-based integrations ' +\n 'will not record spans. Make sure the diagnostics channels are injected ' +\n 'via the runtime `--import` hook or a bundler plugin before the instrumented modules load.',\n );\n return;\n }\n\n debug.log(\n runtime\n ? `[Sentry] Runtime hook registered, injected libraries=${JSON.stringify(runtime)}`\n : '[Sentry] Runtime hook not registered',\n );\n debug.log(\n bundler\n ? `[Sentry] Bundler plugin ran, injected libraries=${JSON.stringify(bundler)}`\n : '[Sentry] Bundler plugin did not run',\n );\n}\n"],"names":[],"mappings":";;AAWO,SAAS,qBAAA,GAAiC;AAC/C,EAAA,OAAO,CAAC,CAAC,UAAA,CAAW,sBAAA;AACtB;AAgBO,SAAS,sBAAA,GAA+B;AAC7C,EAAA,MAAM,EAAE,OAAA,EAAS,OAAA,EAAQ,GAAI,UAAA,CAAW,0BAA0B,EAAC;AAEnE,EAAA,IAAI,CAAC,OAAA,IAAW,CAAC,OAAA,EAAS;AACxB,IAAA,KAAA,CAAM,IAAA;AAAA,MACJ;AAAA,KAGF;AACA,IAAA;AAAA,EACF;AAEA,EAAA,KAAA,CAAM,GAAA;AAAA,IACJ,UACI,CAAA,qDAAA,EAAwD,IAAA,CAAK,SAAA,CAAU,OAAO,CAAC,CAAA,CAAA,GAC/E;AAAA,GACN;AACA,EAAA,KAAA,CAAM,GAAA;AAAA,IACJ,UACI,CAAA,gDAAA,EAAmD,IAAA,CAAK,SAAA,CAAU,OAAO,CAAC,CAAA,CAAA,GAC1E;AAAA,GACN;AACF;;;;"}
@@ -1,22 +1,43 @@
1
+ import { amqplibChannelIntegration } from '../integrations/tracing-channel/amqplib.js';
1
2
  import { anthropicChannelIntegration } from '../integrations/tracing-channel/anthropic.js';
3
+ export { dataloaderChannelIntegration } from '../integrations/tracing-channel/dataloader.js';
4
+ import { genericPoolChannelIntegration } from '../integrations/tracing-channel/generic-pool.js';
5
+ import { googleGenAIChannelIntegration } from '../integrations/tracing-channel/google-genai.js';
6
+ import { graphqlDiagnosticsChannelIntegration } from '../integrations/tracing-channel/graphql/index.js';
7
+ export { graphqlChannelIntegration } from '../integrations/tracing-channel/graphql/index.js';
2
8
  import { hapiChannelIntegration } from '../integrations/tracing-channel/hapi.js';
3
9
  export { ioredisChannelIntegration } from '../integrations/tracing-channel/ioredis.js';
10
+ import { kafkajsChannelIntegration } from '../integrations/tracing-channel/kafkajs/index.js';
11
+ export { knexChannelIntegration } from '../integrations/tracing-channel/knex.js';
4
12
  import { lruMemoizerChannelIntegration } from '../integrations/tracing-channel/lru-memoizer.js';
5
13
  import { mysqlChannelIntegration } from '../integrations/tracing-channel/mysql.js';
14
+ import { mysql2ChannelIntegration } from '../integrations/tracing-channel/mysql2.js';
6
15
  import { openaiChannelIntegration } from '../integrations/tracing-channel/openai.js';
7
16
  import { postgresChannelIntegration } from '../integrations/tracing-channel/postgres.js';
17
+ import { postgresJsChannelIntegration } from '../integrations/tracing-channel/postgres-js.js';
8
18
  import { vercelAiChannelIntegration } from '../integrations/tracing-channel/vercel-ai.js';
19
+ import { expressChannelIntegration } from '../integrations/tracing-channel/express/index.js';
9
20
  export { detectOrchestrionSetup, isOrchestrionInjected } from './detect.js';
21
+ export { nestjsChannels } from './config/nestjs.js';
22
+ export { redisChannelIntegration } from '../integrations/tracing-channel/redis.js';
10
23
 
11
24
  const channelIntegrations = {
12
25
  postgresIntegration: postgresChannelIntegration,
26
+ postgresJsIntegration: postgresJsChannelIntegration,
13
27
  mysqlIntegration: mysqlChannelIntegration,
28
+ mysql2Integration: mysql2ChannelIntegration,
29
+ genericPoolIntegration: genericPoolChannelIntegration,
14
30
  lruMemoizerIntegration: lruMemoizerChannelIntegration,
15
31
  openaiIntegration: openaiChannelIntegration,
16
32
  anthropicIntegration: anthropicChannelIntegration,
33
+ googleGenAIIntegration: googleGenAIChannelIntegration,
17
34
  vercelAiIntegration: vercelAiChannelIntegration,
18
- hapiIntegration: hapiChannelIntegration
35
+ amqplibIntegration: amqplibChannelIntegration,
36
+ hapiIntegration: hapiChannelIntegration,
37
+ expressIntegration: expressChannelIntegration,
38
+ graphqlIntegration: graphqlDiagnosticsChannelIntegration,
39
+ kafkajsIntegration: kafkajsChannelIntegration
19
40
  };
20
41
 
21
- export { anthropicChannelIntegration, channelIntegrations, hapiChannelIntegration, lruMemoizerChannelIntegration, mysqlChannelIntegration, openaiChannelIntegration, postgresChannelIntegration, vercelAiChannelIntegration };
42
+ export { amqplibChannelIntegration, anthropicChannelIntegration, channelIntegrations, expressChannelIntegration, genericPoolChannelIntegration, googleGenAIChannelIntegration, hapiChannelIntegration, kafkajsChannelIntegration, lruMemoizerChannelIntegration, mysql2ChannelIntegration, mysqlChannelIntegration, openaiChannelIntegration, postgresChannelIntegration, postgresJsChannelIntegration, vercelAiChannelIntegration };
22
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/orchestrion/index.ts"],"sourcesContent":["import { anthropicChannelIntegration } from '../integrations/tracing-channel/anthropic';\nimport { hapiChannelIntegration } from '../integrations/tracing-channel/hapi';\nimport { ioredisChannelIntegration } from '../integrations/tracing-channel/ioredis';\nimport { lruMemoizerChannelIntegration } from '../integrations/tracing-channel/lru-memoizer';\nimport { mysqlChannelIntegration } from '../integrations/tracing-channel/mysql';\nimport { openaiChannelIntegration } from '../integrations/tracing-channel/openai';\nimport { postgresChannelIntegration } from '../integrations/tracing-channel/postgres';\nimport { vercelAiChannelIntegration } from '../integrations/tracing-channel/vercel-ai';\n\nexport { detectOrchestrionSetup, isOrchestrionInjected } from './detect';\nexport {\n anthropicChannelIntegration,\n hapiChannelIntegration,\n ioredisChannelIntegration,\n lruMemoizerChannelIntegration,\n mysqlChannelIntegration,\n openaiChannelIntegration,\n postgresChannelIntegration,\n vercelAiChannelIntegration,\n};\nexport type { IORedisChannelIntegrationOptions, IORedisResponseHook } from '../integrations/tracing-channel/ioredis';\n\n/**\n * The canonical set of orchestrion diagnostics-channel integrations, keyed by their public\n * (OTel-parity) factory name.\n *\n * Single source of truth: add a new channel integration here and every consumer — the `@sentry/node`\n * opt-in helper (`experimentalUseDiagnosticsChannelInjection`) and its public\n * `diagnosticsChannelInjectionIntegrations()` map — picks it up automatically, so there's no separate\n * list to keep in sync.\n *\n * NOTE: `ioredisChannelIntegration` is intentionally NOT here. It only partially replaces the\n * composite OTel `Redis` integration and needs the node SDK's redis cache `responseHook` (which\n * can't live in `server-utils`), so `@sentry/node` wires it up separately.\n */\nexport const channelIntegrations = {\n postgresIntegration: postgresChannelIntegration,\n mysqlIntegration: mysqlChannelIntegration,\n lruMemoizerIntegration: lruMemoizerChannelIntegration,\n openaiIntegration: openaiChannelIntegration,\n anthropicIntegration: anthropicChannelIntegration,\n vercelAiIntegration: vercelAiChannelIntegration,\n hapiIntegration: hapiChannelIntegration,\n} as const;\n"],"names":[],"mappings":";;;;;;;;;;AAmCO,MAAM,mBAAA,GAAsB;AAAA,EACjC,mBAAA,EAAqB,0BAAA;AAAA,EACrB,gBAAA,EAAkB,uBAAA;AAAA,EAClB,sBAAA,EAAwB,6BAAA;AAAA,EACxB,iBAAA,EAAmB,wBAAA;AAAA,EACnB,oBAAA,EAAsB,2BAAA;AAAA,EACtB,mBAAA,EAAqB,0BAAA;AAAA,EACrB,eAAA,EAAiB;AACnB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/orchestrion/index.ts"],"sourcesContent":["import { amqplibChannelIntegration } from '../integrations/tracing-channel/amqplib';\nimport { anthropicChannelIntegration } from '../integrations/tracing-channel/anthropic';\nimport { dataloaderChannelIntegration } from '../integrations/tracing-channel/dataloader';\nimport { genericPoolChannelIntegration } from '../integrations/tracing-channel/generic-pool';\nimport { googleGenAIChannelIntegration } from '../integrations/tracing-channel/google-genai';\nimport {\n graphqlChannelIntegration,\n graphqlDiagnosticsChannelIntegration,\n} from '../integrations/tracing-channel/graphql';\nimport { hapiChannelIntegration } from '../integrations/tracing-channel/hapi';\nimport { ioredisChannelIntegration } from '../integrations/tracing-channel/ioredis';\nimport { kafkajsChannelIntegration } from '../integrations/tracing-channel/kafkajs';\nimport { knexChannelIntegration } from '../integrations/tracing-channel/knex';\nimport { lruMemoizerChannelIntegration } from '../integrations/tracing-channel/lru-memoizer';\nimport { mysqlChannelIntegration } from '../integrations/tracing-channel/mysql';\nimport { mysql2ChannelIntegration } from '../integrations/tracing-channel/mysql2';\nimport { openaiChannelIntegration } from '../integrations/tracing-channel/openai';\nimport { postgresChannelIntegration } from '../integrations/tracing-channel/postgres';\nimport { postgresJsChannelIntegration } from '../integrations/tracing-channel/postgres-js';\nimport { vercelAiChannelIntegration } from '../integrations/tracing-channel/vercel-ai';\nimport { expressChannelIntegration } from '../integrations/tracing-channel/express';\n\nexport { detectOrchestrionSetup, isOrchestrionInjected } from './detect';\n// The `@nestjs/*` channel names live here alongside their transform config; the\n// listener that subscribes to them lives in `@sentry/nestjs`, which imports this.\nexport { nestjsChannels } from './config/nestjs';\nexport {\n amqplibChannelIntegration,\n anthropicChannelIntegration,\n dataloaderChannelIntegration,\n genericPoolChannelIntegration,\n googleGenAIChannelIntegration,\n graphqlChannelIntegration,\n hapiChannelIntegration,\n ioredisChannelIntegration,\n kafkajsChannelIntegration,\n knexChannelIntegration,\n lruMemoizerChannelIntegration,\n mysqlChannelIntegration,\n mysql2ChannelIntegration,\n openaiChannelIntegration,\n postgresChannelIntegration,\n postgresJsChannelIntegration,\n vercelAiChannelIntegration,\n expressChannelIntegration,\n};\nexport type { IORedisChannelIntegrationOptions, IORedisResponseHook } from '../integrations/tracing-channel/ioredis';\nexport type { PostgresJsChannelIntegrationOptions } from '../integrations/tracing-channel/postgres-js';\nexport { redisChannelIntegration } from '../integrations/tracing-channel/redis';\nexport type { RedisChannelIntegrationOptions, RedisResponseHook } from '../integrations/tracing-channel/redis';\n\n// The structural `graphql` package types are the single source of truth shared with `@sentry/node`'s\n// vendored OTel graphql instrumentation (re-exported from here so the two can't drift).\nexport type * from '../integrations/tracing-channel/graphql/graphql-types';\n\n/**\n * The canonical set of orchestrion diagnostics-channel integrations, keyed by their public\n * (OTel-parity) factory name.\n *\n * Single source of truth: add a new channel integration here and every consumer — the `@sentry/node`\n * opt-in helper (`experimentalUseDiagnosticsChannelInjection`) and its public\n * `diagnosticsChannelInjectionIntegrations()` map — picks it up automatically, so there's no separate\n * list to keep in sync.\n *\n * NOTE: `ioredisChannelIntegration` and `redisChannelIntegration` are intentionally NOT here. They\n * only partially replace the composite OTel `Redis` integration and need the node SDK's redis cache\n * `responseHook` (which can't live in `server-utils`), so `@sentry/node` wires them up separately.\n *\n * Framework SDKs that own their own channel listener (e.g. `@sentry/nestjs`'s `Nest`) are NOT here\n * either: their transform config is still in `SENTRY_INSTRUMENTATIONS`, but the listener lives in\n * their package and picks the channel-vs-OTel path itself at `setupOnce`, so it needs no central swap.\n *\n * NOTE: `dataloaderChannelIntegration` is also NOT here. Everything in this map is auto-appended to\n * the default integrations, but the OTel `Dataloader` integration is opt-in (never a default). Like\n * `@sentry/nestjs`'s `Nest`, its `@sentry/node` factory picks the channel-vs-OTel path itself at\n * `setupOnce` (via `isOrchestrionInjected()`), so there's nothing for the central swap to do.\n */\nexport const channelIntegrations = {\n postgresIntegration: postgresChannelIntegration,\n postgresJsIntegration: postgresJsChannelIntegration,\n mysqlIntegration: mysqlChannelIntegration,\n mysql2Integration: mysql2ChannelIntegration,\n genericPoolIntegration: genericPoolChannelIntegration,\n lruMemoizerIntegration: lruMemoizerChannelIntegration,\n openaiIntegration: openaiChannelIntegration,\n anthropicIntegration: anthropicChannelIntegration,\n googleGenAIIntegration: googleGenAIChannelIntegration,\n vercelAiIntegration: vercelAiChannelIntegration,\n amqplibIntegration: amqplibChannelIntegration,\n hapiIntegration: hapiChannelIntegration,\n expressIntegration: expressChannelIntegration,\n graphqlIntegration: graphqlDiagnosticsChannelIntegration,\n kafkajsIntegration: kafkajsChannelIntegration,\n} as const;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA6EO,MAAM,mBAAA,GAAsB;AAAA,EACjC,mBAAA,EAAqB,0BAAA;AAAA,EACrB,qBAAA,EAAuB,4BAAA;AAAA,EACvB,gBAAA,EAAkB,uBAAA;AAAA,EAClB,iBAAA,EAAmB,wBAAA;AAAA,EACnB,sBAAA,EAAwB,6BAAA;AAAA,EACxB,sBAAA,EAAwB,6BAAA;AAAA,EACxB,iBAAA,EAAmB,wBAAA;AAAA,EACnB,oBAAA,EAAsB,2BAAA;AAAA,EACtB,sBAAA,EAAwB,6BAAA;AAAA,EACxB,mBAAA,EAAqB,0BAAA;AAAA,EACrB,kBAAA,EAAoB,yBAAA;AAAA,EACpB,eAAA,EAAiB,sBAAA;AAAA,EACjB,kBAAA,EAAoB,yBAAA;AAAA,EACpB,kBAAA,EAAoB,oCAAA;AAAA,EACpB,kBAAA,EAAoB;AACtB;;;;"}
@@ -1,37 +1,47 @@
1
- import { debug } from '@sentry/core';
1
+ import { GLOBAL_OBJ, debug } from '@sentry/core';
2
2
  import * as Module from 'node:module';
3
3
  import { createRequire } from 'node:module';
4
- import 'node:url';
4
+ import { pathToFileURL } from 'node:url';
5
5
  import { DEBUG_BUILD } from '../../debug-build.js';
6
6
  import { SENTRY_INSTRUMENTATIONS } from '../config/index.js';
7
7
 
8
- function registerDiagnosticsChannelInjection() {
9
- const g = globalThis.__SENTRY_ORCHESTRION__ ?? (globalThis.__SENTRY_ORCHESTRION__ = {});
10
- if (g.runtime || g.bundler) {
8
+ function hasStableSyncModuleHooks(denoVersionString) {
9
+ const parseVersion = (v) => v.split(".").map((n) => parseInt(n, 10));
10
+ const nodeVersion = parseVersion(process.versions.node ?? "0.0.0");
11
+ const denoVersion = parseVersion(denoVersionString ?? "0.0.0");
12
+ return (nodeVersion[0] ?? 0) > 25 || nodeVersion[0] === 25 && (nodeVersion[1] ?? 0) >= 1 || nodeVersion[0] === 24 && (nodeVersion[1] ?? 0) >= 13 || (denoVersion[0] ?? 0) > 2 || denoVersion[0] === 2 && (denoVersion[1] ?? 0) >= 8;
13
+ }
14
+ function registerDiagnosticsChannelInjection(options) {
15
+ if (GLOBAL_OBJ?.__SENTRY_ORCHESTRION__?.runtime) {
11
16
  return;
12
17
  }
13
18
  const globalAny = globalThis;
14
- const parseVersion = (v) => v.split(".").map((n) => parseInt(n, 10));
15
- const nodeVersion = parseVersion(process.versions.node ?? "0.0.0");
16
- const denoVersion = parseVersion(globalAny.Deno?.version?.deno ?? "0.0.0");
17
- const stableSyncHooks = (nodeVersion[0] ?? 0) > 25 || nodeVersion[0] === 25 && (nodeVersion[1] ?? 0) >= 1 || nodeVersion[0] === 24 && (nodeVersion[1] ?? 0) >= 13 || (denoVersion[0] ?? 0) > 2 || denoVersion[0] === 2 && (denoVersion[1] ?? 0) >= 8;
19
+ const stableSyncHooks = hasStableSyncModuleHooks(globalAny.Deno?.version?.deno);
20
+ let thisModuleUrl;
21
+ thisModuleUrl = import.meta.url;
18
22
  let nodeRequire;
19
23
  nodeRequire = createRequire(import.meta.url);
24
+ const tracingHooksDir = options?.tracingHooksDir;
25
+ const requireFromHooksDir = tracingHooksDir ? createRequire(thisModuleUrl) : void 0;
20
26
  const mod = Module;
21
27
  try {
22
28
  if (typeof mod.registerHooks === "function" && stableSyncHooks) {
23
- const { initialize, resolve, load } = nodeRequire("@apm-js-collab/tracing-hooks/hook-sync.mjs");
29
+ const { initialize, resolve, load, setDiagnosticsHook } = requireFromHooksDir ? requireFromHooksDir(`${tracingHooksDir}/hook-sync.mjs`) : nodeRequire("@apm-js-collab/tracing-hooks/hook-sync.mjs");
30
+ setDiagnosticsHook((event) => {
31
+ GLOBAL_OBJ.__SENTRY_ORCHESTRION__ = GLOBAL_OBJ.__SENTRY_ORCHESTRION__ || {};
32
+ GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime = GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime || [];
33
+ GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime.push(event.moduleName);
34
+ });
24
35
  initialize({ instrumentations: SENTRY_INSTRUMENTATIONS });
25
36
  mod.registerHooks({ resolve, load });
26
37
  DEBUG_BUILD && debug.log("[orchestrion] registered diagnostics-channel injection via Module.registerHooks()");
27
38
  } else if (typeof mod.register === "function" && !globalAny.Bun && !globalAny.Deno) {
28
- let parentURL;
29
- parentURL = import.meta.url;
30
- mod.register("@apm-js-collab/tracing-hooks/hook.mjs", {
31
- parentURL,
39
+ const hookSpecifier = tracingHooksDir ? pathToFileURL(`${tracingHooksDir}/hook.mjs`).href : "@apm-js-collab/tracing-hooks/hook.mjs";
40
+ mod.register(hookSpecifier, {
41
+ parentURL: thisModuleUrl,
32
42
  data: { instrumentations: SENTRY_INSTRUMENTATIONS }
33
43
  });
34
- const ModulePatch = nodeRequire("@apm-js-collab/tracing-hooks");
44
+ const ModulePatch = requireFromHooksDir && tracingHooksDir ? requireFromHooksDir(tracingHooksDir) : nodeRequire("@apm-js-collab/tracing-hooks");
35
45
  new ModulePatch({ instrumentations: SENTRY_INSTRUMENTATIONS }).patch();
36
46
  DEBUG_BUILD && debug.log("[orchestrion] registered diagnostics-channel injection via Module.register()");
37
47
  } else {
@@ -45,7 +55,8 @@ function registerDiagnosticsChannelInjection() {
45
55
  );
46
56
  return;
47
57
  }
48
- g.runtime = true;
58
+ GLOBAL_OBJ.__SENTRY_ORCHESTRION__ = GLOBAL_OBJ.__SENTRY_ORCHESTRION__ || {};
59
+ GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime = GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime || [];
49
60
  }
50
61
 
51
62
  export { registerDiagnosticsChannelInjection };
@@ -1 +1 @@
1
- {"version":3,"file":"register.js","sources":["../../../../src/orchestrion/runtime/register.ts"],"sourcesContent":["import { debug } from '@sentry/core';\nimport { createRequire } from 'node:module';\nimport * as Module from 'node:module';\nimport { pathToFileURL } from 'node:url';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { SENTRY_INSTRUMENTATIONS } from '../config';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var __SENTRY_ORCHESTRION__: { runtime?: boolean; bundler?: boolean } | undefined;\n}\n\n/**\n * Synchronously register the diagnostics-channel injection module hooks.\n *\n * This is the single source of truth for the registration logic. It is used by:\n * - `Sentry.init()` (the Node SDK calls it directly — that's why this module\n * must be CJS-compatible / dual-built, so it can be `require()`d synchronously\n * before the app's `import`s resolve), and\n * - `import-hook.mjs`, the side-effecting `--import` entry, which just calls it.\n *\n * Libraries imported *after* this call publish the `tracingChannel` events that\n * the channel-based integrations subscribe to.\n *\n * Idempotent via `globalThis.__SENTRY_ORCHESTRION__` — a no-op if the runtime\n * `--import` hook or a bundler plugin already injected the channels.\n */\nexport function registerDiagnosticsChannelInjection(): void {\n const g = (globalThis.__SENTRY_ORCHESTRION__ ??= {});\n\n // Already injected (runtime --import hook or bundler plugin) — nothing to do.\n if (g.runtime || g.bundler) {\n return;\n }\n\n const globalAny = globalThis as { Bun?: unknown; Deno?: { version?: { deno?: string } } };\n const parseVersion = (v: string): number[] => v.split('.').map(n => parseInt(n, 10));\n const nodeVersion = parseVersion(process.versions.node ?? '0.0.0');\n const denoVersion = parseVersion(globalAny.Deno?.version?.deno ?? '0.0.0');\n // `Module.registerHooks` only became stable in Node 24.13 / 25.1 and Deno 2.8.\n const stableSyncHooks =\n (nodeVersion[0] ?? 0) > 25 ||\n (nodeVersion[0] === 25 && (nodeVersion[1] ?? 0) >= 1) ||\n (nodeVersion[0] === 24 && (nodeVersion[1] ?? 0) >= 13) ||\n (denoVersion[0] ?? 0) > 2 ||\n (denoVersion[0] === 2 && (denoVersion[1] ?? 0) >= 8);\n\n let nodeRequire: (specifier: string) => unknown;\n /*! rollup-include-cjs-only */\n nodeRequire = require;\n /*! rollup-include-cjs-only-end */\n /*! rollup-include-esm-only */\n nodeRequire = createRequire(import.meta.url);\n /*! rollup-include-esm-only-end */\n\n // `Module.registerHooks` / `Module.register` are newer than the @types/node\n // we build against, hence the cast.\n const mod = Module as unknown as {\n registerHooks?: (hooks: unknown) => void;\n register?: (specifier: string, options: unknown) => void;\n };\n\n // runs both at `--import` time and (synchronously) inside `Sentry.init()`,\n // so an unguarded throw would either abort startup or make `init()` throw.\n // On any failure (e.g. dep resolution, `require(esm)` / Node-compat\n // incompatibility) we warn (DEBUG only) and continue without channel\n // injection\n try {\n if (typeof mod.registerHooks === 'function' && stableSyncHooks) {\n // Sync hooks cover CJS and ESM, no separate `_compile` patch needed.\n // We require() the module here so that we can synchronously load it,\n // including from a CommonJS Sentry build, without bundlers pulling in.\n // All versions in stableSyncHooks support this.\n const { initialize, resolve, load } = nodeRequire('@apm-js-collab/tracing-hooks/hook-sync.mjs') as {\n initialize: (opts: { instrumentations: unknown }) => void;\n resolve: unknown;\n load: unknown;\n };\n initialize({ instrumentations: SENTRY_INSTRUMENTATIONS });\n mod.registerHooks({ resolve, load });\n DEBUG_BUILD && debug.log('[orchestrion] registered diagnostics-channel injection via Module.registerHooks()');\n } else if (typeof mod.register === 'function' && !globalAny.Bun && !globalAny.Deno) {\n // `Module.register` + the `_compile` patch is Node 18.19–24.12 / 25.0\n // path. Bun/Deno are excluded: they don't support this combination and\n // must use the stable `registerHooks` path above (or none at all).\n let parentURL: string;\n /*! rollup-include-cjs-only */\n parentURL = pathToFileURL(__filename).href;\n /*! rollup-include-cjs-only-end */\n /*! rollup-include-esm-only */\n parentURL = import.meta.url;\n /*! rollup-include-esm-only-end */\n\n mod.register('@apm-js-collab/tracing-hooks/hook.mjs', {\n parentURL,\n data: { instrumentations: SENTRY_INSTRUMENTATIONS },\n });\n\n // ALSO patch `Module.prototype._compile` for the CJS side: when an ESM\n // file `import`s a CJS package, the package's internal `require()` calls\n // are resolved through the CJS machinery and never reach the ESM\n // register hook, so without this patch the file we want to instrument\n // loads untransformed.\n const ModulePatch = nodeRequire('@apm-js-collab/tracing-hooks') as new (opts: { instrumentations: unknown }) => {\n patch: () => void;\n };\n new ModulePatch({ instrumentations: SENTRY_INSTRUMENTATIONS }).patch();\n DEBUG_BUILD && debug.log('[orchestrion] registered diagnostics-channel injection via Module.register()');\n } else {\n DEBUG_BUILD &&\n debug.warn('[Sentry] No available Node API to register diagnostics-channel injection hooks; skipping.');\n return;\n }\n } catch (error) {\n DEBUG_BUILD &&\n debug.warn(\n '[Sentry] Failed to register diagnostics-channel injection hooks; channel-based integrations ' +\n 'will not record spans.',\n error,\n );\n return;\n }\n\n g.runtime = true;\n}\n"],"names":[],"mappings":";;;;;;;AA2BO,SAAS,mCAAA,GAA4C;AAC1D,EAAA,MAAM,CAAA,GAAK,UAAA,CAAW,sBAAA,KAAX,UAAA,CAAW,yBAA2B,EAAC,CAAA;AAGlD,EAAA,IAAI,CAAA,CAAE,OAAA,IAAW,CAAA,CAAE,OAAA,EAAS;AAC1B,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,SAAA,GAAY,UAAA;AAClB,EAAA,MAAM,YAAA,GAAe,CAAC,CAAA,KAAwB,CAAA,CAAE,KAAA,CAAM,GAAG,CAAA,CAAE,GAAA,CAAI,CAAA,CAAA,KAAK,QAAA,CAAS,CAAA,EAAG,EAAE,CAAC,CAAA;AACnF,EAAA,MAAM,WAAA,GAAc,YAAA,CAAa,OAAA,CAAQ,QAAA,CAAS,QAAQ,OAAO,CAAA;AACjE,EAAA,MAAM,cAAc,YAAA,CAAa,SAAA,CAAU,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4G,QAC9G,IAAA,EAAA,EAAW,gBAAW,EAAA,uBAA4B;AAIhD,OAAA,CAAA;AAAI,MACJ,MAAA,WAAA,GAAA,WAAA,CAAA,8BAAA,CAAA;AACA,MAAA,IAAA,WAAY,CAAA,EAAA,kBAAwB,uBAAE,EAAA,CAAA,CAAA,KAAA,EAAA;AAAA,MACtC,WAAA,IAAA,KAAA,CAAA,GAAA,CAAA,8EAAA,CAAA;AAAA,IAAA,CAAA,MACA;AACA,MAAA,WAAA,IAAY,KAAA,CAAA,IAAY,CAAA,2FAAA,CAAA;AAAA,MACxB;AAEA,IAAA;AAAsD,EAAA,CAAA,CAAA,OACpD,KAAA,EAAA;AAAA,IAAA,WACM,IAAE,KAAA,CAAA,IAAA;AAA0C,MACpD,oHAAC;AAOD,MAAA;AAGA,KAAA;AACA,IAAA;AAAuG,EAAA;AAEvG,EAAA,CAAA,CAAA,OAAA,GAAA,IAAA;AAEA;;;;"}
1
+ {"version":3,"file":"register.js","sources":["../../../../src/orchestrion/runtime/register.ts"],"sourcesContent":["import { debug, GLOBAL_OBJ } from '@sentry/core';\nimport { createRequire } from 'node:module';\nimport * as Module from 'node:module';\nimport { pathToFileURL } from 'node:url';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { SENTRY_INSTRUMENTATIONS } from '../config';\nimport type { InstrumentationConfig } from '@apm-js-collab/code-transformer';\nimport type { register } from 'node:module';\n\ntype TracingHooksSync = {\n initialize: (opts: { instrumentations: InstrumentationConfig[] }) => void;\n resolve: Function;\n load: Function;\n setDiagnosticsHook: (callback: (event: { url: string; moduleName: string; error: Error }) => void) => void;\n};\n\ntype NodeModule = {\n registerHooks?: (options: unknown) => { deregister: () => void };\n register?: typeof register;\n};\n\nexport interface RegisterDiagnosticsChannelInjectionOptions {\n /**\n * Absolute directory of the `@apm-js-collab/tracing-hooks` package (forward slashes).\n *\n * Needed when SDK code is bundled into an app's server build: the default bare-specifier\n * require then resolves from the emitted chunk, which fails under isolated installs (pnpm).\n * Framework SDKs (e.g. `@sentry/nextjs`) resolve the package at build time and pass its\n * location here; it is loaded through an opaque `createRequire` that bundlers can't trace.\n */\n tracingHooksDir?: string;\n}\n\n/** `Module.registerHooks` only became stable in Node 24.13 / 25.1 and Deno 2.8. */\nfunction hasStableSyncModuleHooks(denoVersionString: string | undefined): boolean {\n const parseVersion = (v: string): number[] => v.split('.').map(n => parseInt(n, 10));\n const nodeVersion = parseVersion(process.versions.node ?? '0.0.0');\n const denoVersion = parseVersion(denoVersionString ?? '0.0.0');\n return (\n (nodeVersion[0] ?? 0) > 25 ||\n (nodeVersion[0] === 25 && (nodeVersion[1] ?? 0) >= 1) ||\n (nodeVersion[0] === 24 && (nodeVersion[1] ?? 0) >= 13) ||\n (denoVersion[0] ?? 0) > 2 ||\n (denoVersion[0] === 2 && (denoVersion[1] ?? 0) >= 8)\n );\n}\n\n/**\n * Synchronously register the diagnostics-channel injection module hooks.\n *\n * This is the single source of truth for the registration logic. It is used by:\n * - `Sentry.init()` (the Node SDK calls it directly — that's why this module\n * must be CJS-compatible / dual-built, so it can be `require()`d synchronously\n * before the app's `import`s resolve), and\n * - `import-hook.mjs`, the side-effecting `--import` entry, which just calls it.\n *\n * Libraries imported *after* this call publish the `tracingChannel` events that\n * the channel-based integrations subscribe to.\n */\nexport function registerDiagnosticsChannelInjection(options?: RegisterDiagnosticsChannelInjectionOptions): void {\n if (GLOBAL_OBJ?.__SENTRY_ORCHESTRION__?.runtime) {\n return;\n }\n\n const globalAny = globalThis as { Bun?: unknown; Deno?: { version?: { deno?: string } } };\n const stableSyncHooks = hasStableSyncModuleHooks(globalAny.Deno?.version?.deno);\n\n let thisModuleUrl: string;\n /*! rollup-include-cjs-only */\n thisModuleUrl = pathToFileURL(__filename).href;\n /*! rollup-include-cjs-only-end */\n /*! rollup-include-esm-only */\n thisModuleUrl = import.meta.url;\n /*! rollup-include-esm-only-end */\n\n // Default: bare specifiers via a plain (aliased) `require`, so bundlers see and resolve them\n // like any other dependency. Override: with `tracingHooksDir`, absolute paths are loaded through\n // `createRequire`, which bundlers leave as a true runtime require — they must not statically\n // resolve these (Turbopack fails the build on an absolute request, and the machinery breaks when\n // bundled anyway). `createRequire` rather than ignore-comments because webpack only honors\n // `webpackIgnore` on `import()`, not `require()` (it compiles the call to a broken module stub).\n let nodeRequire: (specifier: string) => unknown;\n /*! rollup-include-cjs-only */\n nodeRequire = require;\n /*! rollup-include-cjs-only-end */\n /*! rollup-include-esm-only */\n nodeRequire = createRequire(import.meta.url);\n /*! rollup-include-esm-only-end */\n\n const tracingHooksDir = options?.tracingHooksDir;\n const requireFromHooksDir = tracingHooksDir ? createRequire(thisModuleUrl) : undefined;\n\n // `Module.registerHooks` / `Module.register` are newer than the @types/node\n // we build against, hence the cast.\n const mod = Module as NodeModule;\n\n // runs both at `--import` time and (synchronously) inside `Sentry.init()`,\n // so an unguarded throw would either abort startup or make `init()` throw.\n // On any failure (e.g. dep resolution, `require(esm)` / Node-compat\n // incompatibility) we warn (DEBUG only) and continue without channel\n // injection\n try {\n if (typeof mod.registerHooks === 'function' && stableSyncHooks) {\n // Sync hooks cover CJS and ESM, no separate `_compile` patch needed.\n // We require() the module here so that we can synchronously load it,\n // including from a CommonJS Sentry build, without bundlers pulling in.\n // All versions in stableSyncHooks support this.\n const { initialize, resolve, load, setDiagnosticsHook } = (\n requireFromHooksDir\n ? requireFromHooksDir(`${tracingHooksDir}/hook-sync.mjs`)\n : nodeRequire('@apm-js-collab/tracing-hooks/hook-sync.mjs')\n ) as TracingHooksSync;\n\n setDiagnosticsHook(event => {\n GLOBAL_OBJ.__SENTRY_ORCHESTRION__ = GLOBAL_OBJ.__SENTRY_ORCHESTRION__ || {};\n GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime = GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime || [];\n GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime.push(event.moduleName);\n });\n\n initialize({ instrumentations: SENTRY_INSTRUMENTATIONS });\n mod.registerHooks({ resolve, load });\n DEBUG_BUILD && debug.log('[orchestrion] registered diagnostics-channel injection via Module.registerHooks()');\n } else if (typeof mod.register === 'function' && !globalAny.Bun && !globalAny.Deno) {\n // `Module.register` + the `_compile` patch is Node 18.19–24.12 / 25.0\n // path. Bun/Deno are excluded: they don't support this combination and\n // must use the stable `registerHooks` path above (or none at all).\n // `Module.register` resolves ESM-style: a bare package specifier is resolved against\n // `parentURL`, but a filesystem path (the `tracingHooksDir` override) is not a valid ESM\n // specifier and must be passed as a file:// URL.\n const hookSpecifier = tracingHooksDir\n ? pathToFileURL(`${tracingHooksDir}/hook.mjs`).href\n : '@apm-js-collab/tracing-hooks/hook.mjs';\n mod.register(hookSpecifier, {\n parentURL: thisModuleUrl,\n data: { instrumentations: SENTRY_INSTRUMENTATIONS },\n });\n\n // ALSO patch `Module.prototype._compile` for the CJS side: when an ESM\n // file `import`s a CJS package, the package's internal `require()` calls\n // are resolved through the CJS machinery and never reach the ESM\n // register hook, so without this patch the file we want to instrument\n // loads untransformed.\n const ModulePatch = (\n requireFromHooksDir && tracingHooksDir\n ? requireFromHooksDir(tracingHooksDir)\n : nodeRequire('@apm-js-collab/tracing-hooks')\n ) as new (opts: { instrumentations: unknown }) => {\n patch: () => void;\n };\n new ModulePatch({ instrumentations: SENTRY_INSTRUMENTATIONS }).patch();\n DEBUG_BUILD && debug.log('[orchestrion] registered diagnostics-channel injection via Module.register()');\n } else {\n DEBUG_BUILD &&\n debug.warn('[Sentry] No available Node API to register diagnostics-channel injection hooks; skipping.');\n return;\n }\n } catch (error) {\n DEBUG_BUILD &&\n debug.warn(\n '[Sentry] Failed to register diagnostics-channel injection hooks; channel-based integrations ' +\n 'will not record spans.',\n error,\n );\n return;\n }\n\n GLOBAL_OBJ.__SENTRY_ORCHESTRION__ = GLOBAL_OBJ.__SENTRY_ORCHESTRION__ || {};\n GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime = GLOBAL_OBJ.__SENTRY_ORCHESTRION__.runtime || [];\n}\n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AAA,SAAA,EAAW,aAAA;AACX,QAAA,IAAA,EAAA,EAAA,gBAAW,EAAA,uBAAiC;AAC5C,OAAA,CAAA;AAA+D,MACjE,MAAC,WAAA,GAAA,mBAAA,IAAA,eAAA,GAAA,mBAAA,CAAA,eAAA,CAAA,GAAA,WAAA,CAAA,8BAAA,CAAA;AAED,MAAA,IAAA,WAAa,CAAA,EAAA,gBAAkB,EAAA,uBAAyB,EAAA,CAAA,CAAA,KAAA,EAAA;AACxD,MAAA,WAAI,IAAA,KAAgB,CAAA,GAAA,CAAA,8EAAe,CAAA;AACnC,IAAA,CAAA,MAAA;AAA4G,MAC9G,WAAW,IAAA,KAAW,CAAA,IAAA,CAAA,2FAA8D,CAAA;AAOlF,MAAA;AAGA,IAAA;AAA4B,EAAA,CAAA,CAAA,OAC1B,KAAA,EAAA;AAAW,IAAA,WACL,IAAE,KAAA,CAAA,IAAA;AAA0C,MACpD,oHAAC;AAOD,MAAA;AAOA,KAAA;AACA,IAAA;AAAuG,EAAA;AAEvG,EAAA,UAAA,CAAA,sBACa,GAAA,UAAA,CAAA,sBAAA,IAAA,EAAA;AACb,EAAA,UAAA,CAAA,sBAAA,CAAA,OAAA,GAAA,UAAA,CAAA,sBAAA,CAAA,OAAA,IAAA,EAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"10.64.0","sideEffects":false}
1
+ {"type":"module","version":"10.66.0","sideEffects":false}
@@ -0,0 +1,12 @@
1
+ const majorVersion = "7";
2
+ const GLOBAL_INSTRUMENTATION_KEY = "PRISMA_INSTRUMENTATION";
3
+ const GLOBAL_VERSIONED_INSTRUMENTATION_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION`;
4
+ const globalThisWithPrismaInstrumentation = globalThis;
5
+ function setGlobalTracingHelper(helper) {
6
+ const globalValue = { helper };
7
+ globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY] = globalValue;
8
+ globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY] = globalValue;
9
+ }
10
+
11
+ export { setGlobalTracingHelper };
12
+ //# sourceMappingURL=global.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.js","sources":["../../../src/prisma/global.ts"],"sourcesContent":["/*\n * Copyright Prisma\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/prisma/prisma/tree/b6feea5565ec577545a79547d24273ccdd11b4c7/packages/instrumentation-contract\n * - Upstream version: @prisma/instrumentation-contract@7.8.0\n * - Replaced `import packageJson from '../package.json'` with hardcoded major version\n */\n\nimport type { PrismaInstrumentationGlobalValue, TracingHelper } from './types';\n\nconst majorVersion = '7';\n\nconst GLOBAL_INSTRUMENTATION_KEY = 'PRISMA_INSTRUMENTATION';\nconst GLOBAL_VERSIONED_INSTRUMENTATION_KEY = `V${majorVersion}_PRISMA_INSTRUMENTATION` as const;\n\ntype GlobalThisWithPrismaInstrumentation = typeof globalThis & {\n [GLOBAL_INSTRUMENTATION_KEY]?: PrismaInstrumentationGlobalValue;\n} & {\n [K in typeof GLOBAL_VERSIONED_INSTRUMENTATION_KEY]?: PrismaInstrumentationGlobalValue;\n};\n\nconst globalThisWithPrismaInstrumentation = globalThis as GlobalThisWithPrismaInstrumentation;\n\nexport function getGlobalTracingHelper(): TracingHelper | undefined {\n const versionedGlobal = globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY];\n\n if (versionedGlobal?.helper) {\n return versionedGlobal.helper;\n }\n\n const fallbackGlobal = globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY];\n\n return fallbackGlobal?.helper;\n}\n\nexport function setGlobalTracingHelper(helper: TracingHelper): void {\n const globalValue: PrismaInstrumentationGlobalValue = { helper };\n\n globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY] = globalValue;\n globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY] = globalValue;\n}\n\nexport function clearGlobalTracingHelper(): void {\n globalThisWithPrismaInstrumentation[GLOBAL_VERSIONED_INSTRUMENTATION_KEY] = undefined;\n globalThisWithPrismaInstrumentation[GLOBAL_INSTRUMENTATION_KEY] = undefined;\n}\n"],"names":[],"mappings":"AAYA,MAAM,YAAA,GAAe,GAAA;AAErB,MAAM,0BAAA,GAA6B,wBAAA;AACnC,MAAM,oCAAA,GAAuC,IAAI,YAAY,CAAA,uBAAA,CAAA;AAQ7D,MAAM,mCAAA,GAAsC,UAAA;AAcrC,SAAS,uBAAuB,MAAA,EAA6B;AAClE,EAAA,MAAM,WAAA,GAAgD,EAAE,MAAA,EAAO;AAE/D,EAAA,mCAAA,CAAoC,oCAAoC,CAAA,GAAI,WAAA;AAC5E,EAAA,mCAAA,CAAoC,0BAA0B,CAAA,GAAI,WAAA;AACpE;;;;"}
@@ -0,0 +1,24 @@
1
+ import { defineIntegration } from '@sentry/core';
2
+ import { setGlobalTracingHelper } from './global.js';
3
+ import { ActiveTracingHelper } from './tracing-helper.js';
4
+
5
+ const INTEGRATION_NAME = "Prisma";
6
+ function instrumentPrisma(options) {
7
+ setGlobalTracingHelper(
8
+ new ActiveTracingHelper({
9
+ ignoreSpanTypes: options?.instrumentationConfig?.ignoreSpanTypes ?? []
10
+ })
11
+ );
12
+ }
13
+ const _prismaIntegration = ((options) => {
14
+ return {
15
+ name: INTEGRATION_NAME,
16
+ setupOnce() {
17
+ instrumentPrisma(options);
18
+ }
19
+ };
20
+ });
21
+ const prismaIntegration = defineIntegration(_prismaIntegration);
22
+
23
+ export { instrumentPrisma, prismaIntegration };
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/prisma/index.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { setGlobalTracingHelper } from './global';\nimport { ActiveTracingHelper } from './tracing-helper';\n\nconst INTEGRATION_NAME = 'Prisma' as const;\n\nexport interface PrismaInstrumentationConfig {\n /**\n * Span types that should not be traced. Matched against the full span name (e.g. `prisma:client:operation`),\n * either exactly (string) or by pattern (RegExp).\n */\n ignoreSpanTypes?: (string | RegExp)[];\n}\n\nexport interface PrismaOptions {\n /**\n * @deprecated This is no longer used, v5 works out of the box.\n */\n prismaInstrumentation?: unknown;\n /**\n * Configuration for the Prisma tracing helper.\n */\n instrumentationConfig?: PrismaInstrumentationConfig;\n}\n\n/**\n * Sets up the global Prisma tracing helper that Prisma looks up on `globalThis` to emit tracing data.\n *\n * Prisma reads `globalThis.PRISMA_INSTRUMENTATION` (and its versioned variant) to find a \"TracingHelper\"\n * which it uses internally to create spans, so it can produce tracing data without depending on\n * OpenTelemetry. The helper we install here mints spans through Sentry's span APIs. A single helper\n * serves both Prisma v5 (which calls `createEngineSpan`) and v6/v7 (which call `dispatchEngineSpans`),\n * so it doesn't blow up on version mismatches.\n */\nexport function instrumentPrisma(options?: PrismaOptions): void {\n setGlobalTracingHelper(\n new ActiveTracingHelper({\n ignoreSpanTypes: options?.instrumentationConfig?.ignoreSpanTypes ?? [],\n }),\n );\n}\n\nconst _prismaIntegration = ((options?: PrismaOptions) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentPrisma(options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [prisma](https://www.npmjs.com/package/prisma) library.\n * For more information, see the [`prismaIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/prisma/).\n *\n * NOTE: This integration works out of the box with Prisma v6, and v7.\n * On Prisma versions prior to v6, add `previewFeatures = [\"tracing\"]` to the client generator block of your Prisma schema:\n *\n * ```\n * generator client {\n * provider = \"prisma-client-js\"\n * previewFeatures = [\"tracing\"]\n * }\n * ```\n */\nexport const prismaIntegration = defineIntegration(_prismaIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,QAAA;AA8BlB,SAAS,iBAAiB,OAAA,EAA+B;AAC9D,EAAA,sBAAA;AAAA,IACE,IAAI,mBAAA,CAAoB;AAAA,MACtB,eAAA,EAAiB,OAAA,EAAS,qBAAA,EAAuB,eAAA,IAAmB;AAAC,KACtE;AAAA,GACH;AACF;AAEA,MAAM,kBAAA,IAAsB,CAAC,OAAA,KAA4B;AACvD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,gBAAA,CAAiB,OAAO,CAAA;AAAA,IAC1B;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,iBAAA,GAAoB,kBAAkB,kBAAkB;;;;"}
@@ -0,0 +1,209 @@
1
+ import { LRUMap, getActiveSpan, debug, startInactiveSpan, startSpanManual, SPAN_KIND, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
2
+ import { DEBUG_BUILD } from '../debug-build.js';
3
+ import { DB_SYSTEM } from '@sentry/conventions/attributes';
4
+
5
+ const showAllTraces = (() => {
6
+ try {
7
+ return process.env.PRISMA_SHOW_ALL_TRACES === "true";
8
+ } catch {
9
+ return false;
10
+ }
11
+ })();
12
+ const nonSampledTraceParent = `00-10-10-00`;
13
+ const PRISMA_ORIGIN = "auto.db.otel.prisma";
14
+ const MAX_TRACKED_PRISMA_SPANS = 1e3;
15
+ const prismaSpanRegistry = new LRUMap(MAX_TRACKED_PRISMA_SPANS);
16
+ const pendingEngineSpans = [];
17
+ function registerPrismaSpan(id, span) {
18
+ prismaSpanRegistry.set(id, span);
19
+ }
20
+ function buildSpanAttributes(name, attributes) {
21
+ const merged = {
22
+ ...attributes,
23
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PRISMA_ORIGIN
24
+ };
25
+ if (name === "prisma:engine:db_query" && merged[DB_SYSTEM] == null) {
26
+ merged[DB_SYSTEM] = "prisma";
27
+ }
28
+ return merged;
29
+ }
30
+ function buildSpanName(name, attributes) {
31
+ const queryText = attributes["db.query.text"];
32
+ if ((name === "prisma:engine:db_query" || name === "prisma:client:db_query") && typeof queryText === "string") {
33
+ return queryText;
34
+ }
35
+ return name;
36
+ }
37
+ function createResolvedEngineSpans() {
38
+ let createdSpan = true;
39
+ while (createdSpan) {
40
+ createdSpan = false;
41
+ for (let i = pendingEngineSpans.length - 1; i >= 0; i--) {
42
+ const engineSpan = pendingEngineSpans[i];
43
+ const parentSpan = prismaSpanRegistry.get(engineSpan.parent_span_id);
44
+ if (!parentSpan) {
45
+ continue;
46
+ }
47
+ const attributes = buildSpanAttributes(engineSpan.name, engineSpan.attributes);
48
+ const span = startInactiveSpan({
49
+ name: buildSpanName(engineSpan.name, attributes),
50
+ attributes,
51
+ kind: engineSpan.kind === "client" ? SPAN_KIND.CLIENT : SPAN_KIND.INTERNAL,
52
+ startTime: engineSpan.start_time,
53
+ parentSpan
54
+ });
55
+ registerPrismaSpan(engineSpan.span_id, span);
56
+ if (engineSpan.links) {
57
+ span.addLinks(
58
+ engineSpan.links.flatMap((link) => {
59
+ const linkedSpan = prismaSpanRegistry.get(link.span_id);
60
+ return linkedSpan ? [{ context: linkedSpan.spanContext() }] : [];
61
+ })
62
+ );
63
+ }
64
+ span.end(engineSpan.end_time);
65
+ pendingEngineSpans.splice(i, 1);
66
+ createdSpan = true;
67
+ }
68
+ }
69
+ }
70
+ class ActiveTracingHelper {
71
+ constructor({ ignoreSpanTypes }) {
72
+ this.ignoreSpanTypes = ignoreSpanTypes;
73
+ }
74
+ isEnabled() {
75
+ return true;
76
+ }
77
+ getTraceParent(span) {
78
+ const spanContext = (span ?? getActiveSpan())?.spanContext();
79
+ if (spanContext) {
80
+ return `00-${spanContext.traceId}-${spanContext.spanId}-0${spanContext.traceFlags}`;
81
+ }
82
+ return nonSampledTraceParent;
83
+ }
84
+ dispatchEngineSpans(spans) {
85
+ const linkIds = /* @__PURE__ */ new Map();
86
+ const roots = spans.filter((span) => span.parentId === null);
87
+ for (const root of roots) {
88
+ dispatchEngineSpan(root, spans, linkIds, this.ignoreSpanTypes);
89
+ }
90
+ }
91
+ /**
92
+ * Prisma v5 broke the tracing helper interface with the v6 major, replacing `createEngineSpan` with
93
+ * `dispatchEngineSpans`. We implement the v6/v7 interface (`dispatchEngineSpans`) but also keep this
94
+ * v5-only method so the same helper doesn't blow up in Prisma 5 users' faces, minting v5 engine spans
95
+ * through Sentry's span APIs instead of crashing.
96
+ */
97
+ createEngineSpan(engineSpanEvent) {
98
+ pendingEngineSpans.push(...engineSpanEvent.spans);
99
+ createResolvedEngineSpans();
100
+ const overflow = pendingEngineSpans.length - MAX_TRACKED_PRISMA_SPANS;
101
+ if (overflow > 0) {
102
+ DEBUG_BUILD && debug.log(`[Prisma] Dropping ${overflow} unresolved v5 engine span(s) whose parent was never registered.`);
103
+ pendingEngineSpans.splice(0, overflow);
104
+ }
105
+ }
106
+ getActiveContext() {
107
+ return getActiveSpan();
108
+ }
109
+ runInChildSpan(nameOrOptions, callback) {
110
+ const options = typeof nameOrOptions === "string" ? { name: nameOrOptions } : nameOrOptions;
111
+ if (options.internal && !showAllTraces) {
112
+ return callback();
113
+ }
114
+ const name = `prisma:client:${options.name}`;
115
+ if (shouldIgnoreSpan(name, this.ignoreSpanTypes)) {
116
+ return callback();
117
+ }
118
+ const parentSpan = getActiveSpan();
119
+ const attributes = buildSpanAttributes(name, options.attributes);
120
+ const spanOptions = {
121
+ name: buildSpanName(name, attributes),
122
+ attributes,
123
+ kind: options.kind,
124
+ links: options.links,
125
+ startTime: options.startTime,
126
+ parentSpan
127
+ };
128
+ if (options.active === false) {
129
+ const span = startInactiveSpan(spanOptions);
130
+ registerPrismaSpan(span.spanContext().spanId, span);
131
+ return endSpan(span, () => callback(span, parentSpan));
132
+ }
133
+ return startSpanManual(spanOptions, (span) => {
134
+ registerPrismaSpan(span.spanContext().spanId, span);
135
+ return endSpan(span, () => callback(span, parentSpan));
136
+ });
137
+ }
138
+ }
139
+ function dispatchEngineSpan(engineSpan, allSpans, linkIds, ignoreSpanTypes) {
140
+ if (shouldIgnoreSpan(engineSpan.name, ignoreSpanTypes)) {
141
+ return;
142
+ }
143
+ const attributes = buildSpanAttributes(engineSpan.name, engineSpan.attributes);
144
+ startSpanManual(
145
+ {
146
+ name: buildSpanName(engineSpan.name, attributes),
147
+ attributes,
148
+ kind: engineSpan.kind === "client" ? SPAN_KIND.CLIENT : SPAN_KIND.INTERNAL,
149
+ startTime: engineSpan.startTime
150
+ },
151
+ (span) => {
152
+ linkIds.set(engineSpan.id, span.spanContext().spanId);
153
+ if (engineSpan.links) {
154
+ span.addLinks(
155
+ engineSpan.links.flatMap((link) => {
156
+ const linkedId = linkIds.get(link);
157
+ if (!linkedId) {
158
+ return [];
159
+ }
160
+ return {
161
+ context: {
162
+ spanId: linkedId,
163
+ traceId: span.spanContext().traceId,
164
+ traceFlags: span.spanContext().traceFlags
165
+ }
166
+ };
167
+ })
168
+ );
169
+ }
170
+ const children = allSpans.filter((s) => s.parentId === engineSpan.id);
171
+ for (const child of children) {
172
+ dispatchEngineSpan(child, allSpans, linkIds, ignoreSpanTypes);
173
+ }
174
+ span.end(engineSpan.endTime);
175
+ }
176
+ );
177
+ }
178
+ function endSpan(span, run) {
179
+ let result;
180
+ try {
181
+ result = run();
182
+ } catch (reason) {
183
+ span.end();
184
+ throw reason;
185
+ }
186
+ if (isPromiseLike(result)) {
187
+ return result.then(
188
+ (value) => {
189
+ span.end();
190
+ return value;
191
+ },
192
+ (reason) => {
193
+ span.end();
194
+ throw reason;
195
+ }
196
+ );
197
+ }
198
+ span.end();
199
+ return result;
200
+ }
201
+ function isPromiseLike(value) {
202
+ return value != null && typeof value["then"] === "function";
203
+ }
204
+ function shouldIgnoreSpan(spanName, ignoreSpanTypes) {
205
+ return ignoreSpanTypes.some((pattern) => typeof pattern === "string" ? pattern === spanName : pattern.test(spanName));
206
+ }
207
+
208
+ export { ActiveTracingHelper };
209
+ //# sourceMappingURL=tracing-helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracing-helper.js","sources":["../../../src/prisma/tracing-helper.ts"],"sourcesContent":["/*\n * Copyright Prisma\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/prisma/prisma/tree/b6feea5565ec577545a79547d24273ccdd11b4c7/packages/instrumentation\n * - Upstream version: @prisma/instrumentation@7.8.0\n * - Replaced `@prisma/instrumentation-contract` imports with local vendored types\n * - Span creation uses Sentry's span APIs (`startSpanManual` / `startInactiveSpan`) instead of the OTel tracer\n * - Span creation sets the Sentry origin, renames `db_query` spans to their SQL text, and backfills\n * `db.system` for older Prisma versions\n * - Added a `createEngineSpan` method so a single helper serves both Prisma v5 (which calls\n * `createEngineSpan`) and v6/v7 (which call `dispatchEngineSpans`)\n */\n\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport {\n debug,\n getActiveSpan,\n LRUMap,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n startInactiveSpan,\n startSpanManual,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { EngineSpan, ExtendedSpanOptions, SpanCallback, TracingHelper } from './types';\nimport { DB_SYSTEM } from '@sentry/conventions/attributes';\n\n// Reading `process.env` can throw in runtimes that gate env access (e.g. Deno without `--allow-env`)\n// and `process` may be absent altogether (edge runtimes), so this degrades to `false` in those cases.\nconst showAllTraces = ((): boolean => {\n try {\n return process.env.PRISMA_SHOW_ALL_TRACES === 'true';\n } catch {\n return false;\n }\n})();\n\nconst nonSampledTraceParent = `00-10-10-00`;\n\nconst PRISMA_ORIGIN = 'auto.db.otel.prisma';\n\ntype Options = {\n ignoreSpanTypes: (string | RegExp)[];\n};\n\n// Vendored in from @prisma/instrumentation v5:\ntype V5EngineSpanEvent = {\n span: boolean;\n spans: V5EngineSpan[];\n};\n\ntype V5EngineSpanKind = 'client' | 'internal';\n\ntype V5EngineSpan = {\n span: boolean;\n name: string;\n trace_id: string;\n span_id: string;\n parent_span_id: string;\n start_time: [number, number];\n end_time: [number, number];\n attributes?: Record<string, string>;\n links?: { trace_id: string; span_id: string }[];\n kind: V5EngineSpanKind;\n};\n\n// Prisma v5 dispatches engine spans (`prisma:engine:*`, which carry the SQL `db.statement`) one batch\n// at a time, out of order, and detached from the active span, naming their parent only by id: a span\n// references either a client span (by the Sentry span id Prisma learned via `getTraceParent`) or a\n// sibling engine span (by the engine's own id), and a batch may not contain the parent it references.\n// By the time the engine reports them the client span may already have ended, so `getActiveSpan()`\n// can't be used to find it. `prismaSpanRegistry` maps span ids to their Sentry span, and an engine\n// span whose parent isn't registered yet waits in `pendingEngineSpans` until a later batch registers it.\nconst MAX_TRACKED_PRISMA_SPANS = 1000;\nconst prismaSpanRegistry = new LRUMap<string, Span>(MAX_TRACKED_PRISMA_SPANS);\nconst pendingEngineSpans: V5EngineSpan[] = [];\n\n/** Register a span so v5 engine spans can later resolve it as a parent by the id Prisma reports it under. */\nfunction registerPrismaSpan(id: string, span: Span): void {\n prismaSpanRegistry.set(id, span);\n}\n\n/**\n * Older Prisma versions emit `prisma:engine:db_query` spans without a `db.system`, so it's backfilled here.\n */\nfunction buildSpanAttributes(name: string, attributes: Record<string, unknown> | undefined): SpanAttributes {\n const merged: SpanAttributes = {\n ...(attributes as SpanAttributes | undefined),\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PRISMA_ORIGIN,\n };\n\n // oxlint-disable-next-line typescript/no-deprecated\n if (name === 'prisma:engine:db_query' && merged[DB_SYSTEM] == null) {\n // oxlint-disable-next-line typescript/no-deprecated\n merged[DB_SYSTEM] = 'prisma';\n }\n\n return merged;\n}\n\n/**\n * Db query spans are named after their SQL text (e.g. `SELECT * FROM \"User\"`) rather than the generic\n * engine name. v5/v6 emit `prisma:engine:db_query`; v7 inlined the engine and emits `prisma:client:db_query`.\n */\nfunction buildSpanName(name: string, attributes: SpanAttributes): string {\n const queryText = attributes['db.query.text'];\n if ((name === 'prisma:engine:db_query' || name === 'prisma:client:db_query') && typeof queryText === 'string') {\n return queryText;\n }\n return name;\n}\n\n/**\n * Create every pending v5 engine span whose parent is now registered, repeating until no further span\n * resolves (so a child queued before its parent is created once the parent arrives in a later batch).\n * Each span is created under its resolved parent and registered by its engine id so its own children\n * can find it; origin, the `prisma:engine:db_query` to SQL rename, and the `db.system` backfill are\n * applied here, exactly as for v6/v7 engine spans.\n */\nfunction createResolvedEngineSpans(): void {\n // Terminates: `createdSpan` is only set true right after a `splice`, so every pass that keeps the\n // loop going strictly shrinks the finite `pendingEngineSpans`; a pass that resolves nothing exits.\n let createdSpan = true;\n while (createdSpan) {\n createdSpan = false;\n for (let i = pendingEngineSpans.length - 1; i >= 0; i--) {\n const engineSpan = pendingEngineSpans[i]!;\n const parentSpan = prismaSpanRegistry.get(engineSpan.parent_span_id);\n if (!parentSpan) {\n continue;\n }\n\n const attributes = buildSpanAttributes(engineSpan.name, engineSpan.attributes);\n const span = startInactiveSpan({\n name: buildSpanName(engineSpan.name, attributes),\n attributes,\n kind: engineSpan.kind === 'client' ? SPAN_KIND.CLIENT : SPAN_KIND.INTERNAL,\n startTime: engineSpan.start_time,\n parentSpan,\n });\n registerPrismaSpan(engineSpan.span_id, span);\n\n // Engine links reference other engine spans by their engine id; re-point them at the Sentry spans\n // we minted (mirroring v6/v7's `dispatchEngineSpan`). Links must be added before the span ends,\n // since the SentryTracerProvider seals spans on end. Links to spans we haven't created are dropped.\n if (engineSpan.links) {\n span.addLinks(\n engineSpan.links.flatMap(link => {\n const linkedSpan = prismaSpanRegistry.get(link.span_id);\n return linkedSpan ? [{ context: linkedSpan.spanContext() }] : [];\n }),\n );\n }\n\n span.end(engineSpan.end_time);\n\n pendingEngineSpans.splice(i, 1);\n createdSpan = true;\n }\n }\n}\n\n/**\n * This satisifes the TracingHelper interface for Prisma v5 and v6/v7.\n */\nexport class ActiveTracingHelper implements TracingHelper {\n private ignoreSpanTypes: (string | RegExp)[];\n\n public constructor({ ignoreSpanTypes }: Options) {\n this.ignoreSpanTypes = ignoreSpanTypes;\n }\n\n public isEnabled(): boolean {\n return true;\n }\n\n public getTraceParent(span?: Span): string {\n const spanContext = (span ?? getActiveSpan())?.spanContext();\n if (spanContext) {\n return `00-${spanContext.traceId}-${spanContext.spanId}-0${spanContext.traceFlags}`;\n }\n return nonSampledTraceParent;\n }\n\n public dispatchEngineSpans(spans: EngineSpan[]): void {\n const linkIds = new Map<string, string>();\n const roots = spans.filter(span => span.parentId === null);\n\n for (const root of roots) {\n dispatchEngineSpan(root, spans, linkIds, this.ignoreSpanTypes);\n }\n }\n\n /**\n * Prisma v5 broke the tracing helper interface with the v6 major, replacing `createEngineSpan` with\n * `dispatchEngineSpans`. We implement the v6/v7 interface (`dispatchEngineSpans`) but also keep this\n * v5-only method so the same helper doesn't blow up in Prisma 5 users' faces, minting v5 engine spans\n * through Sentry's span APIs instead of crashing.\n */\n public createEngineSpan(engineSpanEvent: V5EngineSpanEvent): void {\n pendingEngineSpans.push(...engineSpanEvent.spans);\n\n // Resolve before capping so a span is only ever dropped after a full resolution attempt, never\n // before it had a chance to find its parent. What remains are orphans whose parent was never\n // registered (e.g. evicted from the registry under sustained load); cap that backlog so it can't\n // grow without bound.\n createResolvedEngineSpans();\n\n const overflow = pendingEngineSpans.length - MAX_TRACKED_PRISMA_SPANS;\n if (overflow > 0) {\n DEBUG_BUILD &&\n debug.log(`[Prisma] Dropping ${overflow} unresolved v5 engine span(s) whose parent was never registered.`);\n pendingEngineSpans.splice(0, overflow);\n }\n }\n\n public getActiveContext(): Span | undefined {\n return getActiveSpan();\n }\n\n public runInChildSpan<R>(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback<R>): R {\n const options: ExtendedSpanOptions = typeof nameOrOptions === 'string' ? { name: nameOrOptions } : nameOrOptions;\n\n if (options.internal && !showAllTraces) {\n return callback();\n }\n\n const name = `prisma:client:${options.name}`;\n\n if (shouldIgnoreSpan(name, this.ignoreSpanTypes)) {\n return callback();\n }\n\n const parentSpan = getActiveSpan();\n\n const attributes = buildSpanAttributes(name, options.attributes as Record<string, unknown> | undefined);\n const spanOptions = {\n name: buildSpanName(name, attributes),\n attributes,\n kind: options.kind,\n links: options.links,\n startTime: options.startTime,\n parentSpan,\n };\n\n if (options.active === false) {\n const span = startInactiveSpan(spanOptions);\n // Register the client span so a v5 engine span (dispatched later, detached) can resolve it as a\n // parent by the Sentry span id Prisma reported via `getTraceParent` (see `createResolvedEngineSpans`).\n registerPrismaSpan(span.spanContext().spanId, span);\n return endSpan(span, () => callback(span, parentSpan));\n }\n\n return startSpanManual(spanOptions, span => {\n registerPrismaSpan(span.spanContext().spanId, span);\n return endSpan(span, () => callback(span, parentSpan));\n });\n }\n}\n\nfunction dispatchEngineSpan(\n engineSpan: EngineSpan,\n allSpans: EngineSpan[],\n linkIds: Map<string, string>,\n ignoreSpanTypes: (string | RegExp)[],\n): void {\n if (shouldIgnoreSpan(engineSpan.name, ignoreSpanTypes)) {\n return;\n }\n\n const attributes = buildSpanAttributes(engineSpan.name, engineSpan.attributes);\n\n startSpanManual(\n {\n name: buildSpanName(engineSpan.name, attributes),\n attributes,\n kind: engineSpan.kind === 'client' ? SPAN_KIND.CLIENT : SPAN_KIND.INTERNAL,\n startTime: engineSpan.startTime,\n },\n span => {\n linkIds.set(engineSpan.id, span.spanContext().spanId);\n\n if (engineSpan.links) {\n span.addLinks(\n engineSpan.links.flatMap(link => {\n const linkedId = linkIds.get(link);\n if (!linkedId) {\n return [];\n }\n return {\n context: {\n spanId: linkedId,\n traceId: span.spanContext().traceId,\n traceFlags: span.spanContext().traceFlags,\n },\n };\n }),\n );\n }\n\n const children = allSpans.filter(s => s.parentId === engineSpan.id);\n for (const child of children) {\n dispatchEngineSpan(child, allSpans, linkIds, ignoreSpanTypes);\n }\n\n span.end(engineSpan.endTime);\n },\n );\n}\n\nfunction endSpan<T>(span: Span, run: () => T): T {\n let result: T;\n try {\n result = run();\n } catch (reason) {\n span.end();\n throw reason;\n }\n\n if (isPromiseLike(result)) {\n return result.then(\n value => {\n span.end();\n return value;\n },\n reason => {\n span.end();\n throw reason;\n },\n ) as T;\n }\n span.end();\n return result;\n}\n\nfunction isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n return value != null && typeof (value as Record<string, unknown>)['then'] === 'function';\n}\n\nfunction shouldIgnoreSpan(spanName: string, ignoreSpanTypes: (string | RegExp)[]): boolean {\n return ignoreSpanTypes.some(pattern => (typeof pattern === 'string' ? pattern === spanName : pattern.test(spanName)));\n}\n"],"names":[],"mappings":";;;;AA+BA,MAAM,iBAAiB,MAAe;AACpC,EAAA,IAAI;AACF,IAAA,OAAO,OAAA,CAAQ,IAAI,sBAAA,KAA2B,MAAA;AAAA,EAChD,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF,CAAA,GAAG;AAEH,MAAM,qBAAA,GAAwB,CAAA,WAAA,CAAA;AAE9B,MAAM,aAAA,GAAgB,qBAAA;AAkCtB,MAAM,wBAAA,GAA2B,GAAA;AACjC,MAAM,kBAAA,GAAqB,IAAI,MAAA,CAAqB,wBAAwB,CAAA;AAC5E,MAAM,qBAAqC,EAAC;AAG5C,SAAS,kBAAA,CAAmB,IAAY,IAAA,EAAkB;AACxD,EAAA,kBAAA,CAAmB,GAAA,CAAI,IAAI,IAAI,CAAA;AACjC;AAKA,SAAS,mBAAA,CAAoB,MAAc,UAAA,EAAiE;AAC1G,EAAA,MAAM,MAAA,GAAyB;AAAA,IAC7B,GAAI,UAAA;AAAA,IACJ,CAAC,gCAAgC,GAAG;AAAA,GACtC;AAGA,EAAA,IAAI,IAAA,KAAS,wBAAA,IAA4B,MAAA,CAAO,SAAS,KAAK,IAAA,EAAM;AAElE,IAAA,MAAA,CAAO,SAAS,CAAA,GAAI,QAAA;AAAA,EACtB;AAEA,EAAA,OAAO,MAAA;AACT;AAMA,SAAS,aAAA,CAAc,MAAc,UAAA,EAAoC;AACvE,EAAA,MAAM,SAAA,GAAY,WAAW,eAAe,CAAA;AAC5C,EAAA,IAAA,CAAK,SAAS,wBAAA,IAA4B,IAAA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AA,CAAK,GAAA,EAAI;AACT,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,cAAc,KAAA,EAA+C;AACpE,EAAA,OAAO,KAAA,IAAS,IAAA,IAAQ,OAAQ,KAAA,CAAkC,MAAM,CAAA,KAAM,UAAA;AAChF;AAEA,SAAS,gBAAA,CAAiB,UAAkB,eAAA,EAA+C;AACzF,EAAA,OAAO,eAAA,CAAgB,IAAA,CAAK,CAAA,OAAA,KAAY,OAAO,OAAA,KAAY,QAAA,GAAW,OAAA,KAAY,QAAA,GAAW,OAAA,CAAQ,IAAA,CAAK,QAAQ,CAAE,CAAA;AACtH;;;;"}
@@ -0,0 +1,21 @@
1
+ import { defineIntegration, waitForTracingChannelBinding } from '@sentry/core';
2
+ import * as diagnosticsChannel from 'node:diagnostics_channel';
3
+ import { subscribeRedisDiagnosticChannels } from './redis-dc-subscriber.js';
4
+
5
+ const _redisIntegration = ((options = {}) => {
6
+ return {
7
+ name: "Redis",
8
+ setupOnce() {
9
+ if (!diagnosticsChannel.tracingChannel) {
10
+ return;
11
+ }
12
+ waitForTracingChannelBinding(() => {
13
+ subscribeRedisDiagnosticChannels(diagnosticsChannel.tracingChannel, options.responseHook);
14
+ });
15
+ }
16
+ };
17
+ });
18
+ const redisIntegration = defineIntegration(_redisIntegration);
19
+
20
+ export { redisIntegration };
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/redis/index.ts"],"sourcesContent":["import { defineIntegration, type IntegrationFn, waitForTracingChannelBinding } from '@sentry/core';\nimport * as dc from 'node:diagnostics_channel';\nimport { type RedisDiagnosticChannelResponseHook, subscribeRedisDiagnosticChannels } from './redis-dc-subscriber';\n\n/** Options controlling the redis diagnostics-channel subscription. */\nexport interface RedisDiagnosticChannelsOptions {\n /**\n * Optional hook invoked once the redis command response arrives. Useful for attaching\n * response-derived attributes (e.g. cache hit/miss, payload size).\n */\n responseHook?: RedisDiagnosticChannelResponseHook;\n}\n\nconst _redisIntegration = ((options: RedisDiagnosticChannelsOptions = {}) => {\n return {\n name: 'Redis',\n setupOnce() {\n // Bail on runtimes without `tracingChannel` (Node <= 18.18.0).\n if (!dc.tracingChannel) {\n return;\n }\n\n waitForTracingChannelBinding(() => {\n subscribeRedisDiagnosticChannels(dc.tracingChannel, options.responseHook);\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Auto-instrument the [redis](https://www.npmjs.com/package/redis) and\n * [ioredis](https://www.npmjs.com/package/ioredis) libraries via their native\n * `node:diagnostics_channel` tracing channels (node-redis >= 5.12.0, ioredis >= 5.11.0).\n */\nexport const redisIntegration = defineIntegration(_redisIntegration);\n"],"names":["dc"],"mappings":";;;;AAaA,MAAM,iBAAA,IAAqB,CAAC,OAAA,GAA0C,EAAC,KAAM;AAC3E,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,OAAA;AAAA,IACN,SAAA,GAAY;AAEV,MAAA,IAAI,CAACA,mBAAG,cAAA,EAAgB;AACtB,QAAA;AAAA,MACF;AAEA,MAAA,4BAAA,CAA6B,MAAM;AACjC,QAAA,gCAAA,CAAiCA,kBAAA,CAAG,cAAA,EAAgB,OAAA,CAAQ,YAAY,CAAA;AAAA,MAC1E,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAA,CAAA;AAOO,MAAM,gBAAA,GAAmB,kBAAkB,iBAAiB;;;;"}