@sentry/node 10.57.0 → 10.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (523) hide show
  1. package/build/cjs/index.js +2 -0
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/fs/index.js +3 -84
  4. package/build/cjs/integrations/fs/index.js.map +1 -1
  5. package/build/cjs/integrations/fs/vendored/constants.js.map +1 -1
  6. package/build/cjs/integrations/fs/vendored/instrumentation.js +145 -175
  7. package/build/cjs/integrations/fs/vendored/instrumentation.js.map +1 -1
  8. package/build/cjs/integrations/fs/vendored/utils.js.map +1 -1
  9. package/build/cjs/integrations/node-fetch/vendored/undici.js.map +1 -1
  10. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  11. package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
  12. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  13. package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  14. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  15. package/build/cjs/integrations/tracing/connect/index.js +0 -21
  16. package/build/cjs/integrations/tracing/connect/index.js.map +1 -1
  17. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +0 -6
  18. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
  19. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +33 -42
  20. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  21. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
  22. package/build/cjs/integrations/tracing/connect/vendored/utils.js +3 -2
  23. package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -1
  24. package/build/cjs/integrations/tracing/dataloader/index.js +2 -22
  25. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -1
  26. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js +93 -120
  27. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  28. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +1 -1
  29. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  30. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  31. package/build/cjs/integrations/tracing/genericPool/index.js +1 -15
  32. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -1
  33. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +37 -37
  34. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  35. package/build/cjs/integrations/tracing/graphql/index.js +1 -51
  36. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -1
  37. package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +1 -1
  38. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
  39. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
  40. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +67 -57
  41. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  42. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
  43. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
  44. package/build/cjs/integrations/tracing/graphql/vendored/utils.js +28 -62
  45. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  46. package/build/cjs/integrations/tracing/hapi/index.js +0 -17
  47. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  48. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
  49. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +28 -45
  50. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  51. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
  52. package/build/cjs/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
  53. package/build/cjs/integrations/tracing/hapi/vendored/utils.js +4 -9
  54. package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  55. package/build/cjs/integrations/tracing/index.js +1 -0
  56. package/build/cjs/integrations/tracing/index.js.map +1 -1
  57. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  58. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js.map +1 -1
  59. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js.map +1 -1
  60. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  61. package/build/cjs/integrations/tracing/knex/index.js +2 -17
  62. package/build/cjs/integrations/tracing/knex/index.js.map +1 -1
  63. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +65 -93
  64. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  65. package/build/cjs/integrations/tracing/knex/vendored/semconv.js +2 -0
  66. package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  67. package/build/cjs/integrations/tracing/knex/vendored/utils.js +2 -15
  68. package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -1
  69. package/build/cjs/integrations/tracing/koa/index.js +1 -24
  70. package/build/cjs/integrations/tracing/koa/index.js.map +1 -1
  71. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
  72. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +29 -41
  73. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  74. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
  75. package/build/cjs/integrations/tracing/koa/vendored/types.js.map +1 -1
  76. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -1
  77. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  78. package/build/cjs/integrations/tracing/mongo/index.js +1 -42
  79. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -1
  80. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +12 -562
  81. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  82. package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
  83. package/build/cjs/integrations/tracing/mongo/vendored/patches.js +151 -0
  84. package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  85. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js +0 -4
  86. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  87. package/build/cjs/integrations/tracing/mongo/vendored/utils.js +153 -0
  88. package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  89. package/build/cjs/integrations/tracing/mongoose/index.js +1 -8
  90. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -1
  91. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +56 -203
  92. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  93. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js +0 -4
  94. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  95. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +19 -49
  96. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  97. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
  98. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  99. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  100. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  101. package/build/cjs/integrations/tracing/mysql2/index.js +1 -8
  102. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -1
  103. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +21 -59
  104. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  105. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  106. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +14 -33
  107. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  108. package/build/cjs/integrations/tracing/postgres/index.js +0 -4
  109. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -1
  110. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
  111. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
  112. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
  113. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +51 -261
  114. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  115. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +0 -12
  116. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  117. package/build/cjs/integrations/tracing/postgres/vendored/utils.js +43 -167
  118. package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  119. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  120. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  121. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -1
  122. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  123. package/build/cjs/integrations/tracing/redis/index.js +1 -1
  124. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  125. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +89 -160
  126. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  127. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  128. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +92 -231
  129. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  130. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +0 -2
  131. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  132. package/build/cjs/integrations/tracing/tedious/index.js +1 -25
  133. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -1
  134. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +25 -76
  135. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  136. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  137. package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +1 -1
  138. package/build/cjs/sdk/diagnosticsChannelInjection.js +21 -0
  139. package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -0
  140. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +19 -0
  141. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  142. package/build/cjs/sdk/index.js +17 -1
  143. package/build/cjs/sdk/index.js.map +1 -1
  144. package/build/esm/index.js +1 -0
  145. package/build/esm/index.js.map +1 -1
  146. package/build/esm/integrations/fs/index.js +4 -85
  147. package/build/esm/integrations/fs/index.js.map +1 -1
  148. package/build/esm/integrations/fs/vendored/constants.js.map +1 -1
  149. package/build/esm/integrations/fs/vendored/instrumentation.js +147 -177
  150. package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -1
  151. package/build/esm/integrations/fs/vendored/utils.js.map +1 -1
  152. package/build/esm/integrations/node-fetch/vendored/undici.js.map +1 -1
  153. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  154. package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -1
  155. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  156. package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  157. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  158. package/build/esm/integrations/tracing/connect/index.js +1 -22
  159. package/build/esm/integrations/tracing/connect/index.js.map +1 -1
  160. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +1 -6
  161. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -1
  162. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +36 -44
  163. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  164. package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +1 -1
  165. package/build/esm/integrations/tracing/connect/vendored/utils.js +3 -2
  166. package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -1
  167. package/build/esm/integrations/tracing/dataloader/index.js +4 -24
  168. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -1
  169. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js +95 -122
  170. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  171. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +1 -1
  172. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  173. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  174. package/build/esm/integrations/tracing/genericPool/index.js +3 -17
  175. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -1
  176. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +38 -38
  177. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  178. package/build/esm/integrations/tracing/graphql/index.js +3 -53
  179. package/build/esm/integrations/tracing/graphql/index.js.map +1 -1
  180. package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +1 -1
  181. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -2
  182. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -1
  183. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +69 -59
  184. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  185. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +1 -1
  186. package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +1 -1
  187. package/build/esm/integrations/tracing/graphql/vendored/utils.js +29 -62
  188. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -1
  189. package/build/esm/integrations/tracing/hapi/index.js +1 -18
  190. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  191. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -1
  192. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +30 -47
  193. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  194. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +1 -1
  195. package/build/esm/integrations/tracing/hapi/vendored/semconv.js.map +1 -1
  196. package/build/esm/integrations/tracing/hapi/vendored/utils.js +5 -10
  197. package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  198. package/build/esm/integrations/tracing/index.js +1 -0
  199. package/build/esm/integrations/tracing/index.js.map +1 -1
  200. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  201. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js.map +1 -1
  202. package/build/esm/integrations/tracing/kafka/vendored/propagator.js.map +1 -1
  203. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  204. package/build/esm/integrations/tracing/knex/index.js +4 -19
  205. package/build/esm/integrations/tracing/knex/index.js.map +1 -1
  206. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +66 -94
  207. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  208. package/build/esm/integrations/tracing/knex/vendored/semconv.js +2 -1
  209. package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  210. package/build/esm/integrations/tracing/knex/vendored/utils.js +3 -15
  211. package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -1
  212. package/build/esm/integrations/tracing/koa/index.js +3 -26
  213. package/build/esm/integrations/tracing/koa/index.js.map +1 -1
  214. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -1
  215. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +31 -43
  216. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  217. package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +1 -1
  218. package/build/esm/integrations/tracing/koa/vendored/types.js.map +1 -1
  219. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -1
  220. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  221. package/build/esm/integrations/tracing/mongo/index.js +3 -43
  222. package/build/esm/integrations/tracing/mongo/index.js.map +1 -1
  223. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +13 -563
  224. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  225. package/build/esm/integrations/tracing/mongo/vendored/internal-types.js.map +1 -1
  226. package/build/esm/integrations/tracing/mongo/vendored/patches.js +143 -0
  227. package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +1 -0
  228. package/build/esm/integrations/tracing/mongo/vendored/semconv.js +1 -3
  229. package/build/esm/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  230. package/build/esm/integrations/tracing/mongo/vendored/utils.js +146 -0
  231. package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -0
  232. package/build/esm/integrations/tracing/mongoose/index.js +2 -9
  233. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -1
  234. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +59 -206
  235. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  236. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js +1 -3
  237. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  238. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +20 -50
  239. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  240. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -1
  241. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  242. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  243. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  244. package/build/esm/integrations/tracing/mysql2/index.js +2 -9
  245. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -1
  246. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +26 -64
  247. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  248. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  249. package/build/esm/integrations/tracing/mysql2/vendored/utils.js +15 -34
  250. package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  251. package/build/esm/integrations/tracing/postgres/index.js +1 -5
  252. package/build/esm/integrations/tracing/postgres/index.js.map +1 -1
  253. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -1
  254. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -1
  255. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -1
  256. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +52 -262
  257. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  258. package/build/esm/integrations/tracing/postgres/vendored/semconv.js +1 -7
  259. package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  260. package/build/esm/integrations/tracing/postgres/vendored/utils.js +44 -165
  261. package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  262. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  263. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  264. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -1
  265. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  266. package/build/esm/integrations/tracing/redis/index.js +1 -1
  267. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  268. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +92 -163
  269. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  270. package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  271. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +94 -233
  272. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  273. package/build/esm/integrations/tracing/redis/vendored/semconv.js +1 -2
  274. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  275. package/build/esm/integrations/tracing/tedious/index.js +3 -27
  276. package/build/esm/integrations/tracing/tedious/index.js.map +1 -1
  277. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +29 -79
  278. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  279. package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  280. package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +1 -1
  281. package/build/esm/package.json +1 -1
  282. package/build/esm/sdk/diagnosticsChannelInjection.js +17 -0
  283. package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -0
  284. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +17 -0
  285. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -0
  286. package/build/esm/sdk/index.js +17 -1
  287. package/build/esm/sdk/index.js.map +1 -1
  288. package/build/import-hook.mjs +6 -0
  289. package/build/types/index.d.ts +1 -0
  290. package/build/types/index.d.ts.map +1 -1
  291. package/build/types/integrations/fs/index.d.ts.map +1 -1
  292. package/build/types/integrations/fs/vendored/constants.d.ts.map +1 -1
  293. package/build/types/integrations/fs/vendored/instrumentation.d.ts +6 -10
  294. package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -1
  295. package/build/types/integrations/fs/vendored/types.d.ts +10 -15
  296. package/build/types/integrations/fs/vendored/types.d.ts.map +1 -1
  297. package/build/types/integrations/fs/vendored/utils.d.ts +2 -2
  298. package/build/types/integrations/fs/vendored/utils.d.ts.map +1 -1
  299. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts.map +1 -1
  300. package/build/types/integrations/node-fetch/vendored/types.d.ts.map +1 -1
  301. package/build/types/integrations/node-fetch/vendored/undici.d.ts.map +1 -1
  302. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts.map +1 -1
  303. package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts.map +1 -1
  304. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -1
  305. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -1
  306. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -1
  307. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -1
  308. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
  309. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +1 -1
  310. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +5 -5
  311. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -1
  312. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
  313. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +1 -1
  314. package/build/types/integrations/tracing/connect/vendored/utils.d.ts +1 -1
  315. package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +1 -1
  316. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -1
  317. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts +2 -5
  318. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -1
  319. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts +20 -8
  320. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -1
  321. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +1 -1
  322. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -1
  323. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +1 -1
  324. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts.map +1 -1
  325. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts +2 -1
  326. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -1
  327. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -1
  328. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +1 -1
  329. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
  330. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +1 -1
  331. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +7 -2
  332. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -1
  333. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +4 -4
  334. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +1 -1
  335. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +1 -1
  336. package/build/types/integrations/tracing/graphql/vendored/types.d.ts +5 -43
  337. package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -1
  338. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +8 -11
  339. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -1
  340. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  341. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +1 -1
  342. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
  343. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -1
  344. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +1 -1
  345. package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts.map +1 -1
  346. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +3 -4
  347. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -1
  348. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  349. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -1
  350. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts.map +1 -1
  351. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts.map +1 -1
  352. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -1
  353. package/build/types/integrations/tracing/kafka/vendored/types.d.ts.map +1 -1
  354. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -1
  355. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
  356. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -1
  357. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
  358. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -1
  359. package/build/types/integrations/tracing/knex/vendored/utils.d.ts +0 -6
  360. package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +1 -1
  361. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -1
  362. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +1 -1
  363. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +1 -1
  364. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -1
  365. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
  366. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +1 -1
  367. package/build/types/integrations/tracing/koa/vendored/types.d.ts +2 -39
  368. package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +1 -1
  369. package/build/types/integrations/tracing/koa/vendored/utils.d.ts +3 -3
  370. package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -1
  371. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -1
  372. package/build/types/integrations/tracing/mongo/index.d.ts +0 -4
  373. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -1
  374. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
  375. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -1
  376. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
  377. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -1
  378. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  379. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +1 -0
  380. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
  381. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts.map +1 -1
  382. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
  383. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -0
  384. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -1
  385. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
  386. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +1 -1
  387. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
  388. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -1
  389. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
  390. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts.map +1 -1
  391. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
  392. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -1
  393. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +1 -1
  394. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -1
  395. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -1
  396. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -1
  397. package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +1 -1
  398. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -1
  399. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -1
  400. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
  401. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -1
  402. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -1
  403. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
  404. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -1
  405. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -1
  406. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
  407. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +1 -1
  408. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +1 -1
  409. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +1 -9
  410. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -1
  411. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
  412. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +1 -1
  413. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +1 -1
  414. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +1 -1
  415. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
  416. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -1
  417. package/build/types/integrations/tracing/postgres/vendored/types.d.ts +2 -56
  418. package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -1
  419. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
  420. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -1
  421. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -1
  422. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -1
  423. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -1
  424. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -1
  425. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -1
  426. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
  427. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
  428. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -1
  429. package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts.map +1 -1
  430. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -1
  431. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -1
  432. package/build/types/integrations/tracing/redis/vendored/types.d.ts +2 -36
  433. package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -1
  434. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -1
  435. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
  436. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -1
  437. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -1
  438. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +1 -1
  439. package/build/types/sdk/diagnosticsChannelInjection.d.ts +41 -0
  440. package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -0
  441. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
  442. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -0
  443. package/build/types/sdk/index.d.ts.map +1 -1
  444. package/build/types-ts3.8/index.d.ts +1 -0
  445. package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +6 -10
  446. package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +10 -15
  447. package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +2 -2
  448. package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -4
  449. package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +4 -4
  450. package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +2 -2
  451. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/instrumentation.d.ts +2 -5
  452. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/types.d.ts +20 -8
  453. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +1 -1
  454. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/instrumentation.d.ts +2 -1
  455. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +1 -3
  456. package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +6 -1
  457. package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +3 -3
  458. package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +4 -42
  459. package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +6 -9
  460. package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +2 -2
  461. package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +1 -2
  462. package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +8 -10
  463. package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +1 -0
  464. package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +0 -6
  465. package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +4 -4
  466. package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +1 -38
  467. package/build/types-ts3.8/integrations/tracing/mongo/index.d.ts +0 -4
  468. package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +4 -72
  469. package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -59
  470. package/build/types-ts3.8/integrations/tracing/mongo/vendored/patches.d.ts +15 -0
  471. package/build/types-ts3.8/integrations/tracing/mongo/vendored/semconv.d.ts +0 -54
  472. package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +24 -0
  473. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +3 -0
  474. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +3 -8
  475. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -14
  476. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +4 -6
  477. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +3 -6
  478. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +3 -5
  479. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -1
  480. package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +0 -8
  481. package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -2
  482. package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +0 -50
  483. package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +1 -55
  484. package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +13 -26
  485. package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +3 -8
  486. package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +2 -36
  487. package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +3 -14
  488. package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +41 -0
  489. package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +34 -0
  490. package/package.json +20 -6
  491. package/build/cjs/integrations/tracing/knex/vendored/constants.js +0 -16
  492. package/build/cjs/integrations/tracing/knex/vendored/constants.js.map +0 -1
  493. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js +0 -6
  494. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
  495. package/build/cjs/integrations/tracing/utils/sql-common.js +0 -43
  496. package/build/cjs/integrations/tracing/utils/sql-common.js.map +0 -1
  497. package/build/esm/integrations/tracing/knex/vendored/constants.js +0 -13
  498. package/build/esm/integrations/tracing/knex/vendored/constants.js.map +0 -1
  499. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js +0 -4
  500. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js.map +0 -1
  501. package/build/esm/integrations/tracing/utils/sql-common.js +0 -41
  502. package/build/esm/integrations/tracing/utils/sql-common.js.map +0 -1
  503. package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +0 -14
  504. package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts.map +0 -1
  505. package/build/types/integrations/tracing/knex/vendored/constants.d.ts +0 -3
  506. package/build/types/integrations/tracing/knex/vendored/constants.d.ts.map +0 -1
  507. package/build/types/integrations/tracing/knex/vendored/types.d.ts +0 -8
  508. package/build/types/integrations/tracing/knex/vendored/types.d.ts.map +0 -1
  509. package/build/types/integrations/tracing/mongo/vendored/types.d.ts +0 -51
  510. package/build/types/integrations/tracing/mongo/vendored/types.d.ts.map +0 -1
  511. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
  512. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts.map +0 -1
  513. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
  514. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts.map +0 -1
  515. package/build/types/integrations/tracing/tedious/vendored/types.d.ts +0 -10
  516. package/build/types/integrations/tracing/tedious/vendored/types.d.ts.map +0 -1
  517. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +0 -14
  518. package/build/types-ts3.8/integrations/tracing/knex/vendored/constants.d.ts +0 -3
  519. package/build/types-ts3.8/integrations/tracing/knex/vendored/types.d.ts +0 -8
  520. package/build/types-ts3.8/integrations/tracing/mongo/vendored/types.d.ts +0 -51
  521. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/types.d.ts +0 -36
  522. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/types.d.ts +0 -18
  523. package/build/types-ts3.8/integrations/tracing/tedious/vendored/types.d.ts +0 -10
