@sentry/node 10.62.0 → 10.64.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 (497) hide show
  1. package/build/cjs/index.js +15 -14
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  4. package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -1
  5. package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -1
  6. package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -1
  7. package/build/cjs/integrations/fs/index.js.map +1 -1
  8. package/build/cjs/integrations/http.js.map +1 -1
  9. package/build/cjs/integrations/node-fetch.js +24 -0
  10. package/build/cjs/integrations/node-fetch.js.map +1 -0
  11. package/build/cjs/integrations/tracing/amqplib/index.js.map +1 -1
  12. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js +0 -6
  13. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  14. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js +11 -10
  15. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  16. package/build/cjs/integrations/tracing/connect/index.js.map +1 -1
  17. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +2 -2
  18. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  19. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -1
  20. package/build/cjs/integrations/tracing/express.js.map +1 -1
  21. package/build/cjs/integrations/tracing/fastify/index.js +7 -103
  22. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  23. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +4 -5
  24. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  25. package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -1
  26. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +9 -9
  27. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  28. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -1
  29. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -1
  30. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  31. package/build/cjs/integrations/tracing/hapi/vendored/utils.js +8 -9
  32. package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  33. package/build/cjs/integrations/tracing/hono/index.js +7 -7
  34. package/build/cjs/integrations/tracing/hono/index.js.map +1 -1
  35. package/build/cjs/integrations/tracing/index.js +0 -1
  36. package/build/cjs/integrations/tracing/index.js.map +1 -1
  37. package/build/cjs/integrations/tracing/kafka/index.js.map +1 -1
  38. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +2 -1
  39. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  40. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +0 -12
  41. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  42. package/build/cjs/integrations/tracing/kafka/vendored/utils.js +12 -11
  43. package/build/cjs/integrations/tracing/kafka/vendored/utils.js.map +1 -1
  44. package/build/cjs/integrations/tracing/knex/index.js.map +1 -1
  45. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +11 -10
  46. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  47. package/build/cjs/integrations/tracing/knex/vendored/semconv.js +0 -16
  48. package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  49. package/build/cjs/integrations/tracing/koa/index.js.map +1 -1
  50. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +2 -2
  51. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  52. package/build/cjs/integrations/tracing/koa/vendored/utils.js +2 -2
  53. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -1
  54. package/build/cjs/integrations/tracing/lrumemoizer/index.js.map +1 -1
  55. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js +4 -2
  56. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  57. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -1
  58. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js +0 -12
  59. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  60. package/build/cjs/integrations/tracing/mongo/vendored/utils.js +12 -11
  61. package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +1 -1
  62. package/build/cjs/integrations/tracing/mongoose/index.js +3 -2
  63. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -1
  64. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +11 -8
  65. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  66. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js +0 -12
  67. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  68. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +9 -9
  69. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  70. package/build/cjs/integrations/tracing/mysql/index.js.map +1 -1
  71. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js +36 -129
  72. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  73. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js +0 -14
  74. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  75. package/build/cjs/integrations/tracing/mysql/vendored/utils.js +2 -27
  76. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  77. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -1
  78. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +7 -4
  79. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  80. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js +0 -12
  81. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  82. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +7 -4
  83. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  84. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -1
  85. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +0 -12
  86. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  87. package/build/cjs/integrations/tracing/postgres/vendored/utils.js +12 -11
  88. package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  89. package/build/cjs/integrations/tracing/postgresjs.js +8 -7
  90. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  91. package/build/cjs/integrations/tracing/prisma/index.js +48 -62
  92. package/build/cjs/integrations/tracing/prisma/index.js.map +1 -1
  93. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js +83 -57
  94. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  95. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  96. package/build/cjs/integrations/tracing/prisma/vendored/global.js +2 -2
  97. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -1
  98. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js +1 -6
  99. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  100. package/build/cjs/integrations/tracing/redis/cache.js +41 -0
  101. package/build/cjs/integrations/tracing/redis/cache.js.map +1 -0
  102. package/build/cjs/integrations/tracing/redis/index.js +16 -38
  103. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  104. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +22 -13
  105. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  106. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +21 -15
  107. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  108. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +0 -8
  109. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  110. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -1
  111. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +9 -8
  112. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  113. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js +0 -12
  114. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  115. package/build/cjs/integrations/tracing/vercelai/constants.js.map +1 -1
  116. package/build/cjs/integrations/tracing/vercelai/index.js +2 -4
  117. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  118. package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -1
  119. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +18 -6
  120. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
  121. package/build/cjs/sdk/index.js +2 -2
  122. package/build/cjs/sdk/index.js.map +1 -1
  123. package/build/cjs/sdk/initOtel.js +36 -0
  124. package/build/cjs/sdk/initOtel.js.map +1 -1
  125. package/build/esm/index.js +2 -2
  126. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  127. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -1
  128. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -1
  129. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -1
  130. package/build/esm/integrations/fs/index.js.map +1 -1
  131. package/build/esm/integrations/http.js.map +1 -1
  132. package/build/esm/integrations/node-fetch.js +22 -0
  133. package/build/esm/integrations/node-fetch.js.map +1 -0
  134. package/build/esm/integrations/tracing/amqplib/index.js.map +1 -1
  135. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js +1 -4
  136. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  137. package/build/esm/integrations/tracing/amqplib/vendored/utils.js +7 -6
  138. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  139. package/build/esm/integrations/tracing/connect/index.js.map +1 -1
  140. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +2 -2
  141. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  142. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -1
  143. package/build/esm/integrations/tracing/express.js.map +1 -1
  144. package/build/esm/integrations/tracing/fastify/index.js +8 -103
  145. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  146. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +5 -6
  147. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  148. package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -1
  149. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +7 -7
  150. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  151. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -1
  152. package/build/esm/integrations/tracing/graphql/index.js.map +1 -1
  153. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  154. package/build/esm/integrations/tracing/hapi/vendored/utils.js +3 -4
  155. package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -1
  156. package/build/esm/integrations/tracing/hono/index.js +3 -3
  157. package/build/esm/integrations/tracing/hono/index.js.map +1 -1
  158. package/build/esm/integrations/tracing/index.js +1 -2
  159. package/build/esm/integrations/tracing/index.js.map +1 -1
  160. package/build/esm/integrations/tracing/kafka/index.js.map +1 -1
  161. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +3 -2
  162. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  163. package/build/esm/integrations/tracing/kafka/vendored/semconv.js +1 -7
  164. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  165. package/build/esm/integrations/tracing/kafka/vendored/utils.js +11 -10
  166. package/build/esm/integrations/tracing/kafka/vendored/utils.js.map +1 -1
  167. package/build/esm/integrations/tracing/knex/index.js.map +1 -1
  168. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +10 -9
  169. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  170. package/build/esm/integrations/tracing/knex/vendored/semconv.js +1 -9
  171. package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -1
  172. package/build/esm/integrations/tracing/koa/index.js.map +1 -1
  173. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +2 -2
  174. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  175. package/build/esm/integrations/tracing/koa/vendored/utils.js +2 -2
  176. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -1
  177. package/build/esm/integrations/tracing/lrumemoizer/index.js.map +1 -1
  178. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js +5 -3
  179. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  180. package/build/esm/integrations/tracing/mongo/index.js.map +1 -1
  181. package/build/esm/integrations/tracing/mongo/vendored/semconv.js +1 -7
  182. package/build/esm/integrations/tracing/mongo/vendored/semconv.js.map +1 -1
  183. package/build/esm/integrations/tracing/mongo/vendored/utils.js +9 -8
  184. package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +1 -1
  185. package/build/esm/integrations/tracing/mongoose/index.js +4 -3
  186. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -1
  187. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +9 -6
  188. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -1
  189. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js +1 -7
  190. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js.map +1 -1
  191. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +10 -10
  192. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -1
  193. package/build/esm/integrations/tracing/mysql/index.js.map +1 -1
  194. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js +38 -131
  195. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  196. package/build/esm/integrations/tracing/mysql/vendored/semconv.js +1 -8
  197. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  198. package/build/esm/integrations/tracing/mysql/vendored/utils.js +3 -25
  199. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  200. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -1
  201. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +6 -3
  202. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  203. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js +1 -7
  204. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -1
  205. package/build/esm/integrations/tracing/mysql2/vendored/utils.js +8 -5
  206. package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -1
  207. package/build/esm/integrations/tracing/postgres/index.js.map +1 -1
  208. package/build/esm/integrations/tracing/postgres/vendored/semconv.js +1 -7
  209. package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -1
  210. package/build/esm/integrations/tracing/postgres/vendored/utils.js +13 -12
  211. package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -1
  212. package/build/esm/integrations/tracing/postgresjs.js +7 -6
  213. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  214. package/build/esm/integrations/tracing/prisma/index.js +49 -63
  215. package/build/esm/integrations/tracing/prisma/index.js.map +1 -1
  216. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js +83 -57
  217. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  218. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  219. package/build/esm/integrations/tracing/prisma/vendored/global.js +2 -2
  220. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -1
  221. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js +1 -6
  222. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  223. package/build/esm/integrations/tracing/redis/cache.js +38 -0
  224. package/build/esm/integrations/tracing/redis/cache.js.map +1 -0
  225. package/build/esm/integrations/tracing/redis/index.js +12 -37
  226. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  227. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +19 -10
  228. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  229. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +16 -10
  230. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  231. package/build/esm/integrations/tracing/redis/vendored/semconv.js +1 -5
  232. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  233. package/build/esm/integrations/tracing/tedious/index.js.map +1 -1
  234. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +8 -7
  235. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -1
  236. package/build/esm/integrations/tracing/tedious/vendored/semconv.js +1 -7
  237. package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -1
  238. package/build/esm/integrations/tracing/vercelai/constants.js.map +1 -1
  239. package/build/esm/integrations/tracing/vercelai/index.js +3 -5
  240. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  241. package/build/esm/package.json +1 -1
  242. package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -1
  243. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +19 -8
  244. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
  245. package/build/esm/sdk/index.js +1 -1
  246. package/build/esm/sdk/initOtel.js +38 -2
  247. package/build/esm/sdk/initOtel.js.map +1 -1
  248. package/build/types/index.d.ts +1 -1
  249. package/build/types/index.d.ts.map +1 -1
  250. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
  251. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -1
  252. package/build/types/integrations/featureFlagShims/openFeature.d.ts +3 -1
  253. package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -1
  254. package/build/types/integrations/featureFlagShims/statsig.d.ts +3 -1
  255. package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -1
  256. package/build/types/integrations/featureFlagShims/unleash.d.ts +3 -1
  257. package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -1
  258. package/build/types/integrations/fs/index.d.ts +3 -1
  259. package/build/types/integrations/fs/index.d.ts.map +1 -1
  260. package/build/types/integrations/http.d.ts +3 -1
  261. package/build/types/integrations/http.d.ts.map +1 -1
  262. package/build/types/integrations/node-fetch.d.ts +9 -0
  263. package/build/types/integrations/node-fetch.d.ts.map +1 -0
  264. package/build/types/integrations/tracing/amqplib/index.d.ts +3 -1
  265. package/build/types/integrations/tracing/amqplib/index.d.ts.map +1 -1
  266. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts +0 -6
  267. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -1
  268. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -1
  269. package/build/types/integrations/tracing/anthropic-ai/index.d.ts +3 -1
  270. package/build/types/integrations/tracing/anthropic-ai/index.d.ts.map +1 -1
  271. package/build/types/integrations/tracing/connect/index.d.ts +3 -1
  272. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -1
  273. package/build/types/integrations/tracing/dataloader/index.d.ts +3 -1
  274. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -1
  275. package/build/types/integrations/tracing/express.d.ts +3 -1
  276. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  277. package/build/types/integrations/tracing/fastify/index.d.ts +6 -6
  278. package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
  279. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +1 -1
  280. package/build/types/integrations/tracing/firebase/firebase.d.ts +3 -1
  281. package/build/types/integrations/tracing/firebase/firebase.d.ts.map +1 -1
  282. package/build/types/integrations/tracing/genericPool/index.d.ts +3 -1
  283. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -1
  284. package/build/types/integrations/tracing/google-genai/index.d.ts +3 -1
  285. package/build/types/integrations/tracing/google-genai/index.d.ts.map +1 -1
  286. package/build/types/integrations/tracing/graphql/index.d.ts +3 -1
  287. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -1
  288. package/build/types/integrations/tracing/hapi/index.d.ts +3 -1
  289. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  290. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -1
  291. package/build/types/integrations/tracing/hono/index.d.ts +3 -1
  292. package/build/types/integrations/tracing/hono/index.d.ts.map +1 -1
  293. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  294. package/build/types/integrations/tracing/kafka/index.d.ts +3 -1
  295. package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -1
  296. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +5 -63
  297. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -1
  298. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts.map +1 -1
  299. package/build/types/integrations/tracing/knex/index.d.ts +3 -1
  300. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -1
  301. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +0 -32
  302. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -1
  303. package/build/types/integrations/tracing/koa/index.d.ts +3 -1
  304. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -1
  305. package/build/types/integrations/tracing/langchain/index.d.ts +3 -1
  306. package/build/types/integrations/tracing/langchain/index.d.ts.map +1 -1
  307. package/build/types/integrations/tracing/langgraph/index.d.ts +3 -1
  308. package/build/types/integrations/tracing/langgraph/index.d.ts.map +1 -1
  309. package/build/types/integrations/tracing/lrumemoizer/index.d.ts +3 -1
  310. package/build/types/integrations/tracing/lrumemoizer/index.d.ts.map +1 -1
  311. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -1
  312. package/build/types/integrations/tracing/mongo/index.d.ts +3 -1
  313. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -1
  314. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts +1 -37
  315. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts.map +1 -1
  316. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +1 -1
  317. package/build/types/integrations/tracing/mongoose/index.d.ts +3 -1
  318. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -1
  319. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -1
  320. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -48
  321. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts.map +1 -1
  322. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -1
  323. package/build/types/integrations/tracing/mysql/index.d.ts +3 -1
  324. package/build/types/integrations/tracing/mysql/index.d.ts.map +1 -1
  325. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts +3 -17
  326. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -1
  327. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts +16 -16
  328. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -1
  329. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts +1 -70
  330. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -1
  331. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts +6 -9
  332. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -1
  333. package/build/types/integrations/tracing/mysql2/index.d.ts +3 -1
  334. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -1
  335. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -1
  336. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts +0 -6
  337. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -1
  338. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -1
  339. package/build/types/integrations/tracing/openai/index.d.ts +3 -1
  340. package/build/types/integrations/tracing/openai/index.d.ts.map +1 -1
  341. package/build/types/integrations/tracing/postgres/index.d.ts +3 -1
  342. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -1
  343. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +1 -50
  344. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -1
  345. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -1
  346. package/build/types/integrations/tracing/postgresjs.d.ts +3 -1
  347. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
  348. package/build/types/integrations/tracing/prisma/index.d.ts +5 -21
  349. package/build/types/integrations/tracing/prisma/index.d.ts.map +1 -1
  350. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +5 -7
  351. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -1
  352. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -1
  353. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -1
  354. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts +2 -4
  355. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -1
  356. package/build/types/integrations/tracing/prisma/vendored/types.d.ts +5 -23
  357. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -1
  358. package/build/types/integrations/tracing/redis/cache.d.ts +22 -0
  359. package/build/types/integrations/tracing/redis/cache.d.ts.map +1 -0
  360. package/build/types/integrations/tracing/redis/index.d.ts +6 -22
  361. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
  362. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -1
  363. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -1
  364. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts +0 -4
  365. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -1
  366. package/build/types/integrations/tracing/tedious/index.d.ts +3 -1
  367. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -1
  368. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -1
  369. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts +1 -62
  370. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -1
  371. package/build/types/integrations/tracing/vercelai/constants.d.ts +1 -1
  372. package/build/types/integrations/tracing/vercelai/constants.d.ts.map +1 -1
  373. package/build/types/integrations/tracing/vercelai/index.d.ts +3 -1
  374. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  375. package/build/types/sdk/diagnosticsChannelInjection.d.ts +1 -1
  376. package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -1
  377. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +2 -0
  378. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -1
  379. package/build/types/sdk/initOtel.d.ts +2 -3
  380. package/build/types/sdk/initOtel.d.ts.map +1 -1
  381. package/build/types-ts3.8/index.d.ts +1 -1
  382. package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
  383. package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +3 -1
  384. package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +3 -1
  385. package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +3 -1
  386. package/build/types-ts3.8/integrations/fs/index.d.ts +3 -1
  387. package/build/types-ts3.8/integrations/http.d.ts +3 -1
  388. package/build/types-ts3.8/integrations/node-fetch.d.ts +9 -0
  389. package/build/types-ts3.8/integrations/tracing/amqplib/index.d.ts +3 -1
  390. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv.d.ts +0 -6
  391. package/build/types-ts3.8/integrations/tracing/anthropic-ai/index.d.ts +3 -1
  392. package/build/types-ts3.8/integrations/tracing/connect/index.d.ts +3 -1
  393. package/build/types-ts3.8/integrations/tracing/dataloader/index.d.ts +3 -1
  394. package/build/types-ts3.8/integrations/tracing/express.d.ts +3 -1
  395. package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +6 -6
  396. package/build/types-ts3.8/integrations/tracing/firebase/firebase.d.ts +3 -1
  397. package/build/types-ts3.8/integrations/tracing/genericPool/index.d.ts +3 -1
  398. package/build/types-ts3.8/integrations/tracing/google-genai/index.d.ts +3 -1
  399. package/build/types-ts3.8/integrations/tracing/graphql/index.d.ts +3 -1
  400. package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +3 -1
  401. package/build/types-ts3.8/integrations/tracing/hono/index.d.ts +3 -1
  402. package/build/types-ts3.8/integrations/tracing/kafka/index.d.ts +3 -1
  403. package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +5 -63
  404. package/build/types-ts3.8/integrations/tracing/knex/index.d.ts +3 -1
  405. package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +0 -32
  406. package/build/types-ts3.8/integrations/tracing/koa/index.d.ts +3 -1
  407. package/build/types-ts3.8/integrations/tracing/langchain/index.d.ts +3 -1
  408. package/build/types-ts3.8/integrations/tracing/langgraph/index.d.ts +3 -1
  409. package/build/types-ts3.8/integrations/tracing/lrumemoizer/index.d.ts +3 -1
  410. package/build/types-ts3.8/integrations/tracing/mongo/index.d.ts +3 -1
  411. package/build/types-ts3.8/integrations/tracing/mongo/vendored/semconv.d.ts +1 -37
  412. package/build/types-ts3.8/integrations/tracing/mongoose/index.d.ts +3 -1
  413. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/semconv.d.ts +0 -48
  414. package/build/types-ts3.8/integrations/tracing/mysql/index.d.ts +3 -1
  415. package/build/types-ts3.8/integrations/tracing/mysql/vendored/instrumentation.d.ts +3 -17
  416. package/build/types-ts3.8/integrations/tracing/mysql/vendored/mysql-types.d.ts +16 -16
  417. package/build/types-ts3.8/integrations/tracing/mysql/vendored/semconv.d.ts +1 -70
  418. package/build/types-ts3.8/integrations/tracing/mysql/vendored/utils.d.ts +6 -9
  419. package/build/types-ts3.8/integrations/tracing/mysql2/index.d.ts +3 -1
  420. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/semconv.d.ts +0 -6
  421. package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +3 -1
  422. package/build/types-ts3.8/integrations/tracing/postgres/index.d.ts +3 -1
  423. package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +1 -50
  424. package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +3 -1
  425. package/build/types-ts3.8/integrations/tracing/prisma/index.d.ts +5 -21
  426. package/build/types-ts3.8/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +5 -7
  427. package/build/types-ts3.8/integrations/tracing/prisma/vendored/instrumentation.d.ts +2 -4
  428. package/build/types-ts3.8/integrations/tracing/prisma/vendored/types.d.ts +5 -23
  429. package/build/types-ts3.8/integrations/tracing/redis/cache.d.ts +22 -0
  430. package/build/types-ts3.8/integrations/tracing/redis/index.d.ts +6 -22
  431. package/build/types-ts3.8/integrations/tracing/redis/vendored/semconv.d.ts +0 -4
  432. package/build/types-ts3.8/integrations/tracing/tedious/index.d.ts +3 -1
  433. package/build/types-ts3.8/integrations/tracing/tedious/vendored/semconv.d.ts +1 -62
  434. package/build/types-ts3.8/integrations/tracing/vercelai/constants.d.ts +1 -1
  435. package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +3 -1
  436. package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +1 -1
  437. package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +2 -0
  438. package/build/types-ts3.8/sdk/initOtel.d.ts +3 -4
  439. package/package.json +8 -8
  440. package/build/cjs/integrations/node-fetch/index.js +0 -80
  441. package/build/cjs/integrations/node-fetch/index.js.map +0 -1
  442. package/build/cjs/integrations/node-fetch/vendored/semconv.js +0 -28
  443. package/build/cjs/integrations/node-fetch/vendored/semconv.js.map +0 -1
  444. package/build/cjs/integrations/node-fetch/vendored/undici.js +0 -302
  445. package/build/cjs/integrations/node-fetch/vendored/undici.js.map +0 -1
  446. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js +0 -387
  447. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +0 -1
  448. package/build/cjs/integrations/tracing/hapi/vendored/semconv.js +0 -6
  449. package/build/cjs/integrations/tracing/hapi/vendored/semconv.js.map +0 -1
  450. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js +0 -9
  451. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +0 -1
  452. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js +0 -34
  453. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +0 -1
  454. package/build/esm/integrations/node-fetch/index.js +0 -77
  455. package/build/esm/integrations/node-fetch/index.js.map +0 -1
  456. package/build/esm/integrations/node-fetch/vendored/semconv.js +0 -15
  457. package/build/esm/integrations/node-fetch/vendored/semconv.js.map +0 -1
  458. package/build/esm/integrations/node-fetch/vendored/undici.js +0 -300
  459. package/build/esm/integrations/node-fetch/vendored/undici.js.map +0 -1
  460. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js +0 -385
  461. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +0 -1
  462. package/build/esm/integrations/tracing/hapi/vendored/semconv.js +0 -4
  463. package/build/esm/integrations/tracing/hapi/vendored/semconv.js.map +0 -1
  464. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js +0 -7
  465. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +0 -1
  466. package/build/esm/integrations/tracing/redis/vendored/redis-common.js +0 -32
  467. package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +0 -1
  468. package/build/types/integrations/node-fetch/index.d.ts +0 -36
  469. package/build/types/integrations/node-fetch/index.d.ts.map +0 -1
  470. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts +0 -25
  471. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts.map +0 -1
  472. package/build/types/integrations/node-fetch/vendored/semconv.d.ts +0 -13
  473. package/build/types/integrations/node-fetch/vendored/semconv.d.ts.map +0 -1
  474. package/build/types/integrations/node-fetch/vendored/types.d.ts +0 -60
  475. package/build/types/integrations/node-fetch/vendored/types.d.ts.map +0 -1
  476. package/build/types/integrations/node-fetch/vendored/undici.d.ts +0 -21
  477. package/build/types/integrations/node-fetch/vendored/undici.d.ts.map +0 -1
  478. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts +0 -27
  479. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +0 -1
  480. package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts +0 -13
  481. package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts.map +0 -1
  482. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts +0 -4
  483. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +0 -1
  484. package/build/types/integrations/tracing/mysql/vendored/types.d.ts +0 -9
  485. package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +0 -1
  486. package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts +0 -6
  487. package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts.map +0 -1
  488. package/build/types-ts3.8/integrations/node-fetch/index.d.ts +0 -36
  489. package/build/types-ts3.8/integrations/node-fetch/vendored/internal-types.d.ts +0 -25
  490. package/build/types-ts3.8/integrations/node-fetch/vendored/semconv.d.ts +0 -13
  491. package/build/types-ts3.8/integrations/node-fetch/vendored/types.d.ts +0 -60
  492. package/build/types-ts3.8/integrations/node-fetch/vendored/undici.d.ts +0 -21
  493. package/build/types-ts3.8/integrations/tracing/fastify/vendored/instrumentation.d.ts +0 -27
  494. package/build/types-ts3.8/integrations/tracing/hapi/vendored/semconv.d.ts +0 -13
  495. package/build/types-ts3.8/integrations/tracing/mysql/vendored/AttributeNames.d.ts +0 -4
  496. package/build/types-ts3.8/integrations/tracing/mysql/vendored/types.d.ts +0 -9
  497. package/build/types-ts3.8/integrations/tracing/redis/vendored/redis-common.d.ts +0 -6
