@sentry/node 10.58.0 → 10.60.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 (561) hide show
  1. package/build/cjs/index.js +3 -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/index.js +7 -8
  10. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  11. package/build/cjs/integrations/node-fetch/vendored/semconv.js +28 -0
  12. package/build/cjs/integrations/node-fetch/vendored/semconv.js.map +1 -0
  13. package/build/cjs/integrations/node-fetch/vendored/undici.js +91 -127
  14. package/build/cjs/integrations/node-fetch/vendored/undici.js.map +1 -1
  15. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  16. package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
  17. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  18. package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  19. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  20. package/build/cjs/integrations/tracing/connect/index.js +0 -21
  21. package/build/cjs/integrations/tracing/connect/index.js.map +1 -1
  22. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +0 -6
  23. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
  24. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +33 -42
  25. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  26. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
  27. package/build/cjs/integrations/tracing/connect/vendored/utils.js +3 -2
  28. package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -1
  29. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  30. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +1 -1
  31. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  32. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  33. package/build/cjs/integrations/tracing/genericPool/index.js +1 -15
  34. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -1
  35. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +30 -18
  36. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  37. package/build/cjs/integrations/tracing/graphql/index.js +1 -51
  38. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -1
  39. package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +1 -1
  40. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
  41. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
  42. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +67 -57
  43. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  44. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
  45. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
  46. package/build/cjs/integrations/tracing/graphql/vendored/utils.js +28 -62
  47. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  48. package/build/cjs/integrations/tracing/hapi/index.js +0 -17
  49. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  50. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
  51. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +28 -45
  52. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  53. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
  54. package/build/cjs/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
  55. package/build/cjs/integrations/tracing/hapi/vendored/utils.js +4 -9
  56. package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  57. package/build/cjs/integrations/tracing/index.js +1 -0
  58. package/build/cjs/integrations/tracing/index.js.map +1 -1
  59. package/build/cjs/integrations/tracing/kafka/index.js +1 -11
  60. package/build/cjs/integrations/tracing/kafka/index.js.map +1 -1
  61. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +45 -247
  62. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  63. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +4 -8
  64. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  65. package/build/cjs/integrations/tracing/kafka/vendored/utils.js +113 -0
  66. package/build/cjs/integrations/tracing/kafka/vendored/utils.js.map +1 -0
  67. package/build/cjs/integrations/tracing/knex/index.js +2 -17
  68. package/build/cjs/integrations/tracing/knex/index.js.map +1 -1
  69. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +65 -93
  70. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  71. package/build/cjs/integrations/tracing/knex/vendored/semconv.js +2 -0
  72. package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  73. package/build/cjs/integrations/tracing/knex/vendored/utils.js +2 -15
  74. package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -1
  75. package/build/cjs/integrations/tracing/koa/index.js +1 -24
  76. package/build/cjs/integrations/tracing/koa/index.js.map +1 -1
  77. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
  78. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +29 -41
  79. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  80. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
  81. package/build/cjs/integrations/tracing/koa/vendored/types.js.map +1 -1
  82. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -1
  83. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  84. package/build/cjs/integrations/tracing/mongo/index.js +1 -42
  85. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -1
  86. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +12 -562
  87. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  88. package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
  89. package/build/cjs/integrations/tracing/mongo/vendored/patches.js +151 -0
  90. package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  91. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js +0 -4
  92. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  93. package/build/cjs/integrations/tracing/mongo/vendored/utils.js +153 -0
  94. package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  95. package/build/cjs/integrations/tracing/mongoose/index.js +1 -8
  96. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -1
  97. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +56 -203
  98. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  99. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js +0 -4
  100. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  101. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +19 -49
  102. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  103. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
  104. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  105. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  106. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  107. package/build/cjs/integrations/tracing/mysql2/index.js +1 -8
  108. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -1
  109. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +21 -59
  110. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  111. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  112. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +14 -33
  113. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  114. package/build/cjs/integrations/tracing/postgres/index.js +0 -4
  115. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -1
  116. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
  117. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
  118. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
  119. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +51 -261
  120. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  121. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +0 -12
  122. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  123. package/build/cjs/integrations/tracing/postgres/vendored/utils.js +43 -167
  124. package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  125. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  126. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  127. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -1
  128. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  129. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  130. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +89 -160
  131. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  132. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  133. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +92 -231
  134. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  135. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +0 -2
  136. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  137. package/build/cjs/integrations/tracing/tedious/index.js +1 -25
  138. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -1
  139. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +25 -76
  140. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  141. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  142. package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +1 -1
  143. package/build/cjs/sdk/diagnosticsChannelInjection.js +21 -0
  144. package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -0
  145. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +19 -0
  146. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  147. package/build/cjs/sdk/index.js +17 -1
  148. package/build/cjs/sdk/index.js.map +1 -1
  149. package/build/cjs/sdk/initOtel.js +2 -1
  150. package/build/cjs/sdk/initOtel.js.map +1 -1
  151. package/build/esm/index.js +2 -1
  152. package/build/esm/index.js.map +1 -1
  153. package/build/esm/integrations/fs/index.js +4 -85
  154. package/build/esm/integrations/fs/index.js.map +1 -1
  155. package/build/esm/integrations/fs/vendored/constants.js.map +1 -1
  156. package/build/esm/integrations/fs/vendored/instrumentation.js +147 -177
  157. package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -1
  158. package/build/esm/integrations/fs/vendored/utils.js.map +1 -1
  159. package/build/esm/integrations/node-fetch/index.js +8 -9
  160. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  161. package/build/esm/integrations/node-fetch/vendored/semconv.js +15 -0
  162. package/build/esm/integrations/node-fetch/vendored/semconv.js.map +1 -0
  163. package/build/esm/integrations/node-fetch/vendored/undici.js +80 -116
  164. package/build/esm/integrations/node-fetch/vendored/undici.js.map +1 -1
  165. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  166. package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
  167. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  168. package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  169. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  170. package/build/esm/integrations/tracing/connect/index.js +1 -22
  171. package/build/esm/integrations/tracing/connect/index.js.map +1 -1
  172. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +1 -6
  173. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
  174. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +36 -44
  175. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  176. package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
  177. package/build/esm/integrations/tracing/connect/vendored/utils.js +3 -2
  178. package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -1
  179. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  180. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +1 -1
  181. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  182. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  183. package/build/esm/integrations/tracing/genericPool/index.js +3 -17
  184. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -1
  185. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +31 -19
  186. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  187. package/build/esm/integrations/tracing/graphql/index.js +3 -53
  188. package/build/esm/integrations/tracing/graphql/index.js.map +1 -1
  189. package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +1 -1
  190. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
  191. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
  192. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +69 -59
  193. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  194. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
  195. package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
  196. package/build/esm/integrations/tracing/graphql/vendored/utils.js +29 -62
  197. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  198. package/build/esm/integrations/tracing/hapi/index.js +1 -18
  199. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  200. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
  201. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +30 -47
  202. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  203. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
  204. package/build/esm/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
  205. package/build/esm/integrations/tracing/hapi/vendored/utils.js +5 -10
  206. package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  207. package/build/esm/integrations/tracing/index.js +1 -0
  208. package/build/esm/integrations/tracing/index.js.map +1 -1
  209. package/build/esm/integrations/tracing/kafka/index.js +2 -12
  210. package/build/esm/integrations/tracing/kafka/index.js.map +1 -1
  211. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +47 -249
  212. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  213. package/build/esm/integrations/tracing/kafka/vendored/semconv.js +3 -5
  214. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  215. package/build/esm/integrations/tracing/kafka/vendored/utils.js +107 -0
  216. package/build/esm/integrations/tracing/kafka/vendored/utils.js.map +1 -0
  217. package/build/esm/integrations/tracing/knex/index.js +4 -19
  218. package/build/esm/integrations/tracing/knex/index.js.map +1 -1
  219. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +66 -94
  220. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  221. package/build/esm/integrations/tracing/knex/vendored/semconv.js +2 -1
  222. package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  223. package/build/esm/integrations/tracing/knex/vendored/utils.js +3 -15
  224. package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -1
  225. package/build/esm/integrations/tracing/koa/index.js +3 -26
  226. package/build/esm/integrations/tracing/koa/index.js.map +1 -1
  227. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
  228. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +31 -43
  229. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  230. package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
  231. package/build/esm/integrations/tracing/koa/vendored/types.js.map +1 -1
  232. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -1
  233. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  234. package/build/esm/integrations/tracing/mongo/index.js +3 -43
  235. package/build/esm/integrations/tracing/mongo/index.js.map +1 -1
  236. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +13 -563
  237. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  238. package/build/esm/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
  239. package/build/esm/integrations/tracing/mongo/vendored/patches.js +143 -0
  240. package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  241. package/build/esm/integrations/tracing/mongo/vendored/semconv.js +1 -3
  242. package/build/esm/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  243. package/build/esm/integrations/tracing/mongo/vendored/utils.js +146 -0
  244. package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  245. package/build/esm/integrations/tracing/mongoose/index.js +2 -9
  246. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -1
  247. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +59 -206
  248. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  249. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js +1 -3
  250. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  251. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +20 -50
  252. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  253. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
  254. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  255. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  256. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  257. package/build/esm/integrations/tracing/mysql2/index.js +2 -9
  258. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -1
  259. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +26 -64
  260. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  261. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  262. package/build/esm/integrations/tracing/mysql2/vendored/utils.js +15 -34
  263. package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  264. package/build/esm/integrations/tracing/postgres/index.js +1 -5
  265. package/build/esm/integrations/tracing/postgres/index.js.map +1 -1
  266. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
  267. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
  268. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
  269. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +52 -262
  270. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  271. package/build/esm/integrations/tracing/postgres/vendored/semconv.js +1 -7
  272. package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  273. package/build/esm/integrations/tracing/postgres/vendored/utils.js +44 -165
  274. package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  275. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  276. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  277. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -1
  278. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  279. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  280. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +92 -163
  281. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  282. package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  283. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +94 -233
  284. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  285. package/build/esm/integrations/tracing/redis/vendored/semconv.js +1 -2
  286. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  287. package/build/esm/integrations/tracing/tedious/index.js +3 -27
  288. package/build/esm/integrations/tracing/tedious/index.js.map +1 -1
  289. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +29 -79
  290. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  291. package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  292. package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +1 -1
  293. package/build/esm/package.json +1 -1
  294. package/build/esm/sdk/diagnosticsChannelInjection.js +17 -0
  295. package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -0
  296. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +17 -0
  297. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  298. package/build/esm/sdk/index.js +17 -1
  299. package/build/esm/sdk/index.js.map +1 -1
  300. package/build/esm/sdk/initOtel.js +2 -1
  301. package/build/esm/sdk/initOtel.js.map +1 -1
  302. package/build/import-hook.mjs +6 -0
  303. package/build/types/index.d.ts +2 -1
  304. package/build/types/index.d.ts.map +1 -1
  305. package/build/types/integrations/fs/index.d.ts.map +1 -1
  306. package/build/types/integrations/fs/vendored/constants.d.ts.map +1 -1
  307. package/build/types/integrations/fs/vendored/instrumentation.d.ts +6 -10
  308. package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -1
  309. package/build/types/integrations/fs/vendored/types.d.ts +10 -15
  310. package/build/types/integrations/fs/vendored/types.d.ts.map +1 -1
  311. package/build/types/integrations/fs/vendored/utils.d.ts +2 -2
  312. package/build/types/integrations/fs/vendored/utils.d.ts.map +1 -1
  313. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  314. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts.map +1 -1
  315. package/build/types/integrations/node-fetch/vendored/semconv.d.ts +13 -0
  316. package/build/types/integrations/node-fetch/vendored/semconv.d.ts.map +1 -0
  317. package/build/types/integrations/node-fetch/vendored/types.d.ts +2 -4
  318. package/build/types/integrations/node-fetch/vendored/types.d.ts.map +1 -1
  319. package/build/types/integrations/node-fetch/vendored/undici.d.ts +6 -7
  320. package/build/types/integrations/node-fetch/vendored/undici.d.ts.map +1 -1
  321. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts.map +1 -1
  322. package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts.map +1 -1
  323. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -1
  324. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -1
  325. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -1
  326. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -1
  327. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
  328. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +1 -1
  329. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +5 -5
  330. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -1
  331. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
  332. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +1 -1
  333. package/build/types/integrations/tracing/connect/vendored/utils.d.ts +1 -1
  334. package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +1 -1
  335. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -1
  336. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -1
  337. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +1 -1
  338. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -1
  339. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -1
  340. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -1
  341. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +1 -1
  342. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
  343. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +1 -1
  344. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +7 -2
  345. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -1
  346. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +4 -4
  347. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +1 -1
  348. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +1 -1
  349. package/build/types/integrations/tracing/graphql/vendored/types.d.ts +5 -43
  350. package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -1
  351. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +8 -11
  352. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -1
  353. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  354. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +1 -1
  355. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
  356. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -1
  357. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +1 -1
  358. package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts.map +1 -1
  359. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +3 -4
  360. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -1
  361. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  362. package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -1
  363. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +3 -13
  364. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -1
  365. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -32
  366. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +1 -1
  367. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +9 -28
  368. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -1
  369. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
  370. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts.map +1 -0
  371. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -1
  372. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
  373. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -1
  374. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
  375. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -1
  376. package/build/types/integrations/tracing/knex/vendored/utils.d.ts +0 -6
  377. package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +1 -1
  378. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -1
  379. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +1 -1
  380. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +1 -1
  381. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -1
  382. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
  383. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +1 -1
  384. package/build/types/integrations/tracing/koa/vendored/types.d.ts +2 -39
  385. package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +1 -1
  386. package/build/types/integrations/tracing/koa/vendored/utils.d.ts +3 -3
  387. package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -1
  388. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -1
  389. package/build/types/integrations/tracing/mongo/index.d.ts +0 -4
  390. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -1
  391. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
  392. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -1
  393. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
  394. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -1
  395. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  396. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +1 -0
  397. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
  398. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts.map +1 -1
  399. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
  400. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -0
  401. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -1
  402. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
  403. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +1 -1
  404. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
  405. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -1
  406. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
  407. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts.map +1 -1
  408. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
  409. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -1
  410. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +1 -1
  411. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -1
  412. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -1
  413. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -1
  414. package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +1 -1
  415. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -1
  416. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -1
  417. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
  418. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -1
  419. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -1
  420. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
  421. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -1
  422. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -1
  423. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
  424. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +1 -1
  425. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +1 -1
  426. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +1 -9
  427. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -1
  428. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
  429. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +1 -1
  430. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +1 -1
  431. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +1 -1
  432. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
  433. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -1
  434. package/build/types/integrations/tracing/postgres/vendored/types.d.ts +2 -56
  435. package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -1
  436. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
  437. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -1
  438. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -1
  439. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -1
  440. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -1
  441. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -1
  442. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -1
  443. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
  444. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
  445. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -1
  446. package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts.map +1 -1
  447. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -1
  448. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -1
  449. package/build/types/integrations/tracing/redis/vendored/types.d.ts +2 -36
  450. package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -1
  451. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -1
  452. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
  453. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -1
  454. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -1
  455. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +1 -1
  456. package/build/types/sdk/diagnosticsChannelInjection.d.ts +41 -0
  457. package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -0
  458. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
  459. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -0
  460. package/build/types/sdk/index.d.ts.map +1 -1
  461. package/build/types/sdk/initOtel.d.ts.map +1 -1
  462. package/build/types-ts3.8/index.d.ts +2 -1
  463. package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +6 -10
  464. package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +10 -15
  465. package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +2 -2
  466. package/build/types-ts3.8/integrations/node-fetch/vendored/semconv.d.ts +13 -0
  467. package/build/types-ts3.8/integrations/node-fetch/vendored/types.d.ts +2 -4
  468. package/build/types-ts3.8/integrations/node-fetch/vendored/undici.d.ts +6 -7
  469. package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
  470. package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +4 -4
  471. package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
  472. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
  473. package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +6 -1
  474. package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +3 -3
  475. package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +4 -42
  476. package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +6 -9
  477. package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
  478. package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +1 -2
  479. package/build/types-ts3.8/integrations/tracing/kafka/vendored/instrumentation.d.ts +3 -13
  480. package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -32
  481. package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +9 -28
  482. package/build/types-ts3.8/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
  483. package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
  484. package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
  485. package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +0 -6
  486. package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
  487. package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +1 -38
  488. package/build/types-ts3.8/integrations/tracing/mongo/index.d.ts +0 -4
  489. package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
  490. package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
  491. package/build/types-ts3.8/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  492. package/build/types-ts3.8/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
  493. package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
  494. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
  495. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
  496. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
  497. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
  498. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
  499. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
  500. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
  501. package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +0 -8
  502. package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
  503. package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
  504. package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +1 -55
  505. package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
  506. package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
  507. package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +2 -36
  508. package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
  509. package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +41 -0
  510. package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
  511. package/package.json +20 -7
  512. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js +0 -6
  513. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js.map +0 -1
  514. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js +0 -22
  515. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js.map +0 -1
  516. package/build/cjs/integrations/tracing/knex/vendored/constants.js +0 -16
  517. package/build/cjs/integrations/tracing/knex/vendored/constants.js.map +0 -1
  518. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js +0 -6
  519. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
  520. package/build/cjs/integrations/tracing/utils/sql-common.js +0 -43
  521. package/build/cjs/integrations/tracing/utils/sql-common.js.map +0 -1
  522. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js +0 -4
  523. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js.map +0 -1
  524. package/build/esm/integrations/tracing/kafka/vendored/propagator.js +0 -20
  525. package/build/esm/integrations/tracing/kafka/vendored/propagator.js.map +0 -1
  526. package/build/esm/integrations/tracing/knex/vendored/constants.js +0 -13
  527. package/build/esm/integrations/tracing/knex/vendored/constants.js.map +0 -1
  528. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js +0 -4
  529. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
  530. package/build/esm/integrations/tracing/utils/sql-common.js +0 -41
  531. package/build/esm/integrations/tracing/utils/sql-common.js.map +0 -1
  532. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts +0 -9
  533. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts.map +0 -1
  534. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts +0 -3
  535. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts.map +0 -1
  536. package/build/types/integrations/tracing/kafka/vendored/types.d.ts +0 -26
  537. package/build/types/integrations/tracing/kafka/vendored/types.d.ts.map +0 -1
  538. package/build/types/integrations/tracing/knex/vendored/constants.d.ts +0 -3
  539. package/build/types/integrations/tracing/knex/vendored/constants.d.ts.map +0 -1
  540. package/build/types/integrations/tracing/knex/vendored/types.d.ts +0 -8
  541. package/build/types/integrations/tracing/knex/vendored/types.d.ts.map +0 -1
  542. package/build/types/integrations/tracing/mongo/vendored/types.d.ts +0 -51
  543. package/build/types/integrations/tracing/mongo/vendored/types.d.ts.map +0 -1
  544. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
  545. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts.map +0 -1
  546. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
  547. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts.map +0 -1
  548. package/build/types/integrations/tracing/tedious/vendored/types.d.ts +0 -10
  549. package/build/types/integrations/tracing/tedious/vendored/types.d.ts.map +0 -1
  550. package/build/types/integrations/tracing/utils/sql-common.d.ts +0 -3
  551. package/build/types/integrations/tracing/utils/sql-common.d.ts.map +0 -1
  552. package/build/types-ts3.8/integrations/tracing/kafka/vendored/internal-types.d.ts +0 -9
  553. package/build/types-ts3.8/integrations/tracing/kafka/vendored/propagator.d.ts +0 -3
  554. package/build/types-ts3.8/integrations/tracing/kafka/vendored/types.d.ts +0 -26
  555. package/build/types-ts3.8/integrations/tracing/knex/vendored/constants.d.ts +0 -3
  556. package/build/types-ts3.8/integrations/tracing/knex/vendored/types.d.ts +0 -8
  557. package/build/types-ts3.8/integrations/tracing/mongo/vendored/types.d.ts +0 -51
  558. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
  559. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
  560. package/build/types-ts3.8/integrations/tracing/tedious/vendored/types.d.ts +0 -10
  561. package/build/types-ts3.8/integrations/tracing/utils/sql-common.d.ts +0 -3