@@ -1 +1 @@
1
- {"version":3,"file":"redis-instrumentation.js","sources":["../../../../../../src/integrations/tracing/redis/vendored/redis-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/instrumentation-redis-v0.62.0/packages/instrumentation-redis\n * - Upstream version: @opentelemetry/instrumentation-redis@0.62.0\n * - Minor TypeScript adjustments for this repository's compiler settings\n */\n/* eslint-disable -- vendored @opentelemetry/instrumentation-redis */\n\nimport { context, SpanKind, SpanStatusCode, trace } from '@opentelemetry/api';\nimport type { DiagLogger, Span, TracerProvider } from '@opentelemetry/api';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } 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 {\n ATTR_DB_OPERATION_NAME,\n ATTR_DB_QUERY_TEXT,\n ATTR_DB_SYSTEM_NAME,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n} from '@opentelemetry/semantic-conventions';\n\nimport { defaultDbStatementSerializer } from './redis-common';\nimport {\n ATTR_DB_CONNECTION_STRING,\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n DB_SYSTEM_NAME_VALUE_REDIS,\n DB_SYSTEM_VALUE_REDIS,\n} from './semconv';\nimport type { RedisInstrumentationConfig } from './types';\n\nconst PACKAGE_NAME = '@opentelemetry/instrumentation-redis';\nconst PACKAGE_VERSION = '0.62.0';\n\n// ---- Internal types ----\n\ninterface RedisPluginClientTypes {\n connection_options?: {\n port?: string | number;\n host?: string;\n };\n address?: string;\n}\n\ninterface RedisCommand {\n command: string;\n args: string[];\n buffer_args: boolean;\n callback: (err: Error | null, reply: unknown) => void;\n call_on_write: boolean;\n}\n\ninterface MultiErrorReply extends Error {\n replies: unknown[];\n errorIndexes: Array<number>;\n}\n\ninterface OpenSpanInfo {\n span: Span;\n commandName: string;\n commandArgs: Array<string | Buffer>;\n}\n\nconst OTEL_OPEN_SPANS = Symbol('opentelemetry.instrumentation.redis.open_spans');\nconst MULTI_COMMAND_OPTIONS = Symbol('opentelemetry.instrumentation.redis.multi_command_options');\n\n// ---- v4-v5 utils ----\n\nfunction removeCredentialsFromDBConnectionStringAttribute(\n diagLogger: DiagLogger,\n url: string | undefined,\n): string | undefined {\n if (typeof url !== 'string' || !url) {\n return undefined;\n }\n try {\n const u = new URL(url);\n u.searchParams.delete('user_pwd');\n u.username = '';\n u.password = '';\n return u.href;\n } catch (err) {\n diagLogger.error('failed to sanitize redis connection url', err);\n }\n return undefined;\n}\n\nfunction getClientAttributes(\n diagLogger: DiagLogger,\n options: any,\n semconvStability: SemconvStability,\n): Record<string, any> {\n const attributes: Record<string, any> = {};\n if (semconvStability & SemconvStability.OLD) {\n Object.assign(attributes, {\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n [ATTR_NET_PEER_NAME]: options?.socket?.host,\n [ATTR_NET_PEER_PORT]: options?.socket?.port,\n [ATTR_DB_CONNECTION_STRING]: removeCredentialsFromDBConnectionStringAttribute(diagLogger, options?.url),\n });\n }\n if (semconvStability & SemconvStability.STABLE) {\n Object.assign(attributes, {\n [ATTR_DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_REDIS,\n [ATTR_SERVER_ADDRESS]: options?.socket?.host,\n [ATTR_SERVER_PORT]: options?.socket?.port,\n });\n }\n return attributes;\n}\n\n// ---- v2-v3 utils ----\n\nfunction endSpanV2(span: Span, err: Error | null | undefined): void {\n if (err) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n }\n span.end();\n}\n\nfunction getTracedCreateClient(original: Function): Function {\n return function createClientTrace(this: any) {\n const client = original.apply(this, arguments);\n return context.bind(context.active(), client);\n };\n}\n\nfunction getTracedCreateStreamTrace(original: Function): Function {\n return function create_stream_trace(this: any) {\n if (!Object.prototype.hasOwnProperty.call(this, 'stream')) {\n Object.defineProperty(this, 'stream', {\n get() {\n return this._patched_redis_stream;\n },\n set(val: any) {\n context.bind(context.active(), val);\n this._patched_redis_stream = val;\n },\n });\n }\n return original.apply(this, arguments);\n };\n}\n\n// ---- RedisInstrumentationV2_V3 ----\n\nclass RedisInstrumentationV2_V3 extends InstrumentationBase<RedisInstrumentationConfig> {\n static COMPONENT = 'redis';\n _semconvStability: SemconvStability;\n\n constructor(config: RedisInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n this._semconvStability = config.semconvStability\n ? config.semconvStability\n : semconvStabilityFromStr('database', process.env['OTEL_SEMCONV_STABILITY_OPT_IN']);\n }\n\n override setConfig(config: RedisInstrumentationConfig = {}): void {\n super.setConfig(config);\n this._semconvStability = config.semconvStability\n ? config.semconvStability\n : semconvStabilityFromStr('database', process.env['OTEL_SEMCONV_STABILITY_OPT_IN']);\n }\n\n init() {\n return [\n new InstrumentationNodeModuleDefinition(\n 'redis',\n ['>=2.6.0 <4'],\n (moduleExports: any) => {\n if (isWrapped(moduleExports.RedisClient.prototype['internal_send_command'])) {\n this._unwrap(moduleExports.RedisClient.prototype, 'internal_send_command');\n }\n this._wrap(moduleExports.RedisClient.prototype, 'internal_send_command', this._getPatchInternalSendCommand());\n if (isWrapped(moduleExports.RedisClient.prototype['create_stream'])) {\n this._unwrap(moduleExports.RedisClient.prototype, 'create_stream');\n }\n this._wrap(moduleExports.RedisClient.prototype, 'create_stream', this._getPatchCreateStream());\n if (isWrapped(moduleExports.createClient)) {\n this._unwrap(moduleExports, 'createClient');\n }\n this._wrap(moduleExports, 'createClient', this._getPatchCreateClient());\n return moduleExports;\n },\n (moduleExports: any) => {\n if (moduleExports === undefined) return;\n this._unwrap(moduleExports.RedisClient.prototype, 'internal_send_command');\n this._unwrap(moduleExports.RedisClient.prototype, 'create_stream');\n this._unwrap(moduleExports, 'createClient');\n },\n ),\n ];\n }\n\n private _getPatchInternalSendCommand() {\n const instrumentation = this;\n return function internal_send_command(original: Function) {\n return function internal_send_command_trace(this: RedisPluginClientTypes, cmd: RedisCommand) {\n if (arguments.length !== 1 || typeof cmd !== 'object') {\n return original.apply(this, arguments);\n }\n const config = instrumentation.getConfig();\n const hasNoParentSpan = trace.getSpan(context.active()) === undefined;\n if (config.requireParentSpan === true && hasNoParentSpan) {\n return original.apply(this, arguments);\n }\n const dbStatementSerializer = config?.dbStatementSerializer || defaultDbStatementSerializer;\n const attributes: Record<string, any> = {};\n if (instrumentation._semconvStability & SemconvStability.OLD) {\n Object.assign(attributes, {\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n [ATTR_DB_STATEMENT]: dbStatementSerializer(cmd.command, cmd.args),\n });\n }\n if (instrumentation._semconvStability & SemconvStability.STABLE) {\n Object.assign(attributes, {\n [ATTR_DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_REDIS,\n [ATTR_DB_OPERATION_NAME]: cmd.command,\n [ATTR_DB_QUERY_TEXT]: dbStatementSerializer(cmd.command, cmd.args),\n });\n }\n attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = 'auto.db.otel.redis';\n const span = instrumentation.tracer.startSpan(`${RedisInstrumentationV2_V3.COMPONENT}-${cmd.command}`, {\n kind: SpanKind.CLIENT,\n attributes,\n });\n if (this.connection_options) {\n const connectionAttributes: Record<string, any> = {};\n if (instrumentation._semconvStability & SemconvStability.OLD) {\n Object.assign(connectionAttributes, {\n [ATTR_NET_PEER_NAME]: this.connection_options.host,\n [ATTR_NET_PEER_PORT]: this.connection_options.port,\n });\n }\n if (instrumentation._semconvStability & SemconvStability.STABLE) {\n Object.assign(connectionAttributes, {\n [ATTR_SERVER_ADDRESS]: this.connection_options.host,\n [ATTR_SERVER_PORT]: this.connection_options.port,\n });\n }\n span.setAttributes(connectionAttributes);\n }\n if (this.address && instrumentation._semconvStability & SemconvStability.OLD) {\n span.setAttribute(ATTR_DB_CONNECTION_STRING, `redis://${this.address}`);\n }\n const originalCallback = arguments[0].callback;\n if (originalCallback) {\n const originalContext = context.active();\n arguments[0].callback = function callback(this: any, err: Error | null, reply: unknown) {\n if (config?.responseHook) {\n const responseHook = config.responseHook;\n safeExecuteInTheMiddle(\n () => {\n responseHook(span, cmd.command, cmd.args, reply);\n },\n (e: Error | undefined) => {\n if (e) {\n instrumentation._diag.error('Error executing responseHook', e);\n }\n },\n true,\n );\n }\n endSpanV2(span, err);\n return context.with(originalContext, originalCallback, this, ...arguments);\n };\n }\n try {\n return original.apply(this, arguments);\n } catch (rethrow) {\n endSpanV2(span, rethrow as Error);\n throw rethrow;\n }\n };\n };\n }\n\n private _getPatchCreateClient() {\n return function createClient(original: Function) {\n return getTracedCreateClient(original);\n };\n }\n\n private _getPatchCreateStream() {\n return function createReadStream(original: Function) {\n return getTracedCreateStreamTrace(original);\n };\n }\n}\n\n// ---- RedisInstrumentationV4_V5 ----\n\nclass RedisInstrumentationV4_V5 extends InstrumentationBase<RedisInstrumentationConfig> {\n static COMPONENT = 'redis';\n _semconvStability: SemconvStability;\n\n constructor(config: RedisInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n this._semconvStability = config.semconvStability\n ? config.semconvStability\n : semconvStabilityFromStr('database', process.env['OTEL_SEMCONV_STABILITY_OPT_IN']);\n }\n\n override setConfig(config: RedisInstrumentationConfig = {}): void {\n super.setConfig(config);\n this._semconvStability = config.semconvStability\n ? config.semconvStability\n : semconvStabilityFromStr('database', process.env['OTEL_SEMCONV_STABILITY_OPT_IN']);\n }\n\n init() {\n return [\n this._getInstrumentationNodeModuleDefinition('@redis/client'),\n this._getInstrumentationNodeModuleDefinition('@node-redis/client'),\n ];\n }\n\n private _getInstrumentationNodeModuleDefinition(basePackageName: string) {\n const commanderModuleFile = new InstrumentationNodeModuleFile(\n `${basePackageName}/dist/lib/commander.js`,\n ['^1.0.0'],\n (moduleExports: any, moduleVersion?: string) => {\n const transformCommandArguments = moduleExports.transformCommandArguments;\n if (!transformCommandArguments) {\n this._diag.error('internal instrumentation error, missing transformCommandArguments function');\n return moduleExports;\n }\n const functionToPatch = moduleVersion?.startsWith('1.0.') ? 'extendWithCommands' : 'attachCommands';\n if (isWrapped(moduleExports?.[functionToPatch])) {\n this._unwrap(moduleExports, functionToPatch);\n }\n this._wrap(moduleExports, functionToPatch, this._getPatchExtendWithCommands(transformCommandArguments));\n return moduleExports;\n },\n (moduleExports: any) => {\n if (isWrapped(moduleExports?.extendWithCommands)) {\n this._unwrap(moduleExports, 'extendWithCommands');\n }\n if (isWrapped(moduleExports?.attachCommands)) {\n this._unwrap(moduleExports, 'attachCommands');\n }\n },\n );\n\n const multiCommanderModule = new InstrumentationNodeModuleFile(\n `${basePackageName}/dist/lib/client/multi-command.js`,\n ['^1.0.0', '>=5.0.0 <5.12.0'],\n (moduleExports: any) => {\n const redisClientMultiCommandPrototype = moduleExports?.default?.prototype;\n if (isWrapped(redisClientMultiCommandPrototype?.exec)) {\n this._unwrap(redisClientMultiCommandPrototype, 'exec');\n }\n this._wrap(redisClientMultiCommandPrototype, 'exec', this._getPatchMultiCommandsExec(false));\n if (isWrapped(redisClientMultiCommandPrototype?.execAsPipeline)) {\n this._unwrap(redisClientMultiCommandPrototype, 'execAsPipeline');\n }\n this._wrap(redisClientMultiCommandPrototype, 'execAsPipeline', this._getPatchMultiCommandsExec(true));\n if (isWrapped(redisClientMultiCommandPrototype?.addCommand)) {\n this._unwrap(redisClientMultiCommandPrototype, 'addCommand');\n }\n this._wrap(redisClientMultiCommandPrototype, 'addCommand', this._getPatchMultiCommandsAddCommand());\n return moduleExports;\n },\n (moduleExports: any) => {\n const redisClientMultiCommandPrototype = moduleExports?.default?.prototype;\n if (isWrapped(redisClientMultiCommandPrototype?.exec)) {\n this._unwrap(redisClientMultiCommandPrototype, 'exec');\n }\n if (isWrapped(redisClientMultiCommandPrototype?.execAsPipeline)) {\n this._unwrap(redisClientMultiCommandPrototype, 'execAsPipeline');\n }\n if (isWrapped(redisClientMultiCommandPrototype?.addCommand)) {\n this._unwrap(redisClientMultiCommandPrototype, 'addCommand');\n }\n },\n );\n\n const clientIndexModule = new InstrumentationNodeModuleFile(\n `${basePackageName}/dist/lib/client/index.js`,\n ['^1.0.0', '>=5.0.0 <5.12.0'],\n (moduleExports: any) => {\n const redisClientPrototype = moduleExports?.default?.prototype;\n if (redisClientPrototype?.multi) {\n if (isWrapped(redisClientPrototype?.multi)) {\n this._unwrap(redisClientPrototype, 'multi');\n }\n this._wrap(redisClientPrototype, 'multi', this._getPatchRedisClientMulti());\n }\n if (redisClientPrototype?.MULTI) {\n if (isWrapped(redisClientPrototype?.MULTI)) {\n this._unwrap(redisClientPrototype, 'MULTI');\n }\n this._wrap(redisClientPrototype, 'MULTI', this._getPatchRedisClientMulti());\n }\n if (isWrapped(redisClientPrototype?.sendCommand)) {\n this._unwrap(redisClientPrototype, 'sendCommand');\n }\n this._wrap(redisClientPrototype, 'sendCommand', this._getPatchRedisClientSendCommand());\n if (isWrapped(redisClientPrototype?.connect)) {\n this._unwrap(redisClientPrototype, 'connect');\n }\n this._wrap(redisClientPrototype, 'connect', this._getPatchedClientConnect());\n return moduleExports;\n },\n (moduleExports: any) => {\n const redisClientPrototype = moduleExports?.default?.prototype;\n if (isWrapped(redisClientPrototype?.multi)) {\n this._unwrap(redisClientPrototype, 'multi');\n }\n if (isWrapped(redisClientPrototype?.MULTI)) {\n this._unwrap(redisClientPrototype, 'MULTI');\n }\n if (isWrapped(redisClientPrototype?.sendCommand)) {\n this._unwrap(redisClientPrototype, 'sendCommand');\n }\n if (isWrapped(redisClientPrototype?.connect)) {\n this._unwrap(redisClientPrototype, 'connect');\n }\n },\n );\n\n return new InstrumentationNodeModuleDefinition(\n basePackageName,\n ['^1.0.0', '>=5.0.0 <5.12.0'],\n (moduleExports: any) => moduleExports,\n () => {},\n [commanderModuleFile, multiCommanderModule, clientIndexModule],\n );\n }\n\n private _getPatchExtendWithCommands(transformCommandArguments: Function) {\n const plugin = this;\n return function extendWithCommandsPatchWrapper(original: Function) {\n return function extendWithCommandsPatch(this: any, config: any) {\n if (config?.BaseClass?.name !== 'RedisClient') {\n return original.apply(this, arguments);\n }\n const origExecutor = config.executor;\n config.executor = function (this: any, command: any, args: any) {\n const redisCommandArguments = transformCommandArguments(command, args).args;\n return plugin._traceClientCommand(origExecutor, this, arguments, redisCommandArguments);\n };\n return original.apply(this, arguments);\n };\n };\n }\n\n private _getPatchMultiCommandsExec(isPipeline: boolean) {\n const plugin = this;\n return function execPatchWrapper(original: Function) {\n return function execPatch(this: any) {\n const execRes = original.apply(this, arguments);\n if (typeof execRes?.then !== 'function') {\n plugin._diag.error('non-promise result when patching exec/execAsPipeline');\n return execRes;\n }\n return execRes\n .then((redisRes: unknown[]) => {\n const openSpans: OpenSpanInfo[] = this[OTEL_OPEN_SPANS];\n plugin._endSpansWithRedisReplies(openSpans, redisRes, isPipeline);\n return redisRes;\n })\n .catch((err: any) => {\n const openSpans: OpenSpanInfo[] = this[OTEL_OPEN_SPANS];\n if (!openSpans) {\n plugin._diag.error('cannot find open spans to end for multi/pipeline');\n } else {\n const replies =\n err.constructor.name === 'MultiErrorReply'\n ? (err as MultiErrorReply).replies\n : new Array(openSpans.length).fill(err);\n plugin._endSpansWithRedisReplies(openSpans, replies, isPipeline);\n }\n return Promise.reject(err);\n });\n };\n };\n }\n\n private _getPatchMultiCommandsAddCommand() {\n const plugin = this;\n return function addCommandWrapper(original: Function) {\n return function addCommandPatch(this: any, args: any) {\n return plugin._traceClientCommand(original, this, arguments, args);\n };\n };\n }\n\n private _getPatchRedisClientMulti() {\n return function multiPatchWrapper(original: Function) {\n return function multiPatch(this: any) {\n const multiRes: any = original.apply(this, arguments);\n multiRes[MULTI_COMMAND_OPTIONS] = this.options;\n return multiRes;\n };\n };\n }\n\n private _getPatchRedisClientSendCommand() {\n const plugin = this;\n return function sendCommandWrapper(original: Function) {\n return function sendCommandPatch(this: any, args: any) {\n return plugin._traceClientCommand(original, this, arguments, args);\n };\n };\n }\n\n private _getPatchedClientConnect() {\n const plugin = this;\n return function connectWrapper(original: Function) {\n return function patchedConnect(this: any) {\n const options = this.options;\n const attributes = getClientAttributes(plugin._diag, options, plugin._semconvStability);\n attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = 'auto.db.otel.redis';\n const span = plugin.tracer.startSpan(`${RedisInstrumentationV4_V5.COMPONENT}-connect`, {\n kind: SpanKind.CLIENT,\n attributes,\n });\n const res = context.with(trace.setSpan(context.active(), span), () => {\n return original.apply(this);\n });\n return res\n .then((result: any) => {\n span.end();\n return result;\n })\n .catch((error: Error) => {\n span.recordException(error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n span.end();\n return Promise.reject(error);\n });\n };\n };\n }\n\n _traceClientCommand(\n origFunction: Function,\n origThis: any,\n origArguments: IArguments,\n redisCommandArguments: Array<string | Buffer>,\n ): any {\n const hasNoParentSpan = trace.getSpan(context.active()) === undefined;\n if (hasNoParentSpan && this.getConfig().requireParentSpan) {\n return origFunction.apply(origThis, origArguments);\n }\n const clientOptions = origThis.options || origThis[MULTI_COMMAND_OPTIONS];\n const commandName = redisCommandArguments[0] as string;\n const commandArgs = redisCommandArguments.slice(1);\n const dbStatementSerializer = this.getConfig().dbStatementSerializer || defaultDbStatementSerializer;\n const attributes = getClientAttributes(this._diag, clientOptions, this._semconvStability);\n if (this._semconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_OPERATION_NAME] = commandName;\n }\n try {\n const dbStatement = dbStatementSerializer(commandName, commandArgs);\n if (dbStatement != null) {\n if (this._semconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_STATEMENT] = dbStatement;\n }\n if (this._semconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_QUERY_TEXT] = dbStatement;\n }\n }\n } catch (e) {\n this._diag.error('dbStatementSerializer throw an exception', e, { commandName });\n }\n attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = 'auto.db.otel.redis';\n const span = this.tracer.startSpan(`${RedisInstrumentationV4_V5.COMPONENT}-${commandName}`, {\n kind: SpanKind.CLIENT,\n attributes,\n });\n const res = context.with(trace.setSpan(context.active(), span), () => {\n return origFunction.apply(origThis, origArguments);\n });\n if (typeof res?.then === 'function') {\n res.then(\n (redisRes: unknown) => {\n this._endSpanWithResponse(span, commandName, commandArgs, redisRes, undefined);\n },\n (err: Error) => {\n this._endSpanWithResponse(span, commandName, commandArgs, null, err);\n },\n );\n } else {\n const redisClientMultiCommand: any = res;\n redisClientMultiCommand[OTEL_OPEN_SPANS] = redisClientMultiCommand[OTEL_OPEN_SPANS] || [];\n redisClientMultiCommand[OTEL_OPEN_SPANS].push({\n span,\n commandName,\n commandArgs,\n });\n }\n return res;\n }\n\n _endSpansWithRedisReplies(openSpans: OpenSpanInfo[] | undefined, replies: unknown[], isPipeline = false): void {\n if (!openSpans) {\n return this._diag.error('cannot find open spans to end for redis multi/pipeline');\n }\n if (replies.length !== openSpans.length) {\n return this._diag.error('number of multi command spans does not match response from redis');\n }\n const allCommands = openSpans.map(s => s.commandName);\n const allSameCommand = allCommands.every(cmd => cmd === allCommands[0]);\n const operationName = allSameCommand\n ? (isPipeline ? 'PIPELINE ' : 'MULTI ') + allCommands[0]\n : isPipeline\n ? 'PIPELINE'\n : 'MULTI';\n for (let i = 0; i < openSpans.length; i++) {\n const { span, commandArgs } = openSpans[i]!;\n const currCommandRes = replies[i];\n const [res, err] = currCommandRes instanceof Error ? [null, currCommandRes] : [currCommandRes, undefined];\n if (this._semconvStability & SemconvStability.STABLE) {\n span.setAttribute(ATTR_DB_OPERATION_NAME, operationName);\n }\n this._endSpanWithResponse(span, allCommands[i]!, commandArgs, res, err);\n }\n }\n\n _endSpanWithResponse(\n span: Span,\n commandName: string,\n commandArgs: Array<string | Buffer>,\n response: unknown,\n error: Error | null | undefined,\n ): void {\n const { responseHook } = this.getConfig();\n if (!error && responseHook) {\n try {\n responseHook(span, commandName, commandArgs, response);\n } catch (err) {\n this._diag.error('responseHook throw an exception', err);\n }\n }\n if (error) {\n span.recordException(error);\n span.setStatus({ code: SpanStatusCode.ERROR, message: error?.message });\n }\n span.end();\n }\n}\n\n// ---- RedisInstrumentation (wrapper) ----\n\nconst DEFAULT_CONFIG: RedisInstrumentationConfig = {\n requireParentSpan: false,\n};\n\nexport class RedisInstrumentation extends InstrumentationBase<RedisInstrumentationConfig> {\n private instrumentationV2_V3: RedisInstrumentationV2_V3;\n private instrumentationV4_V5: RedisInstrumentationV4_V5;\n private initialized = false;\n\n constructor(config: RedisInstrumentationConfig = {}) {\n const resolvedConfig = { ...DEFAULT_CONFIG, ...config };\n super(PACKAGE_NAME, PACKAGE_VERSION, resolvedConfig);\n this.instrumentationV2_V3 = new RedisInstrumentationV2_V3(this.getConfig());\n this.instrumentationV4_V5 = new RedisInstrumentationV4_V5(this.getConfig());\n this.initialized = true;\n }\n\n override setConfig(config: RedisInstrumentationConfig = {}): void {\n const newConfig = { ...DEFAULT_CONFIG, ...config };\n super.setConfig(newConfig);\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.setConfig(newConfig);\n this.instrumentationV4_V5.setConfig(newConfig);\n }\n\n init() {}\n\n override getModuleDefinitions() {\n return [...this.instrumentationV2_V3.getModuleDefinitions(), ...this.instrumentationV4_V5.getModuleDefinitions()];\n }\n\n override setTracerProvider(tracerProvider: TracerProvider): void {\n super.setTracerProvider(tracerProvider);\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.setTracerProvider(tracerProvider);\n this.instrumentationV4_V5.setTracerProvider(tracerProvider);\n }\n\n override enable(): void {\n super.enable();\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.enable();\n this.instrumentationV4_V5.enable();\n }\n\n override disable(): void {\n super.disable();\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.disable();\n this.instrumentationV4_V5.disable();\n }\n}\n"],"names":["SemconvStability","ATTR_DB_SYSTEM","DB_SYSTEM_VALUE_REDIS","ATTR_NET_PEER_NAME","ATTR_NET_PEER_PORT","ATTR_DB_CONNECTION_STRING","ATTR_DB_SYSTEM_NAME","DB_SYSTEM_NAME_VALUE_REDIS","ATTR_SERVER_ADDRESS","ATTR_SERVER_PORT","SpanStatusCode","context","InstrumentationBase","semconvStabilityFromStr","InstrumentationNodeModuleDefinition","isWrapped","instrumentation","trace","defaultDbStatementSerializer","ATTR_DB_STATEMENT","ATTR_DB_OPERATION_NAME","ATTR_DB_QUERY_TEXT","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SpanKind","safeExecuteInTheMiddle","InstrumentationNodeModuleFile"],"mappings":";;;;;;;;;;AAsDA,MAAM,YAAA,GAAe,sCAAA;AACrB,MAAM,eAAA,GAAkB,QAAA;AA+BxB,MAAM,eAAA,0BAAyB,gDAAgD,CAAA;AAC/E,MAAM,qBAAA,0BAA+B,2DAA2D,CAAA;AAIhG,SAAS,gDAAA,CACP,YACA,GAAA,EACoB;AACpB,EAAA,IAAI,OAAO,GAAA,KAAQ,QAAA,IAAY,CAAC,GAAA,EAAK;AACnC,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,IAAI;AACF,IAAA,MAAM,CAAA,GAAI,IAAI,GAAA,CAAI,GAAG,CAAA;AACrB,IAAA,CAAA,CAAE,YAAA,CAAa,OAAO,UAAU,CAAA;AAChC,IAAA,CAAA,CAAE,QAAA,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ACjC,IAAA,IAAA,CAAK,qBAAqB,MAAA,EAAO;AAAA,EACnC;AAAA,EAES,OAAA,GAAgB;AACvB,IAAA,KAAA,CAAM,OAAA,EAAQ;AACd,IAAA,IAAI,CAAC,KAAK,WAAA,EAAa;AACrB,MAAA;AAAA,IACF;AACA,IAAA,IAAA,CAAK,qBAAqB,OAAA,EAAQ;AAClC,IAAA,IAAA,CAAK,qBAAqB,OAAA,EAAQ;AAAA,EACpC;AACF;;;;"}
1
+ {"version":3,"file":"redis-instrumentation.js","sources":["../../../../../../src/integrations/tracing/redis/vendored/redis-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/instrumentation-redis-v0.62.0/packages/instrumentation-redis\n * - Upstream version: @opentelemetry/instrumentation-redis@0.62.0\n * - Minor TypeScript 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 { TracerProvider } from '@opentelemetry/api';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport {\n debug,\n getActiveSpan,\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n withActiveSpan,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from '../../../../debug-build';\nimport { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile';\nimport { defaultDbStatementSerializer } from './redis-common';\nimport {\n ATTR_DB_CONNECTION_STRING,\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n DB_SYSTEM_VALUE_REDIS,\n} from './semconv';\nimport type { RedisInstrumentationConfig, RedisResponseCustomAttributeFunction } from './types';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-redis';\nconst ORIGIN = 'auto.db.otel.redis';\n\n// node-redis >= 5.12.0 publishes via diagnostics_channel, which Sentry subscribes\n// to separately, so this monkey-patching instrumentation only covers the older\n// `redis` (v2-v3), `@redis/client`/`@node-redis/client` (v1, i.e. node-redis v4)\n// and node-redis 5.0-5.11 releases.\n\n// ---- Internal types ----\n\ninterface RedisPluginClientTypes {\n connection_options?: {\n port?: string | number;\n host?: string;\n };\n address?: string;\n}\n\ninterface RedisCommand {\n command: string;\n args: string[];\n buffer_args: boolean;\n callback: (err: Error | null, reply: unknown) => void;\n call_on_write: boolean;\n}\n\ninterface MultiErrorReply extends Error {\n replies: unknown[];\n errorIndexes: Array<number>;\n}\n\ninterface OpenSpanInfo {\n span: Span;\n commandName: string;\n commandArgs: Array<string | Buffer>;\n}\n\nconst OTEL_OPEN_SPANS = Symbol('opentelemetry.instrumentation.redis.open_spans');\nconst MULTI_COMMAND_OPTIONS = Symbol('opentelemetry.instrumentation.redis.multi_command_options');\n\n// ---- shared utils ----\n\nfunction endSpan(span: Span, err: Error | null | undefined): void {\n if (err) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: err.message });\n }\n span.end();\n}\n\nfunction runResponseHook(\n responseHook: RedisResponseCustomAttributeFunction | undefined,\n span: Span,\n commandName: string,\n commandArgs: Array<string | Buffer>,\n response: unknown,\n): void {\n if (!responseHook) {\n return;\n }\n try {\n responseHook(span, commandName, commandArgs, response);\n } catch {\n // never let a user-provided response hook break instrumentation\n }\n}\n\n// ---- v4-v5 utils ----\n\nfunction removeCredentialsFromDBConnectionStringAttribute(url: string | undefined): string | undefined {\n if (typeof url !== 'string' || !url) {\n return undefined;\n }\n try {\n const u = new URL(url);\n u.searchParams.delete('user_pwd');\n u.username = '';\n u.password = '';\n return u.href;\n } catch (err) {\n DEBUG_BUILD && debug.error('failed to sanitize redis connection url', err);\n }\n return undefined;\n}\n\nfunction getClientAttributes(options: any): SpanAttributes {\n return {\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n [ATTR_NET_PEER_NAME]: options?.socket?.host,\n [ATTR_NET_PEER_PORT]: options?.socket?.port,\n [ATTR_DB_CONNECTION_STRING]: removeCredentialsFromDBConnectionStringAttribute(options?.url),\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n };\n}\n\n// ---- RedisInstrumentationV2_V3 ----\n\nclass RedisInstrumentationV2_V3 extends InstrumentationBase<RedisInstrumentationConfig> {\n static COMPONENT = 'redis';\n\n constructor(config: RedisInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n init() {\n return [\n new InstrumentationNodeModuleDefinition(\n 'redis',\n ['>=2.6.0 <4'],\n (moduleExports: any) => {\n if (isWrapped(moduleExports.RedisClient.prototype['internal_send_command'])) {\n this._unwrap(moduleExports.RedisClient.prototype, 'internal_send_command');\n }\n this._wrap(moduleExports.RedisClient.prototype, 'internal_send_command', this._getPatchInternalSendCommand());\n return moduleExports;\n },\n (moduleExports: any) => {\n if (moduleExports === undefined) return;\n this._unwrap(moduleExports.RedisClient.prototype, 'internal_send_command');\n },\n ),\n ];\n }\n\n private _getPatchInternalSendCommand() {\n const instrumentation = this;\n return function internal_send_command(original: Function) {\n return function internal_send_command_trace(this: RedisPluginClientTypes, cmd: RedisCommand) {\n if (arguments.length !== 1 || typeof cmd !== 'object') {\n return original.apply(this, arguments);\n }\n const attributes: SpanAttributes = {\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n [ATTR_DB_STATEMENT]: defaultDbStatementSerializer(cmd.command, cmd.args),\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n };\n if (this.connection_options) {\n attributes[ATTR_NET_PEER_NAME] = this.connection_options.host;\n attributes[ATTR_NET_PEER_PORT] = this.connection_options.port;\n }\n if (this.address) {\n attributes[ATTR_DB_CONNECTION_STRING] = `redis://${this.address}`;\n }\n const span = startInactiveSpan({\n name: `${RedisInstrumentationV2_V3.COMPONENT}-${cmd.command}`,\n kind: SpanKind.CLIENT,\n attributes,\n });\n const originalCallback = arguments[0].callback;\n if (originalCallback) {\n const parentSpan = getActiveSpan();\n arguments[0].callback = function callback(this: any, err: Error | null, reply: unknown) {\n runResponseHook(instrumentation.getConfig().responseHook, span, cmd.command, cmd.args, reply);\n endSpan(span, err);\n return withActiveSpan(parentSpan ?? null, () => originalCallback.apply(this, arguments));\n };\n }\n try {\n return original.apply(this, arguments);\n } catch (rethrow) {\n endSpan(span, rethrow as Error);\n throw rethrow;\n }\n };\n };\n }\n}\n\n// ---- RedisInstrumentationV4_V5 ----\n\nclass RedisInstrumentationV4_V5 extends InstrumentationBase<RedisInstrumentationConfig> {\n static COMPONENT = 'redis';\n\n constructor(config: RedisInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n init() {\n return [\n this._getInstrumentationNodeModuleDefinition('@redis/client'),\n this._getInstrumentationNodeModuleDefinition('@node-redis/client'),\n ];\n }\n\n private _getInstrumentationNodeModuleDefinition(basePackageName: string) {\n const commanderModuleFile = new InstrumentationNodeModuleFile(\n `${basePackageName}/dist/lib/commander.js`,\n ['^1.0.0'],\n (moduleExports: any, moduleVersion?: string) => {\n const transformCommandArguments = moduleExports.transformCommandArguments;\n if (!transformCommandArguments) {\n DEBUG_BUILD && debug.error('internal instrumentation error, missing transformCommandArguments function');\n return moduleExports;\n }\n const functionToPatch = moduleVersion?.startsWith('1.0.') ? 'extendWithCommands' : 'attachCommands';\n if (isWrapped(moduleExports?.[functionToPatch])) {\n this._unwrap(moduleExports, functionToPatch);\n }\n this._wrap(moduleExports, functionToPatch, this._getPatchExtendWithCommands(transformCommandArguments));\n return moduleExports;\n },\n (moduleExports: any) => {\n if (isWrapped(moduleExports?.extendWithCommands)) {\n this._unwrap(moduleExports, 'extendWithCommands');\n }\n if (isWrapped(moduleExports?.attachCommands)) {\n this._unwrap(moduleExports, 'attachCommands');\n }\n },\n );\n\n const multiCommanderModule = new InstrumentationNodeModuleFile(\n `${basePackageName}/dist/lib/client/multi-command.js`,\n ['^1.0.0', '>=5.0.0 <5.12.0'],\n (moduleExports: any) => {\n const redisClientMultiCommandPrototype = moduleExports?.default?.prototype;\n if (isWrapped(redisClientMultiCommandPrototype?.exec)) {\n this._unwrap(redisClientMultiCommandPrototype, 'exec');\n }\n this._wrap(redisClientMultiCommandPrototype, 'exec', this._getPatchMultiCommandsExec());\n if (isWrapped(redisClientMultiCommandPrototype?.execAsPipeline)) {\n this._unwrap(redisClientMultiCommandPrototype, 'execAsPipeline');\n }\n this._wrap(redisClientMultiCommandPrototype, 'execAsPipeline', this._getPatchMultiCommandsExec());\n if (isWrapped(redisClientMultiCommandPrototype?.addCommand)) {\n this._unwrap(redisClientMultiCommandPrototype, 'addCommand');\n }\n this._wrap(redisClientMultiCommandPrototype, 'addCommand', this._getPatchMultiCommandsAddCommand());\n return moduleExports;\n },\n (moduleExports: any) => {\n const redisClientMultiCommandPrototype = moduleExports?.default?.prototype;\n if (isWrapped(redisClientMultiCommandPrototype?.exec)) {\n this._unwrap(redisClientMultiCommandPrototype, 'exec');\n }\n if (isWrapped(redisClientMultiCommandPrototype?.execAsPipeline)) {\n this._unwrap(redisClientMultiCommandPrototype, 'execAsPipeline');\n }\n if (isWrapped(redisClientMultiCommandPrototype?.addCommand)) {\n this._unwrap(redisClientMultiCommandPrototype, 'addCommand');\n }\n },\n );\n\n const clientIndexModule = new InstrumentationNodeModuleFile(\n `${basePackageName}/dist/lib/client/index.js`,\n ['^1.0.0', '>=5.0.0 <5.12.0'],\n (moduleExports: any) => {\n const redisClientPrototype = moduleExports?.default?.prototype;\n if (redisClientPrototype?.multi) {\n if (isWrapped(redisClientPrototype?.multi)) {\n this._unwrap(redisClientPrototype, 'multi');\n }\n this._wrap(redisClientPrototype, 'multi', this._getPatchRedisClientMulti());\n }\n if (redisClientPrototype?.MULTI) {\n if (isWrapped(redisClientPrototype?.MULTI)) {\n this._unwrap(redisClientPrototype, 'MULTI');\n }\n this._wrap(redisClientPrototype, 'MULTI', this._getPatchRedisClientMulti());\n }\n if (isWrapped(redisClientPrototype?.sendCommand)) {\n this._unwrap(redisClientPrototype, 'sendCommand');\n }\n this._wrap(redisClientPrototype, 'sendCommand', this._getPatchRedisClientSendCommand());\n if (isWrapped(redisClientPrototype?.connect)) {\n this._unwrap(redisClientPrototype, 'connect');\n }\n this._wrap(redisClientPrototype, 'connect', this._getPatchedClientConnect());\n return moduleExports;\n },\n (moduleExports: any) => {\n const redisClientPrototype = moduleExports?.default?.prototype;\n if (isWrapped(redisClientPrototype?.multi)) {\n this._unwrap(redisClientPrototype, 'multi');\n }\n if (isWrapped(redisClientPrototype?.MULTI)) {\n this._unwrap(redisClientPrototype, 'MULTI');\n }\n if (isWrapped(redisClientPrototype?.sendCommand)) {\n this._unwrap(redisClientPrototype, 'sendCommand');\n }\n if (isWrapped(redisClientPrototype?.connect)) {\n this._unwrap(redisClientPrototype, 'connect');\n }\n },\n );\n\n return new InstrumentationNodeModuleDefinition(\n basePackageName,\n ['^1.0.0', '>=5.0.0 <5.12.0'],\n (moduleExports: any) => moduleExports,\n () => {},\n [commanderModuleFile, multiCommanderModule, clientIndexModule],\n );\n }\n\n private _getPatchExtendWithCommands(transformCommandArguments: Function) {\n const plugin = this;\n return function extendWithCommandsPatchWrapper(original: Function) {\n return function extendWithCommandsPatch(this: any, config: any) {\n if (config?.BaseClass?.name !== 'RedisClient') {\n return original.apply(this, arguments);\n }\n const origExecutor = config.executor;\n config.executor = function (this: any, command: any, args: any) {\n const redisCommandArguments = transformCommandArguments(command, args).args;\n return plugin._traceClientCommand(origExecutor, this, arguments, redisCommandArguments);\n };\n return original.apply(this, arguments);\n };\n };\n }\n\n private _getPatchMultiCommandsExec() {\n const plugin = this;\n return function execPatchWrapper(original: Function) {\n return function execPatch(this: any) {\n const execRes = original.apply(this, arguments);\n if (typeof execRes?.then !== 'function') {\n DEBUG_BUILD && debug.error('non-promise result when patching exec/execAsPipeline');\n return execRes;\n }\n return execRes\n .then((redisRes: unknown[]) => {\n const openSpans: OpenSpanInfo[] = this[OTEL_OPEN_SPANS];\n plugin._endSpansWithRedisReplies(openSpans, redisRes);\n return redisRes;\n })\n .catch((err: any) => {\n const openSpans: OpenSpanInfo[] = this[OTEL_OPEN_SPANS];\n if (!openSpans) {\n DEBUG_BUILD && debug.error('cannot find open spans to end for multi/pipeline');\n } else {\n const replies =\n err.constructor.name === 'MultiErrorReply'\n ? (err as MultiErrorReply).replies\n : new Array(openSpans.length).fill(err);\n plugin._endSpansWithRedisReplies(openSpans, replies);\n }\n return Promise.reject(err);\n });\n };\n };\n }\n\n private _getPatchMultiCommandsAddCommand() {\n const plugin = this;\n return function addCommandWrapper(original: Function) {\n return function addCommandPatch(this: any, args: any) {\n return plugin._traceClientCommand(original, this, arguments, args);\n };\n };\n }\n\n private _getPatchRedisClientMulti() {\n return function multiPatchWrapper(original: Function) {\n return function multiPatch(this: any) {\n const multiRes: any = original.apply(this, arguments);\n multiRes[MULTI_COMMAND_OPTIONS] = this.options;\n return multiRes;\n };\n };\n }\n\n private _getPatchRedisClientSendCommand() {\n const plugin = this;\n return function sendCommandWrapper(original: Function) {\n return function sendCommandPatch(this: any, args: any) {\n return plugin._traceClientCommand(original, this, arguments, args);\n };\n };\n }\n\n private _getPatchedClientConnect() {\n return function connectWrapper(original: Function) {\n return function patchedConnect(this: any) {\n const attributes = getClientAttributes(this.options);\n const span = startInactiveSpan({\n name: `${RedisInstrumentationV4_V5.COMPONENT}-connect`,\n kind: SpanKind.CLIENT,\n attributes,\n });\n const res = withActiveSpan(span, () => original.apply(this));\n return res.then(\n (result: any) => {\n span.end();\n return result;\n },\n (error: Error) => {\n endSpan(span, error);\n return Promise.reject(error);\n },\n );\n };\n };\n }\n\n _traceClientCommand(\n origFunction: Function,\n origThis: any,\n origArguments: IArguments,\n redisCommandArguments: Array<string | Buffer>,\n ): any {\n const clientOptions = origThis.options || origThis[MULTI_COMMAND_OPTIONS];\n const commandName = redisCommandArguments[0] as string;\n const commandArgs = redisCommandArguments.slice(1);\n const attributes = getClientAttributes(clientOptions);\n const dbStatement = defaultDbStatementSerializer(commandName, commandArgs);\n if (dbStatement != null) {\n attributes[ATTR_DB_STATEMENT] = dbStatement;\n }\n const span = startInactiveSpan({\n name: `${RedisInstrumentationV4_V5.COMPONENT}-${commandName}`,\n kind: SpanKind.CLIENT,\n attributes,\n });\n const res = withActiveSpan(span, () => origFunction.apply(origThis, origArguments));\n if (res instanceof Promise) {\n res.then(\n (redisRes: unknown) => {\n this._endSpanWithResponse(span, commandName, commandArgs, redisRes, undefined);\n },\n (err: Error) => {\n this._endSpanWithResponse(span, commandName, commandArgs, null, err);\n },\n );\n } else {\n const redisClientMultiCommand: any = res;\n redisClientMultiCommand[OTEL_OPEN_SPANS] = redisClientMultiCommand[OTEL_OPEN_SPANS] || [];\n redisClientMultiCommand[OTEL_OPEN_SPANS].push({\n span,\n commandName,\n commandArgs,\n });\n }\n return res;\n }\n\n _endSpansWithRedisReplies(openSpans: OpenSpanInfo[] | undefined, replies: unknown[]): void {\n if (!openSpans) {\n DEBUG_BUILD && debug.error('cannot find open spans to end for redis multi/pipeline');\n return;\n }\n if (replies.length !== openSpans.length) {\n DEBUG_BUILD && debug.error('number of multi command spans does not match response from redis');\n return;\n }\n for (let i = 0; i < openSpans.length; i++) {\n const { span, commandName, commandArgs } = openSpans[i]!;\n const currCommandRes = replies[i];\n const [res, err] = currCommandRes instanceof Error ? [null, currCommandRes] : [currCommandRes, undefined];\n this._endSpanWithResponse(span, commandName, commandArgs, res, err);\n }\n }\n\n _endSpanWithResponse(\n span: Span,\n commandName: string,\n commandArgs: Array<string | Buffer>,\n response: unknown,\n error: Error | null | undefined,\n ): void {\n if (!error) {\n runResponseHook(this.getConfig().responseHook, span, commandName, commandArgs, response);\n }\n endSpan(span, error);\n }\n}\n\n// ---- RedisInstrumentation (wrapper) ----\n\nexport class RedisInstrumentation extends InstrumentationBase<RedisInstrumentationConfig> {\n private instrumentationV2_V3: RedisInstrumentationV2_V3;\n private instrumentationV4_V5: RedisInstrumentationV4_V5;\n private initialized = false;\n\n constructor(config: RedisInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n this.instrumentationV2_V3 = new RedisInstrumentationV2_V3(this.getConfig());\n this.instrumentationV4_V5 = new RedisInstrumentationV4_V5(this.getConfig());\n this.initialized = true;\n }\n\n override setConfig(config: RedisInstrumentationConfig = {}): void {\n super.setConfig(config);\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.setConfig(config);\n this.instrumentationV4_V5.setConfig(config);\n }\n\n init() {}\n\n override getModuleDefinitions() {\n return [...this.instrumentationV2_V3.getModuleDefinitions(), ...this.instrumentationV4_V5.getModuleDefinitions()];\n }\n\n override setTracerProvider(tracerProvider: TracerProvider): void {\n super.setTracerProvider(tracerProvider);\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.setTracerProvider(tracerProvider);\n this.instrumentationV4_V5.setTracerProvider(tracerProvider);\n }\n\n override enable(): void {\n super.enable();\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.enable();\n this.instrumentationV4_V5.enable();\n }\n\n override disable(): void {\n super.disable();\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.disable();\n this.instrumentationV4_V5.disable();\n }\n}\n"],"names":["SPAN_STATUS_ERROR","DEBUG_BUILD","debug","ATTR_DB_SYSTEM","DB_SYSTEM_VALUE_REDIS","ATTR_NET_PEER_NAME","ATTR_NET_PEER_PORT","ATTR_DB_CONNECTION_STRING","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","isWrapped","ATTR_DB_STATEMENT","defaultDbStatementSerializer","startInactiveSpan","SpanKind","getActiveSpan","withActiveSpan","InstrumentationNodeModuleFile"],"mappings":";;;;;;;;;;AAqCA,MAA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C,IAAA,IAAA,CAAK,oBAAA,CAAqB,UAAU,MAAM,CAAA;AAAA,EAC5C;AAAA,EAEA,IAAA,GAAO;AAAA,EAAC;AAAA,EAEC,oBAAA,GAAuB;AAC9B,IAAA,OAAO,CAAC,GAAG,IAAA,CAAK,oBAAA,CAAqB,oBAAA,IAAwB,GAAG,IAAA,CAAK,oBAAA,CAAqB,oBAAA,EAAsB,CAAA;AAAA,EAClH;AAAA,EAES,kBAAkB,cAAA,EAAsC;AAC/D,IAAA,KAAA,CAAM,kBAAkB,cAAc,CAAA;AACtC,IAAA,IAAI,CAAC,KAAK,WAAA,EAAa;AACrB,MAAA;AAAA,IACF;AACA,IAAA,IAAA,CAAK,oBAAA,CAAqB,kBAAkB,cAAc,CAAA;AAC1D,IAAA,IAAA,CAAK,oBAAA,CAAqB,kBAAkB,cAAc,CAAA;AAAA,EAC5D;AAAA,EAES,MAAA,GAAe;AACtB,IAAA,KAAA,CAAM,MAAA,EAAO;AACb,IAAA,IAAI,CAAC,KAAK,WAAA,EAAa;AACrB,MAAA;AAAA,IACF;AACA,IAAA,IAAA,CAAK,qBAAqB,MAAA,EAAO;AACjC,IAAA,IAAA,CAAK,qBAAqB,MAAA,EAAO;AAAA,EACnC;AAAA,EAES,OAAA,GAAgB;AACvB,IAAA,KAAA,CAAM,OAAA,EAAQ;AACd,IAAA,IAAI,CAAC,KAAK,WAAA,EAAa;AACrB,MAAA;AAAA,IACF;AACA,IAAA,IAAA,CAAK,qBAAqB,OAAA,EAAQ;AAClC,IAAA,IAAA,CAAK,qBAAqB,OAAA,EAAQ;AAAA,EACpC;AACF;;;;"}
@@ -5,7 +5,6 @@ const ATTR_DB_STATEMENT = "db.statement";
5
5
  const ATTR_DB_SYSTEM = "db.system";
