@depup/sentry__server-utils 10.67.0-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (848) hide show
  1. package/README.md +32 -0
  2. package/build/cjs/debug-build.js +6 -0
  3. package/build/cjs/debug-build.js.map +1 -0
  4. package/build/cjs/graphql/graphql-dc-subscriber.js +123 -0
  5. package/build/cjs/graphql/graphql-dc-subscriber.js.map +1 -0
  6. package/build/cjs/graphql/index.js +23 -0
  7. package/build/cjs/graphql/index.js.map +1 -0
  8. package/build/cjs/graphql/utils.js +92 -0
  9. package/build/cjs/graphql/utils.js.map +1 -0
  10. package/build/cjs/index.js +34 -0
  11. package/build/cjs/index.js.map +1 -0
  12. package/build/cjs/integrations/tracing-channel/amqplib.js +420 -0
  13. package/build/cjs/integrations/tracing-channel/amqplib.js.map +1 -0
  14. package/build/cjs/integrations/tracing-channel/anthropic.js +101 -0
  15. package/build/cjs/integrations/tracing-channel/anthropic.js.map +1 -0
  16. package/build/cjs/integrations/tracing-channel/aws-sdk/constants.js +16 -0
  17. package/build/cjs/integrations/tracing-channel/aws-sdk/constants.js.map +1 -0
  18. package/build/cjs/integrations/tracing-channel/aws-sdk/index.js +154 -0
  19. package/build/cjs/integrations/tracing-channel/aws-sdk/index.js.map +1 -0
  20. package/build/cjs/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js +46 -0
  21. package/build/cjs/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js.map +1 -0
  22. package/build/cjs/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js +47 -0
  23. package/build/cjs/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js.map +1 -0
  24. package/build/cjs/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js +419 -0
  25. package/build/cjs/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js.map +1 -0
  26. package/build/cjs/integrations/tracing-channel/aws-sdk/services/dynamodb.js +131 -0
  27. package/build/cjs/integrations/tracing-channel/aws-sdk/services/dynamodb.js.map +1 -0
  28. package/build/cjs/integrations/tracing-channel/aws-sdk/services/kinesis.js +21 -0
  29. package/build/cjs/integrations/tracing-channel/aws-sdk/services/kinesis.js.map +1 -0
  30. package/build/cjs/integrations/tracing-channel/aws-sdk/services/lambda.js +64 -0
  31. package/build/cjs/integrations/tracing-channel/aws-sdk/services/lambda.js.map +1 -0
  32. package/build/cjs/integrations/tracing-channel/aws-sdk/services/s3.js +21 -0
  33. package/build/cjs/integrations/tracing-channel/aws-sdk/services/s3.js.map +1 -0
  34. package/build/cjs/integrations/tracing-channel/aws-sdk/services/secretsmanager.js +27 -0
  35. package/build/cjs/integrations/tracing-channel/aws-sdk/services/secretsmanager.js.map +1 -0
  36. package/build/cjs/integrations/tracing-channel/aws-sdk/services/sns.js +63 -0
  37. package/build/cjs/integrations/tracing-channel/aws-sdk/services/sns.js.map +1 -0
  38. package/build/cjs/integrations/tracing-channel/aws-sdk/services/sqs.js +116 -0
  39. package/build/cjs/integrations/tracing-channel/aws-sdk/services/sqs.js.map +1 -0
  40. package/build/cjs/integrations/tracing-channel/aws-sdk/services/stepfunctions.js +25 -0
  41. package/build/cjs/integrations/tracing-channel/aws-sdk/services/stepfunctions.js.map +1 -0
  42. package/build/cjs/integrations/tracing-channel/aws-sdk/utils.js +30 -0
  43. package/build/cjs/integrations/tracing-channel/aws-sdk/utils.js.map +1 -0
  44. package/build/cjs/integrations/tracing-channel/dataloader.js +95 -0
  45. package/build/cjs/integrations/tracing-channel/dataloader.js.map +1 -0
  46. package/build/cjs/integrations/tracing-channel/express/index.js +24 -0
  47. package/build/cjs/integrations/tracing-channel/express/index.js.map +1 -0
  48. package/build/cjs/integrations/tracing-channel/express/instrumentation.js +168 -0
  49. package/build/cjs/integrations/tracing-channel/express/instrumentation.js.map +1 -0
  50. package/build/cjs/integrations/tracing-channel/express/route.js +76 -0
  51. package/build/cjs/integrations/tracing-channel/express/route.js.map +1 -0
  52. package/build/cjs/integrations/tracing-channel/fastify/errors.js +42 -0
  53. package/build/cjs/integrations/tracing-channel/fastify/errors.js.map +1 -0
  54. package/build/cjs/integrations/tracing-channel/fastify/index.js +34 -0
  55. package/build/cjs/integrations/tracing-channel/fastify/index.js.map +1 -0
  56. package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js +279 -0
  57. package/build/cjs/integrations/tracing-channel/fastify/instrumentation.js.map +1 -0
  58. package/build/cjs/integrations/tracing-channel/fastify/utils.js +11 -0
  59. package/build/cjs/integrations/tracing-channel/fastify/utils.js.map +1 -0
  60. package/build/cjs/integrations/tracing-channel/generic-pool.js +34 -0
  61. package/build/cjs/integrations/tracing-channel/generic-pool.js.map +1 -0
  62. package/build/cjs/integrations/tracing-channel/google-genai.js +96 -0
  63. package/build/cjs/integrations/tracing-channel/google-genai.js.map +1 -0
  64. package/build/cjs/integrations/tracing-channel/graphql/constants.js +26 -0
  65. package/build/cjs/integrations/tracing-channel/graphql/constants.js.map +1 -0
  66. package/build/cjs/integrations/tracing-channel/graphql/index.js +66 -0
  67. package/build/cjs/integrations/tracing-channel/graphql/index.js.map +1 -0
  68. package/build/cjs/integrations/tracing-channel/graphql/resolvers.js +168 -0
  69. package/build/cjs/integrations/tracing-channel/graphql/resolvers.js.map +1 -0
  70. package/build/cjs/integrations/tracing-channel/graphql/spans.js +102 -0
  71. package/build/cjs/integrations/tracing-channel/graphql/spans.js.map +1 -0
  72. package/build/cjs/integrations/tracing-channel/hapi-types.js +30 -0
  73. package/build/cjs/integrations/tracing-channel/hapi-types.js.map +1 -0
  74. package/build/cjs/integrations/tracing-channel/hapi-utils.js +177 -0
  75. package/build/cjs/integrations/tracing-channel/hapi-utils.js.map +1 -0
  76. package/build/cjs/integrations/tracing-channel/hapi.js +52 -0
  77. package/build/cjs/integrations/tracing-channel/hapi.js.map +1 -0
  78. package/build/cjs/integrations/tracing-channel/ioredis.js +99 -0
  79. package/build/cjs/integrations/tracing-channel/ioredis.js.map +1 -0
  80. package/build/cjs/integrations/tracing-channel/kafkajs/consumer.js +71 -0
  81. package/build/cjs/integrations/tracing-channel/kafkajs/consumer.js.map +1 -0
  82. package/build/cjs/integrations/tracing-channel/kafkajs/index.js +70 -0
  83. package/build/cjs/integrations/tracing-channel/kafkajs/index.js.map +1 -0
  84. package/build/cjs/integrations/tracing-channel/kafkajs/semconv.js +22 -0
  85. package/build/cjs/integrations/tracing-channel/kafkajs/semconv.js.map +1 -0
  86. package/build/cjs/integrations/tracing-channel/kafkajs/spans.js +119 -0
  87. package/build/cjs/integrations/tracing-channel/kafkajs/spans.js.map +1 -0
  88. package/build/cjs/integrations/tracing-channel/knex.js +188 -0
  89. package/build/cjs/integrations/tracing-channel/knex.js.map +1 -0
  90. package/build/cjs/integrations/tracing-channel/koa.js +146 -0
  91. package/build/cjs/integrations/tracing-channel/koa.js.map +1 -0
  92. package/build/cjs/integrations/tracing-channel/langchain.js +63 -0
  93. package/build/cjs/integrations/tracing-channel/langchain.js.map +1 -0
  94. package/build/cjs/integrations/tracing-channel/langgraph.js +100 -0
  95. package/build/cjs/integrations/tracing-channel/langgraph.js.map +1 -0
  96. package/build/cjs/integrations/tracing-channel/lru-memoizer.js +31 -0
  97. package/build/cjs/integrations/tracing-channel/lru-memoizer.js.map +1 -0
  98. package/build/cjs/integrations/tracing-channel/mongodb.js +104 -0
  99. package/build/cjs/integrations/tracing-channel/mongodb.js.map +1 -0
  100. package/build/cjs/integrations/tracing-channel/mongoose.js +110 -0
  101. package/build/cjs/integrations/tracing-channel/mongoose.js.map +1 -0
  102. package/build/cjs/integrations/tracing-channel/mysql.js +107 -0
  103. package/build/cjs/integrations/tracing-channel/mysql.js.map +1 -0
  104. package/build/cjs/integrations/tracing-channel/mysql2.js +83 -0
  105. package/build/cjs/integrations/tracing-channel/mysql2.js.map +1 -0
  106. package/build/cjs/integrations/tracing-channel/openai.js +81 -0
  107. package/build/cjs/integrations/tracing-channel/openai.js.map +1 -0
  108. package/build/cjs/integrations/tracing-channel/postgres-js.js +191 -0
  109. package/build/cjs/integrations/tracing-channel/postgres-js.js.map +1 -0
  110. package/build/cjs/integrations/tracing-channel/postgres.js +170 -0
  111. package/build/cjs/integrations/tracing-channel/postgres.js.map +1 -0
  112. package/build/cjs/integrations/tracing-channel/redis.js +218 -0
  113. package/build/cjs/integrations/tracing-channel/redis.js.map +1 -0
  114. package/build/cjs/integrations/tracing-channel/tedious.js +145 -0
  115. package/build/cjs/integrations/tracing-channel/tedious.js.map +1 -0
  116. package/build/cjs/integrations/tracing-channel/vercel-ai.js +25 -0
  117. package/build/cjs/integrations/tracing-channel/vercel-ai.js.map +1 -0
  118. package/build/cjs/mongodb/mongodb-span.js +133 -0
  119. package/build/cjs/mongodb/mongodb-span.js.map +1 -0
  120. package/build/cjs/mongoose/index.js +23 -0
  121. package/build/cjs/mongoose/index.js.map +1 -0
  122. package/build/cjs/mongoose/mongoose-dc-subscriber.js +97 -0
  123. package/build/cjs/mongoose/mongoose-dc-subscriber.js.map +1 -0
  124. package/build/cjs/mongoose/mongoose-legacy-span.js +40 -0
  125. package/build/cjs/mongoose/mongoose-legacy-span.js.map +1 -0
  126. package/build/cjs/mysql2/index.js +23 -0
  127. package/build/cjs/mysql2/index.js.map +1 -0
  128. package/build/cjs/mysql2/mysql2-dc-subscriber.js +68 -0
  129. package/build/cjs/mysql2/mysql2-dc-subscriber.js.map +1 -0
  130. package/build/cjs/orchestrion/bundler/esbuild.js +15 -0
  131. package/build/cjs/orchestrion/bundler/esbuild.js.map +1 -0
  132. package/build/cjs/orchestrion/bundler/options.js +24 -0
  133. package/build/cjs/orchestrion/bundler/options.js.map +1 -0
  134. package/build/cjs/orchestrion/bundler/rollup.js +15 -0
  135. package/build/cjs/orchestrion/bundler/rollup.js.map +1 -0
  136. package/build/cjs/orchestrion/bundler/vite.js +21 -0
  137. package/build/cjs/orchestrion/bundler/vite.js.map +1 -0
  138. package/build/cjs/orchestrion/bundler/webpack.js +36 -0
  139. package/build/cjs/orchestrion/bundler/webpack.js.map +1 -0
  140. package/build/cjs/orchestrion/channels.js +70 -0
  141. package/build/cjs/orchestrion/channels.js.map +1 -0
  142. package/build/cjs/orchestrion/config/amqplib.js +81 -0
  143. package/build/cjs/orchestrion/config/amqplib.js.map +1 -0
  144. package/build/cjs/orchestrion/config/anthropic-ai.js +43 -0
  145. package/build/cjs/orchestrion/config/anthropic-ai.js.map +1 -0
  146. package/build/cjs/orchestrion/config/aws-sdk.js +28 -0
  147. package/build/cjs/orchestrion/config/aws-sdk.js.map +1 -0
  148. package/build/cjs/orchestrion/config/dataloader.js +53 -0
  149. package/build/cjs/orchestrion/config/dataloader.js.map +1 -0
  150. package/build/cjs/orchestrion/config/express.js +77 -0
  151. package/build/cjs/orchestrion/config/express.js.map +1 -0
  152. package/build/cjs/orchestrion/config/firebase.js +8 -0
  153. package/build/cjs/orchestrion/config/firebase.js.map +1 -0
  154. package/build/cjs/orchestrion/config/generic-pool.js +21 -0
  155. package/build/cjs/orchestrion/config/generic-pool.js.map +1 -0
  156. package/build/cjs/orchestrion/config/google-genai.js +38 -0
  157. package/build/cjs/orchestrion/config/google-genai.js.map +1 -0
  158. package/build/cjs/orchestrion/config/graphql.js +28 -0
  159. package/build/cjs/orchestrion/config/graphql.js.map +1 -0
  160. package/build/cjs/orchestrion/config/hapi.js +26 -0
  161. package/build/cjs/orchestrion/config/hapi.js.map +1 -0
  162. package/build/cjs/orchestrion/config/index.js +89 -0
  163. package/build/cjs/orchestrion/config/index.js.map +1 -0
  164. package/build/cjs/orchestrion/config/ioredis.js +35 -0
  165. package/build/cjs/orchestrion/config/ioredis.js.map +1 -0
  166. package/build/cjs/orchestrion/config/kafkajs.js +30 -0
  167. package/build/cjs/orchestrion/config/kafkajs.js.map +1 -0
  168. package/build/cjs/orchestrion/config/knex.js +43 -0
  169. package/build/cjs/orchestrion/config/knex.js.map +1 -0
  170. package/build/cjs/orchestrion/config/koa.js +16 -0
  171. package/build/cjs/orchestrion/config/koa.js.map +1 -0
  172. package/build/cjs/orchestrion/config/langchain.js +52 -0
  173. package/build/cjs/orchestrion/config/langchain.js.map +1 -0
  174. package/build/cjs/orchestrion/config/langgraph.js +28 -0
  175. package/build/cjs/orchestrion/config/langgraph.js.map +1 -0
  176. package/build/cjs/orchestrion/config/lru-memoizer.js +17 -0
  177. package/build/cjs/orchestrion/config/lru-memoizer.js.map +1 -0
  178. package/build/cjs/orchestrion/config/mongodb.js +67 -0
  179. package/build/cjs/orchestrion/config/mongodb.js.map +1 -0
  180. package/build/cjs/orchestrion/config/mongoose.js +107 -0
  181. package/build/cjs/orchestrion/config/mongoose.js.map +1 -0
  182. package/build/cjs/orchestrion/config/mysql.js +16 -0
  183. package/build/cjs/orchestrion/config/mysql.js.map +1 -0
  184. package/build/cjs/orchestrion/config/mysql2.js +32 -0
  185. package/build/cjs/orchestrion/config/mysql2.js.map +1 -0
  186. package/build/cjs/orchestrion/config/nestjs.js +122 -0
  187. package/build/cjs/orchestrion/config/nestjs.js.map +1 -0
  188. package/build/cjs/orchestrion/config/openai.js +40 -0
  189. package/build/cjs/orchestrion/config/openai.js.map +1 -0
  190. package/build/cjs/orchestrion/config/pg.js +51 -0
  191. package/build/cjs/orchestrion/config/pg.js.map +1 -0
  192. package/build/cjs/orchestrion/config/postgres.js +50 -0
  193. package/build/cjs/orchestrion/config/postgres.js.map +1 -0
  194. package/build/cjs/orchestrion/config/prisma.js +8 -0
  195. package/build/cjs/orchestrion/config/prisma.js.map +1 -0
  196. package/build/cjs/orchestrion/config/react-router.js +8 -0
  197. package/build/cjs/orchestrion/config/react-router.js.map +1 -0
  198. package/build/cjs/orchestrion/config/redis.js +76 -0
  199. package/build/cjs/orchestrion/config/redis.js.map +1 -0
  200. package/build/cjs/orchestrion/config/remix.js +54 -0
  201. package/build/cjs/orchestrion/config/remix.js.map +1 -0
  202. package/build/cjs/orchestrion/config/tedious.js +24 -0
  203. package/build/cjs/orchestrion/config/tedious.js.map +1 -0
  204. package/build/cjs/orchestrion/config/vercel-ai.js +48 -0
  205. package/build/cjs/orchestrion/config/vercel-ai.js.map +1 -0
  206. package/build/cjs/orchestrion/detect.js +26 -0
  207. package/build/cjs/orchestrion/detect.js.map +1 -0
  208. package/build/cjs/orchestrion/index.js +89 -0
  209. package/build/cjs/orchestrion/index.js.map +1 -0
  210. package/build/cjs/orchestrion/runtime/register.js +77 -0
  211. package/build/cjs/orchestrion/runtime/register.js.map +1 -0
  212. package/build/cjs/prisma/global.js +14 -0
  213. package/build/cjs/prisma/global.js.map +1 -0
  214. package/build/cjs/prisma/index.js +27 -0
  215. package/build/cjs/prisma/index.js.map +1 -0
  216. package/build/cjs/prisma/tracing-helper.js +211 -0
  217. package/build/cjs/prisma/tracing-helper.js.map +1 -0
  218. package/build/cjs/redis/index.js +23 -0
  219. package/build/cjs/redis/index.js.map +1 -0
  220. package/build/cjs/redis/redis-dc-subscriber.js +101 -0
  221. package/build/cjs/redis/redis-dc-subscriber.js.map +1 -0
  222. package/build/cjs/redis/redis-statement-serializer.js +34 -0
  223. package/build/cjs/redis/redis-statement-serializer.js.map +1 -0
  224. package/build/cjs/tracing-channel.js +134 -0
  225. package/build/cjs/tracing-channel.js.map +1 -0
  226. package/build/cjs/vercel-ai/index.js +23 -0
  227. package/build/cjs/vercel-ai/index.js.map +1 -0
  228. package/build/cjs/vercel-ai/util.js +112 -0
  229. package/build/cjs/vercel-ai/util.js.map +1 -0
  230. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js +433 -0
  231. package/build/cjs/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -0
  232. package/build/cjs/vercel-ai/vercel-ai-orchestrion-subscriber.js +399 -0
  233. package/build/cjs/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -0
  234. package/build/esm/debug-build.js +4 -0
  235. package/build/esm/debug-build.js.map +1 -0
  236. package/build/esm/graphql/graphql-dc-subscriber.js +116 -0
  237. package/build/esm/graphql/graphql-dc-subscriber.js.map +1 -0
  238. package/build/esm/graphql/index.js +21 -0
  239. package/build/esm/graphql/index.js.map +1 -0
  240. package/build/esm/graphql/utils.js +87 -0
  241. package/build/esm/graphql/utils.js.map +1 -0
  242. package/build/esm/index.js +12 -0
  243. package/build/esm/index.js.map +1 -0
  244. package/build/esm/integrations/tracing-channel/amqplib.js +418 -0
  245. package/build/esm/integrations/tracing-channel/amqplib.js.map +1 -0
  246. package/build/esm/integrations/tracing-channel/anthropic.js +99 -0
  247. package/build/esm/integrations/tracing-channel/anthropic.js.map +1 -0
  248. package/build/esm/integrations/tracing-channel/aws-sdk/constants.js +9 -0
  249. package/build/esm/integrations/tracing-channel/aws-sdk/constants.js.map +1 -0
  250. package/build/esm/integrations/tracing-channel/aws-sdk/index.js +152 -0
  251. package/build/esm/integrations/tracing-channel/aws-sdk/index.js.map +1 -0
  252. package/build/esm/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js +41 -0
  253. package/build/esm/integrations/tracing-channel/aws-sdk/services/MessageAttributes.js.map +1 -0
  254. package/build/esm/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js +45 -0
  255. package/build/esm/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.js.map +1 -0
  256. package/build/esm/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js +417 -0
  257. package/build/esm/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.js.map +1 -0
  258. package/build/esm/integrations/tracing-channel/aws-sdk/services/dynamodb.js +129 -0
  259. package/build/esm/integrations/tracing-channel/aws-sdk/services/dynamodb.js.map +1 -0
  260. package/build/esm/integrations/tracing-channel/aws-sdk/services/kinesis.js +19 -0
  261. package/build/esm/integrations/tracing-channel/aws-sdk/services/kinesis.js.map +1 -0
  262. package/build/esm/integrations/tracing-channel/aws-sdk/services/lambda.js +62 -0
  263. package/build/esm/integrations/tracing-channel/aws-sdk/services/lambda.js.map +1 -0
  264. package/build/esm/integrations/tracing-channel/aws-sdk/services/s3.js +19 -0
  265. package/build/esm/integrations/tracing-channel/aws-sdk/services/s3.js.map +1 -0
  266. package/build/esm/integrations/tracing-channel/aws-sdk/services/secretsmanager.js +25 -0
  267. package/build/esm/integrations/tracing-channel/aws-sdk/services/secretsmanager.js.map +1 -0
  268. package/build/esm/integrations/tracing-channel/aws-sdk/services/sns.js +61 -0
  269. package/build/esm/integrations/tracing-channel/aws-sdk/services/sns.js.map +1 -0
  270. package/build/esm/integrations/tracing-channel/aws-sdk/services/sqs.js +114 -0
  271. package/build/esm/integrations/tracing-channel/aws-sdk/services/sqs.js.map +1 -0
  272. package/build/esm/integrations/tracing-channel/aws-sdk/services/stepfunctions.js +23 -0
  273. package/build/esm/integrations/tracing-channel/aws-sdk/services/stepfunctions.js.map +1 -0
  274. package/build/esm/integrations/tracing-channel/aws-sdk/utils.js +26 -0
  275. package/build/esm/integrations/tracing-channel/aws-sdk/utils.js.map +1 -0
  276. package/build/esm/integrations/tracing-channel/dataloader.js +93 -0
  277. package/build/esm/integrations/tracing-channel/dataloader.js.map +1 -0
  278. package/build/esm/integrations/tracing-channel/express/index.js +22 -0
  279. package/build/esm/integrations/tracing-channel/express/index.js.map +1 -0
  280. package/build/esm/integrations/tracing-channel/express/instrumentation.js +166 -0
  281. package/build/esm/integrations/tracing-channel/express/instrumentation.js.map +1 -0
  282. package/build/esm/integrations/tracing-channel/express/route.js +68 -0
  283. package/build/esm/integrations/tracing-channel/express/route.js.map +1 -0
  284. package/build/esm/integrations/tracing-channel/fastify/errors.js +39 -0
  285. package/build/esm/integrations/tracing-channel/fastify/errors.js.map +1 -0
  286. package/build/esm/integrations/tracing-channel/fastify/index.js +30 -0
  287. package/build/esm/integrations/tracing-channel/fastify/index.js.map +1 -0
  288. package/build/esm/integrations/tracing-channel/fastify/instrumentation.js +277 -0
  289. package/build/esm/integrations/tracing-channel/fastify/instrumentation.js.map +1 -0
  290. package/build/esm/integrations/tracing-channel/fastify/utils.js +8 -0
  291. package/build/esm/integrations/tracing-channel/fastify/utils.js.map +1 -0
  292. package/build/esm/integrations/tracing-channel/generic-pool.js +32 -0
  293. package/build/esm/integrations/tracing-channel/generic-pool.js.map +1 -0
  294. package/build/esm/integrations/tracing-channel/google-genai.js +94 -0
  295. package/build/esm/integrations/tracing-channel/google-genai.js.map +1 -0
  296. package/build/esm/integrations/tracing-channel/graphql/constants.js +14 -0
  297. package/build/esm/integrations/tracing-channel/graphql/constants.js.map +1 -0
  298. package/build/esm/integrations/tracing-channel/graphql/index.js +63 -0
  299. package/build/esm/integrations/tracing-channel/graphql/index.js.map +1 -0
  300. package/build/esm/integrations/tracing-channel/graphql/resolvers.js +164 -0
  301. package/build/esm/integrations/tracing-channel/graphql/resolvers.js.map +1 -0
  302. package/build/esm/integrations/tracing-channel/graphql/spans.js +96 -0
  303. package/build/esm/integrations/tracing-channel/graphql/spans.js.map +1 -0
  304. package/build/esm/integrations/tracing-channel/hapi-types.js +25 -0
  305. package/build/esm/integrations/tracing-channel/hapi-types.js.map +1 -0
  306. package/build/esm/integrations/tracing-channel/hapi-utils.js +172 -0
  307. package/build/esm/integrations/tracing-channel/hapi-utils.js.map +1 -0
  308. package/build/esm/integrations/tracing-channel/hapi.js +50 -0
  309. package/build/esm/integrations/tracing-channel/hapi.js.map +1 -0
  310. package/build/esm/integrations/tracing-channel/ioredis.js +96 -0
  311. package/build/esm/integrations/tracing-channel/ioredis.js.map +1 -0
  312. package/build/esm/integrations/tracing-channel/kafkajs/consumer.js +67 -0
  313. package/build/esm/integrations/tracing-channel/kafkajs/consumer.js.map +1 -0
  314. package/build/esm/integrations/tracing-channel/kafkajs/index.js +68 -0
  315. package/build/esm/integrations/tracing-channel/kafkajs/index.js.map +1 -0
  316. package/build/esm/integrations/tracing-channel/kafkajs/semconv.js +12 -0
  317. package/build/esm/integrations/tracing-channel/kafkajs/semconv.js.map +1 -0
  318. package/build/esm/integrations/tracing-channel/kafkajs/spans.js +112 -0
  319. package/build/esm/integrations/tracing-channel/kafkajs/spans.js.map +1 -0
  320. package/build/esm/integrations/tracing-channel/knex.js +186 -0
  321. package/build/esm/integrations/tracing-channel/knex.js.map +1 -0
  322. package/build/esm/integrations/tracing-channel/koa.js +144 -0
  323. package/build/esm/integrations/tracing-channel/koa.js.map +1 -0
  324. package/build/esm/integrations/tracing-channel/langchain.js +61 -0
  325. package/build/esm/integrations/tracing-channel/langchain.js.map +1 -0
  326. package/build/esm/integrations/tracing-channel/langgraph.js +98 -0
  327. package/build/esm/integrations/tracing-channel/langgraph.js.map +1 -0
  328. package/build/esm/integrations/tracing-channel/lru-memoizer.js +29 -0
  329. package/build/esm/integrations/tracing-channel/lru-memoizer.js.map +1 -0
  330. package/build/esm/integrations/tracing-channel/mongodb.js +102 -0
  331. package/build/esm/integrations/tracing-channel/mongodb.js.map +1 -0
  332. package/build/esm/integrations/tracing-channel/mongoose.js +108 -0
  333. package/build/esm/integrations/tracing-channel/mongoose.js.map +1 -0
  334. package/build/esm/integrations/tracing-channel/mysql.js +105 -0
  335. package/build/esm/integrations/tracing-channel/mysql.js.map +1 -0
  336. package/build/esm/integrations/tracing-channel/mysql2.js +81 -0
  337. package/build/esm/integrations/tracing-channel/mysql2.js.map +1 -0
  338. package/build/esm/integrations/tracing-channel/openai.js +79 -0
  339. package/build/esm/integrations/tracing-channel/openai.js.map +1 -0
  340. package/build/esm/integrations/tracing-channel/postgres-js.js +189 -0
  341. package/build/esm/integrations/tracing-channel/postgres-js.js.map +1 -0
  342. package/build/esm/integrations/tracing-channel/postgres.js +168 -0
  343. package/build/esm/integrations/tracing-channel/postgres.js.map +1 -0
  344. package/build/esm/integrations/tracing-channel/redis.js +216 -0
  345. package/build/esm/integrations/tracing-channel/redis.js.map +1 -0
  346. package/build/esm/integrations/tracing-channel/tedious.js +143 -0
  347. package/build/esm/integrations/tracing-channel/tedious.js.map +1 -0
  348. package/build/esm/integrations/tracing-channel/vercel-ai.js +23 -0
  349. package/build/esm/integrations/tracing-channel/vercel-ai.js.map +1 -0
  350. package/build/esm/mongodb/mongodb-span.js +126 -0
  351. package/build/esm/mongodb/mongodb-span.js.map +1 -0
  352. package/build/esm/mongoose/index.js +21 -0
  353. package/build/esm/mongoose/index.js.map +1 -0
  354. package/build/esm/mongoose/mongoose-dc-subscriber.js +89 -0
  355. package/build/esm/mongoose/mongoose-dc-subscriber.js.map +1 -0
  356. package/build/esm/mongoose/mongoose-legacy-span.js +38 -0
  357. package/build/esm/mongoose/mongoose-legacy-span.js.map +1 -0
  358. package/build/esm/mysql2/index.js +21 -0
  359. package/build/esm/mysql2/index.js.map +1 -0
  360. package/build/esm/mysql2/mysql2-dc-subscriber.js +62 -0
  361. package/build/esm/mysql2/mysql2-dc-subscriber.js.map +1 -0
  362. package/build/esm/orchestrion/bundler/esbuild.js +9 -0
  363. package/build/esm/orchestrion/bundler/esbuild.js.map +1 -0
  364. package/build/esm/orchestrion/bundler/options.js +22 -0
  365. package/build/esm/orchestrion/bundler/options.js.map +1 -0
  366. package/build/esm/orchestrion/bundler/rollup.js +9 -0
  367. package/build/esm/orchestrion/bundler/rollup.js.map +1 -0
  368. package/build/esm/orchestrion/bundler/vite.js +15 -0
  369. package/build/esm/orchestrion/bundler/vite.js.map +1 -0
  370. package/build/esm/orchestrion/bundler/webpack.js +27 -0
  371. package/build/esm/orchestrion/bundler/webpack.js.map +1 -0
  372. package/build/esm/orchestrion/channels.js +68 -0
  373. package/build/esm/orchestrion/channels.js.map +1 -0
  374. package/build/esm/orchestrion/config/amqplib.js +78 -0
  375. package/build/esm/orchestrion/config/amqplib.js.map +1 -0
  376. package/build/esm/orchestrion/config/anthropic-ai.js +40 -0
  377. package/build/esm/orchestrion/config/anthropic-ai.js.map +1 -0
  378. package/build/esm/orchestrion/config/aws-sdk.js +25 -0
  379. package/build/esm/orchestrion/config/aws-sdk.js.map +1 -0
  380. package/build/esm/orchestrion/config/dataloader.js +50 -0
  381. package/build/esm/orchestrion/config/dataloader.js.map +1 -0
  382. package/build/esm/orchestrion/config/express.js +74 -0
  383. package/build/esm/orchestrion/config/express.js.map +1 -0
  384. package/build/esm/orchestrion/config/firebase.js +5 -0
  385. package/build/esm/orchestrion/config/firebase.js.map +1 -0
  386. package/build/esm/orchestrion/config/generic-pool.js +18 -0
  387. package/build/esm/orchestrion/config/generic-pool.js.map +1 -0
  388. package/build/esm/orchestrion/config/google-genai.js +35 -0
  389. package/build/esm/orchestrion/config/google-genai.js.map +1 -0
  390. package/build/esm/orchestrion/config/graphql.js +25 -0
  391. package/build/esm/orchestrion/config/graphql.js.map +1 -0
  392. package/build/esm/orchestrion/config/hapi.js +23 -0
  393. package/build/esm/orchestrion/config/hapi.js.map +1 -0
  394. package/build/esm/orchestrion/config/index.js +84 -0
  395. package/build/esm/orchestrion/config/index.js.map +1 -0
  396. package/build/esm/orchestrion/config/ioredis.js +32 -0
  397. package/build/esm/orchestrion/config/ioredis.js.map +1 -0
  398. package/build/esm/orchestrion/config/kafkajs.js +27 -0
  399. package/build/esm/orchestrion/config/kafkajs.js.map +1 -0
  400. package/build/esm/orchestrion/config/knex.js +40 -0
  401. package/build/esm/orchestrion/config/knex.js.map +1 -0
  402. package/build/esm/orchestrion/config/koa.js +13 -0
  403. package/build/esm/orchestrion/config/koa.js.map +1 -0
  404. package/build/esm/orchestrion/config/langchain.js +48 -0
  405. package/build/esm/orchestrion/config/langchain.js.map +1 -0
  406. package/build/esm/orchestrion/config/langgraph.js +25 -0
  407. package/build/esm/orchestrion/config/langgraph.js.map +1 -0
  408. package/build/esm/orchestrion/config/lru-memoizer.js +14 -0
  409. package/build/esm/orchestrion/config/lru-memoizer.js.map +1 -0
  410. package/build/esm/orchestrion/config/mongodb.js +64 -0
  411. package/build/esm/orchestrion/config/mongodb.js.map +1 -0
  412. package/build/esm/orchestrion/config/mongoose.js +103 -0
  413. package/build/esm/orchestrion/config/mongoose.js.map +1 -0
  414. package/build/esm/orchestrion/config/mysql.js +13 -0
  415. package/build/esm/orchestrion/config/mysql.js.map +1 -0
  416. package/build/esm/orchestrion/config/mysql2.js +29 -0
  417. package/build/esm/orchestrion/config/mysql2.js.map +1 -0
  418. package/build/esm/orchestrion/config/nestjs.js +119 -0
  419. package/build/esm/orchestrion/config/nestjs.js.map +1 -0
  420. package/build/esm/orchestrion/config/openai.js +37 -0
  421. package/build/esm/orchestrion/config/openai.js.map +1 -0
  422. package/build/esm/orchestrion/config/pg.js +48 -0
  423. package/build/esm/orchestrion/config/pg.js.map +1 -0
  424. package/build/esm/orchestrion/config/postgres.js +47 -0
  425. package/build/esm/orchestrion/config/postgres.js.map +1 -0
  426. package/build/esm/orchestrion/config/prisma.js +5 -0
  427. package/build/esm/orchestrion/config/prisma.js.map +1 -0
  428. package/build/esm/orchestrion/config/react-router.js +5 -0
  429. package/build/esm/orchestrion/config/react-router.js.map +1 -0
  430. package/build/esm/orchestrion/config/redis.js +73 -0
  431. package/build/esm/orchestrion/config/redis.js.map +1 -0
  432. package/build/esm/orchestrion/config/remix.js +51 -0
  433. package/build/esm/orchestrion/config/remix.js.map +1 -0
  434. package/build/esm/orchestrion/config/tedious.js +21 -0
  435. package/build/esm/orchestrion/config/tedious.js.map +1 -0
  436. package/build/esm/orchestrion/config/vercel-ai.js +45 -0
  437. package/build/esm/orchestrion/config/vercel-ai.js.map +1 -0
  438. package/build/esm/orchestrion/detect.js +23 -0
  439. package/build/esm/orchestrion/detect.js.map +1 -0
  440. package/build/esm/orchestrion/index.js +58 -0
  441. package/build/esm/orchestrion/index.js.map +1 -0
  442. package/build/esm/orchestrion/runtime/register.js +76 -0
  443. package/build/esm/orchestrion/runtime/register.js.map +1 -0
  444. package/build/esm/package.json +1 -0
  445. package/build/esm/prisma/global.js +12 -0
  446. package/build/esm/prisma/global.js.map +1 -0
  447. package/build/esm/prisma/index.js +24 -0
  448. package/build/esm/prisma/index.js.map +1 -0
  449. package/build/esm/prisma/tracing-helper.js +209 -0
  450. package/build/esm/prisma/tracing-helper.js.map +1 -0
  451. package/build/esm/redis/index.js +21 -0
  452. package/build/esm/redis/index.js.map +1 -0
  453. package/build/esm/redis/redis-dc-subscriber.js +94 -0
  454. package/build/esm/redis/redis-dc-subscriber.js.map +1 -0
  455. package/build/esm/redis/redis-statement-serializer.js +32 -0
  456. package/build/esm/redis/redis-statement-serializer.js.map +1 -0
  457. package/build/esm/tracing-channel.js +132 -0
  458. package/build/esm/tracing-channel.js.map +1 -0
  459. package/build/esm/vercel-ai/index.js +21 -0
  460. package/build/esm/vercel-ai/index.js.map +1 -0
  461. package/build/esm/vercel-ai/util.js +106 -0
  462. package/build/esm/vercel-ai/util.js.map +1 -0
  463. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js +425 -0
  464. package/build/esm/vercel-ai/vercel-ai-dc-subscriber.js.map +1 -0
  465. package/build/esm/vercel-ai/vercel-ai-orchestrion-subscriber.js +397 -0
  466. package/build/esm/vercel-ai/vercel-ai-orchestrion-subscriber.js.map +1 -0
  467. package/build/orchestrion/import-hook.mjs +19 -0
  468. package/build/types/debug-build.d.ts +7 -0
  469. package/build/types/debug-build.d.ts.map +1 -0
  470. package/build/types/graphql/graphql-dc-subscriber.d.ts +94 -0
  471. package/build/types/graphql/graphql-dc-subscriber.d.ts.map +1 -0
  472. package/build/types/graphql/index.d.ts +12 -0
  473. package/build/types/graphql/index.d.ts.map +1 -0
  474. package/build/types/graphql/utils.d.ts +36 -0
  475. package/build/types/graphql/utils.d.ts.map +1 -0
  476. package/build/types/index.d.ts +22 -0
  477. package/build/types/index.d.ts.map +1 -0
  478. package/build/types/integrations/tracing-channel/amqplib.d.ts +11 -0
  479. package/build/types/integrations/tracing-channel/amqplib.d.ts.map +1 -0
  480. package/build/types/integrations/tracing-channel/anthropic.d.ts +10 -0
  481. package/build/types/integrations/tracing-channel/anthropic.d.ts.map +1 -0
  482. package/build/types/integrations/tracing-channel/aws-sdk/aws-sdk.types.d.ts +43 -0
  483. package/build/types/integrations/tracing-channel/aws-sdk/aws-sdk.types.d.ts.map +1 -0
  484. package/build/types/integrations/tracing-channel/aws-sdk/constants.d.ts +15 -0
  485. package/build/types/integrations/tracing-channel/aws-sdk/constants.d.ts.map +1 -0
  486. package/build/types/integrations/tracing-channel/aws-sdk/index.d.ts +15 -0
  487. package/build/types/integrations/tracing-channel/aws-sdk/index.d.ts.map +1 -0
  488. package/build/types/integrations/tracing-channel/aws-sdk/services/MessageAttributes.d.ts +23 -0
  489. package/build/types/integrations/tracing-channel/aws-sdk/services/MessageAttributes.d.ts.map +1 -0
  490. package/build/types/integrations/tracing-channel/aws-sdk/services/ServiceExtension.d.ts +9 -0
  491. package/build/types/integrations/tracing-channel/aws-sdk/services/ServiceExtension.d.ts.map +1 -0
  492. package/build/types/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.d.ts +10 -0
  493. package/build/types/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.d.ts.map +1 -0
  494. package/build/types/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.d.ts +14 -0
  495. package/build/types/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.d.ts.map +1 -0
  496. package/build/types/integrations/tracing-channel/aws-sdk/services/dynamodb.d.ts +8 -0
  497. package/build/types/integrations/tracing-channel/aws-sdk/services/dynamodb.d.ts.map +1 -0
  498. package/build/types/integrations/tracing-channel/aws-sdk/services/index.d.ts +2 -0
  499. package/build/types/integrations/tracing-channel/aws-sdk/services/index.d.ts.map +1 -0
  500. package/build/types/integrations/tracing-channel/aws-sdk/services/kinesis.d.ts +6 -0
  501. package/build/types/integrations/tracing-channel/aws-sdk/services/kinesis.d.ts.map +1 -0
  502. package/build/types/integrations/tracing-channel/aws-sdk/services/lambda.d.ts +9 -0
  503. package/build/types/integrations/tracing-channel/aws-sdk/services/lambda.d.ts.map +1 -0
  504. package/build/types/integrations/tracing-channel/aws-sdk/services/s3.d.ts +6 -0
  505. package/build/types/integrations/tracing-channel/aws-sdk/services/s3.d.ts.map +1 -0
  506. package/build/types/integrations/tracing-channel/aws-sdk/services/secretsmanager.d.ts +8 -0
  507. package/build/types/integrations/tracing-channel/aws-sdk/services/secretsmanager.d.ts.map +1 -0
  508. package/build/types/integrations/tracing-channel/aws-sdk/services/sns.d.ts +9 -0
  509. package/build/types/integrations/tracing-channel/aws-sdk/services/sns.d.ts.map +1 -0
  510. package/build/types/integrations/tracing-channel/aws-sdk/services/sqs.d.ts +9 -0
  511. package/build/types/integrations/tracing-channel/aws-sdk/services/sqs.d.ts.map +1 -0
  512. package/build/types/integrations/tracing-channel/aws-sdk/services/stepfunctions.d.ts +6 -0
  513. package/build/types/integrations/tracing-channel/aws-sdk/services/stepfunctions.d.ts.map +1 -0
  514. package/build/types/integrations/tracing-channel/aws-sdk/types.d.ts +26 -0
  515. package/build/types/integrations/tracing-channel/aws-sdk/types.d.ts.map +1 -0
  516. package/build/types/integrations/tracing-channel/aws-sdk/utils.d.ts +5 -0
  517. package/build/types/integrations/tracing-channel/aws-sdk/utils.d.ts.map +1 -0
  518. package/build/types/integrations/tracing-channel/dataloader.d.ts +11 -0
  519. package/build/types/integrations/tracing-channel/dataloader.d.ts.map +1 -0
  520. package/build/types/integrations/tracing-channel/express/index.d.ts +18 -0
  521. package/build/types/integrations/tracing-channel/express/index.d.ts.map +1 -0
  522. package/build/types/integrations/tracing-channel/express/instrumentation.d.ts +4 -0
  523. package/build/types/integrations/tracing-channel/express/instrumentation.d.ts.map +1 -0
  524. package/build/types/integrations/tracing-channel/express/route.d.ts +28 -0
  525. package/build/types/integrations/tracing-channel/express/route.d.ts.map +1 -0
  526. package/build/types/integrations/tracing-channel/express/types.d.ts +64 -0
  527. package/build/types/integrations/tracing-channel/express/types.d.ts.map +1 -0
  528. package/build/types/integrations/tracing-channel/fastify/errors.d.ts +12 -0
  529. package/build/types/integrations/tracing-channel/fastify/errors.d.ts.map +1 -0
  530. package/build/types/integrations/tracing-channel/fastify/index.d.ts +66 -0
  531. package/build/types/integrations/tracing-channel/fastify/index.d.ts.map +1 -0
  532. package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts +10 -0
  533. package/build/types/integrations/tracing-channel/fastify/instrumentation.d.ts.map +1 -0
  534. package/build/types/integrations/tracing-channel/fastify/types.d.ts +32 -0
  535. package/build/types/integrations/tracing-channel/fastify/types.d.ts.map +1 -0
  536. package/build/types/integrations/tracing-channel/fastify/utils.d.ts +9 -0
  537. package/build/types/integrations/tracing-channel/fastify/utils.d.ts.map +1 -0
  538. package/build/types/integrations/tracing-channel/generic-pool.d.ts +10 -0
  539. package/build/types/integrations/tracing-channel/generic-pool.d.ts.map +1 -0
  540. package/build/types/integrations/tracing-channel/google-genai.d.ts +12 -0
  541. package/build/types/integrations/tracing-channel/google-genai.d.ts.map +1 -0
  542. package/build/types/integrations/tracing-channel/graphql/constants.d.ts +12 -0
  543. package/build/types/integrations/tracing-channel/graphql/constants.d.ts.map +1 -0
  544. package/build/types/integrations/tracing-channel/graphql/graphql-types.d.ts +135 -0
  545. package/build/types/integrations/tracing-channel/graphql/graphql-types.d.ts.map +1 -0
  546. package/build/types/integrations/tracing-channel/graphql/index.d.ts +28 -0
  547. package/build/types/integrations/tracing-channel/graphql/index.d.ts.map +1 -0
  548. package/build/types/integrations/tracing-channel/graphql/resolvers.d.ts +13 -0
  549. package/build/types/integrations/tracing-channel/graphql/resolvers.d.ts.map +1 -0
  550. package/build/types/integrations/tracing-channel/graphql/spans.d.ts +17 -0
  551. package/build/types/integrations/tracing-channel/graphql/spans.d.ts.map +1 -0
  552. package/build/types/integrations/tracing-channel/graphql/types.d.ts +25 -0
  553. package/build/types/integrations/tracing-channel/graphql/types.d.ts.map +1 -0
  554. package/build/types/integrations/tracing-channel/hapi-types.d.ts +53 -0
  555. package/build/types/integrations/tracing-channel/hapi-types.d.ts.map +1 -0
  556. package/build/types/integrations/tracing-channel/hapi-utils.d.ts +25 -0
  557. package/build/types/integrations/tracing-channel/hapi-utils.d.ts.map +1 -0
  558. package/build/types/integrations/tracing-channel/hapi.d.ts +9 -0
  559. package/build/types/integrations/tracing-channel/hapi.d.ts.map +1 -0
  560. package/build/types/integrations/tracing-channel/ioredis.d.ts +37 -0
  561. package/build/types/integrations/tracing-channel/ioredis.d.ts.map +1 -0
  562. package/build/types/integrations/tracing-channel/kafkajs/consumer.d.ts +8 -0
  563. package/build/types/integrations/tracing-channel/kafkajs/consumer.d.ts.map +1 -0
  564. package/build/types/integrations/tracing-channel/kafkajs/index.d.ts +17 -0
  565. package/build/types/integrations/tracing-channel/kafkajs/index.d.ts.map +1 -0
  566. package/build/types/integrations/tracing-channel/kafkajs/semconv.d.ts +10 -0
  567. package/build/types/integrations/tracing-channel/kafkajs/semconv.d.ts.map +1 -0
  568. package/build/types/integrations/tracing-channel/kafkajs/spans.d.ts +38 -0
  569. package/build/types/integrations/tracing-channel/kafkajs/spans.d.ts.map +1 -0
  570. package/build/types/integrations/tracing-channel/kafkajs/types.d.ts +40 -0
  571. package/build/types/integrations/tracing-channel/kafkajs/types.d.ts.map +1 -0
  572. package/build/types/integrations/tracing-channel/knex.d.ts +11 -0
  573. package/build/types/integrations/tracing-channel/knex.d.ts.map +1 -0
  574. package/build/types/integrations/tracing-channel/koa.d.ts +14 -0
  575. package/build/types/integrations/tracing-channel/koa.d.ts.map +1 -0
  576. package/build/types/integrations/tracing-channel/langchain.d.ts +10 -0
  577. package/build/types/integrations/tracing-channel/langchain.d.ts.map +1 -0
  578. package/build/types/integrations/tracing-channel/langgraph.d.ts +10 -0
  579. package/build/types/integrations/tracing-channel/langgraph.d.ts.map +1 -0
  580. package/build/types/integrations/tracing-channel/lru-memoizer.d.ts +10 -0
  581. package/build/types/integrations/tracing-channel/lru-memoizer.d.ts.map +1 -0
  582. package/build/types/integrations/tracing-channel/mongodb.d.ts +12 -0
  583. package/build/types/integrations/tracing-channel/mongodb.d.ts.map +1 -0
  584. package/build/types/integrations/tracing-channel/mongoose.d.ts +15 -0
  585. package/build/types/integrations/tracing-channel/mongoose.d.ts.map +1 -0
  586. package/build/types/integrations/tracing-channel/mysql.d.ts +12 -0
  587. package/build/types/integrations/tracing-channel/mysql.d.ts.map +1 -0
  588. package/build/types/integrations/tracing-channel/mysql2.d.ts +15 -0
  589. package/build/types/integrations/tracing-channel/mysql2.d.ts.map +1 -0
  590. package/build/types/integrations/tracing-channel/openai.d.ts +10 -0
  591. package/build/types/integrations/tracing-channel/openai.d.ts.map +1 -0
  592. package/build/types/integrations/tracing-channel/postgres-js.d.ts +26 -0
  593. package/build/types/integrations/tracing-channel/postgres-js.d.ts.map +1 -0
  594. package/build/types/integrations/tracing-channel/postgres.d.ts +15 -0
  595. package/build/types/integrations/tracing-channel/postgres.d.ts.map +1 -0
  596. package/build/types/integrations/tracing-channel/redis.d.ts +16 -0
  597. package/build/types/integrations/tracing-channel/redis.d.ts.map +1 -0
  598. package/build/types/integrations/tracing-channel/tedious.d.ts +11 -0
  599. package/build/types/integrations/tracing-channel/tedious.d.ts.map +1 -0
  600. package/build/types/integrations/tracing-channel/vercel-ai.d.ts +13 -0
  601. package/build/types/integrations/tracing-channel/vercel-ai.d.ts.map +1 -0
  602. package/build/types/mongodb/mongodb-span.d.ts +66 -0
  603. package/build/types/mongodb/mongodb-span.d.ts.map +1 -0
  604. package/build/types/mongoose/index.d.ts +13 -0
  605. package/build/types/mongoose/index.d.ts.map +1 -0
  606. package/build/types/mongoose/mongoose-dc-subscriber.d.ts +63 -0
  607. package/build/types/mongoose/mongoose-dc-subscriber.d.ts.map +1 -0
  608. package/build/types/mongoose/mongoose-legacy-span.d.ts +29 -0
  609. package/build/types/mongoose/mongoose-legacy-span.d.ts.map +1 -0
  610. package/build/types/mysql2/index.d.ts +11 -0
  611. package/build/types/mysql2/index.d.ts.map +1 -0
  612. package/build/types/mysql2/mysql2-dc-subscriber.d.ts +59 -0
  613. package/build/types/mysql2/mysql2-dc-subscriber.d.ts.map +1 -0
  614. package/build/types/orchestrion/bundler/esbuild.d.ts +21 -0
  615. package/build/types/orchestrion/bundler/esbuild.d.ts.map +1 -0
  616. package/build/types/orchestrion/bundler/options.d.ts +29 -0
  617. package/build/types/orchestrion/bundler/options.d.ts.map +1 -0
  618. package/build/types/orchestrion/bundler/rollup.d.ts +17 -0
  619. package/build/types/orchestrion/bundler/rollup.d.ts.map +1 -0
  620. package/build/types/orchestrion/bundler/vite.d.ts +18 -0
  621. package/build/types/orchestrion/bundler/vite.d.ts.map +1 -0
  622. package/build/types/orchestrion/bundler/webpack.d.ts +19 -0
  623. package/build/types/orchestrion/bundler/webpack.d.ts.map +1 -0
  624. package/build/types/orchestrion/channels.d.ts +130 -0
  625. package/build/types/orchestrion/channels.d.ts.map +1 -0
  626. package/build/types/orchestrion/config/amqplib.d.ts +66 -0
  627. package/build/types/orchestrion/config/amqplib.d.ts.map +1 -0
  628. package/build/types/orchestrion/config/anthropic-ai.d.ts +31 -0
  629. package/build/types/orchestrion/config/anthropic-ai.d.ts.map +1 -0
  630. package/build/types/orchestrion/config/aws-sdk.d.ts +19 -0
  631. package/build/types/orchestrion/config/aws-sdk.d.ts.map +1 -0
  632. package/build/types/orchestrion/config/dataloader.d.ts +46 -0
  633. package/build/types/orchestrion/config/dataloader.d.ts.map +1 -0
  634. package/build/types/orchestrion/config/express.d.ts +30 -0
  635. package/build/types/orchestrion/config/express.d.ts.map +1 -0
  636. package/build/types/orchestrion/config/firebase.d.ts +4 -0
  637. package/build/types/orchestrion/config/firebase.d.ts.map +1 -0
  638. package/build/types/orchestrion/config/generic-pool.d.ts +31 -0
  639. package/build/types/orchestrion/config/generic-pool.d.ts.map +1 -0
  640. package/build/types/orchestrion/config/google-genai.d.ts +30 -0
  641. package/build/types/orchestrion/config/google-genai.d.ts.map +1 -0
  642. package/build/types/orchestrion/config/graphql.d.ts +29 -0
  643. package/build/types/orchestrion/config/graphql.d.ts.map +1 -0
  644. package/build/types/orchestrion/config/hapi.d.ts +17 -0
  645. package/build/types/orchestrion/config/hapi.d.ts.map +1 -0
  646. package/build/types/orchestrion/config/index.d.ts +37 -0
  647. package/build/types/orchestrion/config/index.d.ts.map +1 -0
  648. package/build/types/orchestrion/config/ioredis.d.ts +7 -0
  649. package/build/types/orchestrion/config/ioredis.d.ts.map +1 -0
  650. package/build/types/orchestrion/config/kafkajs.d.ts +17 -0
  651. package/build/types/orchestrion/config/kafkajs.d.ts.map +1 -0
  652. package/build/types/orchestrion/config/knex.d.ts +9 -0
  653. package/build/types/orchestrion/config/knex.d.ts.map +1 -0
  654. package/build/types/orchestrion/config/koa.d.ts +17 -0
  655. package/build/types/orchestrion/config/koa.d.ts.map +1 -0
  656. package/build/types/orchestrion/config/langchain.d.ts +18 -0
  657. package/build/types/orchestrion/config/langchain.d.ts.map +1 -0
  658. package/build/types/orchestrion/config/langgraph.d.ts +21 -0
  659. package/build/types/orchestrion/config/langgraph.d.ts.map +1 -0
  660. package/build/types/orchestrion/config/lru-memoizer.d.ts +16 -0
  661. package/build/types/orchestrion/config/lru-memoizer.d.ts.map +1 -0
  662. package/build/types/orchestrion/config/mongodb.d.ts +59 -0
  663. package/build/types/orchestrion/config/mongodb.d.ts.map +1 -0
  664. package/build/types/orchestrion/config/mongoose.d.ts +40 -0
  665. package/build/types/orchestrion/config/mongoose.d.ts.map +1 -0
  666. package/build/types/orchestrion/config/mysql.d.ts +16 -0
  667. package/build/types/orchestrion/config/mysql.d.ts.map +1 -0
  668. package/build/types/orchestrion/config/mysql2.d.ts +18 -0
  669. package/build/types/orchestrion/config/mysql2.d.ts.map +1 -0
  670. package/build/types/orchestrion/config/nestjs.d.ts +24 -0
  671. package/build/types/orchestrion/config/nestjs.d.ts.map +1 -0
  672. package/build/types/orchestrion/config/openai.d.ts +18 -0
  673. package/build/types/orchestrion/config/openai.d.ts.map +1 -0
  674. package/build/types/orchestrion/config/pg.d.ts +33 -0
  675. package/build/types/orchestrion/config/pg.d.ts.map +1 -0
  676. package/build/types/orchestrion/config/postgres.d.ts +9 -0
  677. package/build/types/orchestrion/config/postgres.d.ts.map +1 -0
  678. package/build/types/orchestrion/config/prisma.d.ts +4 -0
  679. package/build/types/orchestrion/config/prisma.d.ts.map +1 -0
  680. package/build/types/orchestrion/config/react-router.d.ts +4 -0
  681. package/build/types/orchestrion/config/react-router.d.ts.map +1 -0
  682. package/build/types/orchestrion/config/redis.d.ts +37 -0
  683. package/build/types/orchestrion/config/redis.d.ts.map +1 -0
  684. package/build/types/orchestrion/config/remix.d.ts +9 -0
  685. package/build/types/orchestrion/config/remix.d.ts.map +1 -0
  686. package/build/types/orchestrion/config/tedious.d.ts +12 -0
  687. package/build/types/orchestrion/config/tedious.d.ts.map +1 -0
  688. package/build/types/orchestrion/config/vercel-ai.d.ts +12 -0
  689. package/build/types/orchestrion/config/vercel-ai.d.ts.map +1 -0
  690. package/build/types/orchestrion/detect.d.ts +26 -0
  691. package/build/types/orchestrion/detect.d.ts.map +1 -0
  692. package/build/types/orchestrion/index.d.ts +136 -0
  693. package/build/types/orchestrion/index.d.ts.map +1 -0
  694. package/build/types/orchestrion/runtime/register.d.ts +25 -0
  695. package/build/types/orchestrion/runtime/register.d.ts.map +1 -0
  696. package/build/types/prisma/global.d.ts +5 -0
  697. package/build/types/prisma/global.d.ts.map +1 -0
  698. package/build/types/prisma/index.d.ts +45 -0
  699. package/build/types/prisma/index.d.ts.map +1 -0
  700. package/build/types/prisma/tracing-helper.d.ts +46 -0
  701. package/build/types/prisma/tracing-helper.d.ts.map +1 -0
  702. package/build/types/prisma/types.d.ts +37 -0
  703. package/build/types/prisma/types.d.ts.map +1 -0
  704. package/build/types/redis/index.d.ts +18 -0
  705. package/build/types/redis/index.d.ts.map +1 -0
  706. package/build/types/redis/redis-dc-subscriber.d.ts +89 -0
  707. package/build/types/redis/redis-dc-subscriber.d.ts.map +1 -0
  708. package/build/types/redis/redis-statement-serializer.d.ts +6 -0
  709. package/build/types/redis/redis-statement-serializer.d.ts.map +1 -0
  710. package/build/types/tracing-channel.d.ts +73 -0
  711. package/build/types/tracing-channel.d.ts.map +1 -0
  712. package/build/types/vercel-ai/index.d.ts +27 -0
  713. package/build/types/vercel-ai/index.d.ts.map +1 -0
  714. package/build/types/vercel-ai/util.d.ts +30 -0
  715. package/build/types/vercel-ai/util.d.ts.map +1 -0
  716. package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts +72 -0
  717. package/build/types/vercel-ai/vercel-ai-dc-subscriber.d.ts.map +1 -0
  718. package/build/types/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts +12 -0
  719. package/build/types/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts.map +1 -0
  720. package/build/types-ts3.8/debug-build.d.ts +7 -0
  721. package/build/types-ts3.8/graphql/graphql-dc-subscriber.d.ts +94 -0
  722. package/build/types-ts3.8/graphql/index.d.ts +12 -0
  723. package/build/types-ts3.8/graphql/utils.d.ts +36 -0
  724. package/build/types-ts3.8/index.d.ts +23 -0
  725. package/build/types-ts3.8/integrations/tracing-channel/amqplib.d.ts +11 -0
  726. package/build/types-ts3.8/integrations/tracing-channel/anthropic.d.ts +10 -0
  727. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/aws-sdk.types.d.ts +43 -0
  728. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/constants.d.ts +15 -0
  729. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/index.d.ts +15 -0
  730. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/MessageAttributes.d.ts +23 -0
  731. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/ServiceExtension.d.ts +9 -0
  732. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/ServicesExtensions.d.ts +10 -0
  733. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/bedrock-runtime.d.ts +14 -0
  734. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/dynamodb.d.ts +8 -0
  735. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/index.d.ts +2 -0
  736. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/kinesis.d.ts +6 -0
  737. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/lambda.d.ts +9 -0
  738. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/s3.d.ts +6 -0
  739. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/secretsmanager.d.ts +8 -0
  740. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/sns.d.ts +9 -0
  741. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/sqs.d.ts +9 -0
  742. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/services/stepfunctions.d.ts +6 -0
  743. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/types.d.ts +26 -0
  744. package/build/types-ts3.8/integrations/tracing-channel/aws-sdk/utils.d.ts +5 -0
  745. package/build/types-ts3.8/integrations/tracing-channel/dataloader.d.ts +11 -0
  746. package/build/types-ts3.8/integrations/tracing-channel/express/index.d.ts +18 -0
  747. package/build/types-ts3.8/integrations/tracing-channel/express/instrumentation.d.ts +4 -0
  748. package/build/types-ts3.8/integrations/tracing-channel/express/route.d.ts +28 -0
  749. package/build/types-ts3.8/integrations/tracing-channel/express/types.d.ts +64 -0
  750. package/build/types-ts3.8/integrations/tracing-channel/fastify/errors.d.ts +12 -0
  751. package/build/types-ts3.8/integrations/tracing-channel/fastify/index.d.ts +66 -0
  752. package/build/types-ts3.8/integrations/tracing-channel/fastify/instrumentation.d.ts +10 -0
  753. package/build/types-ts3.8/integrations/tracing-channel/fastify/types.d.ts +32 -0
  754. package/build/types-ts3.8/integrations/tracing-channel/fastify/utils.d.ts +9 -0
  755. package/build/types-ts3.8/integrations/tracing-channel/generic-pool.d.ts +10 -0
  756. package/build/types-ts3.8/integrations/tracing-channel/google-genai.d.ts +12 -0
  757. package/build/types-ts3.8/integrations/tracing-channel/graphql/constants.d.ts +12 -0
  758. package/build/types-ts3.8/integrations/tracing-channel/graphql/graphql-types.d.ts +135 -0
  759. package/build/types-ts3.8/integrations/tracing-channel/graphql/index.d.ts +30 -0
  760. package/build/types-ts3.8/integrations/tracing-channel/graphql/resolvers.d.ts +13 -0
  761. package/build/types-ts3.8/integrations/tracing-channel/graphql/spans.d.ts +17 -0
  762. package/build/types-ts3.8/integrations/tracing-channel/graphql/types.d.ts +25 -0
  763. package/build/types-ts3.8/integrations/tracing-channel/hapi-types.d.ts +65 -0
  764. package/build/types-ts3.8/integrations/tracing-channel/hapi-utils.d.ts +25 -0
  765. package/build/types-ts3.8/integrations/tracing-channel/hapi.d.ts +9 -0
  766. package/build/types-ts3.8/integrations/tracing-channel/ioredis.d.ts +37 -0
  767. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/consumer.d.ts +8 -0
  768. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/index.d.ts +17 -0
  769. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/semconv.d.ts +10 -0
  770. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/spans.d.ts +38 -0
  771. package/build/types-ts3.8/integrations/tracing-channel/kafkajs/types.d.ts +40 -0
  772. package/build/types-ts3.8/integrations/tracing-channel/knex.d.ts +11 -0
  773. package/build/types-ts3.8/integrations/tracing-channel/koa.d.ts +14 -0
  774. package/build/types-ts3.8/integrations/tracing-channel/langchain.d.ts +10 -0
  775. package/build/types-ts3.8/integrations/tracing-channel/langgraph.d.ts +10 -0
  776. package/build/types-ts3.8/integrations/tracing-channel/lru-memoizer.d.ts +10 -0
  777. package/build/types-ts3.8/integrations/tracing-channel/mongodb.d.ts +12 -0
  778. package/build/types-ts3.8/integrations/tracing-channel/mongoose.d.ts +15 -0
  779. package/build/types-ts3.8/integrations/tracing-channel/mysql.d.ts +12 -0
  780. package/build/types-ts3.8/integrations/tracing-channel/mysql2.d.ts +15 -0
  781. package/build/types-ts3.8/integrations/tracing-channel/openai.d.ts +10 -0
  782. package/build/types-ts3.8/integrations/tracing-channel/postgres-js.d.ts +26 -0
  783. package/build/types-ts3.8/integrations/tracing-channel/postgres.d.ts +15 -0
  784. package/build/types-ts3.8/integrations/tracing-channel/redis.d.ts +16 -0
  785. package/build/types-ts3.8/integrations/tracing-channel/tedious.d.ts +11 -0
  786. package/build/types-ts3.8/integrations/tracing-channel/vercel-ai.d.ts +13 -0
  787. package/build/types-ts3.8/mongodb/mongodb-span.d.ts +66 -0
  788. package/build/types-ts3.8/mongoose/index.d.ts +13 -0
  789. package/build/types-ts3.8/mongoose/mongoose-dc-subscriber.d.ts +63 -0
  790. package/build/types-ts3.8/mongoose/mongoose-legacy-span.d.ts +29 -0
  791. package/build/types-ts3.8/mysql2/index.d.ts +11 -0
  792. package/build/types-ts3.8/mysql2/mysql2-dc-subscriber.d.ts +59 -0
  793. package/build/types-ts3.8/node-diagnostics-channel.d.ts +19 -0
  794. package/build/types-ts3.8/orchestrion/bundler/esbuild.d.ts +21 -0
  795. package/build/types-ts3.8/orchestrion/bundler/options.d.ts +29 -0
  796. package/build/types-ts3.8/orchestrion/bundler/rollup.d.ts +17 -0
  797. package/build/types-ts3.8/orchestrion/bundler/vite.d.ts +18 -0
  798. package/build/types-ts3.8/orchestrion/bundler/webpack.d.ts +19 -0
  799. package/build/types-ts3.8/orchestrion/channels.d.ts +130 -0
  800. package/build/types-ts3.8/orchestrion/config/amqplib.d.ts +66 -0
  801. package/build/types-ts3.8/orchestrion/config/anthropic-ai.d.ts +31 -0
  802. package/build/types-ts3.8/orchestrion/config/aws-sdk.d.ts +19 -0
  803. package/build/types-ts3.8/orchestrion/config/dataloader.d.ts +46 -0
  804. package/build/types-ts3.8/orchestrion/config/express.d.ts +30 -0
  805. package/build/types-ts3.8/orchestrion/config/firebase.d.ts +4 -0
  806. package/build/types-ts3.8/orchestrion/config/generic-pool.d.ts +31 -0
  807. package/build/types-ts3.8/orchestrion/config/google-genai.d.ts +30 -0
  808. package/build/types-ts3.8/orchestrion/config/graphql.d.ts +29 -0
  809. package/build/types-ts3.8/orchestrion/config/hapi.d.ts +17 -0
  810. package/build/types-ts3.8/orchestrion/config/index.d.ts +37 -0
  811. package/build/types-ts3.8/orchestrion/config/ioredis.d.ts +7 -0
  812. package/build/types-ts3.8/orchestrion/config/kafkajs.d.ts +17 -0
  813. package/build/types-ts3.8/orchestrion/config/knex.d.ts +9 -0
  814. package/build/types-ts3.8/orchestrion/config/koa.d.ts +17 -0
  815. package/build/types-ts3.8/orchestrion/config/langchain.d.ts +18 -0
  816. package/build/types-ts3.8/orchestrion/config/langgraph.d.ts +21 -0
  817. package/build/types-ts3.8/orchestrion/config/lru-memoizer.d.ts +16 -0
  818. package/build/types-ts3.8/orchestrion/config/mongodb.d.ts +59 -0
  819. package/build/types-ts3.8/orchestrion/config/mongoose.d.ts +40 -0
  820. package/build/types-ts3.8/orchestrion/config/mysql.d.ts +16 -0
  821. package/build/types-ts3.8/orchestrion/config/mysql2.d.ts +18 -0
  822. package/build/types-ts3.8/orchestrion/config/nestjs.d.ts +24 -0
  823. package/build/types-ts3.8/orchestrion/config/openai.d.ts +18 -0
  824. package/build/types-ts3.8/orchestrion/config/pg.d.ts +33 -0
  825. package/build/types-ts3.8/orchestrion/config/postgres.d.ts +9 -0
  826. package/build/types-ts3.8/orchestrion/config/prisma.d.ts +4 -0
  827. package/build/types-ts3.8/orchestrion/config/react-router.d.ts +4 -0
  828. package/build/types-ts3.8/orchestrion/config/redis.d.ts +37 -0
  829. package/build/types-ts3.8/orchestrion/config/remix.d.ts +9 -0
  830. package/build/types-ts3.8/orchestrion/config/tedious.d.ts +12 -0
  831. package/build/types-ts3.8/orchestrion/config/vercel-ai.d.ts +12 -0
  832. package/build/types-ts3.8/orchestrion/detect.d.ts +26 -0
  833. package/build/types-ts3.8/orchestrion/index.d.ts +138 -0
  834. package/build/types-ts3.8/orchestrion/runtime/register.d.ts +25 -0
  835. package/build/types-ts3.8/prisma/global.d.ts +5 -0
  836. package/build/types-ts3.8/prisma/index.d.ts +45 -0
  837. package/build/types-ts3.8/prisma/tracing-helper.d.ts +52 -0
  838. package/build/types-ts3.8/prisma/types.d.ts +40 -0
  839. package/build/types-ts3.8/redis/index.d.ts +18 -0
  840. package/build/types-ts3.8/redis/redis-dc-subscriber.d.ts +89 -0
  841. package/build/types-ts3.8/redis/redis-statement-serializer.d.ts +6 -0
  842. package/build/types-ts3.8/tracing-channel.d.ts +73 -0
  843. package/build/types-ts3.8/vercel-ai/index.d.ts +27 -0
  844. package/build/types-ts3.8/vercel-ai/util.d.ts +30 -0
  845. package/build/types-ts3.8/vercel-ai/vercel-ai-dc-subscriber.d.ts +72 -0
  846. package/build/types-ts3.8/vercel-ai/vercel-ai-orchestrion-subscriber.d.ts +12 -0
  847. package/changes.json +14 -0
  848. package/package.json +189 -0
