@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,66 +1,38 @@
1
- import { SpanStatusCode, diag } from '@opentelemetry/api';
2
- import { SemconvStability, safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';
3
- import { ATTR_DB_MONGODB_COLLECTION, ATTR_DB_NAME, ATTR_DB_USER, ATTR_NET_PEER_NAME, ATTR_NET_PEER_PORT } from './semconv.js';
4
- import { ATTR_DB_COLLECTION_NAME, ATTR_DB_NAMESPACE, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT } from '@opentelemetry/semantic-conventions';
1
+ import { SPAN_STATUS_ERROR } from '@sentry/core';
2
+ import { ATTR_NET_PEER_PORT, ATTR_NET_PEER_NAME, ATTR_DB_USER, ATTR_DB_NAME, ATTR_DB_MONGODB_COLLECTION } from './semconv.js';
5
3
 
6
- function getAttributesFromCollection(collection, dbSemconvStability, netSemconvStability) {
7
- const attrs = {};
8
- if (dbSemconvStability & SemconvStability.OLD) {
9
- attrs[ATTR_DB_MONGODB_COLLECTION] = collection.name;
10
- attrs[ATTR_DB_NAME] = collection.conn.name;
11
- attrs[ATTR_DB_USER] = collection.conn.user;
12
- }
13
- if (dbSemconvStability & SemconvStability.STABLE) {
14
- attrs[ATTR_DB_COLLECTION_NAME] = collection.name;
15
- attrs[ATTR_DB_NAMESPACE] = collection.conn.name;
16
- }
17
- if (netSemconvStability & SemconvStability.OLD) {
18
- attrs[ATTR_NET_PEER_NAME] = collection.conn.host;
19
- attrs[ATTR_NET_PEER_PORT] = collection.conn.port;
20
- }
21
- if (netSemconvStability & SemconvStability.STABLE) {
22
- attrs[ATTR_SERVER_ADDRESS] = collection.conn.host;
23
- attrs[ATTR_SERVER_PORT] = collection.conn.port;
24
- }
25
- return attrs;
4
+ function getAttributesFromCollection(collection) {
5
+ return {
6
+ // eslint-disable-next-line typescript/no-deprecated
7
+ [ATTR_DB_MONGODB_COLLECTION]: collection.name,
8
+ // eslint-disable-next-line typescript/no-deprecated
9
+ [ATTR_DB_NAME]: collection.conn.name,
10
+ // eslint-disable-next-line typescript/no-deprecated
11
+ [ATTR_DB_USER]: collection.conn.user,
12
+ // eslint-disable-next-line typescript/no-deprecated
13
+ [ATTR_NET_PEER_NAME]: collection.conn.host,
14
+ // eslint-disable-next-line typescript/no-deprecated
15
+ [ATTR_NET_PEER_PORT]: collection.conn.port
16
+ };
26
17
  }
27
- function setErrorStatus(span, error = {}) {
28
- span.recordException(error);
18
+ function setErrorStatus(span, error) {
29
19
  span.setStatus({
30
- code: SpanStatusCode.ERROR,
20
+ code: SPAN_STATUS_ERROR,
31
21
  message: `${error.message} ${error.code ? `
32
22
  Mongoose Error Code: ${error.code}` : ""}`
33
23
  });
34
24
  }
35
- function applyResponseHook(span, response, responseHook, moduleVersion = void 0) {
36
- if (!responseHook) {
37
- return;
38
- }
39
- safeExecuteInTheMiddle(
40
- () => responseHook(span, { moduleVersion, response }),
41
- (e) => {
42
- if (e) {
43
- diag.error("mongoose instrumentation: responseHook error", e);
44
- }
45
- },
46
- true
47
- );
48
- }
49
- function handlePromiseResponse(execResponse, span, responseHook, moduleVersion = void 0) {
25
+ function handlePromiseResponse(execResponse, span) {
50
26
  if (!(execResponse instanceof Promise)) {
51
- applyResponseHook(span, execResponse, responseHook, moduleVersion);
52
27
  span.end();
53
28
  return execResponse;
54
29
  }
55
- return execResponse.then((response) => {
56
- applyResponseHook(span, response, responseHook, moduleVersion);
57
- return response;
58
- }).catch((err) => {
30
+ return execResponse.catch((err) => {
59
31
  setErrorStatus(span, err);
60
32
  throw err;
61
33
  }).finally(() => span.end());
62
34
  }
63
- function handleCallbackResponse(callback, exec, originalThis, span, args, responseHook, moduleVersion = void 0) {
35
+ function handleCallbackResponse(callback, exec, originalThis, span, args) {
64
36
  let callbackArgumentIndex = 0;
65
37
  if (args.length === 2) {
66
38
  callbackArgumentIndex = 1;
@@ -70,8 +42,6 @@ function handleCallbackResponse(callback, exec, originalThis, span, args, respon
70
42
  args[callbackArgumentIndex] = (err, response) => {
71
43
  if (err) {
72
44
  setErrorStatus(span, err);
73
- } else {
74
- applyResponseHook(span, response, responseHook, moduleVersion);
75
45
  }
76
46
  span.end();
77
47
  return callback(err, response);
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/mongoose/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mongoose\n * - Upstream version: @opentelemetry/instrumentation-mongoose@0.64.0\n * - Types vendored from mongoose as simplified interfaces\n */\n/* eslint-disable */\n\nimport { Attributes, SpanStatusCode, diag, Span } from '@opentelemetry/api';\nimport type { Collection } from './mongoose-types';\nimport { MongooseResponseCustomAttributesFunction } from './types';\nimport { safeExecuteInTheMiddle, SemconvStability } from '@opentelemetry/instrumentation';\nimport {\n ATTR_DB_MONGODB_COLLECTION,\n ATTR_DB_NAME,\n ATTR_DB_USER,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n} from './semconv';\nimport {\n ATTR_DB_COLLECTION_NAME,\n ATTR_DB_NAMESPACE,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n} from '@opentelemetry/semantic-conventions';\n\nexport function getAttributesFromCollection(\n collection: Collection,\n dbSemconvStability: SemconvStability,\n netSemconvStability: SemconvStability,\n): Attributes {\n const attrs: Attributes = {};\n\n if (dbSemconvStability & SemconvStability.OLD) {\n attrs[ATTR_DB_MONGODB_COLLECTION] = collection.name;\n attrs[ATTR_DB_NAME] = collection.conn.name;\n attrs[ATTR_DB_USER] = collection.conn.user;\n }\n if (dbSemconvStability & SemconvStability.STABLE) {\n attrs[ATTR_DB_COLLECTION_NAME] = collection.name;\n attrs[ATTR_DB_NAMESPACE] = collection.conn.name;\n }\n\n if (netSemconvStability & SemconvStability.OLD) {\n attrs[ATTR_NET_PEER_NAME] = collection.conn.host;\n attrs[ATTR_NET_PEER_PORT] = collection.conn.port;\n }\n if (netSemconvStability & SemconvStability.STABLE) {\n attrs[ATTR_SERVER_ADDRESS] = collection.conn.host;\n attrs[ATTR_SERVER_PORT] = collection.conn.port;\n }\n\n return attrs;\n}\n\nfunction setErrorStatus(span: Span, error: any = {}) {\n span.recordException(error);\n\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: `${error.message} ${error.code ? `\\nMongoose Error Code: ${error.code}` : ''}`,\n });\n}\n\nfunction applyResponseHook(\n span: Span,\n response: any,\n responseHook?: MongooseResponseCustomAttributesFunction,\n moduleVersion: string | undefined = undefined,\n) {\n if (!responseHook) {\n return;\n }\n\n safeExecuteInTheMiddle(\n () => responseHook(span, { moduleVersion, response }),\n e => {\n if (e) {\n diag.error('mongoose instrumentation: responseHook error', e);\n }\n },\n true,\n );\n}\n\nexport function handlePromiseResponse(\n execResponse: any,\n span: Span,\n responseHook?: MongooseResponseCustomAttributesFunction,\n moduleVersion: string | undefined = undefined,\n): any {\n if (!(execResponse instanceof Promise)) {\n applyResponseHook(span, execResponse, responseHook, moduleVersion);\n span.end();\n return execResponse;\n }\n\n return execResponse\n .then(response => {\n applyResponseHook(span, response, responseHook, moduleVersion);\n return response;\n })\n .catch(err => {\n setErrorStatus(span, err);\n throw err;\n })\n .finally(() => span.end());\n}\n\nexport function handleCallbackResponse(\n callback: Function,\n exec: Function,\n originalThis: any,\n span: Span,\n args: IArguments,\n responseHook?: MongooseResponseCustomAttributesFunction,\n moduleVersion: string | undefined = undefined,\n) {\n let callbackArgumentIndex = 0;\n if (args.length === 2) {\n callbackArgumentIndex = 1;\n } else if (args.length === 3) {\n callbackArgumentIndex = 2;\n }\n\n args[callbackArgumentIndex] = (err: Error, response: any): any => {\n if (err) {\n setErrorStatus(span, err);\n } else {\n applyResponseHook(span, response, responseHook, moduleVersion);\n }\n\n span.end();\n return callback!(err, response);\n };\n\n return exec.apply(originalThis, args);\n}\n"],"names":[],"mappings":";;;;;AAwCO,SAAS,2BAAA,CACd,UAAA,EACA,kBAAA,EACA,mBAAA,EACY;AACZ,EAAA,MAAM,QAAoB,EAAC;AAE3B,EAAA,IAAI,kBAAA,GAAqB,iBAAiB,GAAA,EAAK;AAC7C,IAAA,KAAA,CAAM,0BAA0B,IAAI,UAAA,CAAW,IAAA;AAC/C,IAAA,KAAA,CAAM,YAAY,CAAA,GAAI,UAAA,CAAW,IAAA,CAAK,IAAA;AACtC,IAAA,KAAA,CAAM,YAAY,CAAA,GAAI,UAAA,CAAW,IAAA,CAAK,IAAA;AAAA,EACxC;AACA,EAAA,IAAI,kBAAA,GAAqB,iBAAiB,MAAA,EAAQ;AAChD,IAAA,KAAA,CAAM,uBAAuB,IAAI,UAAA,CAAW,IAAA;AAC5C,IAAA,KAAA,CAAM,iBAAiB,CAAA,GAAI,UAAA,CAAW,IAAA,CAAK,IAAA;AAAA,EAC7C;AAEA,EAAA,IAAI,mBAAA,GAAsB,iBAAiB,GAAA,EAAK;AAC9C,IAA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AA;AAEA,EAAA,OAAO,IAAA,CAAK,KAAA,CAAM,YAAA,EAAc,IAAI,CAAA;AACtC;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/mongoose/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mongoose\n * - Upstream version: @opentelemetry/instrumentation-mongoose@0.64.0\n * - Types vendored from mongoose as simplified interfaces\n * - Refactored to use Sentry's span APIs instead of OpenTelemetry tracing APIs\n */\n\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport { SPAN_STATUS_ERROR } from '@sentry/core';\nimport type { Collection, MongooseError } from './mongoose-types';\nimport {\n ATTR_DB_MONGODB_COLLECTION,\n ATTR_DB_NAME,\n ATTR_DB_USER,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n} from './semconv';\n\nexport function getAttributesFromCollection(collection: Collection): SpanAttributes {\n return {\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_DB_MONGODB_COLLECTION]: collection.name,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_DB_NAME]: collection.conn.name,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_DB_USER]: collection.conn.user,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_NET_PEER_NAME]: collection.conn.host,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_NET_PEER_PORT]: collection.conn.port,\n };\n}\n\nfunction setErrorStatus(span: Span, error: MongooseError): void {\n span.setStatus({\n code: SPAN_STATUS_ERROR,\n message: `${error.message} ${error.code ? `\\nMongoose Error Code: ${error.code}` : ''}`,\n });\n}\n\nexport function handlePromiseResponse(execResponse: any, span: Span): any {\n if (!(execResponse instanceof Promise)) {\n span.end();\n return execResponse;\n }\n\n return execResponse\n .catch((err: any) => {\n setErrorStatus(span, err);\n throw err;\n })\n .finally(() => span.end());\n}\n\nexport function handleCallbackResponse(\n callback: Function,\n exec: Function,\n originalThis: any,\n span: Span,\n args: IArguments,\n) {\n let callbackArgumentIndex = 0;\n if (args.length === 2) {\n callbackArgumentIndex = 1;\n } else if (args.length === 3) {\n callbackArgumentIndex = 2;\n }\n\n args[callbackArgumentIndex] = (err: Error, response: any): any => {\n if (err) {\n setErrorStatus(span, err);\n }\n\n span.end();\n return callback(err, response);\n };\n\n return exec.apply(originalThis, args);\n}\n"],"names":[],"mappings":";;;AAsBO,SAAS,4BAA4B,UAAA,EAAwC;AAClF,EAAA,OAAO;AAAA;AAAA,IAEL,CAAC,0BAA0B,GAAG,UAAA,CAAW,IAAA;AAAA;AAAA,IAEzC,CAAC,YAAY,GAAG,UAAA,CAAW,IAAA,CAAK,IAAA;AAAA;AAAA,IAEhC,CAAC,YAAY,GAAG,UAAA,CAAW,IAAA,CAAK,IAAA;AAAA;AAAA,IAEhC,CAAC,kBAAkB,GAAG,UAAA,CAAW,IAAA,CAAK,IAAA;AAAA;AAAA,IAEtC,CAAC,kBAAkB,GAAG,UAAA,CAAW,IAAA,CAAK;AAAA,GACxC;AACF;AAEA,SAAS,cAAA,CAAe,MAAY,KAAA,EAA4B;AAC9D,EAAA,IAAA,CAAK,SAAA,CAAU;AAAA,IACb,IAAA,EAAM,iBAAA;AAAA,IACN,SAAS,CAAA,EAAG,KAAA,CAAM,OAAO,CAAA,CAAA,EAAI,MAAM,IAAA,GAAO;AAAA,qBAAA,EAA0B,KAAA,CAAM,IAAI,CAAA,CAAA,GAAK,EAAE,CAAA;AAAA,GACtF,CAAA;AACH;AAEO,SAAS,qBAAA,CAAsB,cAAmB,IAAA,EAAiB;AACxE,EAAA,IAAI,EAAE,wBAAwB,OAAA,CAAA,EAAU;AACtC,IAAA,IAAA,CAAK,GAAA,EAAI;AACT,IAAA,OAAO,YAAA;AAAA,EACT;AAEA,EAAA,OAAO,YAAA,CACJ,KAAA,CAAM,CAAC,GAAA,KAAa;AACnB,IAAA,cAAA,CAAe,MAAM,GAAG,CAAA;AACxB,IAAA,MAAM,GAAA;AAAA,EACR,CAAC,CAAA,CACA,OAAA,CAAQ,MAAM,IAAA,CAAK,KAAK,CAAA;AAC7B;AAEO,SAAS,sBAAA,CACd,QAAA,EACA,IAAA,EACA,YAAA,EACA,MACA,IAAA,EACA;AACA,EAAA,IAAI,qBAAA,GAAwB,CAAA;AAC5B,EAAA,IAAI,IAAA,CAAK,WAAW,CAAA,EAAG;AACrB,IAAA,qBAAA,GAAwB,CAAA;AAAA,EAC1B,CAAA,MAAA,IAAW,IAAA,CAAK,MAAA,KAAW,CAAA,EAAG;AAC5B,IAAA,qBAAA,GAAwB,CAAA;AAAA,EAC1B;AAEA,EAAA,IAAA,CAAK,qBAAqB,CAAA,GAAI,CAAC,GAAA,EAAY,QAAA,KAAuB;AAChE,IAAA,IAAI,GAAA,EAAK;AACP,MAAA,cAAA,CAAe,MAAM,GAAG,CAAA;AAAA,IAC1B;AAEA,IAAA,IAAA,CAAK,GAAA,EAAI;AACT,IAAA,OAAO,QAAA,CAAS,KAAK,QAAQ,CAAA;AAAA,EAC/B,CAAA;AAEA,EAAA,OAAO,IAAA,CAAK,KAAA,CAAM,YAAA,EAAc,IAAI,CAAA;AACtC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttributeNames.js","sources":["../../../../../../src/integrations/tracing/mysql/vendored/AttributeNames.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql\n * - Upstream version: @opentelemetry/instrumentation-mysql@0.64.0\n */\n/* eslint-disable */\n\n// Mysql specific attributes not covered by semantic conventions\nexport enum AttributeNames {\n MYSQL_VALUES = 'db.mysql.values',\n}\n"],"names":["AttributeNames"],"mappings":"AAsBO,IAAK,cAAA,qBAAAA,eAAAA,KAAL;AACL,EAAAA,gBAAA,cAAA,CAAA,GAAe,iBAAA;AADL,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;;;;"}
1
+ {"version":3,"file":"AttributeNames.js","sources":["../../../../../../src/integrations/tracing/mysql/vendored/AttributeNames.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql\n * - Upstream version: @opentelemetry/instrumentation-mysql@0.64.0\n */\n/* eslint-disable */\n\n// Mysql specific attributes not covered by semantic conventions\nexport enum AttributeNames {\n MYSQL_VALUES = 'db.mysql.values',\n}\n"],"names":["AttributeNames"],"mappings":"AAWO,IAAK,cAAA,qBAAAA,eAAAA,KAAL;AACL,EAAAA,gBAAA,cAAA,CAAA,GAAe,iBAAA;AADL,EAAA,OAAAA,eAAAA;AAAA,CAAA,EAAA,cAAA,IAAA,EAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/mysql/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql\n * - Upstream version: @opentelemetry/instrumentation-mysql@0.64.0\n * - Types from the `mysql` package inlined as simplified interfaces\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable */\n\nimport { context, Context, trace, Span, SpanKind, SpanStatusCode, type Attributes } from '@opentelemetry/api';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport {\n ATTR_DB_NAMESPACE,\n ATTR_DB_QUERY_TEXT,\n ATTR_DB_SYSTEM_NAME,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n DB_SYSTEM_NAME_VALUE_MYSQL,\n} from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_DB_CONNECTION_STRING,\n ATTR_DB_NAME,\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_DB_USER,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n DB_SYSTEM_VALUE_MYSQL,\n METRIC_DB_CLIENT_CONNECTIONS_USAGE,\n} from './semconv';\nimport type * as mysqlTypes from './mysql-types';\nimport { AttributeNames } from './AttributeNames';\nimport { MySQLInstrumentationConfig } from './types';\nimport { getConfig, getDbQueryText, getDbValues, getJDBCString, getSpanName, getPoolNameOld } from './utils';\nimport { SDK_VERSION } from '@sentry/core';\nimport { UpDownCounter } from '@opentelemetry/api';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-mysql';\n\ntype getConnectionCallbackType = (err: mysqlTypes.MysqlError, connection: mysqlTypes.PoolConnection) => void;\n\nexport class MySQLInstrumentation extends InstrumentationBase<MySQLInstrumentationConfig> {\n private _netSemconvStability!: SemconvStability;\n private _dbSemconvStability!: SemconvStability;\n declare private _connectionsUsageOld: UpDownCounter;\n\n constructor(config: MySQLInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n this._setSemconvStabilityFromEnv();\n }\n\n // Used for testing.\n private _setSemconvStabilityFromEnv() {\n this._netSemconvStability = semconvStabilityFromStr('http', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);\n this._dbSemconvStability = semconvStabilityFromStr('database', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);\n }\n\n protected override _updateMetricInstruments() {\n this._connectionsUsageOld = this.meter.createUpDownCounter(METRIC_DB_CLIENT_CONNECTIONS_USAGE, {\n description: 'The number of connections that are currently in state described by the state attribute.',\n unit: '{connection}',\n });\n }\n\n /**\n * Convenience function for updating the `db.client.connections.usage` metric.\n * The name \"count\" comes from the eventually replacement for this metric per\n * https://opentelemetry.io/docs/specs/semconv/non-normative/db-migration/#database-client-connection-count\n */\n private _connCountAdd(n: number, poolNameOld: string, state: string) {\n this._connectionsUsageOld?.add(n, { state, name: poolNameOld });\n }\n\n protected init() {\n return [\n new InstrumentationNodeModuleDefinition(\n 'mysql',\n ['>=2.0.0 <3'],\n (moduleExports: typeof mysqlTypes) => {\n if (isWrapped(moduleExports.createConnection)) {\n this._unwrap(moduleExports, 'createConnection');\n }\n this._wrap(moduleExports, 'createConnection', this._patchCreateConnection() as any);\n\n if (isWrapped(moduleExports.createPool)) {\n this._unwrap(moduleExports, 'createPool');\n }\n this._wrap(moduleExports, 'createPool', this._patchCreatePool() as any);\n\n if (isWrapped(moduleExports.createPoolCluster)) {\n this._unwrap(moduleExports, 'createPoolCluster');\n }\n this._wrap(moduleExports, 'createPoolCluster', this._patchCreatePoolCluster() as any);\n\n return moduleExports;\n },\n (moduleExports: typeof mysqlTypes) => {\n if (moduleExports === undefined) return;\n this._unwrap(moduleExports, 'createConnection');\n this._unwrap(moduleExports, 'createPool');\n this._unwrap(moduleExports, 'createPoolCluster');\n },\n ),\n ];\n }\n\n // global export function\n private _patchCreateConnection() {\n return (originalCreateConnection: Function) => {\n const thisPlugin = this;\n\n return function createConnection(_connectionUri: string | mysqlTypes.ConnectionConfig) {\n const originalResult = originalCreateConnection(...arguments);\n\n // This is unwrapped on next call after unpatch\n thisPlugin._wrap(originalResult, 'query', thisPlugin._patchQuery(originalResult) as any);\n\n return originalResult;\n };\n };\n }\n\n // global export function\n private _patchCreatePool() {\n return (originalCreatePool: Function) => {\n const thisPlugin = this;\n return function createPool(_config: string | mysqlTypes.PoolConfig) {\n const pool = originalCreatePool(...arguments);\n\n thisPlugin._wrap(pool, 'query', thisPlugin._patchQuery(pool));\n thisPlugin._wrap(pool, 'getConnection', thisPlugin._patchGetConnection(pool));\n thisPlugin._wrap(pool, 'end', thisPlugin._patchPoolEnd(pool));\n thisPlugin._setPoolCallbacks(pool, '');\n\n return pool;\n };\n };\n }\n\n private _patchPoolEnd(pool: any) {\n return (originalPoolEnd: Function) => {\n const thisPlugin = this;\n return function end(callback?: unknown) {\n const nAll = (pool as any)._allConnections.length;\n const nFree = (pool as any)._freeConnections.length;\n const nUsed = nAll - nFree;\n const poolNameOld = getPoolNameOld(pool);\n thisPlugin._connCountAdd(-nUsed, poolNameOld, 'used');\n thisPlugin._connCountAdd(-nFree, poolNameOld, 'idle');\n originalPoolEnd.apply(pool, arguments);\n };\n };\n }\n\n // global export function\n private _patchCreatePoolCluster() {\n return (originalCreatePoolCluster: Function) => {\n const thisPlugin = this;\n return function createPool(_config: string | mysqlTypes.PoolConfig) {\n const cluster = originalCreatePoolCluster(...arguments);\n\n // This is unwrapped on next call after unpatch\n thisPlugin._wrap(cluster, 'getConnection', thisPlugin._patchGetConnection(cluster));\n thisPlugin._wrap(cluster, 'add', thisPlugin._patchAdd(cluster));\n\n return cluster;\n };\n };\n }\n private _patchAdd(cluster: mysqlTypes.PoolCluster) {\n return (originalAdd: Function) => {\n const thisPlugin = this;\n return function add(id: string, config: unknown) {\n // Unwrap if unpatch has been called\n if (!thisPlugin['_enabled']) {\n thisPlugin._unwrap(cluster, 'add');\n return originalAdd.apply(cluster, arguments);\n }\n originalAdd.apply(cluster, arguments);\n const nodes = cluster['_nodes' as keyof mysqlTypes.PoolCluster] as any;\n if (nodes) {\n const nodeId = typeof id === 'object' ? 'CLUSTER::' + (cluster as any)._lastId : String(id);\n\n const pool = nodes[nodeId].pool;\n thisPlugin._setPoolCallbacks(pool, id);\n }\n };\n };\n }\n\n // method on cluster or pool\n private _patchGetConnection(pool: mysqlTypes.Pool | mysqlTypes.PoolCluster) {\n return (originalGetConnection: Function) => {\n const thisPlugin = this;\n\n return function getConnection(arg1?: unknown, arg2?: unknown, arg3?: unknown) {\n // Unwrap if unpatch has been called\n if (!thisPlugin['_enabled']) {\n thisPlugin._unwrap(pool, 'getConnection');\n return originalGetConnection.apply(pool, arguments);\n }\n\n if (arguments.length === 1 && typeof arg1 === 'function') {\n const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg1 as getConnectionCallbackType);\n return originalGetConnection.call(pool, patchFn);\n }\n if (arguments.length === 2 && typeof arg2 === 'function') {\n const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg2 as getConnectionCallbackType);\n return originalGetConnection.call(pool, arg1, patchFn);\n }\n if (arguments.length === 3 && typeof arg3 === 'function') {\n const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg3 as getConnectionCallbackType);\n return originalGetConnection.call(pool, arg1, arg2, patchFn);\n }\n\n return originalGetConnection.apply(pool, arguments);\n };\n };\n }\n\n private _getConnectionCallbackPatchFn(cb: getConnectionCallbackType) {\n const thisPlugin = this;\n const activeContext = context.active();\n return function (this: any, err: mysqlTypes.MysqlError, connection: mysqlTypes.PoolConnection) {\n if (connection) {\n // this is the callback passed into a query\n // no need to unwrap\n if (!isWrapped(connection.query)) {\n thisPlugin._wrap(connection, 'query', thisPlugin._patchQuery(connection));\n }\n }\n if (typeof cb === 'function') {\n context.with(activeContext, cb, this, err, connection);\n }\n };\n }\n\n private _patchQuery(connection: mysqlTypes.Connection | mysqlTypes.Pool) {\n return (originalQuery: Function): mysqlTypes.QueryFunction => {\n const thisPlugin = this;\n\n return function query(\n query: string | mysqlTypes.Query | mysqlTypes.QueryOptions,\n _valuesOrCallback?: unknown[] | mysqlTypes.queryCallback,\n _callback?: mysqlTypes.queryCallback,\n ) {\n if (!thisPlugin['_enabled']) {\n thisPlugin._unwrap(connection, 'query');\n return originalQuery.apply(connection, arguments);\n }\n\n const attributes: Attributes = {};\n const { host, port, database, user } = getConfig(connection.config);\n const portNumber = parseInt(port, 10);\n const dbQueryText = getDbQueryText(query);\n if (thisPlugin._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_SYSTEM] = DB_SYSTEM_VALUE_MYSQL;\n attributes[ATTR_DB_CONNECTION_STRING] = getJDBCString(host, port, database);\n attributes[ATTR_DB_NAME] = database;\n attributes[ATTR_DB_USER] = user;\n attributes[ATTR_DB_STATEMENT] = dbQueryText;\n }\n if (thisPlugin._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_MYSQL;\n attributes[ATTR_DB_NAMESPACE] = database;\n attributes[ATTR_DB_QUERY_TEXT] = dbQueryText;\n }\n if (thisPlugin._netSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_NET_PEER_NAME] = host;\n if (!isNaN(portNumber)) {\n attributes[ATTR_NET_PEER_PORT] = portNumber;\n }\n }\n if (thisPlugin._netSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_SERVER_ADDRESS] = host;\n if (!isNaN(portNumber)) {\n attributes[ATTR_SERVER_PORT] = portNumber;\n }\n }\n const span = thisPlugin.tracer.startSpan(getSpanName(query), {\n kind: SpanKind.CLIENT,\n attributes,\n });\n\n if (thisPlugin.getConfig().enhancedDatabaseReporting) {\n let values;\n\n if (Array.isArray(_valuesOrCallback)) {\n values = _valuesOrCallback;\n } else if (arguments[2]) {\n values = [_valuesOrCallback];\n }\n\n span.setAttribute(AttributeNames.MYSQL_VALUES, getDbValues(query, values));\n }\n\n const cbIndex = Array.from(arguments).findIndex(arg => typeof arg === 'function');\n\n const parentContext = context.active();\n\n if (cbIndex === -1) {\n const streamableQuery: mysqlTypes.Query = context.with(trace.setSpan(context.active(), span), () => {\n return originalQuery.apply(connection, arguments);\n });\n context.bind(parentContext, streamableQuery);\n\n return streamableQuery\n .on('error', err =>\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n }),\n )\n .on('end', () => {\n span.end();\n });\n } else {\n thisPlugin._wrap(arguments, cbIndex, thisPlugin._patchCallbackQuery(span, parentContext));\n\n return context.with(trace.setSpan(context.active(), span), () => {\n return originalQuery.apply(connection, arguments);\n });\n }\n };\n };\n }\n\n private _patchCallbackQuery(span: Span, parentContext: Context) {\n return (originalCallback: Function) => {\n return function (err: mysqlTypes.MysqlError | null, results?: any, fields?: mysqlTypes.FieldInfo[]) {\n if (err) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n }\n span.end();\n return context.with(parentContext, () => originalCallback(...arguments));\n };\n };\n }\n\n private _setPoolCallbacks(pool: mysqlTypes.Pool, id: string) {\n const poolNameOld = id || getPoolNameOld(pool);\n\n pool.on('connection', _connection => {\n this._connCountAdd(1, poolNameOld, 'idle');\n });\n\n pool.on('acquire', _connection => {\n this._connCountAdd(-1, poolNameOld, 'idle');\n this._connCountAdd(1, poolNameOld, 'used');\n });\n\n pool.on('release', _connection => {\n this._connCountAdd(1, poolNameOld, 'idle');\n this._connCountAdd(-1, poolNameOld, 'used');\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAyDA,MAAM,YAAA,GAAe,+BAAA;AAId,MAAM,6BAA6B,mBAAA,CAAgD;AAAA,EAKxF,WAAA,CAAY,MAAA,GAAqC,EAAC,EAAG;AACnD,IAAA,KAAA,CAAM,YAAA,EAAc,aAAa,MAA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CAAc,EAAA,EAAI,WAAA,EAAa,MAAM,CAAA;AAAA,IAC5C,CAAC,CAAA;AAAA,EACH;AACF;;;;"}
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/mysql/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql\n * - Upstream version: @opentelemetry/instrumentation-mysql@0.64.0\n * - Types from the `mysql` package inlined as simplified interfaces\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable */\n\nimport { context, Context, trace, Span, SpanKind, SpanStatusCode, type Attributes } from '@opentelemetry/api';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport {\n ATTR_DB_NAMESPACE,\n ATTR_DB_QUERY_TEXT,\n ATTR_DB_SYSTEM_NAME,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n DB_SYSTEM_NAME_VALUE_MYSQL,\n} from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_DB_CONNECTION_STRING,\n ATTR_DB_NAME,\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_DB_USER,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n DB_SYSTEM_VALUE_MYSQL,\n METRIC_DB_CLIENT_CONNECTIONS_USAGE,\n} from './semconv';\nimport type * as mysqlTypes from './mysql-types';\nimport { AttributeNames } from './AttributeNames';\nimport { MySQLInstrumentationConfig } from './types';\nimport { getConfig, getDbQueryText, getDbValues, getJDBCString, getSpanName, getPoolNameOld } from './utils';\nimport { SDK_VERSION } from '@sentry/core';\nimport { UpDownCounter } from '@opentelemetry/api';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-mysql';\n\ntype getConnectionCallbackType = (err: mysqlTypes.MysqlError, connection: mysqlTypes.PoolConnection) => void;\n\nexport class MySQLInstrumentation extends InstrumentationBase<MySQLInstrumentationConfig> {\n private _netSemconvStability!: SemconvStability;\n private _dbSemconvStability!: SemconvStability;\n declare private _connectionsUsageOld: UpDownCounter;\n\n constructor(config: MySQLInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n this._setSemconvStabilityFromEnv();\n }\n\n // Used for testing.\n private _setSemconvStabilityFromEnv() {\n this._netSemconvStability = semconvStabilityFromStr('http', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);\n this._dbSemconvStability = semconvStabilityFromStr('database', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);\n }\n\n protected override _updateMetricInstruments() {\n this._connectionsUsageOld = this.meter.createUpDownCounter(METRIC_DB_CLIENT_CONNECTIONS_USAGE, {\n description: 'The number of connections that are currently in state described by the state attribute.',\n unit: '{connection}',\n });\n }\n\n /**\n * Convenience function for updating the `db.client.connections.usage` metric.\n * The name \"count\" comes from the eventually replacement for this metric per\n * https://opentelemetry.io/docs/specs/semconv/non-normative/db-migration/#database-client-connection-count\n */\n private _connCountAdd(n: number, poolNameOld: string, state: string) {\n this._connectionsUsageOld?.add(n, { state, name: poolNameOld });\n }\n\n protected init() {\n return [\n new InstrumentationNodeModuleDefinition(\n 'mysql',\n ['>=2.0.0 <3'],\n (moduleExports: typeof mysqlTypes) => {\n if (isWrapped(moduleExports.createConnection)) {\n this._unwrap(moduleExports, 'createConnection');\n }\n this._wrap(moduleExports, 'createConnection', this._patchCreateConnection() as any);\n\n if (isWrapped(moduleExports.createPool)) {\n this._unwrap(moduleExports, 'createPool');\n }\n this._wrap(moduleExports, 'createPool', this._patchCreatePool() as any);\n\n if (isWrapped(moduleExports.createPoolCluster)) {\n this._unwrap(moduleExports, 'createPoolCluster');\n }\n this._wrap(moduleExports, 'createPoolCluster', this._patchCreatePoolCluster() as any);\n\n return moduleExports;\n },\n (moduleExports: typeof mysqlTypes) => {\n if (moduleExports === undefined) return;\n this._unwrap(moduleExports, 'createConnection');\n this._unwrap(moduleExports, 'createPool');\n this._unwrap(moduleExports, 'createPoolCluster');\n },\n ),\n ];\n }\n\n // global export function\n private _patchCreateConnection() {\n return (originalCreateConnection: Function) => {\n const thisPlugin = this;\n\n return function createConnection(_connectionUri: string | mysqlTypes.ConnectionConfig) {\n const originalResult = originalCreateConnection(...arguments);\n\n // This is unwrapped on next call after unpatch\n thisPlugin._wrap(originalResult, 'query', thisPlugin._patchQuery(originalResult) as any);\n\n return originalResult;\n };\n };\n }\n\n // global export function\n private _patchCreatePool() {\n return (originalCreatePool: Function) => {\n const thisPlugin = this;\n return function createPool(_config: string | mysqlTypes.PoolConfig) {\n const pool = originalCreatePool(...arguments);\n\n thisPlugin._wrap(pool, 'query', thisPlugin._patchQuery(pool));\n thisPlugin._wrap(pool, 'getConnection', thisPlugin._patchGetConnection(pool));\n thisPlugin._wrap(pool, 'end', thisPlugin._patchPoolEnd(pool));\n thisPlugin._setPoolCallbacks(pool, '');\n\n return pool;\n };\n };\n }\n\n private _patchPoolEnd(pool: any) {\n return (originalPoolEnd: Function) => {\n const thisPlugin = this;\n return function end(callback?: unknown) {\n const nAll = (pool as any)._allConnections.length;\n const nFree = (pool as any)._freeConnections.length;\n const nUsed = nAll - nFree;\n const poolNameOld = getPoolNameOld(pool);\n thisPlugin._connCountAdd(-nUsed, poolNameOld, 'used');\n thisPlugin._connCountAdd(-nFree, poolNameOld, 'idle');\n originalPoolEnd.apply(pool, arguments);\n };\n };\n }\n\n // global export function\n private _patchCreatePoolCluster() {\n return (originalCreatePoolCluster: Function) => {\n const thisPlugin = this;\n return function createPool(_config: string | mysqlTypes.PoolConfig) {\n const cluster = originalCreatePoolCluster(...arguments);\n\n // This is unwrapped on next call after unpatch\n thisPlugin._wrap(cluster, 'getConnection', thisPlugin._patchGetConnection(cluster));\n thisPlugin._wrap(cluster, 'add', thisPlugin._patchAdd(cluster));\n\n return cluster;\n };\n };\n }\n private _patchAdd(cluster: mysqlTypes.PoolCluster) {\n return (originalAdd: Function) => {\n const thisPlugin = this;\n return function add(id: string, config: unknown) {\n // Unwrap if unpatch has been called\n if (!thisPlugin['_enabled']) {\n thisPlugin._unwrap(cluster, 'add');\n return originalAdd.apply(cluster, arguments);\n }\n originalAdd.apply(cluster, arguments);\n const nodes = cluster['_nodes' as keyof mysqlTypes.PoolCluster] as any;\n if (nodes) {\n const nodeId = typeof id === 'object' ? 'CLUSTER::' + (cluster as any)._lastId : String(id);\n\n const pool = nodes[nodeId].pool;\n thisPlugin._setPoolCallbacks(pool, id);\n }\n };\n };\n }\n\n // method on cluster or pool\n private _patchGetConnection(pool: mysqlTypes.Pool | mysqlTypes.PoolCluster) {\n return (originalGetConnection: Function) => {\n const thisPlugin = this;\n\n return function getConnection(arg1?: unknown, arg2?: unknown, arg3?: unknown) {\n // Unwrap if unpatch has been called\n if (!thisPlugin['_enabled']) {\n thisPlugin._unwrap(pool, 'getConnection');\n return originalGetConnection.apply(pool, arguments);\n }\n\n if (arguments.length === 1 && typeof arg1 === 'function') {\n const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg1 as getConnectionCallbackType);\n return originalGetConnection.call(pool, patchFn);\n }\n if (arguments.length === 2 && typeof arg2 === 'function') {\n const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg2 as getConnectionCallbackType);\n return originalGetConnection.call(pool, arg1, patchFn);\n }\n if (arguments.length === 3 && typeof arg3 === 'function') {\n const patchFn = thisPlugin._getConnectionCallbackPatchFn(arg3 as getConnectionCallbackType);\n return originalGetConnection.call(pool, arg1, arg2, patchFn);\n }\n\n return originalGetConnection.apply(pool, arguments);\n };\n };\n }\n\n private _getConnectionCallbackPatchFn(cb: getConnectionCallbackType) {\n const thisPlugin = this;\n const activeContext = context.active();\n return function (this: any, err: mysqlTypes.MysqlError, connection: mysqlTypes.PoolConnection) {\n if (connection) {\n // this is the callback passed into a query\n // no need to unwrap\n if (!isWrapped(connection.query)) {\n thisPlugin._wrap(connection, 'query', thisPlugin._patchQuery(connection));\n }\n }\n if (typeof cb === 'function') {\n context.with(activeContext, cb, this, err, connection);\n }\n };\n }\n\n private _patchQuery(connection: mysqlTypes.Connection | mysqlTypes.Pool) {\n return (originalQuery: Function): mysqlTypes.QueryFunction => {\n const thisPlugin = this;\n\n return function query(\n query: string | mysqlTypes.Query | mysqlTypes.QueryOptions,\n _valuesOrCallback?: unknown[] | mysqlTypes.queryCallback,\n _callback?: mysqlTypes.queryCallback,\n ) {\n if (!thisPlugin['_enabled']) {\n thisPlugin._unwrap(connection, 'query');\n return originalQuery.apply(connection, arguments);\n }\n\n const attributes: Attributes = {};\n const { host, port, database, user } = getConfig(connection.config);\n const portNumber = parseInt(port, 10);\n const dbQueryText = getDbQueryText(query);\n if (thisPlugin._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_SYSTEM] = DB_SYSTEM_VALUE_MYSQL;\n attributes[ATTR_DB_CONNECTION_STRING] = getJDBCString(host, port, database);\n attributes[ATTR_DB_NAME] = database;\n attributes[ATTR_DB_USER] = user;\n attributes[ATTR_DB_STATEMENT] = dbQueryText;\n }\n if (thisPlugin._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_MYSQL;\n attributes[ATTR_DB_NAMESPACE] = database;\n attributes[ATTR_DB_QUERY_TEXT] = dbQueryText;\n }\n if (thisPlugin._netSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_NET_PEER_NAME] = host;\n if (!isNaN(portNumber)) {\n attributes[ATTR_NET_PEER_PORT] = portNumber;\n }\n }\n if (thisPlugin._netSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_SERVER_ADDRESS] = host;\n if (!isNaN(portNumber)) {\n attributes[ATTR_SERVER_PORT] = portNumber;\n }\n }\n const span = thisPlugin.tracer.startSpan(getSpanName(query), {\n kind: SpanKind.CLIENT,\n attributes,\n });\n\n if (thisPlugin.getConfig().enhancedDatabaseReporting) {\n let values;\n\n if (Array.isArray(_valuesOrCallback)) {\n values = _valuesOrCallback;\n } else if (arguments[2]) {\n values = [_valuesOrCallback];\n }\n\n span.setAttribute(AttributeNames.MYSQL_VALUES, getDbValues(query, values));\n }\n\n const cbIndex = Array.from(arguments).findIndex(arg => typeof arg === 'function');\n\n const parentContext = context.active();\n\n if (cbIndex === -1) {\n const streamableQuery: mysqlTypes.Query = context.with(trace.setSpan(context.active(), span), () => {\n return originalQuery.apply(connection, arguments);\n });\n context.bind(parentContext, streamableQuery);\n\n return streamableQuery\n .on('error', err =>\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n }),\n )\n .on('end', () => {\n span.end();\n });\n } else {\n thisPlugin._wrap(arguments, cbIndex, thisPlugin._patchCallbackQuery(span, parentContext));\n\n return context.with(trace.setSpan(context.active(), span), () => {\n return originalQuery.apply(connection, arguments);\n });\n }\n };\n };\n }\n\n private _patchCallbackQuery(span: Span, parentContext: Context) {\n return (originalCallback: Function) => {\n return function (err: mysqlTypes.MysqlError | null, results?: any, fields?: mysqlTypes.FieldInfo[]) {\n if (err) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n }\n span.end();\n return context.with(parentContext, () => originalCallback(...arguments));\n };\n };\n }\n\n private _setPoolCallbacks(pool: mysqlTypes.Pool, id: string) {\n const poolNameOld = id || getPoolNameOld(pool);\n\n pool.on('connection', _connection => {\n this._connCountAdd(1, poolNameOld, 'idle');\n });\n\n pool.on('acquire', _connection => {\n this._connCountAdd(-1, poolNameOld, 'idle');\n this._connCountAdd(1, poolNameOld, 'used');\n });\n\n pool.on('release', _connection => {\n this._connCountAdd(1, poolNameOld, 'idle');\n this._connCountAdd(-1, poolNameOld, 'used');\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;AA8CA,MAAM,YAAA,GAAe,+BAAA;AAId,MAAM,6BAA6B,mBAA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Ae;AAChC,MAAA,IAAA,CAAK,aAAA,CAAc,CAAA,EAAG,WAAA,EAAa,MAAM,CAAA;AACzC,MAAA,IAAA,CAAK,aAAA,CAAc,EAAA,EAAI,WAAA,EAAa,MAAM,CAAA;AAAA,IAC5C,CAAC,CAAA;AAAA,EACH;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/mysql/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql\n * - Upstream version: @opentelemetry/instrumentation-mysql@0.64.0\n */\n/* eslint-disable */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * Deprecated, use `server.address`, `server.port` attributes instead.\n *\n * @example \"Server=(localdb)\\\\v11.0;Integrated Security=true;\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.address` and `server.port`.\n */\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const;\n\n/**\n * Deprecated, use `db.namespace` instead.\n *\n * @example customers\n * @example main\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.namespace`.\n */\nexport const ATTR_DB_NAME = 'db.name' as const;\n\n/**\n * The database statement being executed.\n *\n * @example SELECT * FROM wuser_table\n * @example SET mykey \"WuValue\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.query.text`.\n */\nexport const ATTR_DB_STATEMENT = 'db.statement' as const;\n\n/**\n * Deprecated, use `db.system.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.system.name`.\n */\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\n\n/**\n * Deprecated, no replacement at this time.\n *\n * @example readonly_user\n * @example reporting_user\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Removed, no replacement at this time.\n */\nexport const ATTR_DB_USER = 'db.user' as const;\n\n/**\n * Deprecated, use `server.address` on client spans and `client.address` on server spans.\n *\n * @example example.com\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.\n */\nexport const ATTR_NET_PEER_NAME = 'net.peer.name' as const;\n\n/**\n * Deprecated, use `server.port` on client spans and `client.port` on server spans.\n *\n * @example 8080\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.\n */\nexport const ATTR_NET_PEER_PORT = 'net.peer.port' as const;\n\n/**\n * Enum value \"mysql\" for attribute {@link ATTR_DB_SYSTEM}.\n *\n * MySQL\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const DB_SYSTEM_VALUE_MYSQL = 'mysql' as const;\n\n/**\n * Deprecated, use `db.client.connection.count` instead.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.client.connection.count`.\n */\nexport const METRIC_DB_CLIENT_CONNECTIONS_USAGE = 'db.client.connections.usage' as const;\n"],"names":[],"mappings":"AAoCO,MAAM,yBAAA,GAA4B;AAYlC,MAAM,YAAA,GAAe;AAYrB,MAAM,iBAAA,GAAoB;AAS1B,MAAM,cAAA,GAAiB;AAYvB,MAAM,YAAA,GAAe;AAWrB,MAAM,kBAAA,GAAqB;AAW3B,MAAM,kBAAA,GAAqB;AAS3B,MAAM,qBAAA,GAAwB;AAS9B,MAAM,kCAAA,GAAqC;;;;"}
1
+ {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/mysql/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql\n * - Upstream version: @opentelemetry/instrumentation-mysql@0.64.0\n */\n/* eslint-disable */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * Deprecated, use `server.address`, `server.port` attributes instead.\n *\n * @example \"Server=(localdb)\\\\v11.0;Integrated Security=true;\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.address` and `server.port`.\n */\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const;\n\n/**\n * Deprecated, use `db.namespace` instead.\n *\n * @example customers\n * @example main\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.namespace`.\n */\nexport const ATTR_DB_NAME = 'db.name' as const;\n\n/**\n * The database statement being executed.\n *\n * @example SELECT * FROM wuser_table\n * @example SET mykey \"WuValue\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.query.text`.\n */\nexport const ATTR_DB_STATEMENT = 'db.statement' as const;\n\n/**\n * Deprecated, use `db.system.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.system.name`.\n */\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\n\n/**\n * Deprecated, no replacement at this time.\n *\n * @example readonly_user\n * @example reporting_user\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Removed, no replacement at this time.\n */\nexport const ATTR_DB_USER = 'db.user' as const;\n\n/**\n * Deprecated, use `server.address` on client spans and `client.address` on server spans.\n *\n * @example example.com\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.\n */\nexport const ATTR_NET_PEER_NAME = 'net.peer.name' as const;\n\n/**\n * Deprecated, use `server.port` on client spans and `client.port` on server spans.\n *\n * @example 8080\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.\n */\nexport const ATTR_NET_PEER_PORT = 'net.peer.port' as const;\n\n/**\n * Enum value \"mysql\" for attribute {@link ATTR_DB_SYSTEM}.\n *\n * MySQL\n *\n * @experimental This enum value is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const DB_SYSTEM_VALUE_MYSQL = 'mysql' as const;\n\n/**\n * Deprecated, use `db.client.connection.count` instead.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `db.client.connection.count`.\n */\nexport const METRIC_DB_CLIENT_CONNECTIONS_USAGE = 'db.client.connections.usage' as const;\n"],"names":[],"mappings":"AAyBO,MAAM,yBAAA,GAA4B;AAYlC,MAAM,YAAA,GAAe;AAYrB,MAAM,iBAAA,GAAoB;AAS1B,MAAM,cAAA,GAAiB;AAYvB,MAAM,YAAA,GAAe;AAWrB,MAAM,kBAAA,GAAqB;AAW3B,MAAM,kBAAA,GAAqB;AAS3B,MAAM,qBAAA,GAAwB;AAS9B,MAAM,kCAAA,GAAqC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/mysql/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql\n * - Upstream version: @opentelemetry/instrumentation-mysql@0.64.0\n * - Types from the `mysql` package inlined as simplified interfaces\n */\n/* eslint-disable */\n\nimport type { Pool, Query, QueryOptions } from './mysql-types';\n\nexport function getConfig(config: any) {\n const { host, port, database, user } = (config && config.connectionConfig) || config || {};\n return { host, port, database, user };\n}\n\nexport function getJDBCString(host: string | undefined, port: number | undefined, database: string | undefined) {\n let jdbcString = `jdbc:mysql://${host || 'localhost'}`;\n\n if (typeof port === 'number') {\n jdbcString += `:${port}`;\n }\n\n if (typeof database === 'string') {\n jdbcString += `/${database}`;\n }\n\n return jdbcString;\n}\n\n/**\n * @returns the database query being executed.\n */\nexport function getDbQueryText(query: string | Query | QueryOptions): string {\n if (typeof query === 'string') {\n return query;\n } else {\n return query.sql;\n }\n}\n\nexport function getDbValues(query: string | Query | QueryOptions, values?: any[]): string {\n if (typeof query === 'string') {\n return arrayStringifyHelper(values);\n } else {\n // According to https://github.com/mysqljs/mysql#performing-queries\n // The values argument will override the values in the option object.\n return arrayStringifyHelper(values || query.values);\n }\n}\n\n/**\n * The span name SHOULD be set to a low cardinality value\n * representing the statement executed on the database.\n *\n * TODO: revisit span name based on https://github.com/open-telemetry/semantic-conventions/blob/v1.33.0/docs/database/database-spans.md#name\n *\n * @returns SQL statement without variable arguments or SQL verb\n */\nexport function getSpanName(query: string | Query | QueryOptions): string {\n const rawQuery = typeof query === 'object' ? query.sql : query;\n // Extract the SQL verb\n const firstSpace = rawQuery?.indexOf(' ');\n if (typeof firstSpace === 'number' && firstSpace !== -1) {\n return rawQuery?.substring(0, firstSpace);\n }\n return rawQuery;\n}\n\nexport function arrayStringifyHelper(arr: Array<unknown> | undefined): string {\n if (arr) return `[${arr.toString()}]`;\n return '';\n}\n\nexport function getPoolNameOld(pool: Pool): string {\n const c = pool.config.connectionConfig;\n let poolName = '';\n poolName += c?.host ? `host: '${c.host}', ` : '';\n poolName += c?.port ? `port: ${c.port}, ` : '';\n poolName += c?.database ? `database: '${c.database}', ` : '';\n poolName += c?.user ? `user: '${c.user}'` : '';\n if (!c?.user) {\n poolName = poolName.substring(0, poolName.length - 2); //omit last comma\n }\n return poolName.trim();\n}\n"],"names":[],"mappings":"AAwBO,SAAS,UAAU,MAAA,EAAa;AACrC,EAAA,MAAM,EAAE,IAAA,EAAM,IAAA,EAAM,QAAA,EAAU,IAAA,KAAU,MAAA,IAAU,MAAA,CAAO,gBAAA,IAAqB,MAAA,IAAU,EAAC;AACzF,EAAA,OAAO,EAAE,IAAA,EAAM,IAAA,EAAM,QAAA,EAAU,IAAA,EAAK;AACtC;AAEO,SAAS,aAAA,CAAc,IAAA,EAA0B,IAAA,EAA0B,QAAA,EAA8B;AAC9G,EAAA,IAAI,UAAA,GAAa,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,IAAA,EAAoB;AACjD,EAAA,MAAM,CAAA,GAAI,KAAK,MAAA,CAAO,gBAAA;AACtB,EAAA,IAAI,QAAA,GAAW,EAAA;AACf,EAAA,QAAA,IAAY,CAAA,EAAG,IAAA,GAAO,CAAA,OAAA,EAAU,CAAA,CAAE,IAAI,CAAA,GAAA,CAAA,GAAQ,EAAA;AAC9C,EAAA,QAAA,IAAY,CAAA,EAAG,IAAA,GAAO,CAAA,MAAA,EAAS,CAAA,CAAE,IAAI,CAAA,EAAA,CAAA,GAAO,EAAA;AAC5C,EAAA,QAAA,IAAY,CAAA,EAAG,QAAA,GAAW,CAAA,WAAA,EAAc,CAAA,CAAE,QAAQ,CAAA,GAAA,CAAA,GAAQ,EAAA;AAC1D,EAAA,QAAA,IAAY,CAAA,EAAG,IAAA,GAAO,CAAA,OAAA,EAAU,CAAA,CAAE,IAAI,CAAA,CAAA,CAAA,GAAM,EAAA;AAC5C,EAAA,IAAI,CAAC,GAAG,IAAA,EAAM;AACZ,IAAA,QAAA,GAAW,QAAA,CAAS,SAAA,CAAU,CAAA,EAAG,QAAA,CAAS,SAAS,CAAC,CAAA;AAAA,EACtD;AACA,EAAA,OAAO,SAAS,IAAA,EAAK;AACvB;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/mysql/vendored/utils.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql\n * - Upstream version: @opentelemetry/instrumentation-mysql@0.64.0\n * - Types from the `mysql` package inlined as simplified interfaces\n */\n/* eslint-disable */\n\nimport type { Pool, Query, QueryOptions } from './mysql-types';\n\nexport function getConfig(config: any) {\n const { host, port, database, user } = (config && config.connectionConfig) || config || {};\n return { host, port, database, user };\n}\n\nexport function getJDBCString(host: string | undefined, port: number | undefined, database: string | undefined) {\n let jdbcString = `jdbc:mysql://${host || 'localhost'}`;\n\n if (typeof port === 'number') {\n jdbcString += `:${port}`;\n }\n\n if (typeof database === 'string') {\n jdbcString += `/${database}`;\n }\n\n return jdbcString;\n}\n\n/**\n * @returns the database query being executed.\n */\nexport function getDbQueryText(query: string | Query | QueryOptions): string {\n if (typeof query === 'string') {\n return query;\n } else {\n return query.sql;\n }\n}\n\nexport function getDbValues(query: string | Query | QueryOptions, values?: any[]): string {\n if (typeof query === 'string') {\n return arrayStringifyHelper(values);\n } else {\n // According to https://github.com/mysqljs/mysql#performing-queries\n // The values argument will override the values in the option object.\n return arrayStringifyHelper(values || query.values);\n }\n}\n\n/**\n * The span name SHOULD be set to a low cardinality value\n * representing the statement executed on the database.\n *\n * TODO: revisit span name based on https://github.com/open-telemetry/semantic-conventions/blob/v1.33.0/docs/database/database-spans.md#name\n *\n * @returns SQL statement without variable arguments or SQL verb\n */\nexport function getSpanName(query: string | Query | QueryOptions): string {\n const rawQuery = typeof query === 'object' ? query.sql : query;\n // Extract the SQL verb\n const firstSpace = rawQuery?.indexOf(' ');\n if (typeof firstSpace === 'number' && firstSpace !== -1) {\n return rawQuery?.substring(0, firstSpace);\n }\n return rawQuery;\n}\n\nexport function arrayStringifyHelper(arr: Array<unknown> | undefined): string {\n if (arr) return `[${arr.toString()}]`;\n return '';\n}\n\nexport function getPoolNameOld(pool: Pool): string {\n const c = pool.config.connectionConfig;\n let poolName = '';\n poolName += c?.host ? `host: '${c.host}', ` : '';\n poolName += c?.port ? `port: ${c.port}, ` : '';\n poolName += c?.database ? `database: '${c.database}', ` : '';\n poolName += c?.user ? `user: '${c.user}'` : '';\n if (!c?.user) {\n poolName = poolName.substring(0, poolName.length - 2); //omit last comma\n }\n return poolName.trim();\n}\n"],"names":[],"mappings":"AAaO,SAAS,UAAU,MAAA,EAAa;AACrC,EAAA,MAAM,EAAE,IAAA,EAAM,IAAA,EAAM,QAAA,EAAU,IAAA,KAAU,MAA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G,UAAU,CAAA;AAAA,EAC1C;AACA,EAAA,OAAO,QAAA;AACT;AAEO,SAAS,qBAAqB,GAAA,EAAyC;AAC5E,EAAA,IAAI,GAAA,EAAK,OAAO,CAAA,CAAA,EAAI,GAAA,CAAI,UAAU,CAAA,CAAA,CAAA;AAClC,EAAA,OAAO,EAAA;AACT;AAEO,SAAS,eAAe,IAAA,EAAoB;AACjD,EAAA,MAAM,CAAA,GAAI,KAAK,MAAA,CAAO,gBAAA;AACtB,EAAA,IAAI,QAAA,GAAW,EAAA;AACf,EAAA,QAAA,IAAY,CAAA,EAAG,IAAA,GAAO,CAAA,OAAA,EAAU,CAAA,CAAE,IAAI,CAAA,GAAA,CAAA,GAAQ,EAAA;AAC9C,EAAA,QAAA,IAAY,CAAA,EAAG,IAAA,GAAO,CAAA,MAAA,EAAS,CAAA,CAAE,IAAI,CAAA,EAAA,CAAA,GAAO,EAAA;AAC5C,EAAA,QAAA,IAAY,CAAA,EAAG,QAAA,GAAW,CAAA,WAAA,EAAc,CAAA,CAAE,QAAQ,CAAA,GAAA,CAAA,GAAQ,EAAA;AAC1D,EAAA,QAAA,IAAY,CAAA,EAAG,IAAA,GAAO,CAAA,OAAA,EAAU,CAAA,CAAE,IAAI,CAAA,CAAA,CAAA,GAAM,EAAA;AAC5C,EAAA,IAAI,CAAC,GAAG,IAAA,EAAM;AACZ,IAAA,QAAA,GAAW,QAAA,CAAS,SAAA,CAAU,CAAA,EAAG,QAAA,CAAS,SAAS,CAAC,CAAA;AAAA,EACtD;AACA,EAAA,OAAO,SAAS,IAAA,EAAK;AACvB;;;;"}
@@ -1,16 +1,9 @@
1
1
  import { MySQL2Instrumentation } from './vendored/instrumentation.js';
2
2
  import { defineIntegration } from '@sentry/core';
3
- import { generateInstrumentOnce, addOriginToSpan } from '@sentry/node-core';
3
+ import { generateInstrumentOnce } from '@sentry/node-core';
4
4
 
5
5
  const INTEGRATION_NAME = "Mysql2";
6
- const instrumentMysql2 = generateInstrumentOnce(
7
- INTEGRATION_NAME,
8
- () => new MySQL2Instrumentation({
9
- responseHook(span) {
10
- addOriginToSpan(span, "auto.db.otel.mysql2");
11
- }
12
- })
13
- );
6
+ const instrumentMysql2 = generateInstrumentOnce(INTEGRATION_NAME, () => new MySQL2Instrumentation());
14
7
  const _mysql2Integration = (() => {
15
8
  return {
16
9
  name: INTEGRATION_NAME,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/mysql2/index.ts"],"sourcesContent":["import { MySQL2Instrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mysql2';\n\nexport const instrumentMysql2 = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n new MySQL2Instrumentation({\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mysql2');\n },\n }),\n);\n\nconst _mysql2Integration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMysql2();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mysql2](https://www.npmjs.com/package/mysql2) library.\n *\n * For more information, see the [`mysql2Integration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql2/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mysqlIntegration()],\n * });\n * ```\n */\nexport const mysql2Integration = defineIntegration(_mysql2Integration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,QAAA;AAElB,MAAM,gBAAA,GAAmB,sBAAA;AAAA,EAC9B,gBAAA;AAAA,EACA,MACE,IAAI,qBAAA,CAAsB;AAAA,IACxB,aAAa,IAAA,EAAM;AACjB,MAAA,eAAA,CAAgB,MAAM,qBAAqB,CAAA;AAAA,IAC7C;AAAA,GACD;AACL;AAEA,MAAM,sBAAsB,MAAM;AAChC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,gBAAA,EAAiB;AAAA,IACnB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,iBAAA,GAAoB,kBAAkB,kBAAkB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/mysql2/index.ts"],"sourcesContent":["import { MySQL2Instrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Mysql2';\n\nexport const instrumentMysql2 = generateInstrumentOnce(INTEGRATION_NAME, () => new MySQL2Instrumentation());\n\nconst _mysql2Integration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentMysql2();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [mysql2](https://www.npmjs.com/package/mysql2) library.\n *\n * For more information, see the [`mysql2Integration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mysql2/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.mysqlIntegration()],\n * });\n * ```\n */\nexport const mysql2Integration = defineIntegration(_mysql2Integration);\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,QAAA;AAElB,MAAM,mBAAmB,sBAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAI,uBAAuB;AAE1G,MAAM,sBAAsB,MAAM;AAChC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,gBAAA,EAAiB;AAAA,IACnB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,iBAAA,GAAoB,kBAAkB,kBAAkB;;;;"}
@@ -1,22 +1,16 @@
1
- import * as api from '@opentelemetry/api';
2
- import { SDK_VERSION } from '@sentry/core';
3
- import { InstrumentationBase, semconvStabilityFromStr, InstrumentationNodeModuleDefinition, SemconvStability, isWrapped, safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';
1
+ import { SpanKind } from '@opentelemetry/api';
2
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';
3
+ import { SDK_VERSION, startInactiveSpan, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR } from '@sentry/core';
4
4
  import { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile.js';
5
- import { DB_SYSTEM_VALUE_MYSQL, ATTR_DB_SYSTEM, ATTR_DB_STATEMENT } from './semconv.js';
6
- import { addSqlCommenterComment } from '../../utils/sql-common.js';
7
- import { getConnectionPrototypeToInstrument, getConnectionAttributes, getQueryText, getSpanName, once } from './utils.js';
8
- import { DB_SYSTEM_NAME_VALUE_MYSQL, ATTR_DB_SYSTEM_NAME, ATTR_DB_QUERY_TEXT } from '@opentelemetry/semantic-conventions';
5
+ import { ATTR_DB_STATEMENT, DB_SYSTEM_VALUE_MYSQL, ATTR_DB_SYSTEM } from './semconv.js';
6
+ import { getConnectionPrototypeToInstrument, getQueryText, getConnectionAttributes, getSpanName, once } from './utils.js';
9
7
 
10
8
  const PACKAGE_NAME = "@sentry/instrumentation-mysql2";
9
+ const ORIGIN = "auto.db.otel.mysql2";
11
10
  const supportedVersions = [">=1.4.2 <4"];
12
11
  class MySQL2Instrumentation extends InstrumentationBase {
13
12
  constructor(config = {}) {
14
13
  super(PACKAGE_NAME, SDK_VERSION, config);
15
- this._setSemconvStabilityFromEnv();
16
- }
17
- _setSemconvStabilityFromEnv() {
18
- this._netSemconvStability = semconvStabilityFromStr("http", process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
19
- this._dbSemconvStability = semconvStabilityFromStr("database", process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
20
14
  }
21
15
  init() {
22
16
  let format;
@@ -29,11 +23,11 @@ class MySQL2Instrumentation extends InstrumentationBase {
29
23
  if (isWrapped(ConnectionPrototype.query)) {
30
24
  this._unwrap(ConnectionPrototype, "query");
31
25
  }
32
- this._wrap(ConnectionPrototype, "query", this._patchQuery(format, false));
26
+ this._wrap(ConnectionPrototype, "query", this._patchQuery(format));
33
27
  if (isWrapped(ConnectionPrototype.execute)) {
34
28
  this._unwrap(ConnectionPrototype, "execute");
35
29
  }
36
- this._wrap(ConnectionPrototype, "execute", this._patchQuery(format, true));
30
+ this._wrap(ConnectionPrototype, "execute", this._patchQuery(format));
37
31
  };
38
32
  const unpatch = (ConnectionPrototype) => {
39
33
  this._unwrap(ConnectionPrototype, "query");
@@ -78,9 +72,9 @@ class MySQL2Instrumentation extends InstrumentationBase {
78
72
  )
79
73
  ];
80
74
  }
81
- _patchQuery(format, isPrepared) {
75
+ _patchQuery(format) {
76
+ const thisPlugin = this;
82
77
  return (originalQuery) => {
83
- const thisPlugin = this;
84
78
  return function query(query, _valuesOrCallback, _callback) {
85
79
  let values;
86
80
  if (Array.isArray(_valuesOrCallback)) {
@@ -88,52 +82,20 @@ class MySQL2Instrumentation extends InstrumentationBase {
88
82
  } else if (arguments[2]) {
89
83
  values = [_valuesOrCallback];
90
84
  }
91
- const { maskStatement, maskStatementHook, responseHook } = thisPlugin.getConfig();
92
- const attributes = getConnectionAttributes(
93
- this.config,
94
- thisPlugin._dbSemconvStability,
95
- thisPlugin._netSemconvStability
96
- );
97
- const dbQueryText = getQueryText(query, format, values, maskStatement, maskStatementHook);
98
- if (thisPlugin._dbSemconvStability & SemconvStability.OLD) {
99
- attributes[ATTR_DB_SYSTEM] = DB_SYSTEM_VALUE_MYSQL;
100
- attributes[ATTR_DB_STATEMENT] = dbQueryText;
101
- }
102
- if (thisPlugin._dbSemconvStability & SemconvStability.STABLE) {
103
- attributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_MYSQL;
104
- attributes[ATTR_DB_QUERY_TEXT] = dbQueryText;
105
- }
106
- const span = thisPlugin.tracer.startSpan(getSpanName(query), {
107
- kind: api.SpanKind.CLIENT,
85
+ const attributes = {
86
+ ...getConnectionAttributes(this.config),
87
+ [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_MYSQL,
88
+ [ATTR_DB_STATEMENT]: getQueryText(query, format, values),
89
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN
90
+ };
91
+ const span = startInactiveSpan({
92
+ name: getSpanName(query),
93
+ kind: SpanKind.CLIENT,
108
94
  attributes
109
95
  });
110
- if (!isPrepared && thisPlugin.getConfig().addSqlCommenterCommentToQueries) {
111
- arguments[0] = query = typeof query === "string" ? addSqlCommenterComment(span, query) : Object.assign(query, {
112
- sql: addSqlCommenterComment(span, query.sql)
113
- });
114
- }
115
- const endSpan = once((err, results) => {
96
+ const endSpan = once((err) => {
116
97
  if (err) {
117
- span.setStatus({
118
- code: api.SpanStatusCode.ERROR,
119
- message: err.message
120
- });
121
- } else {
122
- if (typeof responseHook === "function") {
123
- safeExecuteInTheMiddle(
124
- () => {
125
- responseHook(span, {
126
- queryResults: results
127
- });
128
- },
129
- (err2) => {
130
- if (err2) {
131
- thisPlugin._diag.warn("Failed executing responseHook", err2);
132
- }
133
- },
134
- true
135
- );
136
- }
98
+ span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });
137
99
  }
138
100
  span.end();
139
101
  });
@@ -144,8 +106,8 @@ class MySQL2Instrumentation extends InstrumentationBase {
144
106
  const streamableQuery = originalQuery.apply(this, arguments);
145
107
  streamableQuery.once("error", (err) => {
146
108
  endSpan(err);
147
- }).once("result", (results) => {
148
- endSpan(void 0, results);
109
+ }).once("result", () => {
110
+ endSpan();
149
111
  });
150
112
  return streamableQuery;
151
113
  }
@@ -160,9 +122,9 @@ class MySQL2Instrumentation extends InstrumentationBase {
160
122
  }
161
123
  _patchCallbackQuery(endSpan) {
162
124
  return (originalCallback) => {
163
- return function(err, results, _fields) {
164
- endSpan(err, results);
165
- return originalCallback(...arguments);
125
+ return function(...args) {
126
+ endSpan(args[0]);
127
+ return originalCallback(...args);
166
128
  };
167
129
  };
168
130
  }
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/mysql2/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql2\n * - Upstream version: @opentelemetry/instrumentation-mysql2@0.64.0\n * - Types from 'mysql2' inlined as simplified interfaces\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable */\n\nimport * as api from '@opentelemetry/api';\nimport { SDK_VERSION } from '@sentry/core';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n safeExecuteInTheMiddle,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile';\nimport { DB_SYSTEM_VALUE_MYSQL, ATTR_DB_STATEMENT, ATTR_DB_SYSTEM } from './semconv';\nimport { addSqlCommenterComment } from '../../utils/sql-common';\nimport type { Connection, Query, QueryOptions, QueryError, FieldPacket, FormatFunction } from './mysql2-types';\nimport { MySQL2InstrumentationConfig } from './types';\nimport { getConnectionAttributes, getConnectionPrototypeToInstrument, getQueryText, getSpanName, once } from './utils';\nimport {\n ATTR_DB_QUERY_TEXT,\n ATTR_DB_SYSTEM_NAME,\n DB_SYSTEM_NAME_VALUE_MYSQL,\n} from '@opentelemetry/semantic-conventions';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-mysql2';\n\nconst supportedVersions = ['>=1.4.2 <4'];\n\nexport class MySQL2Instrumentation extends InstrumentationBase<MySQL2InstrumentationConfig> {\n private _netSemconvStability!: SemconvStability;\n private _dbSemconvStability!: SemconvStability;\n\n constructor(config: MySQL2InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n this._setSemconvStabilityFromEnv();\n }\n\n private _setSemconvStabilityFromEnv() {\n this._netSemconvStability = semconvStabilityFromStr('http', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);\n this._dbSemconvStability = semconvStabilityFromStr('database', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);\n }\n\n protected init() {\n let format: FormatFunction | undefined;\n function setFormatFunction(moduleExports: any) {\n if (!format && moduleExports.format) {\n format = moduleExports.format;\n }\n }\n const patch = (ConnectionPrototype: Connection) => {\n if (isWrapped(ConnectionPrototype.query)) {\n this._unwrap(ConnectionPrototype, 'query');\n }\n this._wrap(ConnectionPrototype, 'query', this._patchQuery(format, false) as any);\n if (isWrapped(ConnectionPrototype.execute)) {\n this._unwrap(ConnectionPrototype, 'execute');\n }\n this._wrap(ConnectionPrototype, 'execute', this._patchQuery(format, true) as any);\n };\n const unpatch = (ConnectionPrototype: Connection) => {\n this._unwrap(ConnectionPrototype, 'query');\n this._unwrap(ConnectionPrototype, 'execute');\n };\n return [\n new InstrumentationNodeModuleDefinition(\n 'mysql2',\n supportedVersions,\n (moduleExports: any) => {\n setFormatFunction(moduleExports);\n return moduleExports;\n },\n () => {},\n [\n new InstrumentationNodeModuleFile(\n 'mysql2/promise.js',\n supportedVersions,\n (moduleExports: any) => {\n setFormatFunction(moduleExports);\n return moduleExports;\n },\n () => {},\n ),\n new InstrumentationNodeModuleFile(\n 'mysql2/lib/connection.js',\n supportedVersions,\n (moduleExports: any) => {\n const ConnectionPrototype: Connection = getConnectionPrototypeToInstrument(moduleExports);\n patch(ConnectionPrototype);\n return moduleExports;\n },\n (moduleExports: any) => {\n if (moduleExports === undefined) return;\n const ConnectionPrototype: Connection = getConnectionPrototypeToInstrument(moduleExports);\n unpatch(ConnectionPrototype);\n },\n ),\n ],\n ),\n ];\n }\n\n private _patchQuery(format: FormatFunction | undefined, isPrepared: boolean) {\n return (originalQuery: Function): Function => {\n const thisPlugin = this;\n return function query(\n this: Connection,\n query: string | Query | QueryOptions,\n _valuesOrCallback?: unknown[] | Function,\n _callback?: Function,\n ) {\n let values;\n if (Array.isArray(_valuesOrCallback)) {\n values = _valuesOrCallback;\n } else if (arguments[2]) {\n values = [_valuesOrCallback];\n }\n const { maskStatement, maskStatementHook, responseHook } = thisPlugin.getConfig();\n\n const attributes: api.Attributes = getConnectionAttributes(\n this.config,\n thisPlugin._dbSemconvStability,\n thisPlugin._netSemconvStability,\n );\n const dbQueryText = getQueryText(query, format, values, maskStatement, maskStatementHook);\n if (thisPlugin._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_SYSTEM] = DB_SYSTEM_VALUE_MYSQL;\n attributes[ATTR_DB_STATEMENT] = dbQueryText;\n }\n if (thisPlugin._dbSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_MYSQL;\n attributes[ATTR_DB_QUERY_TEXT] = dbQueryText;\n }\n\n const span = thisPlugin.tracer.startSpan(getSpanName(query), {\n kind: api.SpanKind.CLIENT,\n attributes,\n });\n\n if (!isPrepared && thisPlugin.getConfig().addSqlCommenterCommentToQueries) {\n arguments[0] = query =\n typeof query === 'string'\n ? addSqlCommenterComment(span, query)\n : Object.assign(query, {\n sql: addSqlCommenterComment(span, query.sql),\n });\n }\n\n const endSpan = once((err?: any, results?: any) => {\n if (err) {\n span.setStatus({\n code: api.SpanStatusCode.ERROR,\n message: err.message,\n });\n } else {\n if (typeof responseHook === 'function') {\n safeExecuteInTheMiddle(\n () => {\n responseHook(span, {\n queryResults: results,\n });\n },\n err => {\n if (err) {\n thisPlugin._diag.warn('Failed executing responseHook', err);\n }\n },\n true,\n );\n }\n }\n\n span.end();\n });\n\n if (arguments.length === 1) {\n if (typeof (query as any).onResult === 'function') {\n thisPlugin._wrap(query as any, 'onResult', thisPlugin._patchCallbackQuery(endSpan));\n }\n\n const streamableQuery: Query = originalQuery.apply(this, arguments);\n\n streamableQuery\n .once('error', (err: any) => {\n endSpan(err);\n })\n .once('result', (results: any) => {\n endSpan(undefined, results);\n });\n\n return streamableQuery;\n }\n\n if (typeof arguments[1] === 'function') {\n thisPlugin._wrap(arguments, 1, thisPlugin._patchCallbackQuery(endSpan));\n } else if (typeof arguments[2] === 'function') {\n thisPlugin._wrap(arguments, 2, thisPlugin._patchCallbackQuery(endSpan));\n }\n\n return originalQuery.apply(this, arguments);\n };\n };\n }\n\n private _patchCallbackQuery(endSpan: Function) {\n return (originalCallback: Function) => {\n return function (err: QueryError | null, results?: any, _fields?: FieldPacket[]) {\n endSpan(err, results);\n return originalCallback(...arguments);\n };\n };\n }\n}\n"],"names":["err"],"mappings":";;;;;;;;;AA6CA,MAAM,YAAA,GAAe,gCAAA;AAErB,MAAM,iBAAA,GAAoB,CAAC,YAAY,CAAA;AAEhC,MAAM,8BAA8B,mBAAA,CAAiD;AAAA,EAI1F,WAAA,CAAY,MAAA,GAAsC,EAAC,EAAG;AACpD,IAAA,KAAA,CAAM,YAAA,EAAc,aAAa,MAAM,CAAA;AACvC,IAAA,IAAA,CAAK,2BAAA,EAA4B;AAAA,EACnC;AAAA,EAEQ,2BAAA,GAA8B;AACpC,IAAA,IAAA,CAAK,oBAAA,GAAuB,uBAAA,CAAwB,MAAA,EAAQ,OAAA,CAAQ,IAAI,6BAA6B,CAAA;AACrG,IAAA,IAAA,CAAK,mBAAA,GAAsB,uBAAA,CAAwB,UAAA,EAAY,OAAA,CAAQ,IAAI,6BAA6B,CAAA;A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AW,OAAO,SAAA,CAAU,CAAC,MAAM,UAAA,EAAY;AAC7C,UAAA,UAAA,CAAW,MAAM,SAAA,EAAW,CAAA,EAAG,UAAA,CAAW,mBAAA,CAAoB,OAAO,CAAC,CAAA;AAAA,QACxE;AAEA,QAAA,OAAO,aAAA,CAAc,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAAA,MAC5C,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AAAA,EAEQ,oBAAoB,OAAA,EAAmB;AAC7C,IAAA,OAAO,CAAC,gBAAA,KAA+B;AACrC,MAAA,OAAO,SAAU,GAAA,EAAwB,OAAA,EAAe,OAAA,EAAyB;AAC/E,QAAA,OAAA,CAAQ,KAAK,OAAO,CAAA;AACpB,QAAA,OAAO,gBAAA,CAAiB,GAAG,SAAS,CAAA;AAAA,MACtC,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AACF;;;;"}
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/mysql2/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql2\n * - Upstream version: @opentelemetry/instrumentation-mysql2@0.64.0\n * - Types from 'mysql2' inlined as simplified interfaces\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n * - Refactored to use Sentry's span APIs instead of OpenTelemetry tracing APIs\n */\n\nimport { SpanKind } from '@opentelemetry/api';\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport type { SpanAttributes } from '@sentry/core';\nimport { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, startInactiveSpan } from '@sentry/core';\nimport { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile';\nimport type { Connection, FormatFunction, Query, QueryError, QueryOptions } from './mysql2-types';\nimport { ATTR_DB_STATEMENT, ATTR_DB_SYSTEM, DB_SYSTEM_VALUE_MYSQL } from './semconv';\nimport { getConnectionAttributes, getConnectionPrototypeToInstrument, getQueryText, getSpanName, once } from './utils';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-mysql2';\nconst ORIGIN = 'auto.db.otel.mysql2';\n\nconst supportedVersions = ['>=1.4.2 <4'];\n\n// The raw imported `mysql2` module exposes the `format` helper used to render\n// parameterized queries. Typed shallowly since it is only read internally.\ntype MySQL2Module = { format?: FormatFunction; [key: string]: unknown };\n\nexport class MySQL2Instrumentation extends InstrumentationBase<InstrumentationConfig> {\n public constructor(config: InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init(): InstrumentationNodeModuleDefinition[] {\n let format: FormatFunction | undefined;\n function setFormatFunction(moduleExports: MySQL2Module): void {\n if (!format && moduleExports.format) {\n format = moduleExports.format;\n }\n }\n const patch = (ConnectionPrototype: Connection): void => {\n if (isWrapped(ConnectionPrototype.query)) {\n this._unwrap(ConnectionPrototype, 'query');\n }\n this._wrap(ConnectionPrototype, 'query', this._patchQuery(format) as any);\n if (isWrapped(ConnectionPrototype.execute)) {\n this._unwrap(ConnectionPrototype, 'execute');\n }\n this._wrap(ConnectionPrototype, 'execute', this._patchQuery(format) as any);\n };\n const unpatch = (ConnectionPrototype: Connection): void => {\n this._unwrap(ConnectionPrototype, 'query');\n this._unwrap(ConnectionPrototype, 'execute');\n };\n return [\n new InstrumentationNodeModuleDefinition(\n 'mysql2',\n supportedVersions,\n (moduleExports: MySQL2Module) => {\n setFormatFunction(moduleExports);\n return moduleExports;\n },\n () => {},\n [\n new InstrumentationNodeModuleFile(\n 'mysql2/promise.js',\n supportedVersions,\n (moduleExports: MySQL2Module) => {\n setFormatFunction(moduleExports);\n return moduleExports;\n },\n () => {},\n ),\n new InstrumentationNodeModuleFile(\n 'mysql2/lib/connection.js',\n supportedVersions,\n (moduleExports: any) => {\n const ConnectionPrototype: Connection = getConnectionPrototypeToInstrument(moduleExports);\n patch(ConnectionPrototype);\n return moduleExports;\n },\n (moduleExports: any) => {\n if (moduleExports === undefined) return;\n const ConnectionPrototype: Connection = getConnectionPrototypeToInstrument(moduleExports);\n unpatch(ConnectionPrototype);\n },\n ),\n ],\n ),\n ];\n }\n\n private _patchQuery(format: FormatFunction | undefined) {\n const thisPlugin = this;\n return (originalQuery: Function): Function => {\n return function query(\n this: Connection,\n query: string | Query | QueryOptions,\n _valuesOrCallback?: unknown[] | Function,\n _callback?: Function,\n ) {\n let values;\n if (Array.isArray(_valuesOrCallback)) {\n values = _valuesOrCallback;\n } else if (arguments[2]) {\n values = [_valuesOrCallback];\n }\n\n const attributes: SpanAttributes = {\n ...getConnectionAttributes(this.config),\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_MYSQL,\n [ATTR_DB_STATEMENT]: getQueryText(query, format, values),\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n };\n\n const span = startInactiveSpan({\n name: getSpanName(query),\n kind: SpanKind.CLIENT,\n attributes,\n });\n\n const endSpan = once((err?: QueryError | null) => {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });\n }\n span.end();\n });\n\n if (arguments.length === 1) {\n if (typeof (query as any).onResult === 'function') {\n thisPlugin._wrap(query as any, 'onResult', thisPlugin._patchCallbackQuery(endSpan));\n }\n\n const streamableQuery: Query = originalQuery.apply(this, arguments);\n\n streamableQuery\n .once('error', (err: any) => {\n endSpan(err);\n })\n .once('result', () => {\n endSpan();\n });\n\n return streamableQuery;\n }\n\n if (typeof arguments[1] === 'function') {\n thisPlugin._wrap(arguments, 1, thisPlugin._patchCallbackQuery(endSpan));\n } else if (typeof arguments[2] === 'function') {\n thisPlugin._wrap(arguments, 2, thisPlugin._patchCallbackQuery(endSpan));\n }\n\n return originalQuery.apply(this, arguments);\n };\n };\n }\n\n private _patchCallbackQuery(endSpan: (err?: QueryError | null) => void) {\n return (originalCallback: Function) => {\n return function (...args: [err: QueryError | null, ...rest: unknown[]]) {\n endSpan(args[0]);\n return originalCallback(...args);\n };\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;AAsBA,MAAM,YAAA,GAAe,gCAAA;AACrB,MAAM,MAAA,GAAS,qBAAA;AAEf,MAAM,iBAAA,GAAoB,CAAC,YAAY,CAAA;AAMhC,MAAM,8BAA8B,mBAAA,CAA2C;AAAA,EAC7E,WAAA,CAAY,MAAA,GAAgC,EAAC,EAAG;AACrD,IAAA,KAAA,CAAM,YAAA,EAAc,aAAa,MAAM,CAAA;AAAA,EACzC;AAAA,EAEU,IAAA,GAA8C;AACtD,IAAA,IAAI,MAAA;AACJ,IAAA,SAAS,kBAAkB,aAAA,EAAmC;AAC5D,MAAA,IAAI,CAAC,MAAA,IAAU,aAAA,CAAc,MAAA,EAAQ;AACnC,QAAA,MAAA,GAAS,aAAA,CAAc,MAAA;AAAA,MACzB;AAAA,IACF;AACA,IAAA,MAAM,KAAA,GAAQ,CAAC,mBAAA,KAA0C;AACvD,MAAA,IAAI,SAAA,CAAU,mBAAA,CAAoB,KAAK,CAAA,EAAG;AACxC,QAAA,IAAA,CAAK,OAAA,CAAQ,qBAAqB,OAAO,CAAA;AAAA,MAC3C;AACA,MAAA,IAAA,CAAK,MAAM,mBAAA,EAAqB,OAAA,EAAS,IAAA,CAAK,WAAA,CAAY,MAAM,CAAQ,CAAA;AACxE,MAAA,IAAI,SAAA,CAAU,mBAAA,CAAoB,OAAO,CAAA,EAAG;AAC1C,QAAA,IAAA,CAAK,OAAA,CAAQ,qBAAqB,SAAS,CAAA;AAAA,MAC7C;AACA,MAAA,IAAA,CAAK,MAAM,mBAAA,EAAqB,SAAA,EAAW,IAAA,CAAK,WAAA,CAAY,MAAM,CAAQ,CAAA;AAAA,IAC5E,CAAA;AACA,IAAA,MAAM,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AAC3B,YAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,UACb,CAAC,CAAA,CACA,IAAA,CAAK,QAAA,EAAU,MAAM;AACpB,YAAA,OAAA,EAAQ;AAAA,UACV,CAAC,CAAA;AAEH,UAAA,OAAO,eAAA;AAAA,QACT;AAEA,QAAA,IAAI,OAAO,SAAA,CAAU,CAAC,CAAA,KAAM,UAAA,EAAY;AACtC,UAAA,UAAA,CAAW,MAAM,SAAA,EAAW,CAAA,EAAG,UAAA,CAAW,mBAAA,CAAoB,OAAO,CAAC,CAAA;AAAA,QACxE,CAAA,MAAA,IAAW,OAAO,SAAA,CAAU,CAAC,MAAM,UAAA,EAAY;AAC7C,UAAA,UAAA,CAAW,MAAM,SAAA,EAAW,CAAA,EAAG,UAAA,CAAW,mBAAA,CAAoB,OAAO,CAAC,CAAA;AAAA,QACxE;AAEA,QAAA,OAAO,aAAA,CAAc,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAAA,MAC5C,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AAAA,EAEQ,oBAAoB,OAAA,EAA4C;AACtE,IAAA,OAAO,CAAC,gBAAA,KAA+B;AACrC,MAAA,OAAO,YAAa,IAAA,EAAoD;AACtE,QAAA,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAC,CAAA;AACf,QAAA,OAAO,gBAAA,CAAiB,GAAG,IAAI,CAAA;AAAA,MACjC,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/mysql2/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql2\n * - Upstream version: @opentelemetry/instrumentation-mysql2@0.64.0\n */\n/* eslint-disable */\n\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const;\nexport const ATTR_DB_NAME = 'db.name' as const;\nexport const ATTR_DB_STATEMENT = 'db.statement' as const;\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\nexport const ATTR_DB_USER = 'db.user' as const;\nexport const ATTR_NET_PEER_NAME = 'net.peer.name' as const;\nexport const ATTR_NET_PEER_PORT = 'net.peer.port' as const;\nexport const DB_SYSTEM_VALUE_MYSQL = 'mysql' as const;\n"],"names":[],"mappings":"AAqBO,MAAM,yBAAA,GAA4B;AAClC,MAAM,YAAA,GAAe;AACrB,MAAM,iBAAA,GAAoB;AAC1B,MAAM,cAAA,GAAiB;AACvB,MAAM,YAAA,GAAe;AACrB,MAAM,kBAAA,GAAqB;AAC3B,MAAM,kBAAA,GAAqB;AAC3B,MAAM,qBAAA,GAAwB;;;;"}
1
+ {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/mysql2/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-mysql2\n * - Upstream version: @opentelemetry/instrumentation-mysql2@0.64.0\n */\n\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string' as const;\nexport const ATTR_DB_NAME = 'db.name' as const;\nexport const ATTR_DB_STATEMENT = 'db.statement' as const;\nexport const ATTR_DB_SYSTEM = 'db.system' as const;\nexport const ATTR_DB_USER = 'db.user' as const;\nexport const ATTR_NET_PEER_NAME = 'net.peer.name' as const;\nexport const ATTR_NET_PEER_PORT = 'net.peer.port' as const;\nexport const DB_SYSTEM_VALUE_MYSQL = 'mysql' as const;\n"],"names":[],"mappings":"AASO,MAAM,yBAAA,GAA4B;AAClC,MAAM,YAAA,GAAe;AACrB,MAAM,iBAAA,GAAoB;AAC1B,MAAM,cAAA,GAAiB;AACvB,MAAM,YAAA,GAAe;AACrB,MAAM,kBAAA,GAAqB;AAC3B,MAAM,kBAAA,GAAqB;AAC3B,MAAM,qBAAA,GAAwB;;;;"}