@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":"index.js","sources":["../../../../../src/integrations/tracing/tedious/index.ts"],"sourcesContent":["import { TediousInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Tedious';\n\nexport const instrumentTedious = generateInstrumentOnce(INTEGRATION_NAME, () => new TediousInstrumentation({}));\n\nconst _tediousIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentTedious();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [tedious](https://www.npmjs.com/package/tedious) library.\n *\n * For more information, see the [`tediousIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/tedious/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.tediousIntegration()],\n * });\n * ```\n */\nexport const tediousIntegration = defineIntegration(_tediousIntegration);\n"],"names":["generateInstrumentOnce","TediousInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,SAAA;AAElB,MAAM,iBAAA,GAAoBA,gCAAuB,gBAAA,EAAkB,MAAM,IAAIC,sCAAA,CAAuB,EAAE,CAAC;AAE9G,MAAM,uBAAuB,MAAM;AACjC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,iBAAA,EAAkB;AAAA,IACpB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,kBAAA,GAAqBC,uBAAkB,mBAAmB;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/tedious/index.ts"],"sourcesContent":["import { TediousInstrumentation } from './vendored/instrumentation';\nimport type { IntegrationFn } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Tedious' as const;\n\nexport const instrumentTedious = generateInstrumentOnce(INTEGRATION_NAME, () => new TediousInstrumentation({}));\n\nconst _tediousIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentTedious();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [tedious](https://www.npmjs.com/package/tedious) library.\n *\n * For more information, see the [`tediousIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/tedious/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.tediousIntegration()],\n * });\n * ```\n */\nexport const tediousIntegration = defineIntegration(_tediousIntegration);\n"],"names":["generateInstrumentOnce","TediousInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,SAAA;AAElB,MAAM,iBAAA,GAAoBA,gCAAuB,gBAAA,EAAkB,MAAM,IAAIC,sCAAA,CAAuB,EAAE,CAAC;AAE9G,MAAM,uBAAuB,MAAM;AACjC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,iBAAA,EAAkB;AAAA,IACpB;AAAA,GACF;AACF,CAAA,CAAA;AAgBO,MAAM,kBAAA,GAAqBC,uBAAkB,mBAAmB;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../src/integrations/tracing/vercelai/constants.ts"],"sourcesContent":["export const INTEGRATION_NAME = 'VercelAI';\n"],"names":[],"mappings":";;AAAO,MAAM,gBAAA,GAAmB;;;;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../src/integrations/tracing/vercelai/constants.ts"],"sourcesContent":["export const INTEGRATION_NAME = 'VercelAI' as const;\n"],"names":[],"mappings":";;AAAO,MAAM,gBAAA,GAAmB;;;;"}
@@ -14,12 +14,10 @@ function shouldForceIntegration(client) {
14
14
  const _vercelAIIntegration = ((options = {}) => {
15
15
  let instrumentation;
16
16
  const parentIntegration = serverUtils.vercelAiIntegration(options);
17
- return {
18
- name: constants.INTEGRATION_NAME,
17
+ return core.extendIntegration(parentIntegration, {
19
18
  options,
20
19
  setupOnce() {
21
20
  instrumentation = instrumentVercelAi();
22
- parentIntegration.setupOnce?.();
23
21
  },
24
22
  afterAllSetup(client) {
25
23
  const shouldForce = options.force ?? shouldForceIntegration(client);
@@ -29,7 +27,7 @@ const _vercelAIIntegration = ((options = {}) => {
29
27
  instrumentation?.callWhenPatched(() => core.addVercelAiProcessors(client));
30
28
  }
31
29
  }
32
- };
30
+ });
33
31
  });
34
32
  const vercelAIIntegration = core.defineIntegration(_vercelAIIntegration);
35
33
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/vercelai/index.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core';\nimport { addVercelAiProcessors, defineIntegration } from '@sentry/core';\nimport { generateInstrumentOnce, type modulesIntegration } from '@sentry/node-core';\nimport { vercelAiIntegration as serverUtilsVercelAiIntegration } from '@sentry/server-utils';\nimport { INTEGRATION_NAME } from './constants';\nimport { SentryVercelAiInstrumentation } from './instrumentation';\nimport type { VercelAiOptions } from './types';\n\nexport const instrumentVercelAi = generateInstrumentOnce(INTEGRATION_NAME, () => new SentryVercelAiInstrumentation({}));\n\n/**\n * Determines if the integration should be forced based on environment and package availability.\n * Returns true if the 'ai' package is available.\n */\nfunction shouldForceIntegration(client: Client): boolean {\n const modules = client.getIntegrationByName<ReturnType<typeof modulesIntegration>>('Modules');\n return !!modules?.getModules?.()?.ai;\n}\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n let instrumentation: undefined | SentryVercelAiInstrumentation;\n\n const parentIntegration = serverUtilsVercelAiIntegration(options);\n\n return {\n name: INTEGRATION_NAME,\n options,\n setupOnce() {\n instrumentation = instrumentVercelAi();\n parentIntegration.setupOnce?.();\n },\n afterAllSetup(client) {\n // Auto-detect if we should force the integration when running with 'ai' package available\n // Note that this can only be detected if the 'Modules' integration is available, and running in CJS mode\n const shouldForce = options.force ?? shouldForceIntegration(client);\n\n if (shouldForce) {\n addVercelAiProcessors(client);\n } else {\n instrumentation?.callWhenPatched(() => addVercelAiProcessors(client));\n }\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.vercelAIIntegration()],\n * });\n * ```\n *\n * This integration adds tracing support to all `ai` function calls.\n * You need to opt-in to collecting spans for a specific call,\n * you can do so by setting `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":["generateInstrumentOnce","INTEGRATION_NAME","SentryVercelAiInstrumentation","serverUtilsVercelAiIntegration","addVercelAiProcessors","defineIntegration"],"mappings":";;;;;;;;AAQO,MAAM,kBAAA,GAAqBA,gCAAuBC,0BAAA,EAAkB,MAAM,IAAIC,6CAAA,CAA8B,EAAE,CAAC;AAMtH,SAAS,uBAAuB,MAAA,EAAyB;AACvD,EAAA,MAAM,OAAA,GAAU,MAAA,CAAO,oBAAA,CAA4D,SAAS,CAAA;AAC5F,EAAA,OAAO,CAAC,CAAC,OAAA,EAAS,UAAA,IAAa,EAAG,EAAA;AACpC;AAEA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,IAAI,eAAA;AAEJ,EAAA,MAAM,iBAAA,GAAoBC,gCAA+B,OAAO,CAAA;AAEhE,EAAA,OAAO;AAAA,IACL,IAAA,EAAMF,0BAAA;AAAA,IACN,OAAA;AAAA,IACA,SAAA,GAAY;AACV,MAAA,eAAA,GAAkB,kBAAA,EAAmB;AACrC,MAAA,iBAAA,CAAkB,SAAA,IAAY;AAAA,IAChC,CAAA;AAAA,IACA,cAAc,MAAA,EAAQ;AAGpB,MAAA,MAAM,WAAA,GAAc,OAAA,CAAQ,KAAA,IAAS,sBAAA,CAAuB,MAAM,CAAA;AAElE,MAAA,IAAI,WAAA,EAAa;AACf,QAAAG,0BAAA,CAAsB,MAAM,CAAA;AAAA,MAC9B,CAAA,MAAO;AACL,QAAA,eAAA,EAAiB,eAAA,CAAgB,MAAMA,0BAAA,CAAsB,MAAM,CAAC,CAAA;AAAA,MACtE;AAAA,IACF;AAAA,GACF;AACF,CAAA,CAAA;AAqCO,MAAM,mBAAA,GAAsBC,uBAAkB,oBAAoB;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/vercelai/index.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core';\nimport { addVercelAiProcessors, defineIntegration, extendIntegration } from '@sentry/core';\nimport { generateInstrumentOnce, type modulesIntegration } from '@sentry/node-core';\nimport { vercelAiIntegration as serverUtilsVercelAiIntegration } from '@sentry/server-utils';\nimport { INTEGRATION_NAME } from './constants';\nimport { SentryVercelAiInstrumentation } from './instrumentation';\nimport type { VercelAiOptions } from './types';\n\nexport const instrumentVercelAi = generateInstrumentOnce(INTEGRATION_NAME, () => new SentryVercelAiInstrumentation({}));\n\n/**\n * Determines if the integration should be forced based on environment and package availability.\n * Returns true if the 'ai' package is available.\n */\nfunction shouldForceIntegration(client: Client): boolean {\n const modules = client.getIntegrationByName<ReturnType<typeof modulesIntegration>>('Modules');\n return !!modules?.getModules?.()?.ai;\n}\n\nconst _vercelAIIntegration = ((options: VercelAiOptions = {}) => {\n let instrumentation: undefined | SentryVercelAiInstrumentation;\n\n const parentIntegration = serverUtilsVercelAiIntegration(options);\n\n return extendIntegration(parentIntegration, {\n options,\n setupOnce() {\n instrumentation = instrumentVercelAi();\n },\n afterAllSetup(client) {\n // Auto-detect if we should force the integration when running with 'ai' package available\n // Note that this can only be detected if the 'Modules' integration is available, and running in CJS mode\n const shouldForce = options.force ?? shouldForceIntegration(client);\n\n if (shouldForce) {\n addVercelAiProcessors(client);\n } else {\n instrumentation?.callWhenPatched(() => addVercelAiProcessors(client));\n }\n },\n });\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.\n *\n * For more information, see the [`ai` documentation](https://sdk.vercel.ai/docs/ai-sdk-core/telemetry).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.vercelAIIntegration()],\n * });\n * ```\n *\n * This integration adds tracing support to all `ai` function calls.\n * You need to opt-in to collecting spans for a specific call,\n * you can do so by setting `experimental_telemetry.isEnabled` to `true` in the first argument of the function call.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true },\n * });\n * ```\n *\n * If you want to collect inputs and outputs for a specific call, you must specifically opt-in to each\n * function call by setting `experimental_telemetry.recordInputs` and `experimental_telemetry.recordOutputs`\n * to `true`.\n *\n * ```javascript\n * const result = await generateText({\n * model: openai('gpt-4-turbo'),\n * experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },\n * });\n */\nexport const vercelAIIntegration = defineIntegration(_vercelAIIntegration);\n"],"names":["generateInstrumentOnce","INTEGRATION_NAME","SentryVercelAiInstrumentation","serverUtilsVercelAiIntegration","extendIntegration","addVercelAiProcessors","defineIntegration"],"mappings":";;;;;;;;AAQO,MAAM,kBAAA,GAAqBA,gCAAuBC,0BAAA,EAAkB,MAAM,IAAIC,6CAAA,CAA8B,EAAE,CAAC;AAMtH,SAAS,uBAAuB,MAAA,EAAyB;AACvD,EAAA,MAAM,OAAA,GAAU,MAAA,CAAO,oBAAA,CAA4D,SAAS,CAAA;AAC5F,EAAA,OAAO,CAAC,CAAC,OAAA,EAAS,UAAA,IAAa,EAAG,EAAA;AACpC;AAEA,MAAM,oBAAA,IAAwB,CAAC,OAAA,GAA2B,EAAC,KAAM;AAC/D,EAAA,IAAI,eAAA;AAEJ,EAAA,MAAM,iBAAA,GAAoBC,gCAA+B,OAAO,CAAA;AAEhE,EAAA,OAAOC,uBAAkB,iBAAA,EAAmB;AAAA,IAC1C,OAAA;AAAA,IACA,SAAA,GAAY;AACV,MAAA,eAAA,GAAkB,kBAAA,EAAmB;AAAA,IACvC,CAAA;AAAA,IACA,cAAc,MAAA,EAAQ;AAGpB,MAAA,MAAM,WAAA,GAAc,OAAA,CAAQ,KAAA,IAAS,sBAAA,CAAuB,MAAM,CAAA;AAElE,MAAA,IAAI,WAAA,EAAa;AACf,QAAAC,0BAAA,CAAsB,MAAM,CAAA;AAAA,MAC9B,CAAA,MAAO;AACL,QAAA,eAAA,EAAiB,eAAA,CAAgB,MAAMA,0BAAA,CAAsB,MAAM,CAAC,CAAA;AAAA,MACtE;AAAA,IACF;AAAA,GACD,CAAA;AACH,CAAA,CAAA;AAqCO,MAAM,mBAAA,GAAsBC,uBAAkB,oBAAoB;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagnosticsChannelInjection.js","sources":["../../../src/sdk/diagnosticsChannelInjection.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\n\n/**\n * The orchestrion-driven pieces, resolved lazily by the opt-in loader.\n *\n * IMPORTANT: this module (and everything `init()` imports) must NOT reference\n * the orchestrion code (`@sentry/server-utils/orchestrion/*`). The only\n * reference lives inside `experimentalUseDiagnosticsChannelInjection()` (a\n * separate module, reachable solely through that public export). That's the\n * tree-shaking boundary: if an app never calls the opt-in function, then a\n * bundler drops the entire orchestrion subtree, including its transitive\n * dependencies, while an app that does call it gets it bundled\n * normally.\n */\nexport interface DiagnosticsChannelInjection {\n /** Channel-based integrations to register, replacing their OTel equivalents. */\n integrations: Integration[];\n /** OTel integration names these replace; filtered out of the default set. */\n replacedOtelIntegrationNames: string[];\n /** Installs the module hooks that inject the diagnostics channels. */\n register: () => void;\n /** Warns (DEBUG only) about missing or doubled channel injection. */\n detect: () => void;\n}\n\nlet loader: (() => DiagnosticsChannelInjection) | undefined;\nlet cached: DiagnosticsChannelInjection | undefined;\n\n/**\n * Set by `experimentalUseDiagnosticsChannelInjection()`. The loader\n * is the only thing that pulls in the orchestrion modules; see\n * {@link DiagnosticsChannelInjection) re tree-shaking concerns this addresses.\n *\n * @internal\n */\nexport function setDiagnosticsChannelInjectionLoader(load: () => DiagnosticsChannelInjection): void {\n loader = load;\n}\n\n/** Whether `experimentalUseDiagnosticsChannelInjection()` was called. */\nexport function isDiagnosticsChannelInjectionEnabled(): boolean {\n return !!loader;\n}\n\n/**\n * Resolve and memoize the orchestrion pieces. This is what actually loads\n * the orchestrion modules. Returns `undefined` if the app never opted in.\n * Callers gate this on span recording, so the modules load only when both\n * opted in and tracing is enabled.\n */\nexport function resolveDiagnosticsChannelInjection(): DiagnosticsChannelInjection | undefined {\n if (!loader) {\n return undefined;\n }\n return (cached ??= loader());\n}\n"],"names":[],"mappings":";;AAyBA,IAAI,MAAA;AACJ,IAAI,MAAA;AASG,SAAS,qCAAqC,IAAA,EAA+C;AAClG,EAAA,MAAA,GAAS,IAAA;AACX;AAGO,SAAS,oCAAA,GAAgD;AAC9D,EAAA,OAAO,CAAC,CAAC,MAAA;AACX;AAQO,SAAS,kCAAA,GAA8E;AAC5F,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAQ,oBAAW,MAAA,EAAO,CAAA;AAC5B;;;;;;"}
1
+ {"version":3,"file":"diagnosticsChannelInjection.js","sources":["../../../src/sdk/diagnosticsChannelInjection.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\n\n/**\n * The orchestrion-driven pieces, resolved lazily by the opt-in loader.\n *\n * IMPORTANT: this module (and everything `init()` imports) must NOT reference\n * the orchestrion code (`@sentry/server-utils/orchestrion/*`). The only\n * reference lives inside `experimentalUseDiagnosticsChannelInjection()` (a\n * separate module, reachable solely through that public export). That's the\n * tree-shaking boundary: if an app never calls the opt-in function, then a\n * bundler drops the entire orchestrion subtree, including its transitive\n * dependencies, while an app that does call it gets it bundled\n * normally.\n */\nexport interface DiagnosticsChannelInjection {\n /** Channel-based integrations to register, replacing their OTel equivalents. */\n integrations: Integration[] | readonly Integration[];\n /** OTel integration names these replace; filtered out of the default set. */\n replacedOtelIntegrationNames: string[];\n /** Installs the module hooks that inject the diagnostics channels. */\n register: () => void;\n /** Warns (DEBUG only) about missing or doubled channel injection. */\n detect: () => void;\n}\n\nlet loader: (() => DiagnosticsChannelInjection) | undefined;\nlet cached: DiagnosticsChannelInjection | undefined;\n\n/**\n * Set by `experimentalUseDiagnosticsChannelInjection()`. The loader\n * is the only thing that pulls in the orchestrion modules; see\n * {@link DiagnosticsChannelInjection) re tree-shaking concerns this addresses.\n *\n * @internal\n */\nexport function setDiagnosticsChannelInjectionLoader(load: () => DiagnosticsChannelInjection): void {\n loader = load;\n}\n\n/** Whether `experimentalUseDiagnosticsChannelInjection()` was called. */\nexport function isDiagnosticsChannelInjectionEnabled(): boolean {\n return !!loader;\n}\n\n/**\n * Resolve and memoize the orchestrion pieces. This is what actually loads\n * the orchestrion modules. Returns `undefined` if the app never opted in.\n * Callers gate this on span recording, so the modules load only when both\n * opted in and tracing is enabled.\n */\nexport function resolveDiagnosticsChannelInjection(): DiagnosticsChannelInjection | undefined {\n if (!loader) {\n return undefined;\n }\n return (cached ??= loader());\n}\n"],"names":[],"mappings":";;AAyBA,IAAI,MAAA;AACJ,IAAI,MAAA;AASG,SAAS,qCAAqC,IAAA,EAA+C;AAClG,EAAA,MAAA,GAAS,IAAA;AACX;AAGO,SAAS,oCAAA,GAAgD;AAC9D,EAAA,OAAO,CAAC,CAAC,MAAA;AACX;AAQO,SAAS,kCAAA,GAA8E;AAC5F,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,OAAO,MAAA;AAAA,EACT;AACA,EAAA,OAAQ,oBAAW,MAAA,EAAO,CAAA;AAC5B;;;;;;"}
@@ -5,14 +5,16 @@ const register = require('@sentry/server-utils/orchestrion/register');
5
5
  const diagnosticsChannelInjection = require('./diagnosticsChannelInjection.js');
6
6
 
7
7
  function experimentalUseDiagnosticsChannelInjection() {
8
- diagnosticsChannelInjection.setDiagnosticsChannelInjectionLoader(
9
- () => ({
10
- integrations: [orchestrion.mysqlChannelIntegration()],
11
- replacedOtelIntegrationNames: ["Mysql"],
8
+ diagnosticsChannelInjection.setDiagnosticsChannelInjectionLoader(() => {
9
+ const integrations = [orchestrion.mysqlChannelIntegration(), orchestrion.lruMemoizerChannelIntegration()];
10
+ const replacedOtelIntegrationNames = integrations.map((i) => i.name);
11
+ return {
12
+ integrations,
13
+ replacedOtelIntegrationNames,
12
14
  register: register.registerDiagnosticsChannelInjection,
13
15
  detect: orchestrion.detectOrchestrionSetup
14
- })
15
- );
16
+ };
17
+ });
16
18
  }
17
19
 
18
20
  exports.experimentalUseDiagnosticsChannelInjection = experimentalUseDiagnosticsChannelInjection;
@@ -1 +1 @@
1
- {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.js","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"sourcesContent":["import { mysqlChannelIntegration, detectOrchestrionSetup } from '@sentry/server-utils/orchestrion';\nimport { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';\nimport type { DiagnosticsChannelInjection } from './diagnosticsChannelInjection';\nimport { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInjection';\n\n/**\n * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.\n *\n * Call this BEFORE `Sentry.init()`:\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.experimentalUseDiagnosticsChannelInjection();\n * Sentry.init({\n * dsn: '__DSN__',\n * // other settings...\n * });\n * ```\n *\n * When this has been called AND span recording is enabled, `Sentry.init()`\n * uses the diagnostics-channel-injection-based integrations instead of the\n * OpenTelemetry ones, and installs the module hooks that inject the channels\n * (so libraries imported after `init()` publish the channel events).\n *\n * This is a standalone function rather than an `init()` option so that a\n * bundler drops all of it (and its transitive deps) when this function isn't\n * called. `init()` reads the loader registered below.\n *\n * An app that DOES call it gets the orchestrion code bundled as intended.\n *\n * In an unbundled (server-side runtime) app this eagerly loads only the small\n * subscriber/channel modules; the heavy code-transform dependencies stay lazy\n * inside `register()` and load only when injection actually runs.\n *\n * @experimental May change or be removed in any release.\n */\nexport function experimentalUseDiagnosticsChannelInjection(): void {\n setDiagnosticsChannelInjectionLoader(\n (): DiagnosticsChannelInjection => ({\n integrations: [mysqlChannelIntegration()],\n replacedOtelIntegrationNames: ['Mysql'],\n register: registerDiagnosticsChannelInjection,\n detect: detectOrchestrionSetup,\n }),\n );\n}\n"],"names":["setDiagnosticsChannelInjectionLoader","mysqlChannelIntegration","registerDiagnosticsChannelInjection","detectOrchestrionSetup"],"mappings":";;;;;;AAqCO,SAAS,0CAAA,GAAmD;AACjE,EAAAA,gEAAA;AAAA,IACE,OAAoC;AAAA,MAClC,YAAA,EAAc,CAACC,mCAAA,EAAyB,CAAA;AAAA,MACxC,4BAAA,EAA8B,CAAC,OAAO,CAAA;AAAA,MACtC,QAAA,EAAUC,4CAAA;AAAA,MACV,MAAA,EAAQC;AAAA,KACV;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"experimentalUseDiagnosticsChannelInjection.js","sources":["../../../src/sdk/experimentalUseDiagnosticsChannelInjection.ts"],"sourcesContent":["import {\n mysqlChannelIntegration,\n lruMemoizerChannelIntegration,\n detectOrchestrionSetup,\n} from '@sentry/server-utils/orchestrion';\nimport { registerDiagnosticsChannelInjection } from '@sentry/server-utils/orchestrion/register';\nimport type { DiagnosticsChannelInjection } from './diagnosticsChannelInjection';\nimport { setDiagnosticsChannelInjectionLoader } from './diagnosticsChannelInjection';\n\n/**\n * EXPERIMENTAL: opt into diagnostics-channel-based auto-instrumentation.\n *\n * Call this BEFORE `Sentry.init()`:\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n *\n * Sentry.experimentalUseDiagnosticsChannelInjection();\n * Sentry.init({\n * dsn: '__DSN__',\n * // other settings...\n * });\n * ```\n *\n * When this has been called AND span recording is enabled, `Sentry.init()`\n * uses the diagnostics-channel-injection-based integrations instead of the\n * OpenTelemetry ones, and installs the module hooks that inject the channels\n * (so libraries imported after `init()` publish the channel events).\n *\n * This is a standalone function rather than an `init()` option so that a\n * bundler drops all of it (and its transitive deps) when this function isn't\n * called. `init()` reads the loader registered below.\n *\n * An app that DOES call it gets the orchestrion code bundled as intended.\n *\n * In an unbundled (server-side runtime) app this eagerly loads only the small\n * subscriber/channel modules; the heavy code-transform dependencies stay lazy\n * inside `register()` and load only when injection actually runs.\n *\n * @experimental May change or be removed in any release.\n */\nexport function experimentalUseDiagnosticsChannelInjection(): void {\n setDiagnosticsChannelInjectionLoader((): DiagnosticsChannelInjection => {\n const integrations = [mysqlChannelIntegration(), lruMemoizerChannelIntegration()] as const;\n const replacedOtelIntegrationNames = integrations.map(i => i.name);\n\n return {\n integrations,\n replacedOtelIntegrationNames,\n register: registerDiagnosticsChannelInjection,\n detect: detectOrchestrionSetup,\n };\n });\n}\n"],"names":["setDiagnosticsChannelInjectionLoader","mysqlChannelIntegration","lruMemoizerChannelIntegration","registerDiagnosticsChannelInjection","detectOrchestrionSetup"],"mappings":";;;;;;AAyCO,SAAS,0CAAA,GAAmD;AACjE,EAAAA,gEAAA,CAAqC,MAAmC;AACtE,IAAA,MAAM,YAAA,GAAe,CAACC,mCAAA,EAAwB,EAAGC,2CAA+B,CAAA;AAChF,IAAA,MAAM,4BAAA,GAA+B,YAAA,CAAa,GAAA,CAAI,CAAA,CAAA,KAAK,EAAE,IAAI,CAAA;AAEjE,IAAA,OAAO;AAAA,MACL,YAAA;AAAA,MACA,4BAAA;AAAA,MACA,QAAA,EAAUC,4CAAA;AAAA,MACV,MAAA,EAAQC;AAAA,KACV;AAAA,EACF,CAAC,CAAA;AACH;;;;"}
@@ -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":[],"mappings":";;AAMO,MAAM,2BAAA,GAA8B,iBAAA,CAAkB,CAAC,QAAA,KAAuB;AACnF,EAAA,IAAI,CAAC,WAAU,EAAG;AAChB,IAAA,cAAA,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,CAAC,WAAU,EAAG;AAChB,IAAA,cAAA,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":[],"mappings":";;AAMO,MAAM,2BAAA,GAA8B,iBAAA,CAAkB,CAAC,QAAA,KAAuB;AACnF,EAAA,IAAI,CAAC,WAAU,EAAG;AAChB,IAAA,cAAA,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,CAAC,WAAU,EAAG;AAChB,IAAA,cAAA,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":[],"mappings":";;AAMO,MAAM,0BAAA,GAA6B,iBAAA,CAAkB,CAAC,QAAA,KAAuB;AAClF,EAAA,IAAI,CAAC,WAAU,EAAG;AAChB,IAAA,cAAA,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,CAAC,WAAU,EAAG;AAChB,MAAA,cAAA,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":[],"mappings":";;AAMO,MAAM,0BAAA,GAA6B,iBAAA,CAAkB,CAAC,QAAA,KAAuB;AAClF,EAAA,IAAI,CAAC,WAAU,EAAG;AAChB,IAAA,cAAA,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,CAAC,WAAU,EAAG;AAChB,MAAA,cAAA,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":[],"mappings":";;AAMO,MAAM,sBAAA,GAAyB,iBAAA,CAAkB,CAAC,QAAA,KAAuB;AAC9E,EAAA,IAAI,CAAC,WAAU,EAAG;AAChB,IAAA,cAAA,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":[],"mappings":";;AAMO,MAAM,sBAAA,GAAyB,iBAAA,CAAkB,CAAC,QAAA,KAAuB;AAC9E,EAAA,IAAI,CAAC,WAAU,EAAG;AAChB,IAAA,cAAA,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":[],"mappings":";;AAMO,MAAM,sBAAA,GAAyB,iBAAA,CAAkB,CAAC,QAAA,KAAuB;AAC9E,EAAA,IAAI,CAAC,WAAU,EAAG;AAChB,IAAA,cAAA,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":[],"mappings":";;AAMO,MAAM,sBAAA,GAAyB,iBAAA,CAAkB,CAAC,QAAA,KAAuB;AAC9E,EAAA,IAAI,CAAC,WAAU,EAAG;AAChB,IAAA,cAAA,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":[],"mappings":";;;AAIA,MAAM,gBAAA,GAAmB,YAAA;AAWlB,MAAM,aAAA,GAAgB,iBAAA,CAAkB,CAAC,OAAA,GAAmC,EAAC,KAAM;AACxF,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,uBAAA,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":[],"mappings":";;;AAIA,MAAM,gBAAA,GAAmB,YAAA;AAWlB,MAAM,aAAA,GAAgB,iBAAA,CAAkB,CAAC,OAAA,GAAmC,EAAC,KAAM;AACxF,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,uBAAA,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":[],"mappings":";;;AAsBA,MAAM,gBAAA,GAAmB,MAAA;AA0IlB,MAAM,oBAAA,GAAuB,sBAAA;AAAA,EAClC,GAAG,gBAAgB,CAAA,OAAA,CAAA;AAAA,EACnB,CAAA,OAAA,KAAW;AACT,IAAA,OAAO,IAAI,0BAA0B,OAAO,CAAA;AAAA,EAC9C;AACF;AAMO,MAAM,eAAA,GAAkB,iBAAA,CAAkB,CAAC,OAAA,GAAuB,EAAC,KAAM;AAC9E,EAAA,MAAM,KAAA,GAAQ,QAAQ,KAAA,IAAS,IAAA;AAC/B,EAAA,MAAM,8BAA8B,OAAA,CAAQ,2BAAA;AAC5C,EAAA,MAAM,iBAAA,GAAoB,SAAS,CAAC,2BAAA;AAEpC,EAAA,MAAM,aAAA,GAAgB;AAAA,IACpB,UAAU,OAAA,CAAQ,+BAAA;AAAA,IAClB,wBAAwB,OAAA,CAAQ,sBAAA;AAAA,IAChC,mBAAmB,OAAA,CAAQ,yBAAA;AAAA,IAC3B,oBAAoB,OAAA,CAAQ;AAAA,GAC9B;AAEA,EAAA,MAAM,kBAAA,GAAwD;AAAA,IAC5D,wBAAwB,OAAA,CAAQ,sBAAA;AAAA,IAChC,oBAAoB,OAAA,CAAQ,kBAAA;AAAA,IAC5B,mBAAmB,OAAA,CAAQ,sCAAA;AAAA,IAC3B,iBAAiB,OAAA,CAAQ,eAAA;AAAA,IACzB,eAAe,OAAA,CAAQ;AAAA,GACzB;AAEA,EAAA,MAAM,MAAA,GAAS,sBAAsB,aAAa,CAAA;AAClD,EAAA,MAAM,WAAA,GAAc,2BAA2B,kBAAkB,CAAA;AAEjE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,MAAM,MAAA,EAAoB;AACxB,MAAA,MAAM,aAAA,GAAgB,OAAO,UAAA,EAAW;AAExC,MAAA,IAAI,iBAAA,IAAqB,eAAA,CAAgB,aAAa,CAAA,EAAG;AACvD,QAAA,WAAA,CAAY,MAAM,MAAM,CAAA;AAAA,MAC1B;AAAA,IACF,CAAA;AAAA,IACA,SAAA,GAAY;AACV,MAAA,MAAA,CAAO,SAAA,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,GAAM,+BAA+B,OAAO,CAAA;AAClD,UAAA,IAAI,GAAA,CAAI,UAAA,CAAW,OAAO,CAAA,EAAG;AAC3B,YAAA,MAAM,YAAA,GAAe,oBAAoB,GAAG,CAAA;AAG5C,YAAA,IAAA,CAAK,YAAA,CAAa,YAAY,YAAY,CAAA;AAC1C,YAAA,IAAA,CAAK,YAAA,CAAa,6BAA6B,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":[],"mappings":";;;AAsBA,MAAM,gBAAA,GAAmB,MAAA;AA0IlB,MAAM,oBAAA,GAAuB,sBAAA;AAAA,EAClC,GAAG,gBAAgB,CAAA,OAAA,CAAA;AAAA,EACnB,CAAA,OAAA,KAAW;AACT,IAAA,OAAO,IAAI,0BAA0B,OAAO,CAAA;AAAA,EAC9C;AACF;AAMO,MAAM,eAAA,GAAkB,iBAAA,CAAkB,CAAC,OAAA,GAAuB,EAAC,KAAM;AAC9E,EAAA,MAAM,KAAA,GAAQ,QAAQ,KAAA,IAAS,IAAA;AAC/B,EAAA,MAAM,8BAA8B,OAAA,CAAQ,2BAAA;AAC5C,EAAA,MAAM,iBAAA,GAAoB,SAAS,CAAC,2BAAA;AAEpC,EAAA,MAAM,aAAA,GAAgB;AAAA,IACpB,UAAU,OAAA,CAAQ,+BAAA;AAAA,IAClB,wBAAwB,OAAA,CAAQ,sBAAA;AAAA,IAChC,mBAAmB,OAAA,CAAQ,yBAAA;AAAA,IAC3B,oBAAoB,OAAA,CAAQ;AAAA,GAC9B;AAEA,EAAA,MAAM,kBAAA,GAAwD;AAAA,IAC5D,wBAAwB,OAAA,CAAQ,sBAAA;AAAA,IAChC,oBAAoB,OAAA,CAAQ,kBAAA;AAAA,IAC5B,mBAAmB,OAAA,CAAQ,sCAAA;AAAA,IAC3B,iBAAiB,OAAA,CAAQ,eAAA;AAAA,IACzB,eAAe,OAAA,CAAQ;AAAA,GACzB;AAEA,EAAA,MAAM,MAAA,GAAS,sBAAsB,aAAa,CAAA;AAClD,EAAA,MAAM,WAAA,GAAc,2BAA2B,kBAAkB,CAAA;AAEjE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,MAAM,MAAA,EAAoB;AACxB,MAAA,MAAM,aAAA,GAAgB,OAAO,UAAA,EAAW;AAExC,MAAA,IAAI,iBAAA,IAAqB,eAAA,CAAgB,aAAa,CAAA,EAAG;AACvD,QAAA,WAAA,CAAY,MAAM,MAAM,CAAA;AAAA,MAC1B;AAAA,IACF,CAAA;AAAA,IACA,SAAA,GAAY;AACV,MAAA,MAAA,CAAO,SAAA,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,GAAM,+BAA+B,OAAO,CAAA;AAClD,UAAA,IAAI,GAAA,CAAI,UAAA,CAAW,OAAO,CAAA,EAAG;AAC3B,YAAA,MAAM,YAAA,GAAe,oBAAoB,GAAG,CAAA;AAG5C,YAAA,IAAA,CAAK,YAAA,CAAa,YAAY,YAAY,CAAA;AAC1C,YAAA,IAAA,CAAK,YAAA,CAAa,6BAA6B,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,15 +1,8 @@
1
- import { UndiciInstrumentation } from './vendored/undici.js';
2
- import { defineIntegration, getClient, hasSpansEnabled, stripDataUrlContent, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, SEMANTIC_ATTRIBUTE_URL_FULL, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
1
+ import { instrumentUndici } from './undici-instrumentation.js';
2
+ import { defineIntegration, getClient, hasSpansEnabled } from '@sentry/core';
3
3
  import { generateInstrumentOnce, SentryNodeFetchInstrumentation } from '@sentry/node-core';
4
4
 
5
5
  const INTEGRATION_NAME = "NodeFetch";
6
- let _undiciInstrumentation;
7
- function instrumentNodeFetchSpans(options) {
8
- if (!_undiciInstrumentation) {
9
- _undiciInstrumentation = new UndiciInstrumentation(_getConfigWithDefaults(options));
10
- }
11
- _undiciInstrumentation.enable();
12
- }
13
6
  const instrumentSentryNodeFetch = generateInstrumentOnce(
14
7
  `${INTEGRATION_NAME}.sentry`,
15
8
  SentryNodeFetchInstrumentation,
@@ -23,55 +16,21 @@ const _nativeNodeFetchIntegration = ((options = {}) => {
23
16
  setupOnce() {
24
17
  const instrumentSpans = _shouldInstrumentSpans(options, getClient()?.getOptions());
25
18
  if (instrumentSpans) {
26
- instrumentNodeFetchSpans(options);
19
+ instrumentUndici({
20
+ ignoreOutgoingRequests: options.ignoreOutgoingRequests,
21
+ requestHook: options.requestHook,
22
+ responseHook: options.responseHook,
23
+ headersToSpanAttributes: options.headersToSpanAttributes
24
+ });
27
25
  }
28
26
  instrumentSentryNodeFetch(options);
29
27
  }
30
28
  };
31
29
  });
32
30
  const nativeNodeFetchIntegration = defineIntegration(_nativeNodeFetchIntegration);
33
- function getAbsoluteUrl(origin, path = "/") {
34
- const url = `${origin}`;
35
- if (url.endsWith("/") && path.startsWith("/")) {
36
- return `${url}${path.slice(1)}`;
37
- }
38
- if (!url.endsWith("/") && !path.startsWith("/")) {
39
- return `${url}/${path}`;
40
- }
41
- return `${url}${path}`;
42
- }
43
31
  function _shouldInstrumentSpans(options, clientOptions = {}) {
44
32
  return typeof options.spans === "boolean" ? options.spans : !clientOptions.skipOpenTelemetrySetup && hasSpansEnabled(clientOptions);
45
33
  }
46
- function _getConfigWithDefaults(options = {}) {
47
- const instrumentationConfig = {
48
- ignoreRequestHook: (request) => {
49
- const url = getAbsoluteUrl(request.origin, request.path);
50
- const _ignoreOutgoingRequests = options.ignoreOutgoingRequests;
51
- const shouldIgnore = _ignoreOutgoingRequests && url && _ignoreOutgoingRequests(url);
52
- return !!shouldIgnore;
53
- },
54
- startSpanHook: (request) => {
55
- const url = getAbsoluteUrl(request.origin, request.path);
56
- if (url.startsWith("data:")) {
57
- const sanitizedUrl = stripDataUrlContent(url);
58
- return {
59
- [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.node_fetch",
60
- "http.url": sanitizedUrl,
61
- [SEMANTIC_ATTRIBUTE_URL_FULL]: sanitizedUrl,
62
- [SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]: `${request.method || "GET"} ${sanitizedUrl}`
63
- };
64
- }
65
- return {
66
- [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.node_fetch"
67
- };
68
- },
69
- requestHook: options.requestHook,
70
- responseHook: options.responseHook,
71
- headersToSpanAttributes: options.headersToSpanAttributes
72
- };
73
- return instrumentationConfig;
74
- }
75
34
 
76
- export { _getConfigWithDefaults, nativeNodeFetchIntegration };
35
+ export { nativeNodeFetchIntegration };
77
36
  //# 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":[],"mappings":";;;;AAgBA,MAAM,gBAAA,GAAmB,WAAA;AAuCzB,IAAI,sBAAA;AAIJ,SAAS,yBAAyB,OAAA,EAAiC;AACjE,EAAA,IAAI,CAAC,sBAAA,EAAwB;AAC3B,IAAA,sBAAA,GAAyB,IAAI,qBAAA,CAAsB,sBAAA,CAAuB,OAAO,CAAC,CAAA;AAAA,EACpF;AACA,EAAA,sBAAA,CAAuB,MAAA,EAAO;AAChC;AAEA,MAAM,yBAAA,GAA4B,sBAAA;AAAA,EAChC,GAAG,gBAAgB,CAAA,OAAA,CAAA;AAAA,EACnB,8BAAA;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,SAAA,EAAsB,EAAG,YAAY,CAAA;AAG7F,MAAA,IAAI,eAAA,EAAiB;AACnB,QAAA,wBAAA,CAAyB,OAAO,CAAA;AAAA,MAClC;AAKA,MAAA,yBAAA,CAA0B,OAAO,CAAA;AAAA,IACnC;AAAA,GACF;AACF,CAAA,CAAA;AAEO,MAAM,0BAAA,GAA6B,kBAAkB,2BAA2B;AAGvF,SAAS,cAAA,CAAe,MAAA,EAAgB,IAAA,GAAe,GAAA,EAAa;AAClE,EAAA,MAAM,GAAA,GAAM,GAAG,MAAM,CAAA,CAAA;AAErB,EAAA,IAAI,IAAI,QAAA,CAAS,GAAG,KAAK,IAAA,CAAK,UAAA,CAAW,GAAG,CAAA,EAAG;AAC7C,IAAA,OAAO,GAAG,GAAG,CAAA,EAAG,IAAA,CAAK,KAAA,CAAM,CAAC,CAAC,CAAA,CAAA;AAAA,EAC/B;AAEA,EAAA,IAAI,CAAC,IAAI,QAAA,CAAS,GAAG,KAAK,CAAC,IAAA,CAAK,UAAA,CAAW,GAAG,CAAA,EAAG;AAC/C,IAAA,OAAO,CAAA,EAAG,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA;AAAA,EACvB;AAEA,EAAA,OAAO,CAAA,EAAG,GAAG,CAAA,EAAG,IAAI,CAAA,CAAA;AACtB;AAEA,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,IAA0B,eAAA,CAAgB,aAAa,CAAA;AAC5E;AAGO,SAAS,sBAAA,CAAuB,OAAA,GAAqC,EAAC,EAAgC;AAC3G,EAAA,MAAM,qBAAA,GAAwB;AAAA,IAC5B,mBAAmB,CAAA,OAAA,KAAW;AAC5B,MAAA,MAAM,GAAA,GAAM,cAAA,CAAe,OAAA,CAAQ,MAAA,EAAQ,QAAQ,IAAI,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,GAAe,oBAAoB,GAAG,CAAA;AAC5C,QAAA,OAAO;AAAA,UACL,CAAC,gCAAgC,GAAG,2BAAA;AAAA,UACpC,UAAA,EAAY,YAAA;AAAA,UACZ,CAAC,2BAA2B,GAAG,YAAA;AAAA,UAC/B,CAAC,0CAA0C,GAAG,CAAA,EAAG,QAAQ,MAAA,IAAU,KAAK,IAAI,YAAY,CAAA;AAAA,SAC1F;AAAA,MACF;AAEA,MAAA,OAAO;AAAA,QACL,CAAC,gCAAgC,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":[],"mappings":";;;;AAQA,MAAM,gBAAA,GAAmB,WAAA;AAEzB,MAAM,yBAAA,GAA4B,sBAAA;AAAA,EAChC,GAAG,gBAAgB,CAAA,OAAA,CAAA;AAAA,EACnB,8BAAA;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,SAAA,EAAsB,EAAG,YAAY,CAAA;AAG7F,MAAA,IAAI,eAAA,EAAiB;AACnB,QAAA,gBAAA,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,GAA6B,kBAAkB,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,IAA0B,eAAA,CAAgB,aAAa,CAAA;AAC5E;;;;"}
@@ -0,0 +1,264 @@
1
+ import * as diagch from 'diagnostics_channel';
2
+ import { URL } from 'url';
3
+ import { LRUMap, debug, stripDataUrlContent, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME, startInactiveSpan, SPAN_KIND, SPAN_STATUS_ERROR, getClient, shouldPropagateTraceForUrl, withActiveSpan, getTraceData, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
4
+ import { URL_QUERY, URL_PATH, URL_FULL, SERVER_ADDRESS, SERVER_PORT, USER_AGENT_ORIGINAL, HTTP_RESPONSE_STATUS_CODE, URL_SCHEME, HTTP_REQUEST_METHOD, NETWORK_PEER_PORT, NETWORK_PEER_ADDRESS } from '@sentry/conventions/attributes';
5
+ import { DEBUG_BUILD } from '../../debug-build.js';
6
+
7
+ const ATTR_HTTP_REQUEST_METHOD_ORIGINAL = "http.request.method_original";
8
+ const _channelSubs = [];
9
+ const spanFromReq = /* @__PURE__ */ new WeakMap();
10
+ const propagationDecisionMap = new LRUMap(100);
11
+ function instrumentUndici(config = {}) {
12
+ if (_channelSubs.length) {
13
+ return;
14
+ }
15
+ subscribeToChannel("undici:request:create", (message) => onRequestCreated(config, message));
16
+ subscribeToChannel(
17
+ "undici:client:sendHeaders",
18
+ (message) => onRequestHeaders(config, message)
19
+ );
20
+ subscribeToChannel("undici:request:headers", (message) => onResponseHeaders(config, message));
21
+ subscribeToChannel("undici:request:trailers", (message) => onDone(message));
22
+ subscribeToChannel("undici:request:error", (message) => onError(message));
23
+ }
24
+ function safeExecute(fn, onError2) {
25
+ try {
26
+ return fn();
27
+ } catch (error) {
28
+ onError2(error);
29
+ return void 0;
30
+ }
31
+ }
32
+ function subscribeToChannel(diagnosticChannel, onMessage) {
33
+ const [major = 0, minor = 0] = process.version.replace("v", "").split(".").map((n) => Number(n));
34
+ const useNewSubscribe = major > 18 || major === 18 && minor >= 19;
35
+ if (useNewSubscribe) {
36
+ _channelSubs.push(diagch.subscribe?.(diagnosticChannel, onMessage));
37
+ } else {
38
+ _channelSubs.push(diagch.channel(diagnosticChannel).subscribe(onMessage));
39
+ }
40
+ }
41
+ function parseRequestHeaders(request) {
42
+ const result = /* @__PURE__ */ new Map();
43
+ if (Array.isArray(request.headers)) {
44
+ for (let i = 0; i < request.headers.length; i += 2) {
45
+ const key = request.headers[i];
46
+ const value = request.headers[i + 1];
47
+ if (typeof key === "string" && value !== void 0) {
48
+ result.set(key.toLowerCase(), value);
49
+ }
50
+ }
51
+ } else if (typeof request.headers === "string") {
52
+ const headers = request.headers.split("\r\n");
53
+ for (const line of headers) {
54
+ if (!line) {
55
+ continue;
56
+ }
57
+ const colonIndex = line.indexOf(":");
58
+ if (colonIndex === -1) {
59
+ continue;
60
+ }
61
+ const key = line.substring(0, colonIndex).toLowerCase();
62
+ const value = line.substring(colonIndex + 1).trim();
63
+ const allValues = result.get(key);
64
+ if (allValues && Array.isArray(allValues)) {
65
+ allValues.push(value);
66
+ } else if (allValues) {
67
+ result.set(key, [allValues, value]);
68
+ } else {
69
+ result.set(key, value);
70
+ }
71
+ }
72
+ }
73
+ return result;
74
+ }
75
+ function onRequestCreated(config, { request }) {
76
+ const url = getAbsoluteUrl(request.origin, request.path);
77
+ const shouldIgnoreReq = safeExecute(
78
+ () => request.method === "CONNECT" || !!config.ignoreOutgoingRequests?.(url),
79
+ (e) => e && DEBUG_BUILD && debug.error("caught ignoreOutgoingRequests error: ", e)
80
+ );
81
+ if (shouldIgnoreReq) {
82
+ return;
83
+ }
84
+ let requestUrl;
85
+ try {
86
+ requestUrl = new URL(request.path, request.origin);
87
+ } catch (err) {
88
+ DEBUG_BUILD && debug.warn("could not determine url.full:", err);
89
+ return;
90
+ }
91
+ const urlScheme = requestUrl.protocol.replace(":", "");
92
+ const requestMethod = getRequestMethod(request.method);
93
+ const attributes = {
94
+ [HTTP_REQUEST_METHOD]: requestMethod,
95
+ [ATTR_HTTP_REQUEST_METHOD_ORIGINAL]: request.method,
96
+ [URL_FULL]: requestUrl.toString(),
97
+ [URL_PATH]: requestUrl.pathname,
98
+ [URL_QUERY]: requestUrl.search,
99
+ [URL_SCHEME]: urlScheme,
100
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.node_fetch"
101
+ };
102
+ if (url.startsWith("data:")) {
103
+ const sanitizedUrl = stripDataUrlContent(url);
104
+ attributes["http.url"] = sanitizedUrl;
105
+ attributes[URL_FULL] = sanitizedUrl;
106
+ attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME] = `${request.method || "GET"} ${sanitizedUrl}`;
107
+ }
108
+ const schemePorts = { https: "443", http: "80" };
109
+ const serverAddress = requestUrl.hostname;
110
+ const serverPort = requestUrl.port || schemePorts[urlScheme];
111
+ attributes[SERVER_ADDRESS] = serverAddress;
112
+ if (serverPort && !isNaN(Number(serverPort))) {
113
+ attributes[SERVER_PORT] = Number(serverPort);
114
+ }
115
+ const headersMap = parseRequestHeaders(request);
116
+ const userAgentValues = headersMap.get("user-agent");
117
+ if (userAgentValues) {
118
+ const userAgent = Array.isArray(userAgentValues) ? userAgentValues[userAgentValues.length - 1] : userAgentValues;
119
+ attributes[USER_AGENT_ORIGINAL] = userAgent;
120
+ }
121
+ const span = startInactiveSpan({
122
+ name: requestMethod === "_OTHER" ? "HTTP" : requestMethod,
123
+ kind: SPAN_KIND.CLIENT,
124
+ attributes
125
+ });
126
+ safeExecute(
127
+ () => config.requestHook?.(span, request),
128
+ (e) => e && DEBUG_BUILD && debug.error("caught requestHook error: ", e)
129
+ );
130
+ injectTracePropagationHeaders(span, request, requestUrl.toString());
131
+ spanFromReq.set(request, span);
132
+ }
133
+ function onRequestHeaders(config, { request, socket }) {
134
+ const span = spanFromReq.get(request);
135
+ if (!span) {
136
+ return;
137
+ }
138
+ const { remoteAddress, remotePort } = socket;
139
+ const spanAttributes = {
140
+ [NETWORK_PEER_ADDRESS]: remoteAddress,
141
+ [NETWORK_PEER_PORT]: remotePort
142
+ };
143
+ if (config.headersToSpanAttributes?.requestHeaders) {
144
+ const headersToAttribs = new Set(config.headersToSpanAttributes.requestHeaders.map((n) => n.toLowerCase()));
145
+ const headersMap = parseRequestHeaders(request);
146
+ for (const [name, value] of headersMap.entries()) {
147
+ if (headersToAttribs.has(name)) {
148
+ const attrValue = Array.isArray(value) ? value : [value];
149
+ spanAttributes[`http.request.header.${name}`] = attrValue;
150
+ }
151
+ }
152
+ }
153
+ span.setAttributes(spanAttributes);
154
+ }
155
+ function onResponseHeaders(config, { request, response }) {
156
+ const span = spanFromReq.get(request);
157
+ if (!span) {
158
+ return;
159
+ }
160
+ const spanAttributes = {
161
+ [HTTP_RESPONSE_STATUS_CODE]: response.statusCode
162
+ };
163
+ safeExecute(
164
+ () => config.responseHook?.(span, { request, response }),
165
+ (e) => e && DEBUG_BUILD && debug.error("caught responseHook error: ", e)
166
+ );
167
+ if (config.headersToSpanAttributes?.responseHeaders) {
168
+ const headersToAttribs = /* @__PURE__ */ new Set();
169
+ config.headersToSpanAttributes?.responseHeaders.forEach((name) => headersToAttribs.add(name.toLowerCase()));
170
+ for (let idx = 0; idx < response.headers.length; idx = idx + 2) {
171
+ const nameBuf = response.headers[idx];
172
+ const valueBuf = response.headers[idx + 1];
173
+ if (nameBuf === void 0 || valueBuf === void 0) {
174
+ continue;
175
+ }
176
+ const name = nameBuf.toString().toLowerCase();
177
+ const value = valueBuf;
178
+ if (headersToAttribs.has(name)) {
179
+ const attrName = `http.response.header.${name}`;
180
+ if (!Object.prototype.hasOwnProperty.call(spanAttributes, attrName)) {
181
+ spanAttributes[attrName] = [value.toString()];
182
+ } else {
183
+ spanAttributes[attrName].push(value.toString());
184
+ }
185
+ }
186
+ }
187
+ }
188
+ span.setAttributes(spanAttributes);
189
+ if (response.statusCode >= 400) {
190
+ span.setStatus({ code: SPAN_STATUS_ERROR });
191
+ }
192
+ }
193
+ function onDone({ request }) {
194
+ const span = spanFromReq.get(request);
195
+ if (!span) {
196
+ return;
197
+ }
198
+ span.end();
199
+ spanFromReq.delete(request);
200
+ }
201
+ function onError({ request, error }) {
202
+ const span = spanFromReq.get(request);
203
+ if (!span) {
204
+ return;
205
+ }
206
+ span.setStatus({
207
+ code: SPAN_STATUS_ERROR,
208
+ message: error.message
209
+ });
210
+ span.end();
211
+ spanFromReq.delete(request);
212
+ }
213
+ function injectTracePropagationHeaders(span, request, url) {
214
+ const { tracePropagationTargets, propagateTraceparent } = getClient()?.getOptions() ?? {};
215
+ if (!shouldPropagateTraceForUrl(url, tracePropagationTargets, propagationDecisionMap)) {
216
+ return;
217
+ }
218
+ const addedHeaders = withActiveSpan(span, () => getTraceData({ propagateTraceparent }));
219
+ for (const [k, v] of Object.entries(addedHeaders)) {
220
+ if (!v) {
221
+ continue;
222
+ }
223
+ if (typeof request.addHeader === "function") {
224
+ request.addHeader(k, v);
225
+ } else if (typeof request.headers === "string") {
226
+ request.headers += `${k}: ${v}\r
227
+ `;
228
+ } else if (Array.isArray(request.headers)) {
229
+ request.headers.push(k, v);
230
+ }
231
+ }
232
+ }
233
+ function getRequestMethod(original) {
234
+ const knownMethods = {
235
+ CONNECT: true,
236
+ OPTIONS: true,
237
+ HEAD: true,
238
+ GET: true,
239
+ POST: true,
240
+ PUT: true,
241
+ PATCH: true,
242
+ DELETE: true,
243
+ TRACE: true,
244
+ // QUERY from https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/
245
+ QUERY: true
246
+ };
247
+ if (original.toUpperCase() in knownMethods) {
248
+ return original.toUpperCase();
249
+ }
250
+ return "_OTHER";
251
+ }
252
+ function getAbsoluteUrl(origin, path = "/") {
253
+ const url = `${origin}`;
254
+ if (url.endsWith("/") && path.startsWith("/")) {
255
+ return `${url}${path.slice(1)}`;
256
+ }
257
+ if (!url.endsWith("/") && !path.startsWith("/")) {
258
+ return `${url}/${path}`;
259
+ }
260
+ return `${url}${path}`;
261
+ }
262
+
263
+ export { instrumentUndici };
264
+ //# sourceMappingURL=undici-instrumentation.js.map