@sentry/node 10.62.0 → 10.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  2. package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -1
  3. package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -1
  4. package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -1
  5. package/build/cjs/integrations/fs/index.js.map +1 -1
  6. package/build/cjs/integrations/http.js.map +1 -1
  7. package/build/cjs/integrations/node-fetch/index.js +7 -49
  8. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  9. package/build/cjs/integrations/node-fetch/undici-instrumentation.js +266 -0
  10. package/build/cjs/integrations/node-fetch/undici-instrumentation.js.map +1 -0
  11. package/build/cjs/integrations/tracing/amqplib/index.js.map +1 -1
  12. package/build/cjs/integrations/tracing/connect/index.js.map +1 -1
  13. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -1
  14. package/build/cjs/integrations/tracing/express.js.map +1 -1
  15. package/build/cjs/integrations/tracing/fastify/index.js +7 -103
  16. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  17. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +2 -3
  18. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  19. package/build/cjs/integrations/tracing/firebase/firebase.js.map +1 -1
  20. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -1
  21. package/build/cjs/integrations/tracing/graphql/index.js.map +1 -1
  22. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  23. package/build/cjs/integrations/tracing/hono/index.js.map +1 -1
  24. package/build/cjs/integrations/tracing/index.js +0 -1
  25. package/build/cjs/integrations/tracing/index.js.map +1 -1
  26. package/build/cjs/integrations/tracing/kafka/index.js.map +1 -1
  27. package/build/cjs/integrations/tracing/knex/index.js.map +1 -1
  28. package/build/cjs/integrations/tracing/koa/index.js.map +1 -1
  29. package/build/cjs/integrations/tracing/lrumemoizer/index.js.map +1 -1
  30. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js +4 -2
  31. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  32. package/build/cjs/integrations/tracing/mongo/index.js.map +1 -1
  33. package/build/cjs/integrations/tracing/mongoose/index.js.map +1 -1
  34. package/build/cjs/integrations/tracing/mysql/index.js.map +1 -1
  35. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js +34 -128
  36. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  37. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js +0 -2
  38. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  39. package/build/cjs/integrations/tracing/mysql/vendored/utils.js +2 -27
  40. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  41. package/build/cjs/integrations/tracing/mysql2/index.js.map +1 -1
  42. package/build/cjs/integrations/tracing/postgres/index.js.map +1 -1
  43. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  44. package/build/cjs/integrations/tracing/prisma/index.js +1 -10
  45. package/build/cjs/integrations/tracing/prisma/index.js.map +1 -1
  46. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js +83 -57
  47. package/build/cjs/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  48. package/build/cjs/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  49. package/build/cjs/integrations/tracing/prisma/vendored/global.js +2 -2
  50. package/build/cjs/integrations/tracing/prisma/vendored/global.js.map +1 -1
  51. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js +1 -6
  52. package/build/cjs/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  53. package/build/cjs/integrations/tracing/redis/index.js +3 -3
  54. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  55. package/build/cjs/integrations/tracing/tedious/index.js.map +1 -1
  56. package/build/cjs/integrations/tracing/vercelai/constants.js.map +1 -1
  57. package/build/cjs/integrations/tracing/vercelai/index.js +2 -4
  58. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  59. package/build/cjs/sdk/diagnosticsChannelInjection.js.map +1 -1
  60. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +8 -6
  61. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
  62. package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -1
  63. package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -1
  64. package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -1
  65. package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -1
  66. package/build/esm/integrations/fs/index.js.map +1 -1
  67. package/build/esm/integrations/http.js.map +1 -1
  68. package/build/esm/integrations/node-fetch/index.js +9 -50
  69. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  70. package/build/esm/integrations/node-fetch/undici-instrumentation.js +264 -0
  71. package/build/esm/integrations/node-fetch/undici-instrumentation.js.map +1 -0
  72. package/build/esm/integrations/tracing/amqplib/index.js.map +1 -1
  73. package/build/esm/integrations/tracing/connect/index.js.map +1 -1
  74. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -1
  75. package/build/esm/integrations/tracing/express.js.map +1 -1
  76. package/build/esm/integrations/tracing/fastify/index.js +8 -103
  77. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  78. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +3 -4
  79. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  80. package/build/esm/integrations/tracing/firebase/firebase.js.map +1 -1
  81. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -1
  82. package/build/esm/integrations/tracing/graphql/index.js.map +1 -1
  83. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  84. package/build/esm/integrations/tracing/hono/index.js.map +1 -1
  85. package/build/esm/integrations/tracing/index.js +1 -2
  86. package/build/esm/integrations/tracing/index.js.map +1 -1
  87. package/build/esm/integrations/tracing/kafka/index.js.map +1 -1
  88. package/build/esm/integrations/tracing/knex/index.js.map +1 -1
  89. package/build/esm/integrations/tracing/koa/index.js.map +1 -1
  90. package/build/esm/integrations/tracing/lrumemoizer/index.js.map +1 -1
  91. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js +5 -3
  92. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +1 -1
  93. package/build/esm/integrations/tracing/mongo/index.js.map +1 -1
  94. package/build/esm/integrations/tracing/mongoose/index.js.map +1 -1
  95. package/build/esm/integrations/tracing/mysql/index.js.map +1 -1
  96. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js +37 -131
  97. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +1 -1
  98. package/build/esm/integrations/tracing/mysql/vendored/semconv.js +1 -2
  99. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +1 -1
  100. package/build/esm/integrations/tracing/mysql/vendored/utils.js +3 -25
  101. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +1 -1
  102. package/build/esm/integrations/tracing/mysql2/index.js.map +1 -1
  103. package/build/esm/integrations/tracing/postgres/index.js.map +1 -1
  104. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  105. package/build/esm/integrations/tracing/prisma/index.js +2 -11
  106. package/build/esm/integrations/tracing/prisma/index.js.map +1 -1
  107. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js +83 -57
  108. package/build/esm/integrations/tracing/prisma/vendored/active-tracing-helper.js.map +1 -1
  109. package/build/esm/integrations/tracing/prisma/vendored/constants.js.map +1 -1
  110. package/build/esm/integrations/tracing/prisma/vendored/global.js +2 -2
  111. package/build/esm/integrations/tracing/prisma/vendored/global.js.map +1 -1
  112. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js +1 -6
  113. package/build/esm/integrations/tracing/prisma/vendored/instrumentation.js.map +1 -1
  114. package/build/esm/integrations/tracing/redis/index.js +4 -4
  115. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  116. package/build/esm/integrations/tracing/tedious/index.js.map +1 -1
  117. package/build/esm/integrations/tracing/vercelai/constants.js.map +1 -1
  118. package/build/esm/integrations/tracing/vercelai/index.js +3 -5
  119. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  120. package/build/esm/package.json +1 -1
  121. package/build/esm/sdk/diagnosticsChannelInjection.js.map +1 -1
  122. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +9 -7
  123. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +1 -1
  124. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
  125. package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -1
  126. package/build/types/integrations/featureFlagShims/openFeature.d.ts +3 -1
  127. package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -1
  128. package/build/types/integrations/featureFlagShims/statsig.d.ts +3 -1
  129. package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -1
  130. package/build/types/integrations/featureFlagShims/unleash.d.ts +3 -1
  131. package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -1
  132. package/build/types/integrations/fs/index.d.ts +3 -1
  133. package/build/types/integrations/fs/index.d.ts.map +1 -1
  134. package/build/types/integrations/http.d.ts +3 -1
  135. package/build/types/integrations/http.d.ts.map +1 -1
  136. package/build/types/integrations/node-fetch/index.d.ts +4 -35
  137. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  138. package/build/types/integrations/node-fetch/types.d.ts +96 -0
  139. package/build/types/integrations/node-fetch/types.d.ts.map +1 -0
  140. package/build/types/integrations/node-fetch/undici-instrumentation.d.ts +14 -0
  141. package/build/types/integrations/node-fetch/undici-instrumentation.d.ts.map +1 -0
  142. package/build/types/integrations/tracing/amqplib/index.d.ts +3 -1
  143. package/build/types/integrations/tracing/amqplib/index.d.ts.map +1 -1
  144. package/build/types/integrations/tracing/anthropic-ai/index.d.ts +3 -1
  145. package/build/types/integrations/tracing/anthropic-ai/index.d.ts.map +1 -1
  146. package/build/types/integrations/tracing/connect/index.d.ts +3 -1
  147. package/build/types/integrations/tracing/connect/index.d.ts.map +1 -1
  148. package/build/types/integrations/tracing/dataloader/index.d.ts +3 -1
  149. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -1
  150. package/build/types/integrations/tracing/express.d.ts +3 -1
  151. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  152. package/build/types/integrations/tracing/fastify/index.d.ts +6 -6
  153. package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -1
  154. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +1 -1
  155. package/build/types/integrations/tracing/firebase/firebase.d.ts +3 -1
  156. package/build/types/integrations/tracing/firebase/firebase.d.ts.map +1 -1
  157. package/build/types/integrations/tracing/genericPool/index.d.ts +3 -1
  158. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -1
  159. package/build/types/integrations/tracing/google-genai/index.d.ts +3 -1
  160. package/build/types/integrations/tracing/google-genai/index.d.ts.map +1 -1
  161. package/build/types/integrations/tracing/graphql/index.d.ts +3 -1
  162. package/build/types/integrations/tracing/graphql/index.d.ts.map +1 -1
  163. package/build/types/integrations/tracing/hapi/index.d.ts +3 -1
  164. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  165. package/build/types/integrations/tracing/hono/index.d.ts +3 -1
  166. package/build/types/integrations/tracing/hono/index.d.ts.map +1 -1
  167. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  168. package/build/types/integrations/tracing/kafka/index.d.ts +3 -1
  169. package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -1
  170. package/build/types/integrations/tracing/knex/index.d.ts +3 -1
  171. package/build/types/integrations/tracing/knex/index.d.ts.map +1 -1
  172. package/build/types/integrations/tracing/koa/index.d.ts +3 -1
  173. package/build/types/integrations/tracing/koa/index.d.ts.map +1 -1
  174. package/build/types/integrations/tracing/langchain/index.d.ts +3 -1
  175. package/build/types/integrations/tracing/langchain/index.d.ts.map +1 -1
  176. package/build/types/integrations/tracing/langgraph/index.d.ts +3 -1
  177. package/build/types/integrations/tracing/langgraph/index.d.ts.map +1 -1
  178. package/build/types/integrations/tracing/lrumemoizer/index.d.ts +3 -1
  179. package/build/types/integrations/tracing/lrumemoizer/index.d.ts.map +1 -1
  180. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +1 -1
  181. package/build/types/integrations/tracing/mongo/index.d.ts +3 -1
  182. package/build/types/integrations/tracing/mongo/index.d.ts.map +1 -1
  183. package/build/types/integrations/tracing/mongoose/index.d.ts +3 -1
  184. package/build/types/integrations/tracing/mongoose/index.d.ts.map +1 -1
  185. package/build/types/integrations/tracing/mysql/index.d.ts +3 -1
  186. package/build/types/integrations/tracing/mysql/index.d.ts.map +1 -1
  187. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts +3 -17
  188. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +1 -1
  189. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts +16 -16
  190. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +1 -1
  191. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts +0 -8
  192. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +1 -1
  193. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts +6 -9
  194. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +1 -1
  195. package/build/types/integrations/tracing/mysql2/index.d.ts +3 -1
  196. package/build/types/integrations/tracing/mysql2/index.d.ts.map +1 -1
  197. package/build/types/integrations/tracing/openai/index.d.ts +3 -1
  198. package/build/types/integrations/tracing/openai/index.d.ts.map +1 -1
  199. package/build/types/integrations/tracing/postgres/index.d.ts +3 -1
  200. package/build/types/integrations/tracing/postgres/index.d.ts.map +1 -1
  201. package/build/types/integrations/tracing/postgresjs.d.ts +3 -1
  202. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
  203. package/build/types/integrations/tracing/prisma/index.d.ts +5 -21
  204. package/build/types/integrations/tracing/prisma/index.d.ts.map +1 -1
  205. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +5 -7
  206. package/build/types/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts.map +1 -1
  207. package/build/types/integrations/tracing/prisma/vendored/constants.d.ts.map +1 -1
  208. package/build/types/integrations/tracing/prisma/vendored/global.d.ts.map +1 -1
  209. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts +2 -4
  210. package/build/types/integrations/tracing/prisma/vendored/instrumentation.d.ts.map +1 -1
  211. package/build/types/integrations/tracing/prisma/vendored/types.d.ts +5 -23
  212. package/build/types/integrations/tracing/prisma/vendored/types.d.ts.map +1 -1
  213. package/build/types/integrations/tracing/redis/index.d.ts +4 -2
  214. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
  215. package/build/types/integrations/tracing/tedious/index.d.ts +3 -1
  216. package/build/types/integrations/tracing/tedious/index.d.ts.map +1 -1
  217. package/build/types/integrations/tracing/vercelai/constants.d.ts +1 -1
  218. package/build/types/integrations/tracing/vercelai/constants.d.ts.map +1 -1
  219. package/build/types/integrations/tracing/vercelai/index.d.ts +3 -1
  220. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  221. package/build/types/sdk/diagnosticsChannelInjection.d.ts +1 -1
  222. package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +1 -1
  223. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +1 -1
  224. package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +3 -1
  225. package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +3 -1
  226. package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +3 -1
  227. package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +3 -1
  228. package/build/types-ts3.8/integrations/fs/index.d.ts +3 -1
  229. package/build/types-ts3.8/integrations/http.d.ts +3 -1
  230. package/build/types-ts3.8/integrations/node-fetch/index.d.ts +4 -35
  231. package/build/types-ts3.8/integrations/node-fetch/types.d.ts +96 -0
  232. package/build/types-ts3.8/integrations/node-fetch/undici-instrumentation.d.ts +14 -0
  233. package/build/types-ts3.8/integrations/tracing/amqplib/index.d.ts +3 -1
  234. package/build/types-ts3.8/integrations/tracing/anthropic-ai/index.d.ts +3 -1
  235. package/build/types-ts3.8/integrations/tracing/connect/index.d.ts +3 -1
  236. package/build/types-ts3.8/integrations/tracing/dataloader/index.d.ts +3 -1
  237. package/build/types-ts3.8/integrations/tracing/express.d.ts +3 -1
  238. package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +6 -6
  239. package/build/types-ts3.8/integrations/tracing/firebase/firebase.d.ts +3 -1
  240. package/build/types-ts3.8/integrations/tracing/genericPool/index.d.ts +3 -1
  241. package/build/types-ts3.8/integrations/tracing/google-genai/index.d.ts +3 -1
  242. package/build/types-ts3.8/integrations/tracing/graphql/index.d.ts +3 -1
  243. package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +3 -1
  244. package/build/types-ts3.8/integrations/tracing/hono/index.d.ts +3 -1
  245. package/build/types-ts3.8/integrations/tracing/kafka/index.d.ts +3 -1
  246. package/build/types-ts3.8/integrations/tracing/knex/index.d.ts +3 -1
  247. package/build/types-ts3.8/integrations/tracing/koa/index.d.ts +3 -1
  248. package/build/types-ts3.8/integrations/tracing/langchain/index.d.ts +3 -1
  249. package/build/types-ts3.8/integrations/tracing/langgraph/index.d.ts +3 -1
  250. package/build/types-ts3.8/integrations/tracing/lrumemoizer/index.d.ts +3 -1
  251. package/build/types-ts3.8/integrations/tracing/mongo/index.d.ts +3 -1
  252. package/build/types-ts3.8/integrations/tracing/mongoose/index.d.ts +3 -1
  253. package/build/types-ts3.8/integrations/tracing/mysql/index.d.ts +3 -1
  254. package/build/types-ts3.8/integrations/tracing/mysql/vendored/instrumentation.d.ts +3 -17
  255. package/build/types-ts3.8/integrations/tracing/mysql/vendored/mysql-types.d.ts +16 -16
  256. package/build/types-ts3.8/integrations/tracing/mysql/vendored/semconv.d.ts +0 -8
  257. package/build/types-ts3.8/integrations/tracing/mysql/vendored/utils.d.ts +6 -9
  258. package/build/types-ts3.8/integrations/tracing/mysql2/index.d.ts +3 -1
  259. package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +3 -1
  260. package/build/types-ts3.8/integrations/tracing/postgres/index.d.ts +3 -1
  261. package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +3 -1
  262. package/build/types-ts3.8/integrations/tracing/prisma/index.d.ts +5 -21
  263. package/build/types-ts3.8/integrations/tracing/prisma/vendored/active-tracing-helper.d.ts +5 -7
  264. package/build/types-ts3.8/integrations/tracing/prisma/vendored/instrumentation.d.ts +2 -4
  265. package/build/types-ts3.8/integrations/tracing/prisma/vendored/types.d.ts +5 -23
  266. package/build/types-ts3.8/integrations/tracing/redis/index.d.ts +4 -2
  267. package/build/types-ts3.8/integrations/tracing/tedious/index.d.ts +3 -1
  268. package/build/types-ts3.8/integrations/tracing/vercelai/constants.d.ts +1 -1
  269. package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +3 -1
  270. package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +1 -1
  271. package/package.json +6 -5
  272. package/build/cjs/integrations/node-fetch/vendored/semconv.js +0 -28
  273. package/build/cjs/integrations/node-fetch/vendored/semconv.js.map +0 -1
  274. package/build/cjs/integrations/node-fetch/vendored/undici.js +0 -302
  275. package/build/cjs/integrations/node-fetch/vendored/undici.js.map +0 -1
  276. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js +0 -387
  277. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +0 -1
  278. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js +0 -9
  279. package/build/cjs/integrations/tracing/mysql/vendored/AttributeNames.js.map +0 -1
  280. package/build/esm/integrations/node-fetch/vendored/semconv.js +0 -15
  281. package/build/esm/integrations/node-fetch/vendored/semconv.js.map +0 -1
  282. package/build/esm/integrations/node-fetch/vendored/undici.js +0 -300
  283. package/build/esm/integrations/node-fetch/vendored/undici.js.map +0 -1
  284. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js +0 -385
  285. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +0 -1
  286. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js +0 -7
  287. package/build/esm/integrations/tracing/mysql/vendored/AttributeNames.js.map +0 -1
  288. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts +0 -25
  289. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts.map +0 -1
  290. package/build/types/integrations/node-fetch/vendored/semconv.d.ts +0 -13
  291. package/build/types/integrations/node-fetch/vendored/semconv.d.ts.map +0 -1
  292. package/build/types/integrations/node-fetch/vendored/types.d.ts +0 -60
  293. package/build/types/integrations/node-fetch/vendored/types.d.ts.map +0 -1
  294. package/build/types/integrations/node-fetch/vendored/undici.d.ts +0 -21
  295. package/build/types/integrations/node-fetch/vendored/undici.d.ts.map +0 -1
  296. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts +0 -27
  297. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +0 -1
  298. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts +0 -4
  299. package/build/types/integrations/tracing/mysql/vendored/AttributeNames.d.ts.map +0 -1
  300. package/build/types/integrations/tracing/mysql/vendored/types.d.ts +0 -9
  301. package/build/types/integrations/tracing/mysql/vendored/types.d.ts.map +0 -1
  302. package/build/types-ts3.8/integrations/node-fetch/vendored/internal-types.d.ts +0 -25
  303. package/build/types-ts3.8/integrations/node-fetch/vendored/semconv.d.ts +0 -13
  304. package/build/types-ts3.8/integrations/node-fetch/vendored/types.d.ts +0 -60
  305. package/build/types-ts3.8/integrations/node-fetch/vendored/undici.d.ts +0 -21
  306. package/build/types-ts3.8/integrations/tracing/fastify/vendored/instrumentation.d.ts +0 -27
  307. package/build/types-ts3.8/integrations/tracing/mysql/vendored/AttributeNames.d.ts +0 -4
  308. package/build/types-ts3.8/integrations/tracing/mysql/vendored/types.d.ts +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"launchDarkly.js","sources":["../../../../src/integrations/featureFlagShims/launchDarkly.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the LaunchDarkly integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const launchDarklyIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The launchDarklyIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'LaunchDarkly',\n };\n});\n\n/**\n * This is a shim for the LaunchDarkly flag used handler.\n */\nexport function buildLaunchDarklyFlagUsedHandlerShim(): unknown {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The buildLaunchDarklyFlagUsedHandler() can only be used in the browser.');\n });\n }\n\n return {\n name: 'sentry-flag-auditor',\n type: 'flag-used',\n synchronous: true,\n method: () => null,\n };\n}\n"],"names":["defineIntegration","isBrowser","consoleSandbox"],"mappings":";;;;AAMO,MAAM,2BAAA,GAA8BA,sBAAA,CAAkB,CAAC,QAAA,KAAuB;AACnF,EAAA,IAAI,CAACC,gBAAU,EAAG;AAChB,IAAAC,mBAAA,CAAe,MAAM;AAEnB,MAAA,OAAA,CAAQ,KAAK,gEAAgE,CAAA;AAAA,IAC/E,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM;AAAA,GACR;AACF,CAAC;AAKM,SAAS,oCAAA,GAAgD;AAC9D,EAAA,IAAI,CAACD,gBAAU,EAAG;AAChB,IAAAC,mBAAA,CAAe,MAAM;AAEnB,MAAA,OAAA,CAAQ,KAAK,yEAAyE,CAAA;AAAA,IACxF,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,qBAAA;AAAA,IACN,IAAA,EAAM,WAAA;AAAA,IACN,WAAA,EAAa,IAAA;AAAA,IACb,QAAQ,MAAM;AAAA,GAChB;AACF;;;;;"}