@@ -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 * 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 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_KIND,\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: SPAN_KIND.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: SPAN_KIND.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: SPAN_KIND.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","SPAN_KIND","getActiveSpan","withActiveSpan","InstrumentationNodeModuleFile"],"mappings":";;;;;;;;;AAqCA,MAAM,YAAA,GAAe,+BAAA;AACrB,MAAM,MAAA,GAAS,oBAAA;AAoCf,MAAM,eAAA,0BAAyB,gDAAgD,CAAA;AAC/E,MAA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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;;;;"}
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 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_KIND,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n withActiveSpan,\n} from '@sentry/core';\nimport { DB_STATEMENT, DB_SYSTEM, NET_PEER_NAME, NET_PEER_PORT } from '@sentry/conventions/attributes';\nimport { defaultDbStatementSerializer } from '@sentry/server-utils';\nimport { DEBUG_BUILD } from '../../../../debug-build';\nimport { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile';\nimport { ATTR_DB_CONNECTION_STRING, DB_SYSTEM_VALUE_REDIS } 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 // oxlint-disable-next-line typescript/no-deprecated\n [DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n // oxlint-disable-next-line typescript/no-deprecated\n [NET_PEER_NAME]: options?.socket?.host,\n // oxlint-disable-next-line typescript/no-deprecated\n [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 // oxlint-disable-next-line typescript/no-deprecated\n [DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n // oxlint-disable-next-line typescript/no-deprecated\n [DB_STATEMENT]: defaultDbStatementSerializer(cmd.command, cmd.args),\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n };\n if (this.connection_options) {\n // oxlint-disable-next-line typescript/no-deprecated\n attributes[NET_PEER_NAME] = this.connection_options.host;\n // oxlint-disable-next-line typescript/no-deprecated\n attributes[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: SPAN_KIND.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: SPAN_KIND.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 // oxlint-disable-next-line typescript/no-deprecated\n attributes[DB_STATEMENT] = dbStatement;\n }\n const span = startInactiveSpan({\n name: `${RedisInstrumentationV4_V5.COMPONENT}-${commandName}`,\n kind: SPAN_KIND.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","DB_SYSTEM","DB_SYSTEM_VALUE_REDIS","NET_PEER_NAME","NET_PEER_PORT","ATTR_DB_CONNECTION_STRING","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","InstrumentationBase","SDK_VERSION","InstrumentationNodeModuleDefinition","isWrapped","attributes","DB_STATEMENT","defaultDbStatementSerializer","startInactiveSpan","SPAN_KIND","getActiveSpan","withActiveSpan","InstrumentationNodeModuleFile"],"mappings":";;;;;;;;;;AA+BA,MAAM,YAAA,GAAe,+BAAA;AACrB,MAAM,MAAA,GAAS,oBAAA;AAoCf,MAAM,eAAA,0BAAyB,gDAAgD,CAAA;AAC/E,MAAM,qBAAA,0BAA+B,2DAA2D,CAAA;AAIhG,SAAS,OAAA,CAAQ,MAAY,GAAA,EAAqC;AAChE,EAAA,IAAI,GAAA,EAAK;AACP,IAAA,IAAA,CAAK,UAAU,EAAE,IAAA,EAAMA,wBAAmB,OAAA,EAAS,GAAA,CAAI,SAAS,CAAA;AAAA,EAClE;AACA,EAAA,IAAA,CAAK,GAAA,EAAI;AACX;AAEA,SAAS,eAAA,CACP,YAAA,EACA,IAAA,EACA,WAAA,EACA,aACA,QAAA,EACM;AACN,EAAA,IAAI,CAAC,YAAA,EAAc;AACjB,IAAA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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;;;;"}
@@ -1,16 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const ATTR_DB_CONNECTION_STRING = "db.connection_string";
4
- const ATTR_DB_STATEMENT = "db.statement";
5
- const ATTR_DB_SYSTEM = "db.system";
6
- const ATTR_NET_PEER_NAME = "net.peer.name";
7
- const ATTR_NET_PEER_PORT = "net.peer.port";
8
4
  const DB_SYSTEM_VALUE_REDIS = "redis";
9
5
 
10
6
  exports.ATTR_DB_CONNECTION_STRING = ATTR_DB_CONNECTION_STRING;
11
- exports.ATTR_DB_STATEMENT = ATTR_DB_STATEMENT;
12
- exports.ATTR_DB_SYSTEM = ATTR_DB_SYSTEM;
13
- exports.ATTR_NET_PEER_NAME = ATTR_NET_PEER_NAME;
14
- exports.ATTR_NET_PEER_PORT = ATTR_NET_PEER_PORT;
15
7
  exports.DB_SYSTEM_VALUE_REDIS = DB_SYSTEM_VALUE_REDIS;
16
8
  //# 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 * 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;;;;;;;;;"}
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 DB_SYSTEM_NAME_VALUE_REDIS = 'redis';\nexport const DB_SYSTEM_VALUE_REDIS = 'redis';\n"],"names":[],"mappings":";;AAkBO,MAAM,yBAAA,GAA4B;AAElC,MAAM,qBAAA,GAAwB;;;;;"}
@@ -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 } 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;;;;;"}
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' as const;\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;;;;;"}
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const events = require('events');
4
4
  const instrumentation = require('@opentelemetry/instrumentation');
