@sentry/node 10.53.0 → 10.54.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 (955) hide show
  1. package/build/cjs/debug-build.js +0 -5
  2. package/build/cjs/debug-build.js.map +1 -1
  3. package/build/cjs/index.js +68 -68
  4. package/build/cjs/init.js +0 -6
  5. package/build/cjs/init.js.map +1 -1
  6. package/build/cjs/integrations/featureFlagShims/growthbook.js +0 -4
  7. package/build/cjs/integrations/featureFlagShims/growthbook.js.map +1 -1
  8. package/build/cjs/integrations/featureFlagShims/launchDarkly.js +6 -18
  9. package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  10. package/build/cjs/integrations/featureFlagShims/openFeature.js +6 -21
  11. package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -1
  12. package/build/cjs/integrations/featureFlagShims/statsig.js +2 -8
  13. package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -1
  14. package/build/cjs/integrations/featureFlagShims/unleash.js +2 -8
  15. package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -1
  16. package/build/cjs/integrations/fs/index.js +107 -0
  17. package/build/cjs/integrations/fs/index.js.map +1 -0
  18. package/build/cjs/integrations/fs/vendored/constants.js +138 -0
  19. package/build/cjs/integrations/fs/vendored/constants.js.map +1 -0
  20. package/build/cjs/integrations/fs/vendored/instrumentation.js +311 -0
  21. package/build/cjs/integrations/fs/vendored/instrumentation.js.map +1 -0
  22. package/build/cjs/integrations/fs/vendored/utils.js +31 -0
  23. package/build/cjs/integrations/fs/vendored/utils.js.map +1 -0
  24. package/build/cjs/integrations/http.js +11 -37
  25. package/build/cjs/integrations/http.js.map +1 -1
  26. package/build/cjs/integrations/node-fetch/index.js +19 -46
  27. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  28. package/build/cjs/integrations/node-fetch/vendored/undici.js +71 -215
  29. package/build/cjs/integrations/node-fetch/vendored/undici.js.map +1 -1
  30. package/build/cjs/integrations/tracing/amqplib/index.js +29 -0
  31. package/build/cjs/integrations/tracing/amqplib/index.js.map +1 -0
  32. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js +452 -0
  33. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -0
  34. package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js +24 -0
  35. package/build/cjs/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -0
  36. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js +12 -0
  37. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
  38. package/build/cjs/integrations/tracing/amqplib/vendored/types.js +23 -0
  39. package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +1 -0
  40. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js +137 -0
  41. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -0
  42. package/build/cjs/integrations/tracing/anthropic-ai/index.js +3 -58
  43. package/build/cjs/integrations/tracing/anthropic-ai/index.js.map +1 -1
  44. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js +16 -39
  45. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
  46. package/build/cjs/integrations/tracing/connect/index.js +56 -0
  47. package/build/cjs/integrations/tracing/connect/index.js.map +1 -0
  48. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +22 -0
  49. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
  50. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +148 -0
  51. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -0
  52. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js +8 -0
  53. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +1 -0
  54. package/build/cjs/integrations/tracing/connect/vendored/utils.js +35 -0
  55. package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +1 -0
  56. package/build/cjs/integrations/tracing/dataloader/index.js +41 -0
  57. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -0
  58. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js +245 -0
  59. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
  60. package/build/cjs/integrations/tracing/express.js +15 -23
  61. package/build/cjs/integrations/tracing/express.js.map +1 -1
  62. package/build/cjs/integrations/tracing/fastify/index.js +46 -165
  63. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  64. package/build/cjs/integrations/tracing/fastify/v3/constants.js +1 -18
  65. package/build/cjs/integrations/tracing/fastify/v3/constants.js.map +1 -1
  66. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js +20 -33
  67. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -1
  68. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +68 -150
  69. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  70. package/build/cjs/integrations/tracing/fastify/v3/utils.js +8 -79
  71. package/build/cjs/integrations/tracing/fastify/v3/utils.js.map +1 -1
  72. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js +388 -0
  73. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -0
  74. package/build/cjs/integrations/tracing/firebase/firebase.js +15 -21
  75. package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -1
  76. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +6 -14
  77. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
  78. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +57 -161
  79. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  80. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js +81 -147
  81. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  82. package/build/cjs/integrations/tracing/genericPool/index.js +35 -0
  83. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -0
  84. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +122 -0
  85. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -0
  86. package/build/cjs/integrations/tracing/google-genai/index.js +3 -58
  87. package/build/cjs/integrations/tracing/google-genai/index.js.map +1 -1
  88. package/build/cjs/integrations/tracing/google-genai/instrumentation.js +18 -39
  89. package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +1 -1
  90. package/build/cjs/integrations/tracing/graphql/index.js +83 -0
  91. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -0
  92. package/build/cjs/integrations/tracing/graphql/vendored/enum.js +47 -0
  93. package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +1 -0
  94. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +17 -0
  95. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -0
  96. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +318 -0
  97. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -0
  98. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js +6 -0
  99. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +1 -0
  100. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js +8 -0
  101. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +1 -0
  102. package/build/cjs/integrations/tracing/graphql/vendored/utils.js +300 -0
  103. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +1 -0
  104. package/build/cjs/integrations/tracing/hapi/index.js +20 -78
  105. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  106. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js +11 -0
  107. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -0
  108. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +275 -0
  109. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -0
  110. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js +24 -0
  111. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +1 -0
  112. package/build/cjs/integrations/tracing/hapi/vendored/semconv.js +6 -0
  113. package/build/cjs/integrations/tracing/hapi/vendored/semconv.js.map +1 -0
  114. package/build/cjs/integrations/tracing/hapi/vendored/utils.js +91 -0
  115. package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +1 -0
  116. package/build/cjs/integrations/tracing/hono/constants.js +6 -7
  117. package/build/cjs/integrations/tracing/hono/constants.js.map +1 -1
  118. package/build/cjs/integrations/tracing/hono/index.js +19 -70
  119. package/build/cjs/integrations/tracing/hono/index.js.map +1 -1
  120. package/build/cjs/integrations/tracing/hono/instrumentation.js +47 -82
  121. package/build/cjs/integrations/tracing/hono/instrumentation.js.map +1 -1
  122. package/build/cjs/integrations/tracing/index.js +74 -82
  123. package/build/cjs/integrations/tracing/index.js.map +1 -1
  124. package/build/cjs/integrations/tracing/kafka/index.js +31 -0
  125. package/build/cjs/integrations/tracing/kafka/index.js.map +1 -0
  126. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +438 -0
  127. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
  128. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js +6 -0
  129. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js.map +1 -0
  130. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js +22 -0
  131. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js.map +1 -0
  132. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +38 -0
  133. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
  134. package/build/cjs/integrations/tracing/knex/index.js +36 -0
  135. package/build/cjs/integrations/tracing/knex/index.js.map +1 -0
  136. package/build/cjs/integrations/tracing/knex/vendored/constants.js +16 -0
  137. package/build/cjs/integrations/tracing/knex/vendored/constants.js.map +1 -0
  138. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +162 -0
  139. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
  140. package/build/cjs/integrations/tracing/knex/vendored/semconv.js +24 -0
  141. package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +1 -0
  142. package/build/cjs/integrations/tracing/knex/vendored/utils.js +97 -0
  143. package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +1 -0
  144. package/build/cjs/integrations/tracing/koa/index.js +69 -0
  145. package/build/cjs/integrations/tracing/koa/index.js.map +1 -0
  146. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js +10 -0
  147. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -0
  148. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +140 -0
  149. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -0
  150. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js +6 -0
  151. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +1 -0
  152. package/build/cjs/integrations/tracing/koa/vendored/types.js +10 -0
  153. package/build/cjs/integrations/tracing/koa/vendored/types.js.map +1 -0
  154. package/build/cjs/integrations/tracing/koa/vendored/utils.js +33 -0
  155. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +1 -0
  156. package/build/cjs/integrations/tracing/langchain/index.js +3 -97
  157. package/build/cjs/integrations/tracing/langchain/index.js.map +1 -1
  158. package/build/cjs/integrations/tracing/langchain/instrumentation.js +51 -146
  159. package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +1 -1
  160. package/build/cjs/integrations/tracing/langgraph/index.js +3 -73
  161. package/build/cjs/integrations/tracing/langgraph/index.js.map +1 -1
  162. package/build/cjs/integrations/tracing/langgraph/instrumentation.js +27 -38
  163. package/build/cjs/integrations/tracing/langgraph/instrumentation.js.map +1 -1
  164. package/build/cjs/integrations/tracing/lrumemoizer/index.js +21 -0
  165. package/build/cjs/integrations/tracing/lrumemoizer/index.js.map +1 -0
  166. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js +39 -0
  167. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
  168. package/build/cjs/integrations/tracing/mongo/index.js +62 -0
  169. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -0
  170. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +678 -0
  171. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
  172. package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js +14 -0
  173. package/build/cjs/integrations/tracing/mongo/vendored/internal-types.js.map +1 -0
  174. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js +26 -0
  175. package/build/cjs/integrations/tracing/mongo/vendored/semconv.js.map +1 -0
  176. package/build/cjs/integrations/tracing/mongoose/index.js +28 -0
  177. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -0
  178. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +375 -0
  179. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
  180. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js +22 -0
  181. package/build/cjs/integrations/tracing/mongoose/vendored/semconv.js.map +1 -0
  182. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +87 -0
  183. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +1 -0
  184. package/build/cjs/integrations/tracing/mysql/index.js +21 -0
  185. package/build/cjs/integrations/tracing/mysql/index.js.map +1 -0
  186. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js +9 -0
  187. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -0
  188. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js +278 -0
  189. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
  190. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js +22 -0
  191. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
  192. package/build/cjs/integrations/tracing/mysql/vendored/utils.js +63 -0
  193. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -0
  194. package/build/cjs/integrations/tracing/mysql2/index.js +28 -0
  195. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -0
  196. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +173 -0
  197. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
  198. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js +20 -0
  199. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
  200. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +97 -0
  201. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +1 -0
  202. package/build/cjs/integrations/tracing/openai/index.js +3 -58
  203. package/build/cjs/integrations/tracing/openai/index.js.map +1 -1
  204. package/build/cjs/integrations/tracing/openai/instrumentation.js +17 -41
  205. package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -1
  206. package/build/cjs/integrations/tracing/postgres/index.js +31 -0
  207. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -0
  208. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +12 -0
  209. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -0
  210. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js +11 -0
  211. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -0
  212. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +436 -0
  213. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
  214. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js +6 -0
  215. package/build/cjs/integrations/tracing/postgres/vendored/internal-types.js.map +1 -0
  216. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +32 -0
  217. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
  218. package/build/cjs/integrations/tracing/postgres/vendored/utils.js +275 -0
  219. package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +1 -0
  220. package/build/cjs/integrations/tracing/postgresjs.js +66 -181
  221. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  222. package/build/cjs/integrations/tracing/prisma/index.js +123 -0
  223. package/build/cjs/integrations/tracing/prisma/index.js.map +1 -0
  224. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js +119 -0
  225. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -0
  226. package/build/cjs/integrations/tracing/prisma/vendored/constants.js +14 -0
  227. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -0
  228. package/build/cjs/integrations/tracing/prisma/vendored/global.js +28 -0
  229. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -0
  230. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js +38 -0
  231. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -0
  232. package/build/cjs/integrations/tracing/redis/index.js +15 -72
  233. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  234. package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js +42 -77
  235. package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js.map +1 -1
  236. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +53 -98
  237. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  238. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js +9 -49
  239. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  240. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +175 -282
  241. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  242. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +7 -36
  243. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  244. package/build/cjs/integrations/tracing/tedious/index.js +45 -0
  245. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -0
  246. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +205 -0
  247. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
  248. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js +20 -0
  249. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +1 -0
  250. package/build/cjs/integrations/tracing/tedious/vendored/utils.js +29 -0
  251. package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +1 -0
  252. package/build/cjs/integrations/tracing/utils/sql-common.js +43 -0
  253. package/build/cjs/integrations/tracing/utils/sql-common.js.map +1 -0
  254. package/build/cjs/integrations/tracing/vercelai/constants.js +1 -1
  255. package/build/cjs/integrations/tracing/vercelai/index.js +3 -50
  256. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  257. package/build/cjs/integrations/tracing/vercelai/instrumentation.js +58 -157
  258. package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  259. package/build/cjs/preload.js +1 -14
  260. package/build/cjs/preload.js.map +1 -1
  261. package/build/cjs/sdk/index.js +6 -34
  262. package/build/cjs/sdk/index.js.map +1 -1
  263. package/build/cjs/sdk/initOtel.js +13 -51
  264. package/build/cjs/sdk/initOtel.js.map +1 -1
  265. package/build/cjs/utils/redisCache.js +24 -52
  266. package/build/cjs/utils/redisCache.js.map +1 -1
  267. package/build/esm/debug-build.js +0 -5
  268. package/build/esm/debug-build.js.map +1 -1
  269. package/build/esm/index.js +17 -17
  270. package/build/esm/init.js +0 -6
  271. package/build/esm/init.js.map +1 -1
  272. package/build/esm/integrations/featureFlagShims/growthbook.js +0 -4
  273. package/build/esm/integrations/featureFlagShims/growthbook.js.map +1 -1
  274. package/build/esm/integrations/featureFlagShims/launchDarkly.js +6 -18
  275. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  276. package/build/esm/integrations/featureFlagShims/openFeature.js +6 -21
  277. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -1
  278. package/build/esm/integrations/featureFlagShims/statsig.js +2 -8
  279. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -1
  280. package/build/esm/integrations/featureFlagShims/unleash.js +2 -8
  281. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -1
  282. package/build/esm/integrations/fs/index.js +105 -0
  283. package/build/esm/integrations/fs/index.js.map +1 -0
  284. package/build/esm/integrations/fs/vendored/constants.js +134 -0
  285. package/build/esm/integrations/fs/vendored/constants.js.map +1 -0
  286. package/build/esm/integrations/fs/vendored/instrumentation.js +309 -0
  287. package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -0
  288. package/build/esm/integrations/fs/vendored/utils.js +28 -0
  289. package/build/esm/integrations/fs/vendored/utils.js.map +1 -0
  290. package/build/esm/integrations/http.js +11 -37
  291. package/build/esm/integrations/http.js.map +1 -1
  292. package/build/esm/integrations/node-fetch/index.js +19 -46
  293. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  294. package/build/esm/integrations/node-fetch/vendored/undici.js +71 -215
  295. package/build/esm/integrations/node-fetch/vendored/undici.js.map +1 -1
  296. package/build/esm/integrations/tracing/amqplib/index.js +26 -0
  297. package/build/esm/integrations/tracing/amqplib/index.js.map +1 -0
  298. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js +450 -0
  299. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -0
  300. package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js +13 -0
  301. package/build/esm/integrations/tracing/amqplib/vendored/semconv-obsolete.js.map +1 -0
  302. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js +7 -0
  303. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +1 -0
  304. package/build/esm/integrations/tracing/amqplib/vendored/types.js +20 -0
  305. package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +1 -0
  306. package/build/esm/integrations/tracing/amqplib/vendored/utils.js +126 -0
  307. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -0
  308. package/build/esm/integrations/tracing/anthropic-ai/index.js +3 -58
  309. package/build/esm/integrations/tracing/anthropic-ai/index.js.map +1 -1
  310. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js +16 -39
  311. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
  312. package/build/esm/integrations/tracing/connect/index.js +52 -0
  313. package/build/esm/integrations/tracing/connect/index.js.map +1 -0
  314. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +18 -0
  315. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +1 -0
  316. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +145 -0
  317. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -0
  318. package/build/esm/integrations/tracing/connect/vendored/internal-types.js +6 -0
  319. package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +1 -0
  320. package/build/esm/integrations/tracing/connect/vendored/utils.js +31 -0
  321. package/build/esm/integrations/tracing/connect/vendored/utils.js.map +1 -0
  322. package/build/esm/integrations/tracing/dataloader/index.js +38 -0
  323. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -0
  324. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js +243 -0
  325. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -0
  326. package/build/esm/integrations/tracing/express.js +15 -23
  327. package/build/esm/integrations/tracing/express.js.map +1 -1
  328. package/build/esm/integrations/tracing/fastify/index.js +45 -164
  329. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  330. package/build/esm/integrations/tracing/fastify/v3/constants.js +1 -18
  331. package/build/esm/integrations/tracing/fastify/v3/constants.js.map +1 -1
  332. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js +17 -34
  333. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -1
  334. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +68 -150
  335. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  336. package/build/esm/integrations/tracing/fastify/v3/utils.js +8 -79
  337. package/build/esm/integrations/tracing/fastify/v3/utils.js.map +1 -1
  338. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js +386 -0
  339. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -0
  340. package/build/esm/integrations/tracing/firebase/firebase.js +15 -21
  341. package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -1
  342. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +6 -14
  343. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +1 -1
  344. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +57 -161
  345. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  346. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +81 -147
  347. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  348. package/build/esm/integrations/tracing/genericPool/index.js +32 -0
  349. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -0
  350. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +120 -0
  351. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -0
  352. package/build/esm/integrations/tracing/google-genai/index.js +3 -58
  353. package/build/esm/integrations/tracing/google-genai/index.js.map +1 -1
  354. package/build/esm/integrations/tracing/google-genai/instrumentation.js +18 -39
  355. package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +1 -1
  356. package/build/esm/integrations/tracing/graphql/index.js +80 -0
  357. package/build/esm/integrations/tracing/graphql/index.js.map +1 -0
  358. package/build/esm/integrations/tracing/graphql/vendored/enum.js +43 -0
  359. package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +1 -0
  360. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +15 -0
  361. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +1 -0
  362. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +316 -0
  363. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -0
  364. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js +4 -0
  365. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +1 -0
  366. package/build/esm/integrations/tracing/graphql/vendored/symbols.js +5 -0
  367. package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +1 -0
  368. package/build/esm/integrations/tracing/graphql/vendored/utils.js +291 -0
  369. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +1 -0
  370. package/build/esm/integrations/tracing/hapi/index.js +19 -77
  371. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  372. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js +9 -0
  373. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +1 -0
  374. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +273 -0
  375. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -0
  376. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js +19 -0
  377. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +1 -0
  378. package/build/esm/integrations/tracing/hapi/vendored/semconv.js +4 -0
  379. package/build/esm/integrations/tracing/hapi/vendored/semconv.js.map +1 -0
  380. package/build/esm/integrations/tracing/hapi/vendored/utils.js +82 -0
  381. package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +1 -0
  382. package/build/esm/integrations/tracing/hono/constants.js +6 -7
  383. package/build/esm/integrations/tracing/hono/constants.js.map +1 -1
  384. package/build/esm/integrations/tracing/hono/index.js +19 -70
  385. package/build/esm/integrations/tracing/hono/index.js.map +1 -1
  386. package/build/esm/integrations/tracing/hono/instrumentation.js +47 -82
  387. package/build/esm/integrations/tracing/hono/instrumentation.js.map +1 -1
  388. package/build/esm/integrations/tracing/index.js +16 -24
  389. package/build/esm/integrations/tracing/index.js.map +1 -1
  390. package/build/esm/integrations/tracing/kafka/index.js +28 -0
  391. package/build/esm/integrations/tracing/kafka/index.js.map +1 -0
  392. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +436 -0
  393. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -0
  394. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js +4 -0
  395. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js.map +1 -0
  396. package/build/esm/integrations/tracing/kafka/vendored/propagator.js +20 -0
  397. package/build/esm/integrations/tracing/kafka/vendored/propagator.js.map +1 -0
  398. package/build/esm/integrations/tracing/kafka/vendored/semconv.js +20 -0
  399. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -0
  400. package/build/esm/integrations/tracing/knex/index.js +33 -0
  401. package/build/esm/integrations/tracing/knex/index.js.map +1 -0
  402. package/build/esm/integrations/tracing/knex/vendored/constants.js +13 -0
  403. package/build/esm/integrations/tracing/knex/vendored/constants.js.map +1 -0
  404. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +160 -0
  405. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -0
  406. package/build/esm/integrations/tracing/knex/vendored/semconv.js +13 -0
  407. package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +1 -0
  408. package/build/esm/integrations/tracing/knex/vendored/utils.js +87 -0
  409. package/build/esm/integrations/tracing/knex/vendored/utils.js.map +1 -0
  410. package/build/esm/integrations/tracing/koa/index.js +65 -0
  411. package/build/esm/integrations/tracing/koa/index.js.map +1 -0
  412. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js +8 -0
  413. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +1 -0
  414. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +138 -0
  415. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -0
  416. package/build/esm/integrations/tracing/koa/vendored/internal-types.js +4 -0
  417. package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +1 -0
  418. package/build/esm/integrations/tracing/koa/vendored/types.js +8 -0
  419. package/build/esm/integrations/tracing/koa/vendored/types.js.map +1 -0
  420. package/build/esm/integrations/tracing/koa/vendored/utils.js +30 -0
  421. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +1 -0
  422. package/build/esm/integrations/tracing/langchain/index.js +3 -97
  423. package/build/esm/integrations/tracing/langchain/index.js.map +1 -1
  424. package/build/esm/integrations/tracing/langchain/instrumentation.js +52 -147
  425. package/build/esm/integrations/tracing/langchain/instrumentation.js.map +1 -1
  426. package/build/esm/integrations/tracing/langgraph/index.js +3 -73
  427. package/build/esm/integrations/tracing/langgraph/index.js.map +1 -1
  428. package/build/esm/integrations/tracing/langgraph/instrumentation.js +27 -38
  429. package/build/esm/integrations/tracing/langgraph/instrumentation.js.map +1 -1
  430. package/build/esm/integrations/tracing/lrumemoizer/index.js +18 -0
  431. package/build/esm/integrations/tracing/lrumemoizer/index.js.map +1 -0
  432. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js +37 -0
  433. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -0
  434. package/build/esm/integrations/tracing/mongo/index.js +58 -0
  435. package/build/esm/integrations/tracing/mongo/index.js.map +1 -0
  436. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +676 -0
  437. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -0
  438. package/build/esm/integrations/tracing/mongo/vendored/internal-types.js +12 -0
  439. package/build/esm/integrations/tracing/mongo/vendored/internal-types.js.map +1 -0
  440. package/build/esm/integrations/tracing/mongo/vendored/semconv.js +14 -0
  441. package/build/esm/integrations/tracing/mongo/vendored/semconv.js.map +1 -0
  442. package/build/esm/integrations/tracing/mongoose/index.js +25 -0
  443. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -0
  444. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +371 -0
  445. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +1 -0
  446. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js +12 -0
  447. package/build/esm/integrations/tracing/mongoose/vendored/semconv.js.map +1 -0
  448. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +83 -0
  449. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +1 -0
  450. package/build/esm/integrations/tracing/mysql/index.js +18 -0
  451. package/build/esm/integrations/tracing/mysql/index.js.map +1 -0
  452. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js +7 -0
  453. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +1 -0
  454. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js +276 -0
  455. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -0
  456. package/build/esm/integrations/tracing/mysql/vendored/semconv.js +12 -0
  457. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -0
  458. package/build/esm/integrations/tracing/mysql/vendored/utils.js +55 -0
  459. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -0
  460. package/build/esm/integrations/tracing/mysql2/index.js +25 -0
  461. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -0
  462. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +171 -0
  463. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -0
  464. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js +11 -0
  465. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +1 -0
  466. package/build/esm/integrations/tracing/mysql2/vendored/utils.js +91 -0
  467. package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +1 -0
  468. package/build/esm/integrations/tracing/openai/index.js +3 -58
  469. package/build/esm/integrations/tracing/openai/index.js.map +1 -1
  470. package/build/esm/integrations/tracing/openai/instrumentation.js +17 -41
  471. package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -1
  472. package/build/esm/integrations/tracing/postgres/index.js +28 -0
  473. package/build/esm/integrations/tracing/postgres/index.js.map +1 -0
  474. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +10 -0
  475. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +1 -0
  476. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js +9 -0
  477. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +1 -0
  478. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +434 -0
  479. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -0
  480. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js +4 -0
  481. package/build/esm/integrations/tracing/postgres/vendored/internal-types.js.map +1 -0
  482. package/build/esm/integrations/tracing/postgres/vendored/semconv.js +17 -0
  483. package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +1 -0
  484. package/build/esm/integrations/tracing/postgres/vendored/utils.js +257 -0
  485. package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +1 -0
  486. package/build/esm/integrations/tracing/postgresjs.js +66 -181
  487. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  488. package/build/esm/integrations/tracing/prisma/index.js +120 -0
  489. package/build/esm/integrations/tracing/prisma/index.js.map +1 -0
  490. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js +117 -0
  491. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -0
  492. package/build/esm/integrations/tracing/prisma/vendored/constants.js +9 -0
  493. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -0
  494. package/build/esm/integrations/tracing/prisma/vendored/global.js +24 -0
  495. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -0
  496. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js +36 -0
  497. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -0
  498. package/build/esm/integrations/tracing/redis/index.js +15 -72
  499. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  500. package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js +42 -77
  501. package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js.map +1 -1
  502. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +53 -98
  503. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  504. package/build/esm/integrations/tracing/redis/vendored/redis-common.js +9 -49
  505. package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +1 -1
  506. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +175 -282
  507. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  508. package/build/esm/integrations/tracing/redis/vendored/semconv.js +7 -36
  509. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -1
  510. package/build/esm/integrations/tracing/tedious/index.js +42 -0
  511. package/build/esm/integrations/tracing/tedious/index.js.map +1 -0
  512. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +202 -0
  513. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +1 -0
  514. package/build/esm/integrations/tracing/tedious/vendored/semconv.js +11 -0
  515. package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +1 -0
  516. package/build/esm/integrations/tracing/tedious/vendored/utils.js +26 -0
  517. package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +1 -0
  518. package/build/esm/integrations/tracing/utils/sql-common.js +41 -0
  519. package/build/esm/integrations/tracing/utils/sql-common.js.map +1 -0
  520. package/build/esm/integrations/tracing/vercelai/constants.js +1 -1
  521. package/build/esm/integrations/tracing/vercelai/index.js +3 -50
  522. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  523. package/build/esm/integrations/tracing/vercelai/instrumentation.js +58 -157
  524. package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  525. package/build/esm/package.json +1 -1
  526. package/build/esm/preload.js +1 -14
  527. package/build/esm/preload.js.map +1 -1
  528. package/build/esm/sdk/index.js +6 -34
  529. package/build/esm/sdk/index.js.map +1 -1
  530. package/build/esm/sdk/initOtel.js +13 -51
  531. package/build/esm/sdk/initOtel.js.map +1 -1
  532. package/build/esm/utils/redisCache.js +24 -52
  533. package/build/esm/utils/redisCache.js.map +1 -1
  534. package/build/types/integrations/{fs.d.ts → fs/index.d.ts} +1 -1
  535. package/build/types/integrations/fs/index.d.ts.map +1 -0
  536. package/build/types/integrations/fs/vendored/constants.d.ts +5 -0
  537. package/build/types/integrations/fs/vendored/constants.d.ts.map +1 -0
  538. package/build/types/integrations/fs/vendored/instrumentation.d.ts +15 -0
  539. package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -0
  540. package/build/types/integrations/fs/vendored/types.d.ts +29 -0
  541. package/build/types/integrations/fs/vendored/types.d.ts.map +1 -0
  542. package/build/types/integrations/fs/vendored/utils.d.ts +10 -0
  543. package/build/types/integrations/fs/vendored/utils.d.ts.map +1 -0
  544. package/build/{types-ts3.8/integrations/tracing/amqplib.d.ts → types/integrations/tracing/amqplib/index.d.ts} +20 -20
  545. package/build/types/integrations/tracing/amqplib/index.d.ts.map +1 -0
  546. package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +44 -0
  547. package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts.map +1 -0
  548. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts +26 -0
  549. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts.map +1 -0
  550. package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts +63 -0
  551. package/build/types/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts.map +1 -0
  552. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts +41 -0
  553. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +1 -0
  554. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts +130 -0
  555. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +1 -0
  556. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts +35 -0
  557. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -0
  558. package/build/types/integrations/tracing/{connect.d.ts → connect/index.d.ts} +2 -2
  559. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -0
  560. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +13 -0
  561. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +1 -0
  562. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +18 -0
  563. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -0
  564. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +31 -0
  565. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +1 -0
  566. package/build/types/integrations/tracing/connect/vendored/utils.d.ts +5 -0
  567. package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +1 -0
  568. package/build/types/integrations/tracing/{dataloader.d.ts → dataloader/index.d.ts} +2 -2
  569. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -0
  570. package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +14 -0
  571. package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts.map +1 -0
  572. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts +21 -0
  573. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -0
  574. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts +10 -0
  575. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -0
  576. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts +27 -0
  577. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +1 -0
  578. package/build/{types-ts3.8/integrations/tracing/genericPool.d.ts → types/integrations/tracing/genericPool/index.d.ts} +20 -20
  579. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -0
  580. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +5 -0
  581. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts.map +1 -0
  582. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts +10 -0
  583. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -0
  584. package/build/types/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +2 -2
  585. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -0
  586. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts +38 -0
  587. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +1 -0
  588. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +12 -0
  589. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +1 -0
  590. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts +136 -0
  591. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts.map +1 -0
  592. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +20 -0
  593. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -0
  594. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +63 -0
  595. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +1 -0
  596. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts +3 -0
  597. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +1 -0
  598. package/build/types/integrations/tracing/graphql/vendored/types.d.ts +71 -0
  599. package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +1 -0
  600. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +17 -0
  601. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +1 -0
  602. package/build/types/integrations/tracing/hapi/index.d.ts +1 -1
  603. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  604. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +6 -0
  605. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +1 -0
  606. package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts +70 -0
  607. package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts.map +1 -0
  608. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +72 -0
  609. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -0
  610. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts +32 -0
  611. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +1 -0
  612. package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts +13 -0
  613. package/build/types/integrations/tracing/hapi/vendored/semconv.d.ts.map +1 -0
  614. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +19 -0
  615. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +1 -0
  616. package/build/types/integrations/tracing/{kafka.d.ts → kafka/index.d.ts} +2 -2
  617. package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -0
  618. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +25 -0
  619. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -0
  620. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts +9 -0
  621. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts.map +1 -0
  622. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +111 -0
  623. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +1 -0
  624. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts +3 -0
  625. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts.map +1 -0
  626. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +131 -0
  627. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -0
  628. package/build/types/integrations/tracing/kafka/vendored/types.d.ts +26 -0
  629. package/build/types/integrations/tracing/kafka/vendored/types.d.ts.map +1 -0
  630. package/build/types/integrations/tracing/{knex.d.ts → knex/index.d.ts} +2 -2
  631. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -0
  632. package/build/types/integrations/tracing/knex/vendored/constants.d.ts +3 -0
  633. package/build/types/integrations/tracing/knex/vendored/constants.d.ts.map +1 -0
  634. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +14 -0
  635. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -0
  636. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +38 -0
  637. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +1 -0
  638. package/build/types/integrations/tracing/knex/vendored/types.d.ts +8 -0
  639. package/build/types/integrations/tracing/knex/vendored/types.d.ts.map +1 -0
  640. package/build/types/integrations/tracing/knex/vendored/utils.d.ts +15 -0
  641. package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +1 -0
  642. package/build/types/integrations/tracing/{koa.d.ts → koa/index.d.ts} +2 -2
  643. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -0
  644. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +5 -0
  645. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +1 -0
  646. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +32 -0
  647. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -0
  648. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +34 -0
  649. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +1 -0
  650. package/build/types/integrations/tracing/koa/vendored/types.d.ts +50 -0
  651. package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +1 -0
  652. package/build/types/integrations/tracing/koa/vendored/utils.d.ts +15 -0
  653. package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +1 -0
  654. package/build/types/integrations/tracing/langchain/instrumentation.d.ts.map +1 -1
  655. package/build/{types-ts3.8/integrations/tracing/lrumemoizer.d.ts → types/integrations/tracing/lrumemoizer/index.d.ts} +19 -19
  656. package/build/types/integrations/tracing/lrumemoizer/index.d.ts.map +1 -0
  657. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +6 -0
  658. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -0
  659. package/build/types/integrations/tracing/{mongo.d.ts → mongo/index.d.ts} +2 -2
  660. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -0
  661. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +79 -0
  662. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -0
  663. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +121 -0
  664. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +1 -0
  665. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts +107 -0
  666. package/build/types/integrations/tracing/mongo/vendored/semconv.d.ts.map +1 -0
  667. package/build/types/integrations/tracing/mongo/vendored/types.d.ts +51 -0
  668. package/build/types/integrations/tracing/mongo/vendored/types.d.ts.map +1 -0
  669. package/build/{types-ts3.8/integrations/tracing/mongoose.d.ts → types/integrations/tracing/mongoose/index.d.ts} +20 -20
  670. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -0
  671. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +30 -0
  672. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +1 -0
  673. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +24 -0
  674. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +1 -0
  675. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts +71 -0
  676. package/build/types/integrations/tracing/mongoose/vendored/semconv.d.ts.map +1 -0
  677. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts +36 -0
  678. package/build/types/integrations/tracing/mongoose/vendored/types.d.ts.map +1 -0
  679. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +8 -0
  680. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +1 -0
  681. package/build/types/integrations/tracing/{mysql.d.ts → mysql/index.d.ts} +2 -2
  682. package/build/types/integrations/tracing/mysql/index.d.ts.map +1 -0
  683. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts +4 -0
  684. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +1 -0
  685. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts +28 -0
  686. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -0
  687. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts +78 -0
  688. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -0
  689. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts +88 -0
  690. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -0
  691. package/build/types/integrations/tracing/mysql/vendored/types.d.ts +9 -0
  692. package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +1 -0
  693. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts +25 -0
  694. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -0
  695. package/build/types/integrations/tracing/{mysql2.d.ts → mysql2/index.d.ts} +2 -2
  696. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -0
  697. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +12 -0
  698. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -0
  699. package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +39 -0
  700. package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts.map +1 -0
  701. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts +9 -0
  702. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +1 -0
  703. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts +18 -0
  704. package/build/types/integrations/tracing/mysql2/vendored/types.d.ts.map +1 -0
  705. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +27 -0
  706. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +1 -0
  707. package/build/types/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +2 -2
  708. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -0
  709. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +7 -0
  710. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +1 -0
  711. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +6 -0
  712. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +1 -0
  713. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +20 -0
  714. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -0
  715. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +35 -0
  716. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +1 -0
  717. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +20 -0
  718. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +1 -0
  719. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts +54 -0
  720. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +1 -0
  721. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +112 -0
  722. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +1 -0
  723. package/build/types/integrations/tracing/postgres/vendored/types.d.ts +65 -0
  724. package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +1 -0
  725. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +69 -0
  726. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +1 -0
  727. package/build/types/integrations/tracing/{prisma.d.ts → prisma/index.d.ts} +2 -2
  728. package/build/types/integrations/tracing/prisma/index.d.ts.map +1 -0
  729. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +18 -0
  730. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -0
  731. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts +5 -0
  732. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -0
  733. package/build/types/integrations/tracing/prisma/vendored/global.d.ts +5 -0
  734. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -0
  735. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts +17 -0
  736. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -0
  737. package/build/types/integrations/tracing/prisma/vendored/types.d.ts +52 -0
  738. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -0
  739. package/build/types/integrations/tracing/prisma/vendored/v5-tracing-helper.d.ts.map +1 -0
  740. package/build/types/integrations/tracing/prisma/vendored/v6-tracing-helper.d.ts.map +1 -0
  741. package/build/types/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +2 -2
  742. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -0
  743. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +22 -0
  744. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +1 -0
  745. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts +80 -0
  746. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +1 -0
  747. package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts +21 -0
  748. package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts.map +1 -0
  749. package/build/types/integrations/tracing/tedious/vendored/types.d.ts +10 -0
  750. package/build/types/integrations/tracing/tedious/vendored/types.d.ts.map +1 -0
  751. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts +9 -0
  752. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +1 -0
  753. package/build/types/integrations/tracing/utils/sql-common.d.ts +3 -0
  754. package/build/types/integrations/tracing/utils/sql-common.d.ts.map +1 -0
  755. package/build/types-ts3.8/integrations/{fs.d.ts → fs/index.d.ts} +1 -1
  756. package/build/types-ts3.8/integrations/fs/vendored/constants.d.ts +5 -0
  757. package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +15 -0
  758. package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +29 -0
  759. package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +15 -0
  760. package/build/{types/integrations/tracing/amqplib.d.ts → types-ts3.8/integrations/tracing/amqplib/index.d.ts} +20 -20
  761. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +44 -0
  762. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib.d.ts +26 -0
  763. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv-obsolete.d.ts +63 -0
  764. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv.d.ts +41 -0
  765. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/types.d.ts +130 -0
  766. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/utils.d.ts +35 -0
  767. package/build/types-ts3.8/integrations/tracing/{connect.d.ts → connect/index.d.ts} +2 -2
  768. package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +13 -0
  769. package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +18 -0
  770. package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +36 -0
  771. package/build/types-ts3.8/integrations/tracing/connect/vendored/utils.d.ts +5 -0
  772. package/build/types-ts3.8/integrations/tracing/{dataloader.d.ts → dataloader/index.d.ts} +2 -2
  773. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +14 -0
  774. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/instrumentation.d.ts +21 -0
  775. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/types.d.ts +10 -0
  776. package/build/types-ts3.8/integrations/tracing/fastify/vendored/instrumentation.d.ts +27 -0
  777. package/build/{types/integrations/tracing/genericPool.d.ts → types-ts3.8/integrations/tracing/genericPool/index.d.ts} +20 -20
  778. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +5 -0
  779. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/instrumentation.d.ts +10 -0
  780. package/build/types-ts3.8/integrations/tracing/{graphql.d.ts → graphql/index.d.ts} +2 -2
  781. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enum.d.ts +38 -0
  782. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +12 -0
  783. package/build/types-ts3.8/integrations/tracing/graphql/vendored/graphql-types.d.ts +136 -0
  784. package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +20 -0
  785. package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +63 -0
  786. package/build/types-ts3.8/integrations/tracing/graphql/vendored/symbols.d.ts +3 -0
  787. package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +71 -0
  788. package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +17 -0
  789. package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +1 -1
  790. package/build/types-ts3.8/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +6 -0
  791. package/build/types-ts3.8/integrations/tracing/hapi/vendored/hapi-types.d.ts +70 -0
  792. package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +72 -0
  793. package/build/types-ts3.8/integrations/tracing/hapi/vendored/internal-types.d.ts +32 -0
  794. package/build/types-ts3.8/integrations/tracing/hapi/vendored/semconv.d.ts +13 -0
  795. package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +19 -0
  796. package/build/types-ts3.8/integrations/tracing/{kafka.d.ts → kafka/index.d.ts} +2 -2
  797. package/build/types-ts3.8/integrations/tracing/kafka/vendored/instrumentation.d.ts +25 -0
  798. package/build/types-ts3.8/integrations/tracing/kafka/vendored/internal-types.d.ts +9 -0
  799. package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +111 -0
  800. package/build/types-ts3.8/integrations/tracing/kafka/vendored/propagator.d.ts +3 -0
  801. package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +131 -0
  802. package/build/types-ts3.8/integrations/tracing/kafka/vendored/types.d.ts +26 -0
  803. package/build/types-ts3.8/integrations/tracing/{knex.d.ts → knex/index.d.ts} +2 -2
  804. package/build/types-ts3.8/integrations/tracing/knex/vendored/constants.d.ts +3 -0
  805. package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +14 -0
  806. package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +38 -0
  807. package/build/types-ts3.8/integrations/tracing/knex/vendored/types.d.ts +8 -0
  808. package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +15 -0
  809. package/build/types-ts3.8/integrations/tracing/{koa.d.ts → koa/index.d.ts} +2 -2
  810. package/build/types-ts3.8/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +5 -0
  811. package/build/types-ts3.8/integrations/tracing/koa/vendored/instrumentation.d.ts +32 -0
  812. package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +34 -0
  813. package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +50 -0
  814. package/build/types-ts3.8/integrations/tracing/koa/vendored/utils.d.ts +15 -0
  815. package/build/{types/integrations/tracing/lrumemoizer.d.ts → types-ts3.8/integrations/tracing/lrumemoizer/index.d.ts} +19 -19
  816. package/build/types-ts3.8/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +6 -0
  817. package/build/types-ts3.8/integrations/tracing/{mongo.d.ts → mongo/index.d.ts} +2 -2
  818. package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +79 -0
  819. package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +121 -0
  820. package/build/types-ts3.8/integrations/tracing/mongo/vendored/semconv.d.ts +107 -0
  821. package/build/types-ts3.8/integrations/tracing/mongo/vendored/types.d.ts +51 -0
  822. package/build/{types/integrations/tracing/mongoose.d.ts → types-ts3.8/integrations/tracing/mongoose/index.d.ts} +20 -20
  823. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +30 -0
  824. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +24 -0
  825. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/semconv.d.ts +71 -0
  826. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/types.d.ts +36 -0
  827. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +8 -0
  828. package/build/types-ts3.8/integrations/tracing/{mysql.d.ts → mysql/index.d.ts} +2 -2
  829. package/build/types-ts3.8/integrations/tracing/mysql/vendored/AttributeNames.d.ts +4 -0
  830. package/build/types-ts3.8/integrations/tracing/mysql/vendored/instrumentation.d.ts +28 -0
  831. package/build/types-ts3.8/integrations/tracing/mysql/vendored/mysql-types.d.ts +78 -0
  832. package/build/types-ts3.8/integrations/tracing/mysql/vendored/semconv.d.ts +88 -0
  833. package/build/types-ts3.8/integrations/tracing/mysql/vendored/types.d.ts +9 -0
  834. package/build/types-ts3.8/integrations/tracing/mysql/vendored/utils.d.ts +25 -0
  835. package/build/types-ts3.8/integrations/tracing/{mysql2.d.ts → mysql2/index.d.ts} +2 -2
  836. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +12 -0
  837. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +39 -0
  838. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/semconv.d.ts +9 -0
  839. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/types.d.ts +18 -0
  840. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +27 -0
  841. package/build/types-ts3.8/integrations/tracing/{postgres.d.ts → postgres/index.d.ts} +2 -2
  842. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +7 -0
  843. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +6 -0
  844. package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +20 -0
  845. package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +35 -0
  846. package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +20 -0
  847. package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-types.d.ts +54 -0
  848. package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +112 -0
  849. package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +65 -0
  850. package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +69 -0
  851. package/build/types-ts3.8/integrations/tracing/{prisma.d.ts → prisma/index.d.ts} +2 -2
  852. package/build/types-ts3.8/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +18 -0
  853. package/build/types-ts3.8/integrations/tracing/prisma/vendored/constants.d.ts +5 -0
  854. package/build/types-ts3.8/integrations/tracing/prisma/vendored/global.d.ts +5 -0
  855. package/build/types-ts3.8/integrations/tracing/prisma/vendored/instrumentation.d.ts +17 -0
  856. package/build/types-ts3.8/integrations/tracing/prisma/vendored/types.d.ts +55 -0
  857. package/build/types-ts3.8/integrations/tracing/{tedious.d.ts → tedious/index.d.ts} +2 -2
  858. package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +22 -0
  859. package/build/types-ts3.8/integrations/tracing/tedious/vendored/semconv.d.ts +80 -0
  860. package/build/types-ts3.8/integrations/tracing/tedious/vendored/tedious-types.d.ts +21 -0
  861. package/build/types-ts3.8/integrations/tracing/tedious/vendored/types.d.ts +10 -0
  862. package/build/types-ts3.8/integrations/tracing/tedious/vendored/utils.d.ts +9 -0
  863. package/build/types-ts3.8/integrations/tracing/utils/sql-common.d.ts +3 -0
  864. package/package.json +4 -24
  865. package/build/cjs/integrations/fs.js +0 -142
  866. package/build/cjs/integrations/fs.js.map +0 -1
  867. package/build/cjs/integrations/tracing/amqplib.js +0 -47
  868. package/build/cjs/integrations/tracing/amqplib.js.map +0 -1
  869. package/build/cjs/integrations/tracing/connect.js +0 -110
  870. package/build/cjs/integrations/tracing/connect.js.map +0 -1
  871. package/build/cjs/integrations/tracing/dataloader.js +0 -72
  872. package/build/cjs/integrations/tracing/dataloader.js.map +0 -1
  873. package/build/cjs/integrations/tracing/genericPool.js +0 -59
  874. package/build/cjs/integrations/tracing/genericPool.js.map +0 -1
  875. package/build/cjs/integrations/tracing/graphql.js +0 -127
  876. package/build/cjs/integrations/tracing/graphql.js.map +0 -1
  877. package/build/cjs/integrations/tracing/kafka.js +0 -48
  878. package/build/cjs/integrations/tracing/kafka.js.map +0 -1
  879. package/build/cjs/integrations/tracing/knex.js +0 -57
  880. package/build/cjs/integrations/tracing/knex.js.map +0 -1
  881. package/build/cjs/integrations/tracing/koa.js +0 -138
  882. package/build/cjs/integrations/tracing/koa.js.map +0 -1
  883. package/build/cjs/integrations/tracing/lrumemoizer.js +0 -37
  884. package/build/cjs/integrations/tracing/lrumemoizer.js.map +0 -1
  885. package/build/cjs/integrations/tracing/mongo.js +0 -93
  886. package/build/cjs/integrations/tracing/mongo.js.map +0 -1
  887. package/build/cjs/integrations/tracing/mongoose.js +0 -46
  888. package/build/cjs/integrations/tracing/mongoose.js.map +0 -1
  889. package/build/cjs/integrations/tracing/mysql.js +0 -38
  890. package/build/cjs/integrations/tracing/mysql.js.map +0 -1
  891. package/build/cjs/integrations/tracing/mysql2.js +0 -46
  892. package/build/cjs/integrations/tracing/mysql2.js.map +0 -1
  893. package/build/cjs/integrations/tracing/postgres.js +0 -48
  894. package/build/cjs/integrations/tracing/postgres.js.map +0 -1
  895. package/build/cjs/integrations/tracing/prisma.js +0 -207
  896. package/build/cjs/integrations/tracing/prisma.js.map +0 -1
  897. package/build/cjs/integrations/tracing/tedious.js +0 -67
  898. package/build/cjs/integrations/tracing/tedious.js.map +0 -1
  899. package/build/esm/integrations/fs.js +0 -140
  900. package/build/esm/integrations/fs.js.map +0 -1
  901. package/build/esm/integrations/tracing/amqplib.js +0 -44
  902. package/build/esm/integrations/tracing/amqplib.js.map +0 -1
  903. package/build/esm/integrations/tracing/connect.js +0 -106
  904. package/build/esm/integrations/tracing/connect.js.map +0 -1
  905. package/build/esm/integrations/tracing/dataloader.js +0 -69
  906. package/build/esm/integrations/tracing/dataloader.js.map +0 -1
  907. package/build/esm/integrations/tracing/genericPool.js +0 -56
  908. package/build/esm/integrations/tracing/genericPool.js.map +0 -1
  909. package/build/esm/integrations/tracing/graphql.js +0 -124
  910. package/build/esm/integrations/tracing/graphql.js.map +0 -1
  911. package/build/esm/integrations/tracing/kafka.js +0 -45
  912. package/build/esm/integrations/tracing/kafka.js.map +0 -1
  913. package/build/esm/integrations/tracing/knex.js +0 -54
  914. package/build/esm/integrations/tracing/knex.js.map +0 -1
  915. package/build/esm/integrations/tracing/koa.js +0 -134
  916. package/build/esm/integrations/tracing/koa.js.map +0 -1
  917. package/build/esm/integrations/tracing/lrumemoizer.js +0 -34
  918. package/build/esm/integrations/tracing/lrumemoizer.js.map +0 -1
  919. package/build/esm/integrations/tracing/mongo.js +0 -89
  920. package/build/esm/integrations/tracing/mongo.js.map +0 -1
  921. package/build/esm/integrations/tracing/mongoose.js +0 -43
  922. package/build/esm/integrations/tracing/mongoose.js.map +0 -1
  923. package/build/esm/integrations/tracing/mysql.js +0 -35
  924. package/build/esm/integrations/tracing/mysql.js.map +0 -1
  925. package/build/esm/integrations/tracing/mysql2.js +0 -43
  926. package/build/esm/integrations/tracing/mysql2.js.map +0 -1
  927. package/build/esm/integrations/tracing/postgres.js +0 -45
  928. package/build/esm/integrations/tracing/postgres.js.map +0 -1
  929. package/build/esm/integrations/tracing/prisma.js +0 -204
  930. package/build/esm/integrations/tracing/prisma.js.map +0 -1
  931. package/build/esm/integrations/tracing/tedious.js +0 -64
  932. package/build/esm/integrations/tracing/tedious.js.map +0 -1
  933. package/build/types/integrations/fs.d.ts.map +0 -1
  934. package/build/types/integrations/tracing/amqplib.d.ts.map +0 -1
  935. package/build/types/integrations/tracing/connect.d.ts.map +0 -1
  936. package/build/types/integrations/tracing/dataloader.d.ts.map +0 -1
  937. package/build/types/integrations/tracing/genericPool.d.ts.map +0 -1
  938. package/build/types/integrations/tracing/graphql.d.ts.map +0 -1
  939. package/build/types/integrations/tracing/kafka.d.ts.map +0 -1
  940. package/build/types/integrations/tracing/knex.d.ts.map +0 -1
  941. package/build/types/integrations/tracing/koa.d.ts.map +0 -1
  942. package/build/types/integrations/tracing/lrumemoizer.d.ts.map +0 -1
  943. package/build/types/integrations/tracing/mongo.d.ts.map +0 -1
  944. package/build/types/integrations/tracing/mongoose.d.ts.map +0 -1
  945. package/build/types/integrations/tracing/mysql.d.ts.map +0 -1
  946. package/build/types/integrations/tracing/mysql2.d.ts.map +0 -1
  947. package/build/types/integrations/tracing/postgres.d.ts.map +0 -1
  948. package/build/types/integrations/tracing/prisma/vendor/v5-tracing-helper.d.ts.map +0 -1
  949. package/build/types/integrations/tracing/prisma/vendor/v6-tracing-helper.d.ts.map +0 -1
  950. package/build/types/integrations/tracing/prisma.d.ts.map +0 -1
  951. package/build/types/integrations/tracing/tedious.d.ts.map +0 -1
  952. /package/build/types/integrations/tracing/prisma/{vendor → vendored}/v5-tracing-helper.d.ts +0 -0
  953. /package/build/types/integrations/tracing/prisma/{vendor → vendored}/v6-tracing-helper.d.ts +0 -0
  954. /package/build/types-ts3.8/integrations/tracing/prisma/{vendor → vendored}/v5-tracing-helper.d.ts +0 -0
  955. /package/build/types-ts3.8/integrations/tracing/prisma/{vendor → vendored}/v6-tracing-helper.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"undici.js","sources":["../../../../../src/integrations/node-fetch/vendored/undici.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/ed97091c9890dd18e52759f2ea98e9d7593b3ae4/packages/instrumentation-undici\n * - Upstream version: @opentelemetry/instrumentation-undici@0.24.0\n * - Tracking issue: https://github.com/getsentry/sentry-javascript/issues/20165\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable -- vendored @opentelemetry/instrumentation-undici (#20165) */\n\nimport * as diagch from 'diagnostics_channel';\nimport { URL } from 'url';\n\nimport { InstrumentationBase, safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';\nimport type { Attributes, Histogram, HrTime, Span } from '@opentelemetry/api';\nimport {\n context,\n INVALID_SPAN_CONTEXT,\n propagation,\n SpanKind,\n SpanStatusCode,\n trace,\n ValueType,\n} from '@opentelemetry/api';\nimport { hrTime, hrTimeDuration, hrTimeToMilliseconds } from '@opentelemetry/core';\nimport {\n ATTR_ERROR_TYPE,\n ATTR_HTTP_REQUEST_METHOD,\n ATTR_HTTP_REQUEST_METHOD_ORIGINAL,\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n ATTR_NETWORK_PEER_ADDRESS,\n ATTR_NETWORK_PEER_PORT,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n ATTR_URL_FULL,\n ATTR_URL_PATH,\n ATTR_URL_QUERY,\n ATTR_URL_SCHEME,\n ATTR_USER_AGENT_ORIGINAL,\n METRIC_HTTP_CLIENT_REQUEST_DURATION,\n} from '@opentelemetry/semantic-conventions';\n\nimport type {\n ListenerRecord,\n RequestHeadersMessage,\n RequestMessage,\n RequestTrailersMessage,\n ResponseHeadersMessage,\n} from './internal-types';\nimport type { UndiciInstrumentationConfig, UndiciRequest } from './types';\n\nimport { SDK_VERSION } from '@sentry/core';\n\ninterface InstrumentationRecord {\n span: Span;\n attributes: Attributes;\n startTime: HrTime;\n}\n\nconst PACKAGE_NAME = '@sentry/instrumentation-undici';\n\n// A combination of https://github.com/elastic/apm-agent-nodejs and\n// https://github.com/gadget-inc/opentelemetry-instrumentations/blob/main/packages/opentelemetry-instrumentation-undici/src/index.ts\nexport class UndiciInstrumentation extends InstrumentationBase<UndiciInstrumentationConfig> {\n // Keep ref to avoid https://github.com/nodejs/node/issues/42170 bug and for\n // unsubscribing.\n declare private _channelSubs: Array<ListenerRecord>;\n private _recordFromReq = new WeakMap<UndiciRequest, InstrumentationRecord>();\n\n declare private _httpClientDurationHistogram: Histogram;\n\n constructor(config: UndiciInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n // No need to instrument files/modules\n protected override init() {\n return undefined;\n }\n\n override disable(): void {\n super.disable();\n this._channelSubs.forEach(sub => sub.unsubscribe());\n this._channelSubs.length = 0;\n }\n\n override enable(): void {\n // \"enabled\" handling is currently a bit messy with InstrumentationBase.\n // If constructed with `{enabled: false}`, this `.enable()` is still called,\n // and `this.getConfig().enabled !== this.isEnabled()`, creating confusion.\n //\n // For now, this class will setup for instrumenting if `.enable()` is\n // called, but use `this.getConfig().enabled` to determine if\n // instrumentation should be generated. This covers the more likely common\n // case of config being given a construction time, rather than later via\n // `instance.enable()`, `.disable()`, or `.setConfig()` calls.\n super.enable();\n\n // This method is called by the super-class constructor before ours is\n // called. So we need to ensure the property is initalized.\n this._channelSubs = this._channelSubs || [];\n\n // Avoid to duplicate subscriptions\n if (this._channelSubs.length > 0) {\n return;\n }\n\n this.subscribeToChannel('undici:request:create', this.onRequestCreated.bind(this));\n this.subscribeToChannel('undici:client:sendHeaders', this.onRequestHeaders.bind(this));\n this.subscribeToChannel('undici:request:headers', this.onResponseHeaders.bind(this));\n this.subscribeToChannel('undici:request:trailers', this.onDone.bind(this));\n this.subscribeToChannel('undici:request:error', this.onError.bind(this));\n }\n\n protected override _updateMetricInstruments() {\n this._httpClientDurationHistogram = this.meter.createHistogram(METRIC_HTTP_CLIENT_REQUEST_DURATION, {\n description: 'Measures the duration of outbound HTTP requests.',\n unit: 's',\n valueType: ValueType.DOUBLE,\n advice: {\n explicitBucketBoundaries: [0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10],\n },\n });\n }\n\n private subscribeToChannel(diagnosticChannel: string, onMessage: (message: any, name: string | symbol) => void) {\n // `diagnostics_channel` had a ref counting bug until v18.19.0.\n // https://github.com/nodejs/node/pull/47520\n const [major = 0, minor = 0] = process.version\n .replace('v', '')\n .split('.')\n .map(n => Number(n));\n const useNewSubscribe = major > 18 || (major === 18 && minor >= 19);\n\n let unsubscribe: () => void;\n if (useNewSubscribe) {\n diagch.subscribe?.(diagnosticChannel, onMessage);\n unsubscribe = () => diagch.unsubscribe?.(diagnosticChannel, onMessage);\n } else {\n const channel = diagch.channel(diagnosticChannel);\n channel.subscribe(onMessage);\n unsubscribe = () => channel.unsubscribe(onMessage);\n }\n\n this._channelSubs.push({\n name: diagnosticChannel,\n unsubscribe,\n });\n }\n\n private parseRequestHeaders(request: UndiciRequest) {\n const result = new Map<string, string | string[]>();\n\n if (Array.isArray(request.headers)) {\n // headers are an array [k1, v2, k2, v2] (undici v6+)\n // values could be string or a string[] for multiple values\n for (let i = 0; i < request.headers.length; i += 2) {\n const key = request.headers[i];\n const value = request.headers[i + 1];\n\n // Key should always be a string, but the types don't know that, and let's be safe\n if (typeof key === 'string' && value !== undefined) {\n result.set(key.toLowerCase(), value);\n }\n }\n } else if (typeof request.headers === 'string') {\n // headers are a raw string (undici v5)\n // headers could be repeated in several lines for multiple values\n const headers = request.headers.split('\\r\\n');\n for (const line of headers) {\n if (!line) {\n continue;\n }\n const colonIndex = line.indexOf(':');\n if (colonIndex === -1) {\n // Invalid header? Probably this can't happen, but again let's be safe.\n continue;\n }\n const key = line.substring(0, colonIndex).toLowerCase();\n const value = line.substring(colonIndex + 1).trim();\n const allValues = result.get(key);\n\n if (allValues && Array.isArray(allValues)) {\n allValues.push(value);\n } else if (allValues) {\n result.set(key, [allValues, value]);\n } else {\n result.set(key, value);\n }\n }\n }\n return result;\n }\n\n // This is the 1st message we receive for each request (fired after request creation). Here we will\n // create the span and populate some atttributes, then link the span to the request for further\n // span processing\n private onRequestCreated({ request }: RequestMessage): void {\n // Ignore if:\n // - instrumentation is disabled\n // - ignored by config\n // - method is 'CONNECT'\n const config = this.getConfig();\n const enabled = config.enabled !== false;\n const shouldIgnoreReq = safeExecuteInTheMiddle(\n () => !enabled || request.method === 'CONNECT' || config.ignoreRequestHook?.(request),\n e => e && this._diag.error('caught ignoreRequestHook error: ', e),\n true,\n );\n\n if (shouldIgnoreReq) {\n return;\n }\n\n const startTime = hrTime();\n let requestUrl;\n try {\n requestUrl = new URL(request.path, request.origin);\n } catch (err) {\n this._diag.warn('could not determine url.full:', err);\n // Skip instrumenting this request.\n return;\n }\n const urlScheme = requestUrl.protocol.replace(':', '');\n const requestMethod = this.getRequestMethod(request.method);\n const attributes: Attributes = {\n [ATTR_HTTP_REQUEST_METHOD]: requestMethod,\n [ATTR_HTTP_REQUEST_METHOD_ORIGINAL]: request.method,\n [ATTR_URL_FULL]: requestUrl.toString(),\n [ATTR_URL_PATH]: requestUrl.pathname,\n [ATTR_URL_QUERY]: requestUrl.search,\n [ATTR_URL_SCHEME]: urlScheme,\n };\n\n const schemePorts: Record<string, string> = { https: '443', http: '80' };\n const serverAddress = requestUrl.hostname;\n const serverPort = requestUrl.port || schemePorts[urlScheme];\n\n attributes[ATTR_SERVER_ADDRESS] = serverAddress;\n if (serverPort && !isNaN(Number(serverPort))) {\n attributes[ATTR_SERVER_PORT] = Number(serverPort);\n }\n\n // Get user agent from headers\n const headersMap = this.parseRequestHeaders(request);\n const userAgentValues = headersMap.get('user-agent');\n\n if (userAgentValues) {\n // NOTE: having multiple user agents is not expected so\n // we're going to take last one like `curl` does\n // ref: https://curl.se/docs/manpage.html#-A\n const userAgent = Array.isArray(userAgentValues) ? userAgentValues[userAgentValues.length - 1] : userAgentValues;\n attributes[ATTR_USER_AGENT_ORIGINAL] = userAgent;\n }\n\n // Get attributes from the hook if present\n const hookAttributes = safeExecuteInTheMiddle(\n () => config.startSpanHook?.(request),\n e => e && this._diag.error('caught startSpanHook error: ', e),\n true,\n );\n if (hookAttributes) {\n Object.entries(hookAttributes).forEach(([key, val]) => {\n attributes[key] = val;\n });\n }\n\n // Check if parent span is required via config and:\n // - if a parent is required but not present, we use a `NoopSpan` to still\n // propagate context without recording it.\n // - create a span otherwise\n const activeCtx = context.active();\n const currentSpan = trace.getSpan(activeCtx);\n let span: Span;\n\n if (config.requireParentforSpans && (!currentSpan || !trace.isSpanContextValid(currentSpan.spanContext()))) {\n span = trace.wrapSpanContext(INVALID_SPAN_CONTEXT);\n } else {\n span = this.tracer.startSpan(\n requestMethod === '_OTHER' ? 'HTTP' : requestMethod,\n {\n kind: SpanKind.CLIENT,\n attributes: attributes,\n },\n activeCtx,\n );\n }\n\n // Execute the request hook if defined\n safeExecuteInTheMiddle(\n () => config.requestHook?.(span, request),\n e => e && this._diag.error('caught requestHook error: ', e),\n true,\n );\n\n // Context propagation goes last so no hook can tamper\n // the propagation headers\n const requestContext = trace.setSpan(context.active(), span);\n const addedHeaders: Record<string, string> = {};\n propagation.inject(requestContext, addedHeaders);\n\n const headerEntries = Object.entries(addedHeaders);\n\n for (let i = 0; i < headerEntries.length; i++) {\n const pair = headerEntries[i];\n if (!pair) {\n continue;\n }\n const [k, v] = pair;\n\n if (typeof request.addHeader === 'function') {\n request.addHeader(k, v);\n } else if (typeof request.headers === 'string') {\n request.headers += `${k}: ${v}\\r\\n`;\n } else if (Array.isArray(request.headers)) {\n // undici@6.11.0 accidentally, briefly removed `request.addHeader()`.\n request.headers.push(k, v);\n }\n }\n this._recordFromReq.set(request, { span, attributes, startTime });\n }\n\n // This is the 2nd message we receive for each request. It is fired when connection with\n // the remote is established and about to send the first byte. Here we do have info about the\n // remote address and port so we can populate some `network.*` attributes into the span\n private onRequestHeaders({ request, socket }: RequestHeadersMessage): void {\n const record = this._recordFromReq.get(request);\n\n if (!record) {\n return;\n }\n\n const config = this.getConfig();\n const { span } = record;\n const { remoteAddress, remotePort } = socket;\n const spanAttributes: Attributes = {\n [ATTR_NETWORK_PEER_ADDRESS]: remoteAddress,\n [ATTR_NETWORK_PEER_PORT]: remotePort,\n };\n\n // After hooks have been processed (which may modify request headers)\n // we can collect the headers based on the configuration\n if (config.headersToSpanAttributes?.requestHeaders) {\n const headersToAttribs = new Set(config.headersToSpanAttributes.requestHeaders.map(n => n.toLowerCase()));\n const headersMap = this.parseRequestHeaders(request);\n\n for (const [name, value] of headersMap.entries()) {\n if (headersToAttribs.has(name)) {\n const attrValue = Array.isArray(value) ? value : [value];\n spanAttributes[`http.request.header.${name}`] = attrValue;\n }\n }\n }\n\n span.setAttributes(spanAttributes);\n }\n\n // This is the 3rd message we get for each request and it's fired when the server\n // headers are received, body may not be accessible yet.\n // From the response headers we can set the status and content length\n private onResponseHeaders({ request, response }: ResponseHeadersMessage): void {\n const record = this._recordFromReq.get(request);\n\n if (!record) {\n return;\n }\n\n const { span, attributes } = record;\n const spanAttributes: Attributes = {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: response.statusCode,\n };\n\n const config = this.getConfig();\n\n // Execute the response hook if defined\n safeExecuteInTheMiddle(\n () => config.responseHook?.(span, { request, response }),\n e => e && this._diag.error('caught responseHook error: ', e),\n true,\n );\n\n if (config.headersToSpanAttributes?.responseHeaders) {\n const headersToAttribs = new Set();\n config.headersToSpanAttributes?.responseHeaders.forEach(name => headersToAttribs.add(name.toLowerCase()));\n\n for (let idx = 0; idx < response.headers.length; idx = idx + 2) {\n const nameBuf = response.headers[idx];\n const valueBuf = response.headers[idx + 1];\n if (nameBuf === undefined || valueBuf === undefined) {\n continue;\n }\n const name = nameBuf.toString().toLowerCase();\n const value = valueBuf;\n\n if (headersToAttribs.has(name)) {\n const attrName = `http.response.header.${name}`;\n if (!Object.prototype.hasOwnProperty.call(spanAttributes, attrName)) {\n spanAttributes[attrName] = [value.toString()];\n } else {\n (spanAttributes[attrName] as string[]).push(value.toString());\n }\n }\n }\n }\n\n span.setAttributes(spanAttributes);\n span.setStatus({\n code: response.statusCode >= 400 ? SpanStatusCode.ERROR : SpanStatusCode.UNSET,\n });\n record.attributes = Object.assign(attributes, spanAttributes);\n }\n\n // This is the last event we receive if the request went without any errors\n private onDone({ request }: RequestTrailersMessage): void {\n const record = this._recordFromReq.get(request);\n\n if (!record) {\n return;\n }\n\n const { span, attributes, startTime } = record;\n\n // End the span\n span.end();\n this._recordFromReq.delete(request);\n\n // Record metrics\n this.recordRequestDuration(attributes, startTime);\n }\n\n // This is the event we get when something is wrong in the request like\n // - invalid options when calling `fetch` global API or any undici method for request\n // - connectivity errors such as unreachable host\n // - requests aborted through an `AbortController.signal`\n // NOTE: server errors are considered valid responses and it's the lib consumer\n // who should deal with that.\n private onError({ request, error }: any): void {\n const record = this._recordFromReq.get(request);\n\n if (!record) {\n return;\n }\n\n const { span, attributes, startTime } = record;\n\n // NOTE: in `undici@6.3.0` when request aborted the error type changes from\n // a custom error (`RequestAbortedError`) to a built-in `DOMException` carrying\n // some differences:\n // - `code` is from DOMEXception (ABORT_ERR: 20)\n // - `message` changes\n // - stacktrace is smaller and contains node internal frames\n span.recordException(error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n span.end();\n this._recordFromReq.delete(request);\n\n // Record metrics (with the error)\n attributes[ATTR_ERROR_TYPE] = error.message;\n this.recordRequestDuration(attributes, startTime);\n }\n\n private recordRequestDuration(attributes: Attributes, startTime: HrTime) {\n // Time to record metrics\n const metricsAttributes: Attributes = {};\n // Get the attribs already in span attributes\n const keysToCopy = [\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n ATTR_HTTP_REQUEST_METHOD,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n ATTR_URL_SCHEME,\n ATTR_ERROR_TYPE,\n ];\n keysToCopy.forEach(key => {\n if (key in attributes) {\n metricsAttributes[key] = attributes[key];\n }\n });\n\n // Take the duration and record it\n const durationSeconds = hrTimeToMilliseconds(hrTimeDuration(startTime, hrTime())) / 1000;\n this._httpClientDurationHistogram.record(durationSeconds, metricsAttributes);\n }\n\n private getRequestMethod(original: string): string {\n const knownMethods = {\n CONNECT: true,\n OPTIONS: true,\n HEAD: true,\n GET: true,\n POST: true,\n PUT: true,\n PATCH: true,\n DELETE: true,\n TRACE: true,\n // QUERY from https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/\n QUERY: true,\n };\n\n if (original.toUpperCase() in knownMethods) {\n return original.toUpperCase();\n }\n\n return '_OTHER';\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","METRIC_HTTP_CLIENT_REQUEST_DURATION","ValueType","safeExecuteInTheMiddle","hrTime","URL","ATTR_HTTP_REQUEST_METHOD","ATTR_HTTP_REQUEST_METHOD_ORIGINAL","ATTR_URL_FULL","ATTR_URL_PATH","ATTR_URL_QUERY","ATTR_URL_SCHEME","ATTR_SERVER_ADDRESS","ATTR_SERVER_PORT","ATTR_USER_AGENT_ORIGINAL","context","trace","INVALID_SPAN_CONTEXT","SpanKind","propagation","ATTR_NETWORK_PEER_ADDRESS","ATTR_NETWORK_PEER_PORT","ATTR_HTTP_RESPONSE_STATUS_CODE","SpanStatusCode","ATTR_ERROR_TYPE","hrTimeToMilliseconds","hrTimeDuration"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAmDA,MAAM,YAAA,GAAe,gCAAgC;;AAErD;AACA;AACO,MAAM,qBAAA,SAA8BA,mCAAmB,CAA8B;AAC5F;AACA;;AAEA,kBAAU,cAAA,GAAiB,IAAI,OAAO,GAAuC;;AAI7E,EAAE,WAAW,CAAC,MAAM,GAAgC,EAAE,EAAE;AAC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AACA,IAAA,MAAA,iBAAA,GAAA,EAAA;AACA;AACA,IAAA,MAAA,UAAA,GAAA;AACA,MAAAF,kDAAA;AACA,MAAAhB,4CAAA;AACA,MAAAM,uCAAA;AACA,MAAAC,oCAAA;AACA,MAAAF,mCAAA;AACA,MAAAa,mCAAA;AACA,KAAA;AACA,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,IAAA;AACA,MAAA,IAAA,GAAA,IAAA,UAAA,EAAA;AACA,QAAA,iBAAA,CAAA,GAAA,CAAA,GAAA,UAAA,CAAA,GAAA,CAAA;AACA,MAAA;AACA,IAAA,CAAA,CAAA;;AAEA;AACA,IAAA,MAAA,eAAA,GAAAC,2BAAA,CAAAC,qBAAA,CAAA,SAAA,EAAAtB,aAAA,EAAA,CAAA,CAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,4BAAA,CAAA,MAAA,CAAA,eAAA,EAAA,iBAAA,CAAA;AACA,EAAA;;AAEA,GAAA,gBAAA,CAAA,QAAA,EAAA;AACA,IAAA,MAAA,YAAA,GAAA;AACA,MAAA,OAAA,EAAA,IAAA;AACA,MAAA,OAAA,EAAA,IAAA;AACA,MAAA,IAAA,EAAA,IAAA;AACA,MAAA,GAAA,EAAA,IAAA;AACA,MAAA,IAAA,EAAA,IAAA;AACA,MAAA,GAAA,EAAA,IAAA;AACA,MAAA,KAAA,EAAA,IAAA;AACA,MAAA,MAAA,EAAA,IAAA;AACA,MAAA,KAAA,EAAA,IAAA;AACA;AACA,MAAA,KAAA,EAAA,IAAA;AACA,KAAA;;AAEA,IAAA,IAAA,QAAA,CAAA,WAAA,EAAA,IAAA,YAAA,EAAA;AACA,MAAA,OAAA,QAAA,CAAA,WAAA,EAAA;AACA,IAAA;;AAEA,IAAA,OAAA,QAAA;AACA,EAAA;AACA;;;;"}
1
+ {"version":3,"file":"undici.js","sources":["../../../../../src/integrations/node-fetch/vendored/undici.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/ed97091c9890dd18e52759f2ea98e9d7593b3ae4/packages/instrumentation-undici\n * - Upstream version: @opentelemetry/instrumentation-undici@0.24.0\n * - Tracking issue: https://github.com/getsentry/sentry-javascript/issues/20165\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n */\n/* eslint-disable -- vendored @opentelemetry/instrumentation-undici (#20165) */\n\nimport * as diagch from 'diagnostics_channel';\nimport { URL } from 'url';\n\nimport { InstrumentationBase, safeExecuteInTheMiddle } from '@opentelemetry/instrumentation';\nimport type { Attributes, Histogram, HrTime, Span } from '@opentelemetry/api';\nimport {\n context,\n INVALID_SPAN_CONTEXT,\n propagation,\n SpanKind,\n SpanStatusCode,\n trace,\n ValueType,\n} from '@opentelemetry/api';\nimport { hrTime, hrTimeDuration, hrTimeToMilliseconds } from '@opentelemetry/core';\nimport {\n ATTR_ERROR_TYPE,\n ATTR_HTTP_REQUEST_METHOD,\n ATTR_HTTP_REQUEST_METHOD_ORIGINAL,\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n ATTR_NETWORK_PEER_ADDRESS,\n ATTR_NETWORK_PEER_PORT,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n ATTR_URL_FULL,\n ATTR_URL_PATH,\n ATTR_URL_QUERY,\n ATTR_URL_SCHEME,\n ATTR_USER_AGENT_ORIGINAL,\n METRIC_HTTP_CLIENT_REQUEST_DURATION,\n} from '@opentelemetry/semantic-conventions';\n\nimport type {\n ListenerRecord,\n RequestHeadersMessage,\n RequestMessage,\n RequestTrailersMessage,\n ResponseHeadersMessage,\n} from './internal-types';\nimport type { UndiciInstrumentationConfig, UndiciRequest } from './types';\n\nimport { SDK_VERSION } from '@sentry/core';\n\ninterface InstrumentationRecord {\n span: Span;\n attributes: Attributes;\n startTime: HrTime;\n}\n\nconst PACKAGE_NAME = '@sentry/instrumentation-undici';\n\n// A combination of https://github.com/elastic/apm-agent-nodejs and\n// https://github.com/gadget-inc/opentelemetry-instrumentations/blob/main/packages/opentelemetry-instrumentation-undici/src/index.ts\nexport class UndiciInstrumentation extends InstrumentationBase<UndiciInstrumentationConfig> {\n // Keep ref to avoid https://github.com/nodejs/node/issues/42170 bug and for\n // unsubscribing.\n declare private _channelSubs: Array<ListenerRecord>;\n private _recordFromReq = new WeakMap<UndiciRequest, InstrumentationRecord>();\n\n declare private _httpClientDurationHistogram: Histogram;\n\n constructor(config: UndiciInstrumentationConfig = {}) {\n super(PACKAGE_NAME, SDK_VERSION, config);\n }\n\n // No need to instrument files/modules\n protected override init() {\n return undefined;\n }\n\n override disable(): void {\n super.disable();\n this._channelSubs.forEach(sub => sub.unsubscribe());\n this._channelSubs.length = 0;\n }\n\n override enable(): void {\n // \"enabled\" handling is currently a bit messy with InstrumentationBase.\n // If constructed with `{enabled: false}`, this `.enable()` is still called,\n // and `this.getConfig().enabled !== this.isEnabled()`, creating confusion.\n //\n // For now, this class will setup for instrumenting if `.enable()` is\n // called, but use `this.getConfig().enabled` to determine if\n // instrumentation should be generated. This covers the more likely common\n // case of config being given a construction time, rather than later via\n // `instance.enable()`, `.disable()`, or `.setConfig()` calls.\n super.enable();\n\n // This method is called by the super-class constructor before ours is\n // called. So we need to ensure the property is initalized.\n this._channelSubs = this._channelSubs || [];\n\n // Avoid to duplicate subscriptions\n if (this._channelSubs.length > 0) {\n return;\n }\n\n this.subscribeToChannel('undici:request:create', this.onRequestCreated.bind(this));\n this.subscribeToChannel('undici:client:sendHeaders', this.onRequestHeaders.bind(this));\n this.subscribeToChannel('undici:request:headers', this.onResponseHeaders.bind(this));\n this.subscribeToChannel('undici:request:trailers', this.onDone.bind(this));\n this.subscribeToChannel('undici:request:error', this.onError.bind(this));\n }\n\n protected override _updateMetricInstruments() {\n this._httpClientDurationHistogram = this.meter.createHistogram(METRIC_HTTP_CLIENT_REQUEST_DURATION, {\n description: 'Measures the duration of outbound HTTP requests.',\n unit: 's',\n valueType: ValueType.DOUBLE,\n advice: {\n explicitBucketBoundaries: [0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10],\n },\n });\n }\n\n private subscribeToChannel(diagnosticChannel: string, onMessage: (message: any, name: string | symbol) => void) {\n // `diagnostics_channel` had a ref counting bug until v18.19.0.\n // https://github.com/nodejs/node/pull/47520\n const [major = 0, minor = 0] = process.version\n .replace('v', '')\n .split('.')\n .map(n => Number(n));\n const useNewSubscribe = major > 18 || (major === 18 && minor >= 19);\n\n let unsubscribe: () => void;\n if (useNewSubscribe) {\n diagch.subscribe?.(diagnosticChannel, onMessage);\n unsubscribe = () => diagch.unsubscribe?.(diagnosticChannel, onMessage);\n } else {\n const channel = diagch.channel(diagnosticChannel);\n channel.subscribe(onMessage);\n unsubscribe = () => channel.unsubscribe(onMessage);\n }\n\n this._channelSubs.push({\n name: diagnosticChannel,\n unsubscribe,\n });\n }\n\n private parseRequestHeaders(request: UndiciRequest) {\n const result = new Map<string, string | string[]>();\n\n if (Array.isArray(request.headers)) {\n // headers are an array [k1, v2, k2, v2] (undici v6+)\n // values could be string or a string[] for multiple values\n for (let i = 0; i < request.headers.length; i += 2) {\n const key = request.headers[i];\n const value = request.headers[i + 1];\n\n // Key should always be a string, but the types don't know that, and let's be safe\n if (typeof key === 'string' && value !== undefined) {\n result.set(key.toLowerCase(), value);\n }\n }\n } else if (typeof request.headers === 'string') {\n // headers are a raw string (undici v5)\n // headers could be repeated in several lines for multiple values\n const headers = request.headers.split('\\r\\n');\n for (const line of headers) {\n if (!line) {\n continue;\n }\n const colonIndex = line.indexOf(':');\n if (colonIndex === -1) {\n // Invalid header? Probably this can't happen, but again let's be safe.\n continue;\n }\n const key = line.substring(0, colonIndex).toLowerCase();\n const value = line.substring(colonIndex + 1).trim();\n const allValues = result.get(key);\n\n if (allValues && Array.isArray(allValues)) {\n allValues.push(value);\n } else if (allValues) {\n result.set(key, [allValues, value]);\n } else {\n result.set(key, value);\n }\n }\n }\n return result;\n }\n\n // This is the 1st message we receive for each request (fired after request creation). Here we will\n // create the span and populate some atttributes, then link the span to the request for further\n // span processing\n private onRequestCreated({ request }: RequestMessage): void {\n // Ignore if:\n // - instrumentation is disabled\n // - ignored by config\n // - method is 'CONNECT'\n const config = this.getConfig();\n const enabled = config.enabled !== false;\n const shouldIgnoreReq = safeExecuteInTheMiddle(\n () => !enabled || request.method === 'CONNECT' || config.ignoreRequestHook?.(request),\n e => e && this._diag.error('caught ignoreRequestHook error: ', e),\n true,\n );\n\n if (shouldIgnoreReq) {\n return;\n }\n\n const startTime = hrTime();\n let requestUrl;\n try {\n requestUrl = new URL(request.path, request.origin);\n } catch (err) {\n this._diag.warn('could not determine url.full:', err);\n // Skip instrumenting this request.\n return;\n }\n const urlScheme = requestUrl.protocol.replace(':', '');\n const requestMethod = this.getRequestMethod(request.method);\n const attributes: Attributes = {\n [ATTR_HTTP_REQUEST_METHOD]: requestMethod,\n [ATTR_HTTP_REQUEST_METHOD_ORIGINAL]: request.method,\n [ATTR_URL_FULL]: requestUrl.toString(),\n [ATTR_URL_PATH]: requestUrl.pathname,\n [ATTR_URL_QUERY]: requestUrl.search,\n [ATTR_URL_SCHEME]: urlScheme,\n };\n\n const schemePorts: Record<string, string> = { https: '443', http: '80' };\n const serverAddress = requestUrl.hostname;\n const serverPort = requestUrl.port || schemePorts[urlScheme];\n\n attributes[ATTR_SERVER_ADDRESS] = serverAddress;\n if (serverPort && !isNaN(Number(serverPort))) {\n attributes[ATTR_SERVER_PORT] = Number(serverPort);\n }\n\n // Get user agent from headers\n const headersMap = this.parseRequestHeaders(request);\n const userAgentValues = headersMap.get('user-agent');\n\n if (userAgentValues) {\n // NOTE: having multiple user agents is not expected so\n // we're going to take last one like `curl` does\n // ref: https://curl.se/docs/manpage.html#-A\n const userAgent = Array.isArray(userAgentValues) ? userAgentValues[userAgentValues.length - 1] : userAgentValues;\n attributes[ATTR_USER_AGENT_ORIGINAL] = userAgent;\n }\n\n // Get attributes from the hook if present\n const hookAttributes = safeExecuteInTheMiddle(\n () => config.startSpanHook?.(request),\n e => e && this._diag.error('caught startSpanHook error: ', e),\n true,\n );\n if (hookAttributes) {\n Object.entries(hookAttributes).forEach(([key, val]) => {\n attributes[key] = val;\n });\n }\n\n // Check if parent span is required via config and:\n // - if a parent is required but not present, we use a `NoopSpan` to still\n // propagate context without recording it.\n // - create a span otherwise\n const activeCtx = context.active();\n const currentSpan = trace.getSpan(activeCtx);\n let span: Span;\n\n if (config.requireParentforSpans && (!currentSpan || !trace.isSpanContextValid(currentSpan.spanContext()))) {\n span = trace.wrapSpanContext(INVALID_SPAN_CONTEXT);\n } else {\n span = this.tracer.startSpan(\n requestMethod === '_OTHER' ? 'HTTP' : requestMethod,\n {\n kind: SpanKind.CLIENT,\n attributes: attributes,\n },\n activeCtx,\n );\n }\n\n // Execute the request hook if defined\n safeExecuteInTheMiddle(\n () => config.requestHook?.(span, request),\n e => e && this._diag.error('caught requestHook error: ', e),\n true,\n );\n\n // Context propagation goes last so no hook can tamper\n // the propagation headers\n const requestContext = trace.setSpan(context.active(), span);\n const addedHeaders: Record<string, string> = {};\n propagation.inject(requestContext, addedHeaders);\n\n const headerEntries = Object.entries(addedHeaders);\n\n for (let i = 0; i < headerEntries.length; i++) {\n const pair = headerEntries[i];\n if (!pair) {\n continue;\n }\n const [k, v] = pair;\n\n if (typeof request.addHeader === 'function') {\n request.addHeader(k, v);\n } else if (typeof request.headers === 'string') {\n request.headers += `${k}: ${v}\\r\\n`;\n } else if (Array.isArray(request.headers)) {\n // undici@6.11.0 accidentally, briefly removed `request.addHeader()`.\n request.headers.push(k, v);\n }\n }\n this._recordFromReq.set(request, { span, attributes, startTime });\n }\n\n // This is the 2nd message we receive for each request. It is fired when connection with\n // the remote is established and about to send the first byte. Here we do have info about the\n // remote address and port so we can populate some `network.*` attributes into the span\n private onRequestHeaders({ request, socket }: RequestHeadersMessage): void {\n const record = this._recordFromReq.get(request);\n\n if (!record) {\n return;\n }\n\n const config = this.getConfig();\n const { span } = record;\n const { remoteAddress, remotePort } = socket;\n const spanAttributes: Attributes = {\n [ATTR_NETWORK_PEER_ADDRESS]: remoteAddress,\n [ATTR_NETWORK_PEER_PORT]: remotePort,\n };\n\n // After hooks have been processed (which may modify request headers)\n // we can collect the headers based on the configuration\n if (config.headersToSpanAttributes?.requestHeaders) {\n const headersToAttribs = new Set(config.headersToSpanAttributes.requestHeaders.map(n => n.toLowerCase()));\n const headersMap = this.parseRequestHeaders(request);\n\n for (const [name, value] of headersMap.entries()) {\n if (headersToAttribs.has(name)) {\n const attrValue = Array.isArray(value) ? value : [value];\n spanAttributes[`http.request.header.${name}`] = attrValue;\n }\n }\n }\n\n span.setAttributes(spanAttributes);\n }\n\n // This is the 3rd message we get for each request and it's fired when the server\n // headers are received, body may not be accessible yet.\n // From the response headers we can set the status and content length\n private onResponseHeaders({ request, response }: ResponseHeadersMessage): void {\n const record = this._recordFromReq.get(request);\n\n if (!record) {\n return;\n }\n\n const { span, attributes } = record;\n const spanAttributes: Attributes = {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: response.statusCode,\n };\n\n const config = this.getConfig();\n\n // Execute the response hook if defined\n safeExecuteInTheMiddle(\n () => config.responseHook?.(span, { request, response }),\n e => e && this._diag.error('caught responseHook error: ', e),\n true,\n );\n\n if (config.headersToSpanAttributes?.responseHeaders) {\n const headersToAttribs = new Set();\n config.headersToSpanAttributes?.responseHeaders.forEach(name => headersToAttribs.add(name.toLowerCase()));\n\n for (let idx = 0; idx < response.headers.length; idx = idx + 2) {\n const nameBuf = response.headers[idx];\n const valueBuf = response.headers[idx + 1];\n if (nameBuf === undefined || valueBuf === undefined) {\n continue;\n }\n const name = nameBuf.toString().toLowerCase();\n const value = valueBuf;\n\n if (headersToAttribs.has(name)) {\n const attrName = `http.response.header.${name}`;\n if (!Object.prototype.hasOwnProperty.call(spanAttributes, attrName)) {\n spanAttributes[attrName] = [value.toString()];\n } else {\n (spanAttributes[attrName] as string[]).push(value.toString());\n }\n }\n }\n }\n\n span.setAttributes(spanAttributes);\n span.setStatus({\n code: response.statusCode >= 400 ? SpanStatusCode.ERROR : SpanStatusCode.UNSET,\n });\n record.attributes = Object.assign(attributes, spanAttributes);\n }\n\n // This is the last event we receive if the request went without any errors\n private onDone({ request }: RequestTrailersMessage): void {\n const record = this._recordFromReq.get(request);\n\n if (!record) {\n return;\n }\n\n const { span, attributes, startTime } = record;\n\n // End the span\n span.end();\n this._recordFromReq.delete(request);\n\n // Record metrics\n this.recordRequestDuration(attributes, startTime);\n }\n\n // This is the event we get when something is wrong in the request like\n // - invalid options when calling `fetch` global API or any undici method for request\n // - connectivity errors such as unreachable host\n // - requests aborted through an `AbortController.signal`\n // NOTE: server errors are considered valid responses and it's the lib consumer\n // who should deal with that.\n private onError({ request, error }: any): void {\n const record = this._recordFromReq.get(request);\n\n if (!record) {\n return;\n }\n\n const { span, attributes, startTime } = record;\n\n // NOTE: in `undici@6.3.0` when request aborted the error type changes from\n // a custom error (`RequestAbortedError`) to a built-in `DOMException` carrying\n // some differences:\n // - `code` is from DOMEXception (ABORT_ERR: 20)\n // - `message` changes\n // - stacktrace is smaller and contains node internal frames\n span.recordException(error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n span.end();\n this._recordFromReq.delete(request);\n\n // Record metrics (with the error)\n attributes[ATTR_ERROR_TYPE] = error.message;\n this.recordRequestDuration(attributes, startTime);\n }\n\n private recordRequestDuration(attributes: Attributes, startTime: HrTime) {\n // Time to record metrics\n const metricsAttributes: Attributes = {};\n // Get the attribs already in span attributes\n const keysToCopy = [\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n ATTR_HTTP_REQUEST_METHOD,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n ATTR_URL_SCHEME,\n ATTR_ERROR_TYPE,\n ];\n keysToCopy.forEach(key => {\n if (key in attributes) {\n metricsAttributes[key] = attributes[key];\n }\n });\n\n // Take the duration and record it\n const durationSeconds = hrTimeToMilliseconds(hrTimeDuration(startTime, hrTime())) / 1000;\n this._httpClientDurationHistogram.record(durationSeconds, metricsAttributes);\n }\n\n private getRequestMethod(original: string): string {\n const knownMethods = {\n CONNECT: true,\n OPTIONS: true,\n HEAD: true,\n GET: true,\n POST: true,\n PUT: true,\n PATCH: true,\n DELETE: true,\n TRACE: true,\n // QUERY from https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/\n QUERY: true,\n };\n\n if (original.toUpperCase() in knownMethods) {\n return original.toUpperCase();\n }\n\n return '_OTHER';\n }\n}\n"],"names":["InstrumentationBase","SDK_VERSION","METRIC_HTTP_CLIENT_REQUEST_DURATION","ValueType","safeExecuteInTheMiddle","hrTime","URL","ATTR_HTTP_REQUEST_METHOD","ATTR_HTTP_REQUEST_METHOD_ORIGINAL","ATTR_URL_FULL","ATTR_URL_PATH","ATTR_URL_QUERY","ATTR_URL_SCHEME","ATTR_SERVER_ADDRESS","ATTR_SERVER_PORT","ATTR_USER_AGENT_ORIGINAL","context","trace","INVALID_SPAN_CONTEXT","SpanKind","propagation","ATTR_NETWORK_PEER_ADDRESS","ATTR_NETWORK_PEER_PORT","ATTR_HTTP_RESPONSE_STATUS_CODE","SpanStatusCode","ATTR_ERROR_TYPE","hrTimeToMilliseconds","hrTimeDuration"],"mappings":";;;;;;;;;;AAwEA,MAAM,YAAA,GAAe,gCAAA;AAId,MAAM,8BAA8BA,mCAAA,CAAiD;AAAA,EAQ1F,WAAA,CAAY,MAAA,GAAsC,EAAC,EAAG;AACpD,IAAA,KAAA,CAAM,YAAA,EAAcC,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;AAAA,MACL,KAAA,EAAO,IAAA;AAAA,MACP,MAAA,EAAQ,IAAA;AAAA,MACR,KAAA,EAAO,IAAA;AAAA;AAAA,MAEP,KAAA,EAAO;AAAA,KACT;AAEA,IAAA,IAAI,QAAA,CAAS,WAAA,EAAY,IAAK,YAAA,EAAc;AAC1C,MAAA,OAAO,SAAS,WAAA,EAAY;AAAA,IAC9B;AAEA,IAAA,OAAO,QAAA;AAAA,EACT;AACF;;;;"}
@@ -0,0 +1,29 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const amqplib = require('./vendored/amqplib.js');
4
+ const core = require('@sentry/core');
5
+ const nodeCore = require('@sentry/node-core');
6
+
7
+ const INTEGRATION_NAME = "Amqplib";
8
+ const config = {
9
+ consumeEndHook: (span) => {
10
+ nodeCore.addOriginToSpan(span, "auto.amqplib.otel.consumer");
11
+ },
12
+ publishHook: (span) => {
13
+ nodeCore.addOriginToSpan(span, "auto.amqplib.otel.publisher");
14
+ }
15
+ };
16
+ const instrumentAmqplib = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, () => new amqplib.AmqplibInstrumentation(config));
17
+ const _amqplibIntegration = (() => {
18
+ return {
19
+ name: INTEGRATION_NAME,
20
+ setupOnce() {
21
+ instrumentAmqplib();
22
+ }
23
+ };
24
+ });
25
+ const amqplibIntegration = core.defineIntegration(_amqplibIntegration);
26
+
27
+ exports.amqplibIntegration = amqplibIntegration;
28
+ exports.instrumentAmqplib = instrumentAmqplib;
29
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/amqplib/index.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { AmqplibInstrumentation } from './vendored/amqplib';\nimport type { AmqplibInstrumentationConfig } from './vendored/types';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { addOriginToSpan, generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Amqplib';\n\nconst config: AmqplibInstrumentationConfig = {\n consumeEndHook: (span: Span) => {\n addOriginToSpan(span, 'auto.amqplib.otel.consumer');\n },\n publishHook: (span: Span) => {\n addOriginToSpan(span, 'auto.amqplib.otel.publisher');\n },\n};\n\nexport const instrumentAmqplib = generateInstrumentOnce(INTEGRATION_NAME, () => new AmqplibInstrumentation(config));\n\nconst _amqplibIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentAmqplib();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [amqplib](https://www.npmjs.com/package/amqplib) library.\n *\n * For more information, see the [`amqplibIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/amqplib/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.amqplibIntegration()],\n * });\n * ```\n */\nexport const amqplibIntegration = defineIntegration(_amqplibIntegration);\n"],"names":["addOriginToSpan","generateInstrumentOnce","AmqplibInstrumentation","defineIntegration"],"mappings":";;;;;;AAOA,MAAM,gBAAA,GAAmB,SAAA;AAEzB,MAAM,MAAA,GAAuC;AAAA,EAC3C,cAAA,EAAgB,CAAC,IAAA,KAAe;AAC9B,IAAAA,wBAAA,CAAgB,MAAM,4BAA4B,CAAA;AAAA,EACpD,CAAA;AAAA,EACA,WAAA,EAAa,CAAC,IAAA,KAAe;AAC3B,IAAAA,wBAAA,CAAgB,MAAM,6BAA6B,CAAA;AAAA,EACrD;AACF,CAAA;AAEO,MAAM,oBAAoBC,+BAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAIC,8BAAA,CAAuB,MAAM,CAAC;AAElH,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;;;;;"}
@@ -0,0 +1,452 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const api = require('@opentelemetry/api');
4
+ const core$1 = require('@opentelemetry/core');
5
+ const instrumentation = require('@opentelemetry/instrumentation');
6
+ const semconv = require('./semconv.js');
7
+ const semconvObsolete = require('./semconv-obsolete.js');
8
+ const types = require('./types.js');
9
+ const utils = require('./utils.js');
10
+ const core = require('@sentry/core');
11
+
12
+ const PACKAGE_NAME = "@sentry/instrumentation-amqplib";
13
+ const supportedVersions = [">=0.5.5 <2"];
14
+ class AmqplibInstrumentation extends instrumentation.InstrumentationBase {
15
+ constructor(config = {}) {
16
+ super(PACKAGE_NAME, core.SDK_VERSION, { ...types.DEFAULT_CONFIG, ...config });
17
+ this._setSemconvStabilityFromEnv();
18
+ }
19
+ // Used for testing.
20
+ _setSemconvStabilityFromEnv() {
21
+ this._netSemconvStability = instrumentation.semconvStabilityFromStr("http", process.env.OTEL_SEMCONV_STABILITY_OPT_IN);
22
+ }
23
+ setConfig(config = {}) {
24
+ super.setConfig({ ...types.DEFAULT_CONFIG, ...config });
25
+ }
26
+ init() {
27
+ const channelModelModuleFile = new instrumentation.InstrumentationNodeModuleFile(
28
+ "amqplib/lib/channel_model.js",
29
+ supportedVersions,
30
+ this.patchChannelModel.bind(this),
31
+ this.unpatchChannelModel.bind(this)
32
+ );
33
+ const callbackModelModuleFile = new instrumentation.InstrumentationNodeModuleFile(
34
+ "amqplib/lib/callback_model.js",
35
+ supportedVersions,
36
+ this.patchChannelModel.bind(this),
37
+ this.unpatchChannelModel.bind(this)
38
+ );
39
+ const connectModuleFile = new instrumentation.InstrumentationNodeModuleFile(
40
+ "amqplib/lib/connect.js",
41
+ supportedVersions,
42
+ this.patchConnect.bind(this),
43
+ this.unpatchConnect.bind(this)
44
+ );
45
+ const module = new instrumentation.InstrumentationNodeModuleDefinition("amqplib", supportedVersions, void 0, void 0, [
46
+ channelModelModuleFile,
47
+ connectModuleFile,
48
+ callbackModelModuleFile
49
+ ]);
50
+ return module;
51
+ }
52
+ patchConnect(moduleExports) {
53
+ moduleExports = this.unpatchConnect(moduleExports);
54
+ if (!instrumentation.isWrapped(moduleExports.connect)) {
55
+ this._wrap(moduleExports, "connect", this.getConnectPatch.bind(this));
56
+ }
57
+ return moduleExports;
58
+ }
59
+ unpatchConnect(moduleExports) {
60
+ if (instrumentation.isWrapped(moduleExports.connect)) {
61
+ this._unwrap(moduleExports, "connect");
62
+ }
63
+ return moduleExports;
64
+ }
65
+ patchChannelModel(moduleExports, moduleVersion) {
66
+ if (!instrumentation.isWrapped(moduleExports.Channel.prototype.publish)) {
67
+ this._wrap(moduleExports.Channel.prototype, "publish", this.getPublishPatch.bind(this, moduleVersion));
68
+ }
69
+ if (!instrumentation.isWrapped(moduleExports.Channel.prototype.consume)) {
70
+ this._wrap(moduleExports.Channel.prototype, "consume", this.getConsumePatch.bind(this, moduleVersion));
71
+ }
72
+ if (!instrumentation.isWrapped(moduleExports.Channel.prototype.ack)) {
73
+ this._wrap(moduleExports.Channel.prototype, "ack", this.getAckPatch.bind(this, false, types.EndOperation.Ack));
74
+ }
75
+ if (!instrumentation.isWrapped(moduleExports.Channel.prototype.nack)) {
76
+ this._wrap(moduleExports.Channel.prototype, "nack", this.getAckPatch.bind(this, true, types.EndOperation.Nack));
77
+ }
78
+ if (!instrumentation.isWrapped(moduleExports.Channel.prototype.reject)) {
79
+ this._wrap(moduleExports.Channel.prototype, "reject", this.getAckPatch.bind(this, true, types.EndOperation.Reject));
80
+ }
81
+ if (!instrumentation.isWrapped(moduleExports.Channel.prototype.ackAll)) {
82
+ this._wrap(moduleExports.Channel.prototype, "ackAll", this.getAckAllPatch.bind(this, false, types.EndOperation.AckAll));
83
+ }
84
+ if (!instrumentation.isWrapped(moduleExports.Channel.prototype.nackAll)) {
85
+ this._wrap(
86
+ moduleExports.Channel.prototype,
87
+ "nackAll",
88
+ this.getAckAllPatch.bind(this, true, types.EndOperation.NackAll)
89
+ );
90
+ }
91
+ if (!instrumentation.isWrapped(moduleExports.Channel.prototype.emit)) {
92
+ this._wrap(moduleExports.Channel.prototype, "emit", this.getChannelEmitPatch.bind(this));
93
+ }
94
+ if (!instrumentation.isWrapped(moduleExports.ConfirmChannel.prototype.publish)) {
95
+ this._wrap(
96
+ moduleExports.ConfirmChannel.prototype,
97
+ "publish",
98
+ this.getConfirmedPublishPatch.bind(this, moduleVersion)
99
+ );
100
+ }
101
+ return moduleExports;
102
+ }
103
+ unpatchChannelModel(moduleExports) {
104
+ if (instrumentation.isWrapped(moduleExports.Channel.prototype.publish)) {
105
+ this._unwrap(moduleExports.Channel.prototype, "publish");
106
+ }
107
+ if (instrumentation.isWrapped(moduleExports.Channel.prototype.consume)) {
108
+ this._unwrap(moduleExports.Channel.prototype, "consume");
109
+ }
110
+ if (instrumentation.isWrapped(moduleExports.Channel.prototype.ack)) {
111
+ this._unwrap(moduleExports.Channel.prototype, "ack");
112
+ }
113
+ if (instrumentation.isWrapped(moduleExports.Channel.prototype.nack)) {
114
+ this._unwrap(moduleExports.Channel.prototype, "nack");
115
+ }
116
+ if (instrumentation.isWrapped(moduleExports.Channel.prototype.reject)) {
117
+ this._unwrap(moduleExports.Channel.prototype, "reject");
118
+ }
119
+ if (instrumentation.isWrapped(moduleExports.Channel.prototype.ackAll)) {
120
+ this._unwrap(moduleExports.Channel.prototype, "ackAll");
121
+ }
122
+ if (instrumentation.isWrapped(moduleExports.Channel.prototype.nackAll)) {
123
+ this._unwrap(moduleExports.Channel.prototype, "nackAll");
124
+ }
125
+ if (instrumentation.isWrapped(moduleExports.Channel.prototype.emit)) {
126
+ this._unwrap(moduleExports.Channel.prototype, "emit");
127
+ }
128
+ if (instrumentation.isWrapped(moduleExports.ConfirmChannel.prototype.publish)) {
129
+ this._unwrap(moduleExports.ConfirmChannel.prototype, "publish");
130
+ }
131
+ return moduleExports;
132
+ }
133
+ getConnectPatch(original) {
134
+ const self = this;
135
+ return function patchedConnect(url, socketOptions, openCallback) {
136
+ return original.call(
137
+ this,
138
+ url,
139
+ socketOptions,
140
+ function(err, conn) {
141
+ if (err == null) {
142
+ const urlAttributes = utils.getConnectionAttributesFromUrl(url, self._netSemconvStability);
143
+ const serverAttributes = utils.getConnectionAttributesFromServer(conn);
144
+ conn[utils.CONNECTION_ATTRIBUTES] = {
145
+ ...urlAttributes,
146
+ ...serverAttributes
147
+ };
148
+ }
149
+ openCallback.apply(this, arguments);
150
+ }
151
+ );
152
+ };
153
+ }
154
+ getChannelEmitPatch(original) {
155
+ const self = this;
156
+ return function emit(eventName) {
157
+ if (eventName === "close") {
158
+ self.endAllSpansOnChannel(this, true, types.EndOperation.ChannelClosed, void 0);
159
+ const activeTimer = this[utils.CHANNEL_CONSUME_TIMEOUT_TIMER];
160
+ if (activeTimer) {
161
+ clearInterval(activeTimer);
162
+ }
163
+ this[utils.CHANNEL_CONSUME_TIMEOUT_TIMER] = void 0;
164
+ } else if (eventName === "error") {
165
+ self.endAllSpansOnChannel(this, true, types.EndOperation.ChannelError, void 0);
166
+ }
167
+ return original.apply(this, arguments);
168
+ };
169
+ }
170
+ getAckAllPatch(isRejected, endOperation, original) {
171
+ const self = this;
172
+ return function ackAll(requeueOrEmpty) {
173
+ self.endAllSpansOnChannel(this, isRejected, endOperation, requeueOrEmpty);
174
+ return original.apply(this, arguments);
175
+ };
176
+ }
177
+ getAckPatch(isRejected, endOperation, original) {
178
+ const self = this;
179
+ return function ack(message, allUpToOrRequeue, requeue) {
180
+ const channel = this;
181
+ const requeueResolved = endOperation === types.EndOperation.Reject ? allUpToOrRequeue : requeue;
182
+ const spansNotEnded = channel[utils.CHANNEL_SPANS_NOT_ENDED] ?? [];
183
+ const msgIndex = spansNotEnded.findIndex((msgDetails) => msgDetails.msg === message);
184
+ if (msgIndex < 0) {
185
+ self.endConsumerSpan(message, isRejected, endOperation, requeueResolved);
186
+ } else if (endOperation !== types.EndOperation.Reject && allUpToOrRequeue) {
187
+ for (let i = 0; i <= msgIndex; i++) {
188
+ self.endConsumerSpan(spansNotEnded[i].msg, isRejected, endOperation, requeueResolved);
189
+ }
190
+ spansNotEnded.splice(0, msgIndex + 1);
191
+ } else {
192
+ self.endConsumerSpan(message, isRejected, endOperation, requeueResolved);
193
+ spansNotEnded.splice(msgIndex, 1);
194
+ }
195
+ return original.apply(this, arguments);
196
+ };
197
+ }
198
+ getConsumePatch(moduleVersion, original) {
199
+ const self = this;
200
+ return function consume(queue, onMessage, options) {
201
+ const channel = this;
202
+ if (!Object.prototype.hasOwnProperty.call(channel, utils.CHANNEL_SPANS_NOT_ENDED)) {
203
+ const { consumeTimeoutMs } = self.getConfig();
204
+ if (consumeTimeoutMs) {
205
+ const timer = setInterval(() => {
206
+ self.checkConsumeTimeoutOnChannel(channel);
207
+ }, consumeTimeoutMs);
208
+ timer.unref();
209
+ channel[utils.CHANNEL_CONSUME_TIMEOUT_TIMER] = timer;
210
+ }
211
+ channel[utils.CHANNEL_SPANS_NOT_ENDED] = [];
212
+ }
213
+ const patchedOnMessage = function(msg) {
214
+ if (!msg) {
215
+ return onMessage.call(this, msg);
216
+ }
217
+ const headers = msg.properties.headers ?? {};
218
+ let parentContext = api.propagation.extract(api.ROOT_CONTEXT, headers);
219
+ const exchange = msg.fields?.exchange;
220
+ let links;
221
+ if (self._config.useLinksForConsume) {
222
+ const parentSpanContext = parentContext ? api.trace.getSpan(parentContext)?.spanContext() : void 0;
223
+ parentContext = void 0;
224
+ if (parentSpanContext) {
225
+ links = [
226
+ {
227
+ context: parentSpanContext
228
+ }
229
+ ];
230
+ }
231
+ }
232
+ const span = self.tracer.startSpan(
233
+ `${queue} process`,
234
+ {
235
+ kind: api.SpanKind.CONSUMER,
236
+ attributes: {
237
+ ...channel?.connection?.[utils.CONNECTION_ATTRIBUTES],
238
+ [semconvObsolete.ATTR_MESSAGING_DESTINATION]: exchange,
239
+ [semconvObsolete.ATTR_MESSAGING_DESTINATION_KIND]: semconvObsolete.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,
240
+ [semconvObsolete.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: msg.fields?.routingKey,
241
+ [semconv.ATTR_MESSAGING_OPERATION]: semconvObsolete.MESSAGING_OPERATION_VALUE_PROCESS,
242
+ [semconvObsolete.OLD_ATTR_MESSAGING_MESSAGE_ID]: msg?.properties.messageId,
243
+ [semconvObsolete.ATTR_MESSAGING_CONVERSATION_ID]: msg?.properties.correlationId
244
+ },
245
+ links
246
+ },
247
+ parentContext
248
+ );
249
+ const { consumeHook } = self.getConfig();
250
+ if (consumeHook) {
251
+ instrumentation.safeExecuteInTheMiddle(
252
+ () => consumeHook(span, { moduleVersion, msg }),
253
+ (e) => {
254
+ if (e) {
255
+ api.diag.error("amqplib instrumentation: consumerHook error", e);
256
+ }
257
+ },
258
+ true
259
+ );
260
+ }
261
+ if (!options?.noAck) {
262
+ channel[utils.CHANNEL_SPANS_NOT_ENDED].push({
263
+ msg,
264
+ timeOfConsume: core$1.hrTime()
265
+ });
266
+ msg[utils.MESSAGE_STORED_SPAN] = span;
267
+ }
268
+ const setContext = parentContext ? parentContext : api.ROOT_CONTEXT;
269
+ api.context.with(api.trace.setSpan(setContext, span), () => {
270
+ onMessage.call(this, msg);
271
+ });
272
+ if (options?.noAck) {
273
+ self.callConsumeEndHook(span, msg, false, types.EndOperation.AutoAck);
274
+ span.end();
275
+ }
276
+ };
277
+ arguments[1] = patchedOnMessage;
278
+ return original.apply(this, arguments);
279
+ };
280
+ }
281
+ getConfirmedPublishPatch(moduleVersion, original) {
282
+ const self = this;
283
+ return function confirmedPublish(exchange, routingKey, content, options, callback) {
284
+ const channel = this;
285
+ const { span, modifiedOptions } = self.createPublishSpan(self, exchange, routingKey, channel, options);
286
+ const { publishHook } = self.getConfig();
287
+ if (publishHook) {
288
+ instrumentation.safeExecuteInTheMiddle(
289
+ () => publishHook(span, {
290
+ moduleVersion,
291
+ exchange,
292
+ routingKey,
293
+ content,
294
+ options: modifiedOptions,
295
+ isConfirmChannel: true
296
+ }),
297
+ (e) => {
298
+ if (e) {
299
+ api.diag.error("amqplib instrumentation: publishHook error", e);
300
+ }
301
+ },
302
+ true
303
+ );
304
+ }
305
+ const patchedOnConfirm = function(err, ok) {
306
+ try {
307
+ callback?.call(this, err, ok);
308
+ } finally {
309
+ const { publishConfirmHook } = self.getConfig();
310
+ if (publishConfirmHook) {
311
+ instrumentation.safeExecuteInTheMiddle(
312
+ () => publishConfirmHook(span, {
313
+ moduleVersion,
314
+ exchange,
315
+ routingKey,
316
+ content,
317
+ options,
318
+ isConfirmChannel: true,
319
+ confirmError: err
320
+ }),
321
+ (e) => {
322
+ if (e) {
323
+ api.diag.error("amqplib instrumentation: publishConfirmHook error", e);
324
+ }
325
+ },
326
+ true
327
+ );
328
+ }
329
+ if (err) {
330
+ span.setStatus({
331
+ code: api.SpanStatusCode.ERROR,
332
+ message: "message confirmation has been nack'ed"
333
+ });
334
+ }
335
+ span.end();
336
+ }
337
+ };
338
+ const markedContext = utils.markConfirmChannelTracing(api.context.active());
339
+ const argumentsCopy = [...arguments];
340
+ argumentsCopy[3] = modifiedOptions;
341
+ argumentsCopy[4] = api.context.bind(
342
+ utils.unmarkConfirmChannelTracing(api.trace.setSpan(markedContext, span)),
343
+ patchedOnConfirm
344
+ );
345
+ return api.context.with(markedContext, original.bind(this, ...argumentsCopy));
346
+ };
347
+ }
348
+ getPublishPatch(moduleVersion, original) {
349
+ const self = this;
350
+ return function publish(exchange, routingKey, content, options) {
351
+ if (utils.isConfirmChannelTracing(api.context.active())) {
352
+ return original.apply(this, arguments);
353
+ } else {
354
+ const channel = this;
355
+ const { span, modifiedOptions } = self.createPublishSpan(self, exchange, routingKey, channel, options);
356
+ const { publishHook } = self.getConfig();
357
+ if (publishHook) {
358
+ instrumentation.safeExecuteInTheMiddle(
359
+ () => publishHook(span, {
360
+ moduleVersion,
361
+ exchange,
362
+ routingKey,
363
+ content,
364
+ options: modifiedOptions,
365
+ isConfirmChannel: false
366
+ }),
367
+ (e) => {
368
+ if (e) {
369
+ api.diag.error("amqplib instrumentation: publishHook error", e);
370
+ }
371
+ },
372
+ true
373
+ );
374
+ }
375
+ const argumentsCopy = [...arguments];
376
+ argumentsCopy[3] = modifiedOptions;
377
+ const originalRes = original.apply(this, argumentsCopy);
378
+ span.end();
379
+ return originalRes;
380
+ }
381
+ };
382
+ }
383
+ createPublishSpan(self, exchange, routingKey, channel, options) {
384
+ const normalizedExchange = utils.normalizeExchange(exchange);
385
+ const span = self.tracer.startSpan(`publish ${normalizedExchange}`, {
386
+ kind: api.SpanKind.PRODUCER,
387
+ attributes: {
388
+ ...channel.connection[utils.CONNECTION_ATTRIBUTES],
389
+ [semconvObsolete.ATTR_MESSAGING_DESTINATION]: exchange,
390
+ [semconvObsolete.ATTR_MESSAGING_DESTINATION_KIND]: semconvObsolete.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,
391
+ [semconvObsolete.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]: routingKey,
392
+ [semconvObsolete.OLD_ATTR_MESSAGING_MESSAGE_ID]: options?.messageId,
393
+ [semconvObsolete.ATTR_MESSAGING_CONVERSATION_ID]: options?.correlationId
394
+ }
395
+ });
396
+ const modifiedOptions = options ?? {};
397
+ modifiedOptions.headers = modifiedOptions.headers ?? {};
398
+ api.propagation.inject(api.trace.setSpan(api.context.active(), span), modifiedOptions.headers);
399
+ return { span, modifiedOptions };
400
+ }
401
+ endConsumerSpan(message, isRejected, operation, requeue) {
402
+ const storedSpan = message[utils.MESSAGE_STORED_SPAN];
403
+ if (!storedSpan) return;
404
+ if (isRejected !== false) {
405
+ storedSpan.setStatus({
406
+ code: api.SpanStatusCode.ERROR,
407
+ message: operation !== types.EndOperation.ChannelClosed && operation !== types.EndOperation.ChannelError ? `${operation} called on message${requeue === true ? " with requeue" : requeue === false ? " without requeue" : ""}` : operation
408
+ });
409
+ }
410
+ this.callConsumeEndHook(storedSpan, message, isRejected, operation);
411
+ storedSpan.end();
412
+ message[utils.MESSAGE_STORED_SPAN] = void 0;
413
+ }
414
+ endAllSpansOnChannel(channel, isRejected, operation, requeue) {
415
+ const spansNotEnded = channel[utils.CHANNEL_SPANS_NOT_ENDED] ?? [];
416
+ spansNotEnded.forEach((msgDetails) => {
417
+ this.endConsumerSpan(msgDetails.msg, isRejected, operation, requeue);
418
+ });
419
+ channel[utils.CHANNEL_SPANS_NOT_ENDED] = [];
420
+ }
421
+ callConsumeEndHook(span, msg, rejected, endOperation) {
422
+ const { consumeEndHook } = this.getConfig();
423
+ if (!consumeEndHook) return;
424
+ instrumentation.safeExecuteInTheMiddle(
425
+ () => consumeEndHook(span, { msg, rejected, endOperation }),
426
+ (e) => {
427
+ if (e) {
428
+ api.diag.error("amqplib instrumentation: consumerEndHook error", e);
429
+ }
430
+ },
431
+ true
432
+ );
433
+ }
434
+ checkConsumeTimeoutOnChannel(channel) {
435
+ const currentTime = core$1.hrTime();
436
+ const spansNotEnded = channel[utils.CHANNEL_SPANS_NOT_ENDED] ?? [];
437
+ let i;
438
+ const { consumeTimeoutMs } = this.getConfig();
439
+ for (i = 0; i < spansNotEnded.length; i++) {
440
+ const currMessage = spansNotEnded[i];
441
+ const timeFromConsume = core$1.hrTimeDuration(currMessage.timeOfConsume, currentTime);
442
+ if (core$1.hrTimeToMilliseconds(timeFromConsume) < consumeTimeoutMs) {
443
+ break;
444
+ }
445
+ this.endConsumerSpan(currMessage.msg, null, types.EndOperation.InstrumentationTimeout, true);
446
+ }
447
+ spansNotEnded.splice(0, i);
448
+ }
449
+ }
450
+
451
+ exports.AmqplibInstrumentation = AmqplibInstrumentation;
452
+ //# sourceMappingURL=amqplib.js.map