6
6
  const ATTR_NET_PEER_NAME = "net.peer.name";
7
7
  const ATTR_NET_PEER_PORT = "net.peer.port";
8
- const DB_SYSTEM_NAME_VALUE_REDIS = "redis";
9
8
  const DB_SYSTEM_VALUE_REDIS = "redis";
10
9
 
11
10
  exports.ATTR_DB_CONNECTION_STRING = ATTR_DB_CONNECTION_STRING;
@@ -13,6 +12,5 @@ exports.ATTR_DB_STATEMENT = ATTR_DB_STATEMENT;
13
12
  exports.ATTR_DB_SYSTEM = ATTR_DB_SYSTEM;
14
13
  exports.ATTR_NET_PEER_NAME = ATTR_NET_PEER_NAME;
15
14
  exports.ATTR_NET_PEER_PORT = ATTR_NET_PEER_PORT;
16
- exports.DB_SYSTEM_NAME_VALUE_REDIS = DB_SYSTEM_NAME_VALUE_REDIS;
17
15
  exports.DB_SYSTEM_VALUE_REDIS = DB_SYSTEM_VALUE_REDIS;
18
16
  //# sourceMappingURL=semconv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/redis/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/instrumentation-redis-v0.62.0/packages/instrumentation-redis\n * - Upstream version: @opentelemetry/instrumentation-redis@0.62.0\n * - Minor TypeScript adjustments for this repository's compiler settings\n */\n/* eslint-disable -- vendored @opentelemetry/instrumentation-redis */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by the vendored redis/ioredis instrumentations.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n// Deprecated constants kept for backwards compatibility with older semconv\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string';\nexport const ATTR_DB_STATEMENT = 'db.statement';\nexport const ATTR_DB_SYSTEM = 'db.system';\nexport const ATTR_NET_PEER_NAME = 'net.peer.name';\nexport const ATTR_NET_PEER_PORT = 'net.peer.port';\nexport const DB_SYSTEM_NAME_VALUE_REDIS = 'redis';\nexport const DB_SYSTEM_VALUE_REDIS = 'redis';\n"],"names":[],"mappings":";;AA6BO,MAAM,yBAAA,GAA4B;AAClC,MAAM,iBAAA,GAAoB;AAC1B,MAAM,cAAA,GAAiB;AACvB,MAAM,kBAAA,GAAqB;AAC3B,MAAM,kBAAA,GAAqB;AAC3B,MAAM,0BAAA,GAA6B;AACnC,MAAM,qBAAA,GAAwB;;;;;;;;;;"}
