@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,99 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const diagnosticsChannel = require('node:diagnostics_channel');
4
+ const attributes = require('@sentry/conventions/attributes');
5
+ const core = require('@sentry/core');
6
+ const debugBuild = require('../../debug-build.js');
7
+ const channels = require('../../orchestrion/channels.js');
8
+ const redisStatementSerializer = require('../../redis/redis-statement-serializer.js');
9
+ const tracingChannel = require('../../tracing-channel.js');
10
+
11
+ const INTEGRATION_NAME = "IORedis";
12
+ const ORIGIN = "auto.db.orchestrion.redis";
13
+ const ATTR_DB_CONNECTION_STRING = "db.connection_string";
14
+ function getConnectionOptions(self) {
15
+ return { host: self?.options?.host, port: self?.options?.port };
16
+ }
17
+ function connectionAttributes(host, port) {
18
+ return {
19
+ [attributes.DB_SYSTEM]: "redis",
20
+ [ATTR_DB_CONNECTION_STRING]: `redis://${host}:${port}`,
21
+ [attributes.NET_PEER_NAME]: host,
22
+ [attributes.NET_PEER_PORT]: port,
23
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
24
+ };
25
+ }
26
+ const tracedCommands = /* @__PURE__ */ new WeakSet();
27
+ function startIORedisCommandSpan(data) {
28
+ const command = data.arguments?.[0];
29
+ if (!command || typeof command !== "object") {
30
+ return void 0;
31
+ }
32
+ if (tracedCommands.has(command)) {
33
+ return void 0;
34
+ }
35
+ tracedCommands.add(command);
36
+ const { host, port } = getConnectionOptions(data.self);
37
+ const statement = redisStatementSerializer.defaultDbStatementSerializer(command.name, command.args ?? []);
38
+ return core.startInactiveSpan({
39
+ name: statement,
40
+ op: "db",
41
+ attributes: { ...connectionAttributes(host, port), [attributes.DB_STATEMENT]: statement }
42
+ });
43
+ }
44
+ const _ioredisChannelIntegration = ((options = {}) => {
45
+ const responseHook = options.responseHook;
46
+ return {
47
+ name: INTEGRATION_NAME,
48
+ setupOnce() {
49
+ if (!diagnosticsChannel.tracingChannel) {
50
+ return;
51
+ }
52
+ debugBuild.DEBUG_BUILD && core.debug.log(`[orchestrion:ioredis] subscribing to "${channels.CHANNELS.IOREDIS_COMMAND}"/"${channels.CHANNELS.IOREDIS_CONNECT}"`);
53
+ const commandChannel = diagnosticsChannel.tracingChannel(
54
+ channels.CHANNELS.IOREDIS_COMMAND
55
+ );
56
+ const connectChannel = diagnosticsChannel.tracingChannel(
57
+ channels.CHANNELS.IOREDIS_CONNECT
58
+ );
59
+ core.waitForTracingChannelBinding(() => {
60
+ tracingChannel.bindTracingChannelToSpan(commandChannel, startIORedisCommandSpan, {
61
+ // ioredis' `requireParentSpan` default: only create a span under an active span.
62
+ requiresParentSpan: true,
63
+ beforeSpanEnd(span, data) {
64
+ if ("error" in data || !responseHook) {
65
+ return;
66
+ }
67
+ const command = data.arguments?.[0];
68
+ if (command) {
69
+ runResponseHook(responseHook, span, command, data.result);
70
+ }
71
+ }
72
+ });
73
+ tracingChannel.bindTracingChannelToSpan(
74
+ connectChannel,
75
+ (data) => {
76
+ const { host, port } = getConnectionOptions(data.self);
77
+ return core.startInactiveSpan({
78
+ name: "connect",
79
+ op: "db",
80
+ attributes: { ...connectionAttributes(host, port), [attributes.DB_STATEMENT]: "connect" }
81
+ });
82
+ },
83
+ { requiresParentSpan: true }
84
+ );
85
+ });
86
+ }
87
+ };
88
+ });
89
+ function runResponseHook(hook, span, command, result) {
90
+ try {
91
+ hook(span, command.name, command.args, result);
92
+ } catch {
93
+ }
94
+ }
95
+ const ioredisChannelIntegration = core.defineIntegration(_ioredisChannelIntegration);
96
+
97
+ exports.ioredisChannelIntegration = ioredisChannelIntegration;
98
+ exports.startIORedisCommandSpan = startIORedisCommandSpan;
99
+ //# sourceMappingURL=ioredis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ioredis.js","sources":["../../../../src/integrations/tracing-channel/ioredis.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-deprecated -- we intentionally emit the OLD db/net semconv\n to match `@opentelemetry/instrumentation-ioredis` (and Sentry's `inferDbSpanData`, which keys off\n `db.statement`). TODO(v11): switch to the non-deprecated `db.system.name`/`db.query.text`/\n `server.address`/`server.port` conventions and drop this disable. */\nimport * as diagnosticsChannel from 'node:diagnostics_channel';\nimport { DB_STATEMENT, DB_SYSTEM, NET_PEER_NAME, NET_PEER_PORT } from '@sentry/conventions/attributes';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport {\n debug,\n defineIntegration,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n startInactiveSpan,\n waitForTracingChannelBinding,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport { CHANNELS } from '../../orchestrion/channels';\nimport { defaultDbStatementSerializer } from '../../redis/redis-statement-serializer';\nimport { bindTracingChannelToSpan } from '../../tracing-channel';\n\n// Distinct from the OTel `Redis` integration, which is composite (node-redis +\n// ioredis + the >=5.11.0 diagnostics_channel subscriber) and stays in the set;\n// only its ioredis monkey-patch is gated off in the node SDK when this is active.\nconst INTEGRATION_NAME = 'IORedis' as const;\n\nconst ORIGIN = 'auto.db.orchestrion.redis';\n\n// todo(v11): Let's drop this as this is already covered with host and port\nconst ATTR_DB_CONNECTION_STRING = 'db.connection_string';\n\n/** Mirrors `@opentelemetry/instrumentation-ioredis`' response hook. Not called for failed commands. */\nexport type IORedisResponseHook = (span: Span, command: string, args: Array<string | Buffer>, result: unknown) => void;\n\nexport interface IORedisChannelIntegrationOptions {\n responseHook?: IORedisResponseHook;\n}\n\n/** Structural type for the command object ioredis passes to `sendCommand`. */\ninterface RedisCommand {\n name: string;\n args: Array<string | Buffer>;\n}\n\ninterface RedisClientLike {\n options?: { host?: string; port?: number };\n}\n\ninterface IORedisCommandContext {\n arguments?: unknown[];\n self?: RedisClientLike;\n result?: unknown;\n error?: unknown;\n}\n\ntype IORedisConnectContext = Omit<IORedisCommandContext, 'arguments'>;\n\nfunction getConnectionOptions(self: RedisClientLike | undefined): { host?: string; port?: number } {\n return { host: self?.options?.host, port: self?.options?.port };\n}\n\nfunction connectionAttributes(host: string | undefined, port: number | undefined): Record<string, unknown> {\n return {\n [DB_SYSTEM]: 'redis',\n [ATTR_DB_CONNECTION_STRING]: `redis://${host}:${port}`,\n [NET_PEER_NAME]: host,\n [NET_PEER_PORT]: port,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n };\n}\n\n// ioredis re-enters `sendCommand` with the same command object when it drains\n// the offline queue on connect which leads to duplicate spans.\n// Track commands we've already traced so each logical command produces one span.\nconst tracedCommands = new WeakSet<object>();\n\n/**\n * Builds the db span for an `orchestrion:ioredis:command` payload, or returns `undefined` to skip\n * it: for a non-command payload, or the offline-queue re-send of an already-traced command.\n *\n * Exported for unit testing.\n */\nexport function startIORedisCommandSpan(data: IORedisCommandContext): Span | undefined {\n const command = data.arguments?.[0] as RedisCommand | undefined;\n if (!command || typeof command !== 'object') {\n return undefined;\n }\n // guard against duplicate spans\n if (tracedCommands.has(command)) {\n return undefined;\n }\n tracedCommands.add(command);\n const { host, port } = getConnectionOptions(data.self);\n const statement = defaultDbStatementSerializer(command.name, command.args ?? []);\n return startInactiveSpan({\n name: statement,\n op: 'db',\n attributes: { ...connectionAttributes(host, port), [DB_STATEMENT]: statement },\n });\n}\n\nconst _ioredisChannelIntegration = ((options: IORedisChannelIntegrationOptions = {}) => {\n const responseHook = options.responseHook;\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // `tracingChannel` is unavailable before Node 18.19.\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n DEBUG_BUILD &&\n debug.log(`[orchestrion:ioredis] subscribing to \"${CHANNELS.IOREDIS_COMMAND}\"/\"${CHANNELS.IOREDIS_CONNECT}\"`);\n\n const commandChannel = diagnosticsChannel.tracingChannel<IORedisCommandContext, IORedisCommandContext>(\n CHANNELS.IOREDIS_COMMAND,\n );\n const connectChannel = diagnosticsChannel.tracingChannel<IORedisConnectContext, IORedisConnectContext>(\n CHANNELS.IOREDIS_CONNECT,\n );\n\n // `bindTracingChannelToSpan` uses `bindStore`, which needs the async-context\n // binding that `initOpenTelemetry()` registers after integration `setupOnce` —\n // defer until it's available (matches the native redis diagnostics-channel subscriber).\n waitForTracingChannelBinding(() => {\n bindTracingChannelToSpan(commandChannel, startIORedisCommandSpan, {\n // ioredis' `requireParentSpan` default: only create a span under an active span.\n requiresParentSpan: true,\n beforeSpanEnd(span, data) {\n if ('error' in data || !responseHook) {\n return;\n }\n const command = data.arguments?.[0] as RedisCommand | undefined;\n if (command) {\n runResponseHook(responseHook, span, command, data.result);\n }\n },\n });\n\n bindTracingChannelToSpan(\n connectChannel,\n data => {\n const { host, port } = getConnectionOptions(data.self);\n return startInactiveSpan({\n name: 'connect',\n op: 'db',\n attributes: { ...connectionAttributes(host, port), [DB_STATEMENT]: 'connect' },\n });\n },\n { requiresParentSpan: true },\n );\n });\n },\n };\n}) satisfies IntegrationFn;\n\nfunction runResponseHook(hook: IORedisResponseHook, span: Span, command: RedisCommand, result: unknown): void {\n try {\n hook(span, command.name, command.args, result);\n } catch {\n // never let a user-provided response hook break instrumentation\n }\n}\n\n/**\n * EXPERIMENTAL — orchestrion-driven ioredis integration. Subscribes to\n * `orchestrion:ioredis:command` / `:connect` (injected into ioredis' `<5.11.0`\n * `sendCommand`/`connect`) and creates db spans matching\n * `@opentelemetry/instrumentation-ioredis`. Requires the orchestrion runtime hook\n * or bundler plugin.\n */\nexport const ioredisChannelIntegration = defineIntegration(_ioredisChannelIntegration);\n"],"names":["DB_SYSTEM","NET_PEER_NAME","NET_PEER_PORT","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","defaultDbStatementSerializer","startInactiveSpan","DB_STATEMENT","DEBUG_BUILD","debug","CHANNELS","wait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,UACA,CAAA,IAAA,KAAQ;AACN,YAAA,MAAM,EAAE,IAAA,EAAM,IAAA,EAAK,GAAI,oBAAA,CAAqB,KAAK,IAAI,CAAA;AACrD,YAAA,OAAON,sBAAA,CAAkB;AAAA,cACvB,IAAA,EAAM,SAAA;AAAA,cACN,EAAA,EAAI,IAAA;AAAA,cACJ,UAAA,EAAY,EAAE,GAAG,oBAAA,CAAqB,IAAA,EAAM,IAAI,CAAA,EAAG,CAACC,uBAAY,GAAG,SAAA;AAAU,aAC9E,CAAA;AAAA,UACH,CAAA;AAAA,UACA,EAAE,oBAAoB,IAAA;AAAK,SAC7B;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAA,CAAA;AAEA,SAAS,eAAA,CAAgB,IAAA,EAA2B,IAAA,EAAY,OAAA,EAAuB,MAAA,EAAuB;AAC5G,EAAA,IAAI;AACF,IAAA,IAAA,CAAK,IAAA,EAAM,OAAA,CAAQ,IAAA,EAAM,OAAA,CAAQ,MAAM,MAAM,CAAA;AAAA,EAC/C,CAAA,CAAA,MAAQ;AAAA,EAER;AACF;AASO,MAAM,yBAAA,GAA4BM,uBAAkB,0BAA0B;;;;;"}
@@ -0,0 +1,71 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const attributes = require('@sentry/conventions/attributes');
4
+ const core = require('@sentry/core');
5
+ const semconv = require('./semconv.js');
6
+ const spans = require('./spans.js');
7
+
8
+ const consumerCallbackWrapped = /* @__PURE__ */ Symbol("sentry-kafkajs-consumer-callback-wrapped");
9
+ function isWrappedConsumerCallback(fn) {
10
+ return typeof fn === "function" && fn[consumerCallbackWrapped] === true;
11
+ }
12
+ function wrapEachMessage(original) {
13
+ const wrapped = function eachMessage(payload) {
14
+ const sentryTrace = spans.getHeaderAsString(payload.message.headers, "sentry-trace");
15
+ const baggage = spans.getHeaderAsString(payload.message.headers, "baggage");
16
+ return core.continueTrace({ sentryTrace, baggage }, () => {
17
+ const span = spans.startConsumerSpan({
18
+ topic: payload.topic,
19
+ message: payload.message,
20
+ operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,
21
+ attributes: {
22
+ [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition)
23
+ }
24
+ });
25
+ const promise = core.withActiveSpan(span, () => original.call(this, payload));
26
+ return spans.endSpansOnPromise([span], promise);
27
+ });
28
+ };
29
+ wrapped[consumerCallbackWrapped] = true;
30
+ return wrapped;
31
+ }
32
+ function wrapEachBatch(original) {
33
+ const wrapped = function eachBatch(payload) {
34
+ const receivingSpan = core.startNewTrace(
35
+ () => spans.startConsumerSpan({
36
+ topic: payload.batch.topic,
37
+ message: void 0,
38
+ operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,
39
+ attributes: {
40
+ [attributes.MESSAGING_BATCH_MESSAGE_COUNT]: payload.batch.messages.length,
41
+ [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition)
42
+ }
43
+ })
44
+ );
45
+ return core.withActiveSpan(receivingSpan, () => {
46
+ const spans$1 = [receivingSpan];
47
+ payload.batch.messages.forEach((message) => {
48
+ spans$1.push(
49
+ spans.startConsumerSpan({
50
+ topic: payload.batch.topic,
51
+ message,
52
+ operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,
53
+ links: spans.getLinksFromHeaders(message.headers),
54
+ attributes: {
55
+ [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition)
56
+ }
57
+ })
58
+ );
59
+ });
60
+ const promise = original.call(this, payload);
61
+ return spans.endSpansOnPromise(spans$1, promise);
62
+ });
63
+ };
64
+ wrapped[consumerCallbackWrapped] = true;
65
+ return wrapped;
66
+ }
67
+
68
+ exports.isWrappedConsumerCallback = isWrappedConsumerCallback;
69
+ exports.wrapEachBatch = wrapEachBatch;
70
+ exports.wrapEachMessage = wrapEachMessage;
71
+ //# sourceMappingURL=consumer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consumer.js","sources":["../../../../../src/integrations/tracing-channel/kafkajs/consumer.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-kafkajs\n * - Upstream version: @opentelemetry/instrumentation-kafkajs@0.27.0\n * - Span-creating wrappers for the consumer callbacks (`_getConsumerEachMessagePatch`/\n * `_getConsumerEachBatchPatch`), migrated to the `@sentry/core` span API. The `run` channel's `start`\n * subscriber swaps the user's `eachMessage`/`eachBatch` for these before the original runs.\n */\n\nimport { MESSAGING_BATCH_MESSAGE_COUNT } from '@sentry/conventions/attributes';\nimport type { Span } from '@sentry/core';\nimport { continueTrace, startNewTrace, withActiveSpan } from '@sentry/core';\nimport {\n ATTR_MESSAGING_DESTINATION_PARTITION_ID,\n MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,\n} from './semconv';\nimport { endSpansOnPromise, getHeaderAsString, getLinksFromHeaders, startConsumerSpan } from './spans';\nimport type { EachBatchHandler, EachMessageHandler, KafkaMessage } from './types';\n\n// Marks a callback we've already wrapped. A user can reuse one config object across multiple\n// `consumer.run(config)` calls (e.g. a second consumer); without this guard the second `start` would\n// wrap the wrapper and emit duplicate spans per message.\nconst consumerCallbackWrapped: unique symbol = Symbol('sentry-kafkajs-consumer-callback-wrapped');\n\ntype MaybeWrapped = { [consumerCallbackWrapped]?: true };\n\n/** Whether `fn` is a callback this module already wrapped, so callers skip re-wrapping it. */\nexport function isWrappedConsumerCallback(fn: unknown): boolean {\n return typeof fn === 'function' && (fn as MaybeWrapped)[consumerCallbackWrapped] === true;\n}\n\n/** Wraps `eachMessage` so each processed message becomes a consumer span parented to the message's producer. */\nexport function wrapEachMessage(original: EachMessageHandler): EachMessageHandler {\n const wrapped: EachMessageHandler & MaybeWrapped = function eachMessage(this: unknown, payload) {\n const sentryTrace = getHeaderAsString(payload.message.headers, 'sentry-trace');\n const baggage = getHeaderAsString(payload.message.headers, 'baggage');\n\n // Continue the producer's trace so the consumer span is parented to the message's producer.\n return continueTrace({ sentryTrace, baggage }, () => {\n const span = startConsumerSpan({\n topic: payload.topic,\n message: payload.message,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n attributes: {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition),\n },\n });\n\n const promise = withActiveSpan(span, () => original.call(this, payload));\n return endSpansOnPromise([span], promise);\n });\n };\n wrapped[consumerCallbackWrapped] = true;\n return wrapped;\n}\n\n/** Wraps `eachBatch` so the batch pull becomes a fresh-root receiving span with a process span per message. */\nexport function wrapEachBatch(original: EachBatchHandler): EachBatchHandler {\n const wrapped: EachBatchHandler & MaybeWrapped = function eachBatch(this: unknown, payload) {\n // A batch pull aggregates messages from many producers, so the receiving span is a fresh root\n // trace and each processed message links back to its own producer span. Mirrors the OTel messaging\n // semantic conventions for a topic with multiple consumers.\n const receivingSpan = startNewTrace(() =>\n startConsumerSpan({\n topic: payload.batch.topic,\n message: undefined,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,\n attributes: {\n [MESSAGING_BATCH_MESSAGE_COUNT]: payload.batch.messages.length,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition),\n },\n }),\n );\n\n return withActiveSpan(receivingSpan, () => {\n const spans: Span[] = [receivingSpan];\n payload.batch.messages.forEach((message: KafkaMessage) => {\n spans.push(\n startConsumerSpan({\n topic: payload.batch.topic,\n message,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n links: getLinksFromHeaders(message.headers),\n attributes: {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition),\n },\n }),\n );\n });\n const promise = original.call(this, payload);\n return endSpansOnPromise(spans, promise);\n });\n };\n wrapped[consumerCallbackWrapped] = true;\n return wrapped;\n}\n"],"names":["getHeaderAsString","continueTrace","startConsumerSpan","MESSAGING_OPERATION_TYPE_VALUE_PROCESS","ATTR_MESSAGING_DESTINATION_PARTITION_ID","withActiveSpan","endSpansOnPromise","startNewTrace","MESSAGING_OPERATION_TYPE_VALUE_RECEIVE","MESSAGING_BATCH_MESSAGE_COUNT","spans","getLinksFromHeaders"],"mappings":";;;;;;;AA0BA,MAAM,uBAAA,0BAAgD,0CAA0C,CAAA;AAKzF,SAAS,0BAA0B,EAAA,EAAsB;AAC9D,EAAA,OAAO,OAAO,EAAA,KAAO,UAAA,IAAe,EAAA,CAAoB,uBAAuB,CAAA,KAAM,IAAA;AACvF;AAGO,SAAS,gBAAgB,QAAA,EAAkD;AAChF,EAAA,MAAM,OAAA,GAA6C,SAAS,WAAA,CAA2B,OAAA,EAAS;AAC9F,IAAA,MAAM,WAAA,GAAcA,uBAAA,CAAkB,OAAA,CAAQ,OAAA,CAAQ,SAAS,cAAc,CAAA;AAC7E,IAAA,MAAM,OAAA,GAAUA,uBAAA,CAAkB,OAAA,CAAQ,OAAA,CAAQ,SAAS,SAAS,CAAA;AAGpE,IAAA,OAAOC,kBAAA,CAAc,EAAE,WAAA,EAAa,OAAA,IAAW,MAAM;AACnD,MAAA,MAAM,OAAOC,uBAAA,CAAkB;AAAA,QAC7B,OAAO,OAAA,CAAQ,KAAA;AAAA,QACf,SAAS,OAAA,CAAQ,OAAA;AAAA,QACjB,aAAA,EAAeC,8CAAA;AAAA,QACf,UAAA,EAAY;AAAA,UACV,CAACC,+CAAuC,GAAG,MAAA,CAAO,QAAQ,SAAS;AAAA;AACrE,OACD,CAAA;AAED,MAAA,MAAM,OAAA,GAAUC,oBAAe,IAAA,EAAM,MAAM,SAAS,IAAA,CAAK,IAAA,EAAM,OAAO,CAAC,CAAA;AACvE,MAAA,OAAOC,uBAAA,CAAkB,CAAC,IAAI,CAAA,EAAG,OAAO,CA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AOE,uBAAA,CAAkBI,SAAO,OAAO,CAAA;AAAA,IACzC,CAAC,CAAA;AAAA,EACH,CAAA;AACA,EAAA,OAAA,CAAQ,uBAAuB,CAAA,GAAI,IAAA;AACnC,EAAA,OAAO,OAAA;AACT;;;;;;"}
@@ -0,0 +1,70 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const diagnosticsChannel = require('node:diagnostics_channel');
4
+ const core = require('@sentry/core');
5
+ const debugBuild = require('../../../debug-build.js');
6
+ const channels = require('../../../orchestrion/channels.js');
7
+ const consumer = require('./consumer.js');
8
+ const spans = require('./spans.js');
9
+
10
+ const INTEGRATION_NAME = "Kafka";
11
+ function subscribeToProducer() {
12
+ const channel = diagnosticsChannel.tracingChannel(channels.CHANNELS.KAFKAJS_SEND_BATCH);
13
+ const subscribers = {
14
+ start(ctx) {
15
+ const spans$1 = [];
16
+ (ctx.arguments[0]?.topicMessages ?? []).forEach((topicMessage) => {
17
+ topicMessage.messages.forEach((message) => {
18
+ spans$1.push(spans.startProducerSpan(topicMessage.topic, message));
19
+ });
20
+ });
21
+ ctx._sentrySpans = spans$1;
22
+ },
23
+ error(ctx) {
24
+ if (ctx._sentrySpans) {
25
+ spans.applyErrorToSpans(ctx._sentrySpans, ctx.error);
26
+ }
27
+ },
28
+ asyncEnd(ctx) {
29
+ ctx._sentrySpans?.forEach((span) => span.end());
30
+ }
31
+ };
32
+ channel.subscribe(subscribers);
33
+ }
34
+ function subscribeToConsumer() {
35
+ const channel = diagnosticsChannel.tracingChannel(channels.CHANNELS.KAFKAJS_CONSUMER_RUN);
36
+ const subscribers = {
37
+ start(ctx) {
38
+ const config = ctx.arguments[0];
39
+ if (!config || typeof config !== "object") {
40
+ return;
41
+ }
42
+ if (typeof config.eachMessage === "function" && !consumer.isWrappedConsumerCallback(config.eachMessage)) {
43
+ config.eachMessage = consumer.wrapEachMessage(config.eachMessage);
44
+ }
45
+ if (typeof config.eachBatch === "function" && !consumer.isWrappedConsumerCallback(config.eachBatch)) {
46
+ config.eachBatch = consumer.wrapEachBatch(config.eachBatch);
47
+ }
48
+ }
49
+ };
50
+ channel.subscribe(subscribers);
51
+ }
52
+ const _kafkajsChannelIntegration = (() => {
53
+ return {
54
+ name: INTEGRATION_NAME,
55
+ setupOnce() {
56
+ if (!diagnosticsChannel.tracingChannel) {
57
+ return;
58
+ }
59
+ debugBuild.DEBUG_BUILD && core.debug.log(
60
+ `[orchestrion:kafkajs] subscribing to channels "${channels.CHANNELS.KAFKAJS_SEND_BATCH}", "${channels.CHANNELS.KAFKAJS_CONSUMER_RUN}"`
61
+ );
62
+ subscribeToProducer();
63
+ subscribeToConsumer();
64
+ }
65
+ };
66
+ });
67
+ const kafkajsChannelIntegration = core.defineIntegration(_kafkajsChannelIntegration);
68
+
69
+ exports.kafkajsChannelIntegration = kafkajsChannelIntegration;
70
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing-channel/kafkajs/index.ts"],"sourcesContent":["import * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { TracingChannelSubscribers } from 'node:diagnostics_channel';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport { debug, defineIntegration } from '@sentry/core';\nimport { DEBUG_BUILD } from '../../../debug-build';\nimport { CHANNELS } from '../../../orchestrion/channels';\nimport { isWrappedConsumerCallback, wrapEachBatch, wrapEachMessage } from './consumer';\nimport { applyErrorToSpans, startProducerSpan } from './spans';\nimport type { ConsumerRunConfig, ProducerBatch } from './types';\n\n// NOTE: this uses the same name as the OTel `Kafka` integration by design. When enabled, the OTel\n// integration is omitted from the default set (see `experimentalUseDiagnosticsChannelInjection`).\nconst INTEGRATION_NAME = 'Kafka' as const;\n\n/** The tracing-channel context the transform attaches around `messageProducer.js`'s `sendBatch`. */\ninterface SendBatchChannelContext {\n // `arguments[0]` is the `{ topicMessages }` batch (kafkajs normalizes `send` into `sendBatch`).\n arguments: [ProducerBatch?, ...unknown[]];\n error?: unknown;\n // The producer spans opened at `start`, ended on `asyncEnd` (and marked errored on `error`).\n _sentrySpans?: Span[];\n}\n\n/** The tracing-channel context the transform attaches around `consumer/index.js`'s `run`. */\ninterface ConsumerRunChannelContext {\n // `arguments[0]` is the `run(config)` config whose `eachMessage`/`eachBatch` we swap in place.\n arguments: [ConsumerRunConfig?, ...unknown[]];\n}\n\nfunction subscribeToProducer(): void {\n const channel = diagnosticsChannel.tracingChannel<SendBatchChannelContext>(CHANNELS.KAFKAJS_SEND_BATCH);\n // Node types `subscribe` as requiring every lifecycle handler; runtime accepts a partial set, so we\n // pass only the ones we use (matching `bindTracingChannelToSpan`'s handling in `tracing-channel.ts`).\n const subscribers: Partial<TracingChannelSubscribers<SendBatchChannelContext>> = {\n start(ctx) {\n const spans: Span[] = [];\n // `startProducerSpan` mutates each message's headers; doing it at `start` means the mutation\n // reaches the real call, propagating the producer's trace to consumers.\n (ctx.arguments[0]?.topicMessages ?? []).forEach(topicMessage => {\n topicMessage.messages.forEach(message => {\n spans.push(startProducerSpan(topicMessage.topic, message));\n });\n });\n ctx._sentrySpans = spans;\n },\n error(ctx) {\n if (ctx._sentrySpans) {\n applyErrorToSpans(ctx._sentrySpans, ctx.error);\n }\n },\n asyncEnd(ctx) {\n // `asyncEnd` fires on both success and failure; `error` (above) has already set the status.\n ctx._sentrySpans?.forEach(span => span.end());\n },\n };\n channel.subscribe(subscribers as TracingChannelSubscribers<SendBatchChannelContext>);\n}\n\nfunction subscribeToConsumer(): void {\n const channel = diagnosticsChannel.tracingChannel<ConsumerRunChannelContext>(CHANNELS.KAFKAJS_CONSUMER_RUN);\n const subscribers: Partial<TracingChannelSubscribers<ConsumerRunChannelContext>> = {\n start(ctx) {\n const config = ctx.arguments[0];\n if (!config || typeof config !== 'object') {\n return;\n }\n // Swap the user callbacks for span-creating wrappers before `run` destructures its config. The\n // `isWrappedConsumerCallback` guard keeps this idempotent: a config object reused across another\n // `run` (or a second consumer) must not have its wrapper wrapped again, which would double spans.\n if (typeof config.eachMessage === 'function' && !isWrappedConsumerCallback(config.eachMessage)) {\n config.eachMessage = wrapEachMessage(config.eachMessage);\n }\n if (typeof config.eachBatch === 'function' && !isWrappedConsumerCallback(config.eachBatch)) {\n config.eachBatch = wrapEachBatch(config.eachBatch);\n }\n },\n };\n channel.subscribe(subscribers as TracingChannelSubscribers<ConsumerRunChannelContext>);\n}\n\nconst _kafkajsChannelIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n if (!diagnosticsChannel.tracingChannel) {\n return;\n }\n\n DEBUG_BUILD &&\n debug.log(\n `[orchestrion:kafkajs] subscribing to channels \"${CHANNELS.KAFKAJS_SEND_BATCH}\", \"${CHANNELS.KAFKAJS_CONSUMER_RUN}\"`,\n );\n\n subscribeToProducer();\n subscribeToConsumer();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * EXPERIMENTAL — orchestrion-driven kafkajs integration.\n *\n * Subscribes to the `orchestrion:kafkajs:*` diagnostics_channels that the orchestrion code transform\n * injects into `kafkajs`'s `producer/messageProducer.js` (`sendBatch`) and `consumer/index.js` (`run`).\n * Requires the orchestrion runtime hook or bundler plugin to be active — wire that up via\n * `experimentalUseDiagnosticsChannelInjection`.\n *\n * Known limitation vs. the OTel integration it replaces: the wrapping producer-`transaction` span is\n * not emitted (the transformer can't replace `transaction()`'s return value to patch commit/abort).\n * Transactional `send`/`sendBatch` calls still produce producer spans, since they route through the\n * same instrumented `sendBatch`.\n */\nexport const kafkajsChannelIntegration = defineIntegration(_kafkajsChannelIntegration);\n"],"names":["CHANNELS","spans","startProducerSpan","applyErrorToSpans","isWrappedConsumerCallback","wrapEachMessage","wrapEachBatch","DEBUG_BUILD","debug","defineIntegration"],"mappings":";;;;;;;;;AAYA,MAAM,gBAAA,GAAmB,OAAA;AAiBzB,SAAS,mBAAA,GAA4B;AACnC,EAAA,MAAM,OAAA,GAAU,kBAAA,CAAmB,cAAA,CAAwCA,iBAAA,CAAS,k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I,kCAAA,CAA0B,MAAA,CAAO,WAAW,CAAA,EAAG;AAC9F,QAAA,MAAA,CAAO,WAAA,GAAcC,wBAAA,CAAgB,MAAA,CAAO,WAAW,CAAA;AAAA,MACzD;AACA,MAAA,IAAI,OAAO,OAAO,SAAA,KAAc,UAAA,IAAc,CAACD,kCAAA,CAA0B,MAAA,CAAO,SAAS,CAAA,EAAG;AAC1F,QAAA,MAAA,CAAO,SAAA,GAAYE,sBAAA,CAAc,MAAA,CAAO,SAAS,CAAA;AAAA,MACnD;AAAA,IACF;AAAA,GACF;AACA,EAAA,OAAA,CAAQ,UAAU,WAAmE,CAAA;AACvF;AAEA,MAAM,8BAA8B,MAAM;AACxC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,IAAI,CAAC,mBAAmB,cAAA,EAAgB;AACtC,QAAA;AAAA,MACF;AAEA,MAAAC,sBAAA,IACEC,UAAA,CAAM,GAAA;AAAA,QACJ,CAAA,+CAAA,EAAkDR,iBAAA,CAAS,kBAAkB,CAAA,IAAA,EAAOA,kBAAS,oBAAoB,CAAA,CAAA;AAAA,OACnH;AAEF,MAAA,mBAAA,EAAoB;AACpB,MAAA,mBAAA,EAAoB;AAAA,IACtB;AAAA,GACF;AACF,CAAA,CAAA;AAeO,MAAM,yBAAA,GAA4BS,uBAAkB,0BAA0B;;;;"}
@@ -0,0 +1,22 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const ATTR_MESSAGING_DESTINATION_PARTITION_ID = "messaging.destination.partition.id";
4
+ const ATTR_MESSAGING_KAFKA_MESSAGE_KEY = "messaging.kafka.message.key";
5
+ const ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = "messaging.kafka.message.tombstone";
6
+ const ATTR_MESSAGING_KAFKA_OFFSET = "messaging.kafka.offset";
7
+ const MESSAGING_OPERATION_TYPE_VALUE_PROCESS = "process";
8
+ const MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = "receive";
9
+ const MESSAGING_OPERATION_TYPE_VALUE_SEND = "send";
10
+ const MESSAGING_SYSTEM_VALUE_KAFKA = "kafka";
11
+ const ERROR_TYPE_VALUE_OTHER = "_OTHER";
12
+
13
+ exports.ATTR_MESSAGING_DESTINATION_PARTITION_ID = ATTR_MESSAGING_DESTINATION_PARTITION_ID;
14
+ exports.ATTR_MESSAGING_KAFKA_MESSAGE_KEY = ATTR_MESSAGING_KAFKA_MESSAGE_KEY;
15
+ exports.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE;
16
+ exports.ATTR_MESSAGING_KAFKA_OFFSET = ATTR_MESSAGING_KAFKA_OFFSET;
17
+ exports.ERROR_TYPE_VALUE_OTHER = ERROR_TYPE_VALUE_OTHER;
18
+ exports.MESSAGING_OPERATION_TYPE_VALUE_PROCESS = MESSAGING_OPERATION_TYPE_VALUE_PROCESS;
19
+ exports.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = MESSAGING_OPERATION_TYPE_VALUE_RECEIVE;
20
+ exports.MESSAGING_OPERATION_TYPE_VALUE_SEND = MESSAGING_OPERATION_TYPE_VALUE_SEND;
21
+ exports.MESSAGING_SYSTEM_VALUE_KAFKA = MESSAGING_SYSTEM_VALUE_KAFKA;
22
+ //# sourceMappingURL=semconv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semconv.js","sources":["../../../../../src/integrations/tracing-channel/kafkajs/semconv.ts"],"sourcesContent":["/*\n * Unstable OTel semantic-convention keys/values without a `@sentry/conventions` constant, inlined to\n * keep this integration free of `@opentelemetry/*` deps. Values are byte-identical to the vendored OTel\n * instrumentation (`@sentry/node`'s `integrations/tracing/kafka/vendored/semconv.ts`) for span parity.\n */\n\nexport const ATTR_MESSAGING_DESTINATION_PARTITION_ID = 'messaging.destination.partition.id' as const;\nexport const ATTR_MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message.key' as const;\nexport const ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = 'messaging.kafka.message.tombstone' as const;\nexport const ATTR_MESSAGING_KAFKA_OFFSET = 'messaging.kafka.offset' as const;\nexport const MESSAGING_OPERATION_TYPE_VALUE_PROCESS = 'process' as const;\nexport const MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = 'receive' as const;\nexport const MESSAGING_OPERATION_TYPE_VALUE_SEND = 'send' as const;\nexport const MESSAGING_SYSTEM_VALUE_KAFKA = 'kafka' as const;\n\n// `_OTHER` is OTel's fallback bucket when no more specific `error.type` is known.\nexport const ERROR_TYPE_VALUE_OTHER = '_OTHER' as const;\n"],"names":[],"mappings":";;AAMO,MAAM,uCAAA,GAA0C;AAChD,MAAM,gCAAA,GAAmC;AACzC,MAAM,sCAAA,GAAyC;AAC/C,MAAM,2BAAA,GAA8B;AACpC,MAAM,sCAAA,GAAyC;AAC/C,MAAM,sCAAA,GAAyC;AAC/C,MAAM,mCAAA,GAAsC;AAC5C,MAAM,4BAAA,GAA+B;AAGrC,MAAM,sBAAA,GAAyB;;;;;;;;;;;;"}
@@ -0,0 +1,119 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const attributes = require('@sentry/conventions/attributes');
4
+ const core = require('@sentry/core');
5
+ const semconv = require('./semconv.js');
6
+
7
+ const PRODUCER_ORIGIN = "auto.kafkajs.orchestrion.producer";
8
+ const CONSUMER_ORIGIN = "auto.kafkajs.orchestrion.consumer";
9
+ const TRACE_FLAG_SAMPLED = 1;
10
+ const TRACE_FLAG_NONE = 0;
11
+ function getHeaderAsString(headers, key) {
12
+ const value = headers?.[key];
13
+ if (value == null) {
14
+ return void 0;
15
+ }
16
+ return Array.isArray(value) ? value[0]?.toString() : value.toString();
17
+ }
18
+ function getLinksFromHeaders(headers) {
19
+ const sentryTrace = getHeaderAsString(headers, "sentry-trace");
20
+ if (!sentryTrace) {
21
+ return void 0;
22
+ }
23
+ const { traceId, parentSpanId, sampled } = core.propagationContextFromHeaders(
24
+ sentryTrace,
25
+ getHeaderAsString(headers, "baggage")
26
+ );
27
+ if (!parentSpanId) {
28
+ return void 0;
29
+ }
30
+ return [
31
+ {
32
+ context: {
33
+ traceId,
34
+ spanId: parentSpanId,
35
+ isRemote: true,
36
+ traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE
37
+ }
38
+ }
39
+ ];
40
+ }
41
+ function startConsumerSpan({ topic, message, operationType, links, attributes: attributes$1 }) {
42
+ const operationName = operationType === semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? "poll" : operationType;
43
+ return core.startInactiveSpan({
44
+ name: `${operationName} ${topic}`,
45
+ // todo(v11): Use https://getsentry.github.io/sentry-conventions/ops/#messaging
46
+ op: "message",
47
+ kind: operationType === semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? core.SPAN_KIND.CLIENT : core.SPAN_KIND.CONSUMER,
48
+ links,
49
+ attributes: {
50
+ ...attributes$1,
51
+ [attributes.MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA,
52
+ [attributes.MESSAGING_DESTINATION_NAME]: topic,
53
+ [attributes.MESSAGING_OPERATION_TYPE]: operationType,
54
+ [attributes.MESSAGING_OPERATION_NAME]: operationName,
55
+ [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message?.key ? String(message.key) : void 0,
56
+ [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message?.key && message.value === null ? true : void 0,
57
+ [semconv.ATTR_MESSAGING_KAFKA_OFFSET]: message?.offset,
58
+ // Mirror the upstream behavior of only tagging per-message processing spans (not the batch
59
+ // receiving span, which carries no message) with the auto origin.
60
+ ...message ? { [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: CONSUMER_ORIGIN } : {}
61
+ }
62
+ });
63
+ }
64
+ function startProducerSpan(topic, message) {
65
+ const span = core.startInactiveSpan({
66
+ name: `send ${topic}`,
67
+ op: "message",
68
+ kind: core.SPAN_KIND.PRODUCER,
69
+ attributes: {
70
+ [attributes.MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA,
71
+ [attributes.MESSAGING_DESTINATION_NAME]: topic,
72
+ [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message.key ? String(message.key) : void 0,
73
+ [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message.key && message.value === null ? true : void 0,
74
+ [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: message.partition !== void 0 ? String(message.partition) : void 0,
75
+ [attributes.MESSAGING_OPERATION_NAME]: "send",
76
+ [attributes.MESSAGING_OPERATION_TYPE]: semconv.MESSAGING_OPERATION_TYPE_VALUE_SEND,
77
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PRODUCER_ORIGIN
78
+ }
79
+ });
80
+ message.headers = message.headers ?? {};
81
+ const traceData = core.getTraceData({ span });
82
+ if (traceData["sentry-trace"]) {
83
+ message.headers["sentry-trace"] = traceData["sentry-trace"];
84
+ }
85
+ if (traceData.baggage) {
86
+ message.headers["baggage"] = traceData.baggage;
87
+ }
88
+ return span;
89
+ }
90
+ function applyErrorToSpans(spans, reason) {
91
+ let errorMessage;
92
+ let errorType = semconv.ERROR_TYPE_VALUE_OTHER;
93
+ if (typeof reason === "string" || reason === void 0) {
94
+ errorMessage = reason;
95
+ } else if (typeof reason === "object" && reason !== null && Object.prototype.hasOwnProperty.call(reason, "message")) {
96
+ errorMessage = reason.message;
97
+ errorType = reason.constructor.name;
98
+ }
99
+ spans.forEach((span) => {
100
+ span.setAttribute(attributes.ERROR_TYPE, errorType);
101
+ span.setStatus({ code: core.SPAN_STATUS_ERROR, message: errorMessage });
102
+ });
103
+ }
104
+ function endSpansOnPromise(spans, promise) {
105
+ return Promise.resolve(promise).catch((reason) => {
106
+ applyErrorToSpans(spans, reason);
107
+ throw reason;
108
+ }).finally(() => {
109
+ spans.forEach((span) => span.end());
110
+ });
111
+ }
112
+
113
+ exports.applyErrorToSpans = applyErrorToSpans;
114
+ exports.endSpansOnPromise = endSpansOnPromise;
115
+ exports.getHeaderAsString = getHeaderAsString;
116
+ exports.getLinksFromHeaders = getLinksFromHeaders;
117
+ exports.startConsumerSpan = startConsumerSpan;
118
+ exports.startProducerSpan = startProducerSpan;
119
+ //# sourceMappingURL=spans.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spans.js","sources":["../../../../../src/integrations/tracing-channel/kafkajs/spans.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-kafkajs\n * - Upstream version: @opentelemetry/instrumentation-kafkajs@0.27.0\n * - Span builders migrated to the `@sentry/core` span API. Kept byte-identical in span name/attributes\n * for parity with the OTel integration this replaces; only the origin changes to\n * `auto.kafkajs.orchestrion.*` to mark the injection path.\n */\n\nimport {\n ERROR_TYPE,\n MESSAGING_DESTINATION_NAME,\n MESSAGING_OPERATION_NAME,\n MESSAGING_OPERATION_TYPE,\n MESSAGING_SYSTEM,\n} from '@sentry/conventions/attributes';\nimport type { Span, SpanAttributes, SpanLink } from '@sentry/core';\nimport {\n getTraceData,\n propagationContextFromHeaders,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n} from '@sentry/core';\nimport type { KafkaMessage, Message } from './types';\nimport {\n ATTR_MESSAGING_DESTINATION_PARTITION_ID,\n ATTR_MESSAGING_KAFKA_MESSAGE_KEY,\n ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE,\n ATTR_MESSAGING_KAFKA_OFFSET,\n ERROR_TYPE_VALUE_OTHER,\n MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,\n MESSAGING_OPERATION_TYPE_VALUE_SEND,\n MESSAGING_SYSTEM_VALUE_KAFKA,\n} from './semconv';\n\nconst PRODUCER_ORIGIN = 'auto.kafkajs.orchestrion.producer';\nconst CONSUMER_ORIGIN = 'auto.kafkajs.orchestrion.consumer';\n\n// `@opentelemetry/api` `TraceFlags`, inlined to avoid an OTel dep: SAMPLED = 0x1, NONE = 0x0.\nconst TRACE_FLAG_SAMPLED = 1;\nconst TRACE_FLAG_NONE = 0;\n\ninterface ConsumerSpanOptions {\n topic: string;\n message: KafkaMessage | undefined;\n operationType: string;\n attributes: SpanAttributes;\n links?: SpanLink[];\n}\n\n/**\n * Reads a header value off a kafkajs message as a string. kafkajs delivers headers as `Buffer`s (or\n * arrays of them), so we normalize to a string before handing them to Sentry's trace helpers.\n */\nexport function getHeaderAsString(headers: KafkaMessage['headers'], key: string): string | undefined {\n const value = headers?.[key];\n if (value == null) {\n return undefined;\n }\n return Array.isArray(value) ? value[0]?.toString() : value.toString();\n}\n\n/**\n * Builds a span link to the producer span carried in the message headers, mirroring the upstream\n * behavior of linking each batch-processed message to its originating producer span.\n */\nexport function getLinksFromHeaders(headers: KafkaMessage['headers']): SpanLink[] | undefined {\n const sentryTrace = getHeaderAsString(headers, 'sentry-trace');\n if (!sentryTrace) {\n return undefined;\n }\n\n const { traceId, parentSpanId, sampled } = propagationContextFromHeaders(\n sentryTrace,\n getHeaderAsString(headers, 'baggage'),\n );\n if (!parentSpanId) {\n return undefined;\n }\n\n return [\n {\n context: {\n traceId,\n spanId: parentSpanId,\n isRemote: true,\n traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE,\n },\n },\n ];\n}\n\n/** Starts an inactive consumer (process/receive) span carrying the kafkajs messaging attributes. */\nexport function startConsumerSpan({ topic, message, operationType, links, attributes }: ConsumerSpanOptions): Span {\n // The batch \"receive\" span is named `poll`; per-message spans use the operation type verbatim.\n const operationName = operationType === MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? 'poll' : operationType;\n\n return startInactiveSpan({\n name: `${operationName} ${topic}`,\n // todo(v11): Use https://getsentry.github.io/sentry-conventions/ops/#messaging\n op: 'message',\n kind: operationType === MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? SPAN_KIND.CLIENT : SPAN_KIND.CONSUMER,\n links,\n attributes: {\n ...attributes,\n [MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [MESSAGING_DESTINATION_NAME]: topic,\n [MESSAGING_OPERATION_TYPE]: operationType,\n [MESSAGING_OPERATION_NAME]: operationName,\n [ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message?.key ? String(message.key) : undefined,\n [ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message?.key && message.value === null ? true : undefined,\n [ATTR_MESSAGING_KAFKA_OFFSET]: message?.offset as string | undefined,\n // Mirror the upstream behavior of only tagging per-message processing spans (not the batch\n // receiving span, which carries no message) with the auto origin.\n ...(message ? { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: CONSUMER_ORIGIN } : {}),\n },\n });\n}\n\n/** Starts an inactive producer span and propagates its trace into the message headers. */\nexport function startProducerSpan(topic: string, message: Message): Span {\n const span = startInactiveSpan({\n name: `send ${topic}`,\n op: 'message',\n kind: SPAN_KIND.PRODUCER,\n attributes: {\n [MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [MESSAGING_DESTINATION_NAME]: topic,\n [ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message.key ? String(message.key) : undefined,\n [ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message.key && message.value === null ? true : undefined,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]:\n message.partition !== undefined ? String(message.partition) : undefined,\n [MESSAGING_OPERATION_NAME]: 'send',\n [MESSAGING_OPERATION_TYPE]: MESSAGING_OPERATION_TYPE_VALUE_SEND,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: PRODUCER_ORIGIN,\n },\n });\n\n // Propagate the producer span's trace to consumers via the message headers.\n message.headers = message.headers ?? {};\n const traceData = getTraceData({ span });\n if (traceData['sentry-trace']) {\n message.headers['sentry-trace'] = traceData['sentry-trace'];\n }\n if (traceData.baggage) {\n message.headers['baggage'] = traceData.baggage;\n }\n\n return span;\n}\n\n/**\n * Marks all `spans` with the error status and `error.type` derived from a settle-time `reason`,\n * WITHOUT ending them. Mirrors the vendored `endSpansOnPromise` catch block. The producer path (which\n * receives discrete `error`/`asyncEnd` channel events) applies the error on `error` and ends on\n * `asyncEnd`; the consumer path folds this into `endSpansOnPromise`.\n */\nexport function applyErrorToSpans(spans: Span[], reason: unknown): void {\n let errorMessage: string | undefined;\n let errorType: string = ERROR_TYPE_VALUE_OTHER;\n if (typeof reason === 'string' || reason === undefined) {\n errorMessage = reason;\n } else if (typeof reason === 'object' && reason !== null && Object.prototype.hasOwnProperty.call(reason, 'message')) {\n errorMessage = (reason as { message?: string }).message;\n errorType = (reason as { constructor: { name: string } }).constructor.name;\n }\n\n spans.forEach(span => {\n span.setAttribute(ERROR_TYPE, errorType);\n span.setStatus({ code: SPAN_STATUS_ERROR, message: errorMessage });\n });\n}\n\n/**\n * Resolves once `promise` settles, applying the error status to all `spans` on failure and ending\n * them regardless. Used by the consumer path, which invokes the user callback directly (and so holds a\n * real promise). Verbatim from the vendored `endSpansOnPromise`.\n */\nexport function endSpansOnPromise<T>(spans: Span[], promise: Promise<T>): Promise<T> {\n return Promise.resolve(promise)\n .catch(reason => {\n applyErrorToSpans(spans, reason);\n throw reason;\n })\n .finally(() => {\n spans.forEach(span => span.end());\n });\n}\n"],"names":["propagationContextFromHeaders","attributes","MESSAGING_OPERATION_TYPE_VALUE_RECEIVE","startInactiveSpan","SPAN_KIND","MESSAGING_SYSTEM","MESSAGING_SYSTEM_VALUE_KAFKA","MESSAGING_DESTINATION_NAME","MESSAGING_OPERATION_TYPE","MESSAGING_OPERATION_NAME","ATTR_M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