@sentry/node 10.61.0 → 10.63.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 (385) hide show
  1. package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  2. package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -1
  3. package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -1
  4. package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -1
  5. package/build/cjs/integrations/fs/index.js.map +1 -1
  6. package/build/cjs/integrations/http.js.map +1 -1
  7. package/build/cjs/integrations/node-fetch/index.js +7 -49
  8. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  9. package/build/cjs/integrations/node-fetch/undici-instrumentation.js +266 -0
  10. package/build/cjs/integrations/node-fetch/undici-instrumentation.js.map +1 -0
  11. package/build/cjs/integrations/tracing/amqplib/index.js +2 -10
  12. package/build/cjs/integrations/tracing/amqplib/index.js.map +1 -1
  13. package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js +117 -0
  14. package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js.map +1 -0
  15. package/build/cjs/integrations/tracing/amqplib/vendored/patches.js +185 -0
  16. package/build/cjs/integrations/tracing/amqplib/vendored/patches.js.map +1 -0
  17. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js +21 -1
  18. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  19. package/build/cjs/integrations/tracing/amqplib/vendored/types.js +0 -6
  20. package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  21. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js +71 -80
  22. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  23. package/build/cjs/integrations/tracing/connect/index.js.map +1 -1
  24. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -1
  25. package/build/cjs/integrations/tracing/express.js.map +1 -1
  26. package/build/cjs/integrations/tracing/fastify/index.js +7 -103
  27. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  28. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +2 -3
  29. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  30. package/build/cjs/integrations/tracing/firebase/firebase.js +1 -24
  31. package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -1
  32. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +3 -11
  33. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
  34. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +33 -72
  35. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  36. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js +46 -105
  37. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  38. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -1
  39. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -1
  40. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  41. package/build/cjs/integrations/tracing/hono/index.js.map +1 -1
  42. package/build/cjs/integrations/tracing/index.js +0 -1
  43. package/build/cjs/integrations/tracing/index.js.map +1 -1
  44. package/build/cjs/integrations/tracing/kafka/index.js.map +1 -1
  45. package/build/cjs/integrations/tracing/knex/index.js.map +1 -1
  46. package/build/cjs/integrations/tracing/koa/index.js.map +1 -1
  47. package/build/cjs/integrations/tracing/lrumemoizer/index.js.map +1 -1
  48. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js +4 -2
  49. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  50. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -1
  51. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -1
  52. package/build/cjs/integrations/tracing/mysql/index.js.map +1 -1
  53. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js +34 -128
  54. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  55. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js +0 -2
  56. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  57. package/build/cjs/integrations/tracing/mysql/vendored/utils.js +2 -27
  58. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  59. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -1
  60. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -1
  61. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  62. package/build/cjs/integrations/tracing/prisma/index.js +1 -10
  63. package/build/cjs/integrations/tracing/prisma/index.js.map +1 -1
  64. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js +83 -57
  65. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  66. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  67. package/build/cjs/integrations/tracing/prisma/vendored/global.js +2 -2
  68. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -1
  69. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js +1 -6
  70. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  71. package/build/cjs/integrations/tracing/redis/index.js +5 -3
  72. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  73. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -1
  74. package/build/cjs/integrations/tracing/vercelai/constants.js.map +1 -1
  75. package/build/cjs/integrations/tracing/vercelai/index.js +4 -3
  76. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  77. package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -1
  78. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +8 -6
  79. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
  80. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  81. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -1
  82. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -1
  83. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -1
  84. package/build/esm/integrations/fs/index.js.map +1 -1
  85. package/build/esm/integrations/http.js.map +1 -1
  86. package/build/esm/integrations/node-fetch/index.js +9 -50
  87. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  88. package/build/esm/integrations/node-fetch/undici-instrumentation.js +264 -0
  89. package/build/esm/integrations/node-fetch/undici-instrumentation.js.map +1 -0
  90. package/build/esm/integrations/tracing/amqplib/index.js +3 -11
  91. package/build/esm/integrations/tracing/amqplib/index.js.map +1 -1
  92. package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js +115 -0
  93. package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js.map +1 -0
  94. package/build/esm/integrations/tracing/amqplib/vendored/patches.js +177 -0
  95. package/build/esm/integrations/tracing/amqplib/vendored/patches.js.map +1 -0
  96. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js +12 -2
  97. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -1
  98. package/build/esm/integrations/tracing/amqplib/vendored/types.js +1 -6
  99. package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -1
  100. package/build/esm/integrations/tracing/amqplib/vendored/utils.js +68 -78
  101. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  102. package/build/esm/integrations/tracing/connect/index.js.map +1 -1
  103. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -1
  104. package/build/esm/integrations/tracing/express.js.map +1 -1
  105. package/build/esm/integrations/tracing/fastify/index.js +8 -103
  106. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  107. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +3 -4
  108. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  109. package/build/esm/integrations/tracing/firebase/firebase.js +3 -26
  110. package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -1
  111. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +3 -11
  112. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
  113. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +34 -73
  114. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  115. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +47 -106
  116. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  117. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -1
  118. package/build/esm/integrations/tracing/graphql/index.js.map +1 -1
  119. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  120. package/build/esm/integrations/tracing/hono/index.js.map +1 -1
  121. package/build/esm/integrations/tracing/index.js +1 -2
  122. package/build/esm/integrations/tracing/index.js.map +1 -1
  123. package/build/esm/integrations/tracing/kafka/index.js.map +1 -1
  124. package/build/esm/integrations/tracing/knex/index.js.map +1 -1
  125. package/build/esm/integrations/tracing/koa/index.js.map +1 -1
  126. package/build/esm/integrations/tracing/lrumemoizer/index.js.map +1 -1
  127. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js +5 -3
  128. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  129. package/build/esm/integrations/tracing/mongo/index.js.map +1 -1
  130. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -1
  131. package/build/esm/integrations/tracing/mysql/index.js.map +1 -1
  132. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js +37 -131
  133. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  134. package/build/esm/integrations/tracing/mysql/vendored/semconv.js +1 -2
  135. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  136. package/build/esm/integrations/tracing/mysql/vendored/utils.js +3 -25
  137. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  138. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -1
  139. package/build/esm/integrations/tracing/postgres/index.js.map +1 -1
  140. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  141. package/build/esm/integrations/tracing/prisma/index.js +2 -11
  142. package/build/esm/integrations/tracing/prisma/index.js.map +1 -1
  143. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js +83 -57
  144. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  145. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  146. package/build/esm/integrations/tracing/prisma/vendored/global.js +2 -2
  147. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -1
  148. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js +1 -6
  149. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  150. package/build/esm/integrations/tracing/redis/index.js +7 -5
  151. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  152. package/build/esm/integrations/tracing/tedious/index.js.map +1 -1
  153. package/build/esm/integrations/tracing/vercelai/constants.js.map +1 -1
  154. package/build/esm/integrations/tracing/vercelai/index.js +5 -4
  155. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  156. package/build/esm/package.json +1 -1
  157. package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -1
  158. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +9 -7
  159. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
  160. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
  161. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -1
  162. package/build/types/integrations/featureFlagShims/openFeature.d.ts +3 -1
  163. package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -1
  164. package/build/types/integrations/featureFlagShims/statsig.d.ts +3 -1
  165. package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -1
  166. package/build/types/integrations/featureFlagShims/unleash.d.ts +3 -1
  167. package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -1
  168. package/build/types/integrations/fs/index.d.ts +3 -1
  169. package/build/types/integrations/fs/index.d.ts.map +1 -1
  170. package/build/types/integrations/http.d.ts +3 -1
  171. package/build/types/integrations/http.d.ts.map +1 -1
  172. package/build/types/integrations/node-fetch/index.d.ts +4 -35
  173. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  174. package/build/types/integrations/node-fetch/types.d.ts +96 -0
  175. package/build/types/integrations/node-fetch/types.d.ts.map +1 -0
  176. package/build/types/integrations/node-fetch/undici-instrumentation.d.ts +14 -0
  177. package/build/types/integrations/node-fetch/undici-instrumentation.d.ts.map +1 -0
  178. package/build/types/integrations/tracing/amqplib/index.d.ts +4 -2
  179. package/build/types/integrations/tracing/amqplib/index.d.ts.map +1 -1
  180. package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts +11 -0
  181. package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts.map +1 -0
  182. package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts +11 -0
  183. package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts.map +1 -0
  184. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts +25 -37
  185. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -1
  186. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts +0 -81
  187. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -1
  188. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts +16 -9
  189. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -1
  190. package/build/types/integrations/tracing/anthropic-ai/index.d.ts +3 -1
  191. package/build/types/integrations/tracing/anthropic-ai/index.d.ts.map +1 -1
  192. package/build/types/integrations/tracing/connect/index.d.ts +3 -1
  193. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -1
  194. package/build/types/integrations/tracing/dataloader/index.d.ts +3 -1
  195. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -1
  196. package/build/types/integrations/tracing/express.d.ts +3 -1
  197. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  198. package/build/types/integrations/tracing/fastify/index.d.ts +6 -6
  199. package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
  200. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +1 -1
  201. package/build/types/integrations/tracing/firebase/firebase.d.ts +3 -1
  202. package/build/types/integrations/tracing/firebase/firebase.d.ts.map +1 -1
  203. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +4 -9
  204. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts.map +1 -1
  205. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts +2 -5
  206. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts.map +1 -1
  207. package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts +3 -8
  208. package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts.map +1 -1
  209. package/build/types/integrations/tracing/firebase/otel/types.d.ts +0 -20
  210. package/build/types/integrations/tracing/firebase/otel/types.d.ts.map +1 -1
  211. package/build/types/integrations/tracing/genericPool/index.d.ts +3 -1
  212. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -1
  213. package/build/types/integrations/tracing/google-genai/index.d.ts +3 -1
  214. package/build/types/integrations/tracing/google-genai/index.d.ts.map +1 -1
  215. package/build/types/integrations/tracing/graphql/index.d.ts +3 -1
  216. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -1
  217. package/build/types/integrations/tracing/hapi/index.d.ts +3 -1
  218. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  219. package/build/types/integrations/tracing/hono/index.d.ts +3 -1
  220. package/build/types/integrations/tracing/hono/index.d.ts.map +1 -1
  221. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  222. package/build/types/integrations/tracing/kafka/index.d.ts +3 -1
  223. package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -1
  224. package/build/types/integrations/tracing/knex/index.d.ts +3 -1
  225. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -1
  226. package/build/types/integrations/tracing/koa/index.d.ts +3 -1
  227. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -1
  228. package/build/types/integrations/tracing/langchain/index.d.ts +3 -1
  229. package/build/types/integrations/tracing/langchain/index.d.ts.map +1 -1
  230. package/build/types/integrations/tracing/langgraph/index.d.ts +3 -1
  231. package/build/types/integrations/tracing/langgraph/index.d.ts.map +1 -1
  232. package/build/types/integrations/tracing/lrumemoizer/index.d.ts +3 -1
  233. package/build/types/integrations/tracing/lrumemoizer/index.d.ts.map +1 -1
  234. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -1
  235. package/build/types/integrations/tracing/mongo/index.d.ts +3 -1
  236. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -1
  237. package/build/types/integrations/tracing/mongoose/index.d.ts +3 -1
  238. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -1
  239. package/build/types/integrations/tracing/mysql/index.d.ts +3 -1
  240. package/build/types/integrations/tracing/mysql/index.d.ts.map +1 -1
  241. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts +3 -17
  242. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -1
  243. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts +16 -16
  244. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -1
  245. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts +0 -8
  246. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -1
  247. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts +6 -9
  248. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -1
  249. package/build/types/integrations/tracing/mysql2/index.d.ts +3 -1
  250. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -1
  251. package/build/types/integrations/tracing/openai/index.d.ts +3 -1
  252. package/build/types/integrations/tracing/openai/index.d.ts.map +1 -1
  253. package/build/types/integrations/tracing/postgres/index.d.ts +3 -1
  254. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -1
  255. package/build/types/integrations/tracing/postgresjs.d.ts +3 -1
  256. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
  257. package/build/types/integrations/tracing/prisma/index.d.ts +5 -21
  258. package/build/types/integrations/tracing/prisma/index.d.ts.map +1 -1
  259. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +5 -7
  260. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -1
  261. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -1
  262. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -1
  263. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts +2 -4
  264. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -1
  265. package/build/types/integrations/tracing/prisma/vendored/types.d.ts +5 -23
  266. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -1
  267. package/build/types/integrations/tracing/redis/index.d.ts +4 -2
  268. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
  269. package/build/types/integrations/tracing/tedious/index.d.ts +3 -1
  270. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -1
  271. package/build/types/integrations/tracing/vercelai/constants.d.ts +1 -1
  272. package/build/types/integrations/tracing/vercelai/constants.d.ts.map +1 -1
  273. package/build/types/integrations/tracing/vercelai/index.d.ts +3 -2
  274. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  275. package/build/types/sdk/diagnosticsChannelInjection.d.ts +1 -1
  276. package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -1
  277. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -1
  278. package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
  279. package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +3 -1
  280. package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +3 -1
  281. package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +3 -1
  282. package/build/types-ts3.8/integrations/fs/index.d.ts +3 -1
  283. package/build/types-ts3.8/integrations/http.d.ts +3 -1
  284. package/build/types-ts3.8/integrations/node-fetch/index.d.ts +4 -35
  285. package/build/types-ts3.8/integrations/node-fetch/types.d.ts +96 -0
  286. package/build/types-ts3.8/integrations/node-fetch/undici-instrumentation.d.ts +14 -0
  287. package/build/types-ts3.8/integrations/tracing/amqplib/index.d.ts +4 -2
  288. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/instrumentation.d.ts +11 -0
  289. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/patches.d.ts +11 -0
  290. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv.d.ts +25 -37
  291. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/types.d.ts +0 -81
  292. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/utils.d.ts +16 -9
  293. package/build/types-ts3.8/integrations/tracing/anthropic-ai/index.d.ts +3 -1
  294. package/build/types-ts3.8/integrations/tracing/connect/index.d.ts +3 -1
  295. package/build/types-ts3.8/integrations/tracing/dataloader/index.d.ts +3 -1
  296. package/build/types-ts3.8/integrations/tracing/express.d.ts +3 -1
  297. package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +6 -6
  298. package/build/types-ts3.8/integrations/tracing/firebase/firebase.d.ts +3 -1
  299. package/build/types-ts3.8/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +4 -9
  300. package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/firestore.d.ts +2 -5
  301. package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/functions.d.ts +3 -8
  302. package/build/types-ts3.8/integrations/tracing/firebase/otel/types.d.ts +0 -20
  303. package/build/types-ts3.8/integrations/tracing/genericPool/index.d.ts +3 -1
  304. package/build/types-ts3.8/integrations/tracing/google-genai/index.d.ts +3 -1
  305. package/build/types-ts3.8/integrations/tracing/graphql/index.d.ts +3 -1
  306. package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +3 -1
  307. package/build/types-ts3.8/integrations/tracing/hono/index.d.ts +3 -1
  308. package/build/types-ts3.8/integrations/tracing/kafka/index.d.ts +3 -1
  309. package/build/types-ts3.8/integrations/tracing/knex/index.d.ts +3 -1
  310. package/build/types-ts3.8/integrations/tracing/koa/index.d.ts +3 -1
  311. package/build/types-ts3.8/integrations/tracing/langchain/index.d.ts +3 -1
  312. package/build/types-ts3.8/integrations/tracing/langgraph/index.d.ts +3 -1
  313. package/build/types-ts3.8/integrations/tracing/lrumemoizer/index.d.ts +3 -1
  314. package/build/types-ts3.8/integrations/tracing/mongo/index.d.ts +3 -1
  315. package/build/types-ts3.8/integrations/tracing/mongoose/index.d.ts +3 -1
  316. package/build/types-ts3.8/integrations/tracing/mysql/index.d.ts +3 -1
  317. package/build/types-ts3.8/integrations/tracing/mysql/vendored/instrumentation.d.ts +3 -17
  318. package/build/types-ts3.8/integrations/tracing/mysql/vendored/mysql-types.d.ts +16 -16
  319. package/build/types-ts3.8/integrations/tracing/mysql/vendored/semconv.d.ts +0 -8
  320. package/build/types-ts3.8/integrations/tracing/mysql/vendored/utils.d.ts +6 -9
  321. package/build/types-ts3.8/integrations/tracing/mysql2/index.d.ts +3 -1
  322. package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +3 -1
  323. package/build/types-ts3.8/integrations/tracing/postgres/index.d.ts +3 -1
  324. package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +3 -1
  325. package/build/types-ts3.8/integrations/tracing/prisma/index.d.ts +5 -21
  326. package/build/types-ts3.8/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +5 -7
  327. package/build/types-ts3.8/integrations/tracing/prisma/vendored/instrumentation.d.ts +2 -4
  328. package/build/types-ts3.8/integrations/tracing/prisma/vendored/types.d.ts +5 -23
  329. package/build/types-ts3.8/integrations/tracing/redis/index.d.ts +4 -2
  330. package/build/types-ts3.8/integrations/tracing/tedious/index.d.ts +3 -1
  331. package/build/types-ts3.8/integrations/tracing/vercelai/constants.d.ts +1 -1
  332. package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +3 -2
  333. package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +1 -1
  334. package/package.json +6 -5
  335. package/build/cjs/integrations/node-fetch/vendored/semconv.js +0 -28
  336. package/build/cjs/integrations/node-fetch/vendored/semconv.js.map +0 -1
  337. package/build/cjs/integrations/node-fetch/vendored/undici.js +0 -302
  338. package/build/cjs/integrations/node-fetch/vendored/undici.js.map +0 -1
  339. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js +0 -452
  340. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js.map +0 -1
  341. package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js +0 -24
  342. package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +0 -1
  343. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js +0 -387
  344. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +0 -1
  345. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js +0 -9
  346. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +0 -1
  347. package/build/esm/integrations/node-fetch/vendored/semconv.js +0 -15
  348. package/build/esm/integrations/node-fetch/vendored/semconv.js.map +0 -1
  349. package/build/esm/integrations/node-fetch/vendored/undici.js +0 -300
  350. package/build/esm/integrations/node-fetch/vendored/undici.js.map +0 -1
  351. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js +0 -450
  352. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js.map +0 -1
  353. package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js +0 -13
  354. package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +0 -1
  355. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js +0 -385
  356. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +0 -1
  357. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js +0 -7
  358. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +0 -1
  359. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts +0 -25
  360. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts.map +0 -1
  361. package/build/types/integrations/node-fetch/vendored/semconv.d.ts +0 -13
  362. package/build/types/integrations/node-fetch/vendored/semconv.d.ts.map +0 -1
  363. package/build/types/integrations/node-fetch/vendored/types.d.ts +0 -60
  364. package/build/types/integrations/node-fetch/vendored/types.d.ts.map +0 -1
  365. package/build/types/integrations/node-fetch/vendored/undici.d.ts +0 -21
  366. package/build/types/integrations/node-fetch/vendored/undici.d.ts.map +0 -1
  367. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts +0 -26
  368. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts.map +0 -1
  369. package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts +0 -63
  370. package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts.map +0 -1
  371. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts +0 -27
  372. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +0 -1
  373. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts +0 -4
  374. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +0 -1
  375. package/build/types/integrations/tracing/mysql/vendored/types.d.ts +0 -9
  376. package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +0 -1
  377. package/build/types-ts3.8/integrations/node-fetch/vendored/internal-types.d.ts +0 -25
  378. package/build/types-ts3.8/integrations/node-fetch/vendored/semconv.d.ts +0 -13
  379. package/build/types-ts3.8/integrations/node-fetch/vendored/types.d.ts +0 -60
  380. package/build/types-ts3.8/integrations/node-fetch/vendored/undici.d.ts +0 -21
  381. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib.d.ts +0 -26
  382. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts +0 -63
  383. package/build/types-ts3.8/integrations/tracing/fastify/vendored/instrumentation.d.ts +0 -27
  384. package/build/types-ts3.8/integrations/tracing/mysql/vendored/AttributeNames.d.ts +0 -4
  385. package/build/types-ts3.8/integrations/tracing/mysql/vendored/types.d.ts +0 -9