1
+ {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/redis/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/instrumentation-redis-v0.62.0/packages/instrumentation-redis\n * - Upstream version: @opentelemetry/instrumentation-redis@0.62.0\n * - Minor TypeScript adjustments for this repository's compiler settings\n */\n/* eslint-disable -- vendored @opentelemetry/instrumentation-redis */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by the vendored redis/ioredis instrumentations.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n// Deprecated constants kept for backwards compatibility with older semconv\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string';\nexport const ATTR_DB_STATEMENT = 'db.statement';\nexport const ATTR_DB_SYSTEM = 'db.system';\nexport const ATTR_NET_PEER_NAME = 'net.peer.name';\nexport const ATTR_NET_PEER_PORT = 'net.peer.port';\nexport const DB_SYSTEM_NAME_VALUE_REDIS = 'redis';\nexport const DB_SYSTEM_VALUE_REDIS = 'redis';\n"],"names":[],"mappings":";;AAkBO,MAAM,yBAAA,GAA4B;AAClC,MAAM,iBAAA,GAAoB;AAC1B,MAAM,cAAA,GAAiB;AACvB,MAAM,kBAAA,GAAqB;AAC3B,MAAM,kBAAA,GAAqB;AAE3B,MAAM,qBAAA,GAAwB;;;;;;;;;"}
@@ -4,37 +4,13 @@ const instrumentation = require('./vendored/instrumentation.js');
4
4
  const core = require('@sentry/core');
5
5
  const nodeCore = require('@sentry/node-core');
6
6
 
7
- const TEDIUS_INSTRUMENTED_METHODS = /* @__PURE__ */ new Set([
8
- "callProcedure",
9
- "execSql",
10
- "execSqlBatch",
11
- "execBulkLoad",
12
- "prepare",
13
- "execute"
14
- ]);
15
7
  const INTEGRATION_NAME = "Tedious";
16
8
  const instrumentTedious = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new instrumentation.TediousInstrumentation({}));
