@sentry/node 10.57.0 → 10.59.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 (523) hide show
  1. package/build/cjs/index.js +2 -0
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/fs/index.js +3 -84
  4. package/build/cjs/integrations/fs/index.js.map +1 -1
  5. package/build/cjs/integrations/fs/vendored/constants.js.map +1 -1
  6. package/build/cjs/integrations/fs/vendored/instrumentation.js +145 -175
  7. package/build/cjs/integrations/fs/vendored/instrumentation.js.map +1 -1
  8. package/build/cjs/integrations/fs/vendored/utils.js.map +1 -1
  9. package/build/cjs/integrations/node-fetch/vendored/undici.js.map +1 -1
  10. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  11. package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
  12. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  13. package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  14. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  15. package/build/cjs/integrations/tracing/connect/index.js +0 -21
  16. package/build/cjs/integrations/tracing/connect/index.js.map +1 -1
  17. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +0 -6
  18. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
  19. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +33 -42
  20. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  21. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
  22. package/build/cjs/integrations/tracing/connect/vendored/utils.js +3 -2
  23. package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -1
  24. package/build/cjs/integrations/tracing/dataloader/index.js +2 -22
  25. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -1
  26. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js +93 -120
  27. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  28. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +1 -1
  29. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  30. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  31. package/build/cjs/integrations/tracing/genericPool/index.js +1 -15
  32. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -1
  33. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +37 -37
  34. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  35. package/build/cjs/integrations/tracing/graphql/index.js +1 -51
  36. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -1
  37. package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +1 -1
  38. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
  39. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
  40. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +67 -57
  41. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  42. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
  43. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
  44. package/build/cjs/integrations/tracing/graphql/vendored/utils.js +28 -62
  45. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  46. package/build/cjs/integrations/tracing/hapi/index.js +0 -17
  47. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  48. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
  49. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +28 -45
  50. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  51. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
  52. package/build/cjs/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
  53. package/build/cjs/integrations/tracing/hapi/vendored/utils.js +4 -9
  54. package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  55. package/build/cjs/integrations/tracing/index.js +1 -0
  56. package/build/cjs/integrations/tracing/index.js.map +1 -1
  57. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  58. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js.map +1 -1
  59. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js.map +1 -1
  60. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  61. package/build/cjs/integrations/tracing/knex/index.js +2 -17
  62. package/build/cjs/integrations/tracing/knex/index.js.map +1 -1
  63. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +65 -93
  64. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  65. package/build/cjs/integrations/tracing/knex/vendored/semconv.js +2 -0
  66. package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  67. package/build/cjs/integrations/tracing/knex/vendored/utils.js +2 -15
  68. package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -1
  69. package/build/cjs/integrations/tracing/koa/index.js +1 -24
  70. package/build/cjs/integrations/tracing/koa/index.js.map +1 -1
  71. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
  72. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +29 -41
  73. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  74. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
  75. package/build/cjs/integrations/tracing/koa/vendored/types.js.map +1 -1
  76. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -1
  77. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  78. package/build/cjs/integrations/tracing/mongo/index.js +1 -42
  79. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -1
  80. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +12 -562
  81. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  82. package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
  83. package/build/cjs/integrations/tracing/mongo/vendored/patches.js +151 -0
  84. package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  85. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js +0 -4
  86. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  87. package/build/cjs/integrations/tracing/mongo/vendored/utils.js +153 -0
  88. package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  89. package/build/cjs/integrations/tracing/mongoose/index.js +1 -8
  90. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -1
  91. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +56 -203
  92. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  93. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js +0 -4
  94. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  95. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +19 -49
  96. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  97. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
  98. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  99. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  100. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  101. package/build/cjs/integrations/tracing/mysql2/index.js +1 -8
  102. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -1
  103. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +21 -59
  104. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  105. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  106. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +14 -33
  107. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  108. package/build/cjs/integrations/tracing/postgres/index.js +0 -4
  109. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -1
  110. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
  111. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
  112. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
  113. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +51 -261
  114. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  115. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +0 -12
  116. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  117. package/build/cjs/integrations/tracing/postgres/vendored/utils.js +43 -167
  118. package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  119. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  120. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  121. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -1
  122. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  123. package/build/cjs/integrations/tracing/redis/index.js +1 -1
  124. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  125. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +89 -160
  126. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  127. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  128. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +92 -231
  129. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  130. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +0 -2
  131. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  132. package/build/cjs/integrations/tracing/tedious/index.js +1 -25
  133. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -1
  134. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +25 -76
  135. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  136. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  137. package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +1 -1
  138. package/build/cjs/sdk/diagnosticsChannelInjection.js +21 -0
  139. package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -0
  140. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +19 -0
  141. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  142. package/build/cjs/sdk/index.js +17 -1
  143. package/build/cjs/sdk/index.js.map +1 -1
  144. package/build/esm/index.js +1 -0
  145. package/build/esm/index.js.map +1 -1
  146. package/build/esm/integrations/fs/index.js +4 -85
  147. package/build/esm/integrations/fs/index.js.map +1 -1
  148. package/build/esm/integrations/fs/vendored/constants.js.map +1 -1
  149. package/build/esm/integrations/fs/vendored/instrumentation.js +147 -177
  150. package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -1
  151. package/build/esm/integrations/fs/vendored/utils.js.map +1 -1
  152. package/build/esm/integrations/node-fetch/vendored/undici.js.map +1 -1
  153. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  154. package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
  155. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  156. package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  157. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  158. package/build/esm/integrations/tracing/connect/index.js +1 -22
  159. package/build/esm/integrations/tracing/connect/index.js.map +1 -1
  160. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +1 -6
  161. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
  162. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +36 -44
  163. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  164. package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
  165. package/build/esm/integrations/tracing/connect/vendored/utils.js +3 -2
  166. package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -1
  167. package/build/esm/integrations/tracing/dataloader/index.js +4 -24
  168. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -1
  169. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js +95 -122
  170. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  171. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +1 -1
  172. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  173. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  174. package/build/esm/integrations/tracing/genericPool/index.js +3 -17
  175. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -1
  176. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +38 -38
  177. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  178. package/build/esm/integrations/tracing/graphql/index.js +3 -53
  179. package/build/esm/integrations/tracing/graphql/index.js.map +1 -1
  180. package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +1 -1
  181. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
  182. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
  183. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +69 -59
  184. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  185. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
  186. package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
  187. package/build/esm/integrations/tracing/graphql/vendored/utils.js +29 -62
  188. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  189. package/build/esm/integrations/tracing/hapi/index.js +1 -18
  190. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  191. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
  192. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +30 -47
  193. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  194. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
  195. package/build/esm/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
  196. package/build/esm/integrations/tracing/hapi/vendored/utils.js +5 -10
  197. package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  198. package/build/esm/integrations/tracing/index.js +1 -0
  199. package/build/esm/integrations/tracing/index.js.map +1 -1
  200. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  201. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js.map +1 -1
  202. package/build/esm/integrations/tracing/kafka/vendored/propagator.js.map +1 -1
  203. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  204. package/build/esm/integrations/tracing/knex/index.js +4 -19
  205. package/build/esm/integrations/tracing/knex/index.js.map +1 -1
  206. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +66 -94
  207. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  208. package/build/esm/integrations/tracing/knex/vendored/semconv.js +2 -1
  209. package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  210. package/build/esm/integrations/tracing/knex/vendored/utils.js +3 -15
  211. package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -1
  212. package/build/esm/integrations/tracing/koa/index.js +3 -26
  213. package/build/esm/integrations/tracing/koa/index.js.map +1 -1
  214. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
  215. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +31 -43
  216. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  217. package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
  218. package/build/esm/integrations/tracing/koa/vendored/types.js.map +1 -1
  219. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -1
  220. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  221. package/build/esm/integrations/tracing/mongo/index.js +3 -43
  222. package/build/esm/integrations/tracing/mongo/index.js.map +1 -1
  223. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +13 -563
  224. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  225. package/build/esm/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
  226. package/build/esm/integrations/tracing/mongo/vendored/patches.js +143 -0
  227. package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  228. package/build/esm/integrations/tracing/mongo/vendored/semconv.js +1 -3
  229. package/build/esm/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  230. package/build/esm/integrations/tracing/mongo/vendored/utils.js +146 -0
  231. package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  232. package/build/esm/integrations/tracing/mongoose/index.js +2 -9
  233. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -1
  234. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +59 -206
  235. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  236. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js +1 -3
  237. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  238. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +20 -50
  239. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  240. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
  241. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  242. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  243. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  244. package/build/esm/integrations/tracing/mysql2/index.js +2 -9
  245. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -1
  246. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +26 -64
  247. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  248. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  249. package/build/esm/integrations/tracing/mysql2/vendored/utils.js +15 -34
  250. package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  251. package/build/esm/integrations/tracing/postgres/index.js +1 -5
  252. package/build/esm/integrations/tracing/postgres/index.js.map +1 -1
  253. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
  254. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
  255. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
  256. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +52 -262
  257. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  258. package/build/esm/integrations/tracing/postgres/vendored/semconv.js +1 -7
  259. package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  260. package/build/esm/integrations/tracing/postgres/vendored/utils.js +44 -165
  261. package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  262. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  263. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  264. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -1
  265. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  266. package/build/esm/integrations/tracing/redis/index.js +1 -1
  267. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  268. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +92 -163
  269. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  270. package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  271. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +94 -233
  272. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  273. package/build/esm/integrations/tracing/redis/vendored/semconv.js +1 -2
  274. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  275. package/build/esm/integrations/tracing/tedious/index.js +3 -27
  276. package/build/esm/integrations/tracing/tedious/index.js.map +1 -1
  277. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +29 -79
  278. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  279. package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  280. package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +1 -1
  281. package/build/esm/package.json +1 -1
  282. package/build/esm/sdk/diagnosticsChannelInjection.js +17 -0
  283. package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -0
  284. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +17 -0
  285. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  286. package/build/esm/sdk/index.js +17 -1
  287. package/build/esm/sdk/index.js.map +1 -1
  288. package/build/import-hook.mjs +6 -0
  289. package/build/types/index.d.ts +1 -0
  290. package/build/types/index.d.ts.map +1 -1
  291. package/build/types/integrations/fs/index.d.ts.map +1 -1
  292. package/build/types/integrations/fs/vendored/constants.d.ts.map +1 -1
  293. package/build/types/integrations/fs/vendored/instrumentation.d.ts +6 -10
  294. package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -1
  295. package/build/types/integrations/fs/vendored/types.d.ts +10 -15
  296. package/build/types/integrations/fs/vendored/types.d.ts.map +1 -1
  297. package/build/types/integrations/fs/vendored/utils.d.ts +2 -2
  298. package/build/types/integrations/fs/vendored/utils.d.ts.map +1 -1
  299. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts.map +1 -1
  300. package/build/types/integrations/node-fetch/vendored/types.d.ts.map +1 -1
  301. package/build/types/integrations/node-fetch/vendored/undici.d.ts.map +1 -1
  302. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts.map +1 -1
  303. package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts.map +1 -1
  304. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -1
  305. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -1
  306. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -1
  307. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -1
  308. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
  309. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +1 -1
  310. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +5 -5
  311. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -1
  312. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
  313. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +1 -1
  314. package/build/types/integrations/tracing/connect/vendored/utils.d.ts +1 -1
  315. package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +1 -1
  316. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -1
  317. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts +2 -5
  318. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -1
  319. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts +20 -8
  320. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -1
  321. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +1 -1
  322. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -1
  323. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +1 -1
  324. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts.map +1 -1
  325. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts +2 -1
  326. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -1
  327. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -1
  328. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +1 -1
  329. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
  330. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +1 -1
  331. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +7 -2
  332. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -1
  333. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +4 -4
  334. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +1 -1
  335. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +1 -1
  336. package/build/types/integrations/tracing/graphql/vendored/types.d.ts +5 -43
  337. package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -1
  338. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +8 -11
  339. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -1
  340. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  341. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +1 -1
  342. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
  343. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -1
  344. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +1 -1
  345. package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts.map +1 -1
  346. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +3 -4
  347. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -1
  348. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  349. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -1
  350. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts.map +1 -1
  351. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts.map +1 -1
  352. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -1
  353. package/build/types/integrations/tracing/kafka/vendored/types.d.ts.map +1 -1
  354. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -1
  355. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
  356. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -1
  357. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
  358. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -1
  359. package/build/types/integrations/tracing/knex/vendored/utils.d.ts +0 -6
  360. package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +1 -1
  361. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -1
  362. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +1 -1
  363. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +1 -1
  364. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -1
  365. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
  366. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +1 -1
  367. package/build/types/integrations/tracing/koa/vendored/types.d.ts +2 -39
  368. package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +1 -1
  369. package/build/types/integrations/tracing/koa/vendored/utils.d.ts +3 -3
  370. package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -1
  371. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -1
  372. package/build/types/integrations/tracing/mongo/index.d.ts +0 -4
  373. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -1
  374. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
  375. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -1
  376. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
  377. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -1
  378. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  379. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +1 -0
  380. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
  381. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts.map +1 -1
  382. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
  383. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -0
  384. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -1
  385. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
  386. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +1 -1
  387. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
  388. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -1
  389. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
  390. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts.map +1 -1
  391. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
  392. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -1
  393. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +1 -1
  394. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -1
  395. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -1
  396. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -1
  397. package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +1 -1
  398. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -1
  399. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -1
  400. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
  401. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -1
  402. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -1
  403. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
  404. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -1
  405. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -1
  406. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
  407. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +1 -1
  408. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +1 -1
  409. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +1 -9
  410. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -1
  411. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
  412. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +1 -1
  413. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +1 -1
  414. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +1 -1
  415. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
  416. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -1
  417. package/build/types/integrations/tracing/postgres/vendored/types.d.ts +2 -56
  418. package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -1
  419. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
  420. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -1
  421. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -1
  422. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -1
  423. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -1
  424. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -1
  425. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -1
  426. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
  427. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
  428. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -1
  429. package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts.map +1 -1
  430. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -1
  431. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -1
  432. package/build/types/integrations/tracing/redis/vendored/types.d.ts +2 -36
  433. package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -1
  434. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -1
  435. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
  436. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -1
  437. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -1
  438. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +1 -1
  439. package/build/types/sdk/diagnosticsChannelInjection.d.ts +41 -0
  440. package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -0
  441. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
  442. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -0
  443. package/build/types/sdk/index.d.ts.map +1 -1
  444. package/build/types-ts3.8/index.d.ts +1 -0
  445. package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +6 -10
  446. package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +10 -15
  447. package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +2 -2
  448. package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
  449. package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +4 -4
  450. package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
  451. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/instrumentation.d.ts +2 -5
  452. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/types.d.ts +20 -8
  453. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +1 -1
  454. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/instrumentation.d.ts +2 -1
  455. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
  456. package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +6 -1
  457. package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +3 -3
  458. package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +4 -42
  459. package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +6 -9
  460. package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
  461. package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +1 -2
  462. package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
  463. package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
  464. package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +0 -6
  465. package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
  466. package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +1 -38
  467. package/build/types-ts3.8/integrations/tracing/mongo/index.d.ts +0 -4
  468. package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
  469. package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
  470. package/build/types-ts3.8/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  471. package/build/types-ts3.8/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
  472. package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
  473. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
  474. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
  475. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
  476. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
  477. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
  478. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
  479. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
  480. package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +0 -8
  481. package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
  482. package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
  483. package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +1 -55
  484. package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
  485. package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
  486. package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +2 -36
  487. package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
  488. package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +41 -0
  489. package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
  490. package/package.json +20 -6
  491. package/build/cjs/integrations/tracing/knex/vendored/constants.js +0 -16
  492. package/build/cjs/integrations/tracing/knex/vendored/constants.js.map +0 -1
  493. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js +0 -6
  494. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
  495. package/build/cjs/integrations/tracing/utils/sql-common.js +0 -43
  496. package/build/cjs/integrations/tracing/utils/sql-common.js.map +0 -1
  497. package/build/esm/integrations/tracing/knex/vendored/constants.js +0 -13
  498. package/build/esm/integrations/tracing/knex/vendored/constants.js.map +0 -1
  499. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js +0 -4
  500. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
  501. package/build/esm/integrations/tracing/utils/sql-common.js +0 -41
  502. package/build/esm/integrations/tracing/utils/sql-common.js.map +0 -1
  503. package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +0 -14
  504. package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts.map +0 -1
  505. package/build/types/integrations/tracing/knex/vendored/constants.d.ts +0 -3
  506. package/build/types/integrations/tracing/knex/vendored/constants.d.ts.map +0 -1
  507. package/build/types/integrations/tracing/knex/vendored/types.d.ts +0 -8
  508. package/build/types/integrations/tracing/knex/vendored/types.d.ts.map +0 -1
  509. package/build/types/integrations/tracing/mongo/vendored/types.d.ts +0 -51
  510. package/build/types/integrations/tracing/mongo/vendored/types.d.ts.map +0 -1
  511. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
  512. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts.map +0 -1
  513. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
  514. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts.map +0 -1
  515. package/build/types/integrations/tracing/tedious/vendored/types.d.ts +0 -10
  516. package/build/types/integrations/tracing/tedious/vendored/types.d.ts.map +0 -1
  517. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +0 -14
  518. package/build/types-ts3.8/integrations/tracing/knex/vendored/constants.d.ts +0 -3
  519. package/build/types-ts3.8/integrations/tracing/knex/vendored/types.d.ts +0 -8
  520. package/build/types-ts3.8/integrations/tracing/mongo/vendored/types.d.ts +0 -51
  521. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
  522. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
  523. package/build/types-ts3.8/integrations/tracing/tedious/vendored/types.d.ts +0 -10