5
+ const attributes = require('@sentry/conventions/attributes');
5
6
  const semconv = require('./semconv.js');
6
7
  const utils = require('./utils.js');
7
8
  const core = require('@sentry/core');
@@ -79,28 +80,28 @@ const _TediousInstrumentation = class _TediousInstrumentation extends instrument
79
80
  }
80
81
  return request2.sqlTextOrProcedure;
81
82
  })(request);
82
- const attributes = {
83
+ const attributes$1 = {
83
84
  [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.db.otel.tedious",
84
85
  // eslint-disable-next-line typescript/no-deprecated
85
- [semconv.ATTR_DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_MSSQL,
86
+ [attributes.DB_SYSTEM]: semconv.DB_SYSTEM_VALUE_MSSQL,
86
87
  // eslint-disable-next-line typescript/no-deprecated
87
- [semconv.ATTR_DB_NAME]: databaseName,
88
+ [attributes.DB_NAME]: databaseName,
88
89
  // >=4 uses `authentication` object; older versions just userName and password pair
89
90
  // eslint-disable-next-line typescript/no-deprecated
90
- [semconv.ATTR_DB_USER]: this.config?.userName ?? this.config?.authentication?.options?.userName,
91
+ [attributes.DB_USER]: this.config?.userName ?? this.config?.authentication?.options?.userName,
91
92
  // eslint-disable-next-line typescript/no-deprecated
92
- [semconv.ATTR_DB_STATEMENT]: sql,
93
+ [attributes.DB_STATEMENT]: sql,
93
94
  // eslint-disable-next-line typescript/no-deprecated
94
95
  [semconv.ATTR_DB_SQL_TABLE]: request.table,
95
96
  // eslint-disable-next-line typescript/no-deprecated
96
- [semconv.ATTR_NET_PEER_NAME]: this.config?.server,
97
+ [attributes.NET_PEER_NAME]: this.config?.server,
97
98
  // eslint-disable-next-line typescript/no-deprecated
98
- [semconv.ATTR_NET_PEER_PORT]: this.config?.options?.port
99
+ [attributes.NET_PEER_PORT]: this.config?.options?.port
99
100
  };
100
101
  const span = core.startInactiveSpan({
101
102
  name: utils.getSpanName(operation, databaseName, sql, request.table),
102
103
  kind: core.SPAN_KIND.CLIENT,
103
- attributes
104
+ attributes: attributes$1
104
105
  });
105
106
  const endSpan = utils.once((err) => {
106
107
  request.removeListener("done", incrementStatementCount);
@@ -1 +1 @@
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 { 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 type { SpanAttributes } from '@sentry/core';\nimport {\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\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: SpanAttributes = {\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: SPAN_KIND.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","SPAN_KIND","once","SPAN_STATUS_ERROR","withActiveSpan"],"mappings":";;;;;;;;AAoCA,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;AA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X,CAAA;AAED,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
+ {"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 { EventEmitter } from 'events';\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\nimport { InstrumentationBase, InstrumentationNodeModuleDefinition, isWrapped } from '@opentelemetry/instrumentation';\nimport {\n DB_NAME,\n DB_STATEMENT,\n DB_SYSTEM,\n DB_USER,\n NET_PEER_NAME,\n NET_PEER_PORT,\n} from '@sentry/conventions/attributes';\nimport { DB_SYSTEM_VALUE_MSSQL, ATTR_DB_SQL_TABLE } from './semconv';\nimport type * as tedious from './tedious-types';\nimport { getSpanName, once } from './utils';\nimport type { SpanAttributes } from '@sentry/core';\nimport {\n SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_KIND,\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: SpanAttributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.db.otel.tedious',\n // eslint-disable-next-line typescript/no-deprecated\n [DB_SYSTEM]: DB_SYSTEM_VALUE_MSSQL,\n // eslint-disable-next-line typescript/no-deprecated\n [DB_NAME]: databaseName,\n // >=4 uses `authentication` object; older versions just userName and password pair\n // eslint-disable-next-line typescript/no-deprecated\n [DB_USER]: this.config?.userName ?? this.config?.authentication?.options?.userName,\n // eslint-disable-next-line typescript/no-deprecated\n [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 [NET_PEER_NAME]: this.config?.server,\n // eslint-disable-next-line typescript/no-deprecated\n [NET_PEER_PORT]: this.config?.options?.port,\n };\n const span = startInactiveSpan({\n name: getSpanName(operation, databaseName, sql, request.table),\n kind: SPAN_KIND.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","attributes","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","DB_SYSTEM","DB_SYSTEM_VALUE_MSSQL","DB_NAME","DB_USER","DB_STATEMENT","ATTR_DB_SQL_TABLE","NET_PEER_NAME","NET_PEER_PORT","startInactiveSpan","getSpanName","SPAN_KIND","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,c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6B,CAAC,CAAA;AAAA,MAC7F;AAEA,MAAA,MAAA,CAAO,cAAA,CAAe,eAAe,QAAA,EAAU;AAAA,QAC7C,OAAO,cAAA,CAAe,MAAA;AAAA,QACtB,QAAA,EAAU;AAAA,OACX,CAAA;AAED,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,20 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- const ATTR_DB_NAME = "db.name";
4
3
  const ATTR_DB_SQL_TABLE = "db.sql.table";
5
- const ATTR_DB_STATEMENT = "db.statement";
6
- const ATTR_DB_SYSTEM = "db.system";
7
- const ATTR_DB_USER = "db.user";
8
- const ATTR_NET_PEER_NAME = "net.peer.name";
9
- const ATTR_NET_PEER_PORT = "net.peer.port";
10
4
  const DB_SYSTEM_VALUE_MSSQL = "mssql";
11
5
 
12
- exports.ATTR_DB_NAME = ATTR_DB_NAME;
13
6
  exports.ATTR_DB_SQL_TABLE = ATTR_DB_SQL_TABLE;
14
- exports.ATTR_DB_STATEMENT = ATTR_DB_STATEMENT;
15
- exports.ATTR_DB_SYSTEM = ATTR_DB_SYSTEM;
16
- exports.ATTR_DB_USER = ATTR_DB_USER;
17
- exports.ATTR_NET_PEER_NAME = ATTR_NET_PEER_NAME;
18
- exports.ATTR_NET_PEER_PORT = ATTR_NET_PEER_PORT;
19
7
  exports.DB_SYSTEM_VALUE_MSSQL = DB_SYSTEM_VALUE_MSSQL;
20
8
  //# sourceMappingURL=semconv.js.map
@@ -1 +1 @@
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
+ {"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.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 * Enum value \"mssql\" for attribute `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":";;AAwBO,MAAM,iBAAA,GAAoB;AAS1B,MAAM,qBAAA,GAAwB;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../src/integrations/tracing/vercelai/constants.ts"],"sourcesContent":["export const INTEGRATION_NAME = 'VercelAI';\n"],"names":[],"mappings":";;AAAO,MAAM,gBAAA,GAAmB;;;;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../src/integrations/tracing/vercelai/constants.ts"],"sourcesContent":["export const INTEGRATION_NAME = 'VercelAI' as const;\n"],"names":[],"mappings":";;AAAO,MAAM,gBAAA,GAAmB;;;;"}
@@ -14,12 +14,10 @@ function shouldForceIntegration(client) {
14
14
  const _vercelAIIntegration = ((options = {}) => {
15
15
  let instrumentation;
16
16
  const parentIntegration = serverUtils.vercelAiIntegration(options);
17
- return {
18
- name: constants.INTEGRATION_NAME,
17
+ return core.extendIntegration(parentIntegration, {
19
18
  options,
20
19
  setupOnce() {
21
20
  instrumentation = instrumentVercelAi();
22
- parentIntegration.setupOnce?.();
23
21
  },
24
22
  afterAllSetup(client) {
25
23
  const shouldForce = options.force ?? shouldForceIntegration(client);
@@ -29,7 +27,7 @@ const _vercelAIIntegration = ((options = {}) => {
29
27
  instrumentation?.callWhenPatched(() => core.addVercelAiProcessors(client));
30
28
  }
31
29
  }
32
- };
30
+ });
33
31
  });
34
32
  const vercelAIIntegration = core.defineIntegration(_vercelAIIntegration);
35
33
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/vercelai/index.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core';\nimport { addVercelAiProcessors, defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce, type modulesIntegration } from '@sentry/node-core';\nimport { vercelAiIntegration as serverUtilsVercelAiIntegration } from '@sentry/server-utils';\nimport { INTEGRATION_NAME } from './constants';\nimport { SentryVercelAiInstrumentation } from './instrumentation';\nimport type { VercelAiOptions } from './types';\n\nexport const instrumentVercelAi = generateInstrumentOnce(INTEGRATION_NAME, () => new SentryVercelAiInstrumentation({}));\n\n/**\n * Determines if the integration should be forced based on environment and package availability.\n * Returns true if the 'ai' package is available.\n */\nfunction shouldForceIntegration(client: Client): boolean {\n const modules = client.getIntegrationByName<ReturnType<typeof modulesIntegration>>('Modules');\n return !!modules?.getModules?.()?.ai;\n}\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n let instrumentation: undefined | SentryVercelAiInstrumentation;\n\n const parentIntegration = serverUtilsVercelAiIntegration(options);\n\n return {\n name: INTEGRATION_NAME,\n options,\n setupOnce() {\n instrumentation = instrumentVercelAi();\n parentIntegration.setupOnce?.();\n },\n afterAllSetup(client) {\n // Auto-detect if we should force the integration when running with 'ai' package available\n // Note that this can only be detected if the 'Modules' integration is available, and running in CJS mode\n const shouldForce = options.force ?? shouldForceIntegration(client);\n\n if (shouldForce) {\n addVercelAiProcessors(client);\n } else {\n instrumentation?.callWhenPatched(() => addVercelAiProcessors(client));\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.vercelAIIntegration()],\n * });\n * ```\n *\n * This integration adds tracing support to all `ai` function calls.\n * You need to opt-in to collecting spans for a specific call,\n * you can do so by setting `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":["generateInstrumentOnce","INTEGRATION_NAME","SentryVercelAiInstrumentation","serverUtilsVercelAiIntegration","addVercelAiProcessors","defineIntegration"],"mappings":";;;;;;;;AAQO,MAAM,kBAAA,GAAqBA,gCAAuBC,0BAAA,EAAkB,MAAM,IAAIC,6CAAA,CAA8B,EAAE,CAAC;AAMtH,SAAS,uBAAuB,MAAA,EAAyB;AACvD,EAAA,MAAM,OAAA,GAAU,MAAA,CAAO,oBAAA,CAA4D,SAAS,CAAA;AAC5F,EAAA,OAAO,CAAC,CAAC,OAAA,EAAS,UAAA,IAAa,EAAG,EAAA;AACpC;AAEA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,IAAI,eAAA;AAEJ,EAAA,MAAM,iBAAA,GAAoBC,gCAA+B,OAAO,CAAA;AAEhE,EAAA,OAAO;AAAA,IACL,IAAA,EAAMF,0BAAA;AAAA,IACN,OAAA;AAAA,IACA,SAAA,GAAY;AACV,MAAA,eAAA,GAAkB,kBAAA,EAAmB;AACrC,MAAA,iBAAA,CAAkB,SAAA,IAAY;AAAA,IAChC,CAAA;AAAA,IACA,cAAc,MAAA,EAAQ;AAGpB,MAAA,MAAM,WAAA,GAAc,OAAA,CAAQ,KAAA,IAAS,sBAAA,CAAuB,MAAM,CAAA;AAElE,MAAA,IAAI,WAAA,EAAa;AACf,QAAAG,0BAAA,CAAsB,MAAM,CAAA;AAAA,MAC9B,CAAA,MAAO;AACL,QAAA,eAAA,EAAiB,eAAA,CAAgB,MAAMA,0BAAA,CAAsB,MAAM,CAAC,CAAA;AAAA,MACtE;AAAA,IACF;AAAA,GACF;AACF,CAAA,CAAA;AAqCO,MAAM,mBAAA,GAAsBC,uBAAkB,oBAAoB;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/vercelai/index.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core';\nimport { addVercelAiProcessors, defineIntegration, extendIntegration } from '@sentry/core';\nimport { generateInstrumentOnce, type modulesIntegration } from '@sentry/node-core';\nimport { vercelAiIntegration as serverUtilsVercelAiIntegration } from '@sentry/server-utils';\nimport { INTEGRATION_NAME } from './constants';\nimport { SentryVercelAiInstrumentation } from './instrumentation';\nimport type { VercelAiOptions } from './types';\n\nexport const instrumentVercelAi = generateInstrumentOnce(INTEGRATION_NAME, () => new SentryVercelAiInstrumentation({}));\n\n/**\n * Determines if the integration should be forced based on environment and package availability.\n * Returns true if the 'ai' package is available.\n */\nfunction shouldForceIntegration(client: Client): boolean {\n const modules = client.getIntegrationByName<ReturnType<typeof modulesIntegration>>('Modules');\n return !!modules?.getModules?.()?.ai;\n}\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n let instrumentation: undefined | SentryVercelAiInstrumentation;\n\n const parentIntegration = serverUtilsVercelAiIntegration(options);\n\n return extendIntegration(parentIntegration, {\n options,\n setupOnce() {\n instrumentation = instrumentVercelAi();\n },\n afterAllSetup(client) {\n // Auto-detect if we should force the integration when running with 'ai' package available\n // Note that this can only be detected if the 'Modules' integration is available, and running in CJS mode\n const shouldForce = options.force ?? shouldForceIntegration(client);\n\n if (shouldForce) {\n addVercelAiProcessors(client);\n } else {\n instrumentation?.callWhenPatched(() => addVercelAiProcessors(client));\n }\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.vercelAIIntegration()],\n * });\n * ```\n *\n * This integration adds tracing support to all `ai` function calls.\n * You need to opt-in to collecting spans for a specific call,\n * you can do so by setting `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":["generateInstrumentOnce","INTEGRATION_NAME","SentryVercelAiInstrumentation","serverUtilsVercelAiIntegration","extendIntegration","addVercelAiProcessors","defineIntegration"],"mappings":";;;;;;;;AAQO,MAAM,kBAAA,GAAqBA,gCAAuBC,0BAAA,EAAkB,MAAM,IAAIC,6CAAA,CAA8B,EAAE,CAAC;AAMtH,SAAS,uBAAuB,MAAA,EAAyB;AACvD,EAAA,MAAM,OAAA,GAAU,MAAA,CAAO,oBAAA,CAA4D,SAAS,CAAA;AAC5F,EAAA,OAAO,CAAC,CAAC,OAAA,EAAS,UAAA,IAAa,EAAG,EAAA;AACpC;AAEA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,IAAI,eAAA;AAEJ,EAAA,MAAM,iBAAA,GAAoBC,gCAA+B,OAAO,CAAA;AAEhE,EAAA,OAAOC,uBAAkB,iBAAA,EAAmB;AAAA,IAC1C,OAAA;AAAA,IACA,SAAA,GAAY;AACV,MAAA,eAAA,GAAkB,kBAAA,EAAmB;AAAA,IACvC,CAAA;AAAA,IACA,cAAc,MAAA,EAAQ;AAGpB,MAAA,MAAM,WAAA,GAAc,OAAA,CAAQ,KAAA,IAAS,sBAAA,CAAuB,MAAM,CAAA;AAElE,MAAA,IAAI,WAAA,EAAa;AACf,QAAAC,0BAAA,CAAsB,MAAM,CAAA;AAAA,MAC9B,CAAA,MAAO;AACL,QAAA,eAAA,EAAiB,eAAA,CAAgB,MAAMA,0BAAA,CAAsB,MAAM,CAAC,CAAA;AAAA,MACtE;AAAA,IACF;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAqCO,MAAM,mBAAA,GAAsBC,uBAAkB,oBAAoB;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagnosticsChannelInjection.js","sources":["../../../src/sdk/diagnosticsChannelInjection.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\n\n/**\n * The orchestrion-driven pieces, resolved lazily by the opt-in loader.\n *\n * IMPORTANT: this module (and everything `init()` imports) must NOT reference\n * the orchestrion code (`@sentry/server-utils/orchestrion/*`). The only\n * reference lives inside `experimentalUseDiagnosticsChannelInjection()` (a\n * separate module, reachable solely through that public export). That's the\n * tree-shaking boundary: if an app never calls the opt-in function, then a\n * bundler drops the entire orchestrion subtree, including its transitive\n * dependencies, while an app that does call it gets it bundled\n * normally.\n */\nexport interface DiagnosticsChannelInjection {\n /** Channel-based integrations to register, replacing their OTel equivalents. */\n integrations: Integration[];\n /** OTel integration names these replace; filtered out of the default set. */\n replacedOtelIntegrationNames: string[];\n /** Installs the module hooks that inject the diagnostics channels. */\n register: () => void;\n /** Warns (DEBUG only) about missing or doubled channel injection. */\n detect: () => void;\n}\n\nlet loader: (() => DiagnosticsChannelInjection) | undefined;\nlet cached: DiagnosticsChannelInjection | undefined;\n\n/**\n * Set by `experimentalUseDiagnosticsChannelInjection()`. The loader\n * is the only thing that pulls in the orchestrion modules; see\n * {@link DiagnosticsChannelInjection) re tree-shaking concerns this addresses.\n *\n * @internal\n */\nexport function setDiagnosticsChannelInjectionLoader(load: () => DiagnosticsChannelInjection): void {\n loader = load;\n}\n\n/** Whether `experimentalUseDiagnosticsChannelInjection()` was called. */\nexport function isDiagnosticsChannelInjectionEnabled(): boolean {\n return !!loader;\n}\n\n/**\n * Resolve and memoize the orchestrion pieces. This is what actually loads\n * the orchestrion modules. Returns `undefined` if the app never opted in.\n * Callers gate this on span recording, so the modules load only when both\n * opted in and tracing is enabled.\n */\nexport function resolveDiagnosticsChannelInjection(): DiagnosticsChannelInjection | undefined {\n if (!loader) {\n return undefined;\n }\n return (cached ??= loader());\n}\n"],"names":[],"mappings":";;AAyBA,IAAI,MAAA;AACJ,IAAI,MAAA;AASG,SAAS,qCAAqC,IAAA,EAA+C;AAClG,EAAA,MAAA,GAAS,IAAA;AACX;AAGO,SAAS,oCAAA,GAAgD;AAC9D,EAAA,OAAO,CAAC,CAAC,MAAA;AACX;AAQO,SAAS,kCAAA,GAA8E;AAC5F,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAQ,oBAAW,MAAA,EAAO,CAAA;AAC5B;;;;;;"}
1
+ {"version":3,"file":"diagnosticsChannelInjection.js","sources":["../../../src/sdk/diagnosticsChannelInjection.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\n\n/**\n * The orchestrion-driven pieces, resolved lazily by the opt-in loader.\n *\n * IMPORTANT: this module (and everything `init()` imports) must NOT reference\n * the orchestrion code (`@sentry/server-utils/orchestrion/*`). The only\n * reference lives inside `experimentalUseDiagnosticsChannelInjection()` (a\n * separate module, reachable solely through that public export). That's the\n * tree-shaking boundary: if an app never calls the opt-in function, then a\n * bundler drops the entire orchestrion subtree, including its transitive\n * dependencies, while an app that does call it gets it bundled\n * normally.\n */\nexport interface DiagnosticsChannelInjection {\n /** Channel-based integrations to register, replacing their OTel equivalents. */\n integrations: Integration[] | readonly Integration[];\n /** OTel integration names these replace; filtered out of the default set. */\n replacedOtelIntegrationNames: string[];\n /** Installs the module hooks that inject the diagnostics channels. */\n register: () => void;\n /** Warns (DEBUG only) about missing or doubled channel injection. */\n detect: () => void;\n}\n\nlet loader: (() => DiagnosticsChannelInjection) | undefined;\nlet cached: DiagnosticsChannelInjection | undefined;\n\n/**\n * Set by `experimentalUseDiagnosticsChannelInjection()`. The loader\n * is the only thing that pulls in the orchestrion modules; see\n * {@link DiagnosticsChannelInjection) re tree-shaking concerns this addresses.\n *\n * @internal\n */\nexport function setDiagnosticsChannelInjectionLoader(load: () => DiagnosticsChannelInjection): void {\n loader = load;\n}\n\n/** Whether `experimentalUseDiagnosticsChannelInjection()` was called. */\nexport function isDiagnosticsChannelInjectionEnabled(): boolean {\n return !!loader;\n}\n\n/**\n * Resolve and memoize the orchestrion pieces. This is what actually loads\n * the orchestrion modules. Returns `undefined` if the app never opted in.\n * Callers gate this on span recording, so the modules load only when both\n * opted in and tracing is enabled.\n */\nexport function resolveDiagnosticsChannelInjection(): DiagnosticsChannelInjection | undefined {\n if (!loader) {\n return undefined;\n }\n return (cached ??= loader());\n}\n"],"names":[],"mappings":";;AAyBA,IAAI,MAAA;AACJ,IAAI,MAAA;AASG,SAAS,qCAAqC,IAAA,EAA+C;AAClG,EAAA,MAAA,GAAS,IAAA;AACX;AAGO,SAAS,oCAAA,GAAgD;AAC9D,EAAA,OAAO,CAAC,CAAC,MAAA;AACX;AAQO,SAAS,kCAAA,GAA8E;AAC5F,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAQ,oBAAW,MAAA,EAAO,CAAA;AAC5B;;;;;;"}
@@ -2,18 +2,30 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const orchestrion = require('@sentry/server-utils/orchestrion');
4
4
  const register = require('@sentry/server-utils/orchestrion/register');
5
+ const cache = require('../integrations/tracing/redis/cache.js');
5
6
  const diagnosticsChannelInjection = require('./diagnosticsChannelInjection.js');
6
7
 
8
+ function diagnosticsChannelInjectionIntegrations() {
9
+ return orchestrion.channelIntegrations;
10
+ }
7
11
  function experimentalUseDiagnosticsChannelInjection() {
8
- diagnosticsChannelInjection.setDiagnosticsChannelInjectionLoader(
9
- () => ({
10
- integrations: [orchestrion.mysqlChannelIntegration()],
11
- replacedOtelIntegrationNames: ["Mysql"],
12
+ diagnosticsChannelInjection.setDiagnosticsChannelInjectionLoader(() => {
13
+ const integrations = Object.values(orchestrion.channelIntegrations).map((createIntegration) => createIntegration());
14
+ const replacedOtelIntegrationNames = integrations.map((i) => i.name);
15
+ return {
16
+ // ioredis is wired here rather than in the shared `channelIntegrations` registry: it needs
17
+ // the node redis cache `responseHook`, and it only partially replaces the composite OTel
18
+ // `Redis` integration (which also covers node-redis and ioredis >=5.11 native diagnostics_channel).
19
+ // So it's added to the integration set but kept OUT of `replacedOtelIntegrationNames` — `Redis`
20
+ // must stay; its ioredis <5.11 monkey-patch is gated off in `redisIntegration` instead.
21
+ integrations: [...integrations, orchestrion.ioredisChannelIntegration({ responseHook: cache.cacheResponseHook })],
22
+ replacedOtelIntegrationNames,
12
23
  register: register.registerDiagnosticsChannelInjection,
13
24
  detect: orchestrion.detectOrchestrionSetup
14
- })
15
- );
25
+ };
26
+ });
16
27
  }
17
28
 
29
+ exports.diagnosticsChannelInjectionIntegrations = diagnosticsChannelInjectionIntegrations;
18
30
  exports.experimentalUseDiagnosticsChannelInjection = experimentalUseDiagnosticsChannelInjection;
19
31
  //# sourceMappingURL=experimentalUseDiagnosticsChannelInjection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.js","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"sourcesContent":["import { mysqlChannelIntegration, detectOrchestrionSetup } from '@sentry/server-utils/orchestrion';\nimport { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';\nimport type { DiagnosticsChannelInjection } from './diagnosticsChannelInjection';\nimport { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInjection';\n\n/**\n * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.\n *\n * Call this BEFORE `Sentry.init()`:\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.experimentalUseDiagnosticsChannelInjection();\n * Sentry.init({\n * dsn: '__DSN__',\n * // other settings...\n * });\n * ```\n *\n * When this has been called AND span recording is enabled, `Sentry.init()`\n * uses the diagnostics-channel-injection-based integrations instead of the\n * OpenTelemetry ones, and installs the module hooks that inject the channels\n * (so libraries imported after `init()` publish the channel events).\n *\n * This is a standalone function rather than an `init()` option so that a\n * bundler drops all of it (and its transitive deps) when this function isn't\n * called. `init()` reads the loader registered below.\n *\n * An app that DOES call it gets the orchestrion code bundled as intended.\n *\n * In an unbundled (server-side runtime) app this eagerly loads only the small\n * subscriber/channel modules; the heavy code-transform dependencies stay lazy\n * inside `register()` and load only when injection actually runs.\n *\n * @experimental May change or be removed in any release.\n */\nexport function experimentalUseDiagnosticsChannelInjection(): void {\n setDiagnosticsChannelInjectionLoader(\n (): DiagnosticsChannelInjection => ({\n integrations: [mysqlChannelIntegration()],\n replacedOtelIntegrationNames: ['Mysql'],\n register: registerDiagnosticsChannelInjection,\n detect: detectOrchestrionSetup,\n }),\n );\n}\n"],"names":["setDiagnosticsChannelInjectionLoader","mysqlChannelIntegration","registerDiagnosticsChannelInjection","detectOrchestrionSetup"],"mappings":";;;;;;AAqCO,SAAS,0CAAA,GAAmD;AACjE,EAAAA,gEAAA;AAAA,IACE,OAAoC;AAAA,MAClC,YAAA,EAAc,CAACC,mCAAA,EAAyB,CAAA;AAAA,MACxC,4BAAA,EAA8B,CAAC,OAAO,CAAA;AAAA,MACtC,QAAA,EAAUC,4CAAA;AAAA,MACV,MAAA,EAAQC;AAAA,KACV;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.js","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"sourcesContent":["import {\n channelIntegrations,\n ioredisChannelIntegration,\n detectOrchestrionSetup,\n} from '@sentry/server-utils/orchestrion';\nimport { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';\nimport { cacheResponseHook } from '../integrations/tracing/redis/cache';\nimport type { DiagnosticsChannelInjection } from './diagnosticsChannelInjection';\nimport { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInjection';\n\nexport function diagnosticsChannelInjectionIntegrations(): typeof channelIntegrations {\n return channelIntegrations;\n}\n\n/**\n * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.\n *\n * Call this BEFORE `Sentry.init()`:\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.experimentalUseDiagnosticsChannelInjection();\n * Sentry.init({\n * dsn: '__DSN__',\n * // other settings...\n * });\n * ```\n *\n * When this has been called AND span recording is enabled, `Sentry.init()`\n * uses the diagnostics-channel-injection-based integrations instead of the\n * OpenTelemetry ones, and installs the module hooks that inject the channels\n * (so libraries imported after `init()` publish the channel events).\n *\n * This is a standalone function rather than an `init()` option so that a\n * bundler drops all of it (and its transitive deps) when this function isn't\n * called. `init()` reads the loader registered below.\n *\n * An app that DOES call it gets the orchestrion code bundled as intended.\n *\n * In an unbundled (server-side runtime) app this eagerly loads only the small\n * subscriber/channel modules; the heavy code-transform dependencies stay lazy\n * inside `register()` and load only when injection actually runs.\n *\n * @experimental May change or be removed in any release.\n */\nexport function experimentalUseDiagnosticsChannelInjection(): void {\n setDiagnosticsChannelInjectionLoader((): DiagnosticsChannelInjection => {\n // The registry integrations 1:1 replace the OTel integration of the same name.\n const integrations = Object.values(channelIntegrations).map(createIntegration => createIntegration());\n const replacedOtelIntegrationNames = integrations.map(i => i.name);\n\n return {\n // ioredis is wired here rather than in the shared `channelIntegrations` registry: it needs\n // the node redis cache `responseHook`, and it only partially replaces the composite OTel\n // `Redis` integration (which also covers node-redis and ioredis >=5.11 native diagnostics_channel).\n // So it's added to the integration set but kept OUT of `replacedOtelIntegrationNames` — `Redis`\n // must stay; its ioredis <5.11 monkey-patch is gated off in `redisIntegration` instead.\n integrations: [...integrations, ioredisChannelIntegration({ responseHook: cacheResponseHook })],\n replacedOtelIntegrationNames,\n register: registerDiagnosticsChannelInjection,\n detect: detectOrchestrionSetup,\n };\n });\n}\n"],"names":["channelIntegrations","setDiagnosticsChannelInjectionLoader","ioredisChannelIntegration","cacheResponseHook","registerDiagnosticsChannelInjection","detectOrchestrionSetup"],"mappings":";;;;;;;AAUO,SAAS,uCAAA,GAAsE;AACpF,EAAA,OAAOA,+BAAA;AACT;AAkCO,SAAS,0CAAA,GAAmD;AACjE,EAAAC,gEAAA,CAAqC,MAAmC;AAEtE,IAAA,MAAM,YAAA,GAAe,OAAO,MAAA,CAAOD,+BAAmB,EAAE,GAAA,CAAI,CAAA,iBAAA,KAAqB,mBAAmB,CAAA;AACpG,IAAA,MAAM,4BAAA,GAA+B,YAAA,CAAa,GAAA,CAAI,CAAA,CAAA,KAAK,EAAE,IAAI,CAAA;AAEjE,IAAA,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAML,YAAA,EAAc,CAAC,GAAG,YAAA,EAAcE,sCAA0B,EAAE,YAAA,EAAcC,uBAAA,EAAmB,CAAC,CAAA;AAAA,MAC9F,4BAAA;AAAA,MACA,QAAA,EAAUC,4CAAA;AAAA,MACV,MAAA,EAAQC;AAAA,KACV;AAAA,EACF,CAAC,CAAA;AACH;;;;;"}
@@ -3,14 +3,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
3
  const core = require('@sentry/core');
4
4
  const nodeCore = require('@sentry/node-core');
5
5
  const http = require('../integrations/http.js');
6
- const index$1 = require('../integrations/node-fetch/index.js');
6
+ const nodeFetch = require('../integrations/node-fetch.js');
7
7
  const index = require('../integrations/tracing/index.js');
8
8
  const diagnosticsChannelInjection = require('./diagnosticsChannelInjection.js');
9
9
  const initOtel = require('./initOtel.js');
10
10
 
11
11
  function getDefaultIntegrationsWithoutPerformance() {
12
12
  const nodeCoreIntegrations = nodeCore.getDefaultIntegrations();
13
- return nodeCoreIntegrations.filter((integration) => integration.name !== "Http" && integration.name !== "NodeFetch").concat(http.httpIntegration(), index$1.nativeNodeFetchIntegration());
13
+ return nodeCoreIntegrations.filter((integration) => integration.name !== "Http" && integration.name !== "NodeFetch").concat(http.httpIntegration(), nodeFetch.nativeNodeFetchIntegration());
14
14
  }
15
15
  function getDefaultIntegrations(options) {
16
16
  const integrations = [
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/sdk/index.ts"],"sourcesContent":["import type { Integration, Options } from '@sentry/core';\nimport { applySdkMetadata, hasSpansEnabled } from '@sentry/core';\nimport type { NodeClient } from '@sentry/node-core';\nimport {\n getDefaultIntegrations as getNodeCoreDefaultIntegrations,\n init as initNodeCore,\n validateOpenTelemetrySetup,\n} from '@sentry/node-core';\nimport { httpIntegration } from '../integrations/http';\nimport { nativeNodeFetchIntegration } from '../integrations/node-fetch';\nimport { getAutoPerformanceIntegrations } from '../integrations/tracing';\nimport type { NodeOptions } from '../types';\nimport {\n isDiagnosticsChannelInjectionEnabled,\n resolveDiagnosticsChannelInjection,\n} from './diagnosticsChannelInjection';\nimport { initOpenTelemetry } from './initOtel';\n\n/**\n * Get default integrations, excluding performance.\n */\nexport function getDefaultIntegrationsWithoutPerformance(): Integration[] {\n const nodeCoreIntegrations = getNodeCoreDefaultIntegrations();\n\n // Filter out the node-core HTTP and NodeFetch integrations and replace them with Node SDK's composite versions\n return nodeCoreIntegrations\n .filter(integration => integration.name !== 'Http' && integration.name !== 'NodeFetch')\n .concat(httpIntegration(), nativeNodeFetchIntegration());\n}\n\n/** Get the default integrations for the Node SDK. */\nexport function getDefaultIntegrations(options: Options): Integration[] {\n const integrations: Integration[] = [\n ...getDefaultIntegrationsWithoutPerformance(),\n // We only add performance integrations if tracing is enabled\n // Note that this means that without tracing enabled, e.g. `expressIntegration()` will not be added\n // This means that generally request isolation will work (because that is done by httpIntegration)\n // But `transactionName` will not be set automatically\n ...(hasSpansEnabled(options) ? getAutoPerformanceIntegrations() : []),\n ];\n\n // When the app opted into diagnostics-channel injection (via\n // `experimentalUseDiagnosticsChannelInjection()`) AND span recording is\n // enabled, swap the channel-based integrations in place of OTel equivalents\n // so the two don't both instrument the same library.\n //\n // Every channel-based integration we ship today is a 1:1 replacement for an\n // OTel performance/tracing integration and produces nothing but spans (those\n // only come from `getAutoPerformanceIntegrations()` above), so it's gated on\n // span recording.\n if (isDiagnosticsChannelInjectionEnabled() && hasSpansEnabled(options)) {\n const diagnosticsChannelInjection = resolveDiagnosticsChannelInjection();\n if (diagnosticsChannelInjection) {\n const replaced = new Set(diagnosticsChannelInjection.replacedOtelIntegrationNames);\n return [...integrations.filter(i => !replaced.has(i.name)), ...diagnosticsChannelInjection.integrations];\n }\n }\n return integrations;\n}\n\n/**\n * Initialize Sentry for Node.\n */\nexport function init(options: NodeOptions | undefined = {}): NodeClient | undefined {\n return _init(options, getDefaultIntegrations);\n}\n\n/**\n * Internal initialization function.\n */\nfunction _init(\n options: NodeOptions | undefined = {},\n getDefaultIntegrationsImpl: (options: Options) => Integration[],\n): NodeClient | undefined {\n applySdkMetadata(options, 'node');\n\n // EXPERIMENTAL: diagnostics-channel injection, opted into via\n // `experimentalUseDiagnosticsChannelInjection()`. Gated on span recording to\n // match the OTel integrations it replaces. With tracing off there are no\n // channel subscribers, so injecting is pointless work. `resolve...()` is\n // memoized, so `getDefaultIntegrations()` (below) sees the same instance.\n const diagnosticsChannelInjection =\n isDiagnosticsChannelInjectionEnabled() && hasSpansEnabled(options)\n ? resolveDiagnosticsChannelInjection()\n : undefined;\n\n // Install the channel-injection hooks as early as possible, before the app\n // imports its instrumented modules.\n if (diagnosticsChannelInjection) {\n diagnosticsChannelInjection.register();\n }\n\n const client = initNodeCore({\n ...options,\n // Only use Node SDK defaults if none provided\n defaultIntegrations: options.defaultIntegrations ?? getDefaultIntegrationsImpl(options),\n });\n\n // Add Node SDK specific OpenTelemetry setup\n if (client && !options.skipOpenTelemetrySetup) {\n initOpenTelemetry(client, {\n spanProcessors: options.openTelemetrySpanProcessors,\n });\n validateOpenTelemetrySetup();\n }\n\n // Warn about missing or doubled channel injection. Runs after the client\n // is created so the debug logger is enabled and the warning is emitted.\n if (diagnosticsChannelInjection) {\n diagnosticsChannelInjection.detect();\n }\n\n return client;\n}\n\n/**\n * Initialize Sentry for Node, without any integrations added by default.\n */\nexport function initWithoutDefaultIntegrations(options: NodeOptions | undefined = {}): NodeClient | undefined {\n return _init(options, () => []);\n}\n"],"names":["getNodeCoreDefaultIntegrations","httpIntegration","nativeNodeFetchIntegration","hasSpansEnabled","getAutoPerformanceIntegrations","isDiagnosticsChannelInjectionEnabled","diagnosticsChannelInjection","resolveDiagnosticsChannelInjection","applySdkMetadata","initNodeCore","initOpenTelemetry","validateOpenTelemetrySetup"],"mappings":";;;;;;;;;;AAqBO,SAAS,wCAAA,GAA0D;AACxE,EAAA,MAAM,uBAAuBA,+BAAA,EAA+B;AAG5D,EAAA,OAAO,oBAAA,CACJ,MAAA,CAAO,CAAA,WAAA,KAAe,WAAA,CAAY,SAAS,MAAA,IAAU,WAAA,CAAY,IAAA,KAAS,WAAW,CAAA,CACrF,MAAA,CAAOC,oBAAA,EAAgB,EAAGC,oCAA4B,CAAA;AAC3D;AAGO,SAAS,uBAAuB,OAAA,EAAiC;AACtE,EAAA,MAAM,YAAA,GAA8B;AAAA,IAClC,GAAG,wCAAA,EAAyC;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AQ;AAAA,KACzB,CAAA;AACD,IAAAC,mCAAA,EAA2B;AAAA,EAC7B;AAIA,EAAA,IAAIL,6BAAA,EAA6B;AAC/B,IAAAA,6BAAA,CAA4B,MAAA,EAAO;AAAA,EACrC;AAEA,EAAA,OAAO,MAAA;AACT;AAKO,SAAS,8BAAA,CAA+B,OAAA,GAAmC,EAAC,EAA2B;AAC5G,EAAA,OAAO,KAAA,CAAM,OAAA,EAAS,MAAM,EAAE,CAAA;AAChC;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/sdk/index.ts"],"sourcesContent":["import type { Integration, Options } from '@sentry/core';\nimport { applySdkMetadata, hasSpansEnabled } from '@sentry/core';\nimport type { NodeClient } from '@sentry/node-core';\nimport {\n getDefaultIntegrations as getNodeCoreDefaultIntegrations,\n init as initNodeCore,\n validateOpenTelemetrySetup,\n} from '@sentry/node-core';\nimport { httpIntegration } from '../integrations/http';\nimport { nativeNodeFetchIntegration } from '../integrations/node-fetch';\nimport { getAutoPerformanceIntegrations } from '../integrations/tracing';\nimport type { NodeOptions } from '../types';\nimport {\n isDiagnosticsChannelInjectionEnabled,\n resolveDiagnosticsChannelInjection,\n} from './diagnosticsChannelInjection';\nimport { initOpenTelemetry } from './initOtel';\n\n/**\n * Get default integrations, excluding performance.\n */\nexport function getDefaultIntegrationsWithoutPerformance(): Integration[] {\n const nodeCoreIntegrations = getNodeCoreDefaultIntegrations();\n\n // Filter out the node-core HTTP and NodeFetch integrations and replace them with Node SDK's composite versions\n return nodeCoreIntegrations\n .filter(integration => integration.name !== 'Http' && integration.name !== 'NodeFetch')\n .concat(httpIntegration(), nativeNodeFetchIntegration());\n}\n\n/** Get the default integrations for the Node SDK. */\nexport function getDefaultIntegrations(options: Options): Integration[] {\n const integrations: Integration[] = [\n ...getDefaultIntegrationsWithoutPerformance(),\n // We only add performance integrations if tracing is enabled\n // Note that this means that without tracing enabled, e.g. `expressIntegration()` will not be added\n // This means that generally request isolation will work (because that is done by httpIntegration)\n // But `transactionName` will not be set automatically\n ...(hasSpansEnabled(options) ? getAutoPerformanceIntegrations() : []),\n ];\n\n // When the app opted into diagnostics-channel injection (via\n // `experimentalUseDiagnosticsChannelInjection()`) AND span recording is\n // enabled, swap the channel-based integrations in place of OTel equivalents\n // so the two don't both instrument the same library.\n //\n // Every channel-based integration we ship today is a 1:1 replacement for an\n // OTel performance/tracing integration and produces nothing but spans (those\n // only come from `getAutoPerformanceIntegrations()` above), so it's gated on\n // span recording.\n if (isDiagnosticsChannelInjectionEnabled() && hasSpansEnabled(options)) {\n const diagnosticsChannelInjection = resolveDiagnosticsChannelInjection();\n if (diagnosticsChannelInjection) {\n const replaced = new Set(diagnosticsChannelInjection.replacedOtelIntegrationNames);\n return [...integrations.filter(i => !replaced.has(i.name)), ...diagnosticsChannelInjection.integrations];\n }\n }\n return integrations;\n}\n\n/**\n * Initialize Sentry for Node.\n */\nexport function init(options: NodeOptions | undefined = {}): NodeClient | undefined {\n return _init(options, getDefaultIntegrations);\n}\n\n/**\n * Internal initialization function.\n */\nfunction _init(\n options: NodeOptions | undefined = {},\n getDefaultIntegrationsImpl: (options: Options) => Integration[],\n): NodeClient | undefined {\n applySdkMetadata(options, 'node');\n\n // EXPERIMENTAL: diagnostics-channel injection, opted into via\n // `experimentalUseDiagnosticsChannelInjection()`. Gated on span recording to\n // match the OTel integrations it replaces. With tracing off there are no\n // channel subscribers, so injecting is pointless work. `resolve...()` is\n // memoized, so `getDefaultIntegrations()` (below) sees the same instance.\n const diagnosticsChannelInjection =\n isDiagnosticsChannelInjectionEnabled() && hasSpansEnabled(options)\n ? resolveDiagnosticsChannelInjection()\n : undefined;\n\n // Install the channel-injection hooks as early as possible, before the app\n // imports its instrumented modules.\n if (diagnosticsChannelInjection) {\n diagnosticsChannelInjection.register();\n }\n\n const client = initNodeCore({\n ...options,\n // Only use Node SDK defaults if none provided\n defaultIntegrations: options.defaultIntegrations ?? getDefaultIntegrationsImpl(options),\n });\n\n // Add Node SDK specific OpenTelemetry setup\n if (client && !options.skipOpenTelemetrySetup) {\n initOpenTelemetry(client, {\n spanProcessors: options.openTelemetrySpanProcessors,\n });\n validateOpenTelemetrySetup();\n }\n\n // Warn about missing or doubled channel injection. Runs after the client\n // is created so the debug logger is enabled and the warning is emitted.\n if (diagnosticsChannelInjection) {\n diagnosticsChannelInjection.detect();\n }\n\n return client;\n}\n\n/**\n * Initialize Sentry for Node, without any integrations added by default.\n */\nexport function initWithoutDefaultIntegrations(options: NodeOptions | undefined = {}): NodeClient | undefined {\n return _init(options, () => []);\n}\n"],"names":["getNodeCoreDefaultIntegrations","httpIntegration","nativeNodeFetchIntegration","hasSpansEnabled","getAutoPerformanceIntegrations","isDiagnosticsChannelInjectionEnabled","diagnosticsChannelInjection","resolveDiagnosticsChannelInjection","applySdkMetadata","initNodeCore","initOpenTelemetry","validateOpenTelemetrySetup"],"mappings":";;;;;;;;;;AAqBO,SAAS,wCAAA,GAA0D;AACxE,EAAA,MAAM,uBAAuBA,+BAAA,EAA+B;AAG5D,EAAA,OAAO,oBAAA,CACJ,MAAA,CAAO,CAAA,WAAA,KAAe,WAAA,CAAY,SAAS,MAAA,IAAU,WAAA,CAAY,IAAA,KAAS,WAAW,CAAA,CACrF,MAAA,CAAOC,oBAAA,EAAgB,EAAGC,sCAA4B,CAAA;AAC3D;AAGO,SAAS,uBAAuB,OAAA,EAAiC;AACtE,EAAA,MAAM,YAAA,GAA8B;AAAA,IAClC,GAAG,wCAAA,EAAyC;AAAA;AAAA;AAAA;AAAA;AAAA,IAK5C,GAAIC,oBAAA,CAAgB,OAAO,CAAA,GAAIC,oCAAA,KAAmC;AAAC,GACrE;AAWA,EAAA,IAAIC,gEAAA,EAAqC,IAAKF,oBAAA,CAAgB,OAAO,CAAA,EAAG;AACtE,IAAA,MAAMG,gCAA8BC,8DAAA,EAAmC;AACvE,IAAA,IAAID,6BAAA,EAA6B;AAC/B,MAAA,MAAM,QAAA,GAAW,IAAI,GAAA,CAAIA,6BAAA,CAA4B,4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