17
9
  const _tediousIntegration = (() => {
18
- let instrumentationWrappedCallback;
19
10
  return {
20
11
  name: INTEGRATION_NAME,
21
12
  setupOnce() {
22
- const instrumentation = instrumentTedious();
23
- instrumentationWrappedCallback = nodeCore.instrumentWhenWrapped(instrumentation);
24
- },
25
- setup(client) {
26
- instrumentationWrappedCallback?.(
27
- () => client.on("spanStart", (span) => {
28
- const { description, data } = core.spanToJSON(span);
29
- if (!description || data["db.system"] !== "mssql") {
30
- return;
31
- }
32
- const operation = description.split(" ")[0] || "";
33
- if (TEDIUS_INSTRUMENTED_METHODS.has(operation)) {
34
- span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, "auto.db.otel.tedious");
35
- }
36
- })
37
- );
13
+ instrumentTedious();
38
14
  }
39
15
  };
40
16
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/tedious/index.ts"],"sourcesContent":["import { TediousInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, spanToJSON } from '@sentry/core';\nimport { generateInstrumentOnce, instrumentWhenWrapped } from '@sentry/node-core';\n\nconst TEDIUS_INSTRUMENTED_METHODS = new Set([\n 'callProcedure',\n 'execSql',\n 'execSqlBatch',\n 'execBulkLoad',\n 'prepare',\n 'execute',\n]);\n\nconst INTEGRATION_NAME = 'Tedious';\n\nexport const instrumentTedious = generateInstrumentOnce(INTEGRATION_NAME, () => new TediousInstrumentation({}));\n\nconst _tediousIntegration = (() => {\n let instrumentationWrappedCallback: undefined | ((callback: () => void) => void);\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n const instrumentation = instrumentTedious();\n instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);\n },\n\n setup(client) {\n instrumentationWrappedCallback?.(() =>\n client.on('spanStart', span => {\n const { description, data } = spanToJSON(span);\n // Tedius integration always set a span name and `db.system` attribute to `mssql`.\n if (!description || data['db.system'] !== 'mssql') {\n return;\n }\n\n const operation = description.split(' ')[0] || '';\n if (TEDIUS_INSTRUMENTED_METHODS.has(operation)) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.tedious');\n }\n }),\n );\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [tedious](https://www.npmjs.com/package/tedious) library.\n *\n * For more information, see the [`tediousIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/tedious/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.tediousIntegration()],\n * });\n * ```\n */\nexport const tediousIntegration = defineIntegration(_tediousIntegration);\n"],"names":["generateInstrumentOnce","TediousInstrumentation","instrumentWhenWrapped","spanToJSON","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,2BAAA,uBAAkC,GAAA,CAAI;AAAA,EAC1C,eAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,MAAM,gBAAA,GAAmB,SAAA;AAElB,MAAM,iBAAA,GAAoBA,gCAAuB,gBAAA,EAAkB,MAAM,IAAIC,sCAAA,CAAuB,EAAE,CAAC;AAE9G,MAAM,uBAAuB,MAAM;AACjC,EAAA,IAAI,8BAAA;AAEJ,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,MAAM,kBAAkB,iBAAA,EAAkB;AAC1C,MAAA,8BAAA,GAAiCC,+BAAsB,eAAe,CAAA;AAAA,IACxE,CAAA;AAAA,IAEA,MAAM,MAAA,EAAQ;AACZ,MAAA,8BAAA;AAAA,QAAiC,MAC/B,MAAA,CAAO,EAAA,CAAG,WAAA,EAAa,CAAA,IAAA,KAAQ;AAC7B,UAAA,MAAM,EAAE,WAAA,EAAa,IAAA,EAAK,GAAIC,gBAAW,IAAI,CAAA;AAE7C,UAAA,IAAI,CAAC,WAAA,IAAe,IAAA,CAAK,WAAW,MAAM,OAAA,EAAS;AACjD,YAAA;AAAA,UACF;AAEA,UAAA,MAAM,YAAY,WAAA,CAAY,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA,IAAK,EAAA;AAC/C,UAAA,IAAI,2BAAA,CAA4B,GAAA,CAAI,SAAS,CAAA,EAAG;AAC9C,YAAA,IAAA,CAAK,YAAA,CAAaC,uCAAkC,sBAAsB,CAAA;AAAA,UAC5E;AAAA,QACF,CAAC;AAAA,OACH;AAAA,IACF;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,kBAAA,GAAqBC,uBAAkB,mBAAmB;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/tedious/index.ts"],"sourcesContent":["import { TediousInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Tedious';\n\nexport const instrumentTedious = generateInstrumentOnce(INTEGRATION_NAME, () => new TediousInstrumentation({}));\n\nconst _tediousIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentTedious();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [tedious](https://www.npmjs.com/package/tedious) library.\n *\n * For more information, see the [`tediousIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/tedious/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.tediousIntegration()],\n * });\n * ```\n */\nexport const tediousIntegration = defineIntegration(_tediousIntegration);\n"],"names":["generateInstrumentOnce","TediousInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,SAAA;AAElB,MAAM,iBAAA,GAAoBA,gCAAuB,gBAAA,EAAkB,MAAM,IAAIC,sCAAA,CAAuB,EAAE,CAAC;AAE9G,MAAM,uBAAuB,MAAM;AACjC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,iBAAA,EAAkB;AAAA,IACpB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,kBAAA,GAAqBC,uBAAkB,mBAAmB;;;;;"}
@@ -3,14 +3,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
3
  const api = require('@opentelemetry/api');
4
4
  const events = require('events');
5
5
  const instrumentation = require('@opentelemetry/instrumentation');
6
- const semanticConventions = require('@opentelemetry/semantic-conventions');
7
6
  const semconv = require('./semconv.js');
8
7
  const utils = require('./utils.js');
9
8
  const core = require('@sentry/core');
10
9
 
11
10
  const PACKAGE_NAME = "@sentry/instrumentation-tedious";
12
11
  const CURRENT_DATABASE = /* @__PURE__ */ Symbol("opentelemetry.instrumentation-tedious.current-database");
13
- const INJECTED_CTX = /* @__PURE__ */ Symbol("opentelemetry.instrumentation-tedious.context-info-injected");
14
12
  const PATCHED_METHODS = ["callProcedure", "execSql", "execSqlBatch", "execBulkLoad", "prepare", "execute"];
15
13
  function setDatabase(databaseName) {
16
14
  Object.defineProperty(this, CURRENT_DATABASE, {
@@ -21,12 +19,6 @@ function setDatabase(databaseName) {
21
19
  const _TediousInstrumentation = class _TediousInstrumentation extends instrumentation.InstrumentationBase {
22
20
  constructor(config = {}) {
23
21
  super(PACKAGE_NAME, core.SDK_VERSION, config);
24
- this._setSemconvStabilityFromEnv();
25
- }
26
- // Used for testing.
27
- _setSemconvStabilityFromEnv() {
28
- this._netSemconvStability = instrumentation.semconvStabilityFromStr("http", process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
29
- this._dbSemconvStability = instrumentation.semconvStabilityFromStr("database", process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
30
22
  }
31
23
  init() {
32
24
  return [
@@ -39,7 +31,7 @@ const _TediousInstrumentation = class _TediousInstrumentation extends instrument
39
31
  if (instrumentation.isWrapped(ConnectionPrototype[method])) {
40
32
  this._unwrap(ConnectionPrototype, method);
41
33
  }
42
- this._wrap(ConnectionPrototype, method, this._patchQuery(method, moduleExports));
34
+ this._wrap(ConnectionPrototype, method, this._patchQuery(method));
43
35
  }
44
36
  if (instrumentation.isWrapped(ConnectionPrototype.connect)) {
45
37
  this._unwrap(ConnectionPrototype, "connect");
@@ -69,42 +61,10 @@ const _TediousInstrumentation = class _TediousInstrumentation extends instrument
69
61
  return original.apply(this, arguments);
70
62
  };
71
63
  }
72
- _buildTraceparent(span) {
73
- const sc = span.spanContext();
74
- return `00-${sc.traceId}-${sc.spanId}-0${Number(sc.traceFlags || api.TraceFlags.NONE).toString(16)}`;
75
- }
76
- /**
77
- * Fire a one-off `SET CONTEXT_INFO @opentelemetry_traceparent` on the same
78
- * connection. Marks the request with INJECTED_CTX so our patch skips it.
79
- */
80
- _injectContextInfo(connection, tediousModule, traceparent) {
81
- return new Promise((resolve) => {
82
- try {
83
- const sql = "set context_info @opentelemetry_traceparent";
84
- const req = new tediousModule.Request(sql, (_err) => {
85
- resolve();
86
- });
87
- Object.defineProperty(req, INJECTED_CTX, { value: true });
88
- const buf = Buffer.from(traceparent, "utf8");
89
- req.addParameter("opentelemetry_traceparent", tediousModule.TYPES.VarBinary, buf, {
90
- length: buf.length
91
- });
92
- connection.execSql(req);
93
- } catch {
94
- resolve();
95
- }
96
- });
97
- }
98
- _shouldInjectFor(operation) {
99
- return operation === "execSql" || operation === "execSqlBatch" || operation === "callProcedure" || operation === "execute";
100
- }
101
- _patchQuery(operation, tediousModule) {
64
+ _patchQuery(operation) {
102
65
  return (originalMethod) => {
103
66
  const thisPlugin = this;
104
67
  function patchedMethod(request) {
105
- if (request?.[INJECTED_CTX]) {
106
- return originalMethod.apply(this, arguments);
107
- }
108
68
  if (!(request instanceof events.EventEmitter)) {
109
69
  thisPlugin._diag.warn(`Unexpected invocation of patched ${operation} method. Span not recorded`);
110
70
  return originalMethod.apply(this, arguments);
@@ -120,29 +80,26 @@ const _TediousInstrumentation = class _TediousInstrumentation extends instrument
120
80
  }
121
81
  return request2.sqlTextOrProcedure;
122
82
  })(request);
123
- const attributes = {};
124
- if (thisPlugin._dbSemconvStability & instrumentation.SemconvStability.OLD) {
125
- attributes[semconv.ATTR_DB_SYSTEM] = semconv.DB_SYSTEM_VALUE_MSSQL;
126
- attributes[semconv.ATTR_DB_NAME] = databaseName;
127
- attributes[semconv.ATTR_DB_USER] = this.config?.userName ?? this.config?.authentication?.options?.userName;
128
- attributes[semconv.ATTR_DB_STATEMENT] = sql;
129
- attributes[semconv.ATTR_DB_SQL_TABLE] = request.table;
130
- }
131
- if (thisPlugin._dbSemconvStability & instrumentation.SemconvStability.STABLE) {
132
- attributes[semanticConventions.ATTR_DB_NAMESPACE] = databaseName;
133
- attributes[semanticConventions.ATTR_DB_SYSTEM_NAME] = semanticConventions.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER;
134
- attributes[semanticConventions.ATTR_DB_QUERY_TEXT] = sql;
135
- attributes[semanticConventions.ATTR_DB_COLLECTION_NAME] = request.table;
136
- }
137
- if (thisPlugin._netSemconvStability & instrumentation.SemconvStability.OLD) {
138
- attributes[semconv.ATTR_NET_PEER_NAME] = this.config?.server;
139
- attributes[semconv.ATTR_NET_PEER_PORT] = this.config?.options?.port;
140
- }
141
- if (thisPlugin._netSemconvStability & instrumentation.SemconvStability.STABLE) {
142
- attributes[semanticConventions.ATTR_SERVER_ADDRESS] = this.config?.server;
143
- attributes[semanticConventions.ATTR_SERVER_PORT] = this.config?.options?.port;
144
- }
145
- const span = thisPlugin.tracer.startSpan(utils.getSpanName(operation, databaseName, sql, request.table), {
83
+ const attributes = {
84
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.otel.tedious",
85
+ // eslint-disable-next-line typescript/no-deprecated
86
+ [semconv.ATTR_DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_MSSQL,
87
+ // eslint-disable-next-line typescript/no-deprecated
88
+ [semconv.ATTR_DB_NAME]: databaseName,
89
+ // >=4 uses `authentication` object; older versions just userName and password pair
90
+ // eslint-disable-next-line typescript/no-deprecated
91
+ [semconv.ATTR_DB_USER]: this.config?.userName ?? this.config?.authentication?.options?.userName,
92
+ // eslint-disable-next-line typescript/no-deprecated
93
+ [semconv.ATTR_DB_STATEMENT]: sql,
94
+ // eslint-disable-next-line typescript/no-deprecated
95
+ [semconv.ATTR_DB_SQL_TABLE]: request.table,
96
+ // eslint-disable-next-line typescript/no-deprecated
97
+ [semconv.ATTR_NET_PEER_NAME]: this.config?.server,
98
+ // eslint-disable-next-line typescript/no-deprecated
99
+ [semconv.ATTR_NET_PEER_PORT]: this.config?.options?.port
100
+ };
101
+ const span = core.startInactiveSpan({
102
+ name: utils.getSpanName(operation, databaseName, sql, request.table),
146
103
  kind: api.SpanKind.CLIENT,
147
104
  attributes
148
105
  });
@@ -156,7 +113,7 @@ const _TediousInstrumentation = class _TediousInstrumentation extends instrument
156
113
  span.setAttribute("tedious.statement_count", statementCount);
157
114
  if (err) {
158
115
  span.setStatus({
159
- code: api.SpanStatusCode.ERROR,
116
+ code: core.SPAN_STATUS_ERROR,
160
117
  message: err.message
161
118
  });
162
119
  }
@@ -172,14 +129,7 @@ const _TediousInstrumentation = class _TediousInstrumentation extends instrument
172
129
  } else {
173
130
  thisPlugin._diag.error("Expected request.callback to be a function");
174
131
  }
175
- const runUserRequest = () => {
176
- return api.context.with(api.trace.setSpan(api.context.active(), span), originalMethod, this, ...arguments);
177
- };
178
- const cfg = thisPlugin.getConfig();
179
- const shouldInject = cfg.enableTraceContextPropagation && thisPlugin._shouldInjectFor(operation);
180
- if (!shouldInject) return runUserRequest();
181
- const traceparent = thisPlugin._buildTraceparent(span);
182
- void thisPlugin._injectContextInfo(this, tediousModule, traceparent).finally(runUserRequest);
132
+ return core.withActiveSpan(span, () => originalMethod.apply(this, arguments));
183
133
  }
184
134
  Object.defineProperty(patchedMethod, "length", {
185
135
  value: originalMethod.length,
@@ -190,7 +140,7 @@ const _TediousInstrumentation = class _TediousInstrumentation extends instrument
190
140
  }
191
141
  _patchCallbackQuery(endSpan) {
192
142
  return (originalCallback) => {
193
- return function(err, rowCount, rows) {
143
+ return function(err, _rowCount, _rows) {
194
144
  endSpan(err);
195
145
  return originalCallback.apply(this, arguments);
196
146
  };
@@ -200,6 +150,5 @@ const _TediousInstrumentation = class _TediousInstrumentation extends instrument
200
150
  _TediousInstrumentation.COMPONENT = "tedious";
201
151
  let TediousInstrumentation = _TediousInstrumentation;
202
152
 
203
- exports.INJECTED_CTX = INJECTED_CTX;
204
153
  exports.TediousInstrumentation = TediousInstrumentation;
205
154
  //# sourceMappingURL=instrumentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/tedious/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-tedious\n * - Upstream version: @opentelemetry/instrumentation-tedious@0.37.0\n * - Minor TypeScript strictness adjustments\n */\n/* eslint-disable */\n\nimport * as api from '@opentelemetry/api';\nimport { EventEmitter } from 'events';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport {\n ATTR_DB_COLLECTION_NAME,\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_MICROSOFT_SQL_SERVER,\n} from '@opentelemetry/semantic-conventions';\nimport {\n DB_SYSTEM_VALUE_MSSQL,\n ATTR_DB_NAME,\n ATTR_DB_SQL_TABLE,\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_DB_USER,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n} from './semconv';\nimport type * as tedious from './tedious-types';\nimport { TediousInstrumentationConfig } from './types';\nimport { getSpanName, once } from './utils';\nimport { SDK_VERSION } from '@sentry/core';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-tedious';\n\nconst CURRENT_DATABASE = Symbol('opentelemetry.instrumentation-tedious.current-database');\n\nexport const INJECTED_CTX = Symbol('opentelemetry.instrumentation-tedious.context-info-injected');\n\nconst PATCHED_METHODS = ['callProcedure', 'execSql', 'execSqlBatch', 'execBulkLoad', 'prepare', 'execute'];\n\ntype UnknownFunction = (...args: any[]) => any;\ntype ApproxConnection = EventEmitter & {\n [CURRENT_DATABASE]: string;\n config: any;\n};\ntype ApproxRequest = EventEmitter & {\n sqlTextOrProcedure: string | undefined;\n callback: any;\n table: string | undefined;\n parametersByName: any;\n};\n\nfunction setDatabase(this: ApproxConnection, databaseName: string) {\n Object.defineProperty(this, CURRENT_DATABASE, {\n value: databaseName,\n writable: true,\n });\n}\n\nexport class TediousInstrumentation extends InstrumentationBase<TediousInstrumentationConfig> {\n static readonly COMPONENT = 'tedious';\n private _netSemconvStability!: SemconvStability;\n private _dbSemconvStability!: SemconvStability;\n\n constructor(config: TediousInstrumentationConfig = {}) {\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 init() {\n return [\n new InstrumentationNodeModuleDefinition(\n TediousInstrumentation.COMPONENT,\n ['>=1.11.0 <20'],\n (moduleExports: typeof tedious) => {\n const ConnectionPrototype: any = moduleExports.Connection.prototype;\n for (const method of PATCHED_METHODS) {\n if (isWrapped(ConnectionPrototype[method])) {\n this._unwrap(ConnectionPrototype, method);\n }\n this._wrap(ConnectionPrototype, method, this._patchQuery(method, moduleExports) as any);\n }\n\n if (isWrapped(ConnectionPrototype.connect)) {\n this._unwrap(ConnectionPrototype, 'connect');\n }\n this._wrap(ConnectionPrototype, 'connect', this._patchConnect);\n\n return moduleExports;\n },\n (moduleExports: typeof tedious) => {\n if (moduleExports === undefined) return;\n const ConnectionPrototype: any = moduleExports.Connection.prototype;\n for (const method of PATCHED_METHODS) {\n this._unwrap(ConnectionPrototype, method);\n }\n this._unwrap(ConnectionPrototype, 'connect');\n },\n ),\n ];\n }\n\n private _patchConnect(original: UnknownFunction): UnknownFunction {\n return function patchedConnect(this: ApproxConnection) {\n setDatabase.call(this, this.config?.options?.database);\n\n // remove the listener first in case it's already added\n this.removeListener('databaseChange', setDatabase);\n this.on('databaseChange', setDatabase);\n\n this.once('end', () => {\n this.removeListener('databaseChange', setDatabase);\n });\n return original.apply(this, arguments as unknown as any[]);\n };\n }\n\n private _buildTraceparent(span: api.Span): string {\n const sc = span.spanContext();\n return `00-${sc.traceId}-${sc.spanId}-0${Number(sc.traceFlags || api.TraceFlags.NONE).toString(16)}`;\n }\n\n /**\n * Fire a one-off `SET CONTEXT_INFO @opentelemetry_traceparent` on the same\n * connection. Marks the request with INJECTED_CTX so our patch skips it.\n */\n private _injectContextInfo(connection: any, tediousModule: typeof tedious, traceparent: string): Promise<void> {\n return new Promise(resolve => {\n try {\n const sql = 'set context_info @opentelemetry_traceparent';\n const req = new tediousModule.Request(sql, (_err: any) => {\n resolve();\n });\n Object.defineProperty(req, INJECTED_CTX, { value: true });\n const buf = Buffer.from(traceparent, 'utf8');\n req.addParameter('opentelemetry_traceparent', (tediousModule as any).TYPES.VarBinary, buf, {\n length: buf.length,\n });\n\n connection.execSql(req);\n } catch {\n resolve();\n }\n });\n }\n\n private _shouldInjectFor(operation: string): boolean {\n return (\n operation === 'execSql' ||\n operation === 'execSqlBatch' ||\n operation === 'callProcedure' ||\n operation === 'execute'\n );\n }\n\n private _patchQuery(operation: string, tediousModule: typeof tedious) {\n return (originalMethod: UnknownFunction): UnknownFunction => {\n const thisPlugin = this;\n\n function patchedMethod(this: ApproxConnection, request: ApproxRequest) {\n // Skip our own injected request\n if ((request as any)?.[INJECTED_CTX]) {\n return originalMethod.apply(this, arguments as unknown as any[]);\n }\n\n if (!(request instanceof EventEmitter)) {\n thisPlugin._diag.warn(`Unexpected invocation of patched ${operation} method. Span not recorded`);\n return originalMethod.apply(this, arguments as unknown as any[]);\n }\n let procCount = 0;\n let statementCount = 0;\n const incrementStatementCount = () => statementCount++;\n const incrementProcCount = () => procCount++;\n const databaseName = this[CURRENT_DATABASE];\n const sql = (request => {\n // Required for <11.0.9\n if (request.sqlTextOrProcedure === 'sp_prepare' && request.parametersByName?.stmt?.value) {\n return request.parametersByName.stmt.value;\n }\n return request.sqlTextOrProcedure;\n })(request);\n\n const attributes: api.Attributes = {};\n if (thisPlugin._dbSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_SYSTEM] = DB_SYSTEM_VALUE_MSSQL;\n attributes[ATTR_DB_NAME] = databaseName;\n // >=4 uses `authentication` object; older versions just userName and password pair\n attributes[ATTR_DB_USER] = this.config?.userName ?? this.config?.authentication?.options?.userName;\n attributes[ATTR_DB_STATEMENT] = sql;\n attributes[ATTR_DB_SQL_TABLE] = request.table;\n }\n if (thisPlugin._dbSemconvStability & SemconvStability.STABLE) {\n // The OTel spec for \"db.namespace\" discusses handling for connection\n // to MSSQL \"named instances\". This isn't currently supported.\n // https://opentelemetry.io/docs/specs/semconv/database/sql-server/#:~:text=%5B1%5D%20db%2Enamespace\n attributes[ATTR_DB_NAMESPACE] = databaseName;\n attributes[ATTR_DB_SYSTEM_NAME] = DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER;\n attributes[ATTR_DB_QUERY_TEXT] = sql;\n attributes[ATTR_DB_COLLECTION_NAME] = request.table;\n // See https://opentelemetry.io/docs/specs/semconv/database/sql-server/#spans\n // TODO(3290): can `db.response.status_code` be added?\n // TODO(3290): is `operation` correct for `db.operation.name`\n // TODO(3290): can `db.query.summary` reliably be calculated?\n // TODO(3290): `db.stored_procedure.name`\n }\n if (thisPlugin._netSemconvStability & SemconvStability.OLD) {\n attributes[ATTR_NET_PEER_NAME] = this.config?.server;\n attributes[ATTR_NET_PEER_PORT] = this.config?.options?.port;\n }\n if (thisPlugin._netSemconvStability & SemconvStability.STABLE) {\n attributes[ATTR_SERVER_ADDRESS] = this.config?.server;\n attributes[ATTR_SERVER_PORT] = this.config?.options?.port;\n }\n const span = thisPlugin.tracer.startSpan(getSpanName(operation, databaseName, sql, request.table), {\n kind: api.SpanKind.CLIENT,\n attributes,\n });\n\n const endSpan = once((err?: any) => {\n request.removeListener('done', incrementStatementCount);\n request.removeListener('doneInProc', incrementStatementCount);\n request.removeListener('doneProc', incrementProcCount);\n request.removeListener('error', endSpan);\n this.removeListener('end', endSpan);\n\n span.setAttribute('tedious.procedure_count', procCount);\n span.setAttribute('tedious.statement_count', statementCount);\n if (err) {\n span.setStatus({\n code: api.SpanStatusCode.ERROR,\n message: err.message,\n });\n // TODO(3290): set `error.type` attribute?\n }\n span.end();\n });\n\n request.on('done', incrementStatementCount);\n request.on('doneInProc', incrementStatementCount);\n request.on('doneProc', incrementProcCount);\n request.once('error', endSpan);\n this.on('end', endSpan);\n\n if (typeof request.callback === 'function') {\n thisPlugin._wrap(request, 'callback', thisPlugin._patchCallbackQuery(endSpan));\n } else {\n thisPlugin._diag.error('Expected request.callback to be a function');\n }\n\n const runUserRequest = () => {\n return api.context.with(api.trace.setSpan(api.context.active(), span), originalMethod, this, ...arguments);\n };\n\n const cfg = thisPlugin.getConfig();\n const shouldInject = cfg.enableTraceContextPropagation && thisPlugin._shouldInjectFor(operation);\n\n if (!shouldInject) return runUserRequest();\n\n const traceparent = thisPlugin._buildTraceparent(span);\n\n void thisPlugin._injectContextInfo(this, tediousModule, traceparent).finally(runUserRequest);\n }\n\n Object.defineProperty(patchedMethod, 'length', {\n value: originalMethod.length,\n writable: false,\n });\n\n return patchedMethod;\n };\n }\n\n private _patchCallbackQuery(endSpan: Function) {\n return (originalCallback: Function) => {\n return function (this: any, err: Error | undefined | null, rowCount?: number, rows?: any) {\n endSpan(err);\n return originalCallback.apply(this, arguments);\n };\n };\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","semconvStabilityFromStr","InstrumentationNodeModuleDefinition","isWrapped","EventEmitter","request","SemconvStability","ATTR_DB_SYSTEM","DB_SYSTEM_VALUE_MSSQL","ATTR_DB_NAME","ATTR_DB_USER","ATTR_DB_STATEMENT","ATTR_DB_SQL_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CAAA;AACX,QAAA,OAAO,gBAAA,CAAiB,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAAA,MAC/C,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AACF,CAAA;AAnOa,uBAAA,CACK,SAAA,GAAY,SAAA;AADvB,IAAM,sBAAA,GAAN;;;;;"}
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../../src/integrations/tracing/tedious/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-tedious\n * - Upstream version: @opentelemetry/instrumentation-tedious@0.37.0\n * - Minor TypeScript strictness adjustments\n * - Span creation migrated to the @sentry/core API; origin folded into span creation\n */\n\nimport * as api from '@opentelemetry/api';\nimport { EventEmitter } from 'events';\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport {\n DB_SYSTEM_VALUE_MSSQL,\n ATTR_DB_NAME,\n ATTR_DB_SQL_TABLE,\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_DB_USER,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n} from './semconv';\nimport type * as tedious from './tedious-types';\nimport { getSpanName, once } from './utils';\nimport {\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n withActiveSpan,\n} from '@sentry/core';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-tedious';\n\nconst CURRENT_DATABASE = Symbol('opentelemetry.instrumentation-tedious.current-database');\n\nconst PATCHED_METHODS = ['callProcedure', 'execSql', 'execSqlBatch', 'execBulkLoad', 'prepare', 'execute'];\n\ntype UnknownFunction = (...args: any[]) => any;\ntype ApproxConnection = EventEmitter & {\n [CURRENT_DATABASE]: string;\n config: any;\n};\ntype ApproxRequest = EventEmitter & {\n sqlTextOrProcedure: string | undefined;\n callback: any;\n table: string | undefined;\n parametersByName: any;\n};\n\nfunction setDatabase(this: ApproxConnection, databaseName: string) {\n Object.defineProperty(this, CURRENT_DATABASE, {\n value: databaseName,\n writable: true,\n });\n}\n\nexport class TediousInstrumentation extends InstrumentationBase<InstrumentationConfig> {\n static readonly COMPONENT = 'tedious';\n\n constructor(config: InstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n protected init() {\n return [\n new InstrumentationNodeModuleDefinition(\n TediousInstrumentation.COMPONENT,\n ['>=1.11.0 <20'],\n (moduleExports: typeof tedious) => {\n const ConnectionPrototype: any = moduleExports.Connection.prototype;\n for (const method of PATCHED_METHODS) {\n if (isWrapped(ConnectionPrototype[method])) {\n this._unwrap(ConnectionPrototype, method);\n }\n this._wrap(ConnectionPrototype, method, this._patchQuery(method) as any);\n }\n\n if (isWrapped(ConnectionPrototype.connect)) {\n this._unwrap(ConnectionPrototype, 'connect');\n }\n // oxlint-disable-next-line typescript/unbound-method\n this._wrap(ConnectionPrototype, 'connect', this._patchConnect);\n\n return moduleExports;\n },\n (moduleExports: typeof tedious) => {\n if (moduleExports === undefined) return;\n const ConnectionPrototype: any = moduleExports.Connection.prototype;\n for (const method of PATCHED_METHODS) {\n this._unwrap(ConnectionPrototype, method);\n }\n this._unwrap(ConnectionPrototype, 'connect');\n },\n ),\n ];\n }\n\n private _patchConnect(original: UnknownFunction): UnknownFunction {\n return function patchedConnect(this: ApproxConnection) {\n setDatabase.call(this, this.config?.options?.database);\n\n // remove the listener first in case it's already added\n this.removeListener('databaseChange', setDatabase);\n this.on('databaseChange', setDatabase);\n\n this.once('end', () => {\n this.removeListener('databaseChange', setDatabase);\n });\n return original.apply(this, arguments as unknown as any[]);\n };\n }\n\n private _patchQuery(operation: string) {\n return (originalMethod: UnknownFunction): UnknownFunction => {\n const thisPlugin = this;\n\n function patchedMethod(this: ApproxConnection, request: ApproxRequest) {\n if (!(request instanceof EventEmitter)) {\n thisPlugin._diag.warn(`Unexpected invocation of patched ${operation} method. Span not recorded`);\n return originalMethod.apply(this, arguments as unknown as any[]);\n }\n let procCount = 0;\n let statementCount = 0;\n const incrementStatementCount = () => statementCount++;\n const incrementProcCount = () => procCount++;\n const databaseName = this[CURRENT_DATABASE];\n const sql = (request => {\n // Required for <11.0.9\n if (request.sqlTextOrProcedure === 'sp_prepare' && request.parametersByName?.stmt?.value) {\n return request.parametersByName.stmt.value;\n }\n return request.sqlTextOrProcedure;\n })(request);\n\n const attributes: api.Attributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.otel.tedious',\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_MSSQL,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_DB_NAME]: databaseName,\n // >=4 uses `authentication` object; older versions just userName and password pair\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_DB_USER]: this.config?.userName ?? this.config?.authentication?.options?.userName,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_DB_STATEMENT]: sql,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_DB_SQL_TABLE]: request.table,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_NET_PEER_NAME]: this.config?.server,\n // eslint-disable-next-line typescript/no-deprecated\n [ATTR_NET_PEER_PORT]: this.config?.options?.port,\n };\n const span = startInactiveSpan({\n name: getSpanName(operation, databaseName, sql, request.table),\n kind: api.SpanKind.CLIENT,\n attributes,\n });\n\n const endSpan = once((err?: any) => {\n request.removeListener('done', incrementStatementCount);\n request.removeListener('doneInProc', incrementStatementCount);\n request.removeListener('doneProc', incrementProcCount);\n request.removeListener('error', endSpan);\n this.removeListener('end', endSpan);\n\n span.setAttribute('tedious.procedure_count', procCount);\n span.setAttribute('tedious.statement_count', statementCount);\n if (err) {\n span.setStatus({\n code: SPAN_STATUS_ERROR,\n message: err.message,\n });\n // TODO(3290): set `error.type` attribute?\n }\n span.end();\n });\n\n request.on('done', incrementStatementCount);\n request.on('doneInProc', incrementStatementCount);\n request.on('doneProc', incrementProcCount);\n request.once('error', endSpan);\n this.on('end', endSpan);\n\n if (typeof request.callback === 'function') {\n thisPlugin._wrap(request, 'callback', thisPlugin._patchCallbackQuery(endSpan));\n } else {\n thisPlugin._diag.error('Expected request.callback to be a function');\n }\n\n return withActiveSpan(span, () => originalMethod.apply(this, arguments as unknown as any[]));\n }\n\n Object.defineProperty(patchedMethod, 'length', {\n value: originalMethod.length,\n writable: false,\n });\n\n return patchedMethod;\n };\n }\n\n private _patchCallbackQuery(endSpan: Function) {\n return (originalCallback: Function) => {\n return function (this: any, err: Error | undefined | null, _rowCount?: number, _rows?: any) {\n endSpan(err);\n return originalCallback.apply(this, arguments);\n };\n };\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","isWrapped","EventEmitter","request","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","ATTR_DB_SYSTEM","DB_SYSTEM_VALUE_MSSQL","ATTR_DB_NAME","ATTR_DB_USER","ATTR_DB_STATEMENT","ATTR_DB_SQL_TABLE","ATTR_NET_PEER_NAME","ATTR_NET_PEER_PORT","startInactiveSpan","getSpanName","once","SPAN_STATUS_ERROR","withActiveSpan"],"mappings":";;;;;;;;;AAmCA,MAAM,YAAA,GAAe,iCAAA;AAErB,MAAM,gBAAA,0BAA0B,wDAAwD,CAAA;AAExF,MAAM,kBAAkB,CAAC,eAAA,EAAiB,WAAW,cAAA,EAAgB,cAAA,EAAgB,WAAW,SAAS,CAAA;AAczG,SAAS,YAAoC,YAAA,EAAsB;AACjE,EAAA,MAAA,CAAO,cAAA,CAAe,MAAM,gBAAA,EAAkB;AAAA,IAC5C,KAAA,EAAO,YAAA;AAAA,IACP,QAAA,EAAU;AA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,MAAA,OAAO,aAAA;AAAA,IACT,CAAA;AAAA,EACF;AAAA,EAEQ,oBAAoB,OAAA,EAAmB;AAC7C,IAAA,OAAO,CAAC,gBAAA,KAA+B;AACrC,MAAA,OAAO,SAAqB,GAAA,EAA+B,SAAA,EAAoB,KAAA,EAAa;AAC1F,QAAA,OAAA,CAAQ,GAAG,CAAA;AACX,QAAA,OAAO,gBAAA,CAAiB,KAAA,CAAM,IAAA,EAAM,SAAS,CAAA;AAAA,MAC/C,CAAA;AAAA,IACF,CAAA;AAAA,EACF;AACF,CAAA;AAzJa,uBAAA,CACK,SAAA,GAAY,SAAA;AADvB,IAAM,sBAAA,GAAN;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/tedious/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-tedious\n * - Upstream version: @opentelemetry/instrumentation-tedious@0.37.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 `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 * Deprecated, use `db.collection.name` instead.\n *\n * @example \"mytable\"\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.collection.name`, but only if not extracting the value from `db.query.text`.\n */\nexport const ATTR_DB_SQL_TABLE = 'db.sql.table' 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 \"mssql\" for attribute {@link ATTR_DB_SYSTEM}.\n *\n * Microsoft SQL Server\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_MSSQL = 'mssql' as const;\n"],"names":[],"mappings":";;AAqCO,MAAM,YAAA,GAAe;AAWrB,MAAM,iBAAA,GAAoB;AAY1B,MAAM,iBAAA,GAAoB;AAS1B,MAAM,cAAA,GAAiB;AAYvB,MAAM,YAAA,GAAe;AAWrB,MAAM,kBAAA,GAAqB;AAW3B,MAAM,kBAAA,GAAqB;AAS3B,MAAM,qBAAA,GAAwB;;;;;;;;;;;"}
1
+ {"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/tedious/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-tedious\n * - Upstream version: @opentelemetry/instrumentation-tedious@0.37.0\n */\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 `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 * Deprecated, use `db.collection.name` instead.\n *\n * @example \"mytable\"\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.collection.name`, but only if not extracting the value from `db.query.text`.\n */\nexport const ATTR_DB_SQL_TABLE = 'db.sql.table' 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 \"mssql\" for attribute {@link ATTR_DB_SYSTEM}.\n *\n * Microsoft SQL Server\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_MSSQL = 'mssql' as const;\n"],"names":[],"mappings":";;AAyBO,MAAM,YAAA,GAAe;AAWrB,MAAM,iBAAA,GAAoB;AAY1B,MAAM,iBAAA,GAAoB;AAS1B,MAAM,cAAA,GAAiB;AAYvB,MAAM,YAAA,GAAe;AAWrB,MAAM,kBAAA,GAAqB;AAW3B,MAAM,kBAAA,GAAqB;AAS3B,MAAM,qBAAA,GAAwB;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/tedious/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-tedious\n * - Upstream version: @opentelemetry/instrumentation-tedious@0.37.0\n */\n/* eslint-disable */\n\n/**\n * The span name SHOULD be set to a low cardinality value\n * representing the statement executed on the database.\n *\n * @returns Operation executed on Tedious Connection. Does not map to SQL statement in any way.\n */\nexport function getSpanName(\n operation: string,\n db: string | undefined,\n sql: string | undefined,\n bulkLoadTable: string | undefined,\n): string {\n if (operation === 'execBulkLoad' && bulkLoadTable && db) {\n return `${operation} ${bulkLoadTable} ${db}`;\n }\n if (operation === 'callProcedure') {\n // `sql` refers to procedure name with `callProcedure`\n if (db) {\n return `${operation} ${sql} ${db}`;\n }\n return `${operation} ${sql}`;\n }\n // do not use `sql` in general case because of high-cardinality\n if (db) {\n return `${operation} ${db}`;\n }\n return `${operation}`;\n}\n\nexport const once = (fn: Function) => {\n let called = false;\n return (...args: unknown[]) => {\n if (called) return;\n called = true;\n return fn(...args);\n };\n};\n"],"names":[],"mappings":";;AA2BO,SAAS,WAAA,CACd,SAAA,EACA,EAAA,EACA,GAAA,EACA,aAAA,EACQ;AACR,EAAA,IAAI,SAAA,KAAc,cAAA,IAAkB,aAAA,IAAiB,EAAA,EAAI;AACvD,IAAA,OAAO,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,aAAa,IAAI,EAAE,CAAA,CAAA;AAAA,EAC5C;AACA,EAAA,IAAI,cAAc,eAAA,EAAiB;AAEjC,IAAA,IAAI,EAAA,EAAI;AACN,MAAA,OAAO,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,GAAG,IAAI,EAAE,CAAA,CAAA;AAAA,IAClC;AACA,IAAA,OAAO,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,GAAG,CAAA,CAAA;AAAA,EAC5B;AAEA,EAAA,IAAI,EAAA,EAAI;AACN,IAAA,OAAO,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,EAAE,CAAA,CAAA;AAAA,EAC3B;AACA,EAAA,OAAO,GAAG,SAAS,CAAA,CAAA;AACrB;AAEO,MAAM,IAAA,GAAO,CAAC,EAAA,KAAiB;AACpC,EAAA,IAAI,MAAA,GAAS,KAAA;AACb,EAAA,OAAO,IAAI,IAAA,KAAoB;AAC7B,IAAA,IAAI,MAAA,EAAQ;AACZ,IAAA,MAAA,GAAS,IAAA;AACT,IAAA,OAAO,EAAA,CAAG,GAAG,IAAI,CAAA;AAAA,EACnB,CAAA;AACF;;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../../src/integrations/tracing/tedious/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-tedious\n * - Upstream version: @opentelemetry/instrumentation-tedious@0.37.0\n */\n/* eslint-disable */\n\n/**\n * The span name SHOULD be set to a low cardinality value\n * representing the statement executed on the database.\n *\n * @returns Operation executed on Tedious Connection. Does not map to SQL statement in any way.\n */\nexport function getSpanName(\n operation: string,\n db: string | undefined,\n sql: string | undefined,\n bulkLoadTable: string | undefined,\n): string {\n if (operation === 'execBulkLoad' && bulkLoadTable && db) {\n return `${operation} ${bulkLoadTable} ${db}`;\n }\n if (operation === 'callProcedure') {\n // `sql` refers to procedure name with `callProcedure`\n if (db) {\n return `${operation} ${sql} ${db}`;\n }\n return `${operation} ${sql}`;\n }\n // do not use `sql` in general case because of high-cardinality\n if (db) {\n return `${operation} ${db}`;\n }\n return `${operation}`;\n}\n\nexport const once = (fn: Function) => {\n let called = false;\n return (...args: unknown[]) => {\n if (called) return;\n called = true;\n return fn(...args);\n };\n};\n"],"names":[],"mappings":";;AAgBO,SAAS,WAAA,CACd,SAAA,EACA,EAAA,EACA,GAAA,EACA,aAAA,EACQ;AACR,EAAA,IAAI,SAAA,KAAc,cAAA,IAAkB,aAAA,IAAiB,EAAA,EAAI;AACvD,IAAA,OAAO,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,aAAa,IAAI,EAAE,CAAA,CAAA;AAAA,EAC5C;AACA,EAAA,IAAI,cAAc,eAAA,EAAiB;AAEjC,IAAA,IAAI,EAAA,EAAI;AACN,MAAA,OAAO,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,GAAG,IAAI,EAAE,CAAA,CAAA;AAAA,IAClC;AACA,IAAA,OAAO,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,GAAG,CAAA,CAAA;AAAA,EAC5B;AAEA,EAAA,IAAI,EAAA,EAAI;AACN,IAAA,OAAO,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,EAAE,CAAA,CAAA;AAAA,EAC3B;AACA,EAAA,OAAO,GAAG,SAAS,CAAA,CAAA;AACrB;AAEO,MAAM,IAAA,GAAO,CAAC,EAAA,KAAiB;AACpC,EAAA,IAAI,MAAA,GAAS,KAAA;AACb,EAAA,OAAO,IAAI,IAAA,KAAoB;AAC7B,IAAA,IAAI,MAAA,EAAQ;AACZ,IAAA,MAAA,GAAS,IAAA;AACT,IAAA,OAAO,EAAA,CAAG,GAAG,IAAI,CAAA;AAAA,EACnB,CAAA;AACF;;;;;"}
@@ -0,0 +1,21 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ let loader;
4
+ let cached;
5
+ function setDiagnosticsChannelInjectionLoader(load) {
6
+ loader = load;
7
+ }
8
+ function isDiagnosticsChannelInjectionEnabled() {
9
+ return !!loader;
10
+ }
11
+ function resolveDiagnosticsChannelInjection() {
12
+ if (!loader) {
13
+ return void 0;
14
+ }
15
+ return cached ?? (cached = loader());
16
+ }
17
+
18
+ exports.isDiagnosticsChannelInjectionEnabled = isDiagnosticsChannelInjectionEnabled;
19
+ exports.resolveDiagnosticsChannelInjection = resolveDiagnosticsChannelInjection;
20
+ exports.setDiagnosticsChannelInjectionLoader = setDiagnosticsChannelInjectionLoader;
21
+ //# sourceMappingURL=diagnosticsChannelInjection.js.map