1
+ {"version":3,"file":"launchDarkly.js","sources":["../../../../src/integrations/featureFlagShims/launchDarkly.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the LaunchDarkly integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const launchDarklyIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The launchDarklyIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'LaunchDarkly' as const,\n };\n});\n\n/**\n * This is a shim for the LaunchDarkly flag used handler.\n */\nexport function buildLaunchDarklyFlagUsedHandlerShim(): unknown {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The buildLaunchDarklyFlagUsedHandler() can only be used in the browser.');\n });\n }\n\n return {\n name: 'sentry-flag-auditor',\n type: 'flag-used',\n synchronous: true,\n method: () => null,\n };\n}\n"],"names":["defineIntegration","isBrowser","consoleSandbox"],"mappings":";;;;AAMO,MAAM,2BAAA,GAA8BA,sBAAA,CAAkB,CAAC,QAAA,KAAuB;AACnF,EAAA,IAAI,CAACC,gBAAU,EAAG;AAChB,IAAAC,mBAAA,CAAe,MAAM;AAEnB,MAAA,OAAA,CAAQ,KAAK,gEAAgE,CAAA;AAAA,IAC/E,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM;AAAA,GACR;AACF,CAAC;AAKM,SAAS,oCAAA,GAAgD;AAC9D,EAAA,IAAI,CAACD,gBAAU,EAAG;AAChB,IAAAC,mBAAA,CAAe,MAAM;AAEnB,MAAA,OAAA,CAAQ,KAAK,yEAAyE,CAAA;AAAA,IACxF,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,qBAAA;AAAA,IACN,IAAA,EAAM,WAAA;AAAA,IACN,WAAA,EAAa,IAAA;AAAA,IACb,QAAQ,MAAM;AAAA,GAChB;AACF;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"openFeature.js","sources":["../../../../src/integrations/featureFlagShims/openFeature.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the OpenFeature integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const openFeatureIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The openFeatureIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'OpenFeature',\n };\n});\n\n/**\n * This is a shim for the OpenFeature integration hook.\n */\nexport class OpenFeatureIntegrationHookShim {\n /**\n *\n */\n public constructor() {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The OpenFeatureIntegrationHook can only be used in the browser.');\n });\n }\n }\n\n /**\n *\n */\n public after(): void {\n // No-op\n }\n\n /**\n *\n */\n public error(): void {\n // No-op\n }\n}\n"],"names":["defineIntegration","isBrowser","consoleSandbox"],"mappings":";;;;AAMO,MAAM,0BAAA,GAA6BA,sBAAA,CAAkB,CAAC,QAAA,KAAuB;AAClF,EAAA,IAAI,CAACC,gBAAU,EAAG;AAChB,IAAAC,mBAAA,CAAe,MAAM;AAEnB,MAAA,OAAA,CAAQ,KAAK,+DAA+D,CAAA;AAAA,IAC9E,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM;AAAA,GACR;AACF,CAAC;AAKM,MAAM,8BAAA,CAA+B;AAAA;AAAA;AAAA;AAAA,EAInC,WAAA,GAAc;AACnB,IAAA,IAAI,CAACD,gBAAU,EAAG;AAChB,MAAAC,mBAAA,CAAe,MAAM;AAEnB,QAAA,OAAA,CAAQ,KAAK,iEAAiE,CAAA;AAAA,MAChF,CAAC,CAAA;AAAA,IACH;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKO,KAAA,GAAc;AAAA,EAErB;AAAA;AAAA;AAAA;AAAA,EAKO,KAAA,GAAc;AAAA,EAErB;AACF;;;;;"}
1
+ {"version":3,"file":"openFeature.js","sources":["../../../../src/integrations/featureFlagShims/openFeature.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the OpenFeature integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const openFeatureIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The openFeatureIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'OpenFeature' as const,\n };\n});\n\n/**\n * This is a shim for the OpenFeature integration hook.\n */\nexport class OpenFeatureIntegrationHookShim {\n /**\n *\n */\n public constructor() {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The OpenFeatureIntegrationHook can only be used in the browser.');\n });\n }\n }\n\n /**\n *\n */\n public after(): void {\n // No-op\n }\n\n /**\n *\n */\n public error(): void {\n // No-op\n }\n}\n"],"names":["defineIntegration","isBrowser","consoleSandbox"],"mappings":";;;;AAMO,MAAM,0BAAA,GAA6BA,sBAAA,CAAkB,CAAC,QAAA,KAAuB;AAClF,EAAA,IAAI,CAACC,gBAAU,EAAG;AAChB,IAAAC,mBAAA,CAAe,MAAM;AAEnB,MAAA,OAAA,CAAQ,KAAK,+DAA+D,CAAA;AAAA,IAC9E,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM;AAAA,GACR;AACF,CAAC;AAKM,MAAM,8BAAA,CAA+B;AAAA;AAAA;AAAA;AAAA,EAInC,WAAA,GAAc;AACnB,IAAA,IAAI,CAACD,gBAAU,EAAG;AAChB,MAAAC,mBAAA,CAAe,MAAM;AAEnB,QAAA,OAAA,CAAQ,KAAK,iEAAiE,CAAA;AAAA,MAChF,CAAC,CAAA;AAAA,IACH;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKO,KAAA,GAAc;AAAA,EAErB;AAAA;AAAA;AAAA;AAAA,EAKO,KAAA,GAAc;AAAA,EAErB;AACF;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"statsig.js","sources":["../../../../src/integrations/featureFlagShims/statsig.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the Statsig integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const statsigIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The statsigIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'Statsig',\n };\n});\n"],"names":["defineIntegration","isBrowser","consoleSandbox"],"mappings":";;;;AAMO,MAAM,sBAAA,GAAyBA,sBAAA,CAAkB,CAAC,QAAA,KAAuB;AAC9E,EAAA,IAAI,CAACC,gBAAU,EAAG;AAChB,IAAAC,mBAAA,CAAe,MAAM;AAEnB,MAAA,OAAA,CAAQ,KAAK,2DAA2D,CAAA;AAAA,IAC1E,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM;AAAA,GACR;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"statsig.js","sources":["../../../../src/integrations/featureFlagShims/statsig.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the Statsig integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const statsigIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The statsigIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'Statsig' as const,\n };\n});\n"],"names":["defineIntegration","isBrowser","consoleSandbox"],"mappings":";;;;AAMO,MAAM,sBAAA,GAAyBA,sBAAA,CAAkB,CAAC,QAAA,KAAuB;AAC9E,EAAA,IAAI,CAACC,gBAAU,EAAG;AAChB,IAAAC,mBAAA,CAAe,MAAM;AAEnB,MAAA,OAAA,CAAQ,KAAK,2DAA2D,CAAA;AAAA,IAC1E,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM;AAAA,GACR;AACF,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"unleash.js","sources":["../../../../src/integrations/featureFlagShims/unleash.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the Unleash integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const unleashIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The unleashIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'Unleash',\n };\n});\n"],"names":["defineIntegration","isBrowser","consoleSandbox"],"mappings":";;;;AAMO,MAAM,sBAAA,GAAyBA,sBAAA,CAAkB,CAAC,QAAA,KAAuB;AAC9E,EAAA,IAAI,CAACC,gBAAU,EAAG;AAChB,IAAAC,mBAAA,CAAe,MAAM;AAEnB,MAAA,OAAA,CAAQ,KAAK,2DAA2D,CAAA;AAAA,IAC1E,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM;AAAA,GACR;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"unleash.js","sources":["../../../../src/integrations/featureFlagShims/unleash.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the Unleash integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const unleashIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The unleashIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'Unleash' as const,\n };\n});\n"],"names":["defineIntegration","isBrowser","consoleSandbox"],"mappings":";;;;AAMO,MAAM,sBAAA,GAAyBA,sBAAA,CAAkB,CAAC,QAAA,KAAuB;AAC9E,EAAA,IAAI,CAACC,gBAAU,EAAG;AAChB,IAAAC,mBAAA,CAAe,MAAM;AAEnB,MAAA,OAAA,CAAQ,KAAK,2DAA2D,CAAA;AAAA,IAC1E,CAAC,CAAA;AAAA,EACH;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM;AAAA,GACR;AACF,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/integrations/fs/index.ts"],"sourcesContent":["import { defineIntegration } from '@sentry/core';\nimport { enableFsInstrumentation } from './vendored/instrumentation';\nimport type { FsInstrumentationConfig } from './vendored/types';\n\nconst INTEGRATION_NAME = 'FileSystem';\n\n/**\n * This integration will create spans for `fs` API operations, like reading and writing files.\n *\n * **WARNING:** This integration may add significant overhead to your application. Especially in scenarios with a lot of\n * file I/O, like for example when running a framework dev server, including this integration can massively slow down\n * your application.\n *\n * @param options Configuration for this integration.\n */\nexport const fsIntegration = defineIntegration((options: FsInstrumentationConfig = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n enableFsInstrumentation(options);\n },\n };\n});\n"],"names":["defineIntegration","enableFsInstrumentation"],"mappings":";;;;;AAIA,MAAM,gBAAA,GAAmB,YAAA;AAWlB,MAAM,aAAA,GAAgBA,sBAAA,CAAkB,CAAC,OAAA,GAAmC,EAAC,KAAM;AACxF,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAAC,uCAAA,CAAwB,OAAO,CAAA;AAAA,IACjC;AAAA,GACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/integrations/fs/index.ts"],"sourcesContent":["import { defineIntegration } from '@sentry/core';\nimport { enableFsInstrumentation } from './vendored/instrumentation';\nimport type { FsInstrumentationConfig } from './vendored/types';\n\nconst INTEGRATION_NAME = 'FileSystem' as const;\n\n/**\n * This integration will create spans for `fs` API operations, like reading and writing files.\n *\n * **WARNING:** This integration may add significant overhead to your application. Especially in scenarios with a lot of\n * file I/O, like for example when running a framework dev server, including this integration can massively slow down\n * your application.\n *\n * @param options Configuration for this integration.\n */\nexport const fsIntegration = defineIntegration((options: FsInstrumentationConfig = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n enableFsInstrumentation(options);\n },\n };\n});\n"],"names":["defineIntegration","enableFsInstrumentation"],"mappings":";;;;;AAIA,MAAM,gBAAA,GAAmB,YAAA;AAWlB,MAAM,aAAA,GAAgBA,sBAAA,CAAkB,CAAC,OAAA,GAAmC,EAAC,KAAM;AACxF,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAAC,uCAAA,CAAwB,OAAO,CAAA;AAAA,IACjC;AAAA,GACF;AACF,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sources":["../../../src/integrations/http.ts"],"sourcesContent":["import type { RequestOptions } from 'node:http';\nimport type { HttpClientRequest, HttpIncomingMessage, HttpServerResponse, Span } from '@sentry/core';\nimport {\n defineIntegration,\n hasSpansEnabled,\n SEMANTIC_ATTRIBUTE_URL_FULL,\n stripDataUrlContent,\n getRequestUrlFromClientRequest,\n} from '@sentry/core';\nimport type {\n NodeClient,\n SentryHttpInstrumentationOptions,\n HttpServerIntegrationOptions,\n HttpServerSpansIntegrationOptions,\n} from '@sentry/node-core';\nimport {\n generateInstrumentOnce,\n httpServerIntegration,\n httpServerSpansIntegration,\n SentryHttpInstrumentation,\n} from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Http';\n\n// TODO(v11): Consolidate all the various HTTP integration options into one,\n// and deprecate the duplicated and aliased options.\ninterface HttpOptions {\n /**\n * Whether breadcrumbs should be recorded for outgoing requests.\n * Defaults to true\n */\n breadcrumbs?: boolean;\n\n /**\n * If set to false, do not emit any spans.\n * This will ensure that the default HttpInstrumentation from OpenTelemetry is not setup,\n * only the Sentry-specific instrumentation for request isolation is applied.\n *\n * If `skipOpenTelemetrySetup: true` is configured, this defaults to `false`, otherwise it defaults to `true`.\n */\n spans?: boolean;\n\n /**\n * Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.\n * Read more about Release Health: https://docs.sentry.io/product/releases/health/\n *\n * Defaults to `true`.\n */\n trackIncomingRequestsAsSessions?: boolean;\n\n /**\n * Number of milliseconds until sessions tracked with `trackIncomingRequestsAsSessions` will be flushed as a session aggregate.\n *\n * Defaults to `60000` (60s).\n */\n sessionFlushingDelayMS?: number;\n\n /**\n * Whether to inject trace propagation headers (sentry-trace, baggage, traceparent) into outgoing HTTP requests.\n *\n * When set to `false`, Sentry will not inject any trace propagation headers, but will still create breadcrumbs\n * (if `breadcrumbs` is enabled). This is useful when `skipOpenTelemetrySetup: true` is configured and you want\n * to avoid duplicate trace headers being injected by both Sentry and OpenTelemetry's HttpInstrumentation.\n *\n * @default `true`\n */\n tracePropagation?: boolean;\n\n /**\n * Do not capture spans or breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.\n * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.\n *\n * The `url` param contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.\n * For example: `'https://someService.com/users/details?id=123'`\n *\n * The `request` param contains the original {@type RequestOptions} object used to make the outgoing request.\n * You can use it to filter on additional properties like method, headers, etc.\n */\n ignoreOutgoingRequests?: (url: string, request: RequestOptions) => boolean;\n\n /**\n * Do not capture spans for incoming HTTP requests to URLs where the given callback returns `true`.\n * Spans will be non recording if tracing is disabled.\n *\n * The `urlPath` param consists of the URL path and query string (if any) of the incoming request.\n * For example: `'/users/details?id=123'`\n *\n * The `request` param contains the original {@type IncomingMessage} object of the incoming request.\n * You can use it to filter on additional properties like method, headers, etc.\n */\n ignoreIncomingRequests?: (urlPath: string, request: HttpIncomingMessage) => boolean;\n\n /**\n * A hook that can be used to mutate the span for incoming requests.\n * This is triggered after the span is created, but before it is recorded.\n */\n incomingRequestSpanHook?: (span: Span, request: HttpIncomingMessage, response: HttpServerResponse) => void;\n\n /**\n * Whether to automatically ignore common static asset requests like favicon.ico, robots.txt, etc.\n * This helps reduce noise in your transactions.\n *\n * @default `true`\n */\n ignoreStaticAssets?: boolean;\n\n /**\n * Do not capture spans for incoming HTTP requests with the given status codes.\n * By default, spans with some 3xx and 4xx status codes are ignored (see @default).\n * Expects an array of status codes or a range of status codes, e.g. [[300,399], 404] would ignore 3xx and 404 status codes.\n *\n * @default `[[401, 404], [301, 303], [305, 399]]`\n */\n dropSpansForIncomingRequestStatusCodes?: (number | [number, number])[];\n\n /**\n * Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.\n * This can be useful for long running requests where the body is not needed and we want to avoid capturing it.\n *\n * @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the incoming request.\n * @param request Contains the {@type RequestOptions} object used to make the incoming request.\n */\n ignoreIncomingRequestBody?: (url: string, request: RequestOptions) => boolean;\n\n /**\n * Controls the maximum size of incoming HTTP request bodies attached to events.\n *\n * Available options:\n * - 'none': No request bodies will be attached\n * - 'small': Request bodies up to 1,000 bytes will be attached\n * - 'medium': Request bodies up to 10,000 bytes will be attached (default)\n * - 'always': Request bodies will always be attached\n *\n * Note that even with 'always' setting, bodies exceeding 1MB will never be attached\n * for performance and security reasons.\n *\n * @default 'medium'\n */\n maxIncomingRequestBodySize?: 'none' | 'small' | 'medium' | 'always';\n\n /**\n * If true, do not generate spans for incoming requests at all.\n * This is used by Remix to avoid generating spans for incoming requests, as it generates its own spans.\n */\n disableIncomingRequestSpans?: boolean;\n\n /**\n * Additional instrumentation options that are passed to the underlying HttpInstrumentation.\n */\n instrumentation?: {\n requestHook?: (span: Span, req: HttpIncomingMessage | HttpClientRequest) => void;\n responseHook?: (span: Span, response: HttpIncomingMessage | HttpServerResponse) => void;\n applyCustomAttributesOnSpan?: (\n span: Span,\n request: HttpIncomingMessage | HttpClientRequest,\n response: HttpIncomingMessage | HttpServerResponse,\n ) => void;\n };\n}\n\nexport const instrumentSentryHttp = generateInstrumentOnce<SentryHttpInstrumentationOptions>(\n `${INTEGRATION_NAME}.sentry`,\n options => {\n return new SentryHttpInstrumentation(options);\n },\n);\n\n/**\n * The http integration instruments Node's internal http and https modules.\n * It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.\n */\nexport const httpIntegration = defineIntegration((options: HttpOptions = {}) => {\n const spans = options.spans ?? true;\n const disableIncomingRequestSpans = options.disableIncomingRequestSpans;\n const enableServerSpans = spans && !disableIncomingRequestSpans;\n\n const serverOptions = {\n sessions: options.trackIncomingRequestsAsSessions,\n sessionFlushingDelayMS: options.sessionFlushingDelayMS,\n ignoreRequestBody: options.ignoreIncomingRequestBody,\n maxRequestBodySize: options.maxIncomingRequestBodySize,\n } satisfies HttpServerIntegrationOptions;\n\n const serverSpansOptions: HttpServerSpansIntegrationOptions = {\n ignoreIncomingRequests: options.ignoreIncomingRequests,\n ignoreStaticAssets: options.ignoreStaticAssets,\n ignoreStatusCodes: options.dropSpansForIncomingRequestStatusCodes,\n instrumentation: options.instrumentation,\n onSpanCreated: options.incomingRequestSpanHook,\n };\n\n const server = httpServerIntegration(serverOptions);\n const serverSpans = httpServerSpansIntegration(serverSpansOptions);\n\n return {\n name: INTEGRATION_NAME,\n setup(client: NodeClient) {\n const clientOptions = client.getOptions();\n\n if (enableServerSpans && hasSpansEnabled(clientOptions)) {\n serverSpans.setup(client);\n }\n },\n setupOnce() {\n server.setupOnce();\n\n const sentryHttpInstrumentationOptions: SentryHttpInstrumentationOptions = {\n breadcrumbs: options.breadcrumbs,\n spans,\n propagateTraceInOutgoingRequests: options.tracePropagation ?? true,\n createSpansForOutgoingRequests: spans,\n ignoreOutgoingRequests: options.ignoreOutgoingRequests,\n outgoingRequestHook: (span: Span, request: HttpClientRequest) => {\n // Sanitize data URLs to prevent long base64 strings in span attributes\n const url = getRequestUrlFromClientRequest(request);\n if (url.startsWith('data:')) {\n const sanitizedUrl = stripDataUrlContent(url);\n // TODO(v11): Update these to the Sentry semantic attributes.\n // https://getsentry.github.io/sentry-conventions/attributes/\n span.setAttribute('http.url', sanitizedUrl);\n span.setAttribute(SEMANTIC_ATTRIBUTE_URL_FULL, sanitizedUrl);\n span.updateName(`${request.method || 'GET'} ${sanitizedUrl}`);\n }\n options.instrumentation?.requestHook?.(span, request);\n },\n outgoingResponseHook: options.instrumentation?.responseHook,\n outgoingRequestApplyCustomAttributes: options.instrumentation?.applyCustomAttributesOnSpan,\n };\n\n // This is Sentry-specific instrumentation for outgoing request\n // breadcrumbs & trace propagation. It uses the diagnostic channels on\n // node versions that support it, falling back to monkey-patching when\n // needed.\n instrumentSentryHttp(sentryHttpInstrumentationOptions);\n },\n processEvent(event) {\n // Always run this, even if spans are disabled\n // The reason being that e.g. the remix integration disables span\n // creation here but still wants to use the ignore status codes option\n return serverSpans.processEvent(event);\n },\n };\n});\n"],"names":["generateInstrumentOnce","SentryHttpInstrumentation","defineIntegration","httpServerIntegration","httpServerSpansIntegration","hasSpansEnabled","getRequestUrlFromClientRequest","stripDataUrlContent","SEMANTIC_ATTRIBUTE_URL_FULL"],"mappings":";;;;;AAsBA,MAAM,gBAAA,GAAmB,MAAA;AA0IlB,MAAM,oBAAA,GAAuBA,+BAAA;AA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EAAU;AAEjB,MAAA,MAAM,gCAAA,GAAqE;AAAA,QACzE,aAAa,OAAA,CAAQ,WAAA;AAAA,QACrB,KAAA;AAAA,QACA,gCAAA,EAAkC,QAAQ,gBAAA,IAAoB,IAAA;AAAA,QAC9D,8BAAA,EAAgC,KAAA;AAAA,QAChC,wBAAwB,OAAA,CAAQ,sBAAA;AAAA,QAChC,mBAAA,EAAqB,CAAC,IAAA,EAAY,OAAA,KAA+B;AAE/D,UAAA,MAAM,GAAA,GAAMC,oCAA+B,OAAO,CAAA;AAClD,UAAA,IAAI,GAAA,CAAI,UAAA,CAAW,OAAO,CAAA,EAAG;AAC3B,YAAA,MAAM,YAAA,GAAeC,yBAAoB,GAAG,CAAA;AAG5C,YAAA,IAAA,CAAK,YAAA,CAAa,YAAY,YAAY,CAAA;AAC1C,YAAA,IAAA,CAAK,YAAA,CAAaC,kCAA6B,YAAY,CAAA;AAC3D,YAAA,IAAA,CAAK,WAAW,CAAA,EAAG,OAAA,CAAQ,UAAU,KAAK,CAAA,CAAA,EAAI,YAAY,CAAA,CAAE,CAAA;AAAA,UAC9D;AACA,UAAA,OAAA,CAAQ,eAAA,EAAiB,WAAA,GAAc,IAAA,EAAM,OAAO,CAAA;AAAA,QACtD,CAAA;AAAA,QACA,oBAAA,EAAsB,QAAQ,eAAA,EAAiB,YAAA;AAAA,QAC/C,oCAAA,EAAsC,QAAQ,eAAA,EAAiB;AAAA,OACjE;AAMA,MAAA,oBAAA,CAAqB,gCAAgC,CAAA;AAAA,IACvD,CAAA;AAAA,IACA,aAAa,KAAA,EAAO;AAIlB,MAAA,OAAO,WAAA,CAAY,aAAa,KAAK,CAAA;AAAA,IACvC;AAAA,GACF;AACF,CAAC;;;;;"}
1
+ {"version":3,"file":"http.js","sources":["../../../src/integrations/http.ts"],"sourcesContent":["import type { RequestOptions } from 'node:http';\nimport type { HttpClientRequest, HttpIncomingMessage, HttpServerResponse, Span } from '@sentry/core';\nimport {\n defineIntegration,\n hasSpansEnabled,\n SEMANTIC_ATTRIBUTE_URL_FULL,\n stripDataUrlContent,\n getRequestUrlFromClientRequest,\n} from '@sentry/core';\nimport type {\n NodeClient,\n SentryHttpInstrumentationOptions,\n HttpServerIntegrationOptions,\n HttpServerSpansIntegrationOptions,\n} from '@sentry/node-core';\nimport {\n generateInstrumentOnce,\n httpServerIntegration,\n httpServerSpansIntegration,\n SentryHttpInstrumentation,\n} from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Http' as const;\n\n// TODO(v11): Consolidate all the various HTTP integration options into one,\n// and deprecate the duplicated and aliased options.\ninterface HttpOptions {\n /**\n * Whether breadcrumbs should be recorded for outgoing requests.\n * Defaults to true\n */\n breadcrumbs?: boolean;\n\n /**\n * If set to false, do not emit any spans.\n * This will ensure that the default HttpInstrumentation from OpenTelemetry is not setup,\n * only the Sentry-specific instrumentation for request isolation is applied.\n *\n * If `skipOpenTelemetrySetup: true` is configured, this defaults to `false`, otherwise it defaults to `true`.\n */\n spans?: boolean;\n\n /**\n * Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.\n * Read more about Release Health: https://docs.sentry.io/product/releases/health/\n *\n * Defaults to `true`.\n */\n trackIncomingRequestsAsSessions?: boolean;\n\n /**\n * Number of milliseconds until sessions tracked with `trackIncomingRequestsAsSessions` will be flushed as a session aggregate.\n *\n * Defaults to `60000` (60s).\n */\n sessionFlushingDelayMS?: number;\n\n /**\n * Whether to inject trace propagation headers (sentry-trace, baggage, traceparent) into outgoing HTTP requests.\n *\n * When set to `false`, Sentry will not inject any trace propagation headers, but will still create breadcrumbs\n * (if `breadcrumbs` is enabled). This is useful when `skipOpenTelemetrySetup: true` is configured and you want\n * to avoid duplicate trace headers being injected by both Sentry and OpenTelemetry's HttpInstrumentation.\n *\n * @default `true`\n */\n tracePropagation?: boolean;\n\n /**\n * Do not capture spans or breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.\n * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.\n *\n * The `url` param contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.\n * For example: `'https://someService.com/users/details?id=123'`\n *\n * The `request` param contains the original {@type RequestOptions} object used to make the outgoing request.\n * You can use it to filter on additional properties like method, headers, etc.\n */\n ignoreOutgoingRequests?: (url: string, request: RequestOptions) => boolean;\n\n /**\n * Do not capture spans for incoming HTTP requests to URLs where the given callback returns `true`.\n * Spans will be non recording if tracing is disabled.\n *\n * The `urlPath` param consists of the URL path and query string (if any) of the incoming request.\n * For example: `'/users/details?id=123'`\n *\n * The `request` param contains the original {@type IncomingMessage} object of the incoming request.\n * You can use it to filter on additional properties like method, headers, etc.\n */\n ignoreIncomingRequests?: (urlPath: string, request: HttpIncomingMessage) => boolean;\n\n /**\n * A hook that can be used to mutate the span for incoming requests.\n * This is triggered after the span is created, but before it is recorded.\n */\n incomingRequestSpanHook?: (span: Span, request: HttpIncomingMessage, response: HttpServerResponse) => void;\n\n /**\n * Whether to automatically ignore common static asset requests like favicon.ico, robots.txt, etc.\n * This helps reduce noise in your transactions.\n *\n * @default `true`\n */\n ignoreStaticAssets?: boolean;\n\n /**\n * Do not capture spans for incoming HTTP requests with the given status codes.\n * By default, spans with some 3xx and 4xx status codes are ignored (see @default).\n * Expects an array of status codes or a range of status codes, e.g. [[300,399], 404] would ignore 3xx and 404 status codes.\n *\n * @default `[[401, 404], [301, 303], [305, 399]]`\n */\n dropSpansForIncomingRequestStatusCodes?: (number | [number, number])[];\n\n /**\n * Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.\n * This can be useful for long running requests where the body is not needed and we want to avoid capturing it.\n *\n * @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the incoming request.\n * @param request Contains the {@type RequestOptions} object used to make the incoming request.\n */\n ignoreIncomingRequestBody?: (url: string, request: RequestOptions) => boolean;\n\n /**\n * Controls the maximum size of incoming HTTP request bodies attached to events.\n *\n * Available options:\n * - 'none': No request bodies will be attached\n * - 'small': Request bodies up to 1,000 bytes will be attached\n * - 'medium': Request bodies up to 10,000 bytes will be attached (default)\n * - 'always': Request bodies will always be attached\n *\n * Note that even with 'always' setting, bodies exceeding 1MB will never be attached\n * for performance and security reasons.\n *\n * @default 'medium'\n */\n maxIncomingRequestBodySize?: 'none' | 'small' | 'medium' | 'always';\n\n /**\n * If true, do not generate spans for incoming requests at all.\n * This is used by Remix to avoid generating spans for incoming requests, as it generates its own spans.\n */\n disableIncomingRequestSpans?: boolean;\n\n /**\n * Additional instrumentation options that are passed to the underlying HttpInstrumentation.\n */\n instrumentation?: {\n requestHook?: (span: Span, req: HttpIncomingMessage | HttpClientRequest) => void;\n responseHook?: (span: Span, response: HttpIncomingMessage | HttpServerResponse) => void;\n applyCustomAttributesOnSpan?: (\n span: Span,\n request: HttpIncomingMessage | HttpClientRequest,\n response: HttpIncomingMessage | HttpServerResponse,\n ) => void;\n };\n}\n\nexport const instrumentSentryHttp = generateInstrumentOnce<SentryHttpInstrumentationOptions>(\n `${INTEGRATION_NAME}.sentry`,\n options => {\n return new SentryHttpInstrumentation(options);\n },\n);\n\n/**\n * The http integration instruments Node's internal http and https modules.\n * It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.\n */\nexport const httpIntegration = defineIntegration((options: HttpOptions = {}) => {\n const spans = options.spans ?? true;\n const disableIncomingRequestSpans = options.disableIncomingRequestSpans;\n const enableServerSpans = spans && !disableIncomingRequestSpans;\n\n const serverOptions = {\n sessions: options.trackIncomingRequestsAsSessions,\n sessionFlushingDelayMS: options.sessionFlushingDelayMS,\n ignoreRequestBody: options.ignoreIncomingRequestBody,\n maxRequestBodySize: options.maxIncomingRequestBodySize,\n } satisfies HttpServerIntegrationOptions;\n\n const serverSpansOptions: HttpServerSpansIntegrationOptions = {\n ignoreIncomingRequests: options.ignoreIncomingRequests,\n ignoreStaticAssets: options.ignoreStaticAssets,\n ignoreStatusCodes: options.dropSpansForIncomingRequestStatusCodes,\n instrumentation: options.instrumentation,\n onSpanCreated: options.incomingRequestSpanHook,\n };\n\n const server = httpServerIntegration(serverOptions);\n const serverSpans = httpServerSpansIntegration(serverSpansOptions);\n\n return {\n name: INTEGRATION_NAME,\n setup(client: NodeClient) {\n const clientOptions = client.getOptions();\n\n if (enableServerSpans && hasSpansEnabled(clientOptions)) {\n serverSpans.setup(client);\n }\n },\n setupOnce() {\n server.setupOnce();\n\n const sentryHttpInstrumentationOptions: SentryHttpInstrumentationOptions = {\n breadcrumbs: options.breadcrumbs,\n spans,\n propagateTraceInOutgoingRequests: options.tracePropagation ?? true,\n createSpansForOutgoingRequests: spans,\n ignoreOutgoingRequests: options.ignoreOutgoingRequests,\n outgoingRequestHook: (span: Span, request: HttpClientRequest) => {\n // Sanitize data URLs to prevent long base64 strings in span attributes\n const url = getRequestUrlFromClientRequest(request);\n if (url.startsWith('data:')) {\n const sanitizedUrl = stripDataUrlContent(url);\n // TODO(v11): Update these to the Sentry semantic attributes.\n // https://getsentry.github.io/sentry-conventions/attributes/\n span.setAttribute('http.url', sanitizedUrl);\n span.setAttribute(SEMANTIC_ATTRIBUTE_URL_FULL, sanitizedUrl);\n span.updateName(`${request.method || 'GET'} ${sanitizedUrl}`);\n }\n options.instrumentation?.requestHook?.(span, request);\n },\n outgoingResponseHook: options.instrumentation?.responseHook,\n outgoingRequestApplyCustomAttributes: options.instrumentation?.applyCustomAttributesOnSpan,\n };\n\n // This is Sentry-specific instrumentation for outgoing request\n // breadcrumbs & trace propagation. It uses the diagnostic channels on\n // node versions that support it, falling back to monkey-patching when\n // needed.\n instrumentSentryHttp(sentryHttpInstrumentationOptions);\n },\n processEvent(event) {\n // Always run this, even if spans are disabled\n // The reason being that e.g. the remix integration disables span\n // creation here but still wants to use the ignore status codes option\n return serverSpans.processEvent(event);\n },\n };\n});\n"],"names":["generateInstrumentOnce","SentryHttpInstrumentation","defineIntegration","httpServerIntegration","httpServerSpansIntegration","hasSpansEnabled","getRequestUrlFromClientRequest","stripDataUrlContent","SEMANTIC_ATT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' });
2
2
 
3
- const undici = require('./vendored/undici.js');
3
+ const undiciInstrumentation = require('./undici-instrumentation.js');
4
4
  const core = require('@sentry/core');
5
5
  const nodeCore = require('@sentry/node-core');
6
6
 
7
7
  const INTEGRATION_NAME = "NodeFetch";
8
- let _undiciInstrumentation;
9
- function instrumentNodeFetchSpans(options) {
10
- if (!_undiciInstrumentation) {
11
- _undiciInstrumentation = new undici.UndiciInstrumentation(_getConfigWithDefaults(options));
12
- }
13
- _undiciInstrumentation.enable();
14
- }
15
8
  const instrumentSentryNodeFetch = nodeCore.generateInstrumentOnce(
16
9
  `${INTEGRATION_NAME}.sentry`,
17
10
  nodeCore.SentryNodeFetchInstrumentation,
@@ -25,56 +18,21 @@ const _nativeNodeFetchIntegration = ((options = {}) => {
25
18
  setupOnce() {
26
19
  const instrumentSpans = _shouldInstrumentSpans(options, core.getClient()?.getOptions());
27
20
  if (instrumentSpans) {
28
- instrumentNodeFetchSpans(options);
21
+ undiciInstrumentation.instrumentUndici({
22
+ ignoreOutgoingRequests: options.ignoreOutgoingRequests,
23
+ requestHook: options.requestHook,
24
+ responseHook: options.responseHook,
25
+ headersToSpanAttributes: options.headersToSpanAttributes
26
+ });
29
27
  }
30
28
  instrumentSentryNodeFetch(options);
31
29
  }
32
30
  };
33
31
  });
34
32
  const nativeNodeFetchIntegration = core.defineIntegration(_nativeNodeFetchIntegration);
35
- function getAbsoluteUrl(origin, path = "/") {
36
- const url = `${origin}`;
37
- if (url.endsWith("/") && path.startsWith("/")) {
38
- return `${url}${path.slice(1)}`;
39
- }
40
- if (!url.endsWith("/") && !path.startsWith("/")) {
41
- return `${url}/${path}`;
42
- }
43
- return `${url}${path}`;
44
- }
45
33
  function _shouldInstrumentSpans(options, clientOptions = {}) {
46
34
  return typeof options.spans === "boolean" ? options.spans : !clientOptions.skipOpenTelemetrySetup && core.hasSpansEnabled(clientOptions);
47
35
  }
48
- function _getConfigWithDefaults(options = {}) {
49
- const instrumentationConfig = {
50
- ignoreRequestHook: (request) => {
51
- const url = getAbsoluteUrl(request.origin, request.path);
52
- const _ignoreOutgoingRequests = options.ignoreOutgoingRequests;
53
- const shouldIgnore = _ignoreOutgoingRequests && url && _ignoreOutgoingRequests(url);
54
- return !!shouldIgnore;
55
- },
56
- startSpanHook: (request) => {
57
- const url = getAbsoluteUrl(request.origin, request.path);
58
- if (url.startsWith("data:")) {
59
- const sanitizedUrl = core.stripDataUrlContent(url);
60
- return {
61
- [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.node_fetch",
62
- "http.url": sanitizedUrl,
63
- [core.SEMANTIC_ATTRIBUTE_URL_FULL]: sanitizedUrl,
64
- [core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]: `${request.method || "GET"} ${sanitizedUrl}`
65
- };
66
- }
67
- return {
68
- [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.node_fetch"
69
- };
70
- },
71
- requestHook: options.requestHook,
72
- responseHook: options.responseHook,
73
- headersToSpanAttributes: options.headersToSpanAttributes
74
- };
75
- return instrumentationConfig;
76
- }
77
36
 
78
- exports._getConfigWithDefaults = _getConfigWithDefaults;
79
37
  exports.nativeNodeFetchIntegration = nativeNodeFetchIntegration;
80
38
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/integrations/node-fetch/index.ts"],"sourcesContent":["import type { UndiciInstrumentationConfig } from './vendored/types';\nimport { UndiciInstrumentation } from './vendored/undici';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n getClient,\n hasSpansEnabled,\n SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_URL_FULL,\n stripDataUrlContent,\n} from '@sentry/core';\nimport type { NodeClient } from '@sentry/node-core';\nimport { generateInstrumentOnce, SentryNodeFetchInstrumentation } from '@sentry/node-core';\nimport type { NodeClientOptions } from '../../types';\n\nconst INTEGRATION_NAME = 'NodeFetch';\n\ninterface NodeFetchOptions extends Pick<\n UndiciInstrumentationConfig,\n 'requestHook' | 'responseHook' | 'headersToSpanAttributes'\n> {\n /**\n * Whether breadcrumbs should be recorded for requests.\n * Defaults to true\n */\n breadcrumbs?: boolean;\n\n /**\n * If set to false, do not emit any spans.\n * This will ensure that the default UndiciInstrumentation from OpenTelemetry is not setup,\n * only the Sentry-specific instrumentation for breadcrumbs & trace propagation is applied.\n *\n * If `skipOpenTelemetrySetup: true` is configured, this defaults to `false`, otherwise it defaults to `true`.\n */\n spans?: boolean;\n\n /**\n * Whether to inject trace propagation headers (sentry-trace, baggage, traceparent) into outgoing fetch requests.\n *\n * When set to `false`, Sentry will not inject any trace propagation headers, but will still create breadcrumbs\n * (if `breadcrumbs` is enabled). This is useful when `skipOpenTelemetrySetup: true` is configured and you want\n * to avoid duplicate trace headers being injected by both Sentry and OpenTelemetry's UndiciInstrumentation.\n *\n * @default `true`\n */\n tracePropagation?: boolean;\n\n /**\n * Do not capture spans or breadcrumbs for outgoing fetch requests to URLs where the given callback returns `true`.\n * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.\n */\n ignoreOutgoingRequests?: (url: string) => boolean;\n}\n\nlet _undiciInstrumentation: UndiciInstrumentation | undefined;\n\n// Sets up the vendored undici instrumentation (emits `http.client` spans & propagates traces).\n// The module-level singleton mirrors `generateInstrumentOnce`'s \"instrument once per process\" behavior.\nfunction instrumentNodeFetchSpans(options: NodeFetchOptions): void {\n if (!_undiciInstrumentation) {\n _undiciInstrumentation = new UndiciInstrumentation(_getConfigWithDefaults(options));\n }\n _undiciInstrumentation.enable();\n}\n\nconst instrumentSentryNodeFetch = generateInstrumentOnce(\n `${INTEGRATION_NAME}.sentry`,\n SentryNodeFetchInstrumentation,\n (options: NodeFetchOptions) => {\n return options;\n },\n);\n\nconst _nativeNodeFetchIntegration = ((options: NodeFetchOptions = {}) => {\n return {\n name: 'NodeFetch',\n setupOnce() {\n const instrumentSpans = _shouldInstrumentSpans(options, getClient<NodeClient>()?.getOptions());\n\n // This is the instrumentation that emits spans & propagates traces for outgoing fetch requests\n if (instrumentSpans) {\n instrumentNodeFetchSpans(options);\n }\n\n // This is the Sentry-specific instrumentation that creates breadcrumbs & propagates traces.\n // It must subscribe to the diagnostics channels after the span instrumentation above, so the core\n // trace propagation logic takes precedence. Otherwise, the sentry-trace header may be set multiple times.\n instrumentSentryNodeFetch(options);\n },\n };\n}) satisfies IntegrationFn;\n\nexport const nativeNodeFetchIntegration = defineIntegration(_nativeNodeFetchIntegration);\n\n// Matching the behavior of the base instrumentation\nfunction getAbsoluteUrl(origin: string, path: string = '/'): string {\n const url = `${origin}`;\n\n if (url.endsWith('/') && path.startsWith('/')) {\n return `${url}${path.slice(1)}`;\n }\n\n if (!url.endsWith('/') && !path.startsWith('/')) {\n return `${url}/${path}`;\n }\n\n return `${url}${path}`;\n}\n\nfunction _shouldInstrumentSpans(options: NodeFetchOptions, clientOptions: Partial<NodeClientOptions> = {}): boolean {\n // If `spans` is passed in, it takes precedence\n // Else, we by default emit spans, unless `skipOpenTelemetrySetup` is set to `true` or spans are not enabled\n return typeof options.spans === 'boolean'\n ? options.spans\n : !clientOptions.skipOpenTelemetrySetup && hasSpansEnabled(clientOptions);\n}\n\n/** Exported only for tests. */\nexport function _getConfigWithDefaults(options: Partial<NodeFetchOptions> = {}): UndiciInstrumentationConfig {\n const instrumentationConfig = {\n ignoreRequestHook: request => {\n const url = getAbsoluteUrl(request.origin, request.path);\n const _ignoreOutgoingRequests = options.ignoreOutgoingRequests;\n const shouldIgnore = _ignoreOutgoingRequests && url && _ignoreOutgoingRequests(url);\n\n return !!shouldIgnore;\n },\n startSpanHook: request => {\n const url = getAbsoluteUrl(request.origin, request.path);\n\n // Sanitize data URLs to prevent long base64 strings in span attributes\n if (url.startsWith('data:')) {\n const sanitizedUrl = stripDataUrlContent(url);\n return {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.node_fetch',\n 'http.url': sanitizedUrl,\n [SEMANTIC_ATTRIBUTE_URL_FULL]: sanitizedUrl,\n [SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]: `${request.method || 'GET'} ${sanitizedUrl}`,\n };\n }\n\n return {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.node_fetch',\n };\n },\n requestHook: options.requestHook,\n responseHook: options.responseHook,\n headersToSpanAttributes: options.headersToSpanAttributes,\n } satisfies UndiciInstrumentationConfig;\n\n return instrumentationConfig;\n}\n"],"names":["UndiciInstrumentation","generateInstrumentOnce","SentryNodeFetchInstrumentation","getClient","defineIntegration","hasSpansEnabled","stripDataUrlContent","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_URL_FULL","SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME"],"mappings":";;;;;;AAgBA,MAAM,gBAAA,GAAmB,WAAA;AAuCzB,IAAI,sBAAA;AAIJ,SAAS,yBAAyB,OAAA,EAAiC;AACjE,EAAA,IAAI,CAAC,sBAAA,EAAwB;AAC3B,IAAA,sBAAA,GAAyB,IAAIA,4BAAA,CAAsB,sBAAA,CAAuB,OAAO,CAAC,CAAA;AAAA,EACpF;AACA,EAAA,sBAAA,CAAuB,MAAA,EAAO;AAChC;AAEA,MAAM,yBAAA,GAA4BC,+BAAA;AAAA,EAChC,GAAG,gBAAgB,CAAA,OAAA,CAAA;AAAA,EACnBC,uCAAA;AAAA,EACA,CAAC,OAAA,KAA8B;AAC7B,IAAA,OAAO,OAAA;AAAA,EACT;AACF,CAAA;AAEA,MAAM,2BAAA,IAA+B,CAAC,OAAA,GAA4B,EAAC,KAAM;AACvE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,WAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,MAAM,kBAAkB,sBAAA,CAAuB,OAAA,EAAS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I,CAAA;AACvD,MAAA,MAAM,0BAA0B,OAAA,CAAQ,sBAAA;AACxC,MAAA,MAAM,YAAA,GAAe,uBAAA,IAA2B,GAAA,IAAO,uBAAA,CAAwB,GAAG,CAAA;AAElF,MAAA,OAAO,CAAC,CAAC,YAAA;AAAA,IACX,CAAA;AAAA,IACA,eAAe,CAAA,OAAA,KAAW;AACxB,MAAA,MAAM,GAAA,GAAM,cAAA,CAAe,OAAA,CAAQ,MAAA,EAAQ,QAAQ,IAAI,CAAA;AAGvD,MAAA,IAAI,GAAA,CAAI,UAAA,CAAW,OAAO,CAAA,EAAG;AAC3B,QAAA,MAAM,YAAA,GAAeC,yBAAoB,GAAG,CAAA;AAC5C,QAAA,OAAO;AAAA,UACL,CAACC,qCAAgC,GAAG,2BAAA;AAAA,UACpC,UAAA,EAAY,YAAA;AAAA,UACZ,CAACC,gCAA2B,GAAG,YAAA;AAAA,UAC/B,CAACC,+CAA0C,GAAG,CAAA,EAAG,QAAQ,MAAA,IAAU,KAAK,IAAI,YAAY,CAAA;AAAA,SAC1F;AAAA,MACF;AAEA,MAAA,OAAO;AAAA,QACL,CAACF,qCAAgC,GAAG;AAAA,OACtC;AAAA,IACF,CAAA;AAAA,IACA,aAAa,OAAA,CAAQ,WAAA;AAAA,IACrB,cAAc,OAAA,CAAQ,YAAA;AAAA,IACtB,yBAAyB,OAAA,CAAQ;AAAA,GACnC;AAEA,EAAA,OAAO,qBAAA;AACT;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/integrations/node-fetch/index.ts"],"sourcesContent":["import { instrumentUndici } from './undici-instrumentation';\nimport type { NodeFetchOptions } from './types';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration, getClient, hasSpansEnabled } from '@sentry/core';\nimport type { NodeClient } from '@sentry/node-core';\nimport { generateInstrumentOnce, SentryNodeFetchInstrumentation } from '@sentry/node-core';\nimport type { NodeClientOptions } from '../../types';\n\nconst INTEGRATION_NAME = 'NodeFetch';\n\nconst instrumentSentryNodeFetch = generateInstrumentOnce(\n `${INTEGRATION_NAME}.sentry`,\n SentryNodeFetchInstrumentation,\n (options: NodeFetchOptions) => {\n return options;\n },\n);\n\nconst _nativeNodeFetchIntegration = ((options: NodeFetchOptions = {}) => {\n return {\n name: 'NodeFetch' as const,\n setupOnce() {\n const instrumentSpans = _shouldInstrumentSpans(options, getClient<NodeClient>()?.getOptions());\n\n // This is the instrumentation that emits spans & propagates traces for outgoing fetch requests\n if (instrumentSpans) {\n instrumentUndici({\n ignoreOutgoingRequests: options.ignoreOutgoingRequests,\n requestHook: options.requestHook,\n responseHook: options.responseHook,\n headersToSpanAttributes: options.headersToSpanAttributes,\n });\n }\n\n // This is the Sentry-specific instrumentation that creates breadcrumbs & propagates traces.\n // It must subscribe to the diagnostics channels after the span instrumentation above, so the core\n // trace propagation logic takes precedence. Otherwise, the sentry-trace header may be set multiple times.\n instrumentSentryNodeFetch(options);\n },\n };\n}) satisfies IntegrationFn;\n\nexport const nativeNodeFetchIntegration = defineIntegration(_nativeNodeFetchIntegration);\n\nfunction _shouldInstrumentSpans(options: NodeFetchOptions, clientOptions: Partial<NodeClientOptions> = {}): boolean {\n // If `spans` is passed in, it takes precedence\n // Else, we by default emit spans, unless `skipOpenTelemetrySetup` is set to `true` or spans are not enabled\n return typeof options.spans === 'boolean'\n ? options.spans\n : !clientOptions.skipOpenTelemetrySetup && hasSpansEnabled(clientOptions);\n}\n"],"names":["generateInstrumentOnce","SentryNodeFetchInstrumentation","getClient","instrumentUndici","defineIntegration","hasSpansEnabled"],"mappings":";;;;;;AAQA,MAAM,gBAAA,GAAmB,WAAA;AAEzB,MAAM,yBAAA,GAA4BA,+BAAA;AAAA,EAChC,GAAG,gBAAgB,CAAA,OAAA,CAAA;AAAA,EACnBC,uCAAA;AAAA,EACA,CAAC,OAAA,KAA8B;AAC7B,IAAA,OAAO,OAAA;AAAA,EACT;AACF,CAAA;AAEA,MAAM,2BAAA,IAA+B,CAAC,OAAA,GAA4B,EAAC,KAAM;AACvE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,WAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,MAAM,kBAAkB,sBAAA,CAAuB,OAAA,EAASC,cAAA,EAAsB,EAAG,YAAY,CAAA;AAG7F,MAAA,IAAI,eAAA,EAAiB;AACnB,QAAAC,sCAAA,CAAiB;AAAA,UACf,wBAAwB,OAAA,CAAQ,sBAAA;AAAA,UAChC,aAAa,OAAA,CAAQ,WAAA;AAAA,UACrB,cAAc,OAAA,CAAQ,YAAA;AAAA,UACtB,yBAAyB,OAAA,CAAQ;AAAA,SAClC,CAAA;AAAA,MACH;AAKA,MAAA,yBAAA,CAA0B,OAAO,CAAA;AAAA,IACnC;AAAA,GACF;AACF,CAAA,CAAA;AAEO,MAAM,0BAAA,GAA6BC,uBAAkB,2BAA2B;AAEvF,SAAS,sBAAA,CAAuB,OAAA,EAA2B,aAAA,GAA4C,EAAC,EAAY;AAGlH,EAAA,OAAO,OAAO,OAAA,CAAQ,KAAA,KAAU,SAAA,GAC5B,OAAA,CAAQ,QACR,CAAC,aAAA,CAAc,sBAAA,IAA0BC,oBAAA,CAAgB,aAAa,CAAA;AAC5E;;;;"}
@@ -0,0 +1,266 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ const diagch = require('diagnostics_channel');
4
+ const url = require('url');
5
+ const core = require('@sentry/core');
6
+ const attributes = require('@sentry/conventions/attributes');
7
+ const debugBuild = require('../../debug-build.js');
8
+
9
+ const ATTR_HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original";
10
+ const _channelSubs = [];
11
+ const spanFromReq = /* @__PURE__ */ new WeakMap();
12
+ const propagationDecisionMap = new core.LRUMap(100);
13
+ function instrumentUndici(config = {}) {
14
+ if (_channelSubs.length) {
15
+ return;
16
+ }
17
+ subscribeToChannel("undici:request:create", (message) => onRequestCreated(config, message));
18
+ subscribeToChannel(
19
+ "undici:client:sendHeaders",
20
+ (message) => onRequestHeaders(config, message)
21
+ );
22
+ subscribeToChannel("undici:request:headers", (message) => onResponseHeaders(config, message));
23
+ subscribeToChannel("undici:request:trailers", (message) => onDone(message));
24
+ subscribeToChannel("undici:request:error", (message) => onError(message));
25
+ }
26
+ function safeExecute(fn, onError2) {
27
+ try {
28
+ return fn();
29
+ } catch (error) {
30
+ onError2(error);
31
+ return void 0;
32
+ }
33
+ }
34
+ function subscribeToChannel(diagnosticChannel, onMessage) {
35
+ const [major = 0, minor = 0] = process.version.replace("v", "").split(".").map((n) => Number(n));
36
+ const useNewSubscribe = major > 18 || major === 18 && minor >= 19;
37
+ if (useNewSubscribe) {
38
+ _channelSubs.push(diagch.subscribe?.(diagnosticChannel, onMessage));
39
+ } else {
40
+ _channelSubs.push(diagch.channel(diagnosticChannel).subscribe(onMessage));
41
+ }
42
+ }
43
+ function parseRequestHeaders(request) {
44
+ const result = /* @__PURE__ */ new Map();
45
+ if (Array.isArray(request.headers)) {
46
+ for (let i = 0; i < request.headers.length; i += 2) {
47
+ const key = request.headers[i];
48
+ const value = request.headers[i + 1];
49
+ if (typeof key === "string" && value !== void 0) {
50
+ result.set(key.toLowerCase(), value);
51
+ }
52
+ }
53
+ } else if (typeof request.headers === "string") {
54
+ const headers = request.headers.split("\r\n");
55
+ for (const line of headers) {
56
+ if (!line) {
57
+ continue;
58
+ }
59
+ const colonIndex = line.indexOf(":");
60
+ if (colonIndex === -1) {
61
+ continue;
62
+ }
63
+ const key = line.substring(0, colonIndex).toLowerCase();
64
+ const value = line.substring(colonIndex + 1).trim();
65
+ const allValues = result.get(key);
66
+ if (allValues && Array.isArray(allValues)) {
67
+ allValues.push(value);
68
+ } else if (allValues) {
69
+ result.set(key, [allValues, value]);
70
+ } else {
71
+ result.set(key, value);
72
+ }
73
+ }
74
+ }
75
+ return result;
76
+ }
77
+ function onRequestCreated(config, { request }) {
78
+ const url$1 = getAbsoluteUrl(request.origin, request.path);
79
+ const shouldIgnoreReq = safeExecute(
80
+ () => request.method === "CONNECT" || !!config.ignoreOutgoingRequests?.(url$1),
81
+ (e) => e && debugBuild.DEBUG_BUILD && core.debug.error("caught ignoreOutgoingRequests error: ", e)
82
+ );
83
+ if (shouldIgnoreReq) {
84
+ return;
85
+ }
86
+ let requestUrl;
87
+ try {
88
+ requestUrl = new url.URL(request.path, request.origin);
89
+ } catch (err) {
90
+ debugBuild.DEBUG_BUILD && core.debug.warn("could not determine url.full:", err);
91
+ return;
92
+ }
93
+ const urlScheme = requestUrl.protocol.replace(":", "");
94
+ const requestMethod = getRequestMethod(request.method);
95
+ const attributes$1 = {
96
+ [attributes.HTTP_REQUEST_METHOD]: requestMethod,
97
+ [ATTR_HTTP_REQUEST_METHOD_ORIGINAL]: request.method,
98
+ [attributes.URL_FULL]: requestUrl.toString(),
99
+ [attributes.URL_PATH]: requestUrl.pathname,
100
+ [attributes.URL_QUERY]: requestUrl.search,
101
+ [attributes.URL_SCHEME]: urlScheme,
102
+ [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.node_fetch"
103
+ };
104
+ if (url$1.startsWith("data:")) {
105
+ const sanitizedUrl = core.stripDataUrlContent(url$1);
106
+ attributes$1["http.url"] = sanitizedUrl;
107
+ attributes$1[attributes.URL_FULL] = sanitizedUrl;
108
+ attributes$1[core.SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME] = `${request.method || "GET"} ${sanitizedUrl}`;
109
+ }
110
+ const schemePorts = { https: "443", http: "80" };
111
+ const serverAddress = requestUrl.hostname;
112
+ const serverPort = requestUrl.port || schemePorts[urlScheme];
113
+ attributes$1[attributes.SERVER_ADDRESS] = serverAddress;
114
+ if (serverPort && !isNaN(Number(serverPort))) {
115
+ attributes$1[attributes.SERVER_PORT] = Number(serverPort);
116
+ }
117
+ const headersMap = parseRequestHeaders(request);
118
+ const userAgentValues = headersMap.get("user-agent");
119
+ if (userAgentValues) {
120
+ const userAgent = Array.isArray(userAgentValues) ? userAgentValues[userAgentValues.length - 1] : userAgentValues;
121
+ attributes$1[attributes.USER_AGENT_ORIGINAL] = userAgent;
122
+ }
123
+ const span = core.startInactiveSpan({
124
+ name: requestMethod === "_OTHER" ? "HTTP" : requestMethod,
125
+ kind: core.SPAN_KIND.CLIENT,
126
+ attributes: attributes$1
127
+ });
128
+ safeExecute(
129
+ () => config.requestHook?.(span, request),
130
+ (e) => e && debugBuild.DEBUG_BUILD && core.debug.error("caught requestHook error: ", e)
131
+ );
132
+ injectTracePropagationHeaders(span, request, requestUrl.toString());
133
+ spanFromReq.set(request, span);
134
+ }
135
+ function onRequestHeaders(config, { request, socket }) {
136
+ const span = spanFromReq.get(request);
137
+ if (!span) {
138
+ return;
139
+ }
140
+ const { remoteAddress, remotePort } = socket;
141
+ const spanAttributes = {
142
+ [attributes.NETWORK_PEER_ADDRESS]: remoteAddress,
143
+ [attributes.NETWORK_PEER_PORT]: remotePort
144
+ };
145
+ if (config.headersToSpanAttributes?.requestHeaders) {
146
+ const headersToAttribs = new Set(config.headersToSpanAttributes.requestHeaders.map((n) => n.toLowerCase()));
147
+ const headersMap = parseRequestHeaders(request);
148
+ for (const [name, value] of headersMap.entries()) {
149
+ if (headersToAttribs.has(name)) {
150
+ const attrValue = Array.isArray(value) ? value : [value];
151
+ spanAttributes[`http.request.header.${name}`] = attrValue;
152
+ }
153
+ }
154
+ }
155
+ span.setAttributes(spanAttributes);
156
+ }
157
+ function onResponseHeaders(config, { request, response }) {
158
+ const span = spanFromReq.get(request);
159
+ if (!span) {
160
+ return;
161
+ }
162
+ const spanAttributes = {
163
+ [attributes.HTTP_RESPONSE_STATUS_CODE]: response.statusCode
164
+ };
165
+ safeExecute(
166
+ () => config.responseHook?.(span, { request, response }),
167
+ (e) => e && debugBuild.DEBUG_BUILD && core.debug.error("caught responseHook error: ", e)
168
+ );
169
+ if (config.headersToSpanAttributes?.responseHeaders) {
170
+ const headersToAttribs = /* @__PURE__ */ new Set();
171
+ config.headersToSpanAttributes?.responseHeaders.forEach((name) => headersToAttribs.add(name.toLowerCase()));
172
+ for (let idx = 0; idx < response.headers.length; idx = idx + 2) {
173
+ const nameBuf = response.headers[idx];
174
+ const valueBuf = response.headers[idx + 1];
175
+ if (nameBuf === void 0 || valueBuf === void 0) {
176
+ continue;
177
+ }
178
+ const name = nameBuf.toString().toLowerCase();
179
+ const value = valueBuf;
180
+ if (headersToAttribs.has(name)) {
181
+ const attrName = `http.response.header.${name}`;
182
+ if (!Object.prototype.hasOwnProperty.call(spanAttributes, attrName)) {
183
+ spanAttributes[attrName] = [value.toString()];
184
+ } else {
185
+ spanAttributes[attrName].push(value.toString());
186
+ }
187
+ }
188
+ }
189
+ }
190
+ span.setAttributes(spanAttributes);
191
+ if (response.statusCode >= 400) {
192
+ span.setStatus({ code: core.SPAN_STATUS_ERROR });
193
+ }
194
+ }
195
+ function onDone({ request }) {
196
+ const span = spanFromReq.get(request);
197
+ if (!span) {
198
+ return;
199
+ }
200
+ span.end();
201
+ spanFromReq.delete(request);
202
+ }
203
+ function onError({ request, error }) {
204
+ const span = spanFromReq.get(request);
205
+ if (!span) {
206
+ return;
207
+ }
208
+ span.setStatus({
209
+ code: core.SPAN_STATUS_ERROR,
210
+ message: error.message
211
+ });
212
+ span.end();
213
+ spanFromReq.delete(request);
214
+ }
215
+ function injectTracePropagationHeaders(span, request, url) {
216
+ const { tracePropagationTargets, propagateTraceparent } = core.getClient()?.getOptions() ?? {};
217
+ if (!core.shouldPropagateTraceForUrl(url, tracePropagationTargets, propagationDecisionMap)) {
218
+ return;
219
+ }
220
+ const addedHeaders = core.withActiveSpan(span, () => core.getTraceData({ propagateTraceparent }));
221
+ for (const [k, v] of Object.entries(addedHeaders)) {
222
+ if (!v) {
223
+ continue;
224
+ }
225
+ if (typeof request.addHeader === "function") {
226
+ request.addHeader(k, v);
227
+ } else if (typeof request.headers === "string") {
228
+ request.headers += `${k}: ${v}\r
229
+ `;
230
+ } else if (Array.isArray(request.headers)) {
231
+ request.headers.push(k, v);
232
+ }
233
+ }
234
+ }
235
+ function getRequestMethod(original) {
236
+ const knownMethods = {
237
+ CONNECT: true,
238
+ OPTIONS: true,
239
+ HEAD: true,
240
+ GET: true,
241
+ POST: true,
242
+ PUT: true,
243
+ PATCH: true,
244
+ DELETE: true,
245
+ TRACE: true,
246
+ // QUERY from https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/
247
+ QUERY: true
248
+ };
249
+ if (original.toUpperCase() in knownMethods) {
250
+ return original.toUpperCase();
251
+ }
252
+ return "_OTHER";
253
+ }
254
+ function getAbsoluteUrl(origin, path = "/") {
255
+ const url = `${origin}`;
256
+ if (url.endsWith("/") && path.startsWith("/")) {
257
+ return `${url}${path.slice(1)}`;
258
+ }
259
+ if (!url.endsWith("/") && !path.startsWith("/")) {
260
+ return `${url}/${path}`;
261
+ }
262
+ return `${url}${path}`;
263
+ }
264
+
265
+ exports.instrumentUndici = instrumentUndici;
266
+ //# sourceMappingURL=undici-instrumentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"undici-instrumentation.js","sources":["../../../../src/integrations/node-fetch/undici-instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/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 * - Refactored to use Sentry's span APIs instead of OpenTelemetry tracing APIs\n * - Dropped the OTel metrics (no MeterProvider is wired up) and the dead\n * `requireParentforSpans` code path (the SDK always passes `false`)\n * - Dropped the `@opentelemetry/instrumentation` base (undici reports via `diagnostics_channel`,\n * so no module patching was needed) — exposed as a plain `instrumentUndici()` function that the\n * integration wires up directly\n */\n\n/* eslint-disable max-lines */\n\nimport * as diagch from 'diagnostics_channel';\nimport { URL } from 'url';\n\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport {\n debug,\n getClient,\n getTraceData,\n LRUMap,\n SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n shouldPropagateTraceForUrl,\n SPAN_KIND,\n SPAN_STATUS_ERROR,\n startInactiveSpan,\n stripDataUrlContent,\n withActiveSpan,\n} from '@sentry/core';\nimport {\n HTTP_REQUEST_METHOD,\n HTTP_RESPONSE_STATUS_CODE,\n NETWORK_PEER_ADDRESS,\n NETWORK_PEER_PORT,\n SERVER_ADDRESS,\n SERVER_PORT,\n URL_FULL,\n URL_PATH,\n URL_QUERY,\n URL_SCHEME,\n USER_AGENT_ORIGINAL,\n} from '@sentry/conventions/attributes';\nimport { DEBUG_BUILD } from '../../debug-build';\nimport type {\n UndiciInstrumentationConfig,\n UndiciRequest,\n RequestErrorMessage,\n RequestHeadersMessage,\n RequestMessage,\n RequestTrailersMessage,\n ResponseHeadersMessage,\n} from './types';\n\n// `http.request.method_original` is not part of `@sentry/conventions`, so we keep it inline.\nconst ATTR_HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original';\n\n// Keep ref to avoid https://github.com/nodejs/node/issues/42170 bug\n// We can replace this with _isInstrumented once we drop support for Node.js 18.18.0\nconst _channelSubs: Array<unknown> = [];\nconst spanFromReq = new WeakMap<UndiciRequest, Span>();\n// Caches trace-propagation decisions per URL so we don't recompute the `tracePropagationTargets` regexes per request.\nconst propagationDecisionMap = new LRUMap<string, boolean>(100);\n\n/**\n * Instrument outgoing HTTP requests made through `undici` or the global `fetch` API: emit `http.client`\n * spans and propagate traces into the outgoing request headers.\n *\n * undici reports its request lifecycle via `diagnostics_channel`, so rather than patching any module we\n * subscribe to those channels directly. This is idempotent — subsequent calls are no-ops once the\n * channels have been subscribed to, and the config of the first call wins.\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\n */\nexport function instrumentUndici(config: UndiciInstrumentationConfig = {}): void {\n // Avoid duplicate subscriptions\n if (_channelSubs.length) {\n return;\n }\n\n subscribeToChannel('undici:request:create', message => onRequestCreated(config, message as RequestMessage));\n subscribeToChannel('undici:client:sendHeaders', message =>\n onRequestHeaders(config, message as RequestHeadersMessage),\n );\n subscribeToChannel('undici:request:headers', message => onResponseHeaders(config, message as ResponseHeadersMessage));\n subscribeToChannel('undici:request:trailers', message => onDone(message as RequestTrailersMessage));\n subscribeToChannel('undici:request:error', message => onError(message as RequestErrorMessage));\n}\n\n/** Replaces OTel's `safeExecuteInTheMiddle`: run `fn`, route any error to `onError`, and swallow it. */\nfunction safeExecute<T>(fn: () => T, onError: (error: unknown) => void): T | undefined {\n try {\n return fn();\n } catch (error) {\n onError(error);\n return undefined;\n }\n}\n\nfunction subscribeToChannel(\n diagnosticChannel: string,\n onMessage: (message: unknown, name: string | symbol) => void,\n): 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 if (useNewSubscribe) {\n _channelSubs.push(diagch.subscribe?.(diagnosticChannel, onMessage));\n } else {\n _channelSubs.push(diagch.channel(diagnosticChannel).subscribe(onMessage));\n }\n}\n\nfunction parseRequestHeaders(request: UndiciRequest): Map<string, string | string[]> {\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\nfunction onRequestCreated(config: UndiciInstrumentationConfig, { request }: RequestMessage): void {\n const url = getAbsoluteUrl(request.origin, request.path);\n\n // Ignore if:\n // - the outgoing request is ignored via config\n // - method is 'CONNECT'\n const shouldIgnoreReq = safeExecute(\n () => request.method === 'CONNECT' || !!config.ignoreOutgoingRequests?.(url),\n e => e && DEBUG_BUILD && debug.error('caught ignoreOutgoingRequests error: ', e),\n );\n\n if (shouldIgnoreReq) {\n return;\n }\n\n let requestUrl;\n try {\n requestUrl = new URL(request.path, request.origin);\n } catch (err) {\n DEBUG_BUILD && debug.warn('could not determine url.full:', err);\n // Skip instrumenting this request.\n return;\n }\n const urlScheme = requestUrl.protocol.replace(':', '');\n const requestMethod = getRequestMethod(request.method);\n const attributes: SpanAttributes = {\n [HTTP_REQUEST_METHOD]: requestMethod,\n [ATTR_HTTP_REQUEST_METHOD_ORIGINAL]: request.method,\n [URL_FULL]: requestUrl.toString(),\n [URL_PATH]: requestUrl.pathname,\n [URL_QUERY]: requestUrl.search,\n [URL_SCHEME]: urlScheme,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.node_fetch',\n };\n\n // Sanitize data URLs to prevent long base64 strings in span attributes\n if (url.startsWith('data:')) {\n const sanitizedUrl = stripDataUrlContent(url);\n attributes['http.url'] = sanitizedUrl;\n attributes[URL_FULL] = sanitizedUrl;\n attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME] = `${request.method || 'GET'} ${sanitizedUrl}`;\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[SERVER_ADDRESS] = serverAddress;\n if (serverPort && !isNaN(Number(serverPort))) {\n attributes[SERVER_PORT] = Number(serverPort);\n }\n\n // Get user agent from headers\n const headersMap = 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[USER_AGENT_ORIGINAL] = userAgent;\n }\n\n const span = startInactiveSpan({\n name: requestMethod === '_OTHER' ? 'HTTP' : requestMethod,\n kind: SPAN_KIND.CLIENT,\n attributes,\n });\n\n // Execute the request hook if defined\n safeExecute(\n () => config.requestHook?.(span, request),\n e => e && DEBUG_BUILD && debug.error('caught requestHook error: ', e),\n );\n\n // Context propagation goes last so no hook can tamper the propagation headers.\n // We propagate the trace data of the freshly created client span (not the active parent span)\n // so downstream services are parented to the http.client span, matching the upstream behavior.\n injectTracePropagationHeaders(span, request, requestUrl.toString());\n\n spanFromReq.set(request, span);\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\nfunction onRequestHeaders(config: UndiciInstrumentationConfig, { request, socket }: RequestHeadersMessage): void {\n const span = spanFromReq.get(request);\n\n if (!span) {\n return;\n }\n\n const { remoteAddress, remotePort } = socket;\n const spanAttributes: SpanAttributes = {\n [NETWORK_PEER_ADDRESS]: remoteAddress,\n [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 = 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\nfunction onResponseHeaders(config: UndiciInstrumentationConfig, { request, response }: ResponseHeadersMessage): void {\n const span = spanFromReq.get(request);\n\n if (!span) {\n return;\n }\n\n const spanAttributes: SpanAttributes = {\n [HTTP_RESPONSE_STATUS_CODE]: response.statusCode,\n };\n\n // Execute the response hook if defined\n safeExecute(\n () => config.responseHook?.(span, { request, response }),\n e => e && DEBUG_BUILD && debug.error('caught responseHook error: ', e),\n );\n\n if (config.headersToSpanAttributes?.responseHeaders) {\n const headersToAttribs = new Set<string>();\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\n // The Sentry pipeline infers `ok` / `not_found` / etc. from `http.response.status_code` when the\n // status is left unset, so we only need to flag erroneous responses explicitly.\n if (response.statusCode >= 400) {\n span.setStatus({ code: SPAN_STATUS_ERROR });\n }\n}\n\n// This is the last event we receive if the request went without any errors\nfunction onDone({ request }: RequestTrailersMessage): void {\n const span = spanFromReq.get(request);\n\n if (!span) {\n return;\n }\n\n span.end();\n spanFromReq.delete(request);\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.\nfunction onError({ request, error }: RequestErrorMessage): void {\n const span = spanFromReq.get(request);\n\n if (!span) {\n return;\n }\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.setStatus({\n code: SPAN_STATUS_ERROR,\n message: error.message,\n });\n span.end();\n spanFromReq.delete(request);\n}\n\n// Propagate the trace data of the given (client) span into the outgoing request headers, gated by\n// `tracePropagationTargets`. Mirrors what `propagation.inject()` did with the SentryPropagator, but\n// via Sentry's `getTraceData()` so we stay off OpenTelemetry's propagation API.\nfunction injectTracePropagationHeaders(span: Span, request: UndiciRequest, url: string): void {\n const { tracePropagationTargets, propagateTraceparent } = getClient()?.getOptions() ?? {};\n\n if (!shouldPropagateTraceForUrl(url, tracePropagationTargets, propagationDecisionMap)) {\n return;\n }\n\n // We make the freshly created client span active so the propagated headers reference it (and not\n // the parent span). Passing `{ span }` to `getTraceData()` is not enough: for an inactive span it\n // resolves to the span's *captured* scope, whose active span is still the parent.\n const addedHeaders = withActiveSpan(span, () => getTraceData({ propagateTraceparent }));\n\n for (const [k, v] of Object.entries(addedHeaders)) {\n if (!v) {\n continue;\n }\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}\n\nfunction 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// Matching the behavior of the base instrumentation\nfunction getAbsoluteUrl(origin: string, path: string = '/'): string {\n const url = `${origin}`;\n\n if (url.endsWith('/') && path.startsWith('/')) {\n return `${url}${path.slice(1)}`;\n }\n\n if (!url.endsWith('/') && !path.startsWith('/')) {\n return `${url}/${path}`;\n }\n\n return `${url}${path}`;\n}\n"],"names":["LRUMap","onError","url","DEBUG_BUILD","debug","URL","attributes","HTTP_REQUEST_METHOD","URL_FULL","URL_PATH","URL_QUERY","URL_SCHEME","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","stripDataUrlContent","SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME","SERVER_ADDRESS","SERVER_PORT","USER_AGENT_ORIGINAL","startInactiveSpan","SPAN_KIND","NETWORK_PEER_ADDRESS","NETWORK_PEER_PORT","HTTP_RESPONSE_STATUS_CODE","SPAN_STATUS_ERROR","getClient","shouldPropagateTraceForUrl","withActiveSpan","getTraceData"],"mappings":";;;;;;;;AA6DA,MAAM,iCAAA,GAAoC,8BAAA;AAI1C,MAAM,eAA+B,EAAC;AACtC,MAAM,WAAA,uBAAkB,OAAA,EAA6B;AAErD,MAAM,sBAAA,GAAyB,IAAIA,WAAA,CAAwB,GAAG,CAAA;AAavD,SAAS,gBAAA,CAAiB,MAAA,GAAsC,EAAC,EAAS;AAE/E,EAAA,IAAI,aAAa,MAAA,EAAQ;AACvB,IAAA;AAAA,EACF;AAEA,EAAA,kBAAA,CAAmB,uBAAA,EAAyB,CAAA,OAAA,K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A,EAAG,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA;AAAA,EACvB;AAEA,EAAA,OAAO,CAAA,EAAG,GAAG,CAAA,EAAG,IAAI,CAAA,CAAA;AACtB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/amqplib/index.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport { AmqplibInstrumentation } from './vendored/instrumentation';\n\nconst INTEGRATION_NAME = 'Amqplib';\n\nexport const instrumentAmqplib = generateInstrumentOnce(INTEGRATION_NAME, () => new AmqplibInstrumentation());\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":["generateInstrumentOnce","AmqplibInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,SAAA;AAElB,MAAM,oBAAoBA,+BAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAIC,wCAAwB;AAE5G,MAAM,uBAAuB,MAAM;AACjC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,iBAAA,EAAkB;AAAA,IACpB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,kBAAA,GAAqBC,uBAAkB,mBAAmB;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/amqplib/index.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport { AmqplibInstrumentation } from './vendored/instrumentation';\n\nconst INTEGRATION_NAME = 'Amqplib' as const;\n\nexport const instrumentAmqplib = generateInstrumentOnce(INTEGRATION_NAME, () => new AmqplibInstrumentation());\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":["generateInstrumentOnce","AmqplibInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,SAAA;AAElB,MAAM,oBAAoBA,+BAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAIC,wCAAwB;AAE5G,MAAM,uBAAuB,MAAM;AACjC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,iBAAA,EAAkB;AAAA,IACpB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,kBAAA,GAAqBC,uBAAkB,mBAAmB;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/connect/index.ts"],"sourcesContent":["import { ConnectInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { captureException, defineIntegration } from '@sentry/core';\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\n\ntype ConnectApp = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n use: (middleware: any) => void;\n};\n\nconst INTEGRATION_NAME = 'Connect';\n\nexport const instrumentConnect = generateInstrumentOnce(INTEGRATION_NAME, () => new ConnectInstrumentation());\n\nconst _connectIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentConnect();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Connect](https://github.com/senchalabs/connect/).\n *\n * If you also want to capture errors, you need to call `setupConnectErrorHandler(app)` after you initialize your connect app.\n *\n * For more information, see the [connect documentation](https://docs.sentry.io/platforms/javascript/guides/connect/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.connectIntegration()],\n * })\n * ```\n */\nexport const connectIntegration = defineIntegration(_connectIntegration);\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction connectErrorMiddleware(err: any, req: any, res: any, next: any): void {\n captureException(err, {\n mechanism: {\n handled: false,\n type: 'auto.middleware.connect',\n },\n });\n next(err);\n}\n\n/**\n * Add a Connect middleware to capture errors to Sentry.\n *\n * @param app The Connect app to attach the error handler to\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const connect = require(\"connect\");\n *\n * const app = connect();\n *\n * Sentry.setupConnectErrorHandler(app);\n *\n * // Add you connect routes here\n *\n * app.listen(3000);\n * ```\n */\nexport const setupConnectErrorHandler = (app: ConnectApp): void => {\n app.use(connectErrorMiddleware);\n ensureIsWrapped(app.use, 'connect');\n};\n"],"names":["generateInstrumentOnce","ConnectInstrumentation","defineIntegration","captureException","ensureIsWrapped"],"mappings":";;;;;;AAUA,MAAM,gBAAA,GAAmB,SAAA;AAElB,MAAM,oBAAoBA,+BAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAIC,wCAAwB;AAE5G,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;AAkBO,MAAM,kBAAA,GAAqBC,uBAAkB,mBAAmB;AAGvE,SAAS,sBAAA,CAAuB,GAAA,EAAU,GAAA,EAAU,GAAA,EAAU,IAAA,EAAiB;AAC7E,EAAAC,qBAAA,CAAiB,GAAA,EAAK;AAAA,IACpB,SAAA,EAAW;AAAA,MACT,OAAA,EAAS,KAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR,GACD,CAAA;AACD,EAAA,IAAA,CAAK,GAAG,CAAA;AACV;AAqBO,MAAM,wBAAA,GAA2B,CAAC,GAAA,KAA0B;AACjE,EAAA,GAAA,CAAI,IAAI,sBAAsB,CAAA;AAC9B,EAAAC,wBAAA,CAAgB,GAAA,CAAI,KAAK,SAAS,CAAA;AACpC;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/connect/index.ts"],"sourcesContent":["import { ConnectInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { captureException, defineIntegration } from '@sentry/core';\nimport { ensureIsWrapped, generateInstrumentOnce } from '@sentry/node-core';\n\ntype ConnectApp = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n use: (middleware: any) => void;\n};\n\nconst INTEGRATION_NAME = 'Connect' as const;\n\nexport const instrumentConnect = generateInstrumentOnce(INTEGRATION_NAME, () => new ConnectInstrumentation());\n\nconst _connectIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentConnect();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Connect](https://github.com/senchalabs/connect/).\n *\n * If you also want to capture errors, you need to call `setupConnectErrorHandler(app)` after you initialize your connect app.\n *\n * For more information, see the [connect documentation](https://docs.sentry.io/platforms/javascript/guides/connect/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.connectIntegration()],\n * })\n * ```\n */\nexport const connectIntegration = defineIntegration(_connectIntegration);\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction connectErrorMiddleware(err: any, req: any, res: any, next: any): void {\n captureException(err, {\n mechanism: {\n handled: false,\n type: 'auto.middleware.connect',\n },\n });\n next(err);\n}\n\n/**\n * Add a Connect middleware to capture errors to Sentry.\n *\n * @param app The Connect app to attach the error handler to\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const connect = require(\"connect\");\n *\n * const app = connect();\n *\n * Sentry.setupConnectErrorHandler(app);\n *\n * // Add you connect routes here\n *\n * app.listen(3000);\n * ```\n */\nexport const setupConnectErrorHandler = (app: ConnectApp): void => {\n app.use(connectErrorMiddleware);\n ensureIsWrapped(app.use, 'connect');\n};\n"],"names":["generateInstrumentOnce","ConnectInstrumentation","defineIntegration","captureException","ensureIsWrapped"],"mappings":";;;;;;AAUA,MAAM,gBAAA,GAAmB,SAAA;AAElB,MAAM,oBAAoBA,+BAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAIC,wCAAwB;AAE5G,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;AAkBO,MAAM,kBAAA,GAAqBC,uBAAkB,mBAAmB;AAGvE,SAAS,sBAAA,CAAuB,GAAA,EAAU,GAAA,EAAU,GAAA,EAAU,IAAA,EAAiB;AAC7E,EAAAC,qBAAA,CAAiB,GAAA,EAAK;AAAA,IACpB,SAAA,EAAW;AAAA,MACT,OAAA,EAAS,KAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR,GACD,CAAA;AACD,EAAA,IAAA,CAAK,GAAG,CAAA;AACV;AAqBO,MAAM,wBAAA,GAA2B,CAAC,GAAA,KAA0B;AACjE,EAAA,GAAA,CAAI,IAAI,sBAAsB,CAAA;AAC9B,EAAAC,wBAAA,CAAgB,GAAA,CAAI,KAAK,SAAS,CAAA;AACpC;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/dataloader/index.ts"],"sourcesContent":["import { DataloaderInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Dataloader';\n\nexport const instrumentDataloader = generateInstrumentOnce(INTEGRATION_NAME, () => new DataloaderInstrumentation());\n\nconst _dataloaderIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentDataloader();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [dataloader](https://www.npmjs.com/package/dataloader) library.\n *\n * For more information, see the [`dataloaderIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/dataloader/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.dataloaderIntegration()],\n * });\n * ```\n */\nexport const dataloaderIntegration = defineIntegration(_dataloaderIntegration);\n"],"names":["generateInstrumentOnce","DataloaderInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,YAAA;AAElB,MAAM,uBAAuBA,+BAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAIC,2CAA2B;AAElH,MAAM,0BAA0B,MAAM;AACpC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,oBAAA,EAAqB;AAAA,IACvB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,qBAAA,GAAwBC,uBAAkB,sBAAsB;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/dataloader/index.ts"],"sourcesContent":["import { DataloaderInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Dataloader' as const;\n\nexport const instrumentDataloader = generateInstrumentOnce(INTEGRATION_NAME, () => new DataloaderInstrumentation());\n\nconst _dataloaderIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentDataloader();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [dataloader](https://www.npmjs.com/package/dataloader) library.\n *\n * For more information, see the [`dataloaderIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/dataloader/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.dataloaderIntegration()],\n * });\n * ```\n */\nexport const dataloaderIntegration = defineIntegration(_dataloaderIntegration);\n"],"names":["generateInstrumentOnce","DataloaderInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,YAAA;AAElB,MAAM,uBAAuBA,+BAAA,CAAuB,gBAAA,EAAkB,MAAM,IAAIC,2CAA2B;AAElH,MAAM,0BAA0B,MAAM;AACpC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,oBAAA,EAAqB;AAAA,IACvB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,qBAAA,GAAwBC,uBAAkB,sBAAsB;;;;;"}