@@ -0,0 +1,98 @@
1
+ import * as diagnosticsChannel from 'node:diagnostics_channel';
2
+ import { defineIntegration, LANGGRAPH_INTEGRATION_NAME, resolveAIRecordingOptions, createLangChainCallbackHandler, waitForTracingChannelBinding, debug, startInactiveSpan, _INTERNAL_getLangGraphCreateAgentSpanOptions, wrapToolsWithSpans, extractAgentNameFromParams, extractLLMFromParams, instrumentCompiledGraphInvoke } from '@sentry/core';
3
+ import { DEBUG_BUILD } from '../../debug-build.js';
4
+ import { CHANNELS } from '../../orchestrion/channels.js';
5
+ import { bindTracingChannelToSpan } from '../../tracing-channel.js';
6
+
7
+ const INTEGRATION_NAME = LANGGRAPH_INTEGRATION_NAME;
8
+ let subscribed = false;
9
+ let insideCreateReactAgent = false;
10
+ const _langGraphChannelIntegration = ((options = {}) => {
11
+ return {
12
+ name: INTEGRATION_NAME,
13
+ setupOnce() {
14
+ if (!diagnosticsChannel.tracingChannel || subscribed) {
15
+ return;
16
+ }
17
+ subscribed = true;
18
+ const resolvedOptions = resolveAIRecordingOptions(options);
19
+ const sentryHandler = createLangChainCallbackHandler(resolvedOptions);
20
+ waitForTracingChannelBinding(() => {
21
+ DEBUG_BUILD && debug.log(`[orchestrion:langgraph] subscribing to channel "${CHANNELS.LANGGRAPH_STATE_GRAPH_COMPILE}"`);
22
+ bindTracingChannelToSpan(
23
+ diagnosticsChannel.tracingChannel(CHANNELS.LANGGRAPH_STATE_GRAPH_COMPILE),
24
+ (data) => {
25
+ if (insideCreateReactAgent) {
26
+ return void 0;
27
+ }
28
+ const compileOptions = getFirstArgObject(data.arguments);
29
+ const name = typeof compileOptions?.name === "string" ? compileOptions.name : void 0;
30
+ return startInactiveSpan(_INTERNAL_getLangGraphCreateAgentSpanOptions(name));
31
+ },
32
+ {
33
+ beforeSpanEnd: (_span, data) => {
34
+ wrapCompiledGraphInvoke(
35
+ data.result,
36
+ getFirstArgObject(data.arguments) ?? {},
37
+ resolvedOptions,
38
+ null,
39
+ sentryHandler
40
+ );
41
+ }
42
+ }
43
+ );
44
+ DEBUG_BUILD && debug.log(`[orchestrion:langgraph] subscribing to channel "${CHANNELS.LANGGRAPH_CREATE_REACT_AGENT}"`);
45
+ const reactAgentChannel = diagnosticsChannel.tracingChannel(
46
+ CHANNELS.LANGGRAPH_CREATE_REACT_AGENT
47
+ );
48
+ reactAgentChannel.start.subscribe((message) => {
49
+ insideCreateReactAgent = true;
50
+ try {
51
+ const { arguments: args } = message;
52
+ const params = getFirstArgObject(args);
53
+ if (params && Array.isArray(params.tools) && params.tools.length > 0) {
54
+ wrapToolsWithSpans(params.tools, resolvedOptions, extractAgentNameFromParams(args) ?? void 0);
55
+ }
56
+ } catch (error) {
57
+ DEBUG_BUILD && debug.error("[orchestrion:langgraph] failed to wrap createReactAgent tools", error);
58
+ }
59
+ });
60
+ reactAgentChannel.end.subscribe((message) => {
61
+ insideCreateReactAgent = false;
62
+ const { arguments: args, result } = message;
63
+ const agentName = extractAgentNameFromParams(args) ?? void 0;
64
+ const compileOptions = agentName ? { name: agentName } : {};
65
+ wrapCompiledGraphInvoke(result, compileOptions, resolvedOptions, extractLLMFromParams(args), sentryHandler);
66
+ });
67
+ reactAgentChannel.error.subscribe(() => {
68
+ insideCreateReactAgent = false;
69
+ });
70
+ });
71
+ }
72
+ };
73
+ });
74
+ function getFirstArgObject(args) {
75
+ const first = (args ?? [])[0];
76
+ return typeof first === "object" && first !== null ? first : void 0;
77
+ }
78
+ function wrapCompiledGraphInvoke(graph, compileOptions, options, llm, sentryHandler) {
79
+ if (!graph || typeof graph !== "object") {
80
+ return;
81
+ }
82
+ const compiledGraph = graph;
83
+ const originalInvoke = compiledGraph.invoke;
84
+ if (typeof originalInvoke === "function") {
85
+ compiledGraph.invoke = instrumentCompiledGraphInvoke(
86
+ originalInvoke.bind(compiledGraph),
87
+ compiledGraph,
88
+ compileOptions,
89
+ options,
90
+ llm,
91
+ sentryHandler
92
+ );
93
+ }
94
+ }
95
+ const langGraphChannelIntegration = defineIntegration(_langGraphChannelIntegration);
96
+
97
+ export { langGraphChannelIntegration };
98
+ //# sourceMappingURL=langgraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"langgraph.js","sources":["../../../../src/integrations/tracing-channel/langgraph.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { CompiledGraph, IntegrationFn, LangGraphOptions } from '@sentry/core';\nimport {\n _INTERNAL_getLangGraphCreateAgentSpanOptions,\n createLangChainCallbackHandler,\n debug,\n defineIntegration,\n extractAgentNameFromParams,\n extractLLMFromParams,\n instrumentCompiledGraphInvoke,\n LANGGRAPH_INTEGRATION_NAME,\n resolveAIRecordingOptions,\n startInactiveSpan,\n waitForTracingChannelBinding,\n wrapToolsWithSpans,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { CHANNELS } from '../../orchestrion/channels';\nimport { bindTracingChannelToSpan } from '../../tracing-channel';\n\n// Same name as the OTel integration by design: when enabled, the OTel 'LangGraph' integration is\n// dropped from the default set (see the Node opt-in loader).\nconst INTEGRATION_NAME = LANGGRAPH_INTEGRATION_NAME;\n\ninterface CompileChannelContext {\n arguments: unknown[];\n result?: unknown;\n}\n\ninterface CreateReactAgentChannelContext {\n arguments: unknown[];\n result?: unknown;\n}\n\nlet subscribed = false;\n\n// `createReactAgent` compiles a `StateGraph` internally; suppress the `create_agent` span for that\n// nested compile so a react agent gets a single `invoke_agent` span, matching the OTel path.\nlet insideCreateReactAgent = false;\n\nconst _langGraphChannelIntegration = ((options: LangGraphOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // `tracingChannel` is unavailable before Node 18.19, and a second `init()` would double-subscribe.\n if (!diagnosticsChannel.tracingChannel || subscribed) {\n return;\n }\n subscribed = true;\n\n const resolvedOptions = resolveAIRecordingOptions(options);\n const sentryHandler = createLangChainCallbackHandler(resolvedOptions);\n\n // `bindTracingChannelToSpan` needs the async-context binding that `initOpenTelemetry()` registers\n // after `setupOnce` runs, so wait for it before subscribing.\n waitForTracingChannelBinding(() => {\n // StateGraph.compile → `create_agent` span, then wrap the returned graph's `invoke`.\n DEBUG_BUILD &&\n debug.log(`[orchestrion:langgraph] subscribing to channel \"${CHANNELS.LANGGRAPH_STATE_GRAPH_COMPILE}\"`);\n bindTracingChannelToSpan(\n diagnosticsChannel.tracingChannel<CompileChannelContext>(CHANNELS.LANGGRAPH_STATE_GRAPH_COMPILE),\n data => {\n if (insideCreateReactAgent) {\n return undefined;\n }\n const compileOptions = getFirstArgObject(data.arguments);\n const name = typeof compileOptions?.name === 'string' ? compileOptions.name : undefined;\n\n return startInactiveSpan(_INTERNAL_getLangGraphCreateAgentSpanOptions(name));\n },\n {\n beforeSpanEnd: (_span, data) => {\n wrapCompiledGraphInvoke(\n data.result,\n getFirstArgObject(data.arguments) ?? {},\n resolvedOptions,\n null,\n sentryHandler,\n );\n },\n },\n );\n\n // createReactAgent has no `create_agent` span of its own; it only wraps tools and the returned\n // graph's `invoke`. Tools are wrapped at `start` (before the agent runs), invoke at `end`.\n DEBUG_BUILD &&\n debug.log(`[orchestrion:langgraph] subscribing to channel \"${CHANNELS.LANGGRAPH_CREATE_REACT_AGENT}\"`);\n const reactAgentChannel = diagnosticsChannel.tracingChannel<CreateReactAgentChannelContext>(\n CHANNELS.LANGGRAPH_CREATE_REACT_AGENT,\n );\n reactAgentChannel.start.subscribe(message => {\n // `createReactAgent` runs synchronously and compiles a `StateGraph` internally, so the flag\n // must be on for the duration and off by `end`. It's set here (never in a branch that can\n // throw) and cleared in both `end` and `error`, so it can neither stick on across calls nor\n // stay off during this call's nested compile. Tool wrapping is guarded for the same reason.\n insideCreateReactAgent = true;\n try {\n const { arguments: args } = message as CreateReactAgentChannelContext;\n const params = getFirstArgObject(args);\n if (params && Array.isArray(params.tools) && params.tools.length > 0) {\n wrapToolsWithSpans(params.tools, resolvedOptions, extractAgentNameFromParams(args) ?? undefined);\n }\n } catch (error) {\n DEBUG_BUILD && debug.error('[orchestrion:langgraph] failed to wrap createReactAgent tools', error);\n }\n });\n reactAgentChannel.end.subscribe(message => {\n insideCreateReactAgent = false;\n const { arguments: args, result } = message as CreateReactAgentChannelContext;\n const agentName = extractAgentNameFromParams(args) ?? undefined;\n const compileOptions = agentName ? { name: agentName } : {};\n wrapCompiledGraphInvoke(result, compileOptions, resolvedOptions, extractLLMFromParams(args), sentryHandler);\n });\n // Make sure a thrown `createReactAgent` doesn't leave the suppression flag stuck on.\n reactAgentChannel.error.subscribe(() => {\n insideCreateReactAgent = false;\n });\n });\n },\n };\n}) satisfies IntegrationFn;\n\nfunction getFirstArgObject(args: unknown[] | undefined): Record<string, unknown> | undefined {\n const first = (args ?? [])[0];\n\n return typeof first === 'object' && first !== null ? (first as Record<string, unknown>) : undefined;\n}\n\n/**\n * Wrap the compiled graph's `invoke` with the shared `invoke_agent` instrumentation, exactly as the\n * OTel path does on the returned graph.\n */\nfunction wrapCompiledGraphInvoke(\n graph: unknown,\n compileOptions: Record<string, unknown>,\n options: LangGraphOptions,\n llm: ReturnType<typeof extractLLMFromParams>,\n sentryHandler: unknown,\n): void {\n if (!graph || typeof graph !== 'object') {\n return;\n }\n\n const compiledGraph = graph as CompiledGraph;\n const originalInvoke = compiledGraph.invoke;\n if (typeof originalInvoke === 'function') {\n compiledGraph.invoke = instrumentCompiledGraphInvoke(\n originalInvoke.bind(compiledGraph),\n compiledGraph,\n compileOptions,\n options,\n llm,\n sentryHandler,\n );\n }\n}\n\n/**\n * EXPERIMENTAL — orchestrion-driven LangGraph integration. Subscribes to the diagnostics_channels\n * injected into `@langchain/langgraph`'s `StateGraph.compile` and `createReactAgent`, so it requires\n * the orchestrion runtime hook or bundler plugin.\n */\nexport const langGraphChannel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BAAA,CAAwB,QAAQ,cAAA,EAAgB,eAAA,EAAiB,oBAAA,CAAqB,IAAI,GAAG,aAAa,CAAA;AAAA,QAC5G,CAAC,CAAA;AAED,QAAA,iBAAA,CAAkB,KAAA,CAAM,UAAU,MAAM;AACtC,UAAA,sBAAA,GAAyB,KAAA;AAAA,QAC3B,CAAC,CAAA;AAAA,MACH,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAA,CAAA;AAEA,SAAS,kBAAkB,IAAA,EAAkE;AAC3F,EAAA,MAAM,KAAA,GAAA,CAAS,IAAA,IAAQ,EAAC,EAAG,CAAC,CAAA;AAE5B,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,OAAQ,KAAA,GAAoC,MAAA;AAC5F;AAMA,SAAS,uBAAA,CACP,KAAA,EACA,cAAA,EACA,OAAA,EACA,KACA,aAAA,EACM;AACN,EAAA,IAAI,CAAC,KAAA,IAAS,OAAO,KAAA,KAAU,QAAA,EAAU;AACvC,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,aAAA,GAAgB,KAAA;AACtB,EAAA,MAAM,iBAAiB,aAAA,CAAc,MAAA;AACrC,EAAA,IAAI,OAAO,mBAAmB,UAAA,EAAY;AACxC,IAAA,aAAA,CAAc,MAAA,GAAS,6BAAA;AAAA,MACrB,cAAA,CAAe,KAAK,aAAa,CAAA;AAAA,MACjC,aAAA;AAAA,MACA,cAAA;AAAA,MACA,OAAA;AAAA,MACA,GAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AACF;AAOO,MAAM,2BAAA,GAA8B,kBAAkB,4BAA4B;;;;"}
@@ -0,0 +1,29 @@
1
+ import * as diagnosticsChannel from 'node:diagnostics_channel';
2
+ import { defineIntegration, debug, waitForTracingChannelBinding } from '@sentry/core';
3
+ import { DEBUG_BUILD } from '../../debug-build.js';
4
+ import { CHANNELS } from '../../orchestrion/channels.js';
5
+ import { bindTracingChannelToSpan } from '../../tracing-channel.js';
6
+
7
+ const INTEGRATION_NAME = "LruMemoizer";
8
+ const _lruMemoizerChannelIntegration = (() => {
9
+ return {
10
+ name: INTEGRATION_NAME,
11
+ setupOnce() {
12
+ if (!diagnosticsChannel.tracingChannel) {
13
+ return;
14
+ }
15
+ DEBUG_BUILD && debug.log(`[orchestrion:lru-memoizer] subscribing to channel "${CHANNELS.LRU_MEMOIZER_LOAD}"`);
16
+ waitForTracingChannelBinding(() => {
17
+ bindTracingChannelToSpan(
18
+ diagnosticsChannel.tracingChannel(CHANNELS.LRU_MEMOIZER_LOAD),
19
+ // We only want the helper's caller-context restore for the callback lru-memoizer fires from a detached `setImmediate`.
20
+ () => void 0
21
+ );
22
+ });
23
+ }
24
+ };
25
+ });
26
+ const lruMemoizerChannelIntegration = defineIntegration(_lruMemoizerChannelIntegration);
27
+
28
+ export { lruMemoizerChannelIntegration };
29
+ //# sourceMappingURL=lru-memoizer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lru-memoizer.js","sources":["../../../../src/integrations/tracing-channel/lru-memoizer.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn } from '@sentry/core';\nimport { debug, defineIntegration, waitForTracingChannelBinding } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { CHANNELS } from '../../orchestrion/channels';\nimport { bindTracingChannelToSpan } from '../../tracing-channel';\n\n// Same name as the OTel integration by design — when enabled, the OTel\n// 'LruMemoizer' integration is omitted from the default set.\nconst INTEGRATION_NAME = 'LruMemoizer' as const;\n\ninterface LruMemoizerLoadContext {\n arguments: unknown[];\n}\n\nconst _lruMemoizerChannelIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // `tracingChannel` is unavailable before Node 18.19 so do nothing in that case.\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n DEBUG_BUILD && debug.log(`[orchestrion:lru-memoizer] subscribing to channel \"${CHANNELS.LRU_MEMOIZER_LOAD}\"`);\n\n waitForTracingChannelBinding(() => {\n bindTracingChannelToSpan(\n diagnosticsChannel.tracingChannel<LruMemoizerLoadContext>(CHANNELS.LRU_MEMOIZER_LOAD),\n // We only want the helper's caller-context restore for the callback lru-memoizer fires from a detached `setImmediate`.\n () => undefined,\n );\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * EXPERIMENTAL — orchestrion-driven lru-memoizer integration. Subscribes to\n * `orchestrion:lru-memoizer:load` (injected into `lru-memoizer/lib/async.js`'s\n * `memoizedFunction`). Creates no spans; only re-runs the memoized callback with the\n * caller's scope. Requires the orchestrion runtime hook or bundler plugin.\n */\nexport const lruMemoizerChannelIntegration = defineIntegration(_lruMemoizerChannelIntegration);\n"],"names":[],"mappings":";;;;;;AASA,MAAM,gBAAA,GAAmB,aAAA;AAMzB,MAAM,kCAAkC,MAAM;AAC5C,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AAEV,MAAA,IAAI,CAAC,mBAAmB,cAAA,EAAgB;AACtC,QAAA;AAAA,MACF;AAEA,MAAA,WAAA,IAAe,KAAA,CAAM,GAAA,CAAI,CAAA,mDAAA,EAAsD,QAAA,CAAS,iBAAiB,CAAA,CAAA,CAAG,CAAA;AAE5G,MAAA,4BAAA,CAA6B,MAAM;AACjC,QAAA,wBAAA;AAAA,UACE,kBAAA,CAAmB,cAAA,CAAuC,QAAA,CAAS,iBAAiB,CAAA;AAAA;AAAA,UAEpF,MAAM;AAAA,SACR;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAA,CAAA;AAQO,MAAM,6BAAA,GAAgC,kBAAkB,8BAA8B;;;;"}
@@ -0,0 +1,102 @@
1
+ import * as diagnosticsChannel from 'node:diagnostics_channel';
2
+ import { defineIntegration, waitForTracingChannelBinding } from '@sentry/core';
3
+ import { startMongoSpan, getV4SpanAttributes, getV3SpanAttributes, getV3CommandOperation } from '../../mongodb/mongodb-span.js';
4
+ import { CHANNELS } from '../../orchestrion/channels.js';
5
+ import { bindTracingChannelToSpan } from '../../tracing-channel.js';
6
+
7
+ const INTEGRATION_NAME = "Mongo";
8
+ const ORIGIN = "auto.db.orchestrion.mongo";
9
+ const V3_DEDICATED_COMMANDS = /* @__PURE__ */ new Set(["insert", "update", "delete", "find", "getMore", "killCursors"]);
10
+ const _mongodbChannelIntegration = (() => {
11
+ return {
12
+ name: INTEGRATION_NAME,
13
+ setupOnce() {
14
+ if (!diagnosticsChannel.tracingChannel) {
15
+ return;
16
+ }
17
+ waitForTracingChannelBinding(() => {
18
+ subscribeV4Command();
19
+ subscribeV4Checkout();
20
+ subscribeV3Wireprotocol();
21
+ });
22
+ }
23
+ };
24
+ });
25
+ function subscribeV4Command() {
26
+ bindTracingChannelToSpan(
27
+ diagnosticsChannel.tracingChannel(CHANNELS.MONGODB_COMMAND),
28
+ (data) => {
29
+ const args = data.arguments ?? [];
30
+ const ns = args[0];
31
+ const cmd = args[1];
32
+ if (!ns || !cmd || typeof cmd !== "object" || cmd.ismaster || cmd.hello) {
33
+ return void 0;
34
+ }
35
+ const operation = Object.keys(cmd)[0];
36
+ return startMongoSpan(getV4SpanAttributes(data.self, ns, cmd, operation, ORIGIN));
37
+ },
38
+ // Matches otel's `shouldSkipInstrumentation`: only trace when there is
39
+ // an active parent span, to avoid emitting orphaned mongodb spans.
40
+ { requiresParentSpan: true }
41
+ );
42
+ }
43
+ function subscribeV4Checkout() {
44
+ bindTracingChannelToSpan(diagnosticsChannel.tracingChannel(CHANNELS.MONGODB_CHECKOUT), () => void 0);
45
+ }
46
+ function subscribeV3Wireprotocol() {
47
+ for (const operation of ["insert", "update", "remove"]) {
48
+ const channel = operation === "insert" ? CHANNELS.MONGODB_V3_INSERT : operation === "update" ? CHANNELS.MONGODB_V3_UPDATE : CHANNELS.MONGODB_V3_REMOVE;
49
+ bindV3(channel, (args) => ({
50
+ topology: args[0],
51
+ ns: args[1],
52
+ command: args[2]?.[0],
53
+ operation
54
+ }));
55
+ }
56
+ bindV3(CHANNELS.MONGODB_V3_COMMAND, (args) => {
57
+ const command = args[2];
58
+ const type = command ? Object.keys(command)[0] : void 0;
59
+ if (type && V3_DEDICATED_COMMANDS.has(type)) {
60
+ return void 0;
61
+ }
62
+ return {
63
+ topology: args[0],
64
+ ns: args[1],
65
+ command,
66
+ operation: command ? getV3CommandOperation(command) : void 0
67
+ };
68
+ });
69
+ bindV3(CHANNELS.MONGODB_V3_QUERY, (args) => ({
70
+ topology: args[0],
71
+ ns: args[1],
72
+ command: args[2],
73
+ operation: "find"
74
+ }));
75
+ bindV3(CHANNELS.MONGODB_V3_GET_MORE, (args) => ({
76
+ topology: args[0],
77
+ ns: args[1],
78
+ command: args[2]?.cmd,
79
+ operation: "getMore"
80
+ }));
81
+ }
82
+ function bindV3(channelName, extract) {
83
+ bindTracingChannelToSpan(
84
+ diagnosticsChannel.tracingChannel(channelName),
85
+ (data) => {
86
+ const args = data.arguments;
87
+ if (!args) {
88
+ return void 0;
89
+ }
90
+ const info = extract(args);
91
+ if (!info || typeof info.ns !== "string") {
92
+ return void 0;
93
+ }
94
+ return startMongoSpan(getV3SpanAttributes(info.ns, info.topology, info.command, info.operation, ORIGIN));
95
+ },
96
+ { requiresParentSpan: true }
97
+ );
98
+ }
99
+ const mongodbChannelIntegration = defineIntegration(_mongodbChannelIntegration);
100
+
101
+ export { mongodbChannelIntegration };
102
+ //# sourceMappingURL=mongodb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongodb.js","sources":["../../../../src/integrations/tracing-channel/mongodb.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, waitForTracingChannelBinding } from '@sentry/core';\nimport type { MongodbNamespace, MongoV3Topology } from '../../mongodb/mongodb-span';\nimport {\n getV3CommandOperation,\n getV3SpanAttributes,\n getV4SpanAttributes,\n startMongoSpan,\n} from '../../mongodb/mongodb-span';\nimport { CHANNELS } from '../../orchestrion/channels';\nimport { bindTracingChannelToSpan } from '../../tracing-channel';\n\nconst INTEGRATION_NAME = 'Mongo' as const;\n\nconst ORIGIN = 'auto.db.orchestrion.mongo';\n\n/**\n * what orchestrion's transform attaches to a channel context:\n * `self` is the `this`, plus args.\n */\ninterface MongoChannelContext {\n self?: { address?: string };\n arguments?: unknown[];\n}\n\n// Details extracted from a v3 wireprotocol call's arguments to build its span.\ninterface V3CallInfo {\n topology: MongoV3Topology | undefined;\n ns: string;\n command: Record<string, unknown> | undefined;\n operation: string | undefined;\n}\n\n// Command doc first-keys whose span the `v3_command` channel must suppress.\n// The `insert`/`update`/`remove`/`query`/`getMore` functions call the shared\n// `command` function internally. Orchestrion transforms the `command` *source*\n// (unlike the vendored OTel patch, which wraps the module's exported reference\n// and misses internal calls), so `v3_command` would double-span the ones that\n// already have their own dedicated channel (`v3_insert`/`update`/`remove`/\n// `query`/`get_more`) without this guard.\n//\n// `killCursors` has no dedicated channel, but is suppressed too for OTel\n// parity: OTel wraps `wireprotocol/index.js`'s `command` property, which never\n// intercepts `kill_cursors.js`'s direct `require('./command')` call — so OTel\n// emits no killCursors span, and neither should we.\nconst V3_DEDICATED_COMMANDS = new Set(['insert', 'update', 'delete', 'find', 'getMore', 'killCursors']);\n\nconst _mongodbChannelIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n waitForTracingChannelBinding(() => {\n subscribeV4Command();\n subscribeV4Checkout();\n subscribeV3Wireprotocol();\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * `Connection.prototype.command` (mongodb >=4.0) one span per command.\n * Handles both the >=6.4 promise form and the >=4.0 <6.4 callback form\n * (both publish to this channel).\n */\nfunction subscribeV4Command(): void {\n bindTracingChannelToSpan(\n diagnosticsChannel.tracingChannel<MongoChannelContext>(CHANNELS.MONGODB_COMMAND),\n data => {\n const args = data.arguments ?? [];\n const ns = args[0] as MongodbNamespace | undefined;\n const cmd = args[1] as Record<string, unknown> | undefined;\n // Skip handshake/heartbeat commands (matches otel).\n if (!ns || !cmd || typeof cmd !== 'object' || cmd.ismaster || cmd.hello) {\n return undefined;\n }\n const operation = Object.keys(cmd)[0];\n return startMongoSpan(getV4SpanAttributes(data.self, ns, cmd, operation, ORIGIN));\n },\n // Matches otel's `shouldSkipInstrumentation`: only trace when there is\n // an active parent span, to avoid emitting orphaned mongodb spans.\n { requiresParentSpan: true },\n );\n}\n\n/**\n * `ConnectionPool.prototype.checkOut` (mongodb 4.0 - 6.3, callback form).\n * Creates no span (`getSpan` returns `undefined`) but the binding re-runs\n * the checkout callback under the caller's captured context, so the pooled\n * `command()` invoked inside it re-inherits the active span.\n */\nfunction subscribeV4Checkout(): void {\n bindTracingChannelToSpan(diagnosticsChannel.tracingChannel(CHANNELS.MONGODB_CHECKOUT), () => undefined);\n}\n\n/**\n * mongodb >=3.3 <4 had no unified `command`; each operation is a separate\n * `lib/core/wireprotocol` function with its own argument layout, so each\n * channel extracts topology/namespace/command/op differently before building\n * the span.\n */\nfunction subscribeV3Wireprotocol(): void {\n for (const operation of ['insert', 'update', 'remove'] as const) {\n const channel =\n operation === 'insert'\n ? CHANNELS.MONGODB_V3_INSERT\n : operation === 'update'\n ? CHANNELS.MONGODB_V3_UPDATE\n : CHANNELS.MONGODB_V3_REMOVE;\n bindV3(channel, args => ({\n topology: args[0] as MongoV3Topology | undefined,\n ns: args[1] as string,\n command: (args[2] as Record<string, unknown>[] | undefined)?.[0],\n operation,\n }));\n }\n\n // `command`(server, ns, cmd, options, callback) operation derived from the\n // command doc. Skips commands that have a dedicated channel. See set above.\n bindV3(CHANNELS.MONGODB_V3_COMMAND, args => {\n const command = args[2] as Record<string, unknown> | undefined;\n const type = command ? Object.keys(command)[0] : undefined;\n if (type && V3_DEDICATED_COMMANDS.has(type)) {\n return undefined;\n }\n return {\n topology: args[0] as MongoV3Topology | undefined,\n ns: args[1] as string,\n command,\n operation: command ? getV3CommandOperation(command) : undefined,\n };\n });\n\n // `query`(server, ns, cmd, cursorState, options, callback). a find.\n bindV3(CHANNELS.MONGODB_V3_QUERY, args => ({\n topology: args[0] as MongoV3Topology | undefined,\n ns: args[1] as string,\n command: args[2] as Record<string, unknown> | undefined,\n operation: 'find',\n }));\n\n // `getMore`(server, ns, cursorState, batchSize, options, callback)\n // command doc is `cursorState.cmd`.\n bindV3(CHANNELS.MONGODB_V3_GET_MORE, args => ({\n topology: args[0] as MongoV3Topology | undefined,\n ns: args[1] as string,\n command: (args[2] as { cmd?: Record<string, unknown> } | undefined)?.cmd,\n operation: 'getMore',\n }));\n}\n\nfunction bindV3(channelName: string, extract: (args: unknown[]) => V3CallInfo | undefined): void {\n bindTracingChannelToSpan(\n diagnosticsChannel.tracingChannel<MongoChannelContext>(channelName),\n data => {\n const args = data.arguments;\n if (!args) {\n return undefined;\n }\n const info = extract(args);\n if (!info || typeof info.ns !== 'string') {\n return undefined;\n }\n return startMongoSpan(getV3SpanAttributes(info.ns, info.topology, info.command, info.operation, ORIGIN));\n },\n { requiresParentSpan: true },\n );\n}\n\n/**\n * EXPERIMENTAL: orchestrion-driven mongodb integration.\n *\n * Reproduces the vendored `@opentelemetry/instrumentation-mongodb` span shape\n * (legacy db/net semantic conventions, `mongodb.<op>` names, scrubbed\n * `db.statement`) via the `orchestrion:mongodb:*` diagnostics_channels\n * injected by the orchestrion code transform.\n */\nexport const mongodbChannelIntegration = defineIntegration(_mongodbChannelIntegration);\n"],"names":[],"mappings":";;;;;;AAaA,MAAM,gBAAA,GAAmB,OAAA;AAEzB,MAAM,MAAA,GAAS,2BAAA;AA+Bf,MAAM,qBAAA,mBAAwB,IAAI,GAAA,CAAI,CAAC,QAAA,EAAU,UAAU,QAAA,EAAU,MAAA,EAAQ,SAAA,EAAW,aAAa,CAAC,CAAA;AAEtG,MAAM,8BAA8B,MAAM;AACxC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,IAAI,CAA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AAA,EAAI,KAAK,CAAC,CAAA;AAAA,IACV,OAAA,EAAU,IAAA,CAAK,CAAC,CAAA,EAAqD,GAAA;AAAA,IACrE,SAAA,EAAW;AAAA,GACb,CAAE,CAAA;AACJ;AAEA,SAAS,MAAA,CAAO,aAAqB,OAAA,EAA4D;AAC/F,EAAA,wBAAA;AAAA,IACE,kBAAA,CAAmB,eAAoC,WAAW,CAAA;AAAA,IAClE,CAAA,IAAA,KAAQ;AACN,MAAA,MAAM,OAAO,IAAA,CAAK,SAAA;AAClB,MAAA,IAAI,CAAC,IAAA,EAAM;AACT,QAAA,OAAO,MAAA;AAAA,MACT;AACA,MAAA,MAAM,IAAA,GAAO,QAAQ,IAAI,CAAA;AACzB,MAAA,IAAI,CAAC,IAAA,IAAQ,OAAO,IAAA,CAAK,OAAO,QAAA,EAAU;AACxC,QAAA,OAAO,MAAA;AAAA,MACT;AACA,MAAA,OAAO,cAAA,CAAe,mBAAA,CAAoB,IAAA,CAAK,EAAA,EAAI,IAAA,CAAK,QAAA,EAAU,IAAA,CAAK,OAAA,EAAS,IAAA,CAAK,SAAA,EAAW,MAAM,CAAC,CAAA;AAAA,IACzG,CAAA;AAAA,IACA,EAAE,oBAAoB,IAAA;AAAK,GAC7B;AACF;AAUO,MAAM,yBAAA,GAA4B,kBAAkB,0BAA0B;;;;"}
@@ -0,0 +1,108 @@
1
+ import * as diagnosticsChannel from 'node:diagnostics_channel';
2
+ import { defineIntegration, waitForTracingChannelBinding, debug, getActiveSpan } from '@sentry/core';
3
+ import { subscribeMongooseDiagnosticChannels } from '../../mongoose/mongoose-dc-subscriber.js';
4
+ import { startMongooseLegacySpan } from '../../mongoose/mongoose-legacy-span.js';
5
+ import { CHANNELS } from '../../orchestrion/channels.js';
6
+ import { MONGOOSE_CONTEXT_CAPTURE_CHANNELS } from '../../orchestrion/config/mongoose.js';
7
+ import { DEBUG_BUILD } from '../../debug-build.js';
8
+ import { bindTracingChannelToSpan } from '../../tracing-channel.js';
9
+
10
+ const INTEGRATION_NAME = "Mongoose";
11
+ const ORIGIN = "auto.db.orchestrion.mongoose";
12
+ const STORED_PARENT_SPAN = /* @__PURE__ */ new WeakMap();
13
+ let orchestrionSubscribed = false;
14
+ const _mongooseChannelIntegration = (() => {
15
+ return {
16
+ name: INTEGRATION_NAME,
17
+ setupOnce() {
18
+ if (!diagnosticsChannel.tracingChannel) {
19
+ return;
20
+ }
21
+ waitForTracingChannelBinding(() => {
22
+ subscribeMongooseDiagnosticChannels(diagnosticsChannel.tracingChannel);
23
+ subscribeOrchestrionMongooseChannels();
24
+ });
25
+ }
26
+ };
27
+ });
28
+ function subscribeOrchestrionMongooseChannels() {
29
+ if (orchestrionSubscribed) {
30
+ return;
31
+ }
32
+ orchestrionSubscribed = true;
33
+ DEBUG_BUILD && debug.log("[orchestrion:mongoose] subscribing to injected channels");
34
+ for (const channelName of MONGOOSE_CONTEXT_CAPTURE_CHANNELS) {
35
+ channel(channelName).subscribe({
36
+ start(message) {
37
+ stashParentSpan(message.self);
38
+ }
39
+ });
40
+ }
41
+ channel(CHANNELS.MONGOOSE_MODEL_AGGREGATE).subscribe({
42
+ end(message) {
43
+ const result = message.result;
44
+ if (result && typeof result === "object") {
45
+ stashParentSpan(result);
46
+ }
47
+ }
48
+ });
49
+ bindExecSpan(CHANNELS.MONGOOSE_QUERY_EXEC, (self) => {
50
+ const query = self;
51
+ return startSpan(
52
+ query.mongooseCollection,
53
+ query.model?.modelName,
54
+ query.op ?? "exec",
55
+ STORED_PARENT_SPAN.get(self)
56
+ );
57
+ });
58
+ bindExecSpan(CHANNELS.MONGOOSE_AGGREGATE_EXEC, (self) => {
59
+ const model = self._model;
60
+ return startSpan(model?.collection, model?.modelName, "aggregate", STORED_PARENT_SPAN.get(self));
61
+ });
62
+ bindExecSpan(CHANNELS.MONGOOSE_MODEL_SAVE, (self) => {
63
+ const ctor = self.constructor;
64
+ return startSpan(ctor.collection, ctor.modelName, "save");
65
+ });
66
+ bindExecSpan(CHANNELS.MONGOOSE_MODEL_REMOVE, (self) => {
67
+ const ctor = self.constructor;
68
+ return startSpan(ctor.collection, ctor.modelName, "remove");
69
+ });
70
+ bindExecSpan(CHANNELS.MONGOOSE_MODEL_INSERT_MANY, (self) => {
71
+ const model = self;
72
+ return startSpan(model.collection, model.modelName, "insertMany");
73
+ });
74
+ bindExecSpan(CHANNELS.MONGOOSE_MODEL_BULK_WRITE, (self) => {
75
+ const model = self;
76
+ return startSpan(model.collection, model.modelName, "bulkWrite");
77
+ });
78
+ }
79
+ function startSpan(collection, modelName, operation, parentSpan) {
80
+ return startMongooseLegacySpan({ collection, modelName, operation, origin: ORIGIN, parentSpan });
81
+ }
82
+ function channel(channelName) {
83
+ return diagnosticsChannel.tracingChannel(
84
+ channelName
85
+ );
86
+ }
87
+ function bindExecSpan(channelName, getSpan) {
88
+ bindTracingChannelToSpan(
89
+ diagnosticsChannel.tracingChannel(channelName),
90
+ (data) => {
91
+ const self = data.self;
92
+ if (!self) {
93
+ return void 0;
94
+ }
95
+ return getSpan(self);
96
+ }
97
+ );
98
+ }
99
+ function stashParentSpan(self) {
100
+ const active = getActiveSpan();
101
+ if (self && active) {
102
+ STORED_PARENT_SPAN.set(self, active);
103
+ }
104
+ }
105
+ const mongooseChannelIntegration = defineIntegration(_mongooseChannelIntegration);
106
+
107
+ export { mongooseChannelIntegration };
108
+ //# sourceMappingURL=mongoose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongoose.js","sources":["../../../../src/integrations/tracing-channel/mongoose.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport { debug, defineIntegration, getActiveSpan, waitForTracingChannelBinding } from '@sentry/core';\nimport { subscribeMongooseDiagnosticChannels } from '../../mongoose/mongoose-dc-subscriber';\nimport type { MongooseLegacyCollection } from '../../mongoose/mongoose-legacy-span';\nimport { startMongooseLegacySpan } from '../../mongoose/mongoose-legacy-span';\nimport { CHANNELS } from '../../orchestrion/channels';\nimport { MONGOOSE_CONTEXT_CAPTURE_CHANNELS } from '../../orchestrion/config/mongoose';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport type { SentryTracingChannel } from '../../tracing-channel';\nimport { bindTracingChannelToSpan } from '../../tracing-channel';\n\nconst INTEGRATION_NAME = 'Mongoose' as const;\n\n// Origin distinguishes the orchestrion path from the OTel/IITM path\n// (`auto.db.otel.mongoose`) and the native diagnostics_channel path\n// (`auto.db.mongoose.diagnostic_channel`).\nconst ORIGIN = 'auto.db.orchestrion.mongoose';\n\ninterface MongooseQuery {\n mongooseCollection?: MongooseLegacyCollection;\n model?: { modelName?: string };\n op?: string;\n}\n\ninterface MongooseAggregate {\n _model?: { collection?: MongooseLegacyCollection; modelName?: string };\n}\n\ninterface MongooseModelStatic {\n collection?: MongooseLegacyCollection;\n modelName?: string;\n}\n\ninterface MongooseDocument {\n constructor: { collection?: MongooseLegacyCollection; modelName?: string };\n}\n\n/**\n * The shape orchestrion's transform attaches to the tracing-channel context\n * object. `self` is the `this` of the traced method\n */\ninterface MongooseChannelContext {\n self?: object;\n arguments?: unknown[];\n result?: unknown;\n error?: unknown;\n moduleVersion?: string;\n}\n\n// The active span captured when a query/aggregate was *built*, keyed by the\n// query/aggregate object.\n//\n// Used as the parent for the span created at `exec()` so a query parents to\n// where it was built, not where it happens to be awaited. A WeakMap avoids\n// mutating mongoose's own objects.\nconst STORED_PARENT_SPAN = new WeakMap<object, Span>();\n\nlet orchestrionSubscribed = false;\n\nconst _mongooseChannelIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n waitForTracingChannelBinding(() => {\n // mongoose >= 9.7 publishes via its own diagnostics_channel; reuse\n // the shared native subscriber so this single integration covers all\n // versions after it replaces the OTel one. Idempotent and inert on\n // < 9.7 (those channels just never get published to)\n subscribeMongooseDiagnosticChannels(diagnosticsChannel.tracingChannel);\n\n // mongoose < 9.7 is covered by the orchestrion-injected channels.\n subscribeOrchestrionMongooseChannels();\n });\n },\n };\n}) satisfies IntegrationFn;\n\nfunction subscribeOrchestrionMongooseChannels(): void {\n if (orchestrionSubscribed) {\n return;\n }\n orchestrionSubscribed = true;\n\n DEBUG_BUILD && debug.log('[orchestrion:mongoose] subscribing to injected channels');\n\n // Context-capture builders: stash the active span at build time so `exec()`\n // can parent to it.\n for (const channelName of MONGOOSE_CONTEXT_CAPTURE_CHANNELS) {\n channel(channelName).subscribe({\n start(message) {\n stashParentSpan(message.self);\n },\n });\n }\n\n // `Model.aggregate()` returns the aggregate it builds; stash the parent on\n // the returned object.\n channel(CHANNELS.MONGOOSE_MODEL_AGGREGATE).subscribe({\n end(message) {\n const result = message.result;\n if (result && typeof result === 'object') {\n stashParentSpan(result);\n }\n },\n });\n\n // Query execution.\n bindExecSpan(CHANNELS.MONGOOSE_QUERY_EXEC, self => {\n const query = self as MongooseQuery;\n return startSpan(\n query.mongooseCollection,\n query.model?.modelName,\n query.op ?? 'exec',\n STORED_PARENT_SPAN.get(self),\n );\n });\n\n // Aggregation execution.\n bindExecSpan(CHANNELS.MONGOOSE_AGGREGATE_EXEC, self => {\n const model = (self as MongooseAggregate)._model;\n return startSpan(model?.collection, model?.modelName, 'aggregate', STORED_PARENT_SPAN.get(self));\n });\n\n // `doc.save()` (and the `$save` alias).\n bindExecSpan(CHANNELS.MONGOOSE_MODEL_SAVE, self => {\n const ctor = (self as MongooseDocument).constructor;\n return startSpan(ctor.collection, ctor.modelName, 'save');\n });\n\n // `doc.remove()` (mongoose 5/6).\n bindExecSpan(CHANNELS.MONGOOSE_MODEL_REMOVE, self => {\n const ctor = (self as MongooseDocument).constructor;\n return startSpan(ctor.collection, ctor.modelName, 'remove');\n });\n\n // Static batch operations. `self` is the Model.\n bindExecSpan(CHANNELS.MONGOOSE_MODEL_INSERT_MANY, self => {\n const model = self as MongooseModelStatic;\n return startSpan(model.collection, model.modelName, 'insertMany');\n });\n bindExecSpan(CHANNELS.MONGOOSE_MODEL_BULK_WRITE, self => {\n const model = self as MongooseModelStatic;\n return startSpan(model.collection, model.modelName, 'bulkWrite');\n });\n}\n\nfunction startSpan(\n collection: MongooseLegacyCollection | undefined,\n modelName: string | undefined,\n operation: string,\n parentSpan?: Span,\n): Span {\n return startMongooseLegacySpan({ collection, modelName, operation, origin: ORIGIN, parentSpan });\n}\n\n// `SentryTracingChannel` relaxes Node's subscriber type to a `Partial`, so a\n// `start`-only (or `end`-only) subscriber for the context-capture channels\n// is accepted.\nfunction channel(channelName: string): SentryTracingChannel<MongooseChannelContext> {\n return diagnosticsChannel.tracingChannel<MongooseChannelContext>(\n channelName,\n ) as unknown as SentryTracingChannel<MongooseChannelContext>;\n}\n\nfunction bindExecSpan(channelName: string, getSpan: (self: object) => Span): void {\n bindTracingChannelToSpan<MongooseChannelContext>(\n diagnosticsChannel.tracingChannel<MongooseChannelContext>(channelName),\n data => {\n const self = data.self;\n if (!self) {\n return undefined;\n }\n return getSpan(self);\n },\n );\n}\n\nfunction stashParentSpan(self: object | undefined): void {\n const active = getActiveSpan();\n if (self && active) {\n STORED_PARENT_SPAN.set(self, active);\n }\n}\n\n/**\n * EXPERIMENTAL: orchestrion-driven mongoose integration.\n *\n * Reproduces the vendored `@opentelemetry/instrumentation-mongoose` span\n * shape (legacy db/net semantic conventions, `mongoose.<Model>.<op>` names,\n * build-time span parenting) via the `orchestrion:mongoose:*`\n * diagnostics_channels injected into mongoose `< 9.7` by the orchestrion\n * code transform. For mongoose `>= 9.7` it also drives the native\n * diagnostics_channel subscription, so this single integration covers every\n * supported version once it replaces the OTel one.\n */\nexport const mongooseChannelIntegration = defineIntegration(_mongooseChannelIntegration);\n"],"names":[],"mappings":";;;;;;;;;AAYA,MAAM,gBAAA,GAAmB,UAAA;AAKzB,MAAM,MAAA,GAAS,8BAAA;AAuCf,MAAM,kBAAA,uBAAyB,OAAA,EAAsB;AAErD,IAAI,qBAAA,GAAwB,KAAA;AAE5B,MAAM,+BAA+B,MAAM;AAC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AA,CAAwB,EAAE,UAAA,EAAY,SAAA,EAAW,WAAW,MAAA,EAAQ,MAAA,EAAQ,YAAY,CAAA;AACjG;AAKA,SAAS,QAAQ,WAAA,EAAmE;AAClF,EAAA,OAAO,kBAAA,CAAmB,cAAA;AAAA,IACxB;AAAA,GACF;AACF;AAEA,SAAS,YAAA,CAAa,aAAqB,OAAA,EAAuC;AAChF,EAAA,wBAAA;AAAA,IACE,kBAAA,CAAmB,eAAuC,WAAW,CAAA;AAAA,IACrE,CAAA,IAAA,KAAQ;AACN,MAAA,MAAM,OAAO,IAAA,CAAK,IAAA;AAClB,MAAA,IAAI,CAAC,IAAA,EAAM;AACT,QAAA,OAAO,MAAA;AAAA,MACT;AACA,MAAA,OAAO,QAAQ,IAAI,CAAA;AAAA,IACrB;AAAA,GACF;AACF;AAEA,SAAS,gBAAgB,IAAA,EAAgC;AACvD,EAAA,MAAM,SAAS,aAAA,EAAc;AAC7B,EAAA,IAAI,QAAQ,MAAA,EAAQ;AAClB,IAAA,kBAAA,CAAmB,GAAA,CAAI,MAAM,MAAM,CAAA;AAAA,EACrC;AACF;AAaO,MAAM,0BAAA,GAA6B,kBAAkB,2BAA2B;;;;"}
@@ -0,0 +1,105 @@
1
+ import * as diagnosticsChannel from 'node:diagnostics_channel';
2
+ import { defineIntegration, debug, waitForTracingChannelBinding, bindScopeToEmitter, getCurrentScope, startInactiveSpan, SPAN_KIND, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, isObjectLike } from '@sentry/core';
3
+ import { DEBUG_BUILD } from '../../debug-build.js';
4
+ import { CHANNELS } from '../../orchestrion/channels.js';
5
+ import { bindTracingChannelToSpan } from '../../tracing-channel.js';
6
+
7
+ const INTEGRATION_NAME = "Mysql";
8
+ const ATTR_DB_SYSTEM = "db.system";
9
+ const ATTR_DB_CONNECTION_STRING = "db.connection_string";
10
+ const ATTR_DB_NAME = "db.name";
11
+ const ATTR_DB_USER = "db.user";
12
+ const ATTR_DB_STATEMENT = "db.statement";
13
+ const ATTR_NET_PEER_NAME = "net.peer.name";
14
+ const ATTR_NET_PEER_PORT = "net.peer.port";
15
+ const _mysqlChannelIntegration = (() => {
16
+ return {
17
+ name: INTEGRATION_NAME,
18
+ setupOnce() {
19
+ if (!diagnosticsChannel.tracingChannel) {
20
+ return;
21
+ }
22
+ DEBUG_BUILD && debug.log(`[orchestrion:mysql] subscribing to channel "${CHANNELS.MYSQL_QUERY}"`);
23
+ waitForTracingChannelBinding(() => {
24
+ bindTracingChannelToSpan(
25
+ diagnosticsChannel.tracingChannel(CHANNELS.MYSQL_QUERY),
26
+ (data) => {
27
+ const sql = extractSql(data.arguments[0]);
28
+ const { host, port, database, user } = getConnectionConfig(data.self);
29
+ const portNumber = typeof port === "string" ? parseInt(port, 10) : port;
30
+ const portIsNumber = typeof portNumber === "number" && !isNaN(portNumber);
31
+ data._sentryCallerScope = getCurrentScope();
32
+ return startInactiveSpan({
33
+ name: sql ?? "mysql.query",
34
+ kind: SPAN_KIND.CLIENT,
35
+ op: "db",
36
+ attributes: {
37
+ [ATTR_DB_SYSTEM]: "mysql",
38
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.orchestrion.mysql",
39
+ [ATTR_DB_CONNECTION_STRING]: getJDBCString(host, portIsNumber ? portNumber : void 0, database),
40
+ ...database ? { [ATTR_DB_NAME]: database } : {},
41
+ ...user ? { [ATTR_DB_USER]: user } : {},
42
+ ...sql ? { [ATTR_DB_STATEMENT]: sql } : {},
43
+ ...host ? { [ATTR_NET_PEER_NAME]: host } : {},
44
+ ...portIsNumber ? { [ATTR_NET_PEER_PORT]: portNumber } : {}
45
+ }
46
+ });
47
+ },
48
+ {
49
+ // No-callback `query(sql)` returns a streamable `Query` emitter as `result`; it settles on the
50
+ // emitter's `'end'`/`'error'`, not the channel, so defer ending to those.
51
+ deferSpanEnd({ data, end }) {
52
+ const result = data.result;
53
+ if (!result || typeof result !== "object" || !hasOnMethod(result)) {
54
+ return false;
55
+ }
56
+ const callerScope = data._sentryCallerScope;
57
+ if (callerScope) {
58
+ bindScopeToEmitter(result, callerScope);
59
+ }
60
+ result.on("error", (err) => end(err));
61
+ result.on("end", () => end());
62
+ return true;
63
+ }
64
+ }
65
+ );
66
+ });
67
+ }
68
+ };
69
+ });
70
+ function hasOnMethod(obj) {
71
+ return "on" in obj && typeof obj.on === "function";
72
+ }
73
+ function extractSql(firstArg) {
74
+ if (typeof firstArg === "string") {
75
+ return firstArg;
76
+ }
77
+ if (isObjectLike(firstArg) && "sql" in firstArg) {
78
+ const sql = firstArg.sql;
79
+ return typeof sql === "string" ? sql : void 0;
80
+ }
81
+ return void 0;
82
+ }
83
+ function getConnectionConfig(connection) {
84
+ const config = connection?.config?.connectionConfig ?? connection?.config ?? {};
85
+ return {
86
+ host: config.host,
87
+ port: config.port,
88
+ database: config.database,
89
+ user: config.user
90
+ };
91
+ }
92
+ function getJDBCString(host, port, database) {
93
+ let s = `jdbc:mysql://${host || "localhost"}`;
94
+ if (typeof port === "number") {
95
+ s += `:${port}`;
96
+ }
97
+ if (database) {
98
+ s += `/${database}`;
99
+ }
100
+ return s;
101
+ }
102
+ const mysqlChannelIntegration = defineIntegration(_mysqlChannelIntegration);
103
+
104
+ export { mysqlChannelIntegration };
105
+ //# sourceMappingURL=mysql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mysql.js","sources":["../../../../src/integrations/tracing-channel/mysql.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { IntegrationFn, Scope } from '@sentry/core';\nimport {\n isObjectLike,\n bindScopeToEmitter,\n debug,\n defineIntegration,\n getCurrentScope,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n startInactiveSpan,\n waitForTracingChannelBinding,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { CHANNELS } from '../../orchestrion/channels';\nimport { bindTracingChannelToSpan } from '../../tracing-channel';\n\n// NOTE: this uses the same name as the OTel integration by design.\n// When enabled, OTel 'Mysql' integration is omitted from the default set.\nconst INTEGRATION_NAME = 'Mysql' as const;\n\n// OTel \"OLD\" db/net semantic-conventions, inlined to keep this integration free of OTel deps. Matches\n// `@opentelemetry/instrumentation-mysql`'s default and the SDK's `inferDbSpanData` (which renames spans\n// off `db.statement`).\nconst ATTR_DB_SYSTEM = 'db.system';\nconst ATTR_DB_CONNECTION_STRING = 'db.connection_string';\nconst ATTR_DB_NAME = 'db.name';\nconst ATTR_DB_USER = 'db.user';\nconst ATTR_DB_STATEMENT = 'db.statement';\nconst ATTR_NET_PEER_NAME = 'net.peer.name';\nconst ATTR_NET_PEER_PORT = 'net.peer.port';\n\n/**\n * The shape orchestrion's transform attaches to the tracing-channel `context` object. Documented here\n * rather than imported because orchestrion's runtime doesn't export it.\n */\ninterface MysqlQueryChannelContext {\n // The live args array passed to the wrapped `connection.query` call; `arguments[0]` is the SQL.\n arguments: unknown[];\n self?: MysqlConnection;\n moduleVersion?: string;\n result?: unknown;\n error?: unknown;\n // The caller's scope, captured at `start` and replayed onto the streamed `Query` emitter (see below).\n _sentryCallerScope?: Scope;\n}\n\ninterface MysqlConnectionConfig {\n host?: string;\n port?: number | string;\n database?: string;\n user?: string;\n // Pool connections nest the real config one level deeper.\n connectionConfig?: MysqlConnectionConfig;\n}\n\ninterface MysqlConnection {\n config?: MysqlConnectionConfig;\n}\n\nconst _mysqlChannelIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // `tracingChannel` is unavailable before Node 18.19 so do nothing in that case.\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n DEBUG_BUILD && debug.log(`[orchestrion:mysql] subscribing to channel \"${CHANNELS.MYSQL_QUERY}\"`);\n\n waitForTracingChannelBinding(() => {\n bindTracingChannelToSpan(\n diagnosticsChannel.tracingChannel<MysqlQueryChannelContext>(CHANNELS.MYSQL_QUERY),\n data => {\n const sql = extractSql(data.arguments[0]);\n const { host, port, database, user } = getConnectionConfig(data.self);\n const portNumber = typeof port === 'string' ? parseInt(port, 10) : port;\n const portIsNumber = typeof portNumber === 'number' && !isNaN(portNumber);\n\n // For the streamed path: mysql emits the `Query` emitter's events from its socket data\n // handler with the caller's context lost. `deferSpanEnd` replays this scope onto the emitter.\n data._sentryCallerScope = getCurrentScope();\n\n return startInactiveSpan({\n name: sql ?? 'mysql.query',\n kind: SPAN_KIND.CLIENT,\n op: 'db',\n attributes: {\n [ATTR_DB_SYSTEM]: 'mysql',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.orchestrion.mysql',\n [ATTR_DB_CONNECTION_STRING]: getJDBCString(host, portIsNumber ? portNumber : undefined, database),\n ...(database ? { [ATTR_DB_NAME]: database } : {}),\n ...(user ? { [ATTR_DB_USER]: user } : {}),\n ...(sql ? { [ATTR_DB_STATEMENT]: sql } : {}),\n ...(host ? { [ATTR_NET_PEER_NAME]: host } : {}),\n ...(portIsNumber ? { [ATTR_NET_PEER_PORT]: portNumber } : {}),\n },\n });\n },\n {\n // No-callback `query(sql)` returns a streamable `Query` emitter as `result`; it settles on the\n // emitter's `'end'`/`'error'`, not the channel, so defer ending to those.\n deferSpanEnd({ data, end }) {\n const result = data.result;\n if (!result || typeof result !== 'object' || !hasOnMethod(result)) {\n return false;\n }\n\n // Replay the caller's scope so user listeners on the emitter nest under it, not a new trace.\n const callerScope = data._sentryCallerScope;\n if (callerScope) {\n bindScopeToEmitter(result, callerScope);\n }\n\n result.on('error', err => end(err));\n result.on('end', () => end());\n\n return true;\n },\n },\n );\n });\n },\n };\n}) satisfies IntegrationFn;\n\nfunction hasOnMethod(obj: object): obj is { on: (event: string, listener: (arg?: unknown) => void) => unknown } {\n return 'on' in obj && typeof (obj as { on?: unknown }).on === 'function';\n}\n\nfunction extractSql(firstArg: unknown): string | undefined {\n if (typeof firstArg === 'string') {\n return firstArg;\n }\n if (isObjectLike(firstArg) && 'sql' in firstArg) {\n const sql = (firstArg as { sql?: unknown }).sql;\n return typeof sql === 'string' ? sql : undefined;\n }\n return undefined;\n}\n\nfunction getConnectionConfig(connection: MysqlConnection | undefined): {\n host?: string;\n port?: number | string;\n database?: string;\n user?: string;\n} {\n // Pool connections nest the real config under `.connectionConfig`; single\n // connections expose it directly. Matches `@opentelemetry/instrumentation-mysql`.\n const config = connection?.config?.connectionConfig ?? connection?.config ?? {};\n return {\n host: config.host,\n port: config.port,\n database: config.database,\n user: config.user,\n };\n}\n\nfunction getJDBCString(host: string | undefined, port: number | undefined, database: string | undefined): string {\n let s = `jdbc:mysql://${host || 'localhost'}`;\n if (typeof port === 'number') {\n s += `:${port}`;\n }\n if (database) {\n s += `/${database}`;\n }\n return s;\n}\n\n/**\n * EXPERIMENTAL — orchestrion-driven mysql integration.\n *\n * Subscribes to the `orchestrion:mysql:query` diagnostics_channel that the\n * orchestrion code transform injects into `mysql/lib/Connection.js`'s\n * `Connection.prototype.query`. Requires the orchestrion runtime hook or\n * bundler plugin to be active — wire that up via `_experimentalSetupOrchestrion`.\n */\nexport const mysqlChannelIntegration = defineIntegration(_mysqlChannelIntegration);\n"],"names":[],"mappings":";;;;;;AAmBA,MAAM,gBAAA,GAAmB,OAAA;AAKzB,MAAM,cAAA,GAAiB,WAAA;AACvB,MAAM,yBAAA,GAA4B,sBAAA;AAClC,MAAM,YAAA,GAAe,SAAA;AACrB,MAAM,YAAA,GAAe,SAAA;AACrB,MAAM,iBAAA,GAAoB,cAAA;AAC1B,MAAM,kBAAA,GAAqB,eAAA;AAC3B,MAAM,kBAAA,GAAqB,eAAA;AA8B3B,MAAM,4BAA4B,MAAM;AACtC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AAEV,MAAA,IAAI,CAAC,mBAAmB,cAAA,EAAgB;AACtC,QAAA;AAAA,MACF;AAEA,MAAA,WAAA,IAAe,KAAA,CAAM,GAAA,CAAI,CAAA,4CAAA,EAA+C,QAAA,CAAS,WAAW,CAAA,CAAA,CAAG,CAAA;AA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gBAAA,IAAoB,UAAA,EAAY,UAAU,EAAC;AAC9E,EAAA,OAAO;AAAA,IACL,MAAM,MAAA,CAAO,IAAA;AAAA,IACb,MAAM,MAAA,CAAO,IAAA;AAAA,IACb,UAAU,MAAA,CAAO,QAAA;AAAA,IACjB,MAAM,MAAA,CAAO;AAAA,GACf;AACF;AAEA,SAAS,aAAA,CAAc,IAAA,EAA0B,IAAA,EAA0B,QAAA,EAAsC;AAC/G,EAAA,IAAI,CAAA,GAAI,CAAA,aAAA,EAAgB,IAAA,IAAQ,WAAW,CAAA,CAAA;AAC3C,EAAA,IAAI,OAAO,SAAS,QAAA,EAAU;AAC5B,IAAA,CAAA,IAAK,IAAI,IAAI,CAAA,CAAA;AAAA,EACf;AACA,EAAA,IAAI,QAAA,EAAU;AACZ,IAAA,CAAA,IAAK,IAAI,QAAQ,CAAA,CAAA;AAAA,EACnB;AACA,EAAA,OAAO,CAAA;AACT;AAUO,MAAM,uBAAA,GAA0B,kBAAkB,wBAAwB;;;;"}
@@ -0,0 +1,81 @@
1
+ import * as diagnosticsChannel from 'node:diagnostics_channel';
2
+ import { defineIntegration, waitForTracingChannelBinding, startInactiveSpan, SPAN_KIND, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, isObjectLike } from '@sentry/core';
3
+ import { subscribeMysql2DiagnosticChannels } from '../../mysql2/mysql2-dc-subscriber.js';
4
+ import { CHANNELS } from '../../orchestrion/channels.js';
5
+ import { bindTracingChannelToSpan } from '../../tracing-channel.js';
6
+ import { DB_STATEMENT, DB_SYSTEM, NET_PEER_PORT, NET_PEER_NAME, DB_USER, DB_NAME } from '@sentry/conventions/attributes';
7
+
8
+ const INTEGRATION_NAME = "Mysql2";
9
+ const ORIGIN = "auto.db.orchestrion.mysql2";
10
+ const DB_SYSTEM_VALUE_MYSQL = "mysql";
11
+ function instrumentMysql2() {
12
+ subscribeMysql2DiagnosticChannels(diagnosticsChannel.tracingChannel);
13
+ subscribeQueryChannel(CHANNELS.MYSQL2_QUERY);
14
+ subscribeQueryChannel(CHANNELS.MYSQL2_EXECUTE);
15
+ }
16
+ function subscribeQueryChannel(channelName) {
17
+ bindTracingChannelToSpan(
18
+ diagnosticsChannel.tracingChannel(channelName),
19
+ (data) => {
20
+ const statement = getQueryText(data.arguments);
21
+ return startInactiveSpan({
22
+ name: statement ?? "mysql2.query",
23
+ kind: SPAN_KIND.CLIENT,
24
+ attributes: {
25
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
26
+ [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db",
27
+ // oxlint-disable-next-line typescript/no-deprecated
28
+ [DB_SYSTEM]: DB_SYSTEM_VALUE_MYSQL,
29
+ ...getConnectionAttributes(data.self?.config),
30
+ // oxlint-disable-next-line typescript/no-deprecated
31
+ [DB_STATEMENT]: statement || void 0
32
+ }
33
+ });
34
+ },
35
+ { requiresParentSpan: true }
36
+ );
37
+ }
38
+ function getQueryText(args) {
39
+ return extractSql(args[0]);
40
+ }
41
+ function extractSql(firstArg) {
42
+ if (typeof firstArg === "string") {
43
+ return firstArg;
44
+ }
45
+ if (isObjectLike(firstArg) && "sql" in firstArg) {
46
+ const sql = firstArg.sql;
47
+ return typeof sql === "string" ? sql : void 0;
48
+ }
49
+ return void 0;
50
+ }
51
+ function getConnectionAttributes(config) {
52
+ const { host, port, database, user } = config?.connectionConfig ?? config ?? {};
53
+ const portNumber = typeof port === "string" ? parseInt(port, 10) : port;
54
+ const portIsNumber = typeof portNumber === "number" && !isNaN(portNumber);
55
+ return {
56
+ // oxlint-disable-next-line typescript/no-deprecated
57
+ [DB_NAME]: database || void 0,
58
+ [DB_USER]: user || void 0,
59
+ // oxlint-disable-next-line typescript/no-deprecated
60
+ [NET_PEER_NAME]: host || void 0,
61
+ // oxlint-disable-next-line typescript/no-deprecated
62
+ [NET_PEER_PORT]: portIsNumber ? portNumber : void 0
63
+ };
64
+ }
65
+ const _mysql2ChannelIntegration = (() => {
66
+ return {
67
+ name: INTEGRATION_NAME,
68
+ setupOnce() {
69
+ if (!diagnosticsChannel.tracingChannel) {
70
+ return;
71
+ }
72
+ waitForTracingChannelBinding(() => {
73
+ instrumentMysql2();
74
+ });
75
+ }
76
+ };
77
+ });
78
+ const mysql2ChannelIntegration = defineIntegration(_mysql2ChannelIntegration);
79
+
80
+ export { mysql2ChannelIntegration };
81
+ //# sourceMappingURL=mysql2.js.map