@@ -1,45 +1,15 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- const api = require('@opentelemetry/api');
4
3
  const instrumentation = require('@opentelemetry/instrumentation');
5
- const semanticConventions = require('@opentelemetry/semantic-conventions');
6
- const internalTypes = require('./internal-types.js');
7
- const propagator = require('./propagator.js');
8
- const semconv = require('./semconv.js');
9
4
  const core = require('@sentry/core');
5
+ const semconv = require('./semconv.js');
6
+ const utils = require('./utils.js');
10
7
 
11
8
  const PACKAGE_NAME = "@sentry/instrumentation-kafkajs";
12
- function prepareCounter(meter, value, attributes) {
13
- return (errorType) => {
14
- meter.add(value, {
15
- ...attributes,
16
- ...errorType ? { [semanticConventions.ATTR_ERROR_TYPE]: errorType } : {}
17
- });
18
- };
19
- }
20
- function prepareDurationHistogram(meter, value, attributes) {
21
- return (errorType) => {
22
- meter.record((Date.now() - value) / 1e3, {
23
- ...attributes,
24
- ...errorType ? { [semanticConventions.ATTR_ERROR_TYPE]: errorType } : {}
25
- });
26
- };
27
- }
28
- const HISTOGRAM_BUCKET_BOUNDARIES = [5e-3, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10];
29
9
  class KafkaJsInstrumentation extends instrumentation.InstrumentationBase {
30
10
  constructor(config = {}) {
31
11
  super(PACKAGE_NAME, core.SDK_VERSION, config);
32
12
  }
33
- _updateMetricInstruments() {
34
- this._clientDuration = this.meter.createHistogram(semconv.METRIC_MESSAGING_CLIENT_OPERATION_DURATION, {
35
- advice: { explicitBucketBoundaries: HISTOGRAM_BUCKET_BOUNDARIES }
36
- });
37
- this._sentMessages = this.meter.createCounter(semconv.METRIC_MESSAGING_CLIENT_SENT_MESSAGES);
38
- this._consumedMessages = this.meter.createCounter(semconv.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES);
39
- this._processDuration = this.meter.createHistogram(semconv.METRIC_MESSAGING_PROCESS_DURATION, {
40
- advice: { explicitBucketBoundaries: HISTOGRAM_BUCKET_BOUNDARIES }
41
- });
42
- }
43
13
  init() {
44
14
  const unpatch = (moduleExports) => {
45
15
  if (instrumentation.isWrapped(moduleExports?.Kafka?.prototype.producer)) {
@@ -71,27 +41,10 @@ class KafkaJsInstrumentation extends instrumentation.InstrumentationBase {
71
41
  instrumentation$1._unwrap(newConsumer, "run");
72
42
  }
73
43
  instrumentation$1._wrap(newConsumer, "run", instrumentation$1._getConsumerRunPatch());
74
- instrumentation$1._setKafkaEventListeners(newConsumer);
75
44
  return newConsumer;
76
45
  };
77
46
  };
78
47
  }
79
- _setKafkaEventListeners(kafkaObj) {
80
- if (kafkaObj[internalTypes.EVENT_LISTENERS_SET]) return;
81
- if (kafkaObj.events?.REQUEST) {
82
- kafkaObj.on(kafkaObj.events.REQUEST, this._recordClientDurationMetric.bind(this));
83
- }
84
- kafkaObj[internalTypes.EVENT_LISTENERS_SET] = true;
85
- }
86
- _recordClientDurationMetric(event) {
87
- const [address = "", port = "0"] = event.payload.broker.split(":");
88
- this._clientDuration.record(event.payload.duration / 1e3, {
89
- [semconv.ATTR_MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA,
90
- [semconv.ATTR_MESSAGING_OPERATION_NAME]: `${event.payload.apiName}`,
91
- [semanticConventions.ATTR_SERVER_ADDRESS]: address,
92
- [semanticConventions.ATTR_SERVER_PORT]: Number.parseInt(port, 10)
93
- });
94
- }
95
48
  _getProducerPatch() {
96
49
  const instrumentation$1 = this;
97
50
  return (original) => {
@@ -109,7 +62,6 @@ class KafkaJsInstrumentation extends instrumentation.InstrumentationBase {
109
62
  instrumentation$1._unwrap(newProducer, "transaction");
110
63
  }
111
64
  instrumentation$1._wrap(newProducer, "transaction", instrumentation$1._getProducerTransactionPatch());
112
- instrumentation$1._setKafkaEventListeners(newProducer);
113
65
  return newProducer;
114
66
  };
115
67
  };
@@ -136,103 +88,60 @@ class KafkaJsInstrumentation extends instrumentation.InstrumentationBase {
136
88
  };
137
89
  }
138
90
  _getConsumerEachMessagePatch() {
139
- const instrumentation = this;
140
91
  return (original) => {
141
92
  return function eachMessage(...args) {
142
93
  const payload = args[0];
143
- const propagatedContext = api.propagation.extract(
144
- api.ROOT_CONTEXT,
145
- payload.message.headers,
146
- propagator.bufferTextMapGetter
147
- );
148
- const span = instrumentation._startConsumerSpan({
149
- topic: payload.topic,
150
- message: payload.message,
151
- operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,
152
- ctx: propagatedContext,
153
- attributes: {
154
- [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition)
155
- }
156
- });
157
- const pendingMetrics = [
158
- prepareDurationHistogram(instrumentation._processDuration, Date.now(), {
159
- [semconv.ATTR_MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA,
160
- [semconv.ATTR_MESSAGING_OPERATION_NAME]: "process",
161
- [semconv.ATTR_MESSAGING_DESTINATION_NAME]: payload.topic,
162
- [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition)
163
- }),
164
- prepareCounter(instrumentation._consumedMessages, 1, {
165
- [semconv.ATTR_MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA,
166
- [semconv.ATTR_MESSAGING_OPERATION_NAME]: "process",
167
- [semconv.ATTR_MESSAGING_DESTINATION_NAME]: payload.topic,
168
- [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition)
169
- })
170
- ];
171
- const eachMessagePromise = api.context.with(api.trace.setSpan(propagatedContext, span), () => {
172
- return original.apply(this, args);
94
+ const sentryTrace = utils.getHeaderAsString(payload.message.headers, "sentry-trace");
95
+ const baggage = utils.getHeaderAsString(payload.message.headers, "baggage");
96
+ return core.continueTrace({ sentryTrace, baggage }, () => {
97
+ const span = utils.startConsumerSpan({
98
+ topic: payload.topic,
99
+ message: payload.message,
100
+ operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,
101
+ attributes: {
102
+ [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition)
103
+ }
104
+ });
105
+ const eachMessagePromise = core.withActiveSpan(span, () => {
106
+ return original.apply(this, args);
107
+ });
108
+ return utils.endSpansOnPromise([span], eachMessagePromise);
173
109
  });
174
- return instrumentation._endSpansOnPromise([span], pendingMetrics, eachMessagePromise);
175
110
  };
176
111
  };
177
112
  }
178
113
  _getConsumerEachBatchPatch() {
179
114
  return (original) => {
180
- const instrumentation = this;
181
115
  return function eachBatch(...args) {
182
116
  const payload = args[0];
183
- const receivingSpan = instrumentation._startConsumerSpan({
184
- topic: payload.batch.topic,
185
- message: void 0,
186
- operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,
187
- ctx: api.ROOT_CONTEXT,
188
- attributes: {
189
- [semconv.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]: payload.batch.messages.length,
190
- [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition)
191
- }
192
- });
193
- return api.context.with(api.trace.setSpan(api.context.active(), receivingSpan), () => {
194
- const startTime = Date.now();
195
- const spans = [];
196
- const pendingMetrics = [
197
- prepareCounter(instrumentation._consumedMessages, payload.batch.messages.length, {
198
- [semconv.ATTR_MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA,
199
- [semconv.ATTR_MESSAGING_OPERATION_NAME]: "process",
200
- [semconv.ATTR_MESSAGING_DESTINATION_NAME]: payload.batch.topic,
117
+ const receivingSpan = core.startNewTrace(
118
+ () => utils.startConsumerSpan({
119
+ topic: payload.batch.topic,
120
+ message: void 0,
121
+ operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,
122
+ attributes: {
123
+ [semconv.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]: payload.batch.messages.length,
201
124
  [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition)
202
- })
203
- ];
204
- payload.batch.messages.forEach((message) => {
205
- const propagatedContext = api.propagation.extract(api.ROOT_CONTEXT, message.headers, propagator.bufferTextMapGetter);
206
- const spanContext = api.trace.getSpan(propagatedContext)?.spanContext();
207
- let origSpanLink;
208
- if (spanContext) {
209
- origSpanLink = {
210
- context: spanContext
211
- };
212
125
  }
126
+ })
127
+ );
128
+ return core.withActiveSpan(receivingSpan, () => {
129
+ const spans = [receivingSpan];
130
+ payload.batch.messages.forEach((message) => {
213
131
  spans.push(
214
- instrumentation._startConsumerSpan({
132
+ utils.startConsumerSpan({
215
133
  topic: payload.batch.topic,
216
134
  message,
217
135
  operationType: semconv.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,
218
- link: origSpanLink,
136
+ links: utils.getLinksFromHeaders(message.headers),
219
137
  attributes: {
220
138
  [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition)
221
139
  }
222
140
  })
223
141
  );
224
- pendingMetrics.push(
225
- prepareDurationHistogram(instrumentation._processDuration, startTime, {
226
- [semconv.ATTR_MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA,
227
- [semconv.ATTR_MESSAGING_OPERATION_NAME]: "process",
228
- [semconv.ATTR_MESSAGING_DESTINATION_NAME]: payload.batch.topic,
229
- [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition)
230
- })
231
- );
232
142
  });
233
143
  const batchMessagePromise = original.apply(this, args);
234
- spans.unshift(receivingSpan);
235
- return instrumentation._endSpansOnPromise(spans, pendingMetrics, batchMessagePromise);
144
+ return utils.endSpansOnPromise(spans, batchMessagePromise);
236
145
  });
237
146
  };
238
147
  };
@@ -241,33 +150,31 @@ class KafkaJsInstrumentation extends instrumentation.InstrumentationBase {
241
150
  const instrumentation = this;
242
151
  return (original) => {
243
152
  return function transaction(...args) {
244
- const transactionSpan = instrumentation.tracer.startSpan("transaction");
153
+ const transactionSpan = core.startInactiveSpan({ name: "transaction" });
245
154
  const transactionPromise = original.apply(this, args);
246
155
  transactionPromise.then((transaction2) => {
247
156
  const originalSend = transaction2.send;
248
157
  transaction2.send = function send(...args2) {
249
- return api.context.with(api.trace.setSpan(api.context.active(), transactionSpan), () => {
158
+ return core.withActiveSpan(transactionSpan, () => {
250
159
  const patched = instrumentation._getSendPatch()(originalSend);
251
160
  return patched.apply(this, args2).catch((err) => {
252
161
  transactionSpan.setStatus({
253
- code: api.SpanStatusCode.ERROR,
162
+ code: core.SPAN_STATUS_ERROR,
254
163
  message: err?.message
255
164
  });
256
- transactionSpan.recordException(err);
257
165
  throw err;
258
166
  });
259
167
  });
260
168
  };
261
169
  const originalSendBatch = transaction2.sendBatch;
262
170
  transaction2.sendBatch = function sendBatch(...args2) {
263
- return api.context.with(api.trace.setSpan(api.context.active(), transactionSpan), () => {
171
+ return core.withActiveSpan(transactionSpan, () => {
264
172
  const patched = instrumentation._getSendBatchPatch()(originalSendBatch);
265
173
  return patched.apply(this, args2).catch((err) => {
266
174
  transactionSpan.setStatus({
267
- code: api.SpanStatusCode.ERROR,
175
+ code: core.SPAN_STATUS_ERROR,
268
176
  message: err?.message
269
177
  });
270
- transactionSpan.recordException(err);
271
178
  throw err;
272
179
  });
273
180
  });
@@ -275,21 +182,20 @@ class KafkaJsInstrumentation extends instrumentation.InstrumentationBase {
275
182
  const originalCommit = transaction2.commit;
276
183
  transaction2.commit = function commit(...args2) {
277
184
  const originCommitPromise = originalCommit.apply(this, args2).then(() => {
278
- transactionSpan.setStatus({ code: api.SpanStatusCode.OK });
185
+ transactionSpan.setStatus({ code: core.SPAN_STATUS_OK });
279
186
  });
280
- return instrumentation._endSpansOnPromise([transactionSpan], [], originCommitPromise);
187
+ return utils.endSpansOnPromise([transactionSpan], originCommitPromise);
281
188
  };
282
189
  const originalAbort = transaction2.abort;
283
190
  transaction2.abort = function abort(...args2) {
284
191
  const originAbortPromise = originalAbort.apply(this, args2);
285
- return instrumentation._endSpansOnPromise([transactionSpan], [], originAbortPromise);
192
+ return utils.endSpansOnPromise([transactionSpan], originAbortPromise);
286
193
  };
287
194
  }).catch((err) => {
288
195
  transactionSpan.setStatus({
289
- code: api.SpanStatusCode.ERROR,
196
+ code: core.SPAN_STATUS_ERROR,
290
197
  message: err?.message
291
198
  });
292
- transactionSpan.recordException(err);
293
199
  transactionSpan.end();
294
200
  });
295
201
  return transactionPromise;
@@ -297,141 +203,33 @@ class KafkaJsInstrumentation extends instrumentation.InstrumentationBase {
297
203
  };
298
204
  }
299
205
  _getSendBatchPatch() {
300
- const instrumentation = this;
301
206
  return (original) => {
302
207
  return function sendBatch(...args) {
303
208
  const batch = args[0];
304
209
  const messages = batch.topicMessages || [];
305
210
  const spans = [];
306
- const pendingMetrics = [];
307
211
  messages.forEach((topicMessage) => {
308
212
  topicMessage.messages.forEach((message) => {
309
- spans.push(instrumentation._startProducerSpan(topicMessage.topic, message));
310
- pendingMetrics.push(
311
- prepareCounter(instrumentation._sentMessages, 1, {
312
- [semconv.ATTR_MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA,
313
- [semconv.ATTR_MESSAGING_OPERATION_NAME]: "send",
314
- [semconv.ATTR_MESSAGING_DESTINATION_NAME]: topicMessage.topic,
315
- ...message.partition !== void 0 ? {
316
- [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(message.partition)
317
- } : {}
318
- })
319
- );
213
+ spans.push(utils.startProducerSpan(topicMessage.topic, message));
320
214
  });
321
215
  });
322
216
  const origSendResult = original.apply(this, args);
323
- return instrumentation._endSpansOnPromise(spans, pendingMetrics, origSendResult);
217
+ return utils.endSpansOnPromise(spans, origSendResult);
324
218
  };
325
219
  };
326
220
  }
327
221
  _getSendPatch() {
328
- const instrumentation = this;
329
222
  return (original) => {
330
223
  return function send(...args) {
331
224
  const record = args[0];
332
225
  const spans = record.messages.map((message) => {
333
- return instrumentation._startProducerSpan(record.topic, message);
226
+ return utils.startProducerSpan(record.topic, message);
334
227
  });
335
- const pendingMetrics = record.messages.map(
336
- (m) => prepareCounter(instrumentation._sentMessages, 1, {
337
- [semconv.ATTR_MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA,
338
- [semconv.ATTR_MESSAGING_OPERATION_NAME]: "send",
339
- [semconv.ATTR_MESSAGING_DESTINATION_NAME]: record.topic,
340
- ...m.partition !== void 0 ? {
341
- [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(m.partition)
342
- } : {}
343
- })
344
- );
345
228
  const origSendResult = original.apply(this, args);
346
- return instrumentation._endSpansOnPromise(spans, pendingMetrics, origSendResult);
229
+ return utils.endSpansOnPromise(spans, origSendResult);
347
230
  };
348
231
  };
349
232
  }
350
- _endSpansOnPromise(spans, pendingMetrics, sendPromise) {
351
- return Promise.resolve(sendPromise).then((result) => {
352
- pendingMetrics.forEach((m) => m());
353
- return result;
354
- }).catch((reason) => {
355
- let errorMessage;
356
- let errorType = semanticConventions.ERROR_TYPE_VALUE_OTHER;
357
- if (typeof reason === "string" || reason === void 0) {
358
- errorMessage = reason;
359
- } else if (typeof reason === "object" && Object.prototype.hasOwnProperty.call(reason, "message")) {
360
- errorMessage = reason.message;
361
- errorType = reason.constructor.name;
362
- }
363
- pendingMetrics.forEach((m) => m(errorType));
364
- spans.forEach((span) => {
365
- span.setAttribute(semanticConventions.ATTR_ERROR_TYPE, errorType);
366
- span.setStatus({
367
- code: api.SpanStatusCode.ERROR,
368
- message: errorMessage
369
- });
370
- });
371
- throw reason;
372
- }).finally(() => {
373
- spans.forEach((span) => span.end());
374
- });
375
- }
376
- _startConsumerSpan({ topic, message, operationType, ctx, link, attributes }) {
377
- const operationName = operationType === semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? "poll" : operationType;
378
- const span = this.tracer.startSpan(
379
- `${operationName} ${topic}`,
380
- {
381
- kind: operationType === semconv.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE ? api.SpanKind.CLIENT : api.SpanKind.CONSUMER,
382
- attributes: {
383
- ...attributes,
384
- [semconv.ATTR_MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA,
385
- [semconv.ATTR_MESSAGING_DESTINATION_NAME]: topic,
386
- [semconv.ATTR_MESSAGING_OPERATION_TYPE]: operationType,
387
- [semconv.ATTR_MESSAGING_OPERATION_NAME]: operationName,
388
- [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message?.key ? String(message.key) : void 0,
389
- [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message?.key && message.value === null ? true : void 0,
390
- [semconv.ATTR_MESSAGING_KAFKA_OFFSET]: message?.offset
391
- },
392
- links: link ? [link] : []
393
- },
394
- ctx
395
- );
396
- const { consumerHook } = this.getConfig();
397
- if (consumerHook && message) {
398
- instrumentation.safeExecuteInTheMiddle(
399
- () => consumerHook(span, { topic, message }),
400
- (e) => {
401
- if (e) this._diag.error("consumerHook error", e);
402
- },
403
- true
404
- );
405
- }
406
- return span;
407
- }
408
- _startProducerSpan(topic, message) {
409
- const span = this.tracer.startSpan(`send ${topic}`, {
410
- kind: api.SpanKind.PRODUCER,
411
- attributes: {
412
- [semconv.ATTR_MESSAGING_SYSTEM]: semconv.MESSAGING_SYSTEM_VALUE_KAFKA,
413
- [semconv.ATTR_MESSAGING_DESTINATION_NAME]: topic,
414
- [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]: message.key ? String(message.key) : void 0,
415
- [semconv.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]: message.key && message.value === null ? true : void 0,
416
- [semconv.ATTR_MESSAGING_DESTINATION_PARTITION_ID]: message.partition !== void 0 ? String(message.partition) : void 0,
417
- [semconv.ATTR_MESSAGING_OPERATION_NAME]: "send",
418
- [semconv.ATTR_MESSAGING_OPERATION_TYPE]: semconv.MESSAGING_OPERATION_TYPE_VALUE_SEND
419
- }
420
- });
421
- message.headers = message.headers ?? {};
422
- api.propagation.inject(api.trace.setSpan(api.context.active(), span), message.headers);
423
- const { producerHook } = this.getConfig();
424
- if (producerHook) {
425
- instrumentation.safeExecuteInTheMiddle(
426
- () => producerHook(span, { topic, message }),
427
- (e) => {
428
- if (e) this._diag.error("producerHook error", e);
429
- },
430
- true
431
- );
432
- }
433
- return span;
434
- }
435
233
  }
436
234
 
437
235
  exports.KafkaJsInstrumentation = KafkaJsInstrumentation;
@@ -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":["ATTR_ERROR_TYPE","InstrumentationBase","SDK_VERSION","METRIC_MESSAGING_CLIENT_OPERATION_DURATION","METRIC_MESSAGING_CLIENT_SENT_MESSAGES","METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES","METRIC_MESSAGING_PROCESS_DURATION","isWrapped","InstrumentationNodeModuleDefinition","instrumentation","EVENT_LISTENERS_SET","ATTR_MESSAGING_SYSTEM","MESSAGING_SYSTEM_VALUE_KAFKA","ATTR_MESSAGING_OPERATION_NAME","ATTR_SERVER_ADDRESS","ATTR_SERVER_PORT","propagation","ROOT_CONTEXT","bufferTextMapGetter","MESSAGING_OPERATION_TYPE_VALUE_PROCESS","ATTR_MESSAGING_DESTINATION_PARTITION_ID","ATTR_MESSAGING_DESTINATION_NAME","context","trace","MESSAGING_OPERATION_TYPE_VALUE_RECEIVE","ATTR_MESSAGING_BATCH_MESSAGE_COUNT","transaction","args","SpanStatusCode","ERROR_TYPE_VALUE_OTHER","SpanKind","ATTR_MESSAGING_OPERATION_TYPE","ATTR_MESSAGING_KAFKA_MESSAGE_KEY","ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE","ATTR_MESSAGING_KAFKA_OFFSET","safeExecuteInTheMiddle","MESSAGING_OPERATION_TYPE_VALUE_SEND"],"mappings":";;;;;;;;;;AA4FA,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,CAACA,mCAAe,GAAG,SAAA,KAAc;AAAC,KACrD,CAAA;AAAA,EACH,CAAA;AACF;AAEA,SAAS,wBAAA,CACP,KAAA,EACA,KAAA,EACA,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+B,GAAG,KAAA;AAAA,QACnC,CAACW,wCAAgC,GAAG,OAAA,CAAQ,MAAM,MAAA,CAAO,OAAA,CAAQ,GAAG,CAAA,GAAI,MAAA;AAAA,QACxE,CAACC,8CAAsC,GAAG,OAAA,CAAQ,OAAO,OAAA,CAAQ,KAAA,KAAU,OAAO,IAAA,GAAO,MAAA;AAAA,QACzF,CAACb,+CAAuC,GACtC,OAAA,CAAQ,cAAc,MAAA,GAAY,MAAA,CAAO,OAAA,CAAQ,SAAS,CAAA,GAAI,MAAA;AAAA,QAChE,CAACP,qCAA6B,GAAG,MAAA;AAAA,QACjC,CAACkB,qCAA6B,GAAGK;AAAA;AACnC,KACD,CAAA;AAED,IAAA,OAAA,CAAQ,OAAA,GAAU,OAAA,CAAQ,OAAA,IAAW,EAAC;AACtC,IAAApB,eAAA,CAAY,MAAA,CAAOO,UAAM,OAAA,CAAQD,WAAA,CAAQ,QAAO,EAAG,IAAI,CAAA,EAAG,OAAA,CAAQ,OAAO,CAAA;AAEzE,IAAA,MAAM,EAAE,YAAA,EAAa,GAAI,IAAA,CAAK,SAAA,EAAU;AACxC,IAAA,IAAI,YAAA,EAAc;AAChB,MAAAa,sCAAA;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
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/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 * - Refactored to use Sentry's span APIs instead of OpenTelemetry tracing APIs\n * - Cross-broker trace propagation uses Sentry's `getTraceData`/`continueTrace` instead of the OTel\n * propagator, so the vendored `bufferTextMapGetter` propagator is gone\n * - Dropped the OTel metrics (no MeterProvider is wired up) and, with them, the `network.request`\n * event listeners they relied on; origin is folded into span creation instead of `index.ts` hooks\n */\n\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport type { Span } from '@sentry/core';\nimport {\n continueTrace,\n SDK_VERSION,\n SPAN_STATUS_ERROR,\n SPAN_STATUS_OK,\n startInactiveSpan,\n startNewTrace,\n withActiveSpan,\n} from '@sentry/core';\nimport type {\n Consumer,\n ConsumerRunConfig,\n EachBatchHandler,\n EachMessageHandler,\n Kafka,\n KafkaMessage,\n Producer,\n RecordMetadata,\n Transaction,\n} from './kafkajs-types';\nimport {\n ATTR_MESSAGING_BATCH_MESSAGE_COUNT,\n ATTR_MESSAGING_DESTINATION_PARTITION_ID,\n MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,\n} from './semconv';\nimport {\n endSpansOnPromise,\n getHeaderAsString,\n getLinksFromHeaders,\n startConsumerSpan,\n startProducerSpan,\n} from './utils';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-kafkajs';\n\nexport class KafkaJsInstrumentation extends InstrumentationBase<InstrumentationConfig> {\n public constructor(config: InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init(): InstrumentationNodeModuleDefinition {\n const unpatch = (moduleExports: any): void => {\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 // oxlint-disable-next-line typescript/unbound-method -- property check, the method is never called\n if (isWrapped(newConsumer.run)) {\n instrumentation._unwrap(newConsumer, 'run');\n }\n\n instrumentation._wrap(newConsumer, 'run', instrumentation._getConsumerRunPatch());\n\n return newConsumer;\n };\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 // oxlint-disable-next-line typescript/unbound-method -- property check, the method is never called\n if (isWrapped(newProducer.sendBatch)) {\n instrumentation._unwrap(newProducer, 'sendBatch');\n }\n instrumentation._wrap(newProducer, 'sendBatch', instrumentation._getSendBatchPatch());\n\n // oxlint-disable-next-line typescript/unbound-method -- property check, the method is never called\n if (isWrapped(newProducer.send)) {\n instrumentation._unwrap(newProducer, 'send');\n }\n instrumentation._wrap(newProducer, 'send', instrumentation._getSendPatch());\n\n // oxlint-disable-next-line typescript/unbound-method -- property check, the method is never called\n if (isWrapped(newProducer.transaction)) {\n instrumentation._unwrap(newProducer, 'transaction');\n }\n instrumentation._wrap(newProducer, 'transaction', instrumentation._getProducerTransactionPatch());\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 return (original: ConsumerRunConfig['eachMessage']) => {\n return function eachMessage(this: unknown, ...args: Parameters<EachMessageHandler>): Promise<void> {\n const payload = args[0];\n const sentryTrace = getHeaderAsString(payload.message.headers, 'sentry-trace');\n const baggage = getHeaderAsString(payload.message.headers, 'baggage');\n\n // Continue the producer's trace so the consumer span is parented to the message's producer.\n return continueTrace({ sentryTrace, baggage }, () => {\n const span = startConsumerSpan({\n topic: payload.topic,\n message: payload.message,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n attributes: {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.partition),\n },\n });\n\n const eachMessagePromise = withActiveSpan(span, () => {\n return original!.apply(this, args);\n });\n return endSpansOnPromise([span], eachMessagePromise);\n });\n };\n };\n }\n\n private _getConsumerEachBatchPatch() {\n return (original: ConsumerRunConfig['eachBatch']) => {\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 // A batch pull aggregates messages from many producers, so the receiving span is a fresh root\n // trace and each processed message links back to its own producer span.\n const receivingSpan = startNewTrace(() =>\n startConsumerSpan({\n topic: payload.batch.topic,\n message: undefined,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,\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 );\n\n return withActiveSpan(receivingSpan, () => {\n const spans: Span[] = [receivingSpan];\n payload.batch.messages.forEach((message: KafkaMessage) => {\n spans.push(\n startConsumerSpan({\n topic: payload.batch.topic,\n message,\n operationType: MESSAGING_OPERATION_TYPE_VALUE_PROCESS,\n links: getLinksFromHeaders(message.headers),\n attributes: {\n [ATTR_MESSAGING_DESTINATION_PARTITION_ID]: String(payload.batch.partition),\n },\n }),\n );\n });\n const batchMessagePromise: Promise<void> = original!.apply(this, args);\n return endSpansOnPromise(spans, 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 = startInactiveSpan({ name: 'transaction' });\n\n const transactionPromise = original.apply(this, args);\n\n transactionPromise\n .then((transaction: Transaction) => {\n // oxlint-disable-next-line typescript/unbound-method -- re-bound below via `.apply(this, args)`\n const originalSend = transaction.send;\n transaction.send = function send(this: Transaction, ...args) {\n return withActiveSpan(transactionSpan, () => {\n const patched = instrumentation._getSendPatch()(originalSend);\n return patched.apply(this, args).catch((err: any) => {\n transactionSpan.setStatus({\n code: SPAN_STATUS_ERROR,\n message: err?.message,\n });\n throw err;\n });\n });\n };\n\n // oxlint-disable-next-line typescript/unbound-method -- re-bound below via `.apply(this, args)`\n const originalSendBatch = transaction.sendBatch;\n transaction.sendBatch = function sendBatch(this: Transaction, ...args) {\n return withActiveSpan(transactionSpan, () => {\n const patched = instrumentation._getSendBatchPatch()(originalSendBatch);\n return patched.apply(this, args).catch((err: any) => {\n transactionSpan.setStatus({\n code: SPAN_STATUS_ERROR,\n message: err?.message,\n });\n throw err;\n });\n });\n };\n\n // oxlint-disable-next-line typescript/unbound-method -- re-bound below via `.apply(this, args)`\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: SPAN_STATUS_OK });\n });\n return endSpansOnPromise([transactionSpan], originCommitPromise);\n };\n\n // oxlint-disable-next-line typescript/unbound-method -- re-bound below via `.apply(this, args)`\n const originalAbort = transaction.abort;\n transaction.abort = function abort(this: Transaction, ...args) {\n const originAbortPromise = originalAbort.apply(this, args);\n return endSpansOnPromise([transactionSpan], originAbortPromise);\n };\n })\n .catch((err: any) => {\n transactionSpan.setStatus({\n code: SPAN_STATUS_ERROR,\n message: err?.message,\n });\n transactionSpan.end();\n });\n\n return transactionPromise;\n };\n };\n }\n\n private _getSendBatchPatch() {\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\n messages.forEach((topicMessage: any) => {\n topicMessage.messages.forEach((message: any) => {\n spans.push(startProducerSpan(topicMessage.topic, message));\n });\n });\n const origSendResult: Promise<RecordMetadata[]> = original.apply(this, args);\n return endSpansOnPromise(spans, origSendResult);\n };\n };\n }\n\n private _getSendPatch() {\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 startProducerSpan(record.topic, message);\n });\n\n const origSendResult: Promise<RecordMetadata[]> = original.apply(this, args);\n return endSpansOnPromise(spans, origSendResult);\n };\n };\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","isWrapped","InstrumentationNodeModuleDefinition","instrumentation","getHeaderAsString","continueTrace","startConsumerSpan","MESSAGING_OPERATION_TYPE_VALUE_PROCESS","ATTR_MESSAGING_DESTINATION_PARTITION_ID","withActiveSpan","endSpansOnPromise","startNewTrace","MESSAGING_OPERATION_TYPE_VALUE_RECEIVE","ATTR_MESSAGING_BATCH_MESSAGE_COUNT","getLinksFromHeaders","startInactiveSpan","transaction","args","SPAN_STATUS_ERROR","SPAN_STATUS_OK","startProducerSpan"],"mappings":";;;;;;;AAoDA,MAAM,YAAA,GAAe,iCAAA;AAEd,MAAM,+BAA+BA,mCAAA,CAA2C;AAAA,EAC9E,WAAA,CAAY,MAAA,GAAgC,EAAC,EAAG;AACrD,IAAA,KAAA,CAAM,YAAA,EAAcC,kBAAa,MAAM,CAAA;AAAA,EACzC;AAAA,EAEU,IAAA,GAA4C;AACpD,IAAA,MAAM,OAAA,GAAU,CAAC,aAAA,KAA6B;AAC5C,MAAA,IAAIC,yBAAA,CAAU,aAAA,EAAe,KAAA,EAAO,SAAA,CAAU,QAAQ,CAAA,EAAG;AACvD,QAAA,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,KAAA,CAAM,SAAA,EAAW,UAAU,CAAA;AAAA,MACxD;AACA,MAAA,IAAIA,yBAAA,CAAU,aAAA,EAAe,KAAA,EAAO,SAAA,CAAU,QAAQ,CAAA,EAAG;AACvD,QAAA,IAAA,CAAK,OAAA,CAAQ,aAAA,CAAc,KAAA,CAAM,SAAA,EAAW,UAAU,CAAA;AAAA,MACxD;AAAA,IACF,CAAA;AAEA,IAAA,MAAM,SAAS,IAAIC,mDAAA;AAAA,MACjB,SAAA;AAAA,MACA,CAAC,YAAY,CAAA;AAAA,MACb,CAAC,aAAA,KAAuB;AACtB,QAAA,OAAA,CAAQ,aAAa,CAAA;AACrB,QAAA,IAAA,CAAK,MAAM,aAAA,EAAe,KAAA,EAAO,WAAW,UAAA,EAAY,IAAA,CAAK,mBAAmB,CAAA;AAChF,QAAA,IAAA,CAAK,MAAM,aAAA,EAAe,KAAA,EAAO,WAAW,UAAA,EAAY,IAAA,CAAK,mBAAmB,CAAA;AAEhF,QAAA,OA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B,EAAC;AAEzC,QAAA,MAAM,QAAgB,EAAC;AAEvB,QAAA,QAAA,CAAS,OAAA,CAAQ,CAAC,YAAA,KAAsB;AACtC,UAAA,YAAA,CAAa,QAAA,CAAS,OAAA,CAAQ,CAAC,OAAA,KAAiB;AAC9C,YAAA,KAAA,CAAM,IAAA,CAAKE,uBAAA,CAAkB,YAAA,CAAa,KAAA,EAAO,OAAO,CAAC,CAAA;AAAA,UAC3D,CAAC,CAAA;AAAA,QACH,CAAC,CAAA;AACD,QAAA,MAAM,cAAA,GAA4C,QAAA,CAAS,KAAA,CAAM,IAAA,EAAM,IAAI,CAAA;AAC3E,QAAA,OAAOV,uBAAA,CAAkB,OAAO,cAAc,CAAA;AAAA,MAChD,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AAAA,EAEQ,aAAA,GAAgB;AACtB,IAAA,OAAO,CAAC,QAAA,KAAqD;AAC3D,MAAA,OAAO,SAAS,QAEX,IAAA,EAC2B;AAC9B,QAAA,MAAM,MAAA,GAAS,KAAK,CAAC,CAAA;AACrB,QAAA,MAAM,KAAA,GAAgB,MAAA,CAAO,QAAA,CAAS,GAAA,CAAI,CAAC,OAAA,KAAiB;AAC1D,UAAA,OAAOU,uBAAA,CAAkB,MAAA,CAAO,KAAA,EAAO,OAAO,CAAA;AAAA,QAChD,CAAC,CAAA;AAED,QAAA,MAAM,cAAA,GAA4C,QAAA,CAAS,KAAA,CAAM,IAAA,EAAM,IAAI,CAAA;AAC3E,QAAA,OAAOV,uBAAA,CAAkB,OAAO,cAAc,CAAA;AAAA,MAChD,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AACF;;;;"}
@@ -13,11 +13,10 @@ const MESSAGING_OPERATION_TYPE_VALUE_PROCESS = "process";
13
13
  const MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = "receive";
14
14
  const MESSAGING_OPERATION_TYPE_VALUE_SEND = "send";
15
15
  const MESSAGING_SYSTEM_VALUE_KAFKA = "kafka";
16
- const METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES = "messaging.client.consumed.messages";
17
- const METRIC_MESSAGING_CLIENT_OPERATION_DURATION = "messaging.client.operation.duration";
18
- const METRIC_MESSAGING_CLIENT_SENT_MESSAGES = "messaging.client.sent.messages";
19
- const METRIC_MESSAGING_PROCESS_DURATION = "messaging.process.duration";
16
+ const ATTR_ERROR_TYPE = "error.type";
17
+ const ERROR_TYPE_VALUE_OTHER = "_OTHER";
20
18
 
19
+ exports.ATTR_ERROR_TYPE = ATTR_ERROR_TYPE;
21
20
  exports.ATTR_MESSAGING_BATCH_MESSAGE_COUNT = ATTR_MESSAGING_BATCH_MESSAGE_COUNT;
22
21
  exports.ATTR_MESSAGING_DESTINATION_NAME = ATTR_MESSAGING_DESTINATION_NAME;
23
22
  exports.ATTR_MESSAGING_DESTINATION_PARTITION_ID = ATTR_MESSAGING_DESTINATION_PARTITION_ID;
@@ -27,12 +26,9 @@ exports.ATTR_MESSAGING_KAFKA_OFFSET = ATTR_MESSAGING_KAFKA_OFFSET;
27
26
  exports.ATTR_MESSAGING_OPERATION_NAME = ATTR_MESSAGING_OPERATION_NAME;
28
27
  exports.ATTR_MESSAGING_OPERATION_TYPE = ATTR_MESSAGING_OPERATION_TYPE;
29
28
  exports.ATTR_MESSAGING_SYSTEM = ATTR_MESSAGING_SYSTEM;
29
+ exports.ERROR_TYPE_VALUE_OTHER = ERROR_TYPE_VALUE_OTHER;
30
30
  exports.MESSAGING_OPERATION_TYPE_VALUE_PROCESS = MESSAGING_OPERATION_TYPE_VALUE_PROCESS;
31
31
  exports.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE = MESSAGING_OPERATION_TYPE_VALUE_RECEIVE;
32
32
  exports.MESSAGING_OPERATION_TYPE_VALUE_SEND = MESSAGING_OPERATION_TYPE_VALUE_SEND;
33
33
  exports.MESSAGING_SYSTEM_VALUE_KAFKA = MESSAGING_SYSTEM_VALUE_KAFKA;
34
- exports.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES = METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES;
35
- exports.METRIC_MESSAGING_CLIENT_OPERATION_DURATION = METRIC_MESSAGING_CLIENT_OPERATION_DURATION;
36
- exports.METRIC_MESSAGING_CLIENT_SENT_MESSAGES = METRIC_MESSAGING_CLIENT_SENT_MESSAGES;
37
- exports.METRIC_MESSAGING_PROCESS_DURATION = METRIC_MESSAGING_PROCESS_DURATION;
38
34
  //# sourceMappingURL=semconv.js.map