@@ -1 +1 @@
1
- {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/hapi/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n */\n/* eslint-disable */\n\n/**\n * Deprecated, use `http.request.method` instead.\n *\n * @example GET\n * @example POST\n * @example HEAD\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `http.request.method`.\n */\nexport const ATTR_HTTP_METHOD = 'http.method' as const;\n"],"names":[],"mappings":"AAgCO,MAAM,gBAAA,GAAmB;;;;"}
1
+ {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/hapi/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n */\n/* eslint-disable */\n\n/**\n * Deprecated, use `http.request.method` instead.\n *\n * @example GET\n * @example POST\n * @example HEAD\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `http.request.method`.\n */\nexport const ATTR_HTTP_METHOD = 'http.method' as const;\n"],"names":[],"mappings":"AAqBO,MAAM,gBAAA,GAAmB;;;;"}
@@ -1,8 +1,7 @@
1
- import { ATTR_HTTP_ROUTE, ATTR_HTTP_REQUEST_METHOD } from '@opentelemetry/semantic-conventions';
1
+ import { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';
2
2
  import { ATTR_HTTP_METHOD } from './semconv.js';
3
3
  import { HapiLifecycleMethodNames, HapiLayerType } from './internal-types.js';
4
4
  import { AttributeNames } from './enums/AttributeNames.js';
5
- import { SemconvStability } from '@opentelemetry/instrumentation';
6
5
 
7
6
  function getPluginName(plugin) {
8
7
  if (plugin.name) {
@@ -24,16 +23,12 @@ const isDirectExtInput = (variableToCheck) => {
24
23
  const isPatchableExtMethod = (variableToCheck) => {
25
24
  return !Array.isArray(variableToCheck);
26
25
  };
27
- const getRouteMetadata = (route, semconvStability, pluginName) => {
26
+ const getRouteMetadata = (route, pluginName) => {
28
27
  const attributes = {
29
- [ATTR_HTTP_ROUTE]: route.path
28
+ [ATTR_HTTP_ROUTE]: route.path,
29
+ // eslint-disable-next-line typescript/no-deprecated
30
+ [ATTR_HTTP_METHOD]: route.method
30
31
  };
31
- if (semconvStability & SemconvStability.OLD) {
32
- attributes[ATTR_HTTP_METHOD] = route.method;
33
- }
34
- if (semconvStability & SemconvStability.STABLE) {
35
- attributes[ATTR_HTTP_REQUEST_METHOD] = route.method;
36
- }
37
32
  let name;
38
33
  if (pluginName) {
39
34
  attributes[AttributeNames.HAPI_TYPE] = HapiLayerType.PLUGIN;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/hapi/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n * - Types vendored from @hapi/hapi as simplified interfaces\n */\n/* eslint-disable */\n\nimport { Attributes } from '@opentelemetry/api';\nimport { ATTR_HTTP_ROUTE, ATTR_HTTP_REQUEST_METHOD } from '@opentelemetry/semantic-conventions';\nimport { ATTR_HTTP_METHOD } from './semconv';\nimport type * as Hapi from './hapi-types';\nimport {\n HapiLayerType,\n HapiLifecycleMethodNames,\n HapiPluginObject,\n PatchableExtMethod,\n ServerExtDirectInput,\n} from './internal-types';\nimport { AttributeNames } from './enums/AttributeNames';\nimport { SemconvStability } from '@opentelemetry/instrumentation';\n\nexport function getPluginName<T>(plugin: Hapi.Plugin<T>): string {\n if ((plugin as Hapi.PluginNameVersion).name) {\n return (plugin as Hapi.PluginNameVersion).name;\n } else {\n return (plugin as Hapi.PluginPackage).pkg.name;\n }\n}\n\nexport const isLifecycleExtType = (variableToCheck: unknown): variableToCheck is Hapi.ServerRequestExtType => {\n return typeof variableToCheck === 'string' && HapiLifecycleMethodNames.has(variableToCheck);\n};\n\nexport const isLifecycleExtEventObj = (\n variableToCheck: unknown,\n): variableToCheck is Hapi.ServerExtEventsRequestObject => {\n const event = (variableToCheck as Hapi.ServerExtEventsRequestObject)?.type;\n return event !== undefined && isLifecycleExtType(event);\n};\n\nexport const isDirectExtInput = (variableToCheck: unknown): variableToCheck is ServerExtDirectInput => {\n return (\n Array.isArray(variableToCheck) &&\n variableToCheck.length <= 3 &&\n isLifecycleExtType(variableToCheck[0]) &&\n typeof variableToCheck[1] === 'function'\n );\n};\n\nexport const isPatchableExtMethod = (\n variableToCheck: PatchableExtMethod | PatchableExtMethod[],\n): variableToCheck is PatchableExtMethod => {\n return !Array.isArray(variableToCheck);\n};\n\nexport const getRouteMetadata = (\n route: Hapi.ServerRoute,\n semconvStability: SemconvStability,\n pluginName?: string,\n): {\n attributes: Attributes;\n name: string;\n} => {\n const attributes: Attributes = {\n [ATTR_HTTP_ROUTE]: route.path,\n };\n if (semconvStability & SemconvStability.OLD) {\n attributes[ATTR_HTTP_METHOD] = route.method;\n }\n if (semconvStability & SemconvStability.STABLE) {\n // Note: This currently does *not* normalize the method name to uppercase\n // and conditionally include `http.request.method.original` as described\n // at https://opentelemetry.io/docs/specs/semconv/http/http-spans/\n // These attributes are for a *hapi* span, and not the parent HTTP span,\n // so the HTTP span guidance doesn't strictly apply.\n attributes[ATTR_HTTP_REQUEST_METHOD] = route.method;\n }\n\n let name;\n if (pluginName) {\n attributes[AttributeNames.HAPI_TYPE] = HapiLayerType.PLUGIN;\n attributes[AttributeNames.PLUGIN_NAME] = pluginName;\n name = `${pluginName}: route - ${route.path}`;\n } else {\n attributes[AttributeNames.HAPI_TYPE] = HapiLayerType.ROUTER;\n name = `route - ${route.path}`;\n }\n\n return { attributes, name };\n};\n\nexport const getExtMetadata = (\n extPoint: Hapi.ServerRequestExtType,\n pluginName?: string,\n methodName?: string,\n): {\n attributes: Attributes;\n name: string;\n} => {\n let baseName = `ext - ${extPoint}`;\n if (methodName && methodName !== 'method') {\n // method is the default name for the extension in the ServerExtEventsObject format.\n baseName = `ext - ${extPoint} - ${methodName}`;\n }\n if (pluginName) {\n return {\n attributes: {\n [AttributeNames.EXT_TYPE]: extPoint,\n [AttributeNames.HAPI_TYPE]: HapiLayerType.EXT,\n [AttributeNames.PLUGIN_NAME]: pluginName,\n },\n name: `${pluginName}: ${baseName}`,\n };\n }\n return {\n attributes: {\n [AttributeNames.EXT_TYPE]: extPoint,\n [AttributeNames.HAPI_TYPE]: HapiLayerType.EXT,\n },\n name: baseName,\n };\n};\n\nexport const getPluginFromInput = <T>(pluginObj: HapiPluginObject<T>): Hapi.Plugin<T, void> => {\n if ('plugin' in pluginObj) {\n if ('plugin' in pluginObj.plugin) {\n return pluginObj.plugin.plugin;\n }\n return pluginObj.plugin;\n }\n return pluginObj;\n};\n"],"names":[],"mappings":";;;;;;AAoCO,SAAS,cAAiB,MAAA,EAAgC;AAC/D,EAAA,IAAK,OAAkC,IAAA,EAAM;AAC3C,IAAA,OAAQ,MAAA,CAAkC,IAAA;AAAA,EAC5C,CAAA,MAAO;AACL,IAAA,OAAQ,OAA8B,GAAA,CAAI,IAAA;AAAA,EAC5C;AACF;AAEO,MAAM,kBAAA,GAAqB,CAAC,eAAA,KAA2E;AAC5G,EAAA,OAAO,OAAO,eAAA,KAAoB,QAAA,IAAY,wBAAA,CAAyB,IAAI,eAAe,CAAA;AAC5F;AAEO,MAAM,sBAAA,GAAyB,CACpC,eAAA,KACyD;AACzD,EAAA,MAAM,QAAS,eAAA,EAAuD,IAAA;AACtE,EAAA,OAAO,KAAA,KAAU,MAAA,IAAa,kBAAA,CAAmB,KAAK,CAAA;AACxD;AAEO,MAAM,gBAAA,GAAmB,CAAC,eAAA,KAAsE;AACrG,EAAA,OACE,KAAA,CAAM,OAAA,CAAQ,eAAe,CAAA,IAC7B,gBAAgB,MAAA,IAAU,CAAA,IAC1B,kBAAA,CAAmB,eAAA,CAAgB,CAAC,CAAC,CAAA,IACrC,OAAO,eAAA,CAAgB,CAAC,CAAA,KAAM,UAAA;AAElC;AAEO,MAAM,oBAAA,GAAuB,CAClC,eAAA,KAC0C;AAC1C,EAAA,OAAO,CAAC,KAAA,CAAM,OAAA,CAAQ,eAAe,CAAA;AACvC;AAEO,MAAM,gBAAA,GAAmB,CAC9B,KAAA,EACA,gBAAA,EACA,UAAA,KAIG;AACH,EAAA,MAAM,UAAA,GAAyB;AAAA,IAC7B,CAAC,eAAe,GAAG,KAAA,CAAM;AAAA,GAC3B;AACA,EAAA,IAAI,gBAAA,GAAmB,iB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AAM,CAAA,EAAG,UAAU,CAAA,EAAA,EAAK,QAAQ,CAAA;AAAA,KAClC;AAAA,EACF;AACA,EAAA,OAAO;AAAA,IACL,UAAA,EAAY;AAAA,MACV,CAAC,cAAA,CAAe,QAAQ,GAAG,QAAA;AAAA,MAC3B,CAAC,cAAA,CAAe,SAAS,GAAG,aAAA,CAAc;AAAA,KAC5C;AAAA,IACA,IAAA,EAAM;AAAA,GACR;AACF;AAEO,MAAM,kBAAA,GAAqB,CAAI,SAAA,KAAyD;AAC7F,EAAA,IAAI,YAAY,SAAA,EAAW;AACzB,IAAA,IAAI,QAAA,IAAY,UAAU,MAAA,EAAQ;AAChC,MAAA,OAAO,UAAU,MAAA,CAAO,MAAA;AAAA,IAC1B;AACA,IAAA,OAAO,SAAA,CAAU,MAAA;AAAA,EACnB;AACA,EAAA,OAAO,SAAA;AACT;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/hapi/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\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-hapi\n * - Upstream version: @opentelemetry/instrumentation-hapi@0.64.0\n * - Types vendored from @hapi/hapi as simplified interfaces\n */\n\nimport type { Attributes } from '@opentelemetry/api';\nimport { ATTR_HTTP_ROUTE } from '@opentelemetry/semantic-conventions';\nimport { ATTR_HTTP_METHOD } from './semconv';\nimport type * as Hapi from './hapi-types';\nimport {\n HapiLayerType,\n HapiLifecycleMethodNames,\n type HapiPluginObject,\n type PatchableExtMethod,\n type ServerExtDirectInput,\n} from './internal-types';\nimport { AttributeNames } from './enums/AttributeNames';\n\nexport function getPluginName<T>(plugin: Hapi.Plugin<T>): string {\n if ((plugin as Hapi.PluginNameVersion).name) {\n return (plugin as Hapi.PluginNameVersion).name;\n } else {\n return (plugin as Hapi.PluginPackage).pkg.name;\n }\n}\n\nexport const isLifecycleExtType = (variableToCheck: unknown): variableToCheck is Hapi.ServerRequestExtType => {\n return typeof variableToCheck === 'string' && HapiLifecycleMethodNames.has(variableToCheck);\n};\n\nexport const isLifecycleExtEventObj = (\n variableToCheck: unknown,\n): variableToCheck is Hapi.ServerExtEventsRequestObject => {\n const event = (variableToCheck as Hapi.ServerExtEventsRequestObject)?.type;\n return event !== undefined && isLifecycleExtType(event);\n};\n\nexport const isDirectExtInput = (variableToCheck: unknown): variableToCheck is ServerExtDirectInput => {\n return (\n Array.isArray(variableToCheck) &&\n variableToCheck.length <= 3 &&\n isLifecycleExtType(variableToCheck[0]) &&\n typeof variableToCheck[1] === 'function'\n );\n};\n\nexport const isPatchableExtMethod = (\n variableToCheck: PatchableExtMethod | PatchableExtMethod[],\n): variableToCheck is PatchableExtMethod => {\n return !Array.isArray(variableToCheck);\n};\n\nexport const getRouteMetadata = (\n route: Hapi.ServerRoute,\n pluginName?: string,\n): {\n attributes: Attributes;\n name: string;\n} => {\n const attributes: Attributes = {\n [ATTR_HTTP_ROUTE]: route.path,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_HTTP_METHOD]: route.method,\n };\n\n let name;\n if (pluginName) {\n attributes[AttributeNames.HAPI_TYPE] = HapiLayerType.PLUGIN;\n attributes[AttributeNames.PLUGIN_NAME] = pluginName;\n name = `${pluginName}: route - ${route.path}`;\n } else {\n attributes[AttributeNames.HAPI_TYPE] = HapiLayerType.ROUTER;\n name = `route - ${route.path}`;\n }\n\n return { attributes, name };\n};\n\nexport const getExtMetadata = (\n extPoint: Hapi.ServerRequestExtType,\n pluginName?: string,\n methodName?: string,\n): {\n attributes: Attributes;\n name: string;\n} => {\n let baseName = `ext - ${extPoint}`;\n if (methodName && methodName !== 'method') {\n // method is the default name for the extension in the ServerExtEventsObject format.\n baseName = `ext - ${extPoint} - ${methodName}`;\n }\n if (pluginName) {\n return {\n attributes: {\n [AttributeNames.EXT_TYPE]: extPoint,\n [AttributeNames.HAPI_TYPE]: HapiLayerType.EXT,\n [AttributeNames.PLUGIN_NAME]: pluginName,\n },\n name: `${pluginName}: ${baseName}`,\n };\n }\n return {\n attributes: {\n [AttributeNames.EXT_TYPE]: extPoint,\n [AttributeNames.HAPI_TYPE]: HapiLayerType.EXT,\n },\n name: baseName,\n };\n};\n\nexport const getPluginFromInput = <T>(pluginObj: HapiPluginObject<T>): Hapi.Plugin<T, void> => {\n if ('plugin' in pluginObj) {\n if ('plugin' in pluginObj.plugin) {\n return pluginObj.plugin.plugin;\n }\n return pluginObj.plugin;\n }\n return pluginObj;\n};\n"],"names":[],"mappings":";;;;;AAuBO,SAAS,cAAiB,MAAA,EAAgC;AAC/D,EAAA,IAAK,OAAkC,IAAA,EAAM;AAC3C,IAAA,OAAQ,MAAA,CAAkC,IAAA;AAAA,EAC5C,CAAA,MAAO;AACL,IAAA,OAAQ,OAA8B,GAAA,CAAI,IAAA;AAAA,EAC5C;AACF;AAEO,MAAM,kBAAA,GAAqB,CAAC,eAAA,KAA2E;AAC5G,EAAA,OAAO,OAAO,eAAA,KAAoB,QAAA,IAAY,wBAAA,CAAyB,IAAI,eAAe,CAAA;AAC5F;AAEO,MAAM,sBAAA,GAAyB,CACpC,eAAA,KACyD;AACzD,EAAA,MAAM,QAAS,eAAA,EAAuD,IAAA;AACtE,EAAA,OAAO,KAAA,KAAU,MAAA,IAAa,kBAAA,CAAmB,KAAK,CAAA;AACxD;AAEO,MAAM,gBAAA,GAAmB,CAAC,eAAA,KAAsE;AACrG,EAAA,OACE,KAAA,CAAM,OAAA,CAAQ,eAAe,CAAA,IAC7B,gBAAgB,MAAA,IAAU,CAAA,IAC1B,kBAAA,CAAmB,eAAA,CAAgB,CAAC,CAAC,CAAA,IACrC,OAAO,eAAA,CAAgB,CAAC,CAAA,KAAM,UAAA;AAElC;AAEO,MAAM,oBAAA,GAAuB,CAClC,eAAA,KAC0C;AAC1C,EAAA,OAAO,CAAC,KAAA,CAA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AChC;AAAA,MACA,IAAA,EAAM,CAAA,EAAG,UAAU,CAAA,EAAA,EAAK,QAAQ,CAAA;AAAA,KAClC;AAAA,EACF;AACA,EAAA,OAAO;AAAA,IACL,UAAA,EAAY;AAAA,MACV,CAAC,cAAA,CAAe,QAAQ,GAAG,QAAA;AAAA,MAC3B,CAAC,cAAA,CAAe,SAAS,GAAG,aAAA,CAAc;AAAA,KAC5C;AAAA,IACA,IAAA,EAAM;AAAA,GACR;AACF;AAEO,MAAM,kBAAA,GAAqB,CAAI,SAAA,KAAyD;AAC7F,EAAA,IAAI,YAAY,SAAA,EAAW;AACzB,IAAA,IAAI,QAAA,IAAY,UAAU,MAAA,EAAQ;AAChC,MAAA,OAAO,UAAU,MAAA,CAAO,MAAA;AAAA,IAC1B;AACA,IAAA,OAAO,SAAA,CAAU,MAAA;AAAA,EACnB;AACA,EAAA,OAAO,SAAA;AACT;;;;"}
@@ -32,6 +32,7 @@ function getAutoPerformanceIntegrations() {
32
32
  expressIntegration(),
33
33
  fastifyIntegration(),
34
34
  graphqlIntegration(),
35
+ // eslint-disable-next-line typescript/no-deprecated
35
36
  honoIntegration(),
36
37
  mongoIntegration(),
37
38
  mongooseIntegration(),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { instrumentSentryHttp } from '../http';\nimport { amqplibIntegration, instrumentAmqplib } from './amqplib';\nimport { anthropicAIIntegration, instrumentAnthropicAi } from './anthropic-ai';\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress } from './express';\nimport { fastifyIntegration, instrumentFastify, instrumentFastifyV3 } from './fastify';\nimport { firebaseIntegration, instrumentFirebase } from './firebase';\nimport { genericPoolIntegration, instrumentGenericPool } from './genericPool';\nimport { googleGenAIIntegration, instrumentGoogleGenAI } from './google-genai';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { honoIntegration, instrumentHono } from './hono';\nimport { instrumentKafka, kafkaIntegration } from './kafka';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentLangChain, langChainIntegration } from './langchain';\nimport { instrumentLangGraph, langGraphIntegration } from './langgraph';\nimport { instrumentLruMemoizer, lruMemoizerIntegration } from './lrumemoizer';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentOpenAi, openAIIntegration } from './openai';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { instrumentPostgresJs, postgresJsIntegration } from './postgresjs';\nimport { prismaIntegration } from './prisma';\nimport { instrumentRedis, redisIntegration } from './redis';\nimport { instrumentTedious, tediousIntegration } from './tedious';\nimport { instrumentVercelAi, vercelAIIntegration } from './vercelai';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n honoIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n tediousIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n // AI providers\n // LangChain must come first to disable AI provider integrations before they instrument\n langChainIntegration(),\n langGraphIntegration(),\n vercelAIIntegration(),\n openAIIntegration(),\n anthropicAIIntegration(),\n googleGenAIIntegration(),\n postgresJsIntegration(),\n firebaseIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentSentryHttp,\n instrumentExpress,\n instrumentConnect,\n instrumentFastify,\n instrumentFastifyV3,\n instrumentHapi,\n instrumentHono,\n instrumentKafka,\n instrumentKoa,\n instrumentLruMemoizer,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n instrumentRedis,\n instrumentTedious,\n instrumentGenericPool,\n instrumentAmqplib,\n instrumentLangChain,\n instrumentVercelAi,\n instrumentOpenAi,\n instrumentPostgresJs,\n instrumentFirebase,\n instrumentAnthropicAi,\n instrumentGoogleGenAI,\n instrumentLangGraph,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCO,SAAS,8BAAA,GAAgD;AAC9D,EAAA,OAAO;AAAA,IACL,kBAAA,EAAmB;AAAA,IACnB,kBAAA,EAAmB;AAAA,IACnB,kBAAA,EAAmB;AAAA,IACnB,eAAA,EAAgB;AAAA,IAChB,gBAAA,EAAiB;AAAA,IACjB,mBAAA,EAAoB;AAAA,IACpB,gBAAA,EAAiB;AAAA,IACjB,iBAAA,EAAkB;AAAA,IAClB,gBAAA,EAAiB;AAAA,IACjB,mBAAA,EAAoB;AAAA,IACpB,iBAAA,EAAkB;AAAA,IAClB,eAAA,EAAgB;AAAA,IAChB,cAAA,EAAe;AAAA,IACf,kBAAA,EAAmB;AAAA,IACnB,kBAAA,EAAmB;AAAA,IACnB,sBAAA,EAAuB;AAAA,IACvB,gBAAA,EAAiB;AAAA,IACjB,kBAAA,EAAmB;AAAA,IACnB,sBAAA,EAAuB;AAAA;AAAA;AAAA,IAGvB,oBAAA,EAAqB;AAAA,IACrB,oBAAA,EAAqB;AAAA,IACrB,mBAAA,EAAoB;AAAA,IACpB,iBAAA,EAAkB;AAAA,IAClB,sBAAA,EAAuB;AAAA,IACvB,sBAAA,EAAuB;AAAA,IACvB,qBAAA,EAAsB;AAAA,IACtB,mBAAA;AAAoB,GACtB;AACF;AAMO,SAAS,wCAAA,GAA2F;AACzG,EAAA,OAAO;AAAA,IACL,oBAAA;AAAA,IACA,iBAAA;AAAA,IACA,iBAAA;AAAA,IACA,iBAAA;AAAA,IACA,mBAAA;AAAA,IACA,cAAA;AAAA,IACA,cAAA;AAAA,IACA,eAAA;AAAA,IACA,aAAA;AAAA,IACA,qBAAA;AAAA,IACA,eAAA;AAAA,IACA,kBAAA;AAAA,IACA,eAAA;AAAA,IACA,gBAAA;AAAA,IACA,kBAAA;AAAA,IACA,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,eAAA;AAAA,IACA,iBAAA;AAAA,IACA,qBAAA;AAAA,IACA,iBAAA;AAAA,IACA,mBAAA;AAAA,IACA,kBAAA;AAAA,IACA,gBAAA;AAAA,IACA,oBAAA;AAAA,IACA,kBAAA;AAAA,IACA,qBAAA;AAAA,IACA,qBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { instrumentSentryHttp } from '../http';\nimport { amqplibIntegration, instrumentAmqplib } from './amqplib';\nimport { anthropicAIIntegration, instrumentAnthropicAi } from './anthropic-ai';\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress } from './express';\nimport { fastifyIntegration, instrumentFastify, instrumentFastifyV3 } from './fastify';\nimport { firebaseIntegration, instrumentFirebase } from './firebase';\nimport { genericPoolIntegration, instrumentGenericPool } from './genericPool';\nimport { googleGenAIIntegration, instrumentGoogleGenAI } from './google-genai';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { honoIntegration, instrumentHono } from './hono';\nimport { instrumentKafka, kafkaIntegration } from './kafka';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentLangChain, langChainIntegration } from './langchain';\nimport { instrumentLangGraph, langGraphIntegration } from './langgraph';\nimport { instrumentLruMemoizer, lruMemoizerIntegration } from './lrumemoizer';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentOpenAi, openAIIntegration } from './openai';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { instrumentPostgresJs, postgresJsIntegration } from './postgresjs';\nimport { prismaIntegration } from './prisma';\nimport { instrumentRedis, redisIntegration } from './redis';\nimport { instrumentTedious, tediousIntegration } from './tedious';\nimport { instrumentVercelAi, vercelAIIntegration } from './vercelai';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n // eslint-disable-next-line typescript/no-deprecated\n honoIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n tediousIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n // AI providers\n // LangChain must come first to disable AI provider integrations before they instrument\n langChainIntegration(),\n langGraphIntegration(),\n vercelAIIntegration(),\n openAIIntegration(),\n anthropicAIIntegration(),\n googleGenAIIntegration(),\n postgresJsIntegration(),\n firebaseIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentSentryHttp,\n instrumentExpress,\n instrumentConnect,\n instrumentFastify,\n instrumentFastifyV3,\n instrumentHapi,\n instrumentHono,\n instrumentKafka,\n instrumentKoa,\n instrumentLruMemoizer,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n instrumentRedis,\n instrumentTedious,\n instrumentGenericPool,\n instrumentAmqplib,\n instrumentLangChain,\n instrumentVercelAi,\n instrumentOpenAi,\n instrumentPostgresJs,\n instrumentFirebase,\n instrumentAnthropicAi,\n instrumentGoogleGenAI,\n instrumentLangGraph,\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCO,SAAS,8BAAA,GAAgD;AAC9D,EAAA,OAAO;AAAA,IACL,kBAAA,EAAmB;AAAA,IACnB,kBAAA,EAAmB;AAAA,IACnB,kBAAA,EAAmB;AAAA;AAAA,IAEnB,eAAA,EAAgB;AAAA,IAChB,gBAAA,EAAiB;AAAA,IACjB,mBAAA,EAAoB;AAAA,IACpB,gBAAA,EAAiB;AAAA,IACjB,iBAAA,EAAkB;AAAA,IAClB,gBAAA,EAAiB;AAAA,IACjB,mBAAA,EAAoB;AAAA,IACpB,iBAAA,EAAkB;AAAA,IAClB,eAAA,EAAgB;AAAA,IAChB,cAAA,EAAe;AAAA,IACf,kBAAA,EAAmB;AAAA,IACnB,kBAAA,EAAmB;AAAA,IACnB,sBAAA,EAAuB;AAAA,IACvB,gBAAA,EAAiB;AAAA,IACjB,kBAAA,EAAmB;AAAA,IACnB,sBAAA,EAAuB;AAAA;AAAA;AAAA,IAGvB,oBAAA,EAAqB;AAAA,IACrB,oBAAA,EAAqB;AAAA,IACrB,mBAAA,EAAoB;AAAA,IACpB,iBAAA,EAAkB;AAAA,IAClB,sBAAA,EAAuB;AAAA,IACvB,sBAAA,EAAuB;AAAA,IACvB,qBAAA,EAAsB;AAAA,IACtB,mBAAA;AAAoB,GACtB;AACF;AAMO,SAAS,wCAAA,GAA2F;AACzG,EAAA,OAAO;AAAA,IACL,oBAAA;AAAA,IACA,iBAAA;AAAA,IACA,iBAAA;AAAA,IACA,iBAAA;AAAA,IACA,mBAAA;AAAA,IACA,cAAA;AAAA,IACA,cAAA;AAAA,IACA,eAAA;AAAA,IACA,aAAA;AAAA,IACA,qBAAA;AAAA,IACA,eAAA;AAAA,IACA,kBAAA;AAAA,IACA,eAAA;AAAA,IACA,gBAAA;AAAA,IACA,kBAAA;AAAA,IACA,cAAA;AAAA,IACA,iBAAA;AAAA,IACA,eAAA;AAAA,IACA,iBAAA;AAAA,IACA,qBAAA;AAAA,IACA,iBAAA;AAAA,IACA,mBAAA;AAAA,IACA,kBAAA;AAAA,IACA,gBAAA;AAAA,IACA,oBAAA;AAAA,IACA,kBAAA;AAAA,IACA,qBAAA;AAAA,IACA,qBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\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 * - Some types vendored from kafkajs with simplifications\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable */\n\nimport {\n Attributes,\n Context,\n context,\n Counter,\n Histogram,\n Link,\n propagation,\n ROOT_CONTEXT,\n Span,\n SpanKind,\n SpanStatusCode,\n trace,\n} from '@opentelemetry/api';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport {\n ATTR_ERROR_TYPE,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n ERROR_TYPE_VALUE_OTHER,\n} from '@opentelemetry/semantic-conventions';\nimport type { Kafka, Transaction, Producer, ConsumerEvents, ProducerEvents, RequestEvent } from './kafkajs-types';\nimport type {\n Consumer,\n ConsumerRunConfig,\n EachBatchHandler,\n EachMessageHandler,\n KafkaMessage,\n Message,\n RecordMetadata,\n} from './kafkajs-types';\nimport { EVENT_LISTENERS_SET } from './internal-types';\nimport { bufferTextMapGetter } from './propagator';\nimport {\n ATTR_MESSAGING_BATCH_MESSAGE_COUNT,\n ATTR_MESSAGING_DESTINATION_NAME,\n ATTR_MESSAGING_DESTINATION_PARTITION_ID,\n ATTR_MESSAGING_KAFKA_MESSAGE_KEY,\n ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE,\n ATTR_MESSAGING_KAFKA_OFFSET,\n ATTR_MESSAGING_OPERATION_NAME,\n ATTR_MESSAGING_OPERATION_TYPE,\n ATTR_MESSAGING_SYSTEM,\n MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,\n MESSAGING_OPERATION_TYPE_VALUE_SEND,\n MESSAGING_SYSTEM_VALUE_KAFKA,\n METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES,\n METRIC_MESSAGING_CLIENT_OPERATION_DURATION,\n METRIC_MESSAGING_CLIENT_SENT_MESSAGES,\n METRIC_MESSAGING_PROCESS_DURATION,\n} from './semconv';\nimport { KafkaJsInstrumentationConfig } from './types';\n\ninterface ConsumerSpanOptions {\n topic: string;\n message: KafkaMessage | undefined;\n operationType: string;\n attributes: Attributes;\n ctx?: Context | undefined;\n link?: Link;\n}\nimport { SDK_VERSION } from '@sentry/core';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-kafkajs';\n\n// This interface acts as a strict subset of the KafkaJS Consumer and\n// Producer interfaces (just for the event we're needing)\ninterface KafkaEventEmitter {\n on(eventName: ConsumerEvents['REQUEST'] | ProducerEvents['REQUEST'], listener: (event: RequestEvent) => void): void;\n events: {\n REQUEST: ConsumerEvents['REQUEST'] | ProducerEvents['REQUEST'];\n };\n [EVENT_LISTENERS_SET]?: boolean;\n}\n\ninterface StandardAttributes<OP extends string = string> extends Attributes {\n [ATTR_MESSAGING_SYSTEM]: string;\n [ATTR_MESSAGING_OPERATION_NAME]: OP;\n [ATTR_ERROR_TYPE]?: string;\n}\ninterface TopicAttributes {\n [ATTR_MESSAGING_DESTINATION_NAME]: string;\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]?: string;\n}\n\ninterface ClientDurationAttributes extends StandardAttributes, Partial<TopicAttributes> {\n [ATTR_SERVER_ADDRESS]: string;\n [ATTR_SERVER_PORT]: number;\n [ATTR_MESSAGING_OPERATION_TYPE]?: string;\n}\ninterface SentMessagesAttributes extends StandardAttributes<'send'>, TopicAttributes {\n [ATTR_ERROR_TYPE]?: string;\n}\ntype ConsumedMessagesAttributes = StandardAttributes<'receive' | 'process'>;\ninterface MessageProcessDurationAttributes extends StandardAttributes<'process'>, TopicAttributes {\n [ATTR_MESSAGING_SYSTEM]: string;\n [ATTR_MESSAGING_OPERATION_NAME]: 'process';\n [ATTR_ERROR_TYPE]?: string;\n}\ntype RecordPendingMetric = (errorType?: string | undefined) => void;\n\nfunction prepareCounter<T extends Attributes>(meter: Counter<T>, value: number, attributes: T): RecordPendingMetric {\n return (errorType?: string | undefined) => {\n meter.add(value, {\n ...attributes,\n ...(errorType ? { [ATTR_ERROR_TYPE]: errorType } : {}),\n });\n };\n}\n\nfunction prepareDurationHistogram<T extends Attributes>(\n meter: Histogram<T>,\n value: number,\n attributes: T,\n): RecordPendingMetric {\n return (errorType?: string | undefined) => {\n meter.record((Date.now() - value) / 1000, {\n ...attributes,\n ...(errorType ? { [ATTR_ERROR_TYPE]: errorType } : {}),\n });\n };\n}\n\nconst HISTOGRAM_BUCKET_BOUNDARIES = [0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10];\nexport class KafkaJsInstrumentation extends InstrumentationBase<KafkaJsInstrumentationConfig> {\n declare private _clientDuration: Histogram<ClientDurationAttributes>;\n declare private _sentMessages: Counter<SentMessagesAttributes>;\n declare private _consumedMessages: Counter<ConsumedMessagesAttributes>;\n declare private _processDuration: Histogram<MessageProcessDurationAttributes>;\n\n constructor(config: KafkaJsInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n override _updateMetricInstruments() {\n this._clientDuration = this.meter.createHistogram(METRIC_MESSAGING_CLIENT_OPERATION_DURATION, {\n advice: { explicitBucketBoundaries: HISTOGRAM_BUCKET_BOUNDARIES },\n });\n this._sentMessages = this.meter.createCounter(METRIC_MESSAGING_CLIENT_SENT_MESSAGES);\n this._consumedMessages = this.meter.createCounter(METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES);\n this._processDuration = this.meter.createHistogram(METRIC_MESSAGING_PROCESS_DURATION, {\n advice: { explicitBucketBoundaries: HISTOGRAM_BUCKET_BOUNDARIES },\n });\n }\n\n protected init() {\n const unpatch = (moduleExports: any) => {\n if (isWrapped(moduleExports?.Kafka?.prototype.producer)) {\n this._unwrap(moduleExports.Kafka.prototype, 'producer');\n }\n if (isWrapped(moduleExports?.Kafka?.prototype.consumer)) {\n this._unwrap(moduleExports.Kafka.prototype, 'consumer');\n }\n };\n\n const module = new InstrumentationNodeModuleDefinition(\n 'kafkajs',\n ['>=0.3.0 <3'],\n (moduleExports: any) => {\n unpatch(moduleExports);\n this._wrap(moduleExports?.Kafka?.prototype, 'producer', this._getProducerPatch());\n this._wrap(moduleExports?.Kafka?.prototype, 'consumer', this._getConsumerPatch());\n\n return moduleExports;\n },\n unpatch,\n );\n return module;\n }\n\n private _getConsumerPatch() {\n const instrumentation = this;\n return (original: Kafka['consumer']) => {\n return function consumer(this: Kafka, ...args: Parameters<Kafka['consumer']>) {\n const newConsumer: Consumer = original.apply(this, args);\n\n if (isWrapped(newConsumer.run)) {\n instrumentation._unwrap(newConsumer, 'run');\n }\n\n instrumentation._wrap(newConsumer, 'run', instrumentation._getConsumerRunPatch());\n\n instrumentation._setKafkaEventListeners(newConsumer);\n\n return newConsumer;\n };\n };\n }\n\n private _setKafkaEventListeners(kafkaObj: KafkaEventEmitter) {\n if (kafkaObj[EVENT_LISTENERS_SET]) return;\n\n // The REQUEST Consumer event was added in kafkajs@1.5.0.\n if (kafkaObj.events?.REQUEST) {\n kafkaObj.on(kafkaObj.events.REQUEST, this._recordClientDurationMetric.bind(this));\n }\n\n kafkaObj[EVENT_LISTENERS_SET] = true;\n }\n\n private _recordClientDurationMetric(event: Pick<RequestEvent, 'payload'>) {\n const [address = '', port = '0'] = event.payload.broker.split(':');\n this._clientDuration.record(event.payload.duration / 1000, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: `${event.payload.apiName}`,\n [ATTR_SERVER_ADDRESS]: address,\n [ATTR_SERVER_PORT]: Number.parseInt(port, 10),\n });\n }\n\n private _getProducerPatch() {\n const instrumentation = this;\n return (original: Kafka['producer']) => {\n return function consumer(this: Kafka, ...args: Parameters<Kafka['producer']>) {\n const newProducer: Producer = original.apply(this, args);\n\n if (isWrapped(newProducer.sendBatch)) {\n instrumentation._unwrap(newProducer, 'sendBatch');\n }\n instrumentation._wrap(newProducer, 'sendBatch', instrumentation._getSendBatchPatch());\n\n if (isWrapped(newProducer.send)) {\n instrumentation._unwrap(newProducer, 'send');\n }\n instrumentation._wrap(newProducer, 'send', instrumentation._getSendPatch());\n\n if (isWrapped(newProducer.transaction)) {\n instrumentation._unwrap(newProducer, 'transaction');\n }\n instrumentation._wrap(newProducer, 'transaction', instrumentation._getProducerTransactionPatch());\n\n instrumentation._setKafkaEventListeners(newProducer);\n\n return newProducer;\n };\n };\n }\n\n private _getConsumerRunPatch() {\n const instrumentation = this;\n return (original: Consumer['run']) => {\n return function run(this: Consumer, ...args: Parameters<Consumer['run']>): ReturnType<Consumer['run']> {\n const config = args[0];\n if (config?.eachMessage) {\n if (isWrapped(config.eachMessage)) {\n instrumentation._unwrap(config, 'eachMessage');\n }\n instrumentation._wrap(config, 'eachMessage', instrumentation._getConsumerEachMessagePatch());\n }\n if (config?.eachBatch) {\n if (isWrapped(config.eachBatch)) {\n instrumentation._unwrap(config, 'eachBatch');\n }\n instrumentation._wrap(config, 'eachBatch', instrumentation._getConsumerEachBatchPatch());\n }\n return original.call(this, config);\n };\n };\n }\n\n private _getConsumerEachMessagePatch() {\n const instrumentation = this;\n return (original: ConsumerRunConfig['eachMessage']) => {\n return function eachMessage(this: unknown, ...args: Parameters<EachMessageHandler>): Promise<void> {\n const payload = args[0];\n const propagatedContext: Context = propagation.extract(\n ROOT_CONTEXT,\n payload.message.headers,\n bufferTextMapGetter,\n );\n const span = instrumentation._startConsumerSpan({\n topic: payload.topic,\n message: payload.message,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n ctx: propagatedContext,\n attributes: {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition),\n },\n });\n\n const pendingMetrics: RecordPendingMetric[] = [\n prepareDurationHistogram(instrumentation._processDuration, Date.now(), {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'process',\n [ATTR_MESSAGING_DESTINATION_NAME]: payload.topic,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition),\n }),\n prepareCounter(instrumentation._consumedMessages, 1, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'process',\n [ATTR_MESSAGING_DESTINATION_NAME]: payload.topic,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition),\n }),\n ];\n\n const eachMessagePromise = context.with(trace.setSpan(propagatedContext, span), () => {\n return original!.apply(this, args);\n });\n return instrumentation._endSpansOnPromise([span], pendingMetrics, eachMessagePromise);\n };\n };\n }\n\n private _getConsumerEachBatchPatch() {\n return (original: ConsumerRunConfig['eachBatch']) => {\n const instrumentation = this;\n return function eachBatch(this: unknown, ...args: Parameters<EachBatchHandler>): Promise<void> {\n const payload = args[0];\n // https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#topic-with-multiple-consumers\n const receivingSpan = instrumentation._startConsumerSpan({\n topic: payload.batch.topic,\n message: undefined,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,\n ctx: ROOT_CONTEXT,\n attributes: {\n [ATTR_MESSAGING_BATCH_MESSAGE_COUNT]: payload.batch.messages.length,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition),\n },\n });\n return context.with(trace.setSpan(context.active(), receivingSpan), () => {\n const startTime = Date.now();\n const spans: Span[] = [];\n const pendingMetrics: RecordPendingMetric[] = [\n prepareCounter(instrumentation._consumedMessages, payload.batch.messages.length, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'process',\n [ATTR_MESSAGING_DESTINATION_NAME]: payload.batch.topic,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition),\n }),\n ];\n payload.batch.messages.forEach((message: any) => {\n const propagatedContext: Context = propagation.extract(ROOT_CONTEXT, message.headers, bufferTextMapGetter);\n const spanContext = trace.getSpan(propagatedContext)?.spanContext();\n let origSpanLink: Link | undefined;\n if (spanContext) {\n origSpanLink = {\n context: spanContext,\n };\n }\n spans.push(\n instrumentation._startConsumerSpan({\n topic: payload.batch.topic,\n message,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n link: origSpanLink,\n attributes: {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition),\n },\n }),\n );\n pendingMetrics.push(\n prepareDurationHistogram(instrumentation._processDuration, startTime, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'process',\n [ATTR_MESSAGING_DESTINATION_NAME]: payload.batch.topic,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition),\n }),\n );\n });\n const batchMessagePromise: Promise<void> = original!.apply(this, args);\n spans.unshift(receivingSpan);\n return instrumentation._endSpansOnPromise(spans, pendingMetrics, batchMessagePromise);\n });\n };\n };\n }\n\n private _getProducerTransactionPatch() {\n const instrumentation = this;\n return (original: Producer['transaction']) => {\n return function transaction(\n this: Producer,\n ...args: Parameters<Producer['transaction']>\n ): ReturnType<Producer['transaction']> {\n const transactionSpan = instrumentation.tracer.startSpan('transaction');\n\n const transactionPromise = original.apply(this, args);\n\n transactionPromise\n .then((transaction: Transaction) => {\n const originalSend = transaction.send;\n transaction.send = function send(this: Transaction, ...args) {\n return context.with(trace.setSpan(context.active(), transactionSpan), () => {\n const patched = instrumentation._getSendPatch()(originalSend);\n return patched.apply(this, args).catch((err: any) => {\n transactionSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: err?.message,\n });\n transactionSpan.recordException(err);\n throw err;\n });\n });\n };\n\n const originalSendBatch = transaction.sendBatch;\n transaction.sendBatch = function sendBatch(this: Transaction, ...args) {\n return context.with(trace.setSpan(context.active(), transactionSpan), () => {\n const patched = instrumentation._getSendBatchPatch()(originalSendBatch);\n return patched.apply(this, args).catch((err: any) => {\n transactionSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: err?.message,\n });\n transactionSpan.recordException(err);\n throw err;\n });\n });\n };\n\n const originalCommit = transaction.commit;\n transaction.commit = function commit(this: Transaction, ...args) {\n const originCommitPromise = originalCommit.apply(this, args).then(() => {\n transactionSpan.setStatus({ code: SpanStatusCode.OK });\n });\n return instrumentation._endSpansOnPromise([transactionSpan], [], originCommitPromise);\n };\n\n const originalAbort = transaction.abort;\n transaction.abort = function abort(this: Transaction, ...args) {\n const originAbortPromise = originalAbort.apply(this, args);\n return instrumentation._endSpansOnPromise([transactionSpan], [], originAbortPromise);\n };\n })\n .catch((err: any) => {\n transactionSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: err?.message,\n });\n transactionSpan.recordException(err);\n transactionSpan.end();\n });\n\n return transactionPromise;\n };\n };\n }\n\n private _getSendBatchPatch() {\n const instrumentation = this;\n return (original: Producer['sendBatch'] | Transaction['sendBatch']) => {\n return function sendBatch(\n this: Producer | Transaction,\n ...args: Parameters<Producer['sendBatch']>\n ): ReturnType<Producer['sendBatch']> {\n const batch = args[0];\n const messages = batch.topicMessages || [];\n\n const spans: Span[] = [];\n const pendingMetrics: RecordPendingMetric[] = [];\n\n messages.forEach((topicMessage: any) => {\n topicMessage.messages.forEach((message: any) => {\n spans.push(instrumentation._startProducerSpan(topicMessage.topic, message));\n pendingMetrics.push(\n prepareCounter(instrumentation._sentMessages, 1, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'send',\n [ATTR_MESSAGING_DESTINATION_NAME]: topicMessage.topic,\n ...(message.partition !== undefined\n ? {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(message.partition),\n }\n : {}),\n }),\n );\n });\n });\n const origSendResult: Promise<RecordMetadata[]> = original.apply(this, args);\n return instrumentation._endSpansOnPromise(spans, pendingMetrics, origSendResult);\n };\n };\n }\n\n private _getSendPatch() {\n const instrumentation = this;\n return (original: Producer['send'] | Transaction['send']) => {\n return function send(\n this: Producer | Transaction,\n ...args: Parameters<Producer['send']>\n ): ReturnType<Producer['send']> {\n const record = args[0];\n const spans: Span[] = record.messages.map((message: any) => {\n return instrumentation._startProducerSpan(record.topic, message);\n });\n\n const pendingMetrics: RecordPendingMetric[] = record.messages.map((m: any) =>\n prepareCounter(instrumentation._sentMessages, 1, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'send',\n [ATTR_MESSAGING_DESTINATION_NAME]: record.topic,\n ...(m.partition !== undefined\n ? {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(m.partition),\n }\n : {}),\n }),\n );\n const origSendResult: Promise<RecordMetadata[]> = original.apply(this, args);\n return instrumentation._endSpansOnPromise(spans, pendingMetrics, origSendResult);\n };\n };\n }\n\n private _endSpansOnPromise<T>(\n spans: Span[],\n pendingMetrics: RecordPendingMetric[],\n sendPromise: Promise<T>,\n ): Promise<T> {\n return Promise.resolve(sendPromise)\n .then(result => {\n pendingMetrics.forEach(m => m());\n return result;\n })\n .catch(reason => {\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' && Object.prototype.hasOwnProperty.call(reason, 'message')) {\n errorMessage = reason.message;\n errorType = reason.constructor.name;\n }\n pendingMetrics.forEach(m => m(errorType));\n\n spans.forEach(span => {\n span.setAttribute(ATTR_ERROR_TYPE, errorType);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: errorMessage,\n });\n });\n\n throw reason;\n })\n .finally(() => {\n spans.forEach(span => span.end());\n });\n }\n\n private _startConsumerSpan({ topic, message, operationType, ctx, link, attributes }: ConsumerSpanOptions) {\n const operationName =\n operationType === MESSAGING_OPERATION_TYPE_VALUE_RECEIVE\n ? 'poll' // for batch processing spans\n : operationType; // for individual message processing spans\n\n const span = this.tracer.startSpan(\n `${operationName} ${topic}`,\n {\n kind: operationType === MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? SpanKind.CLIENT : SpanKind.CONSUMER,\n attributes: {\n ...attributes,\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_DESTINATION_NAME]: topic,\n [ATTR_MESSAGING_OPERATION_TYPE]: operationType,\n [ATTR_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,\n },\n links: link ? [link] : [],\n },\n ctx,\n );\n\n const { consumerHook } = this.getConfig();\n if (consumerHook && message) {\n safeExecuteInTheMiddle(\n () => consumerHook(span, { topic, message }),\n e => {\n if (e) this._diag.error('consumerHook error', e);\n },\n true,\n );\n }\n\n return span;\n }\n\n private _startProducerSpan(topic: string, message: Message) {\n const span = this.tracer.startSpan(`send ${topic}`, {\n kind: SpanKind.PRODUCER,\n attributes: {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_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 [ATTR_MESSAGING_OPERATION_NAME]: 'send',\n [ATTR_MESSAGING_OPERATION_TYPE]: MESSAGING_OPERATION_TYPE_VALUE_SEND,\n },\n });\n\n message.headers = message.headers ?? {};\n propagation.inject(trace.setSpan(context.active(), span), message.headers);\n\n const { producerHook } = this.getConfig();\n if (producerHook) {\n safeExecuteInTheMiddle(\n () => producerHook(span, { topic, message }),\n e => {\n if (e) this._diag.error('producerHook error', e);\n },\n true,\n );\n }\n\n return span;\n }\n}\n"],"names":["transaction","args"],"mappings":";;;;;;;;AA4FA,MAAM,YAAA,GAAe,iCAAA;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instrumentation.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 * - Some types vendored from kafkajs with simplifications\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable */\n\nimport {\n Attributes,\n Context,\n context,\n Counter,\n Histogram,\n Link,\n propagation,\n ROOT_CONTEXT,\n Span,\n SpanKind,\n SpanStatusCode,\n trace,\n} from '@opentelemetry/api';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n safeExecuteInTheMiddle,\n} from '@opentelemetry/instrumentation';\nimport {\n ATTR_ERROR_TYPE,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n ERROR_TYPE_VALUE_OTHER,\n} from '@opentelemetry/semantic-conventions';\nimport type { Kafka, Transaction, Producer, ConsumerEvents, ProducerEvents, RequestEvent } from './kafkajs-types';\nimport type {\n Consumer,\n ConsumerRunConfig,\n EachBatchHandler,\n EachMessageHandler,\n KafkaMessage,\n Message,\n RecordMetadata,\n} from './kafkajs-types';\nimport { EVENT_LISTENERS_SET } from './internal-types';\nimport { bufferTextMapGetter } from './propagator';\nimport {\n ATTR_MESSAGING_BATCH_MESSAGE_COUNT,\n ATTR_MESSAGING_DESTINATION_NAME,\n ATTR_MESSAGING_DESTINATION_PARTITION_ID,\n ATTR_MESSAGING_KAFKA_MESSAGE_KEY,\n ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE,\n ATTR_MESSAGING_KAFKA_OFFSET,\n ATTR_MESSAGING_OPERATION_NAME,\n ATTR_MESSAGING_OPERATION_TYPE,\n ATTR_MESSAGING_SYSTEM,\n MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,\n MESSAGING_OPERATION_TYPE_VALUE_SEND,\n MESSAGING_SYSTEM_VALUE_KAFKA,\n METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES,\n METRIC_MESSAGING_CLIENT_OPERATION_DURATION,\n METRIC_MESSAGING_CLIENT_SENT_MESSAGES,\n METRIC_MESSAGING_PROCESS_DURATION,\n} from './semconv';\nimport { KafkaJsInstrumentationConfig } from './types';\n\ninterface ConsumerSpanOptions {\n topic: string;\n message: KafkaMessage | undefined;\n operationType: string;\n attributes: Attributes;\n ctx?: Context | undefined;\n link?: Link;\n}\nimport { SDK_VERSION } from '@sentry/core';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-kafkajs';\n\n// This interface acts as a strict subset of the KafkaJS Consumer and\n// Producer interfaces (just for the event we're needing)\ninterface KafkaEventEmitter {\n on(eventName: ConsumerEvents['REQUEST'] | ProducerEvents['REQUEST'], listener: (event: RequestEvent) => void): void;\n events: {\n REQUEST: ConsumerEvents['REQUEST'] | ProducerEvents['REQUEST'];\n };\n [EVENT_LISTENERS_SET]?: boolean;\n}\n\ninterface StandardAttributes<OP extends string = string> extends Attributes {\n [ATTR_MESSAGING_SYSTEM]: string;\n [ATTR_MESSAGING_OPERATION_NAME]: OP;\n [ATTR_ERROR_TYPE]?: string;\n}\ninterface TopicAttributes {\n [ATTR_MESSAGING_DESTINATION_NAME]: string;\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]?: string;\n}\n\ninterface ClientDurationAttributes extends StandardAttributes, Partial<TopicAttributes> {\n [ATTR_SERVER_ADDRESS]: string;\n [ATTR_SERVER_PORT]: number;\n [ATTR_MESSAGING_OPERATION_TYPE]?: string;\n}\ninterface SentMessagesAttributes extends StandardAttributes<'send'>, TopicAttributes {\n [ATTR_ERROR_TYPE]?: string;\n}\ntype ConsumedMessagesAttributes = StandardAttributes<'receive' | 'process'>;\ninterface MessageProcessDurationAttributes extends StandardAttributes<'process'>, TopicAttributes {\n [ATTR_MESSAGING_SYSTEM]: string;\n [ATTR_MESSAGING_OPERATION_NAME]: 'process';\n [ATTR_ERROR_TYPE]?: string;\n}\ntype RecordPendingMetric = (errorType?: string | undefined) => void;\n\nfunction prepareCounter<T extends Attributes>(meter: Counter<T>, value: number, attributes: T): RecordPendingMetric {\n return (errorType?: string | undefined) => {\n meter.add(value, {\n ...attributes,\n ...(errorType ? { [ATTR_ERROR_TYPE]: errorType } : {}),\n });\n };\n}\n\nfunction prepareDurationHistogram<T extends Attributes>(\n meter: Histogram<T>,\n value: number,\n attributes: T,\n): RecordPendingMetric {\n return (errorType?: string | undefined) => {\n meter.record((Date.now() - value) / 1000, {\n ...attributes,\n ...(errorType ? { [ATTR_ERROR_TYPE]: errorType } : {}),\n });\n };\n}\n\nconst HISTOGRAM_BUCKET_BOUNDARIES = [0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10];\nexport class KafkaJsInstrumentation extends InstrumentationBase<KafkaJsInstrumentationConfig> {\n declare private _clientDuration: Histogram<ClientDurationAttributes>;\n declare private _sentMessages: Counter<SentMessagesAttributes>;\n declare private _consumedMessages: Counter<ConsumedMessagesAttributes>;\n declare private _processDuration: Histogram<MessageProcessDurationAttributes>;\n\n constructor(config: KafkaJsInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n override _updateMetricInstruments() {\n this._clientDuration = this.meter.createHistogram(METRIC_MESSAGING_CLIENT_OPERATION_DURATION, {\n advice: { explicitBucketBoundaries: HISTOGRAM_BUCKET_BOUNDARIES },\n });\n this._sentMessages = this.meter.createCounter(METRIC_MESSAGING_CLIENT_SENT_MESSAGES);\n this._consumedMessages = this.meter.createCounter(METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES);\n this._processDuration = this.meter.createHistogram(METRIC_MESSAGING_PROCESS_DURATION, {\n advice: { explicitBucketBoundaries: HISTOGRAM_BUCKET_BOUNDARIES },\n });\n }\n\n protected init() {\n const unpatch = (moduleExports: any) => {\n if (isWrapped(moduleExports?.Kafka?.prototype.producer)) {\n this._unwrap(moduleExports.Kafka.prototype, 'producer');\n }\n if (isWrapped(moduleExports?.Kafka?.prototype.consumer)) {\n this._unwrap(moduleExports.Kafka.prototype, 'consumer');\n }\n };\n\n const module = new InstrumentationNodeModuleDefinition(\n 'kafkajs',\n ['>=0.3.0 <3'],\n (moduleExports: any) => {\n unpatch(moduleExports);\n this._wrap(moduleExports?.Kafka?.prototype, 'producer', this._getProducerPatch());\n this._wrap(moduleExports?.Kafka?.prototype, 'consumer', this._getConsumerPatch());\n\n return moduleExports;\n },\n unpatch,\n );\n return module;\n }\n\n private _getConsumerPatch() {\n const instrumentation = this;\n return (original: Kafka['consumer']) => {\n return function consumer(this: Kafka, ...args: Parameters<Kafka['consumer']>) {\n const newConsumer: Consumer = original.apply(this, args);\n\n if (isWrapped(newConsumer.run)) {\n instrumentation._unwrap(newConsumer, 'run');\n }\n\n instrumentation._wrap(newConsumer, 'run', instrumentation._getConsumerRunPatch());\n\n instrumentation._setKafkaEventListeners(newConsumer);\n\n return newConsumer;\n };\n };\n }\n\n private _setKafkaEventListeners(kafkaObj: KafkaEventEmitter) {\n if (kafkaObj[EVENT_LISTENERS_SET]) return;\n\n // The REQUEST Consumer event was added in kafkajs@1.5.0.\n if (kafkaObj.events?.REQUEST) {\n kafkaObj.on(kafkaObj.events.REQUEST, this._recordClientDurationMetric.bind(this));\n }\n\n kafkaObj[EVENT_LISTENERS_SET] = true;\n }\n\n private _recordClientDurationMetric(event: Pick<RequestEvent, 'payload'>) {\n const [address = '', port = '0'] = event.payload.broker.split(':');\n this._clientDuration.record(event.payload.duration / 1000, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: `${event.payload.apiName}`,\n [ATTR_SERVER_ADDRESS]: address,\n [ATTR_SERVER_PORT]: Number.parseInt(port, 10),\n });\n }\n\n private _getProducerPatch() {\n const instrumentation = this;\n return (original: Kafka['producer']) => {\n return function consumer(this: Kafka, ...args: Parameters<Kafka['producer']>) {\n const newProducer: Producer = original.apply(this, args);\n\n if (isWrapped(newProducer.sendBatch)) {\n instrumentation._unwrap(newProducer, 'sendBatch');\n }\n instrumentation._wrap(newProducer, 'sendBatch', instrumentation._getSendBatchPatch());\n\n if (isWrapped(newProducer.send)) {\n instrumentation._unwrap(newProducer, 'send');\n }\n instrumentation._wrap(newProducer, 'send', instrumentation._getSendPatch());\n\n if (isWrapped(newProducer.transaction)) {\n instrumentation._unwrap(newProducer, 'transaction');\n }\n instrumentation._wrap(newProducer, 'transaction', instrumentation._getProducerTransactionPatch());\n\n instrumentation._setKafkaEventListeners(newProducer);\n\n return newProducer;\n };\n };\n }\n\n private _getConsumerRunPatch() {\n const instrumentation = this;\n return (original: Consumer['run']) => {\n return function run(this: Consumer, ...args: Parameters<Consumer['run']>): ReturnType<Consumer['run']> {\n const config = args[0];\n if (config?.eachMessage) {\n if (isWrapped(config.eachMessage)) {\n instrumentation._unwrap(config, 'eachMessage');\n }\n instrumentation._wrap(config, 'eachMessage', instrumentation._getConsumerEachMessagePatch());\n }\n if (config?.eachBatch) {\n if (isWrapped(config.eachBatch)) {\n instrumentation._unwrap(config, 'eachBatch');\n }\n instrumentation._wrap(config, 'eachBatch', instrumentation._getConsumerEachBatchPatch());\n }\n return original.call(this, config);\n };\n };\n }\n\n private _getConsumerEachMessagePatch() {\n const instrumentation = this;\n return (original: ConsumerRunConfig['eachMessage']) => {\n return function eachMessage(this: unknown, ...args: Parameters<EachMessageHandler>): Promise<void> {\n const payload = args[0];\n const propagatedContext: Context = propagation.extract(\n ROOT_CONTEXT,\n payload.message.headers,\n bufferTextMapGetter,\n );\n const span = instrumentation._startConsumerSpan({\n topic: payload.topic,\n message: payload.message,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n ctx: propagatedContext,\n attributes: {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition),\n },\n });\n\n const pendingMetrics: RecordPendingMetric[] = [\n prepareDurationHistogram(instrumentation._processDuration, Date.now(), {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'process',\n [ATTR_MESSAGING_DESTINATION_NAME]: payload.topic,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition),\n }),\n prepareCounter(instrumentation._consumedMessages, 1, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'process',\n [ATTR_MESSAGING_DESTINATION_NAME]: payload.topic,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition),\n }),\n ];\n\n const eachMessagePromise = context.with(trace.setSpan(propagatedContext, span), () => {\n return original!.apply(this, args);\n });\n return instrumentation._endSpansOnPromise([span], pendingMetrics, eachMessagePromise);\n };\n };\n }\n\n private _getConsumerEachBatchPatch() {\n return (original: ConsumerRunConfig['eachBatch']) => {\n const instrumentation = this;\n return function eachBatch(this: unknown, ...args: Parameters<EachBatchHandler>): Promise<void> {\n const payload = args[0];\n // https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/messaging.md#topic-with-multiple-consumers\n const receivingSpan = instrumentation._startConsumerSpan({\n topic: payload.batch.topic,\n message: undefined,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,\n ctx: ROOT_CONTEXT,\n attributes: {\n [ATTR_MESSAGING_BATCH_MESSAGE_COUNT]: payload.batch.messages.length,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition),\n },\n });\n return context.with(trace.setSpan(context.active(), receivingSpan), () => {\n const startTime = Date.now();\n const spans: Span[] = [];\n const pendingMetrics: RecordPendingMetric[] = [\n prepareCounter(instrumentation._consumedMessages, payload.batch.messages.length, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'process',\n [ATTR_MESSAGING_DESTINATION_NAME]: payload.batch.topic,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition),\n }),\n ];\n payload.batch.messages.forEach((message: any) => {\n const propagatedContext: Context = propagation.extract(ROOT_CONTEXT, message.headers, bufferTextMapGetter);\n const spanContext = trace.getSpan(propagatedContext)?.spanContext();\n let origSpanLink: Link | undefined;\n if (spanContext) {\n origSpanLink = {\n context: spanContext,\n };\n }\n spans.push(\n instrumentation._startConsumerSpan({\n topic: payload.batch.topic,\n message,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n link: origSpanLink,\n attributes: {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition),\n },\n }),\n );\n pendingMetrics.push(\n prepareDurationHistogram(instrumentation._processDuration, startTime, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'process',\n [ATTR_MESSAGING_DESTINATION_NAME]: payload.batch.topic,\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition),\n }),\n );\n });\n const batchMessagePromise: Promise<void> = original!.apply(this, args);\n spans.unshift(receivingSpan);\n return instrumentation._endSpansOnPromise(spans, pendingMetrics, batchMessagePromise);\n });\n };\n };\n }\n\n private _getProducerTransactionPatch() {\n const instrumentation = this;\n return (original: Producer['transaction']) => {\n return function transaction(\n this: Producer,\n ...args: Parameters<Producer['transaction']>\n ): ReturnType<Producer['transaction']> {\n const transactionSpan = instrumentation.tracer.startSpan('transaction');\n\n const transactionPromise = original.apply(this, args);\n\n transactionPromise\n .then((transaction: Transaction) => {\n const originalSend = transaction.send;\n transaction.send = function send(this: Transaction, ...args) {\n return context.with(trace.setSpan(context.active(), transactionSpan), () => {\n const patched = instrumentation._getSendPatch()(originalSend);\n return patched.apply(this, args).catch((err: any) => {\n transactionSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: err?.message,\n });\n transactionSpan.recordException(err);\n throw err;\n });\n });\n };\n\n const originalSendBatch = transaction.sendBatch;\n transaction.sendBatch = function sendBatch(this: Transaction, ...args) {\n return context.with(trace.setSpan(context.active(), transactionSpan), () => {\n const patched = instrumentation._getSendBatchPatch()(originalSendBatch);\n return patched.apply(this, args).catch((err: any) => {\n transactionSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: err?.message,\n });\n transactionSpan.recordException(err);\n throw err;\n });\n });\n };\n\n const originalCommit = transaction.commit;\n transaction.commit = function commit(this: Transaction, ...args) {\n const originCommitPromise = originalCommit.apply(this, args).then(() => {\n transactionSpan.setStatus({ code: SpanStatusCode.OK });\n });\n return instrumentation._endSpansOnPromise([transactionSpan], [], originCommitPromise);\n };\n\n const originalAbort = transaction.abort;\n transaction.abort = function abort(this: Transaction, ...args) {\n const originAbortPromise = originalAbort.apply(this, args);\n return instrumentation._endSpansOnPromise([transactionSpan], [], originAbortPromise);\n };\n })\n .catch((err: any) => {\n transactionSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message: err?.message,\n });\n transactionSpan.recordException(err);\n transactionSpan.end();\n });\n\n return transactionPromise;\n };\n };\n }\n\n private _getSendBatchPatch() {\n const instrumentation = this;\n return (original: Producer['sendBatch'] | Transaction['sendBatch']) => {\n return function sendBatch(\n this: Producer | Transaction,\n ...args: Parameters<Producer['sendBatch']>\n ): ReturnType<Producer['sendBatch']> {\n const batch = args[0];\n const messages = batch.topicMessages || [];\n\n const spans: Span[] = [];\n const pendingMetrics: RecordPendingMetric[] = [];\n\n messages.forEach((topicMessage: any) => {\n topicMessage.messages.forEach((message: any) => {\n spans.push(instrumentation._startProducerSpan(topicMessage.topic, message));\n pendingMetrics.push(\n prepareCounter(instrumentation._sentMessages, 1, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'send',\n [ATTR_MESSAGING_DESTINATION_NAME]: topicMessage.topic,\n ...(message.partition !== undefined\n ? {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(message.partition),\n }\n : {}),\n }),\n );\n });\n });\n const origSendResult: Promise<RecordMetadata[]> = original.apply(this, args);\n return instrumentation._endSpansOnPromise(spans, pendingMetrics, origSendResult);\n };\n };\n }\n\n private _getSendPatch() {\n const instrumentation = this;\n return (original: Producer['send'] | Transaction['send']) => {\n return function send(\n this: Producer | Transaction,\n ...args: Parameters<Producer['send']>\n ): ReturnType<Producer['send']> {\n const record = args[0];\n const spans: Span[] = record.messages.map((message: any) => {\n return instrumentation._startProducerSpan(record.topic, message);\n });\n\n const pendingMetrics: RecordPendingMetric[] = record.messages.map((m: any) =>\n prepareCounter(instrumentation._sentMessages, 1, {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_OPERATION_NAME]: 'send',\n [ATTR_MESSAGING_DESTINATION_NAME]: record.topic,\n ...(m.partition !== undefined\n ? {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(m.partition),\n }\n : {}),\n }),\n );\n const origSendResult: Promise<RecordMetadata[]> = original.apply(this, args);\n return instrumentation._endSpansOnPromise(spans, pendingMetrics, origSendResult);\n };\n };\n }\n\n private _endSpansOnPromise<T>(\n spans: Span[],\n pendingMetrics: RecordPendingMetric[],\n sendPromise: Promise<T>,\n ): Promise<T> {\n return Promise.resolve(sendPromise)\n .then(result => {\n pendingMetrics.forEach(m => m());\n return result;\n })\n .catch(reason => {\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' && Object.prototype.hasOwnProperty.call(reason, 'message')) {\n errorMessage = reason.message;\n errorType = reason.constructor.name;\n }\n pendingMetrics.forEach(m => m(errorType));\n\n spans.forEach(span => {\n span.setAttribute(ATTR_ERROR_TYPE, errorType);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: errorMessage,\n });\n });\n\n throw reason;\n })\n .finally(() => {\n spans.forEach(span => span.end());\n });\n }\n\n private _startConsumerSpan({ topic, message, operationType, ctx, link, attributes }: ConsumerSpanOptions) {\n const operationName =\n operationType === MESSAGING_OPERATION_TYPE_VALUE_RECEIVE\n ? 'poll' // for batch processing spans\n : operationType; // for individual message processing spans\n\n const span = this.tracer.startSpan(\n `${operationName} ${topic}`,\n {\n kind: operationType === MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? SpanKind.CLIENT : SpanKind.CONSUMER,\n attributes: {\n ...attributes,\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_MESSAGING_DESTINATION_NAME]: topic,\n [ATTR_MESSAGING_OPERATION_TYPE]: operationType,\n [ATTR_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,\n },\n links: link ? [link] : [],\n },\n ctx,\n );\n\n const { consumerHook } = this.getConfig();\n if (consumerHook && message) {\n safeExecuteInTheMiddle(\n () => consumerHook(span, { topic, message }),\n e => {\n if (e) this._diag.error('consumerHook error', e);\n },\n true,\n );\n }\n\n return span;\n }\n\n private _startProducerSpan(topic: string, message: Message) {\n const span = this.tracer.startSpan(`send ${topic}`, {\n kind: SpanKind.PRODUCER,\n attributes: {\n [ATTR_MESSAGING_SYSTEM]: MESSAGING_SYSTEM_VALUE_KAFKA,\n [ATTR_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 [ATTR_MESSAGING_OPERATION_NAME]: 'send',\n [ATTR_MESSAGING_OPERATION_TYPE]: MESSAGING_OPERATION_TYPE_VALUE_SEND,\n },\n });\n\n message.headers = message.headers ?? {};\n propagation.inject(trace.setSpan(context.active(), span), message.headers);\n\n const { producerHook } = this.getConfig();\n if (producerHook) {\n safeExecuteInTheMiddle(\n () => producerHook(span, { topic, message }),\n e => {\n if (e) this._diag.error('producerHook error', e);\n },\n true,\n );\n }\n\n return span;\n }\n}\n"],"names":["transaction","args"],"mappings":";;;;;;;;AAiFA,MAAM,YAAA,GAAe,iCAAA;AAsCrB,SAAS,cAAA,CAAqC,KAAA,EAAmB,KAAA,EAAe,UAAA,EAAoC;AAClH,EAAA,OAAO,CAAC,SAAA,KAAmC;AACzC,IAAA,KAAA,CAAM,IAAI,KAAA,EAAO;AAAA,MACf,GAAG,UAAA;AAAA,MACH,GAAI,YAAY,EAAE,CAAC,eAAe,GAAG,SAAA,KAAc;AAAC,KACrD,CAAA;AAAA,EACH,CAAA;AACF;AAEA,SAAS,wBAAA,CACP,KAAA,EACA,KAAA,EACA,UAAA,EACqB;AACrB,EAAA,OAAO,CAAC,SAAA,KAAmC;AACzC,IAAA,KAAA,CAAM,MAAA,CAAA,CAAQ,IAAA,CAAK,GAAA,EAAI,GAAI,SAAS,GAAA,EAAM;AAAA,MACxC,GAAG,UAAA;AAAA,MACH,GAAI,YAAY,EAAE,CAAC,eAAe,GAAG,SAAA,KAAc;AAAC,KACrD,CAAA;AAAA,EACH,CAAA;AACF;AAEA,MAAM,2BAAA,GAA8B,CAAC,IAAA,EAAO,IAAA,EAAM,OAAO,IAAA,EAAM,KAAA,EAAO,GAAA,EAAK,IAAA,EAAM,KAAK,IAAA,EAAM,CAAA,EAAG,GAAA,EAAK,CAAA,EAAG,KAAK,EAAE,CAA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,OAAO,CAAA;AAEzE,IAAA,MAAM,EAAE,YAAA,EAAa,GAAI,IAAA,CAAK,SAAA,EAAU;AACxC,IAAA,IAAI,YAAA,EAAc;AAChB,MAAA,sBAAA;AAAA,QACE,MAAM,YAAA,CAAa,IAAA,EAAM,EAAE,KAAA,EAAO,SAAS,CAAA;AAAA,QAC3C,CAAA,CAAA,KAAK;AACH,UAAA,IAAI,CAAA,EAAG,IAAA,CAAK,KAAA,CAAM,KAAA,CAAM,sBAAsB,CAAC,CAAA;AAAA,QACjD,CAAA;AAAA,QACA;AAAA,OACF;AAAA,IACF;AAEA,IAAA,OAAO,IAAA;AAAA,EACT;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"internal-types.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/internal-types.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\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 * - Some types vendored from kafkajs with simplifications\n */\n/* eslint-disable */\n\nimport type { Consumer, Producer } from './kafkajs-types';\n\nexport const EVENT_LISTENERS_SET = Symbol('opentelemetry.instrumentation.kafkajs.eventListenersSet');\n\nexport interface ConsumerExtended extends Consumer {\n [EVENT_LISTENERS_SET]?: boolean; // flag to identify if the event listeners for instrumentation have been set\n}\n\nexport interface ProducerExtended extends Producer {\n [EVENT_LISTENERS_SET]?: boolean; // flag to identify if the event listeners for instrumentation have been set\n}\n"],"names":[],"mappings":"AAwBO,MAAM,mBAAA,0BAA6B,yDAAyD;;;;"}
1
+ {"version":3,"file":"internal-types.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/internal-types.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 * - Some types vendored from kafkajs with simplifications\n */\n/* eslint-disable */\n\nimport type { Consumer, Producer } from './kafkajs-types';\n\nexport const EVENT_LISTENERS_SET = Symbol('opentelemetry.instrumentation.kafkajs.eventListenersSet');\n\nexport interface ConsumerExtended extends Consumer {\n [EVENT_LISTENERS_SET]?: boolean; // flag to identify if the event listeners for instrumentation have been set\n}\n\nexport interface ProducerExtended extends Producer {\n [EVENT_LISTENERS_SET]?: boolean; // flag to identify if the event listeners for instrumentation have been set\n}\n"],"names":[],"mappings":"AAaO,MAAM,mBAAA,0BAA6B,yDAAyD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"propagator.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/propagator.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\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 */\n/* eslint-disable */\n\nimport type { TextMapGetter } from '@opentelemetry/api';\n\n/*\nsame as open telemetry's `defaultTextMapGetter`,\nbut also handle case where header is buffer,\nadding toString() to make sure string is returned\n*/\nexport const bufferTextMapGetter: TextMapGetter = {\n get(carrier, key) {\n if (!carrier) {\n return undefined;\n }\n\n const keys = Object.keys(carrier);\n\n for (const carrierKey of keys) {\n if (carrierKey === key || carrierKey.toLowerCase() === key) {\n return carrier[carrierKey]?.toString();\n }\n }\n\n return undefined;\n },\n\n keys(carrier) {\n return carrier ? Object.keys(carrier) : [];\n },\n};\n"],"names":[],"mappings":"AA4BO,MAAM,mBAAA,GAAqC;AAAA,EAChD,GAAA,CAAI,SAAS,GAAA,EAAK;AAChB,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,OAAO,MAAA;AAAA,IACT;AAEA,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,CAAK,OAAO,CAAA;AAEhC,IAAA,KAAA,MAAW,cAAc,IAAA,EAAM;AAC7B,MAAA,IAAI,UAAA,KAAe,GAAA,IAAO,UAAA,CAAW,WAAA,OAAkB,GAAA,EAAK;AAC1D,QAAA,OAAO,OAAA,CAAQ,UAAU,CAAA,EAAG,QAAA,EAAS;AAAA,MACvC;AAAA,IACF;AAEA,IAAA,OAAO,MAAA;AAAA,EACT,CAAA;AAAA,EAEA,KAAK,OAAA,EAAS;AACZ,IAAA,OAAO,OAAA,GAAU,MAAA,CAAO,IAAA,CAAK,OAAO,IAAI,EAAC;AAAA,EAC3C;AACF;;;;"}
1
+ {"version":3,"file":"propagator.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/propagator.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 */\n/* eslint-disable */\n\nimport type { TextMapGetter } from '@opentelemetry/api';\n\n/*\nsame as open telemetry's `defaultTextMapGetter`,\nbut also handle case where header is buffer,\nadding toString() to make sure string is returned\n*/\nexport const bufferTextMapGetter: TextMapGetter = {\n get(carrier, key) {\n if (!carrier) {\n return undefined;\n }\n\n const keys = Object.keys(carrier);\n\n for (const carrierKey of keys) {\n if (carrierKey === key || carrierKey.toLowerCase() === key) {\n return carrier[carrierKey]?.toString();\n }\n }\n\n return undefined;\n },\n\n keys(carrier) {\n return carrier ? Object.keys(carrier) : [];\n },\n};\n"],"names":[],"mappings":"AAiBO,MAAM,mBAAA,GAAqC;AAAA,EAChD,GAAA,CAAI,SAAS,GAAA,EAAK;AAChB,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,OAAO,MAAA;AAAA,IACT;AAEA,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,CAAK,OAAO,CAAA;AAEhC,IAAA,KAAA,MAAW,cAAc,IAAA,EAAM;AAC7B,MAAA,IAAI,UAAA,KAAe,GAAA,IAAO,UAAA,CAAW,WAAA,OAAkB,GAAA,EAAK;AAC1D,QAAA,OAAO,OAAA,CAAQ,UAAU,CAAA,EAAG,QAAA,EAAS;AAAA,MACvC;AAAA,IACF;AAEA,IAAA,OAAO,MAAA;AAAA,EACT,CAAA;AAAA,EAEA,KAAK,OAAA,EAAS;AACZ,IAAA,OAAO,OAAA,GAAU,MAAA,CAAO,IAAA,CAAK,OAAO,IAAI,EAAC;AAAA,EAC3C;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\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 */\n/* eslint-disable */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The number of messages sent, received, or processed in the scope of the batching operation.\n *\n * @example 0\n * @example 1\n * @example 2\n *\n * @note Instrumentations **SHOULD NOT** set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations **SHOULD** use `messaging.batch.message_count` for batching APIs and **SHOULD NOT** use it for single-message APIs.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_BATCH_MESSAGE_COUNT = 'messaging.batch.message_count' as const;\n\n/**\n * The message destination name\n *\n * @example MyQueue\n * @example MyTopic\n *\n * @note Destination name **SHOULD** uniquely identify a specific queue, topic or other entity within the broker. If\n * the broker doesn't have such notion, the destination name **SHOULD** uniquely identify the broker.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_DESTINATION_NAME = 'messaging.destination.name' as const;\n\n/**\n * The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`.\n *\n * @example \"1\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_DESTINATION_PARTITION_ID = 'messaging.destination.partition.id' as const;\n\n/**\n * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute **MUST NOT** be set.\n *\n * @example \"myKey\"\n *\n * @note If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message.key' as const;\n\n/**\n * A boolean that is true if the message is a tombstone.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = 'messaging.kafka.message.tombstone' as const;\n\n/**\n * The offset of a record in the corresponding Kafka partition.\n *\n * @example 42\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_KAFKA_OFFSET = 'messaging.kafka.offset' as const;\n\n/**\n * The system-specific name of the messaging operation.\n *\n * @example ack\n * @example nack\n * @example send\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_OPERATION_NAME = 'messaging.operation.name' as const;\n\n/**\n * A string identifying the type of the messaging operation.\n *\n * @note If a custom value is used, it **MUST** be of low cardinality.\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_OPERATION_TYPE = 'messaging.operation.type' as const;\n\n/**\n * The messaging system as identified by the client instrumentation.\n *\n * @note The actual messaging system may differ from the one known by the client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the `messaging.system` is set to `kafka` based on the instrumentation's best knowledge.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_SYSTEM = 'messaging.system' as const;\n\n/**\n * Enum value \"process\" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}.\n */\nexport const MESSAGING_OPERATION_TYPE_VALUE_PROCESS = 'process' as const;\n\n/**\n * Enum value \"receive\" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}.\n */\nexport const MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = 'receive' as const;\n\n/**\n * Enum value \"send\" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}.\n */\nexport const MESSAGING_OPERATION_TYPE_VALUE_SEND = 'send' as const;\n\n/**\n * Enum value \"kafka\" for attribute {@link ATTR_MESSAGING_SYSTEM}.\n */\nexport const MESSAGING_SYSTEM_VALUE_KAFKA = 'kafka' as const;\n\n/**\n * Number of messages that were delivered to the application.\n *\n * @note Records the number of messages pulled from the broker or number of messages dispatched to the application in push-based scenarios.\n * The metric **SHOULD** be reported once per message delivery. For example, if receiving and processing operations are both instrumented for a single message delivery, this counter is incremented when the message is received and not reported when it is processed.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES = 'messaging.client.consumed.messages' as const;\n\n/**\n * Duration of messaging operation initiated by a producer or consumer client.\n *\n * @note This metric **SHOULD NOT** be used to report processing duration - processing duration is reported in `messaging.process.duration` metric.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_MESSAGING_CLIENT_OPERATION_DURATION = 'messaging.client.operation.duration' as const;\n\n/**\n * Number of messages producer attempted to send to the broker.\n *\n * @note This metric **MUST NOT** count messages that were created but haven't yet been sent.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_MESSAGING_CLIENT_SENT_MESSAGES = 'messaging.client.sent.messages' as const;\n\n/**\n * Duration of processing operation.\n *\n * @note This metric **MUST** be reported for operations with `messaging.operation.type` that matches `process`.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_MESSAGING_PROCESS_DURATION = 'messaging.process.duration' as const;\n"],"names":[],"mappings":"AAsCO,MAAM,kCAAA,GAAqC;AAa3C,MAAM,+BAAA,GAAkC;AASxC,MAAM,uCAAA,GAA0C;AAWhD,MAAM,gCAAA,GAAmC;AAOzC,MAAM,sCAAA,GAAyC;AAS/C,MAAM,2BAAA,GAA8B;AAWpC,MAAM,6BAAA,GAAgC;AAQtC,MAAM,6BAAA,GAAgC;AAStC,MAAM,qBAAA,GAAwB;AAK9B,MAAM,sCAAA,GAAyC;AAK/C,MAAM,sCAAA,GAAyC;AAK/C,MAAM,mCAAA,GAAsC;AAK5C,MAAM,4BAAA,GAA+B;AAUrC,MAAM,yCAAA,GAA4C;AASlD,MAAM,0CAAA,GAA6C;AASnD,MAAM,qCAAA,GAAwC;AAS9C,MAAM,iCAAA,GAAoC;;;;"}
1
+ {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/semconv.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 */\n/* eslint-disable */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * The number of messages sent, received, or processed in the scope of the batching operation.\n *\n * @example 0\n * @example 1\n * @example 2\n *\n * @note Instrumentations **SHOULD NOT** set `messaging.batch.message_count` on spans that operate with a single message. When a messaging client library supports both batch and single-message API for the same operation, instrumentations **SHOULD** use `messaging.batch.message_count` for batching APIs and **SHOULD NOT** use it for single-message APIs.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_BATCH_MESSAGE_COUNT = 'messaging.batch.message_count' as const;\n\n/**\n * The message destination name\n *\n * @example MyQueue\n * @example MyTopic\n *\n * @note Destination name **SHOULD** uniquely identify a specific queue, topic or other entity within the broker. If\n * the broker doesn't have such notion, the destination name **SHOULD** uniquely identify the broker.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_DESTINATION_NAME = 'messaging.destination.name' as const;\n\n/**\n * The identifier of the partition messages are sent to or received from, unique within the `messaging.destination.name`.\n *\n * @example \"1\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_DESTINATION_PARTITION_ID = 'messaging.destination.partition.id' as const;\n\n/**\n * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message.id` in that they're not unique. If the key is `null`, the attribute **MUST NOT** be set.\n *\n * @example \"myKey\"\n *\n * @note If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_KAFKA_MESSAGE_KEY = 'messaging.kafka.message.key' as const;\n\n/**\n * A boolean that is true if the message is a tombstone.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE = 'messaging.kafka.message.tombstone' as const;\n\n/**\n * The offset of a record in the corresponding Kafka partition.\n *\n * @example 42\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_KAFKA_OFFSET = 'messaging.kafka.offset' as const;\n\n/**\n * The system-specific name of the messaging operation.\n *\n * @example ack\n * @example nack\n * @example send\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_OPERATION_NAME = 'messaging.operation.name' as const;\n\n/**\n * A string identifying the type of the messaging operation.\n *\n * @note If a custom value is used, it **MUST** be of low cardinality.\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_OPERATION_TYPE = 'messaging.operation.type' as const;\n\n/**\n * The messaging system as identified by the client instrumentation.\n *\n * @note The actual messaging system may differ from the one known by the client. For example, when using Kafka client libraries to communicate with Azure Event Hubs, the `messaging.system` is set to `kafka` based on the instrumentation's best knowledge.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_MESSAGING_SYSTEM = 'messaging.system' as const;\n\n/**\n * Enum value \"process\" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}.\n */\nexport const MESSAGING_OPERATION_TYPE_VALUE_PROCESS = 'process' as const;\n\n/**\n * Enum value \"receive\" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}.\n */\nexport const MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = 'receive' as const;\n\n/**\n * Enum value \"send\" for attribute {@link ATTR_MESSAGING_OPERATION_TYPE}.\n */\nexport const MESSAGING_OPERATION_TYPE_VALUE_SEND = 'send' as const;\n\n/**\n * Enum value \"kafka\" for attribute {@link ATTR_MESSAGING_SYSTEM}.\n */\nexport const MESSAGING_SYSTEM_VALUE_KAFKA = 'kafka' as const;\n\n/**\n * Number of messages that were delivered to the application.\n *\n * @note Records the number of messages pulled from the broker or number of messages dispatched to the application in push-based scenarios.\n * The metric **SHOULD** be reported once per message delivery. For example, if receiving and processing operations are both instrumented for a single message delivery, this counter is incremented when the message is received and not reported when it is processed.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES = 'messaging.client.consumed.messages' as const;\n\n/**\n * Duration of messaging operation initiated by a producer or consumer client.\n *\n * @note This metric **SHOULD NOT** be used to report processing duration - processing duration is reported in `messaging.process.duration` metric.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_MESSAGING_CLIENT_OPERATION_DURATION = 'messaging.client.operation.duration' as const;\n\n/**\n * Number of messages producer attempted to send to the broker.\n *\n * @note This metric **MUST NOT** count messages that were created but haven't yet been sent.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_MESSAGING_CLIENT_SENT_MESSAGES = 'messaging.client.sent.messages' as const;\n\n/**\n * Duration of processing operation.\n *\n * @note This metric **MUST** be reported for operations with `messaging.operation.type` that matches `process`.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_MESSAGING_PROCESS_DURATION = 'messaging.process.duration' as const;\n"],"names":[],"mappings":"AA2BO,MAAM,kCAAA,GAAqC;AAa3C,MAAM,+BAAA,GAAkC;AASxC,MAAM,uCAAA,GAA0C;AAWhD,MAAM,gCAAA,GAAmC;AAOzC,MAAM,sCAAA,GAAyC;AAS/C,MAAM,2BAAA,GAA8B;AAWpC,MAAM,6BAAA,GAAgC;AAQtC,MAAM,6BAAA,GAAgC;AAStC,MAAM,qBAAA,GAAwB;AAK9B,MAAM,sCAAA,GAAyC;AAK/C,MAAM,sCAAA,GAAyC;AAK/C,MAAM,mCAAA,GAAsC;AAK5C,MAAM,4BAAA,GAA+B;AAUrC,MAAM,yCAAA,GAA4C;AASlD,MAAM,0CAAA,GAA6C;AASnD,MAAM,qCAAA,GAAwC;AAS9C,MAAM,iCAAA,GAAoC;;;;"}
@@ -1,29 +1,14 @@
1
1
  import { KnexInstrumentation } from './vendored/instrumentation.js';
2
- import { defineIntegration, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
3
- import { generateInstrumentOnce, instrumentWhenWrapped } from '@sentry/node-core';
2
+ import { defineIntegration } from '@sentry/core';
3
+ import { generateInstrumentOnce } from '@sentry/node-core';
4
4
 
5
5
  const INTEGRATION_NAME = "Knex";
6
- const instrumentKnex = generateInstrumentOnce(
7
- INTEGRATION_NAME,
8
- () => new KnexInstrumentation({ requireParentSpan: true })
9
- );
6
+ const instrumentKnex = generateInstrumentOnce(INTEGRATION_NAME, () => new KnexInstrumentation());
10
7
  const _knexIntegration = (() => {
11
- let instrumentationWrappedCallback;
12
8
  return {
13
9
  name: INTEGRATION_NAME,
14
10
  setupOnce() {
15
- const instrumentation = instrumentKnex();
16
- instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);
17
- },
18
- setup(client) {
19
- instrumentationWrappedCallback?.(
20
- () => client.on("spanStart", (span) => {
21
- const { data } = spanToJSON(span);
22
- if ("knex.version" in data) {
23
- span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, "auto.db.otel.knex");
24
- }
25
- })
26
- );
11
+ instrumentKnex();
27
12
  }
28
13
  };
29
14
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/knex/index.ts"],"sourcesContent":["import { KnexInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON } from '@sentry/core';\nimport { generateInstrumentOnce, instrumentWhenWrapped } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Knex';\n\nexport const instrumentKnex = generateInstrumentOnce(\n INTEGRATION_NAME,\n () => new KnexInstrumentation({ requireParentSpan: true }),\n);\n\nconst _knexIntegration = (() => {\n let instrumentationWrappedCallback: undefined | ((callback: () => void) => void);\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const instrumentation = instrumentKnex();\n instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);\n },\n\n setup(client) {\n instrumentationWrappedCallback?.(() =>\n client.on('spanStart', span => {\n const { data } = spanToJSON(span);\n // knex.version is always set in the span data\n // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/0309caeafc44ac9cb13a3345b790b01b76d0497d/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts#L138\n if ('knex.version' in data) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.knex');\n }\n }),\n );\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Knex integration\n *\n * Capture tracing data for [Knex](https://knexjs.org/).\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.init({\n * integrations: [Sentry.knexIntegration()],\n * });\n * ```\n */\nexport const knexIntegration = defineIntegration(_knexIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,MAAA;AAElB,MAAM,cAAA,GAAiB,sBAAA;AAAA,EAC5B,gBAAA;AAAA,EACA,MAAM,IAAI,mBAAA,CAAoB,EAAE,iBAAA,EAAmB,MAAM;AAC3D;AAEA,MAAM,oBAAoB,MAAM;AAC9B,EAAA,IAAI,8BAAA;AAEJ,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,MAAM,kBAAkB,cAAA,EAAe;AACvC,MAAA,8BAAA,GAAiC,sBAAsB,eAAe,CAAA;AAAA,IACxE,CAAA;AAAA,IAEA,MAAM,MAAA,EAAQ;AACZ,MAAA,8BAAA;AAAA,QAAiC,MAC/B,MAAA,CAAO,EAAA,CAAG,WAAA,EAAa,CAAA,IAAA,KAAQ;AAC7B,UAAA,MAAM,EAAE,IAAA,EAAK,GAAI,UAAA,CAAW,IAAI,CAAA;AAGhC,UAAA,IAAI,kBAAkB,IAAA,EAAM;AAC1B,YAAA,IAAA,CAAK,YAAA,CAAa,kCAAkC,mBAAmB,CAAA;AAAA,UACzE;AAAA,QACF,CAAC;AAAA,OACH;AAAA,IACF;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,eAAA,GAAkB,kBAAkB,gBAAgB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/knex/index.ts"],"sourcesContent":["import { KnexInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Knex';\n\nexport const instrumentKnex = generateInstrumentOnce(INTEGRATION_NAME, () => new KnexInstrumentation());\n\nconst _knexIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentKnex();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Knex integration\n *\n * Capture tracing data for [Knex](https://knexjs.org/).\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.init({\n * integrations: [Sentry.knexIntegration()],\n * });\n * ```\n */\nexport const knexIntegration = defineIntegration(_knexIntegration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,MAAA;AAElB,MAAM,iBAAiB,sBAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAI,qBAAqB;AAEtG,MAAM,oBAAoB,MAAM;AAC9B,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,cAAA,EAAe;AAAA,IACjB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,eAAA,GAAkB,kBAAkB,gBAAgB;;;;"}