@@ -1,450 +0,0 @@
1
- import { diag, context, trace, SpanKind, propagation, SpanStatusCode, ROOT_CONTEXT } from '@opentelemetry/api';
2
- import { SDK_VERSION, timestampInSeconds } from '@sentry/core';
3
- import { InstrumentationBase, semconvStabilityFromStr, InstrumentationNodeModuleDefinition, isWrapped, safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';
4
- import { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile.js';
5
- import { ATTR_MESSAGING_OPERATION } from './semconv.js';
6
- import { MESSAGING_DESTINATION_KIND_VALUE_TOPIC, ATTR_MESSAGING_CONVERSATION_ID, OLD_ATTR_MESSAGING_MESSAGE_ID, ATTR_MESSAGING_RABBITMQ_ROUTING_KEY, ATTR_MESSAGING_DESTINATION_KIND, ATTR_MESSAGING_DESTINATION, MESSAGING_OPERATION_VALUE_PROCESS } from './semconv-obsolete.js';
7
- import { DEFAULT_CONFIG, EndOperation } from './types.js';
8
- import { getConnectionAttributesFromUrl, getConnectionAttributesFromServer, CONNECTION_ATTRIBUTES, CHANNEL_CONSUME_TIMEOUT_TIMER, CHANNEL_SPANS_NOT_ENDED, markConfirmChannelTracing, unmarkConfirmChannelTracing, isConfirmChannelTracing, MESSAGE_STORED_SPAN, normalizeExchange } from './utils.js';
9
-
10
- const PACKAGE_NAME = "@sentry/instrumentation-amqplib";
11
- const supportedVersions = [">=0.5.5 <2"];
12
- class AmqplibInstrumentation extends InstrumentationBase {
13
- constructor(config = {}) {
14
- super(PACKAGE_NAME, SDK_VERSION, { ...DEFAULT_CONFIG, ...config });
15
- this._setSemconvStabilityFromEnv();
16
- }
17
- // Used for testing.
18
- _setSemconvStabilityFromEnv() {
19
- this._netSemconvStability = semconvStabilityFromStr("http", process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
20
- }
21
- setConfig(config = {}) {
22
- super.setConfig({ ...DEFAULT_CONFIG, ...config });
23
- }
24
- init() {
25
- const channelModelModuleFile = new InstrumentationNodeModuleFile(
26
- "amqplib/lib/channel_model.js",
27
- supportedVersions,
28
- this.patchChannelModel.bind(this),
29
- this.unpatchChannelModel.bind(this)
30
- );
31
- const callbackModelModuleFile = new InstrumentationNodeModuleFile(
32
- "amqplib/lib/callback_model.js",
33
- supportedVersions,
34
- this.patchChannelModel.bind(this),
35
- this.unpatchChannelModel.bind(this)
36
- );
37
- const connectModuleFile = new InstrumentationNodeModuleFile(
38
- "amqplib/lib/connect.js",
39
- supportedVersions,
40
- this.patchConnect.bind(this),
41
- this.unpatchConnect.bind(this)
42
- );
43
- const module = new InstrumentationNodeModuleDefinition("amqplib", supportedVersions, void 0, void 0, [
44
- channelModelModuleFile,
45
- connectModuleFile,
46
- callbackModelModuleFile
47
- ]);
48
- return module;
49
- }
50
- patchConnect(moduleExports) {
51
- moduleExports = this.unpatchConnect(moduleExports);
52
- if (!isWrapped(moduleExports.connect)) {
53
- this._wrap(moduleExports, "connect", this.getConnectPatch.bind(this));
54
- }
55
- return moduleExports;
56
- }
57
- unpatchConnect(moduleExports) {
58
- if (isWrapped(moduleExports.connect)) {
59
- this._unwrap(moduleExports, "connect");
60
- }
61
- return moduleExports;
62
- }
63
- patchChannelModel(moduleExports, moduleVersion) {
64
- if (!isWrapped(moduleExports.Channel.prototype.publish)) {
65
- this._wrap(moduleExports.Channel.prototype, "publish", this.getPublishPatch.bind(this, moduleVersion));
66
- }
67
- if (!isWrapped(moduleExports.Channel.prototype.consume)) {
68
- this._wrap(moduleExports.Channel.prototype, "consume", this.getConsumePatch.bind(this, moduleVersion));
69
- }
70
- if (!isWrapped(moduleExports.Channel.prototype.ack)) {
71
- this._wrap(moduleExports.Channel.prototype, "ack", this.getAckPatch.bind(this, false, EndOperation.Ack));
72
- }
73
- if (!isWrapped(moduleExports.Channel.prototype.nack)) {
74
- this._wrap(moduleExports.Channel.prototype, "nack", this.getAckPatch.bind(this, true, EndOperation.Nack));
75
- }
76
- if (!isWrapped(moduleExports.Channel.prototype.reject)) {
77
- this._wrap(moduleExports.Channel.prototype, "reject", this.getAckPatch.bind(this, true, EndOperation.Reject));
78
- }
79
- if (!isWrapped(moduleExports.Channel.prototype.ackAll)) {
80
- this._wrap(moduleExports.Channel.prototype, "ackAll", this.getAckAllPatch.bind(this, false, EndOperation.AckAll));
81
- }
82
- if (!isWrapped(moduleExports.Channel.prototype.nackAll)) {
83
- this._wrap(
84
- moduleExports.Channel.prototype,
85
- "nackAll",
86
- this.getAckAllPatch.bind(this, true, EndOperation.NackAll)
87
- );
88
- }
89
- if (!isWrapped(moduleExports.Channel.prototype.emit)) {
90
- this._wrap(moduleExports.Channel.prototype, "emit", this.getChannelEmitPatch.bind(this));
91
- }
92
- if (!isWrapped(moduleExports.ConfirmChannel.prototype.publish)) {
93
- this._wrap(
94
- moduleExports.ConfirmChannel.prototype,
95
- "publish",
96
- this.getConfirmedPublishPatch.bind(this, moduleVersion)
97
- );
98
- }
99
- return moduleExports;
100
- }
101
- unpatchChannelModel(moduleExports) {
102
- if (isWrapped(moduleExports.Channel.prototype.publish)) {
103
- this._unwrap(moduleExports.Channel.prototype, "publish");
104
- }
105
- if (isWrapped(moduleExports.Channel.prototype.consume)) {
106
- this._unwrap(moduleExports.Channel.prototype, "consume");
107
- }
108
- if (isWrapped(moduleExports.Channel.prototype.ack)) {
109
- this._unwrap(moduleExports.Channel.prototype, "ack");
110
- }
111
- if (isWrapped(moduleExports.Channel.prototype.nack)) {
112
- this._unwrap(moduleExports.Channel.prototype, "nack");
113
- }
114
- if (isWrapped(moduleExports.Channel.prototype.reject)) {
115
- this._unwrap(moduleExports.Channel.prototype, "reject");
116
- }
117
- if (isWrapped(moduleExports.Channel.prototype.ackAll)) {
118
- this._unwrap(moduleExports.Channel.prototype, "ackAll");
119
- }
120
- if (isWrapped(moduleExports.Channel.prototype.nackAll)) {
121
- this._unwrap(moduleExports.Channel.prototype, "nackAll");
122
- }
123
- if (isWrapped(moduleExports.Channel.prototype.emit)) {
124
- this._unwrap(moduleExports.Channel.prototype, "emit");
125
- }
126
- if (isWrapped(moduleExports.ConfirmChannel.prototype.publish)) {
127
- this._unwrap(moduleExports.ConfirmChannel.prototype, "publish");
128
- }
129
- return moduleExports;
130
- }
131
- getConnectPatch(original) {
132
- const self = this;
133
- return function patchedConnect(url, socketOptions, openCallback) {
134
- return original.call(
135
- this,
136
- url,
137
- socketOptions,
138
- function(err, conn) {
139
- if (err == null) {
140
- const urlAttributes = getConnectionAttributesFromUrl(url, self._netSemconvStability);
141
- const serverAttributes = getConnectionAttributesFromServer(conn);
142
- conn[CONNECTION_ATTRIBUTES] = {
143
- ...urlAttributes,
144
- ...serverAttributes
145
- };
146
- }
147
- openCallback.apply(this, arguments);
148
- }
149
- );
150
- };
151
- }
152
- getChannelEmitPatch(original) {
153
- const self = this;
154
- return function emit(eventName) {
155
- if (eventName === "close") {
156
- self.endAllSpansOnChannel(this, true, EndOperation.ChannelClosed, void 0);
157
- const activeTimer = this[CHANNEL_CONSUME_TIMEOUT_TIMER];
158
- if (activeTimer) {
159
- clearInterval(activeTimer);
160
- }
161
- this[CHANNEL_CONSUME_TIMEOUT_TIMER] = void 0;
162
- } else if (eventName === "error") {
163
- self.endAllSpansOnChannel(this, true, EndOperation.ChannelError, void 0);
164
- }
165
- return original.apply(this, arguments);
166
- };
167
- }
168
- getAckAllPatch(isRejected, endOperation, original) {
169
- const self = this;
170
- return function ackAll(requeueOrEmpty) {
171
- self.endAllSpansOnChannel(this, isRejected, endOperation, requeueOrEmpty);
172
- return original.apply(this, arguments);
173
- };
174
- }
175
- getAckPatch(isRejected, endOperation, original) {
176
- const self = this;
177
- return function ack(message, allUpToOrRequeue, requeue) {
178
- const channel = this;
179
- const requeueResolved = endOperation === EndOperation.Reject ? allUpToOrRequeue : requeue;
180
- const spansNotEnded = channel[CHANNEL_SPANS_NOT_ENDED] ?? [];
181
- const msgIndex = spansNotEnded.findIndex((msgDetails) => msgDetails.msg === message);
182
- if (msgIndex < 0) {
183
- self.endConsumerSpan(message, isRejected, endOperation, requeueResolved);
184
- } else if (endOperation !== EndOperation.Reject && allUpToOrRequeue) {
185
- for (let i = 0; i <= msgIndex; i++) {
186
- self.endConsumerSpan(spansNotEnded[i].msg, isRejected, endOperation, requeueResolved);
187
- }
188
- spansNotEnded.splice(0, msgIndex + 1);
189
- } else {
190
- self.endConsumerSpan(message, isRejected, endOperation, requeueResolved);
191
- spansNotEnded.splice(msgIndex, 1);
192
- }
193
- return original.apply(this, arguments);
194
- };
195
- }
196
- getConsumePatch(moduleVersion, original) {
197
- const self = this;
198
- return function consume(queue, onMessage, options) {
199
- const channel = this;
200
- if (!Object.prototype.hasOwnProperty.call(channel, CHANNEL_SPANS_NOT_ENDED)) {
201
- const { consumeTimeoutMs } = self.getConfig();
202
- if (consumeTimeoutMs) {
203
- const timer = setInterval(() => {
204
- self.checkConsumeTimeoutOnChannel(channel);
205
- }, consumeTimeoutMs);
206
- timer.unref();
207
- channel[CHANNEL_CONSUME_TIMEOUT_TIMER] = timer;
208
- }
209
- channel[CHANNEL_SPANS_NOT_ENDED] = [];
210
- }
211
- const patchedOnMessage = function(msg) {
212
- if (!msg) {
213
- return onMessage.call(this, msg);
214
- }
215
- const headers = msg.properties.headers ?? {};
216
- let parentContext = propagation.extract(ROOT_CONTEXT, headers);
217
- const exchange = msg.fields?.exchange;
218
- let links;
219
- if (self._config.useLinksForConsume) {
220
- const parentSpanContext = parentContext ? trace.getSpan(parentContext)?.spanContext() : void 0;
221
- parentContext = void 0;
222
- if (parentSpanContext) {
223
- links = [
224
- {
225
- context: parentSpanContext
226
- }
227
- ];
228
- }
229
- }
230
- const span = self.tracer.startSpan(
231
- `${queue} process`,
232
- {
233
- kind: SpanKind.CONSUMER,
234
- attributes: {
235
- ...channel?.connection?.[CONNECTION_ATTRIBUTES],
236
- [ATTR_MESSAGING_DESTINATION]: exchange,
237
- [ATTR_MESSAGING_DESTINATION_KIND]: MESSAGING_DESTINATION_KIND_VALUE_TOPIC,
238
- [ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: msg.fields?.routingKey,
239
- [ATTR_MESSAGING_OPERATION]: MESSAGING_OPERATION_VALUE_PROCESS,
240
- [OLD_ATTR_MESSAGING_MESSAGE_ID]: msg?.properties.messageId,
241
- [ATTR_MESSAGING_CONVERSATION_ID]: msg?.properties.correlationId
242
- },
243
- links
244
- },
245
- parentContext
246
- );
247
- const { consumeHook } = self.getConfig();
248
- if (consumeHook) {
249
- safeExecuteInTheMiddle(
250
- () => consumeHook(span, { moduleVersion, msg }),
251
- (e) => {
252
- if (e) {
253
- diag.error("amqplib instrumentation: consumerHook error", e);
254
- }
255
- },
256
- true
257
- );
258
- }
259
- if (!options?.noAck) {
260
- channel[CHANNEL_SPANS_NOT_ENDED].push({
261
- msg,
262
- timeOfConsume: timestampInSeconds()
263
- });
264
- msg[MESSAGE_STORED_SPAN] = span;
265
- }
266
- const setContext = parentContext ? parentContext : ROOT_CONTEXT;
267
- context.with(trace.setSpan(setContext, span), () => {
268
- onMessage.call(this, msg);
269
- });
270
- if (options?.noAck) {
271
- self.callConsumeEndHook(span, msg, false, EndOperation.AutoAck);
272
- span.end();
273
- }
274
- };
275
- arguments[1] = patchedOnMessage;
276
- return original.apply(this, arguments);
277
- };
278
- }
279
- getConfirmedPublishPatch(moduleVersion, original) {
280
- const self = this;
281
- return function confirmedPublish(exchange, routingKey, content, options, callback) {
282
- const channel = this;
283
- const { span, modifiedOptions } = self.createPublishSpan(self, exchange, routingKey, channel, options);
284
- const { publishHook } = self.getConfig();
285
- if (publishHook) {
286
- safeExecuteInTheMiddle(
287
- () => publishHook(span, {
288
- moduleVersion,
289
- exchange,
290
- routingKey,
291
- content,
292
- options: modifiedOptions,
293
- isConfirmChannel: true
294
- }),
295
- (e) => {
296
- if (e) {
297
- diag.error("amqplib instrumentation: publishHook error", e);
298
- }
299
- },
300
- true
301
- );
302
- }
303
- const patchedOnConfirm = function(err, ok) {
304
- try {
305
- callback?.call(this, err, ok);
306
- } finally {
307
- const { publishConfirmHook } = self.getConfig();
308
- if (publishConfirmHook) {
309
- safeExecuteInTheMiddle(
310
- () => publishConfirmHook(span, {
311
- moduleVersion,
312
- exchange,
313
- routingKey,
314
- content,
315
- options,
316
- isConfirmChannel: true,
317
- confirmError: err
318
- }),
319
- (e) => {
320
- if (e) {
321
- diag.error("amqplib instrumentation: publishConfirmHook error", e);
322
- }
323
- },
324
- true
325
- );
326
- }
327
- if (err) {
328
- span.setStatus({
329
- code: SpanStatusCode.ERROR,
330
- message: "message confirmation has been nack'ed"
331
- });
332
- }
333
- span.end();
334
- }
335
- };
336
- const markedContext = markConfirmChannelTracing(context.active());
337
- const argumentsCopy = [...arguments];
338
- argumentsCopy[3] = modifiedOptions;
339
- argumentsCopy[4] = context.bind(
340
- unmarkConfirmChannelTracing(trace.setSpan(markedContext, span)),
341
- patchedOnConfirm
342
- );
343
- return context.with(markedContext, original.bind(this, ...argumentsCopy));
344
- };
345
- }
346
- getPublishPatch(moduleVersion, original) {
347
- const self = this;
348
- return function publish(exchange, routingKey, content, options) {
349
- if (isConfirmChannelTracing(context.active())) {
350
- return original.apply(this, arguments);
351
- } else {
352
- const channel = this;
353
- const { span, modifiedOptions } = self.createPublishSpan(self, exchange, routingKey, channel, options);
354
- const { publishHook } = self.getConfig();
355
- if (publishHook) {
356
- safeExecuteInTheMiddle(
357
- () => publishHook(span, {
358
- moduleVersion,
359
- exchange,
360
- routingKey,
361
- content,
362
- options: modifiedOptions,
363
- isConfirmChannel: false
364
- }),
365
- (e) => {
366
- if (e) {
367
- diag.error("amqplib instrumentation: publishHook error", e);
368
- }
369
- },
370
- true
371
- );
372
- }
373
- const argumentsCopy = [...arguments];
374
- argumentsCopy[3] = modifiedOptions;
375
- const originalRes = original.apply(this, argumentsCopy);
376
- span.end();
377
- return originalRes;
378
- }
379
- };
380
- }
381
- createPublishSpan(self, exchange, routingKey, channel, options) {
382
- const normalizedExchange = normalizeExchange(exchange);
383
- const span = self.tracer.startSpan(`publish ${normalizedExchange}`, {
384
- kind: SpanKind.PRODUCER,
385
- attributes: {
386
- ...channel.connection[CONNECTION_ATTRIBUTES],
387
- [ATTR_MESSAGING_DESTINATION]: exchange,
388
- [ATTR_MESSAGING_DESTINATION_KIND]: MESSAGING_DESTINATION_KIND_VALUE_TOPIC,
389
- [ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey,
390
- [OLD_ATTR_MESSAGING_MESSAGE_ID]: options?.messageId,
391
- [ATTR_MESSAGING_CONVERSATION_ID]: options?.correlationId
392
- }
393
- });
394
- const modifiedOptions = options ?? {};
395
- modifiedOptions.headers = modifiedOptions.headers ?? {};
396
- propagation.inject(trace.setSpan(context.active(), span), modifiedOptions.headers);
397
- return { span, modifiedOptions };
398
- }
399
- endConsumerSpan(message, isRejected, operation, requeue) {
400
- const storedSpan = message[MESSAGE_STORED_SPAN];
401
- if (!storedSpan) return;
402
- if (isRejected !== false) {
403
- storedSpan.setStatus({
404
- code: SpanStatusCode.ERROR,
405
- message: operation !== EndOperation.ChannelClosed && operation !== EndOperation.ChannelError ? `${operation} called on message${requeue === true ? " with requeue" : requeue === false ? " without requeue" : ""}` : operation
406
- });
407
- }
408
- this.callConsumeEndHook(storedSpan, message, isRejected, operation);
409
- storedSpan.end();
410
- message[MESSAGE_STORED_SPAN] = void 0;
411
- }
412
- endAllSpansOnChannel(channel, isRejected, operation, requeue) {
413
- const spansNotEnded = channel[CHANNEL_SPANS_NOT_ENDED] ?? [];
414
- spansNotEnded.forEach((msgDetails) => {
415
- this.endConsumerSpan(msgDetails.msg, isRejected, operation, requeue);
416
- });
417
- channel[CHANNEL_SPANS_NOT_ENDED] = [];
418
- }
419
- callConsumeEndHook(span, msg, rejected, endOperation) {
420
- const { consumeEndHook } = this.getConfig();
421
- if (!consumeEndHook) return;
422
- safeExecuteInTheMiddle(
423
- () => consumeEndHook(span, { msg, rejected, endOperation }),
424
- (e) => {
425
- if (e) {
426
- diag.error("amqplib instrumentation: consumerEndHook error", e);
427
- }
428
- },
429
- true
430
- );
431
- }
432
- checkConsumeTimeoutOnChannel(channel) {
433
- const currentTime = timestampInSeconds();
434
- const spansNotEnded = channel[CHANNEL_SPANS_NOT_ENDED] ?? [];
435
- let i;
436
- const { consumeTimeoutMs } = this.getConfig();
437
- for (i = 0; i < spansNotEnded.length; i++) {
438
- const currMessage = spansNotEnded[i];
439
- const timeFromConsumeMs = (currentTime - currMessage.timeOfConsume) * 1e3;
440
- if (timeFromConsumeMs < consumeTimeoutMs) {
441
- break;
442
- }
443
- this.endConsumerSpan(currMessage.msg, null, EndOperation.InstrumentationTimeout, true);
444
- }
445
- spansNotEnded.splice(0, i);
446
- }
447
- }
448
-
449
- export { AmqplibInstrumentation };
450
- //# sourceMappingURL=amqplib.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"amqplib.js","sources":["../../../../../../src/integrations/tracing/amqplib/vendored/amqplib.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-amqplib\n * - Upstream version: @opentelemetry/instrumentation-amqplib@0.65.0\n */\n/* eslint-disable */\n\nimport {\n context,\n diag,\n propagation,\n trace,\n Span,\n SpanKind,\n SpanStatusCode,\n ROOT_CONTEXT,\n Link,\n Context,\n} from '@opentelemetry/api';\nimport { timestampInSeconds } from '@sentry/core';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n isWrapped,\n safeExecuteInTheMiddle,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport { InstrumentationNodeModuleFile } from '../../InstrumentationNodeModuleFile';\nimport { ATTR_MESSAGING_OPERATION } from './semconv';\nimport {\n ATTR_MESSAGING_DESTINATION,\n ATTR_MESSAGING_DESTINATION_KIND,\n ATTR_MESSAGING_RABBITMQ_ROUTING_KEY,\n MESSAGING_DESTINATION_KIND_VALUE_TOPIC,\n MESSAGING_OPERATION_VALUE_PROCESS,\n OLD_ATTR_MESSAGING_MESSAGE_ID,\n ATTR_MESSAGING_CONVERSATION_ID,\n} from './semconv-obsolete';\nimport type { Connection, Options, Replies } from './amqplib-types';\nimport { AmqplibInstrumentationConfig, DEFAULT_CONFIG, EndOperation, type ConsumeMessage, type Message } from './types';\nimport {\n CHANNEL_CONSUME_TIMEOUT_TIMER,\n CHANNEL_SPANS_NOT_ENDED,\n CONNECTION_ATTRIBUTES,\n getConnectionAttributesFromServer,\n getConnectionAttributesFromUrl,\n InstrumentationConnection,\n InstrumentationConsumeChannel,\n InstrumentationConsumeMessage,\n InstrumentationMessage,\n InstrumentationPublishChannel,\n isConfirmChannelTracing,\n markConfirmChannelTracing,\n MESSAGE_STORED_SPAN,\n normalizeExchange,\n unmarkConfirmChannelTracing,\n} from './utils';\n\nimport { SDK_VERSION } from '@sentry/core';\n\nconst PACKAGE_NAME = '@sentry/instrumentation-amqplib';\nconst supportedVersions = ['>=0.5.5 <2'];\n\nexport class AmqplibInstrumentation extends InstrumentationBase<AmqplibInstrumentationConfig> {\n private _netSemconvStability!: SemconvStability;\n\n constructor(config: AmqplibInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, { ...DEFAULT_CONFIG, ...config });\n this._setSemconvStabilityFromEnv();\n }\n\n // Used for testing.\n private _setSemconvStabilityFromEnv() {\n this._netSemconvStability = semconvStabilityFromStr('http', process.env.OTEL_SEMCONV_STABILITY_OPT_IN);\n }\n\n override setConfig(config: AmqplibInstrumentationConfig = {}) {\n super.setConfig({ ...DEFAULT_CONFIG, ...config });\n }\n\n protected init() {\n const channelModelModuleFile = new InstrumentationNodeModuleFile(\n 'amqplib/lib/channel_model.js',\n supportedVersions,\n this.patchChannelModel.bind(this),\n this.unpatchChannelModel.bind(this),\n );\n\n const callbackModelModuleFile = new InstrumentationNodeModuleFile(\n 'amqplib/lib/callback_model.js',\n supportedVersions,\n this.patchChannelModel.bind(this),\n this.unpatchChannelModel.bind(this),\n );\n\n const connectModuleFile = new InstrumentationNodeModuleFile(\n 'amqplib/lib/connect.js',\n supportedVersions,\n this.patchConnect.bind(this),\n this.unpatchConnect.bind(this),\n );\n\n const module = new InstrumentationNodeModuleDefinition('amqplib', supportedVersions, undefined, undefined, [\n channelModelModuleFile,\n connectModuleFile,\n callbackModelModuleFile,\n ]);\n return module;\n }\n\n private patchConnect(moduleExports: any) {\n moduleExports = this.unpatchConnect(moduleExports);\n if (!isWrapped(moduleExports.connect)) {\n this._wrap(moduleExports, 'connect', this.getConnectPatch.bind(this));\n }\n return moduleExports;\n }\n\n private unpatchConnect(moduleExports: any) {\n if (isWrapped(moduleExports.connect)) {\n this._unwrap(moduleExports, 'connect');\n }\n return moduleExports;\n }\n\n private patchChannelModel(moduleExports: any, moduleVersion: string | undefined) {\n if (!isWrapped(moduleExports.Channel.prototype.publish)) {\n this._wrap(moduleExports.Channel.prototype, 'publish', this.getPublishPatch.bind(this, moduleVersion));\n }\n if (!isWrapped(moduleExports.Channel.prototype.consume)) {\n this._wrap(moduleExports.Channel.prototype, 'consume', this.getConsumePatch.bind(this, moduleVersion));\n }\n if (!isWrapped(moduleExports.Channel.prototype.ack)) {\n this._wrap(moduleExports.Channel.prototype, 'ack', this.getAckPatch.bind(this, false, EndOperation.Ack));\n }\n if (!isWrapped(moduleExports.Channel.prototype.nack)) {\n this._wrap(moduleExports.Channel.prototype, 'nack', this.getAckPatch.bind(this, true, EndOperation.Nack));\n }\n if (!isWrapped(moduleExports.Channel.prototype.reject)) {\n this._wrap(moduleExports.Channel.prototype, 'reject', this.getAckPatch.bind(this, true, EndOperation.Reject));\n }\n if (!isWrapped(moduleExports.Channel.prototype.ackAll)) {\n this._wrap(moduleExports.Channel.prototype, 'ackAll', this.getAckAllPatch.bind(this, false, EndOperation.AckAll));\n }\n if (!isWrapped(moduleExports.Channel.prototype.nackAll)) {\n this._wrap(\n moduleExports.Channel.prototype,\n 'nackAll',\n this.getAckAllPatch.bind(this, true, EndOperation.NackAll),\n );\n }\n if (!isWrapped(moduleExports.Channel.prototype.emit)) {\n this._wrap(moduleExports.Channel.prototype, 'emit', this.getChannelEmitPatch.bind(this));\n }\n if (!isWrapped(moduleExports.ConfirmChannel.prototype.publish)) {\n this._wrap(\n moduleExports.ConfirmChannel.prototype,\n 'publish',\n this.getConfirmedPublishPatch.bind(this, moduleVersion),\n );\n }\n return moduleExports;\n }\n\n private unpatchChannelModel(moduleExports: any) {\n if (isWrapped(moduleExports.Channel.prototype.publish)) {\n this._unwrap(moduleExports.Channel.prototype, 'publish');\n }\n if (isWrapped(moduleExports.Channel.prototype.consume)) {\n this._unwrap(moduleExports.Channel.prototype, 'consume');\n }\n if (isWrapped(moduleExports.Channel.prototype.ack)) {\n this._unwrap(moduleExports.Channel.prototype, 'ack');\n }\n if (isWrapped(moduleExports.Channel.prototype.nack)) {\n this._unwrap(moduleExports.Channel.prototype, 'nack');\n }\n if (isWrapped(moduleExports.Channel.prototype.reject)) {\n this._unwrap(moduleExports.Channel.prototype, 'reject');\n }\n if (isWrapped(moduleExports.Channel.prototype.ackAll)) {\n this._unwrap(moduleExports.Channel.prototype, 'ackAll');\n }\n if (isWrapped(moduleExports.Channel.prototype.nackAll)) {\n this._unwrap(moduleExports.Channel.prototype, 'nackAll');\n }\n if (isWrapped(moduleExports.Channel.prototype.emit)) {\n this._unwrap(moduleExports.Channel.prototype, 'emit');\n }\n if (isWrapped(moduleExports.ConfirmChannel.prototype.publish)) {\n this._unwrap(moduleExports.ConfirmChannel.prototype, 'publish');\n }\n return moduleExports;\n }\n\n private getConnectPatch(\n original: (\n url: string | Options.Connect,\n socketOptions: any,\n openCallback: (err: any, connection: Connection) => void,\n ) => Connection,\n ) {\n const self = this;\n return function patchedConnect(\n this: unknown,\n url: string | Options.Connect,\n socketOptions: any,\n openCallback: Function,\n ) {\n return original.call(\n this,\n url,\n socketOptions,\n function (this: unknown, err: any, conn: InstrumentationConnection) {\n if (err == null) {\n const urlAttributes = getConnectionAttributesFromUrl(url, self._netSemconvStability);\n const serverAttributes = getConnectionAttributesFromServer(conn);\n conn[CONNECTION_ATTRIBUTES] = {\n ...urlAttributes,\n ...serverAttributes,\n };\n }\n openCallback.apply(this, arguments);\n },\n );\n };\n }\n\n private getChannelEmitPatch(original: Function) {\n const self = this;\n return function emit(this: InstrumentationConsumeChannel, eventName: string) {\n if (eventName === 'close') {\n self.endAllSpansOnChannel(this, true, EndOperation.ChannelClosed, undefined);\n const activeTimer = this[CHANNEL_CONSUME_TIMEOUT_TIMER];\n if (activeTimer) {\n clearInterval(activeTimer);\n }\n this[CHANNEL_CONSUME_TIMEOUT_TIMER] = undefined;\n } else if (eventName === 'error') {\n self.endAllSpansOnChannel(this, true, EndOperation.ChannelError, undefined);\n }\n return original.apply(this, arguments);\n };\n }\n\n private getAckAllPatch(isRejected: boolean, endOperation: EndOperation, original: Function) {\n const self = this;\n return function ackAll(this: InstrumentationConsumeChannel, requeueOrEmpty?: boolean): void {\n self.endAllSpansOnChannel(this, isRejected, endOperation, requeueOrEmpty);\n return original.apply(this, arguments);\n };\n }\n\n private getAckPatch(isRejected: boolean, endOperation: EndOperation, original: Function) {\n const self = this;\n return function ack(\n this: InstrumentationConsumeChannel,\n message: Message,\n allUpToOrRequeue?: boolean,\n requeue?: boolean,\n ): void {\n const channel = this;\n // we use this patch in reject function as well, but it has different signature\n const requeueResolved = endOperation === EndOperation.Reject ? allUpToOrRequeue : requeue;\n\n const spansNotEnded: { msg: Message }[] = channel[CHANNEL_SPANS_NOT_ENDED] ?? [];\n const msgIndex = spansNotEnded.findIndex(msgDetails => msgDetails.msg === message);\n if (msgIndex < 0) {\n // should not happen in happy flow\n // but possible if user is calling the api function ack twice with same message\n self.endConsumerSpan(message, isRejected, endOperation, requeueResolved);\n } else if (endOperation !== EndOperation.Reject && allUpToOrRequeue) {\n for (let i = 0; i <= msgIndex; i++) {\n self.endConsumerSpan(spansNotEnded[i]!.msg, isRejected, endOperation, requeueResolved);\n }\n spansNotEnded.splice(0, msgIndex + 1);\n } else {\n self.endConsumerSpan(message, isRejected, endOperation, requeueResolved);\n spansNotEnded.splice(msgIndex, 1);\n }\n return original.apply(this, arguments);\n };\n }\n\n private getConsumePatch(moduleVersion: string | undefined, original: Function) {\n const self = this;\n return function consume(\n this: InstrumentationConsumeChannel,\n queue: string,\n onMessage: (msg: ConsumeMessage | null) => void,\n options?: Options.Consume,\n ): Promise<Replies.Consume> {\n const channel = this;\n if (!Object.prototype.hasOwnProperty.call(channel, CHANNEL_SPANS_NOT_ENDED)) {\n const { consumeTimeoutMs } = self.getConfig();\n if (consumeTimeoutMs) {\n const timer = setInterval(() => {\n self.checkConsumeTimeoutOnChannel(channel);\n }, consumeTimeoutMs);\n timer.unref();\n channel[CHANNEL_CONSUME_TIMEOUT_TIMER] = timer;\n }\n channel[CHANNEL_SPANS_NOT_ENDED] = [];\n }\n\n const patchedOnMessage = function (this: unknown, msg: InstrumentationConsumeMessage | null) {\n // msg is expected to be null for signaling consumer cancel notification\n // https://www.rabbitmq.com/consumer-cancel.html\n // in this case, we do not start a span, as this is not a real message.\n if (!msg) {\n return onMessage.call(this, msg);\n }\n\n const headers = msg.properties.headers ?? {};\n let parentContext: Context | undefined = propagation.extract(ROOT_CONTEXT, headers);\n const exchange = msg.fields?.exchange;\n let links: Link[] | undefined;\n if (self._config.useLinksForConsume) {\n const parentSpanContext = parentContext ? trace.getSpan(parentContext)?.spanContext() : undefined;\n parentContext = undefined;\n if (parentSpanContext) {\n links = [\n {\n context: parentSpanContext,\n },\n ];\n }\n }\n const span = self.tracer.startSpan(\n `${queue} process`,\n {\n kind: SpanKind.CONSUMER,\n attributes: {\n ...channel?.connection?.[CONNECTION_ATTRIBUTES],\n [ATTR_MESSAGING_DESTINATION]: exchange,\n [ATTR_MESSAGING_DESTINATION_KIND]: MESSAGING_DESTINATION_KIND_VALUE_TOPIC,\n [ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: msg.fields?.routingKey,\n [ATTR_MESSAGING_OPERATION]: MESSAGING_OPERATION_VALUE_PROCESS,\n [OLD_ATTR_MESSAGING_MESSAGE_ID]: msg?.properties.messageId,\n [ATTR_MESSAGING_CONVERSATION_ID]: msg?.properties.correlationId,\n },\n links,\n },\n parentContext,\n );\n\n const { consumeHook } = self.getConfig();\n if (consumeHook) {\n safeExecuteInTheMiddle(\n () => consumeHook(span, { moduleVersion, msg }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: consumerHook error', e);\n }\n },\n true,\n );\n }\n\n if (!options?.noAck) {\n // store the message on the channel so we can close the span on ackAll etc\n channel[CHANNEL_SPANS_NOT_ENDED]!.push({\n msg,\n timeOfConsume: timestampInSeconds(),\n });\n\n // store the span on the message, so we can end it when user call 'ack' on it\n msg[MESSAGE_STORED_SPAN] = span;\n }\n const setContext: Context = parentContext ? parentContext : ROOT_CONTEXT;\n context.with(trace.setSpan(setContext, span), () => {\n onMessage.call(this, msg);\n });\n\n if (options?.noAck) {\n self.callConsumeEndHook(span, msg, false, EndOperation.AutoAck);\n span.end();\n }\n };\n arguments[1] = patchedOnMessage;\n return original.apply(this, arguments);\n };\n }\n\n private getConfirmedPublishPatch(moduleVersion: string | undefined, original: Function) {\n const self = this;\n return function confirmedPublish(\n this: InstrumentationConsumeChannel,\n exchange: string,\n routingKey: string,\n content: Buffer,\n options?: Options.Publish,\n callback?: (err: any, ok: Replies.Empty) => void,\n ): boolean {\n const channel = this;\n const { span, modifiedOptions } = self.createPublishSpan(self, exchange, routingKey, channel, options);\n\n const { publishHook } = self.getConfig();\n if (publishHook) {\n safeExecuteInTheMiddle(\n () =>\n publishHook(span, {\n moduleVersion,\n exchange,\n routingKey,\n content,\n options: modifiedOptions,\n isConfirmChannel: true,\n }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: publishHook error', e);\n }\n },\n true,\n );\n }\n\n const patchedOnConfirm = function (this: unknown, err: any, ok: Replies.Empty) {\n try {\n callback?.call(this, err, ok);\n } finally {\n const { publishConfirmHook } = self.getConfig();\n if (publishConfirmHook) {\n safeExecuteInTheMiddle(\n () =>\n publishConfirmHook(span, {\n moduleVersion,\n exchange,\n routingKey,\n content,\n options,\n isConfirmChannel: true,\n confirmError: err,\n }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: publishConfirmHook error', e);\n }\n },\n true,\n );\n }\n\n if (err) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: \"message confirmation has been nack'ed\",\n });\n }\n span.end();\n }\n };\n\n // calling confirm channel publish function is storing the message in queue and registering the callback for broker confirm.\n // span ends in the patched callback.\n const markedContext = markConfirmChannelTracing(context.active());\n const argumentsCopy = [...arguments];\n argumentsCopy[3] = modifiedOptions;\n argumentsCopy[4] = context.bind(\n unmarkConfirmChannelTracing(trace.setSpan(markedContext, span)),\n patchedOnConfirm,\n );\n return context.with(markedContext, original.bind(this, ...argumentsCopy));\n };\n }\n\n private getPublishPatch(moduleVersion: string | undefined, original: Function) {\n const self = this;\n return function publish(\n this: InstrumentationPublishChannel,\n exchange: string,\n routingKey: string,\n content: Buffer,\n options?: Options.Publish,\n ): boolean {\n if (isConfirmChannelTracing(context.active())) {\n // work already done\n return original.apply(this, arguments);\n } else {\n const channel = this;\n const { span, modifiedOptions } = self.createPublishSpan(self, exchange, routingKey, channel, options);\n\n const { publishHook } = self.getConfig();\n if (publishHook) {\n safeExecuteInTheMiddle(\n () =>\n publishHook(span, {\n moduleVersion,\n exchange,\n routingKey,\n content,\n options: modifiedOptions,\n isConfirmChannel: false,\n }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: publishHook error', e);\n }\n },\n true,\n );\n }\n\n // calling normal channel publish function is only storing the message in queue.\n // it does not send it and waits for an ack, so the span duration is expected to be very short.\n const argumentsCopy = [...arguments];\n argumentsCopy[3] = modifiedOptions;\n const originalRes = original.apply(this, argumentsCopy as any);\n span.end();\n return originalRes;\n }\n };\n }\n\n private createPublishSpan(\n self: this,\n exchange: string,\n routingKey: string,\n channel: InstrumentationPublishChannel,\n options?: Options.Publish,\n ) {\n const normalizedExchange = normalizeExchange(exchange);\n\n const span = self.tracer.startSpan(`publish ${normalizedExchange}`, {\n kind: SpanKind.PRODUCER,\n attributes: {\n ...channel.connection[CONNECTION_ATTRIBUTES],\n [ATTR_MESSAGING_DESTINATION]: exchange,\n [ATTR_MESSAGING_DESTINATION_KIND]: MESSAGING_DESTINATION_KIND_VALUE_TOPIC,\n\n [ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey,\n [OLD_ATTR_MESSAGING_MESSAGE_ID]: options?.messageId,\n [ATTR_MESSAGING_CONVERSATION_ID]: options?.correlationId,\n },\n });\n const modifiedOptions = options ?? {};\n modifiedOptions.headers = modifiedOptions.headers ?? {};\n\n propagation.inject(trace.setSpan(context.active(), span), modifiedOptions.headers);\n\n return { span, modifiedOptions };\n }\n\n private endConsumerSpan(\n message: InstrumentationMessage,\n isRejected: boolean | null,\n operation: EndOperation,\n requeue: boolean | undefined,\n ) {\n const storedSpan: Span | undefined = message[MESSAGE_STORED_SPAN];\n if (!storedSpan) return;\n if (isRejected !== false) {\n storedSpan.setStatus({\n code: SpanStatusCode.ERROR,\n message:\n operation !== EndOperation.ChannelClosed && operation !== EndOperation.ChannelError\n ? `${operation} called on message${\n requeue === true ? ' with requeue' : requeue === false ? ' without requeue' : ''\n }`\n : operation,\n });\n }\n this.callConsumeEndHook(storedSpan, message, isRejected, operation);\n storedSpan.end();\n message[MESSAGE_STORED_SPAN] = undefined;\n }\n\n private endAllSpansOnChannel(\n channel: InstrumentationConsumeChannel,\n isRejected: boolean,\n operation: EndOperation,\n requeue: boolean | undefined,\n ) {\n const spansNotEnded: { msg: Message }[] = channel[CHANNEL_SPANS_NOT_ENDED] ?? [];\n spansNotEnded.forEach(msgDetails => {\n this.endConsumerSpan(msgDetails.msg, isRejected, operation, requeue);\n });\n channel[CHANNEL_SPANS_NOT_ENDED] = [];\n }\n\n private callConsumeEndHook(\n span: Span,\n msg: InstrumentationMessage,\n rejected: boolean | null,\n endOperation: EndOperation,\n ) {\n const { consumeEndHook } = this.getConfig();\n if (!consumeEndHook) return;\n\n safeExecuteInTheMiddle(\n () => consumeEndHook(span, { msg, rejected, endOperation }),\n e => {\n if (e) {\n diag.error('amqplib instrumentation: consumerEndHook error', e);\n }\n },\n true,\n );\n }\n\n private checkConsumeTimeoutOnChannel(channel: InstrumentationConsumeChannel) {\n const currentTime = timestampInSeconds();\n const spansNotEnded = channel[CHANNEL_SPANS_NOT_ENDED] ?? [];\n let i: number;\n const { consumeTimeoutMs } = this.getConfig();\n for (i = 0; i < spansNotEnded.length; i++) {\n const currMessage = spansNotEnded[i]!;\n const timeFromConsumeMs = (currentTime - currMessage.timeOfConsume) * 1000;\n if (timeFromConsumeMs < consumeTimeoutMs!) {\n break;\n }\n this.endConsumerSpan(currMessage.msg, null, EndOperation.InstrumentationTimeout, true);\n }\n spansNotEnded.splice(0, i);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAgEA,MAAM,YAAA,GAAe,iCAAA;AACrB,MAAM,iBAAA,GAAoB,CAAC,YAAY,CAAA;AAEhC,MAAM,+BAA+B,mBAAA,CAAkD;AAAA,EAG5F,WAAA,CAAY,MAAA,GAAuC,EAAC,EAAG;AACrD,IAAA,KAAA,CAAM,cAAc,WAAA,EAAa,EAAE,GAAG,cAAA,EAAgB,GAAG,QAAQ,CAAA;AACjE,IAAA,IAAA,CAAK,2BAAA,EAA4B;AAAA,EACnC;AAAA;AAAA,EAGQ,2BAAA,GAA8B;AACpC,IAAA,IAAA,CAAK,oBAAA,GAAuB,uBAAA,CAA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A,EAAK,QAAA,EAAU,cAAc,CAAA;AAAA,MAC1D,CAAA,CAAA,KAAK;AACH,QAAA,IAAI,CAAA,EAAG;AACL,UAAA,IAAA,CAAK,KAAA,CAAM,kDAAkD,CAAC,CAAA;AAAA,QAChE;AAAA,MACF,CAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA,EAEQ,6BAA6B,OAAA,EAAwC;AAC3E,IAAA,MAAM,cAAc,kBAAA,EAAmB;AACvC,IAAA,MAAM,aAAA,GAAgB,OAAA,CAAQ,uBAAuB,CAAA,IAAK,EAAC;AAC3D,IAAA,IAAI,CAAA;AACJ,IAAA,MAAM,EAAE,gBAAA,EAAiB,GAAI,IAAA,CAAK,SAAA,EAAU;AAC5C,IAAA,KAAK,CAAA,GAAI,CAAA,EAAG,CAAA,GAAI,aAAA,CAAc,QAAQ,CAAA,EAAA,EAAK;AACzC,MAAA,MAAM,WAAA,GAAc,cAAc,CAAC,CAAA;AACnC,MAAA,MAAM,iBAAA,GAAA,CAAqB,WAAA,GAAc,WAAA,CAAY,aAAA,IAAiB,GAAA;AACtE,MAAA,IAAI,oBAAoB,gBAAA,EAAmB;AACzC,QAAA;AAAA,MACF;AACA,MAAA,IAAA,CAAK,gBAAgB,WAAA,CAAY,GAAA,EAAK,IAAA,EAAM,YAAA,CAAa,wBAAwB,IAAI,CAAA;AAAA,IACvF;AACA,IAAA,aAAA,CAAc,MAAA,CAAO,GAAG,CAAC,CAAA;AAAA,EAC3B;AACF;;;;"}
@@ -1,13 +0,0 @@
1
- const ATTR_MESSAGING_DESTINATION = "messaging.destination";
2
- const ATTR_MESSAGING_DESTINATION_KIND = "messaging.destination_kind";
3
- const ATTR_MESSAGING_RABBITMQ_ROUTING_KEY = "messaging.rabbitmq.routing_key";
4
- const MESSAGING_OPERATION_VALUE_PROCESS = "process";
5
- const ATTR_MESSAGING_PROTOCOL = "messaging.protocol";
6
- const ATTR_MESSAGING_PROTOCOL_VERSION = "messaging.protocol_version";
7
- const ATTR_MESSAGING_URL = "messaging.url";
8
- const MESSAGING_DESTINATION_KIND_VALUE_TOPIC = "topic";
9
- const OLD_ATTR_MESSAGING_MESSAGE_ID = "messaging.message_id";
10
- const ATTR_MESSAGING_CONVERSATION_ID = "messaging.conversation_id";
11
-
12
- export { ATTR_MESSAGING_CONVERSATION_ID, ATTR_MESSAGING_DESTINATION, ATTR_MESSAGING_DESTINATION_KIND, ATTR_MESSAGING_PROTOCOL, ATTR_MESSAGING_PROTOCOL_VERSION, ATTR_MESSAGING_RABBITMQ_ROUTING_KEY, ATTR_MESSAGING_URL, MESSAGING_DESTINATION_KIND_VALUE_TOPIC, MESSAGING_OPERATION_VALUE_PROCESS, OLD_ATTR_MESSAGING_MESSAGE_ID };
13
- //# sourceMappingURL=semconv-obsolete.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"semconv-obsolete.js","sources":["../../../../../../src/integrations/tracing/amqplib/vendored/semconv-obsolete.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-amqplib\n * - Upstream version: @opentelemetry/instrumentation-amqplib@0.65.0\n */\n/* eslint-disable */\n\n/*\n * This file contains constants for values that where replaced/removed from\n * Semantic Conventions long enough ago that they do not have `ATTR_*`\n * constants in the `@opentelemetry/semantic-conventions` package. Eventually\n * it is expected that this instrumention will be updated to emit telemetry\n * using modern Semantic Conventions, dropping the need for the constants in\n * this file.\n */\n\n/**\n * The message destination name. This might be equal to the span name but is required nevertheless.\n *\n * @deprecated Use ATTR_MESSAGING_DESTINATION_NAME in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n */\nexport const ATTR_MESSAGING_DESTINATION = 'messaging.destination' as const;\n\n/**\n * The kind of message destination.\n *\n * @deprecated Removed in semconv v1.20.0.\n */\nexport const ATTR_MESSAGING_DESTINATION_KIND = 'messaging.destination_kind' as const;\n\n/**\n * RabbitMQ message routing key.\n *\n * @deprecated Use ATTR_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n */\nexport const ATTR_MESSAGING_RABBITMQ_ROUTING_KEY = 'messaging.rabbitmq.routing_key' as const;\n\n/**\n * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is &#34;send&#34;, this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case.\n *\n * @deprecated Use MESSAGING_OPERATION_TYPE_VALUE_PROCESS in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n */\nexport const MESSAGING_OPERATION_VALUE_PROCESS = 'process' as const;\n\n/**\n * The name of the transport protocol.\n *\n * @deprecated Use ATTR_NETWORK_PROTOCOL_NAME.\n */\nexport const ATTR_MESSAGING_PROTOCOL = 'messaging.protocol' as const;\n\n/**\n * The version of the transport protocol.\n *\n * @deprecated Use ATTR_NETWORK_PROTOCOL_VERSION.\n */\nexport const ATTR_MESSAGING_PROTOCOL_VERSION = 'messaging.protocol_version' as const;\n\n/**\n * Connection string.\n *\n * @deprecated Removed in semconv v1.17.0.\n */\nexport const ATTR_MESSAGING_URL = 'messaging.url' as const;\n\n/**\n * The kind of message destination.\n *\n * @deprecated Removed in semconv v1.20.0.\n */\nexport const MESSAGING_DESTINATION_KIND_VALUE_TOPIC = 'topic' as const;\n\n/**\n * A value used by the messaging system as an identifier for the message, represented as a string.\n *\n * @deprecated Use ATTR_MESSAGING_MESSAGE_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n *\n * Note: changing to `ATTR_MESSAGING_MESSAGE_ID` means a change in value from `messaging.message_id` to `messaging.message.id`.\n */\nexport const OLD_ATTR_MESSAGING_MESSAGE_ID = 'messaging.message_id' as const;\n\n/**\n * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called &#34;Correlation ID&#34;.\n *\n * @deprecated Use ATTR_MESSAGING_MESSAGE_CONVERSATION_ID in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).\n */\nexport const ATTR_MESSAGING_CONVERSATION_ID = 'messaging.conversation_id' as const;\n"],"names":[],"mappings":"AAwBO,MAAM,0BAAA,GAA6B;AAOnC,MAAM,+BAAA,GAAkC;AAOxC,MAAM,mCAAA,GAAsC;AAO5C,MAAM,iCAAA,GAAoC;AAO1C,MAAM,uBAAA,GAA0B;AAOhC,MAAM,+BAAA,GAAkC;AAOxC,MAAM,kBAAA,GAAqB;AAO3B,MAAM,sCAAA,GAAyC;AAS/C,MAAM,6BAAA,GAAgC;AAOtC,MAAM,8BAAA,GAAiC;;;;"}