@depup/sentry__node 10.75.2-depup.0 → 11.1.0-depup.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 (1237) hide show
  1. package/README.md +3 -12
  2. package/build/cjs/bundler-plugin/esbuild.js +19 -0
  3. package/build/cjs/bundler-plugin/esbuild.js.map +1 -0
  4. package/build/cjs/bundler-plugin/rollup.js +12 -0
  5. package/build/cjs/bundler-plugin/rollup.js.map +1 -0
  6. package/build/cjs/bundler-plugin/vite.js +12 -0
  7. package/build/cjs/bundler-plugin/vite.js.map +1 -0
  8. package/build/cjs/bundler-plugin/webpack.js +18 -0
  9. package/build/cjs/bundler-plugin/webpack.js.map +1 -0
  10. package/build/cjs/cron/common.js +52 -0
  11. package/build/cjs/cron/common.js.map +1 -0
  12. package/build/cjs/cron/cron.js +88 -0
  13. package/build/cjs/cron/cron.js.map +1 -0
  14. package/build/cjs/cron/index.js +14 -0
  15. package/build/cjs/cron/index.js.map +1 -0
  16. package/build/cjs/cron/node-cron.js +52 -0
  17. package/build/cjs/cron/node-cron.js.map +1 -0
  18. package/build/cjs/cron/node-schedule.js +41 -0
  19. package/build/cjs/cron/node-schedule.js.map +1 -0
  20. package/build/cjs/eve.js +31 -0
  21. package/build/cjs/eve.js.map +1 -0
  22. package/build/cjs/index.js +131 -129
  23. package/build/cjs/index.js.map +1 -1
  24. package/build/cjs/integrations/anr/index.js +167 -0
  25. package/build/cjs/integrations/anr/index.js.map +1 -0
  26. package/build/cjs/integrations/childProcess.js +57 -0
  27. package/build/cjs/integrations/childProcess.js.map +1 -0
  28. package/build/cjs/integrations/console.js +95 -0
  29. package/build/cjs/integrations/console.js.map +1 -0
  30. package/build/cjs/integrations/context.js +391 -0
  31. package/build/cjs/integrations/context.js.map +1 -0
  32. package/build/cjs/integrations/contextlines.js +251 -0
  33. package/build/cjs/integrations/contextlines.js.map +1 -0
  34. package/build/cjs/integrations/fs/index.js +1 -1
  35. package/build/cjs/integrations/fs/index.js.map +1 -1
  36. package/build/cjs/integrations/fs/vendored/constants.js.map +1 -1
  37. package/build/cjs/integrations/fs/vendored/instrumentation.js +4 -2
  38. package/build/cjs/integrations/fs/vendored/instrumentation.js.map +1 -1
  39. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +62 -0
  40. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -0
  41. package/build/cjs/integrations/http/httpServerIntegration.js +78 -0
  42. package/build/cjs/integrations/http/httpServerIntegration.js.map +1 -0
  43. package/build/cjs/integrations/http/httpServerSpansIntegration.js +187 -0
  44. package/build/cjs/integrations/http/httpServerSpansIntegration.js.map +1 -0
  45. package/build/cjs/integrations/http/index.js +57 -0
  46. package/build/cjs/integrations/http/index.js.map +1 -0
  47. package/build/cjs/integrations/local-variables/common.js +20 -0
  48. package/build/cjs/integrations/local-variables/common.js.map +1 -0
  49. package/build/cjs/integrations/local-variables/index.js +10 -0
  50. package/build/cjs/integrations/local-variables/index.js.map +1 -0
  51. package/build/cjs/integrations/local-variables/local-variables-async.js +106 -0
  52. package/build/cjs/integrations/local-variables/local-variables-async.js.map +1 -0
  53. package/build/cjs/integrations/modules.js +98 -0
  54. package/build/cjs/integrations/modules.js.map +1 -0
  55. package/build/cjs/integrations/node-fetch/index.js +24 -0
  56. package/build/cjs/integrations/node-fetch/index.js.map +1 -0
  57. package/build/cjs/integrations/node-fetch/undici-instrumentation.js +268 -0
  58. package/build/cjs/integrations/node-fetch/undici-instrumentation.js.map +1 -0
  59. package/build/cjs/integrations/nodeRuntimeMetrics.js +182 -0
  60. package/build/cjs/integrations/nodeRuntimeMetrics.js.map +1 -0
  61. package/build/cjs/integrations/onuncaughtexception.js +92 -0
  62. package/build/cjs/integrations/onuncaughtexception.js.map +1 -0
  63. package/build/cjs/integrations/onunhandledrejection.js +94 -0
  64. package/build/cjs/integrations/onunhandledrejection.js.map +1 -0
  65. package/build/cjs/integrations/pino.js +115 -0
  66. package/build/cjs/integrations/pino.js.map +1 -0
  67. package/build/cjs/integrations/processSession.js +22 -0
  68. package/build/cjs/integrations/processSession.js.map +1 -0
  69. package/build/cjs/integrations/spotlight.js +79 -0
  70. package/build/cjs/integrations/spotlight.js.map +1 -0
  71. package/build/cjs/integrations/systemError.js +54 -0
  72. package/build/cjs/integrations/systemError.js.map +1 -0
  73. package/build/cjs/integrations/tracing/hapi.js +10 -0
  74. package/build/cjs/integrations/tracing/hapi.js.map +1 -0
  75. package/build/cjs/integrations/tracing/index.js +1 -92
  76. package/build/cjs/integrations/tracing/index.js.map +1 -1
  77. package/build/cjs/integrations/tracing/koa.js +10 -0
  78. package/build/cjs/integrations/tracing/koa.js.map +1 -0
  79. package/build/cjs/integrations/winston.js +84 -0
  80. package/build/cjs/integrations/winston.js.map +1 -0
  81. package/build/cjs/integrations/workerThreads.js +35 -0
  82. package/build/cjs/integrations/workerThreads.js.map +1 -0
  83. package/build/cjs/logs/capture.js +26 -0
  84. package/build/cjs/logs/capture.js.map +1 -0
  85. package/build/cjs/logs/exports.js +32 -0
  86. package/build/cjs/logs/exports.js.map +1 -0
  87. package/build/cjs/nodeVersion.js +10 -0
  88. package/build/cjs/nodeVersion.js.map +1 -0
  89. package/build/cjs/otel/logger.js +21 -0
  90. package/build/cjs/otel/logger.js.map +1 -0
  91. package/build/cjs/proxy/base.js +69 -0
  92. package/build/cjs/proxy/base.js.map +1 -0
  93. package/build/cjs/proxy/index.js +112 -0
  94. package/build/cjs/proxy/index.js.map +1 -0
  95. package/build/cjs/proxy/parse-proxy-response.js +88 -0
  96. package/build/cjs/proxy/parse-proxy-response.js.map +1 -0
  97. package/build/cjs/sdk/api.js +62 -0
  98. package/build/cjs/sdk/api.js.map +1 -0
  99. package/build/cjs/sdk/client.js +128 -0
  100. package/build/cjs/sdk/client.js.map +1 -0
  101. package/build/cjs/sdk/index.js +170 -45
  102. package/build/cjs/sdk/index.js.map +1 -1
  103. package/build/cjs/sdk/initOtel.js +9 -95
  104. package/build/cjs/sdk/initOtel.js.map +1 -1
  105. package/build/cjs/transports/http.js +109 -0
  106. package/build/cjs/transports/http.js.map +1 -0
  107. package/build/cjs/utils/debug.js +17 -0
  108. package/build/cjs/utils/debug.js.map +1 -0
  109. package/build/cjs/utils/entry-point.js +36 -0
  110. package/build/cjs/utils/entry-point.js.map +1 -0
  111. package/build/cjs/utils/errorhandling.js +39 -0
  112. package/build/cjs/utils/errorhandling.js.map +1 -0
  113. package/build/cjs/utils/module.js +37 -0
  114. package/build/cjs/utils/module.js.map +1 -0
  115. package/build/cjs/utils/outgoingFetchRequest.js +178 -0
  116. package/build/cjs/utils/outgoingFetchRequest.js.map +1 -0
  117. package/build/cjs/utils/spotlight.js +18 -0
  118. package/build/cjs/utils/spotlight.js.map +1 -0
  119. package/build/esm/bundler-plugin/esbuild.js +17 -0
  120. package/build/esm/bundler-plugin/esbuild.js.map +1 -0
  121. package/build/esm/bundler-plugin/rollup.js +10 -0
  122. package/build/esm/bundler-plugin/rollup.js.map +1 -0
  123. package/build/esm/bundler-plugin/vite.js +10 -0
  124. package/build/esm/bundler-plugin/vite.js.map +1 -0
  125. package/build/esm/bundler-plugin/webpack.js +16 -0
  126. package/build/esm/bundler-plugin/webpack.js.map +1 -0
  127. package/build/esm/cron/common.js +50 -0
  128. package/build/esm/cron/common.js.map +1 -0
  129. package/build/esm/cron/cron.js +86 -0
  130. package/build/esm/cron/cron.js.map +1 -0
  131. package/build/esm/cron/index.js +12 -0
  132. package/build/esm/cron/index.js.map +1 -0
  133. package/build/esm/cron/node-cron.js +50 -0
  134. package/build/esm/cron/node-cron.js.map +1 -0
  135. package/build/esm/cron/node-schedule.js +39 -0
  136. package/build/esm/cron/node-schedule.js.map +1 -0
  137. package/build/esm/eve.js +29 -0
  138. package/build/esm/eve.js.map +1 -0
  139. package/build/esm/index.js +37 -38
  140. package/build/esm/index.js.map +1 -1
  141. package/build/esm/integrations/anr/index.js +163 -0
  142. package/build/esm/integrations/anr/index.js.map +1 -0
  143. package/build/esm/integrations/anr/worker-script.js +2 -0
  144. package/build/esm/integrations/childProcess.js +55 -0
  145. package/build/esm/integrations/childProcess.js.map +1 -0
  146. package/build/esm/integrations/console.js +93 -0
  147. package/build/esm/integrations/console.js.map +1 -0
  148. package/build/esm/integrations/context.js +383 -0
  149. package/build/esm/integrations/context.js.map +1 -0
  150. package/build/esm/integrations/contextlines.js +245 -0
  151. package/build/esm/integrations/contextlines.js.map +1 -0
  152. package/build/esm/integrations/fs/index.js +1 -1
  153. package/build/esm/integrations/fs/index.js.map +1 -1
  154. package/build/esm/integrations/fs/vendored/constants.js.map +1 -1
  155. package/build/esm/integrations/fs/vendored/instrumentation.js +4 -2
  156. package/build/esm/integrations/fs/vendored/instrumentation.js.map +1 -1
  157. package/build/esm/integrations/http/SentryHttpInstrumentation.js +60 -0
  158. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -0
  159. package/build/esm/integrations/http/httpServerIntegration.js +75 -0
  160. package/build/esm/integrations/http/httpServerIntegration.js.map +1 -0
  161. package/build/esm/integrations/http/httpServerSpansIntegration.js +184 -0
  162. package/build/esm/integrations/http/httpServerSpansIntegration.js.map +1 -0
  163. package/build/esm/integrations/http/index.js +55 -0
  164. package/build/esm/integrations/http/index.js.map +1 -0
  165. package/build/esm/integrations/local-variables/common.js +15 -0
  166. package/build/esm/integrations/local-variables/common.js.map +1 -0
  167. package/build/esm/integrations/local-variables/index.js +8 -0
  168. package/build/esm/integrations/local-variables/index.js.map +1 -0
  169. package/build/esm/integrations/local-variables/local-variables-async.js +103 -0
  170. package/build/esm/integrations/local-variables/local-variables-async.js.map +1 -0
  171. package/build/esm/integrations/local-variables/worker-script.js +2 -0
  172. package/build/esm/integrations/modules.js +57 -0
  173. package/build/esm/integrations/modules.js.map +1 -0
  174. package/build/esm/integrations/node-fetch/index.js +22 -0
  175. package/build/esm/integrations/node-fetch/index.js.map +1 -0
  176. package/build/esm/integrations/node-fetch/undici-instrumentation.js +266 -0
  177. package/build/esm/integrations/node-fetch/undici-instrumentation.js.map +1 -0
  178. package/build/esm/integrations/nodeRuntimeMetrics.js +179 -0
  179. package/build/esm/integrations/nodeRuntimeMetrics.js.map +1 -0
  180. package/build/esm/integrations/onuncaughtexception.js +89 -0
  181. package/build/esm/integrations/onuncaughtexception.js.map +1 -0
  182. package/build/esm/integrations/onunhandledrejection.js +91 -0
  183. package/build/esm/integrations/onunhandledrejection.js.map +1 -0
  184. package/build/esm/integrations/pino.js +113 -0
  185. package/build/esm/integrations/pino.js.map +1 -0
  186. package/build/esm/integrations/processSession.js +20 -0
  187. package/build/esm/integrations/processSession.js.map +1 -0
  188. package/build/esm/integrations/spotlight.js +76 -0
  189. package/build/esm/integrations/spotlight.js.map +1 -0
  190. package/build/esm/integrations/systemError.js +52 -0
  191. package/build/esm/integrations/systemError.js.map +1 -0
  192. package/build/esm/integrations/tracing/hapi.js +8 -0
  193. package/build/esm/integrations/tracing/hapi.js.map +1 -0
  194. package/build/esm/integrations/tracing/index.js +3 -93
  195. package/build/esm/integrations/tracing/index.js.map +1 -1
  196. package/build/esm/integrations/tracing/koa.js +8 -0
  197. package/build/esm/integrations/tracing/koa.js.map +1 -0
  198. package/build/esm/integrations/winston.js +82 -0
  199. package/build/esm/integrations/winston.js.map +1 -0
  200. package/build/esm/integrations/workerThreads.js +33 -0
  201. package/build/esm/integrations/workerThreads.js.map +1 -0
  202. package/build/esm/logs/capture.js +24 -0
  203. package/build/esm/logs/capture.js.map +1 -0
  204. package/build/esm/logs/exports.js +24 -0
  205. package/build/esm/logs/exports.js.map +1 -0
  206. package/build/esm/nodeVersion.js +8 -0
  207. package/build/esm/nodeVersion.js.map +1 -0
  208. package/build/esm/otel/logger.js +19 -0
  209. package/build/esm/otel/logger.js.map +1 -0
  210. package/build/esm/package.json +1 -1
  211. package/build/esm/proxy/base.js +67 -0
  212. package/build/esm/proxy/base.js.map +1 -0
  213. package/build/esm/proxy/index.js +110 -0
  214. package/build/esm/proxy/index.js.map +1 -0
  215. package/build/esm/proxy/parse-proxy-response.js +86 -0
  216. package/build/esm/proxy/parse-proxy-response.js.map +1 -0
  217. package/build/esm/sdk/api.js +59 -0
  218. package/build/esm/sdk/api.js.map +1 -0
  219. package/build/esm/sdk/client.js +126 -0
  220. package/build/esm/sdk/client.js.map +1 -0
  221. package/build/esm/sdk/index.js +172 -46
  222. package/build/esm/sdk/index.js.map +1 -1
  223. package/build/esm/sdk/initOtel.js +12 -96
  224. package/build/esm/sdk/initOtel.js.map +1 -1
  225. package/build/esm/transports/http.js +107 -0
  226. package/build/esm/transports/http.js.map +1 -0
  227. package/build/esm/utils/debug.js +15 -0
  228. package/build/esm/utils/debug.js.map +1 -0
  229. package/build/esm/utils/entry-point.js +33 -0
  230. package/build/esm/utils/entry-point.js.map +1 -0
  231. package/build/esm/utils/errorhandling.js +37 -0
  232. package/build/esm/utils/errorhandling.js.map +1 -0
  233. package/build/esm/utils/module.js +35 -0
  234. package/build/esm/utils/module.js.map +1 -0
  235. package/build/esm/utils/outgoingFetchRequest.js +174 -0
  236. package/build/esm/utils/outgoingFetchRequest.js.map +1 -0
  237. package/build/esm/utils/spotlight.js +16 -0
  238. package/build/esm/utils/spotlight.js.map +1 -0
  239. package/build/import-hook.mjs +1 -11
  240. package/build/types/bundler-plugin/esbuild.d.ts +33 -0
  241. package/build/types/bundler-plugin/esbuild.d.ts.map +1 -0
  242. package/build/types/bundler-plugin/rollup.d.ts +34 -0
  243. package/build/types/bundler-plugin/rollup.d.ts.map +1 -0
  244. package/build/types/bundler-plugin/vite.d.ts +35 -0
  245. package/build/types/bundler-plugin/vite.d.ts.map +1 -0
  246. package/build/types/bundler-plugin/webpack.d.ts +37 -0
  247. package/build/types/bundler-plugin/webpack.d.ts.map +1 -0
  248. package/build/types/cron/common.d.ts +5 -0
  249. package/build/types/cron/common.d.ts.map +1 -0
  250. package/build/types/cron/cron.d.ts +43 -0
  251. package/build/types/cron/cron.d.ts.map +1 -0
  252. package/build/types/cron/index.d.ts +10 -0
  253. package/build/types/cron/index.d.ts.map +1 -0
  254. package/build/types/cron/node-cron.d.ts +28 -0
  255. package/build/types/cron/node-cron.d.ts.map +1 -0
  256. package/build/types/cron/node-schedule.d.ts +19 -0
  257. package/build/types/cron/node-schedule.d.ts.map +1 -0
  258. package/build/types/eve.d.ts +60 -0
  259. package/build/types/eve.d.ts.map +1 -0
  260. package/build/types/index.d.ts +38 -36
  261. package/build/types/index.d.ts.map +1 -1
  262. package/build/types/integrations/anr/common.d.ts +79 -0
  263. package/build/types/integrations/anr/common.d.ts.map +1 -0
  264. package/build/types/integrations/anr/index.d.ts +60 -0
  265. package/build/types/integrations/anr/index.d.ts.map +1 -0
  266. package/build/types/integrations/anr/worker.d.ts +2 -0
  267. package/build/types/integrations/anr/worker.d.ts.map +1 -0
  268. package/build/types/integrations/childProcess.d.ts +17 -0
  269. package/build/types/integrations/childProcess.d.ts.map +1 -0
  270. package/build/types/integrations/console.d.ts +23 -0
  271. package/build/types/integrations/console.d.ts.map +1 -0
  272. package/build/types/integrations/context.d.ts +33 -0
  273. package/build/types/integrations/context.d.ts.map +1 -0
  274. package/build/types/integrations/contextlines.d.ts +35 -0
  275. package/build/types/integrations/contextlines.d.ts.map +1 -0
  276. package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -1
  277. package/build/types/integrations/fs/index.d.ts.map +1 -1
  278. package/build/types/integrations/fs/vendored/instrumentation.d.ts.map +1 -1
  279. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +48 -0
  280. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -0
  281. package/build/types/integrations/http/httpServerIntegration.d.ts +68 -0
  282. package/build/types/integrations/http/httpServerIntegration.d.ts.map +1 -0
  283. package/build/types/integrations/http/httpServerSpansIntegration.d.ts +59 -0
  284. package/build/types/integrations/http/httpServerSpansIntegration.d.ts.map +1 -0
  285. package/build/types/integrations/http/index.d.ts +69 -0
  286. package/build/types/integrations/http/index.d.ts.map +1 -0
  287. package/build/types/integrations/local-variables/common.d.ts +79 -0
  288. package/build/types/integrations/local-variables/common.d.ts.map +1 -0
  289. package/build/types/integrations/local-variables/index.d.ts +4 -0
  290. package/build/types/integrations/local-variables/index.d.ts.map +1 -0
  291. package/build/types/integrations/local-variables/local-variables-async.d.ts +9 -0
  292. package/build/types/integrations/local-variables/local-variables-async.d.ts.map +1 -0
  293. package/build/types/integrations/local-variables/worker.d.ts +2 -0
  294. package/build/types/integrations/local-variables/worker.d.ts.map +1 -0
  295. package/build/types/integrations/modules.d.ts +17 -0
  296. package/build/types/integrations/modules.d.ts.map +1 -0
  297. package/build/types/integrations/node-fetch/index.d.ts +9 -0
  298. package/build/types/integrations/node-fetch/index.d.ts.map +1 -0
  299. package/build/types/integrations/node-fetch/types.d.ts +104 -0
  300. package/build/types/integrations/node-fetch/types.d.ts.map +1 -0
  301. package/build/types/integrations/node-fetch/undici-instrumentation.d.ts +17 -0
  302. package/build/types/integrations/node-fetch/undici-instrumentation.d.ts.map +1 -0
  303. package/build/types/integrations/nodeRuntimeMetrics.d.ts +66 -0
  304. package/build/types/integrations/nodeRuntimeMetrics.d.ts.map +1 -0
  305. package/build/types/integrations/onuncaughtexception.d.ts +33 -0
  306. package/build/types/integrations/onuncaughtexception.d.ts.map +1 -0
  307. package/build/types/integrations/onunhandledrejection.d.ts +22 -0
  308. package/build/types/integrations/onunhandledrejection.d.ts.map +1 -0
  309. package/build/types/integrations/pino.d.ts +61 -0
  310. package/build/types/integrations/pino.d.ts.map +1 -0
  311. package/build/types/integrations/processSession.d.ts +7 -0
  312. package/build/types/integrations/processSession.d.ts.map +1 -0
  313. package/build/types/integrations/spotlight.d.ts +18 -0
  314. package/build/types/integrations/spotlight.d.ts.map +1 -0
  315. package/build/types/integrations/systemError.d.ts +14 -0
  316. package/build/types/integrations/systemError.d.ts.map +1 -0
  317. package/build/types/integrations/tracing/hapi.d.ts +13 -0
  318. package/build/types/integrations/tracing/hapi.d.ts.map +1 -0
  319. package/build/types/integrations/tracing/index.d.ts +0 -9
  320. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  321. package/build/types/integrations/tracing/koa.d.ts +27 -0
  322. package/build/types/integrations/tracing/koa.d.ts.map +1 -0
  323. package/build/types/integrations/winston.d.ts +55 -0
  324. package/build/types/integrations/winston.d.ts.map +1 -0
  325. package/build/types/integrations/workerThreads.d.ts +8 -0
  326. package/build/types/integrations/workerThreads.d.ts.map +1 -0
  327. package/build/types/logs/capture.d.ts +29 -0
  328. package/build/types/logs/capture.d.ts.map +1 -0
  329. package/build/types/logs/exports.d.ts +150 -0
  330. package/build/types/logs/exports.d.ts.map +1 -0
  331. package/build/types/nodeVersion.d.ts +8 -0
  332. package/build/types/nodeVersion.d.ts.map +1 -0
  333. package/build/types/otel/logger.d.ts +5 -0
  334. package/build/types/otel/logger.d.ts.map +1 -0
  335. package/build/types/proxy/base.d.ts +61 -0
  336. package/build/types/proxy/base.d.ts.map +1 -0
  337. package/build/types/proxy/helpers.d.ts +37 -0
  338. package/build/types/proxy/helpers.d.ts.map +1 -0
  339. package/build/types/proxy/index.d.ts +70 -0
  340. package/build/types/proxy/index.d.ts.map +1 -0
  341. package/build/types/proxy/parse-proxy-response.d.ts +39 -0
  342. package/build/types/proxy/parse-proxy-response.d.ts.map +1 -0
  343. package/build/types/sdk/api.d.ts +8 -0
  344. package/build/types/sdk/api.d.ts.map +1 -0
  345. package/build/types/sdk/client.d.ts +33 -0
  346. package/build/types/sdk/client.d.ts.map +1 -0
  347. package/build/types/sdk/index.d.ts +1 -19
  348. package/build/types/sdk/index.d.ts.map +1 -1
  349. package/build/types/sdk/initOtel.d.ts +4 -22
  350. package/build/types/sdk/initOtel.d.ts.map +1 -1
  351. package/build/types/sdk/scope.d.ts +7 -0
  352. package/build/types/sdk/scope.d.ts.map +1 -0
  353. package/build/types/transports/http-module.d.ts +27 -0
  354. package/build/types/transports/http-module.d.ts.map +1 -0
  355. package/build/types/transports/http.d.ts +17 -0
  356. package/build/types/transports/http.d.ts.map +1 -0
  357. package/build/types/transports/index.d.ts +3 -0
  358. package/build/types/transports/index.d.ts.map +1 -0
  359. package/build/types/types.d.ts +33 -37
  360. package/build/types/types.d.ts.map +1 -1
  361. package/build/types/utils/addOriginToSpan.d.ts +5 -0
  362. package/build/types/utils/addOriginToSpan.d.ts.map +1 -0
  363. package/build/types/utils/debug.d.ts +5 -0
  364. package/build/types/utils/debug.d.ts.map +1 -0
  365. package/build/types/utils/entry-point.d.ts +24 -0
  366. package/build/types/utils/entry-point.d.ts.map +1 -0
  367. package/build/types/utils/errorhandling.d.ts +5 -0
  368. package/build/types/utils/errorhandling.d.ts.map +1 -0
  369. package/build/types/utils/module.d.ts +3 -0
  370. package/build/types/utils/module.d.ts.map +1 -0
  371. package/build/types/utils/outgoingFetchRequest.d.ts +20 -0
  372. package/build/types/utils/outgoingFetchRequest.d.ts.map +1 -0
  373. package/build/types/utils/prepareEvent.d.ts +17 -0
  374. package/build/types/utils/prepareEvent.d.ts.map +1 -0
  375. package/build/types/utils/spotlight.d.ts +8 -0
  376. package/build/types/utils/spotlight.d.ts.map +1 -0
  377. package/changes.json +3 -20
  378. package/package.json +44 -53
  379. package/build/cjs/init.js +0 -4
  380. package/build/cjs/init.js.map +0 -1
  381. package/build/cjs/integrations/http.js +0 -69
  382. package/build/cjs/integrations/http.js.map +0 -1
  383. package/build/cjs/integrations/node-fetch.js +0 -24
  384. package/build/cjs/integrations/node-fetch.js.map +0 -1
  385. package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js +0 -15
  386. package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js.map +0 -1
  387. package/build/cjs/integrations/tracing/amqplib/index.js +0 -21
  388. package/build/cjs/integrations/tracing/amqplib/index.js.map +0 -1
  389. package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js +0 -117
  390. package/build/cjs/integrations/tracing/amqplib/vendored/instrumentation.js.map +0 -1
  391. package/build/cjs/integrations/tracing/amqplib/vendored/patches.js +0 -185
  392. package/build/cjs/integrations/tracing/amqplib/vendored/patches.js.map +0 -1
  393. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js +0 -26
  394. package/build/cjs/integrations/tracing/amqplib/vendored/semconv.js.map +0 -1
  395. package/build/cjs/integrations/tracing/amqplib/vendored/types.js +0 -17
  396. package/build/cjs/integrations/tracing/amqplib/vendored/types.js.map +0 -1
  397. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js +0 -129
  398. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +0 -1
  399. package/build/cjs/integrations/tracing/anthropic-ai/index.js +0 -24
  400. package/build/cjs/integrations/tracing/anthropic-ai/index.js.map +0 -1
  401. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js +0 -72
  402. package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js.map +0 -1
  403. package/build/cjs/integrations/tracing/connect/index.js +0 -35
  404. package/build/cjs/integrations/tracing/connect/index.js.map +0 -1
  405. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js +0 -16
  406. package/build/cjs/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +0 -1
  407. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +0 -137
  408. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +0 -1
  409. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js +0 -8
  410. package/build/cjs/integrations/tracing/connect/vendored/internal-types.js.map +0 -1
  411. package/build/cjs/integrations/tracing/connect/vendored/utils.js +0 -36
  412. package/build/cjs/integrations/tracing/connect/vendored/utils.js.map +0 -1
  413. package/build/cjs/integrations/tracing/dataloader/index.js +0 -26
  414. package/build/cjs/integrations/tracing/dataloader/index.js.map +0 -1
  415. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js +0 -227
  416. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +0 -1
  417. package/build/cjs/integrations/tracing/express.js +0 -67
  418. package/build/cjs/integrations/tracing/express.js.map +0 -1
  419. package/build/cjs/integrations/tracing/fastify/index.js +0 -55
  420. package/build/cjs/integrations/tracing/fastify/index.js.map +0 -1
  421. package/build/cjs/integrations/tracing/fastify/v3/constants.js +0 -6
  422. package/build/cjs/integrations/tracing/fastify/v3/constants.js.map +0 -1
  423. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js +0 -24
  424. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +0 -1
  425. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +0 -220
  426. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +0 -1
  427. package/build/cjs/integrations/tracing/fastify/v3/utils.js +0 -64
  428. package/build/cjs/integrations/tracing/fastify/v3/utils.js.map +0 -1
  429. package/build/cjs/integrations/tracing/firebase/firebase.js +0 -21
  430. package/build/cjs/integrations/tracing/firebase/firebase.js.map +0 -1
  431. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js +0 -28
  432. package/build/cjs/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +0 -1
  433. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +0 -155
  434. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +0 -1
  435. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js +0 -141
  436. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +0 -1
  437. package/build/cjs/integrations/tracing/genericPool/index.js +0 -21
  438. package/build/cjs/integrations/tracing/genericPool/index.js.map +0 -1
  439. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +0 -122
  440. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +0 -1
  441. package/build/cjs/integrations/tracing/google-genai/index.js +0 -23
  442. package/build/cjs/integrations/tracing/google-genai/index.js.map +0 -1
  443. package/build/cjs/integrations/tracing/google-genai/instrumentation.js +0 -68
  444. package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +0 -1
  445. package/build/cjs/integrations/tracing/graphql/index.js +0 -34
  446. package/build/cjs/integrations/tracing/graphql/index.js.map +0 -1
  447. package/build/cjs/integrations/tracing/graphql/vendored/enum.js +0 -47
  448. package/build/cjs/integrations/tracing/graphql/vendored/enum.js.map +0 -1
  449. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -15
  450. package/build/cjs/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +0 -1
  451. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +0 -329
  452. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +0 -1
  453. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js +0 -6
  454. package/build/cjs/integrations/tracing/graphql/vendored/internal-types.js.map +0 -1
  455. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js +0 -8
  456. package/build/cjs/integrations/tracing/graphql/vendored/symbols.js.map +0 -1
  457. package/build/cjs/integrations/tracing/graphql/vendored/utils.js +0 -265
  458. package/build/cjs/integrations/tracing/graphql/vendored/utils.js.map +0 -1
  459. package/build/cjs/integrations/tracing/hapi/index.js +0 -60
  460. package/build/cjs/integrations/tracing/hapi/index.js.map +0 -1
  461. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js +0 -11
  462. package/build/cjs/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +0 -1
  463. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +0 -255
  464. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +0 -1
  465. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js +0 -24
  466. package/build/cjs/integrations/tracing/hapi/vendored/internal-types.js.map +0 -1
  467. package/build/cjs/integrations/tracing/hapi/vendored/utils.js +0 -85
  468. package/build/cjs/integrations/tracing/hapi/vendored/utils.js.map +0 -1
  469. package/build/cjs/integrations/tracing/hono/constants.js +0 -14
  470. package/build/cjs/integrations/tracing/hono/constants.js.map +0 -1
  471. package/build/cjs/integrations/tracing/hono/index.js +0 -86
  472. package/build/cjs/integrations/tracing/hono/index.js.map +0 -1
  473. package/build/cjs/integrations/tracing/hono/instrumentation.js +0 -201
  474. package/build/cjs/integrations/tracing/hono/instrumentation.js.map +0 -1
  475. package/build/cjs/integrations/tracing/kafka/index.js +0 -21
  476. package/build/cjs/integrations/tracing/kafka/index.js.map +0 -1
  477. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +0 -237
  478. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +0 -1
  479. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +0 -22
  480. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +0 -1
  481. package/build/cjs/integrations/tracing/kafka/vendored/utils.js +0 -114
  482. package/build/cjs/integrations/tracing/kafka/vendored/utils.js.map +0 -1
  483. package/build/cjs/integrations/tracing/knex/index.js +0 -26
  484. package/build/cjs/integrations/tracing/knex/index.js.map +0 -1
  485. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +0 -135
  486. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +0 -1
  487. package/build/cjs/integrations/tracing/knex/vendored/semconv.js +0 -10
  488. package/build/cjs/integrations/tracing/knex/vendored/semconv.js.map +0 -1
  489. package/build/cjs/integrations/tracing/knex/vendored/utils.js +0 -84
  490. package/build/cjs/integrations/tracing/knex/vendored/utils.js.map +0 -1
  491. package/build/cjs/integrations/tracing/koa/index.js +0 -46
  492. package/build/cjs/integrations/tracing/koa/index.js.map +0 -1
  493. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js +0 -10
  494. package/build/cjs/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +0 -1
  495. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +0 -127
  496. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +0 -1
  497. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js +0 -6
  498. package/build/cjs/integrations/tracing/koa/vendored/internal-types.js.map +0 -1
  499. package/build/cjs/integrations/tracing/koa/vendored/types.js +0 -10
  500. package/build/cjs/integrations/tracing/koa/vendored/types.js.map +0 -1
  501. package/build/cjs/integrations/tracing/koa/vendored/utils.js +0 -36
  502. package/build/cjs/integrations/tracing/koa/vendored/utils.js.map +0 -1
  503. package/build/cjs/integrations/tracing/langchain/index.js +0 -23
  504. package/build/cjs/integrations/tracing/langchain/index.js.map +0 -1
  505. package/build/cjs/integrations/tracing/langchain/instrumentation.js +0 -160
  506. package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +0 -1
  507. package/build/cjs/integrations/tracing/langgraph/index.js +0 -23
  508. package/build/cjs/integrations/tracing/langgraph/index.js.map +0 -1
  509. package/build/cjs/integrations/tracing/langgraph/instrumentation.js +0 -96
  510. package/build/cjs/integrations/tracing/langgraph/instrumentation.js.map +0 -1
  511. package/build/cjs/integrations/tracing/lrumemoizer/index.js +0 -21
  512. package/build/cjs/integrations/tracing/lrumemoizer/index.js.map +0 -1
  513. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js +0 -38
  514. package/build/cjs/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +0 -1
  515. package/build/cjs/integrations/tracing/mongo/index.js +0 -21
  516. package/build/cjs/integrations/tracing/mongo/index.js.map +0 -1
  517. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +0 -129
  518. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +0 -1
  519. package/build/cjs/integrations/tracing/mongo/vendored/patches.js +0 -150
  520. package/build/cjs/integrations/tracing/mongo/vendored/patches.js.map +0 -1
  521. package/build/cjs/integrations/tracing/mongo/vendored/utils.js +0 -40
  522. package/build/cjs/integrations/tracing/mongo/vendored/utils.js.map +0 -1
  523. package/build/cjs/integrations/tracing/mongoose/index.js +0 -22
  524. package/build/cjs/integrations/tracing/mongoose/index.js.map +0 -1
  525. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js +0 -240
  526. package/build/cjs/integrations/tracing/mongoose/vendored/mongoose.js.map +0 -1
  527. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js +0 -41
  528. package/build/cjs/integrations/tracing/mongoose/vendored/utils.js.map +0 -1
  529. package/build/cjs/integrations/tracing/mysql/index.js +0 -21
  530. package/build/cjs/integrations/tracing/mysql/index.js.map +0 -1
  531. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js +0 -185
  532. package/build/cjs/integrations/tracing/mysql/vendored/instrumentation.js.map +0 -1
  533. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js +0 -8
  534. package/build/cjs/integrations/tracing/mysql/vendored/semconv.js.map +0 -1
  535. package/build/cjs/integrations/tracing/mysql/vendored/utils.js +0 -38
  536. package/build/cjs/integrations/tracing/mysql/vendored/utils.js.map +0 -1
  537. package/build/cjs/integrations/tracing/mysql2/index.js +0 -22
  538. package/build/cjs/integrations/tracing/mysql2/index.js.map +0 -1
  539. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +0 -138
  540. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +0 -1
  541. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js +0 -8
  542. package/build/cjs/integrations/tracing/mysql2/vendored/semconv.js.map +0 -1
  543. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js +0 -81
  544. package/build/cjs/integrations/tracing/mysql2/vendored/utils.js.map +0 -1
  545. package/build/cjs/integrations/tracing/openai/index.js +0 -23
  546. package/build/cjs/integrations/tracing/openai/index.js.map +0 -1
  547. package/build/cjs/integrations/tracing/openai/instrumentation.js +0 -80
  548. package/build/cjs/integrations/tracing/openai/instrumentation.js.map +0 -1
  549. package/build/cjs/integrations/tracing/postgres/index.js +0 -27
  550. package/build/cjs/integrations/tracing/postgres/index.js.map +0 -1
  551. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -11
  552. package/build/cjs/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +0 -1
  553. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js +0 -11
  554. package/build/cjs/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +0 -1
  555. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +0 -225
  556. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +0 -1
  557. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js +0 -8
  558. package/build/cjs/integrations/tracing/postgres/vendored/semconv.js.map +0 -1
  559. package/build/cjs/integrations/tracing/postgres/vendored/utils.js +0 -151
  560. package/build/cjs/integrations/tracing/postgres/vendored/utils.js.map +0 -1
  561. package/build/cjs/integrations/tracing/postgresjs.js +0 -265
  562. package/build/cjs/integrations/tracing/postgresjs.js.map +0 -1
  563. package/build/cjs/integrations/tracing/redis/cache.js +0 -41
  564. package/build/cjs/integrations/tracing/redis/cache.js.map +0 -1
  565. package/build/cjs/integrations/tracing/redis/index.js +0 -50
  566. package/build/cjs/integrations/tracing/redis/index.js.map +0 -1
  567. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +0 -147
  568. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +0 -1
  569. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +0 -445
  570. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +0 -1
  571. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +0 -8
  572. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +0 -1
  573. package/build/cjs/integrations/tracing/tedious/index.js +0 -21
  574. package/build/cjs/integrations/tracing/tedious/index.js.map +0 -1
  575. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js +0 -154
  576. package/build/cjs/integrations/tracing/tedious/vendored/instrumentation.js.map +0 -1
  577. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js +0 -8
  578. package/build/cjs/integrations/tracing/tedious/vendored/semconv.js.map +0 -1
  579. package/build/cjs/integrations/tracing/tedious/vendored/utils.js +0 -29
  580. package/build/cjs/integrations/tracing/tedious/vendored/utils.js.map +0 -1
  581. package/build/cjs/integrations/tracing/vercelai/constants.js +0 -6
  582. package/build/cjs/integrations/tracing/vercelai/constants.js.map +0 -1
  583. package/build/cjs/integrations/tracing/vercelai/index.js +0 -36
  584. package/build/cjs/integrations/tracing/vercelai/index.js.map +0 -1
  585. package/build/cjs/integrations/tracing/vercelai/instrumentation.js +0 -179
  586. package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +0 -1
  587. package/build/cjs/preload.js +0 -8
  588. package/build/cjs/preload.js.map +0 -1
  589. package/build/cjs/sdk/diagnosticsChannelInjection.js +0 -21
  590. package/build/cjs/sdk/diagnosticsChannelInjection.js.map +0 -1
  591. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js +0 -33
  592. package/build/cjs/sdk/experimentalUseDiagnosticsChannelInjection.js.map +0 -1
  593. package/build/cjs/utils/redisCache.js +0 -98
  594. package/build/cjs/utils/redisCache.js.map +0 -1
  595. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js +0 -21
  596. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js.map +0 -1
  597. package/build/esm/init.js +0 -4
  598. package/build/esm/init.js.map +0 -1
  599. package/build/esm/integrations/http.js +0 -66
  600. package/build/esm/integrations/http.js.map +0 -1
  601. package/build/esm/integrations/node-fetch.js +0 -22
  602. package/build/esm/integrations/node-fetch.js.map +0 -1
  603. package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js +0 -13
  604. package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js.map +0 -1
  605. package/build/esm/integrations/tracing/amqplib/index.js +0 -18
  606. package/build/esm/integrations/tracing/amqplib/index.js.map +0 -1
  607. package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js +0 -115
  608. package/build/esm/integrations/tracing/amqplib/vendored/instrumentation.js.map +0 -1
  609. package/build/esm/integrations/tracing/amqplib/vendored/patches.js +0 -177
  610. package/build/esm/integrations/tracing/amqplib/vendored/patches.js.map +0 -1
  611. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js +0 -14
  612. package/build/esm/integrations/tracing/amqplib/vendored/semconv.js.map +0 -1
  613. package/build/esm/integrations/tracing/amqplib/vendored/types.js +0 -15
  614. package/build/esm/integrations/tracing/amqplib/vendored/types.js.map +0 -1
  615. package/build/esm/integrations/tracing/amqplib/vendored/utils.js +0 -117
  616. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +0 -1
  617. package/build/esm/integrations/tracing/anthropic-ai/index.js +0 -21
  618. package/build/esm/integrations/tracing/anthropic-ai/index.js.map +0 -1
  619. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js +0 -70
  620. package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js.map +0 -1
  621. package/build/esm/integrations/tracing/connect/index.js +0 -31
  622. package/build/esm/integrations/tracing/connect/index.js.map +0 -1
  623. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js +0 -13
  624. package/build/esm/integrations/tracing/connect/vendored/enums/AttributeNames.js.map +0 -1
  625. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +0 -135
  626. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +0 -1
  627. package/build/esm/integrations/tracing/connect/vendored/internal-types.js +0 -6
  628. package/build/esm/integrations/tracing/connect/vendored/internal-types.js.map +0 -1
  629. package/build/esm/integrations/tracing/connect/vendored/utils.js +0 -32
  630. package/build/esm/integrations/tracing/connect/vendored/utils.js.map +0 -1
  631. package/build/esm/integrations/tracing/dataloader/index.js +0 -23
  632. package/build/esm/integrations/tracing/dataloader/index.js.map +0 -1
  633. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js +0 -225
  634. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +0 -1
  635. package/build/esm/integrations/tracing/express.js +0 -62
  636. package/build/esm/integrations/tracing/express.js.map +0 -1
  637. package/build/esm/integrations/tracing/fastify/index.js +0 -51
  638. package/build/esm/integrations/tracing/fastify/index.js.map +0 -1
  639. package/build/esm/integrations/tracing/fastify/v3/constants.js +0 -4
  640. package/build/esm/integrations/tracing/fastify/v3/constants.js.map +0 -1
  641. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js +0 -20
  642. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +0 -1
  643. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +0 -218
  644. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +0 -1
  645. package/build/esm/integrations/tracing/fastify/v3/utils.js +0 -60
  646. package/build/esm/integrations/tracing/fastify/v3/utils.js.map +0 -1
  647. package/build/esm/integrations/tracing/firebase/firebase.js +0 -18
  648. package/build/esm/integrations/tracing/firebase/firebase.js.map +0 -1
  649. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js +0 -26
  650. package/build/esm/integrations/tracing/firebase/otel/firebaseInstrumentation.js.map +0 -1
  651. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +0 -152
  652. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +0 -1
  653. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +0 -138
  654. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +0 -1
  655. package/build/esm/integrations/tracing/genericPool/index.js +0 -18
  656. package/build/esm/integrations/tracing/genericPool/index.js.map +0 -1
  657. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +0 -120
  658. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +0 -1
  659. package/build/esm/integrations/tracing/google-genai/index.js +0 -20
  660. package/build/esm/integrations/tracing/google-genai/index.js.map +0 -1
  661. package/build/esm/integrations/tracing/google-genai/instrumentation.js +0 -66
  662. package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +0 -1
  663. package/build/esm/integrations/tracing/graphql/index.js +0 -31
  664. package/build/esm/integrations/tracing/graphql/index.js.map +0 -1
  665. package/build/esm/integrations/tracing/graphql/vendored/enum.js +0 -43
  666. package/build/esm/integrations/tracing/graphql/vendored/enum.js.map +0 -1
  667. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js +0 -13
  668. package/build/esm/integrations/tracing/graphql/vendored/enums/AttributeNames.js.map +0 -1
  669. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +0 -327
  670. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +0 -1
  671. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js +0 -4
  672. package/build/esm/integrations/tracing/graphql/vendored/internal-types.js.map +0 -1
  673. package/build/esm/integrations/tracing/graphql/vendored/symbols.js +0 -5
  674. package/build/esm/integrations/tracing/graphql/vendored/symbols.js.map +0 -1
  675. package/build/esm/integrations/tracing/graphql/vendored/utils.js +0 -257
  676. package/build/esm/integrations/tracing/graphql/vendored/utils.js.map +0 -1
  677. package/build/esm/integrations/tracing/hapi/index.js +0 -55
  678. package/build/esm/integrations/tracing/hapi/index.js.map +0 -1
  679. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js +0 -9
  680. package/build/esm/integrations/tracing/hapi/vendored/enums/AttributeNames.js.map +0 -1
  681. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +0 -253
  682. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +0 -1
  683. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js +0 -19
  684. package/build/esm/integrations/tracing/hapi/vendored/internal-types.js.map +0 -1
  685. package/build/esm/integrations/tracing/hapi/vendored/utils.js +0 -76
  686. package/build/esm/integrations/tracing/hapi/vendored/utils.js.map +0 -1
  687. package/build/esm/integrations/tracing/hono/constants.js +0 -11
  688. package/build/esm/integrations/tracing/hono/constants.js.map +0 -1
  689. package/build/esm/integrations/tracing/hono/index.js +0 -82
  690. package/build/esm/integrations/tracing/hono/index.js.map +0 -1
  691. package/build/esm/integrations/tracing/hono/instrumentation.js +0 -199
  692. package/build/esm/integrations/tracing/hono/instrumentation.js.map +0 -1
  693. package/build/esm/integrations/tracing/kafka/index.js +0 -18
  694. package/build/esm/integrations/tracing/kafka/index.js.map +0 -1
  695. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +0 -235
  696. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +0 -1
  697. package/build/esm/integrations/tracing/kafka/vendored/semconv.js +0 -12
  698. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +0 -1
  699. package/build/esm/integrations/tracing/kafka/vendored/utils.js +0 -108
  700. package/build/esm/integrations/tracing/kafka/vendored/utils.js.map +0 -1
  701. package/build/esm/integrations/tracing/knex/index.js +0 -23
  702. package/build/esm/integrations/tracing/knex/index.js.map +0 -1
  703. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +0 -133
  704. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +0 -1
  705. package/build/esm/integrations/tracing/knex/vendored/semconv.js +0 -6
  706. package/build/esm/integrations/tracing/knex/vendored/semconv.js.map +0 -1
  707. package/build/esm/integrations/tracing/knex/vendored/utils.js +0 -75
  708. package/build/esm/integrations/tracing/knex/vendored/utils.js.map +0 -1
  709. package/build/esm/integrations/tracing/koa/index.js +0 -42
  710. package/build/esm/integrations/tracing/koa/index.js.map +0 -1
  711. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js +0 -8
  712. package/build/esm/integrations/tracing/koa/vendored/enums/AttributeNames.js.map +0 -1
  713. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +0 -125
  714. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +0 -1
  715. package/build/esm/integrations/tracing/koa/vendored/internal-types.js +0 -4
  716. package/build/esm/integrations/tracing/koa/vendored/internal-types.js.map +0 -1
  717. package/build/esm/integrations/tracing/koa/vendored/types.js +0 -8
  718. package/build/esm/integrations/tracing/koa/vendored/types.js.map +0 -1
  719. package/build/esm/integrations/tracing/koa/vendored/utils.js +0 -33
  720. package/build/esm/integrations/tracing/koa/vendored/utils.js.map +0 -1
  721. package/build/esm/integrations/tracing/langchain/index.js +0 -20
  722. package/build/esm/integrations/tracing/langchain/index.js.map +0 -1
  723. package/build/esm/integrations/tracing/langchain/instrumentation.js +0 -158
  724. package/build/esm/integrations/tracing/langchain/instrumentation.js.map +0 -1
  725. package/build/esm/integrations/tracing/langgraph/index.js +0 -20
  726. package/build/esm/integrations/tracing/langgraph/index.js.map +0 -1
  727. package/build/esm/integrations/tracing/langgraph/instrumentation.js +0 -94
  728. package/build/esm/integrations/tracing/langgraph/instrumentation.js.map +0 -1
  729. package/build/esm/integrations/tracing/lrumemoizer/index.js +0 -18
  730. package/build/esm/integrations/tracing/lrumemoizer/index.js.map +0 -1
  731. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js +0 -36
  732. package/build/esm/integrations/tracing/lrumemoizer/vendored/instrumentation.js.map +0 -1
  733. package/build/esm/integrations/tracing/mongo/index.js +0 -18
  734. package/build/esm/integrations/tracing/mongo/index.js.map +0 -1
  735. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +0 -127
  736. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +0 -1
  737. package/build/esm/integrations/tracing/mongo/vendored/patches.js +0 -142
  738. package/build/esm/integrations/tracing/mongo/vendored/patches.js.map +0 -1
  739. package/build/esm/integrations/tracing/mongo/vendored/utils.js +0 -34
  740. package/build/esm/integrations/tracing/mongo/vendored/utils.js.map +0 -1
  741. package/build/esm/integrations/tracing/mongoose/index.js +0 -19
  742. package/build/esm/integrations/tracing/mongoose/index.js.map +0 -1
  743. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js +0 -236
  744. package/build/esm/integrations/tracing/mongoose/vendored/mongoose.js.map +0 -1
  745. package/build/esm/integrations/tracing/mongoose/vendored/utils.js +0 -38
  746. package/build/esm/integrations/tracing/mongoose/vendored/utils.js.map +0 -1
  747. package/build/esm/integrations/tracing/mysql/index.js +0 -18
  748. package/build/esm/integrations/tracing/mysql/index.js.map +0 -1
  749. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js +0 -183
  750. package/build/esm/integrations/tracing/mysql/vendored/instrumentation.js.map +0 -1
  751. package/build/esm/integrations/tracing/mysql/vendored/semconv.js +0 -5
  752. package/build/esm/integrations/tracing/mysql/vendored/semconv.js.map +0 -1
  753. package/build/esm/integrations/tracing/mysql/vendored/utils.js +0 -33
  754. package/build/esm/integrations/tracing/mysql/vendored/utils.js.map +0 -1
  755. package/build/esm/integrations/tracing/mysql2/index.js +0 -19
  756. package/build/esm/integrations/tracing/mysql2/index.js.map +0 -1
  757. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +0 -136
  758. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +0 -1
  759. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js +0 -5
  760. package/build/esm/integrations/tracing/mysql2/vendored/semconv.js.map +0 -1
  761. package/build/esm/integrations/tracing/mysql2/vendored/utils.js +0 -75
  762. package/build/esm/integrations/tracing/mysql2/vendored/utils.js.map +0 -1
  763. package/build/esm/integrations/tracing/openai/index.js +0 -20
  764. package/build/esm/integrations/tracing/openai/index.js.map +0 -1
  765. package/build/esm/integrations/tracing/openai/instrumentation.js +0 -78
  766. package/build/esm/integrations/tracing/openai/instrumentation.js.map +0 -1
  767. package/build/esm/integrations/tracing/postgres/index.js +0 -24
  768. package/build/esm/integrations/tracing/postgres/index.js.map +0 -1
  769. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js +0 -9
  770. package/build/esm/integrations/tracing/postgres/vendored/enums/AttributeNames.js.map +0 -1
  771. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js +0 -9
  772. package/build/esm/integrations/tracing/postgres/vendored/enums/SpanNames.js.map +0 -1
  773. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +0 -223
  774. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +0 -1
  775. package/build/esm/integrations/tracing/postgres/vendored/semconv.js +0 -5
  776. package/build/esm/integrations/tracing/postgres/vendored/semconv.js.map +0 -1
  777. package/build/esm/integrations/tracing/postgres/vendored/utils.js +0 -136
  778. package/build/esm/integrations/tracing/postgres/vendored/utils.js.map +0 -1
  779. package/build/esm/integrations/tracing/postgresjs.js +0 -261
  780. package/build/esm/integrations/tracing/postgresjs.js.map +0 -1
  781. package/build/esm/integrations/tracing/redis/cache.js +0 -38
  782. package/build/esm/integrations/tracing/redis/cache.js.map +0 -1
  783. package/build/esm/integrations/tracing/redis/index.js +0 -43
  784. package/build/esm/integrations/tracing/redis/index.js.map +0 -1
  785. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +0 -145
  786. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +0 -1
  787. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +0 -443
  788. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +0 -1
  789. package/build/esm/integrations/tracing/redis/vendored/semconv.js +0 -5
  790. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +0 -1
  791. package/build/esm/integrations/tracing/tedious/index.js +0 -18
  792. package/build/esm/integrations/tracing/tedious/index.js.map +0 -1
  793. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js +0 -152
  794. package/build/esm/integrations/tracing/tedious/vendored/instrumentation.js.map +0 -1
  795. package/build/esm/integrations/tracing/tedious/vendored/semconv.js +0 -5
  796. package/build/esm/integrations/tracing/tedious/vendored/semconv.js.map +0 -1
  797. package/build/esm/integrations/tracing/tedious/vendored/utils.js +0 -26
  798. package/build/esm/integrations/tracing/tedious/vendored/utils.js.map +0 -1
  799. package/build/esm/integrations/tracing/vercelai/constants.js +0 -4
  800. package/build/esm/integrations/tracing/vercelai/constants.js.map +0 -1
  801. package/build/esm/integrations/tracing/vercelai/index.js +0 -33
  802. package/build/esm/integrations/tracing/vercelai/index.js.map +0 -1
  803. package/build/esm/integrations/tracing/vercelai/instrumentation.js +0 -174
  804. package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +0 -1
  805. package/build/esm/preload.js +0 -8
  806. package/build/esm/preload.js.map +0 -1
  807. package/build/esm/sdk/diagnosticsChannelInjection.js +0 -17
  808. package/build/esm/sdk/diagnosticsChannelInjection.js.map +0 -1
  809. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js +0 -30
  810. package/build/esm/sdk/experimentalUseDiagnosticsChannelInjection.js.map +0 -1
  811. package/build/esm/utils/redisCache.js +0 -89
  812. package/build/esm/utils/redisCache.js.map +0 -1
  813. package/build/esm/utils/setHttpServerSpanRouteAttribute.js +0 -19
  814. package/build/esm/utils/setHttpServerSpanRouteAttribute.js.map +0 -1
  815. package/build/loader-hook.mjs +0 -1
  816. package/build/types/init.d.ts +0 -2
  817. package/build/types/init.d.ts.map +0 -1
  818. package/build/types/integrations/http.d.ts +0 -131
  819. package/build/types/integrations/http.d.ts.map +0 -1
  820. package/build/types/integrations/node-fetch.d.ts +0 -9
  821. package/build/types/integrations/node-fetch.d.ts.map +0 -1
  822. package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts +0 -9
  823. package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts.map +0 -1
  824. package/build/types/integrations/tracing/amqplib/index.d.ts +0 -22
  825. package/build/types/integrations/tracing/amqplib/index.d.ts.map +0 -1
  826. package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +0 -44
  827. package/build/types/integrations/tracing/amqplib/vendored/amqplib-types.d.ts.map +0 -1
  828. package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts +0 -11
  829. package/build/types/integrations/tracing/amqplib/vendored/instrumentation.d.ts.map +0 -1
  830. package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts +0 -11
  831. package/build/types/integrations/tracing/amqplib/vendored/patches.d.ts.map +0 -1
  832. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts +0 -23
  833. package/build/types/integrations/tracing/amqplib/vendored/semconv.d.ts.map +0 -1
  834. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts +0 -49
  835. package/build/types/integrations/tracing/amqplib/vendored/types.d.ts.map +0 -1
  836. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts +0 -42
  837. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +0 -1
  838. package/build/types/integrations/tracing/anthropic-ai/index.d.ts +0 -62
  839. package/build/types/integrations/tracing/anthropic-ai/index.d.ts.map +0 -1
  840. package/build/types/integrations/tracing/anthropic-ai/instrumentation.d.ts +0 -19
  841. package/build/types/integrations/tracing/anthropic-ai/instrumentation.d.ts.map +0 -1
  842. package/build/types/integrations/tracing/connect/index.d.ts +0 -48
  843. package/build/types/integrations/tracing/connect/index.d.ts.map +0 -1
  844. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -9
  845. package/build/types/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts.map +0 -1
  846. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts +0 -18
  847. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +0 -1
  848. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts +0 -31
  849. package/build/types/integrations/tracing/connect/vendored/internal-types.d.ts.map +0 -1
  850. package/build/types/integrations/tracing/connect/vendored/utils.d.ts +0 -5
  851. package/build/types/integrations/tracing/connect/vendored/utils.d.ts.map +0 -1
  852. package/build/types/integrations/tracing/dataloader/index.d.ts +0 -22
  853. package/build/types/integrations/tracing/dataloader/index.d.ts.map +0 -1
  854. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts +0 -18
  855. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +0 -1
  856. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts +0 -22
  857. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +0 -1
  858. package/build/types/integrations/tracing/express.d.ts +0 -19
  859. package/build/types/integrations/tracing/express.d.ts.map +0 -1
  860. package/build/types/integrations/tracing/fastify/index.d.ts +0 -124
  861. package/build/types/integrations/tracing/fastify/index.d.ts.map +0 -1
  862. package/build/types/integrations/tracing/fastify/types.d.ts +0 -33
  863. package/build/types/integrations/tracing/fastify/types.d.ts.map +0 -1
  864. package/build/types/integrations/tracing/fastify/v3/constants.d.ts +0 -3
  865. package/build/types/integrations/tracing/fastify/v3/constants.d.ts.map +0 -1
  866. package/build/types/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts +0 -15
  867. package/build/types/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts.map +0 -1
  868. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts +0 -16
  869. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +0 -1
  870. package/build/types/integrations/tracing/fastify/v3/internal-types.d.ts +0 -7
  871. package/build/types/integrations/tracing/fastify/v3/internal-types.d.ts.map +0 -1
  872. package/build/types/integrations/tracing/fastify/v3/types.d.ts +0 -21
  873. package/build/types/integrations/tracing/fastify/v3/types.d.ts.map +0 -1
  874. package/build/types/integrations/tracing/fastify/v3/utils.d.ts +0 -28
  875. package/build/types/integrations/tracing/fastify/v3/utils.d.ts.map +0 -1
  876. package/build/types/integrations/tracing/firebase/firebase.d.ts +0 -8
  877. package/build/types/integrations/tracing/firebase/firebase.d.ts.map +0 -1
  878. package/build/types/integrations/tracing/firebase/index.d.ts +0 -2
  879. package/build/types/integrations/tracing/firebase/index.d.ts.map +0 -1
  880. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +0 -14
  881. package/build/types/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts.map +0 -1
  882. package/build/types/integrations/tracing/firebase/otel/index.d.ts +0 -3
  883. package/build/types/integrations/tracing/firebase/otel/index.d.ts.map +0 -1
  884. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts +0 -22
  885. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts.map +0 -1
  886. package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts +0 -18
  887. package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts.map +0 -1
  888. package/build/types/integrations/tracing/firebase/otel/types.d.ts +0 -100
  889. package/build/types/integrations/tracing/firebase/otel/types.d.ts.map +0 -1
  890. package/build/types/integrations/tracing/genericPool/index.d.ts +0 -22
  891. package/build/types/integrations/tracing/genericPool/index.d.ts.map +0 -1
  892. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +0 -5
  893. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts.map +0 -1
  894. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts +0 -11
  895. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +0 -1
  896. package/build/types/integrations/tracing/google-genai/index.d.ts +0 -62
  897. package/build/types/integrations/tracing/google-genai/index.d.ts.map +0 -1
  898. package/build/types/integrations/tracing/google-genai/instrumentation.d.ts +0 -20
  899. package/build/types/integrations/tracing/google-genai/instrumentation.d.ts.map +0 -1
  900. package/build/types/integrations/tracing/graphql/index.d.ts +0 -50
  901. package/build/types/integrations/tracing/graphql/index.d.ts.map +0 -1
  902. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts +0 -38
  903. package/build/types/integrations/tracing/graphql/vendored/enum.d.ts.map +0 -1
  904. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +0 -10
  905. package/build/types/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts.map +0 -1
  906. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts +0 -2
  907. package/build/types/integrations/tracing/graphql/vendored/graphql-types.d.ts.map +0 -1
  908. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts +0 -25
  909. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +0 -1
  910. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts +0 -63
  911. package/build/types/integrations/tracing/graphql/vendored/internal-types.d.ts.map +0 -1
  912. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts +0 -3
  913. package/build/types/integrations/tracing/graphql/vendored/symbols.d.ts.map +0 -1
  914. package/build/types/integrations/tracing/graphql/vendored/types.d.ts +0 -33
  915. package/build/types/integrations/tracing/graphql/vendored/types.d.ts.map +0 -1
  916. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts +0 -14
  917. package/build/types/integrations/tracing/graphql/vendored/utils.d.ts.map +0 -1
  918. package/build/types/integrations/tracing/hapi/index.d.ts +0 -52
  919. package/build/types/integrations/tracing/hapi/index.d.ts.map +0 -1
  920. package/build/types/integrations/tracing/hapi/types.d.ts +0 -166
  921. package/build/types/integrations/tracing/hapi/types.d.ts.map +0 -1
  922. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +0 -6
  923. package/build/types/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts.map +0 -1
  924. package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts +0 -70
  925. package/build/types/integrations/tracing/hapi/vendored/hapi-types.d.ts.map +0 -1
  926. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts +0 -72
  927. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +0 -1
  928. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts +0 -32
  929. package/build/types/integrations/tracing/hapi/vendored/internal-types.d.ts.map +0 -1
  930. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts +0 -18
  931. package/build/types/integrations/tracing/hapi/vendored/utils.d.ts.map +0 -1
  932. package/build/types/integrations/tracing/hono/constants.d.ts +0 -11
  933. package/build/types/integrations/tracing/hono/constants.d.ts.map +0 -1
  934. package/build/types/integrations/tracing/hono/index.d.ts +0 -60
  935. package/build/types/integrations/tracing/hono/index.d.ts.map +0 -1
  936. package/build/types/integrations/tracing/hono/instrumentation.d.ts +0 -55
  937. package/build/types/integrations/tracing/hono/instrumentation.d.ts.map +0 -1
  938. package/build/types/integrations/tracing/hono/types.d.ts +0 -36
  939. package/build/types/integrations/tracing/hono/types.d.ts.map +0 -1
  940. package/build/types/integrations/tracing/kafka/index.d.ts +0 -21
  941. package/build/types/integrations/tracing/kafka/index.d.ts.map +0 -1
  942. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +0 -15
  943. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +0 -1
  944. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -79
  945. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +0 -1
  946. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +0 -54
  947. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +0 -1
  948. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts +0 -29
  949. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts.map +0 -1
  950. package/build/types/integrations/tracing/knex/index.d.ts +0 -22
  951. package/build/types/integrations/tracing/knex/index.d.ts.map +0 -1
  952. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts +0 -12
  953. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +0 -1
  954. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts +0 -7
  955. package/build/types/integrations/tracing/knex/vendored/semconv.d.ts.map +0 -1
  956. package/build/types/integrations/tracing/knex/vendored/utils.d.ts +0 -9
  957. package/build/types/integrations/tracing/knex/vendored/utils.d.ts.map +0 -1
  958. package/build/types/integrations/tracing/koa/index.d.ts +0 -72
  959. package/build/types/integrations/tracing/koa/index.d.ts.map +0 -1
  960. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +0 -5
  961. package/build/types/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts.map +0 -1
  962. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts +0 -32
  963. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +0 -1
  964. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts +0 -34
  965. package/build/types/integrations/tracing/koa/vendored/internal-types.d.ts.map +0 -1
  966. package/build/types/integrations/tracing/koa/vendored/types.d.ts +0 -13
  967. package/build/types/integrations/tracing/koa/vendored/types.d.ts.map +0 -1
  968. package/build/types/integrations/tracing/koa/vendored/utils.d.ts +0 -15
  969. package/build/types/integrations/tracing/koa/vendored/utils.d.ts.map +0 -1
  970. package/build/types/integrations/tracing/langchain/index.d.ts +0 -101
  971. package/build/types/integrations/tracing/langchain/index.d.ts.map +0 -1
  972. package/build/types/integrations/tracing/langchain/instrumentation.d.ts +0 -38
  973. package/build/types/integrations/tracing/langchain/instrumentation.d.ts.map +0 -1
  974. package/build/types/integrations/tracing/langgraph/index.d.ts +0 -77
  975. package/build/types/integrations/tracing/langgraph/index.d.ts.map +0 -1
  976. package/build/types/integrations/tracing/langgraph/instrumentation.d.ts +0 -19
  977. package/build/types/integrations/tracing/langgraph/instrumentation.d.ts.map +0 -1
  978. package/build/types/integrations/tracing/lrumemoizer/index.d.ts +0 -21
  979. package/build/types/integrations/tracing/lrumemoizer/index.d.ts.map +0 -1
  980. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +0 -6
  981. package/build/types/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts.map +0 -1
  982. package/build/types/integrations/tracing/mongo/index.d.ts +0 -22
  983. package/build/types/integrations/tracing/mongo/index.d.ts.map +0 -1
  984. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts +0 -11
  985. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +0 -1
  986. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -62
  987. package/build/types/integrations/tracing/mongo/vendored/internal-types.d.ts.map +0 -1
  988. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts +0 -15
  989. package/build/types/integrations/tracing/mongo/vendored/patches.d.ts.map +0 -1
  990. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts +0 -15
  991. package/build/types/integrations/tracing/mongo/vendored/utils.d.ts.map +0 -1
  992. package/build/types/integrations/tracing/mongoose/index.d.ts +0 -22
  993. package/build/types/integrations/tracing/mongoose/index.d.ts.map +0 -1
  994. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +0 -33
  995. package/build/types/integrations/tracing/mongoose/vendored/mongoose-types.d.ts.map +0 -1
  996. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts +0 -18
  997. package/build/types/integrations/tracing/mongoose/vendored/mongoose.d.ts.map +0 -1
  998. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts +0 -4
  999. package/build/types/integrations/tracing/mongoose/vendored/utils.d.ts.map +0 -1
  1000. package/build/types/integrations/tracing/mysql/index.d.ts +0 -22
  1001. package/build/types/integrations/tracing/mysql/index.d.ts.map +0 -1
  1002. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts +0 -14
  1003. package/build/types/integrations/tracing/mysql/vendored/instrumentation.d.ts.map +0 -1
  1004. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts +0 -78
  1005. package/build/types/integrations/tracing/mysql/vendored/mysql-types.d.ts.map +0 -1
  1006. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts +0 -19
  1007. package/build/types/integrations/tracing/mysql/vendored/semconv.d.ts.map +0 -1
  1008. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts +0 -22
  1009. package/build/types/integrations/tracing/mysql/vendored/utils.d.ts.map +0 -1
  1010. package/build/types/integrations/tracing/mysql2/index.d.ts +0 -22
  1011. package/build/types/integrations/tracing/mysql2/index.d.ts.map +0 -1
  1012. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts +0 -9
  1013. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +0 -1
  1014. package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +0 -39
  1015. package/build/types/integrations/tracing/mysql2/vendored/mysql2-types.d.ts.map +0 -1
  1016. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts +0 -3
  1017. package/build/types/integrations/tracing/mysql2/vendored/semconv.d.ts.map +0 -1
  1018. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts +0 -25
  1019. package/build/types/integrations/tracing/mysql2/vendored/utils.d.ts.map +0 -1
  1020. package/build/types/integrations/tracing/openai/index.d.ts +0 -62
  1021. package/build/types/integrations/tracing/openai/index.d.ts.map +0 -1
  1022. package/build/types/integrations/tracing/openai/instrumentation.d.ts +0 -26
  1023. package/build/types/integrations/tracing/openai/instrumentation.d.ts.map +0 -1
  1024. package/build/types/integrations/tracing/postgres/index.d.ts +0 -26
  1025. package/build/types/integrations/tracing/postgres/index.d.ts.map +0 -1
  1026. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -6
  1027. package/build/types/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts.map +0 -1
  1028. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +0 -6
  1029. package/build/types/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts.map +0 -1
  1030. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts +0 -12
  1031. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +0 -1
  1032. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -33
  1033. package/build/types/integrations/tracing/postgres/vendored/internal-types.d.ts.map +0 -1
  1034. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +0 -20
  1035. package/build/types/integrations/tracing/postgres/vendored/pg-pool-types.d.ts.map +0 -1
  1036. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts +0 -54
  1037. package/build/types/integrations/tracing/postgres/vendored/pg-types.d.ts.map +0 -1
  1038. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts +0 -13
  1039. package/build/types/integrations/tracing/postgres/vendored/semconv.d.ts.map +0 -1
  1040. package/build/types/integrations/tracing/postgres/vendored/types.d.ts +0 -11
  1041. package/build/types/integrations/tracing/postgres/vendored/types.d.ts.map +0 -1
  1042. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts +0 -56
  1043. package/build/types/integrations/tracing/postgres/vendored/utils.d.ts.map +0 -1
  1044. package/build/types/integrations/tracing/postgresjs.d.ts +0 -103
  1045. package/build/types/integrations/tracing/postgresjs.d.ts.map +0 -1
  1046. package/build/types/integrations/tracing/redis/cache.d.ts +0 -22
  1047. package/build/types/integrations/tracing/redis/cache.d.ts.map +0 -1
  1048. package/build/types/integrations/tracing/redis/index.d.ts +0 -28
  1049. package/build/types/integrations/tracing/redis/index.d.ts.map +0 -1
  1050. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +0 -10
  1051. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +0 -1
  1052. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +0 -16
  1053. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +0 -1
  1054. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts +0 -4
  1055. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +0 -1
  1056. package/build/types/integrations/tracing/redis/vendored/types.d.ts +0 -24
  1057. package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +0 -1
  1058. package/build/types/integrations/tracing/tedious/index.d.ts +0 -22
  1059. package/build/types/integrations/tracing/tedious/index.d.ts.map +0 -1
  1060. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts +0 -11
  1061. package/build/types/integrations/tracing/tedious/vendored/instrumentation.d.ts.map +0 -1
  1062. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts +0 -19
  1063. package/build/types/integrations/tracing/tedious/vendored/semconv.d.ts.map +0 -1
  1064. package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts +0 -21
  1065. package/build/types/integrations/tracing/tedious/vendored/tedious-types.d.ts.map +0 -1
  1066. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts +0 -9
  1067. package/build/types/integrations/tracing/tedious/vendored/utils.d.ts.map +0 -1
  1068. package/build/types/integrations/tracing/vercelai/constants.d.ts +0 -2
  1069. package/build/types/integrations/tracing/vercelai/constants.d.ts.map +0 -1
  1070. package/build/types/integrations/tracing/vercelai/index.d.ts +0 -44
  1071. package/build/types/integrations/tracing/vercelai/index.d.ts.map +0 -1
  1072. package/build/types/integrations/tracing/vercelai/instrumentation.d.ts +0 -56
  1073. package/build/types/integrations/tracing/vercelai/instrumentation.d.ts.map +0 -1
  1074. package/build/types/integrations/tracing/vercelai/types.d.ts +0 -50
  1075. package/build/types/integrations/tracing/vercelai/types.d.ts.map +0 -1
  1076. package/build/types/preload.d.ts +0 -2
  1077. package/build/types/preload.d.ts.map +0 -1
  1078. package/build/types/sdk/diagnosticsChannelInjection.d.ts +0 -41
  1079. package/build/types/sdk/diagnosticsChannelInjection.d.ts.map +0 -1
  1080. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +0 -37
  1081. package/build/types/sdk/experimentalUseDiagnosticsChannelInjection.d.ts.map +0 -1
  1082. package/build/types/utils/redisCache.d.ts +0 -17
  1083. package/build/types/utils/redisCache.d.ts.map +0 -1
  1084. package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts +0 -9
  1085. package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts.map +0 -1
  1086. package/build/types-ts3.8/debug-build.d.ts +0 -7
  1087. package/build/types-ts3.8/index.d.ts +0 -44
  1088. package/build/types-ts3.8/init.d.ts +0 -2
  1089. package/build/types-ts3.8/integrations/featureFlagShims/growthbook.d.ts +0 -6
  1090. package/build/types-ts3.8/integrations/featureFlagShims/index.d.ts +0 -6
  1091. package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +0 -12
  1092. package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +0 -25
  1093. package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +0 -8
  1094. package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +0 -8
  1095. package/build/types-ts3.8/integrations/fs/index.d.ts +0 -14
  1096. package/build/types-ts3.8/integrations/fs/vendored/constants.d.ts +0 -5
  1097. package/build/types-ts3.8/integrations/fs/vendored/instrumentation.d.ts +0 -3
  1098. package/build/types-ts3.8/integrations/fs/vendored/types.d.ts +0 -23
  1099. package/build/types-ts3.8/integrations/fs/vendored/utils.d.ts +0 -15
  1100. package/build/types-ts3.8/integrations/http.d.ts +0 -134
  1101. package/build/types-ts3.8/integrations/node-fetch.d.ts +0 -9
  1102. package/build/types-ts3.8/integrations/tracing/InstrumentationNodeModuleFile.d.ts +0 -9
  1103. package/build/types-ts3.8/integrations/tracing/amqplib/index.d.ts +0 -22
  1104. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/amqplib-types.d.ts +0 -44
  1105. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/instrumentation.d.ts +0 -11
  1106. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/patches.d.ts +0 -11
  1107. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/semconv.d.ts +0 -23
  1108. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/types.d.ts +0 -49
  1109. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/utils.d.ts +0 -42
  1110. package/build/types-ts3.8/integrations/tracing/anthropic-ai/index.d.ts +0 -62
  1111. package/build/types-ts3.8/integrations/tracing/anthropic-ai/instrumentation.d.ts +0 -19
  1112. package/build/types-ts3.8/integrations/tracing/connect/index.d.ts +0 -48
  1113. package/build/types-ts3.8/integrations/tracing/connect/vendored/enums/AttributeNames.d.ts +0 -9
  1114. package/build/types-ts3.8/integrations/tracing/connect/vendored/instrumentation.d.ts +0 -18
  1115. package/build/types-ts3.8/integrations/tracing/connect/vendored/internal-types.d.ts +0 -36
  1116. package/build/types-ts3.8/integrations/tracing/connect/vendored/utils.d.ts +0 -5
  1117. package/build/types-ts3.8/integrations/tracing/dataloader/index.d.ts +0 -22
  1118. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/instrumentation.d.ts +0 -18
  1119. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/types.d.ts +0 -22
  1120. package/build/types-ts3.8/integrations/tracing/express.d.ts +0 -19
  1121. package/build/types-ts3.8/integrations/tracing/fastify/index.d.ts +0 -124
  1122. package/build/types-ts3.8/integrations/tracing/fastify/types.d.ts +0 -33
  1123. package/build/types-ts3.8/integrations/tracing/fastify/v3/constants.d.ts +0 -3
  1124. package/build/types-ts3.8/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts +0 -15
  1125. package/build/types-ts3.8/integrations/tracing/fastify/v3/instrumentation.d.ts +0 -16
  1126. package/build/types-ts3.8/integrations/tracing/fastify/v3/internal-types.d.ts +0 -7
  1127. package/build/types-ts3.8/integrations/tracing/fastify/v3/types.d.ts +0 -21
  1128. package/build/types-ts3.8/integrations/tracing/fastify/v3/utils.d.ts +0 -28
  1129. package/build/types-ts3.8/integrations/tracing/firebase/firebase.d.ts +0 -8
  1130. package/build/types-ts3.8/integrations/tracing/firebase/index.d.ts +0 -2
  1131. package/build/types-ts3.8/integrations/tracing/firebase/otel/firebaseInstrumentation.d.ts +0 -14
  1132. package/build/types-ts3.8/integrations/tracing/firebase/otel/index.d.ts +0 -3
  1133. package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/firestore.d.ts +0 -22
  1134. package/build/types-ts3.8/integrations/tracing/firebase/otel/patches/functions.d.ts +0 -18
  1135. package/build/types-ts3.8/integrations/tracing/firebase/otel/types.d.ts +0 -100
  1136. package/build/types-ts3.8/integrations/tracing/genericPool/index.d.ts +0 -22
  1137. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +0 -5
  1138. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/instrumentation.d.ts +0 -11
  1139. package/build/types-ts3.8/integrations/tracing/google-genai/index.d.ts +0 -62
  1140. package/build/types-ts3.8/integrations/tracing/google-genai/instrumentation.d.ts +0 -20
  1141. package/build/types-ts3.8/integrations/tracing/graphql/index.d.ts +0 -50
  1142. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enum.d.ts +0 -38
  1143. package/build/types-ts3.8/integrations/tracing/graphql/vendored/enums/AttributeNames.d.ts +0 -10
  1144. package/build/types-ts3.8/integrations/tracing/graphql/vendored/graphql-types.d.ts +0 -2
  1145. package/build/types-ts3.8/integrations/tracing/graphql/vendored/instrumentation.d.ts +0 -25
  1146. package/build/types-ts3.8/integrations/tracing/graphql/vendored/internal-types.d.ts +0 -63
  1147. package/build/types-ts3.8/integrations/tracing/graphql/vendored/symbols.d.ts +0 -3
  1148. package/build/types-ts3.8/integrations/tracing/graphql/vendored/types.d.ts +0 -33
  1149. package/build/types-ts3.8/integrations/tracing/graphql/vendored/utils.d.ts +0 -14
  1150. package/build/types-ts3.8/integrations/tracing/hapi/index.d.ts +0 -52
  1151. package/build/types-ts3.8/integrations/tracing/hapi/types.d.ts +0 -166
  1152. package/build/types-ts3.8/integrations/tracing/hapi/vendored/enums/AttributeNames.d.ts +0 -6
  1153. package/build/types-ts3.8/integrations/tracing/hapi/vendored/hapi-types.d.ts +0 -70
  1154. package/build/types-ts3.8/integrations/tracing/hapi/vendored/instrumentation.d.ts +0 -72
  1155. package/build/types-ts3.8/integrations/tracing/hapi/vendored/internal-types.d.ts +0 -32
  1156. package/build/types-ts3.8/integrations/tracing/hapi/vendored/utils.d.ts +0 -18
  1157. package/build/types-ts3.8/integrations/tracing/hono/constants.d.ts +0 -11
  1158. package/build/types-ts3.8/integrations/tracing/hono/index.d.ts +0 -60
  1159. package/build/types-ts3.8/integrations/tracing/hono/instrumentation.d.ts +0 -55
  1160. package/build/types-ts3.8/integrations/tracing/hono/types.d.ts +0 -36
  1161. package/build/types-ts3.8/integrations/tracing/index.d.ts +0 -12
  1162. package/build/types-ts3.8/integrations/tracing/kafka/index.d.ts +0 -21
  1163. package/build/types-ts3.8/integrations/tracing/kafka/vendored/instrumentation.d.ts +0 -15
  1164. package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -79
  1165. package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +0 -54
  1166. package/build/types-ts3.8/integrations/tracing/kafka/vendored/utils.d.ts +0 -29
  1167. package/build/types-ts3.8/integrations/tracing/knex/index.d.ts +0 -22
  1168. package/build/types-ts3.8/integrations/tracing/knex/vendored/instrumentation.d.ts +0 -12
  1169. package/build/types-ts3.8/integrations/tracing/knex/vendored/semconv.d.ts +0 -7
  1170. package/build/types-ts3.8/integrations/tracing/knex/vendored/utils.d.ts +0 -9
  1171. package/build/types-ts3.8/integrations/tracing/koa/index.d.ts +0 -72
  1172. package/build/types-ts3.8/integrations/tracing/koa/vendored/enums/AttributeNames.d.ts +0 -5
  1173. package/build/types-ts3.8/integrations/tracing/koa/vendored/instrumentation.d.ts +0 -32
  1174. package/build/types-ts3.8/integrations/tracing/koa/vendored/internal-types.d.ts +0 -34
  1175. package/build/types-ts3.8/integrations/tracing/koa/vendored/types.d.ts +0 -13
  1176. package/build/types-ts3.8/integrations/tracing/koa/vendored/utils.d.ts +0 -15
  1177. package/build/types-ts3.8/integrations/tracing/langchain/index.d.ts +0 -101
  1178. package/build/types-ts3.8/integrations/tracing/langchain/instrumentation.d.ts +0 -38
  1179. package/build/types-ts3.8/integrations/tracing/langgraph/index.d.ts +0 -77
  1180. package/build/types-ts3.8/integrations/tracing/langgraph/instrumentation.d.ts +0 -19
  1181. package/build/types-ts3.8/integrations/tracing/lrumemoizer/index.d.ts +0 -21
  1182. package/build/types-ts3.8/integrations/tracing/lrumemoizer/vendored/instrumentation.d.ts +0 -6
  1183. package/build/types-ts3.8/integrations/tracing/mongo/index.d.ts +0 -22
  1184. package/build/types-ts3.8/integrations/tracing/mongo/vendored/instrumentation.d.ts +0 -11
  1185. package/build/types-ts3.8/integrations/tracing/mongo/vendored/internal-types.d.ts +0 -62
  1186. package/build/types-ts3.8/integrations/tracing/mongo/vendored/patches.d.ts +0 -15
  1187. package/build/types-ts3.8/integrations/tracing/mongo/vendored/utils.d.ts +0 -15
  1188. package/build/types-ts3.8/integrations/tracing/mongoose/index.d.ts +0 -22
  1189. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose-types.d.ts +0 -33
  1190. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/mongoose.d.ts +0 -18
  1191. package/build/types-ts3.8/integrations/tracing/mongoose/vendored/utils.d.ts +0 -4
  1192. package/build/types-ts3.8/integrations/tracing/mysql/index.d.ts +0 -22
  1193. package/build/types-ts3.8/integrations/tracing/mysql/vendored/instrumentation.d.ts +0 -14
  1194. package/build/types-ts3.8/integrations/tracing/mysql/vendored/mysql-types.d.ts +0 -78
  1195. package/build/types-ts3.8/integrations/tracing/mysql/vendored/semconv.d.ts +0 -19
  1196. package/build/types-ts3.8/integrations/tracing/mysql/vendored/utils.d.ts +0 -22
  1197. package/build/types-ts3.8/integrations/tracing/mysql2/index.d.ts +0 -22
  1198. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/instrumentation.d.ts +0 -9
  1199. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/mysql2-types.d.ts +0 -39
  1200. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/semconv.d.ts +0 -3
  1201. package/build/types-ts3.8/integrations/tracing/mysql2/vendored/utils.d.ts +0 -25
  1202. package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +0 -62
  1203. package/build/types-ts3.8/integrations/tracing/openai/instrumentation.d.ts +0 -26
  1204. package/build/types-ts3.8/integrations/tracing/postgres/index.d.ts +0 -26
  1205. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/AttributeNames.d.ts +0 -6
  1206. package/build/types-ts3.8/integrations/tracing/postgres/vendored/enums/SpanNames.d.ts +0 -6
  1207. package/build/types-ts3.8/integrations/tracing/postgres/vendored/instrumentation.d.ts +0 -12
  1208. package/build/types-ts3.8/integrations/tracing/postgres/vendored/internal-types.d.ts +0 -33
  1209. package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-pool-types.d.ts +0 -20
  1210. package/build/types-ts3.8/integrations/tracing/postgres/vendored/pg-types.d.ts +0 -54
  1211. package/build/types-ts3.8/integrations/tracing/postgres/vendored/semconv.d.ts +0 -13
  1212. package/build/types-ts3.8/integrations/tracing/postgres/vendored/types.d.ts +0 -11
  1213. package/build/types-ts3.8/integrations/tracing/postgres/vendored/utils.d.ts +0 -56
  1214. package/build/types-ts3.8/integrations/tracing/postgresjs.d.ts +0 -103
  1215. package/build/types-ts3.8/integrations/tracing/redis/cache.d.ts +0 -22
  1216. package/build/types-ts3.8/integrations/tracing/redis/index.d.ts +0 -28
  1217. package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +0 -10
  1218. package/build/types-ts3.8/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +0 -16
  1219. package/build/types-ts3.8/integrations/tracing/redis/vendored/semconv.d.ts +0 -4
  1220. package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +0 -24
  1221. package/build/types-ts3.8/integrations/tracing/tedious/index.d.ts +0 -22
  1222. package/build/types-ts3.8/integrations/tracing/tedious/vendored/instrumentation.d.ts +0 -11
  1223. package/build/types-ts3.8/integrations/tracing/tedious/vendored/semconv.d.ts +0 -19
  1224. package/build/types-ts3.8/integrations/tracing/tedious/vendored/tedious-types.d.ts +0 -21
  1225. package/build/types-ts3.8/integrations/tracing/tedious/vendored/utils.d.ts +0 -9
  1226. package/build/types-ts3.8/integrations/tracing/vercelai/constants.d.ts +0 -2
  1227. package/build/types-ts3.8/integrations/tracing/vercelai/index.d.ts +0 -44
  1228. package/build/types-ts3.8/integrations/tracing/vercelai/instrumentation.d.ts +0 -56
  1229. package/build/types-ts3.8/integrations/tracing/vercelai/types.d.ts +0 -50
  1230. package/build/types-ts3.8/preload.d.ts +0 -2
  1231. package/build/types-ts3.8/sdk/diagnosticsChannelInjection.d.ts +0 -41
  1232. package/build/types-ts3.8/sdk/experimentalUseDiagnosticsChannelInjection.d.ts +0 -37
  1233. package/build/types-ts3.8/sdk/index.d.ts +0 -36
  1234. package/build/types-ts3.8/sdk/initOtel.d.ts +0 -30
  1235. package/build/types-ts3.8/types.d.ts +0 -89
  1236. package/build/types-ts3.8/utils/redisCache.d.ts +0 -17
  1237. package/build/types-ts3.8/utils/setHttpServerSpanRouteAttribute.d.ts +0 -9
@@ -0,0 +1,245 @@
1
+ import { createReadStream } from 'node:fs';
2
+ import { createInterface } from 'node:readline';
3
+ import { LRUMap, defineIntegration, debug, snipLine } from '@sentry/core';
4
+ import { DEBUG_BUILD } from '../debug-build.js';
5
+
6
+ const LRU_FILE_CONTENTS_CACHE = new LRUMap(10);
7
+ const LRU_FILE_CONTENTS_FS_READ_FAILED = new LRUMap(20);
8
+ const DEFAULT_LINES_OF_CONTEXT = 5;
9
+ const INTEGRATION_NAME = "ContextLines";
10
+ const MAX_CONTEXTLINES_COLNO = 1e3;
11
+ const MAX_CONTEXTLINES_LINENO = 1e4;
12
+ function emplace(map, key, contents) {
13
+ const value = map.get(key);
14
+ if (value === void 0) {
15
+ map.set(key, contents);
16
+ return contents;
17
+ }
18
+ return value;
19
+ }
20
+ function shouldSkipContextLinesForFile(path) {
21
+ if (path.startsWith("node:")) return true;
22
+ if (path.endsWith(".min.js")) return true;
23
+ if (path.endsWith(".min.cjs")) return true;
24
+ if (path.endsWith(".min.mjs")) return true;
25
+ if (path.startsWith("data:")) return true;
26
+ return false;
27
+ }
28
+ function shouldSkipContextLinesForFrame(frame) {
29
+ if (frame.lineno !== void 0 && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;
30
+ if (frame.colno !== void 0 && frame.colno > MAX_CONTEXTLINES_COLNO) return true;
31
+ return false;
32
+ }
33
+ function rangeExistsInContentCache(file, range) {
34
+ const contents = LRU_FILE_CONTENTS_CACHE.get(file);
35
+ if (contents === void 0) return false;
36
+ for (let i = range[0]; i <= range[1]; i++) {
37
+ if (contents[i] === void 0) {
38
+ return false;
39
+ }
40
+ }
41
+ return true;
42
+ }
43
+ function makeLineReaderRanges(lines, linecontext) {
44
+ if (!lines.length) {
45
+ return [];
46
+ }
47
+ let i = 0;
48
+ const line = lines[0];
49
+ if (typeof line !== "number") {
50
+ return [];
51
+ }
52
+ let current = makeContextRange(line, linecontext);
53
+ const out = [];
54
+ while (true) {
55
+ if (i === lines.length - 1) {
56
+ out.push(current);
57
+ break;
58
+ }
59
+ const next = lines[i + 1];
60
+ if (typeof next !== "number") {
61
+ break;
62
+ }
63
+ if (next <= current[1]) {
64
+ current[1] = next + linecontext;
65
+ } else {
66
+ out.push(current);
67
+ current = makeContextRange(next, linecontext);
68
+ }
69
+ i++;
70
+ }
71
+ return out;
72
+ }
73
+ function getContextLinesFromFile(path, ranges, output) {
74
+ return new Promise((resolve, _reject) => {
75
+ const stream = createReadStream(path);
76
+ const lineReaded = createInterface({
77
+ input: stream
78
+ });
79
+ function destroyStreamAndResolve() {
80
+ stream.destroy();
81
+ resolve();
82
+ }
83
+ let lineNumber = 0;
84
+ let currentRangeIndex = 0;
85
+ const range = ranges[currentRangeIndex];
86
+ if (range === void 0) {
87
+ destroyStreamAndResolve();
88
+ return;
89
+ }
90
+ let rangeStart = range[0];
91
+ let rangeEnd = range[1];
92
+ function onStreamError(e) {
93
+ LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1);
94
+ DEBUG_BUILD && debug.error(`Failed to read file: ${path}. Error: ${e}`);
95
+ lineReaded.close();
96
+ lineReaded.removeAllListeners();
97
+ destroyStreamAndResolve();
98
+ }
99
+ stream.on("error", onStreamError);
100
+ lineReaded.on("error", onStreamError);
101
+ lineReaded.on("close", destroyStreamAndResolve);
102
+ lineReaded.on("line", (line) => {
103
+ lineNumber++;
104
+ if (lineNumber < rangeStart) return;
105
+ output[lineNumber] = snipLine(line, 0);
106
+ if (lineNumber >= rangeEnd) {
107
+ if (currentRangeIndex === ranges.length - 1) {
108
+ lineReaded.close();
109
+ lineReaded.removeAllListeners();
110
+ return;
111
+ }
112
+ currentRangeIndex++;
113
+ const range2 = ranges[currentRangeIndex];
114
+ if (range2 === void 0) {
115
+ lineReaded.close();
116
+ lineReaded.removeAllListeners();
117
+ return;
118
+ }
119
+ rangeStart = range2[0];
120
+ rangeEnd = range2[1];
121
+ }
122
+ });
123
+ });
124
+ }
125
+ async function addSourceContext(event, contextLines) {
126
+ const filesToLines = {};
127
+ if (contextLines > 0 && event.exception?.values) {
128
+ for (const exception of event.exception.values) {
129
+ if (!exception.stacktrace?.frames?.length) {
130
+ continue;
131
+ }
132
+ for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {
133
+ const frame = exception.stacktrace.frames[i];
134
+ const filename = frame?.filename;
135
+ if (!frame || typeof filename !== "string" || typeof frame.lineno !== "number" || shouldSkipContextLinesForFile(filename) || shouldSkipContextLinesForFrame(frame)) {
136
+ continue;
137
+ }
138
+ const filesToLinesOutput = filesToLines[filename];
139
+ if (!filesToLinesOutput) filesToLines[filename] = [];
140
+ filesToLines[filename].push(frame.lineno);
141
+ }
142
+ }
143
+ }
144
+ const files = Object.keys(filesToLines);
145
+ if (files.length == 0) {
146
+ return event;
147
+ }
148
+ const readlinePromises = [];
149
+ for (const file of files) {
150
+ if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) {
151
+ continue;
152
+ }
153
+ const filesToLineRanges = filesToLines[file];
154
+ if (!filesToLineRanges) {
155
+ continue;
156
+ }
157
+ filesToLineRanges.sort((a, b) => a - b);
158
+ const ranges = makeLineReaderRanges(filesToLineRanges, contextLines);
159
+ if (ranges.every((r) => rangeExistsInContentCache(file, r))) {
160
+ continue;
161
+ }
162
+ const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {});
163
+ readlinePromises.push(getContextLinesFromFile(file, ranges, cache));
164
+ }
165
+ await Promise.all(readlinePromises).catch(() => {
166
+ DEBUG_BUILD && debug.log("Failed to read one or more source files and resolve context lines");
167
+ });
168
+ if (contextLines > 0 && event.exception?.values) {
169
+ for (const exception of event.exception.values) {
170
+ if (exception.stacktrace?.frames && exception.stacktrace.frames.length > 0) {
171
+ addSourceContextToFrames(exception.stacktrace.frames, contextLines, LRU_FILE_CONTENTS_CACHE);
172
+ }
173
+ }
174
+ }
175
+ return event;
176
+ }
177
+ function addSourceContextToFrames(frames, contextLines, cache) {
178
+ for (const frame of frames) {
179
+ if (frame.filename && frame.context_line === void 0 && typeof frame.lineno === "number") {
180
+ const contents = cache.get(frame.filename);
181
+ if (contents === void 0) {
182
+ continue;
183
+ }
184
+ addContextToFrame(frame.lineno, frame, contextLines, contents);
185
+ }
186
+ }
187
+ }
188
+ function clearLineContext(frame) {
189
+ delete frame.pre_context;
190
+ delete frame.context_line;
191
+ delete frame.post_context;
192
+ }
193
+ function addContextToFrame(lineno, frame, contextLines, contents) {
194
+ if (frame.lineno === void 0 || contents === void 0) {
195
+ DEBUG_BUILD && debug.error("Cannot resolve context for frame with no lineno or file contents");
196
+ return;
197
+ }
198
+ frame.pre_context = [];
199
+ for (let i = makeRangeStart(lineno, contextLines); i < lineno; i++) {
200
+ const line = contents[i];
201
+ if (line === void 0) {
202
+ clearLineContext(frame);
203
+ DEBUG_BUILD && debug.error(`Could not find line ${i} in file ${frame.filename}`);
204
+ return;
205
+ }
206
+ frame.pre_context.push(line);
207
+ }
208
+ if (contents[lineno] === void 0) {
209
+ clearLineContext(frame);
210
+ DEBUG_BUILD && debug.error(`Could not find line ${lineno} in file ${frame.filename}`);
211
+ return;
212
+ }
213
+ frame.context_line = contents[lineno];
214
+ const end = makeRangeEnd(lineno, contextLines);
215
+ frame.post_context = [];
216
+ for (let i = lineno + 1; i <= end; i++) {
217
+ const line = contents[i];
218
+ if (line === void 0) {
219
+ break;
220
+ }
221
+ frame.post_context.push(line);
222
+ }
223
+ }
224
+ function makeRangeStart(line, linecontext) {
225
+ return Math.max(1, line - linecontext);
226
+ }
227
+ function makeRangeEnd(line, linecontext) {
228
+ return line + linecontext;
229
+ }
230
+ function makeContextRange(line, linecontext) {
231
+ return [makeRangeStart(line, linecontext), makeRangeEnd(line, linecontext)];
232
+ }
233
+ const _contextLinesIntegration = ((options = {}) => {
234
+ return {
235
+ name: INTEGRATION_NAME,
236
+ processEvent(event, _hint, client) {
237
+ const contextLines = options.frameContextLines ?? client?.getDataCollectionOptions().frameContextLines ?? DEFAULT_LINES_OF_CONTEXT;
238
+ return addSourceContext(event, contextLines);
239
+ }
240
+ };
241
+ });
242
+ const contextLinesIntegration = defineIntegration(_contextLinesIntegration);
243
+
244
+ export { MAX_CONTEXTLINES_COLNO, MAX_CONTEXTLINES_LINENO, _contextLinesIntegration, addContextToFrame, contextLinesIntegration };
245
+ //# sourceMappingURL=contextlines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextlines.js","sources":["../../../src/integrations/contextlines.ts"],"sourcesContent":["import { createReadStream } from 'node:fs';\nimport { createInterface } from 'node:readline';\nimport type { Event, IntegrationFn, StackFrame } from '@sentry/core';\nimport { debug, defineIntegration, LRUMap, snipLine } from '@sentry/core';\nimport { DEBUG_BUILD } from '../debug-build';\n\nconst LRU_FILE_CONTENTS_CACHE = new LRUMap<string, Record<number, string>>(10);\nconst LRU_FILE_CONTENTS_FS_READ_FAILED = new LRUMap<string, 1>(20);\nconst DEFAULT_LINES_OF_CONTEXT = 5;\nconst INTEGRATION_NAME = 'ContextLines' as const;\n// Determines the upper bound of lineno/colno that we will attempt to read. Large colno values are likely to be\n// minified code while large lineno values are likely to be bundled code.\n// Exported for testing purposes.\nexport const MAX_CONTEXTLINES_COLNO: number = 1000;\nexport const MAX_CONTEXTLINES_LINENO: number = 10000;\n\ninterface ContextLinesOptions {\n /**\n * Sets the number of context lines for each frame when loading a file.\n * Defaults to `dataCollection.frameContextLines` (5).\n *\n * Set to 0 to disable loading and inclusion of source files.\n *\n * When set, this option takes precedence over `dataCollection.frameContextLines`.\n **/\n frameContextLines?: number;\n}\n\n/**\n * Exported for testing purposes.\n */\nexport function resetFileContentCache(): void {\n LRU_FILE_CONTENTS_CACHE.clear();\n}\n\n/**\n * Get or init map value\n */\nfunction emplace<T extends LRUMap<K, V>, K extends string, V>(map: T, key: K, contents: V): V {\n const value = map.get(key);\n\n if (value === undefined) {\n map.set(key, contents);\n return contents;\n }\n\n return value;\n}\n\n/**\n * Determines if context lines should be skipped for a file.\n * - .min.(mjs|cjs|js) files are and not useful since they dont point to the original source\n * - node: prefixed modules are part of the runtime and cannot be resolved to a file\n * - data: skip json, wasm and inline js https://nodejs.org/api/esm.html#data-imports\n */\nfunction shouldSkipContextLinesForFile(path: string): boolean {\n // Test the most common prefix and extension first. These are the ones we\n // are most likely to see in user applications and are the ones we can break out of first.\n if (path.startsWith('node:')) return true;\n if (path.endsWith('.min.js')) return true;\n if (path.endsWith('.min.cjs')) return true;\n if (path.endsWith('.min.mjs')) return true;\n if (path.startsWith('data:')) return true;\n return false;\n}\n\n/**\n * Determines if we should skip contextlines based off the max lineno and colno values.\n */\nfunction shouldSkipContextLinesForFrame(frame: StackFrame): boolean {\n if (frame.lineno !== undefined && frame.lineno > MAX_CONTEXTLINES_LINENO) return true;\n if (frame.colno !== undefined && frame.colno > MAX_CONTEXTLINES_COLNO) return true;\n return false;\n}\n/**\n * Checks if we have all the contents that we need in the cache.\n */\nfunction rangeExistsInContentCache(file: string, range: ReadlineRange): boolean {\n const contents = LRU_FILE_CONTENTS_CACHE.get(file);\n if (contents === undefined) return false;\n\n for (let i = range[0]; i <= range[1]; i++) {\n if (contents[i] === undefined) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Creates contiguous ranges of lines to read from a file. In the case where context lines overlap,\n * the ranges are merged to create a single range.\n */\nfunction makeLineReaderRanges(lines: number[], linecontext: number): ReadlineRange[] {\n if (!lines.length) {\n return [];\n }\n\n let i = 0;\n const line = lines[0];\n\n if (typeof line !== 'number') {\n return [];\n }\n\n let current = makeContextRange(line, linecontext);\n const out: ReadlineRange[] = [];\n // eslint-disable-next-line no-constant-condition\n while (true) {\n if (i === lines.length - 1) {\n out.push(current);\n break;\n }\n\n // If the next line falls into the current range, extend the current range to lineno + linecontext.\n const next = lines[i + 1];\n if (typeof next !== 'number') {\n break;\n }\n if (next <= current[1]) {\n current[1] = next + linecontext;\n } else {\n out.push(current);\n current = makeContextRange(next, linecontext);\n }\n\n i++;\n }\n\n return out;\n}\n\n/**\n * Extracts lines from a file and stores them in a cache.\n */\nfunction getContextLinesFromFile(path: string, ranges: ReadlineRange[], output: Record<number, string>): Promise<void> {\n return new Promise((resolve, _reject) => {\n // It is important *not* to have any async code between createInterface and the 'line' event listener\n // as it will cause the 'line' event to\n // be emitted before the listener is attached.\n const stream = createReadStream(path);\n const lineReaded = createInterface({\n input: stream,\n });\n\n // We need to explicitly destroy the stream to prevent memory leaks,\n // removing the listeners on the readline interface is not enough.\n // See: https://github.com/nodejs/node/issues/9002 and https://github.com/getsentry/sentry-javascript/issues/14892\n function destroyStreamAndResolve(): void {\n stream.destroy();\n resolve();\n }\n\n // Init at zero and increment at the start of the loop because lines are 1 indexed.\n let lineNumber = 0;\n let currentRangeIndex = 0;\n const range = ranges[currentRangeIndex];\n if (range === undefined) {\n // We should never reach this point, but if we do, we should resolve the promise to prevent it from hanging.\n destroyStreamAndResolve();\n return;\n }\n let rangeStart = range[0];\n let rangeEnd = range[1];\n\n // We use this inside Promise.all, so we need to resolve the promise even if there is an error\n // to prevent Promise.all from short circuiting the rest.\n function onStreamError(e: Error): void {\n // Mark file path as failed to read and prevent multiple read attempts.\n LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1);\n DEBUG_BUILD && debug.error(`Failed to read file: ${path}. Error: ${e}`);\n lineReaded.close();\n lineReaded.removeAllListeners();\n destroyStreamAndResolve();\n }\n\n // We need to handle the error event to prevent the process from crashing in < Node 16\n // https://github.com/nodejs/node/pull/31603\n stream.on('error', onStreamError);\n lineReaded.on('error', onStreamError);\n lineReaded.on('close', destroyStreamAndResolve);\n\n lineReaded.on('line', line => {\n lineNumber++;\n if (lineNumber < rangeStart) return;\n\n // !Warning: This mutates the cache by storing the snipped line into the cache.\n output[lineNumber] = snipLine(line, 0);\n\n if (lineNumber >= rangeEnd) {\n if (currentRangeIndex === ranges.length - 1) {\n // We need to close the file stream and remove listeners, else the reader will continue to run our listener;\n lineReaded.close();\n lineReaded.removeAllListeners();\n return;\n }\n currentRangeIndex++;\n const range = ranges[currentRangeIndex];\n if (range === undefined) {\n // This should never happen as it means we have a bug in the context.\n lineReaded.close();\n lineReaded.removeAllListeners();\n return;\n }\n rangeStart = range[0];\n rangeEnd = range[1];\n }\n });\n });\n}\n\n/**\n * Adds surrounding (context) lines of the line that an exception occurred on to the event.\n * This is done by reading the file line by line and extracting the lines. The extracted lines are stored in\n * a cache to prevent multiple reads of the same file. Failures to read a file are similarly cached to prevent multiple\n * failing reads from happening.\n */\n/* eslint-disable complexity */\nasync function addSourceContext(event: Event, contextLines: number): Promise<Event> {\n // keep a lookup map of which files we've already enqueued to read,\n // so we don't enqueue the same file multiple times which would cause multiple i/o reads\n const filesToLines: Record<string, number[]> = {};\n\n if (contextLines > 0 && event.exception?.values) {\n for (const exception of event.exception.values) {\n if (!exception.stacktrace?.frames?.length) {\n continue;\n }\n\n // Maps preserve insertion order, so we iterate in reverse, starting at the\n // outermost frame and closer to where the exception has occurred (poor mans priority)\n for (let i = exception.stacktrace.frames.length - 1; i >= 0; i--) {\n const frame: StackFrame | undefined = exception.stacktrace.frames[i];\n const filename = frame?.filename;\n\n if (\n !frame ||\n typeof filename !== 'string' ||\n typeof frame.lineno !== 'number' ||\n shouldSkipContextLinesForFile(filename) ||\n shouldSkipContextLinesForFrame(frame)\n ) {\n continue;\n }\n\n const filesToLinesOutput = filesToLines[filename];\n if (!filesToLinesOutput) filesToLines[filename] = [];\n // @ts-expect-error this is defined above\n filesToLines[filename].push(frame.lineno);\n }\n }\n }\n\n const files = Object.keys(filesToLines);\n if (files.length == 0) {\n return event;\n }\n\n const readlinePromises: Promise<void>[] = [];\n for (const file of files) {\n // If we failed to read this before, dont try reading it again.\n if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) {\n continue;\n }\n\n const filesToLineRanges = filesToLines[file];\n if (!filesToLineRanges) {\n continue;\n }\n\n // Sort ranges so that they are sorted by line increasing order and match how the file is read.\n filesToLineRanges.sort((a, b) => a - b);\n // Check if the contents are already in the cache and if we can avoid reading the file again.\n const ranges = makeLineReaderRanges(filesToLineRanges, contextLines);\n if (ranges.every(r => rangeExistsInContentCache(file, r))) {\n continue;\n }\n\n const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {});\n readlinePromises.push(getContextLinesFromFile(file, ranges, cache));\n }\n\n // The promise rejections are caught in order to prevent them from short circuiting Promise.all\n await Promise.all(readlinePromises).catch(() => {\n DEBUG_BUILD && debug.log('Failed to read one or more source files and resolve context lines');\n });\n\n // Perform the same loop as above, but this time we can assume all files are in the cache\n // and attempt to add source context to frames.\n if (contextLines > 0 && event.exception?.values) {\n for (const exception of event.exception.values) {\n if (exception.stacktrace?.frames && exception.stacktrace.frames.length > 0) {\n addSourceContextToFrames(exception.stacktrace.frames, contextLines, LRU_FILE_CONTENTS_CACHE);\n }\n }\n }\n\n return event;\n}\n/* eslint-enable complexity */\n\n/** Adds context lines to frames */\nfunction addSourceContextToFrames(\n frames: StackFrame[],\n contextLines: number,\n cache: LRUMap<string, Record<number, string>>,\n): void {\n for (const frame of frames) {\n // Only add context if we have a filename and it hasn't already been added\n if (frame.filename && frame.context_line === undefined && typeof frame.lineno === 'number') {\n const contents = cache.get(frame.filename);\n if (contents === undefined) {\n continue;\n }\n\n addContextToFrame(frame.lineno, frame, contextLines, contents);\n }\n }\n}\n\n/**\n * Clears the context lines from a frame, used to reset a frame to its original state\n * if we fail to resolve all context lines for it.\n */\nfunction clearLineContext(frame: StackFrame): void {\n delete frame.pre_context;\n delete frame.context_line;\n delete frame.post_context;\n}\n\n/**\n * Resolves context lines before and after the given line number and appends them to the frame;\n */\nexport function addContextToFrame(\n lineno: number,\n frame: StackFrame,\n contextLines: number,\n contents: Record<number, string> | undefined,\n): void {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping.\n // We already check for lineno before calling this, but since StackFrame lineno ism optional, we check it again.\n if (frame.lineno === undefined || contents === undefined) {\n DEBUG_BUILD && debug.error('Cannot resolve context for frame with no lineno or file contents');\n return;\n }\n\n frame.pre_context = [];\n for (let i = makeRangeStart(lineno, contextLines); i < lineno; i++) {\n // We always expect the start context as line numbers cannot be negative. If we dont find a line, then\n // something went wrong somewhere. Clear the context and return without adding any linecontext.\n const line = contents[i];\n if (line === undefined) {\n clearLineContext(frame);\n DEBUG_BUILD && debug.error(`Could not find line ${i} in file ${frame.filename}`);\n return;\n }\n\n frame.pre_context.push(line);\n }\n\n // We should always have the context line. If we dont, something went wrong, so we clear the context and return\n // without adding any linecontext.\n if (contents[lineno] === undefined) {\n clearLineContext(frame);\n DEBUG_BUILD && debug.error(`Could not find line ${lineno} in file ${frame.filename}`);\n return;\n }\n\n frame.context_line = contents[lineno];\n\n const end = makeRangeEnd(lineno, contextLines);\n frame.post_context = [];\n for (let i = lineno + 1; i <= end; i++) {\n // Since we dont track when the file ends, we cant clear the context if we dont find a line as it could\n // just be that we reached the end of the file.\n const line = contents[i];\n if (line === undefined) {\n break;\n }\n frame.post_context.push(line);\n }\n}\n\n// Helper functions for generating line context ranges. They take a line number and the number of lines of context to\n// include before and after the line and generate an inclusive range of indices.\ntype ReadlineRange = [start: number, end: number];\n// Compute inclusive end context range\nfunction makeRangeStart(line: number, linecontext: number): number {\n return Math.max(1, line - linecontext);\n}\n// Compute inclusive start context range\nfunction makeRangeEnd(line: number, linecontext: number): number {\n return line + linecontext;\n}\n// Determine start and end indices for context range (inclusive);\nfunction makeContextRange(line: number, linecontext: number): [start: number, end: number] {\n return [makeRangeStart(line, linecontext), makeRangeEnd(line, linecontext)];\n}\n\n/** Exported only for tests, as a type-safe variant. */\nexport const _contextLinesIntegration = ((options: ContextLinesOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n processEvent(event, _hint, client) {\n const contextLines =\n options.frameContextLines ?? client?.getDataCollectionOptions().frameContextLines ?? DEFAULT_LINES_OF_CONTEXT;\n return addSourceContext(event, contextLines);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Capture the lines before and after the frame's context.\n */\nexport const contextLinesIntegration = defineIntegration(_contextLinesIntegration);\n"],"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EGRATION_NAME,
8
8
  setupOnce() {
9
- enableFsInstrumentation(options);
9
+ setImmediate(() => enableFsInstrumentation(options));
10
10
  }
11
11
  };
12
12
  });
@@ -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' 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
+ {"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 // We only run this in the next tick to avoid instrumenting the `fs` module while the SDK is initializating\n // especially, at the point when this runs the Async Context Manager may not be set up yet,\n // which could lead to weird outcomes - so we wait until everything is settled before we instrument.\n setImmediate(() => 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;AAIV,MAAA,YAAA,CAAa,MAAM,uBAAA,CAAwB,OAAO,CAAC,CAAA;AAAA,IACrD;AAAA,GACF;AACF,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../../src/integrations/fs/vendored/constants.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-fs\n * - Upstream version: @opentelemetry/instrumentation-fs@0.37.0\n */\n\nimport type { FMember, FPMember } from './types';\n\nexport const PROMISE_FUNCTIONS: FPMember[] = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'copyFile',\n 'cp' as FPMember, // added in v16\n 'lchown',\n 'link',\n 'lstat',\n 'lutimes', // added in v12\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir', // added in v12\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'rename',\n 'rm', // added in v14\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile',\n // 'lchmod', // only implemented on macOS\n];\n\nexport const CALLBACK_FUNCTIONS: FMember[] = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'copyFile',\n 'cp' as FMember, // added in v16\n 'exists', // deprecated, inconsistent cb signature, handling separately when patching\n 'lchown',\n 'link',\n 'lstat',\n 'lutimes', // added in v12\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir', // added in v12\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'realpath.native',\n 'rename',\n 'rm', // added in v14\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile',\n // 'close', // functions on file descriptor\n // 'fchmod', // functions on file descriptor\n // 'fchown', // functions on file descriptor\n // 'fdatasync', // functions on file descriptor\n // 'fstat', // functions on file descriptor\n // 'fsync', // functions on file descriptor\n // 'ftruncate', // functions on file descriptor\n // 'futimes', // functions on file descriptor\n // 'lchmod', // only implemented on macOS\n // 'read', // functions on file descriptor\n // 'readv', // functions on file descriptor\n // 'write', // functions on file descriptor\n // 'writev', // functions on file descriptor\n];\n\nexport const SYNC_FUNCTIONS: FMember[] = [\n 'accessSync',\n 'appendFileSync',\n 'chmodSync',\n 'chownSync',\n 'copyFileSync',\n 'cpSync' as FMember, // added in v16\n 'existsSync',\n 'lchownSync',\n 'linkSync',\n 'lstatSync',\n 'lutimesSync', // added in v12\n 'mkdirSync',\n 'mkdtempSync',\n 'opendirSync', // added in v12\n 'openSync',\n 'readdirSync',\n 'readFileSync',\n 'readlinkSync',\n 'realpathSync',\n 'realpathSync.native',\n 'renameSync',\n 'rmdirSync',\n 'rmSync', // added in v14\n 'statSync',\n 'symlinkSync',\n 'truncateSync',\n 'unlinkSync',\n 'utimesSync',\n 'writeFileSync',\n // 'closeSync', // functions on file descriptor\n // 'fchmodSync', // functions on file descriptor\n // 'fchownSync', // functions on file descriptor\n // 'fdatasyncSync', // functions on file descriptor\n // 'fstatSync', // functions on file descriptor\n // 'fsyncSync', // functions on file descriptor\n // 'ftruncateSync', // functions on file descriptor\n // 'futimesSync', // functions on file descriptor\n // 'lchmodSync', // only implemented on macOS\n // 'readSync', // functions on file descriptor\n // 'readvSync', // functions on file descriptor\n // 'writeSync', // functions on file descriptor\n // 'writevSync', // functions on file descriptor\n];\n"],"names":[],"mappings":"AAWO,MAAM,iBAAA,GAAgC;AAAA,EAC3C,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AAAA;AAEF;AAEO,MAAM,kBAAA,GAAgC;AAAA,EAC3C,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,QAAA;AAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcF;AAEO,MAAM,cAAA,GAA4B;AAAA,EACvC,YAAA;AAAA,EACA,gBAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,qBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcF;;;;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../../src/integrations/fs/vendored/constants.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-fs\n * - Upstream version: @opentelemetry/instrumentation-fs@0.37.0\n */\n\nimport type { FMember, FPMember } from './types';\n\nexport const PROMISE_FUNCTIONS: FPMember[] = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'copyFile',\n 'cp', // added in v16\n 'lchown',\n 'link',\n 'lstat',\n 'lutimes', // added in v12\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir', // added in v12\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'rename',\n 'rm', // added in v14\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile',\n // 'lchmod', // only implemented on macOS\n];\n\nexport const CALLBACK_FUNCTIONS: FMember[] = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'copyFile',\n 'cp', // added in v16\n 'exists', // deprecated, inconsistent cb signature, handling separately when patching\n 'lchown',\n 'link',\n 'lstat',\n 'lutimes', // added in v12\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir', // added in v12\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'realpath.native',\n 'rename',\n 'rm', // added in v14\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile',\n // 'close', // functions on file descriptor\n // 'fchmod', // functions on file descriptor\n // 'fchown', // functions on file descriptor\n // 'fdatasync', // functions on file descriptor\n // 'fstat', // functions on file descriptor\n // 'fsync', // functions on file descriptor\n // 'ftruncate', // functions on file descriptor\n // 'futimes', // functions on file descriptor\n // 'lchmod', // only implemented on macOS\n // 'read', // functions on file descriptor\n // 'readv', // functions on file descriptor\n // 'write', // functions on file descriptor\n // 'writev', // functions on file descriptor\n];\n\nexport const SYNC_FUNCTIONS: FMember[] = [\n 'accessSync',\n 'appendFileSync',\n 'chmodSync',\n 'chownSync',\n 'copyFileSync',\n 'cpSync', // added in v16\n 'existsSync',\n 'lchownSync',\n 'linkSync',\n 'lstatSync',\n 'lutimesSync', // added in v12\n 'mkdirSync',\n 'mkdtempSync',\n 'opendirSync', // added in v12\n 'openSync',\n 'readdirSync',\n 'readFileSync',\n 'readlinkSync',\n 'realpathSync',\n 'realpathSync.native',\n 'renameSync',\n 'rmdirSync',\n 'rmSync', // added in v14\n 'statSync',\n 'symlinkSync',\n 'truncateSync',\n 'unlinkSync',\n 'utimesSync',\n 'writeFileSync',\n // 'closeSync', // functions on file descriptor\n // 'fchmodSync', // functions on file descriptor\n // 'fchownSync', // functions on file descriptor\n // 'fdatasyncSync', // functions on file descriptor\n // 'fstatSync', // functions on file descriptor\n // 'fsyncSync', // functions on file descriptor\n // 'ftruncateSync', // functions on file descriptor\n // 'futimesSync', // functions on file descriptor\n // 'lchmodSync', // only implemented on macOS\n // 'readSync', // functions on file descriptor\n // 'readvSync', // functions on file descriptor\n // 'writeSync', // functions on file descriptor\n // 'writevSync', // functions on file descriptor\n];\n"],"names":[],"mappings":"AAWO,MAAM,iBAAA,GAAgC;AAAA,EAC3C,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AAAA;AAEF;AAEO,MAAM,kBAAA,GAAgC;AAAA,EAC3C,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,QAAA;AAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA;AAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcF;AAEO,MAAM,cAAA,GAA4B;AAAA,EACvC,YAAA;AAAA,EACA,gBAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,qBAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcF;;;;"}
@@ -1,3 +1,5 @@
1
+ import { ERROR_TYPE } from '@sentry/conventions/attributes';
2
+ import { FILE } from '@sentry/conventions/op';
1
3
  import { startInactiveSpan, getActiveSpan, withActiveSpan, suppressTracing, SPAN_STATUS_ERROR, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_OP, startSpan } from '@sentry/core';
2
4
  import * as fs from 'fs';
3
5
  import { promisify } from 'util';
@@ -5,7 +7,7 @@ import { SYNC_FUNCTIONS, CALLBACK_FUNCTIONS, PROMISE_FUNCTIONS } from './constan
5
7
  import { indexFs } from './utils.js';
6
8
 
7
9
  const SPAN_ORIGIN = "auto.file.fs";
8
- const SPAN_OP = "file";
10
+ const SPAN_OP = FILE;
9
11
  const FS_OPERATIONS_WITH_OLD_PATH_NEW_PATH = ["rename", "renameSync"];
10
12
  const FS_OPERATIONS_WITH_SRC_DEST = ["copyFile", "cp", "copyFileSync", "cpSync"];
11
13
  const FS_OPERATIONS_WITH_EXISTING_PATH_NEW_PATH = ["link", "linkSync"];
@@ -220,7 +222,7 @@ function enableFsInstrumentation(config = {}) {
220
222
  function recordError(span, error, config) {
221
223
  span.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" });
222
224
  if (config.recordErrorMessagesAsSpanAttributes && error instanceof Error) {
223
- span.setAttribute("fs_error", error.message);
225
+ span.setAttribute(ERROR_TYPE, error.code ?? error.name);
224
226
  }
225
227
  }
226
228
 
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/fs/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-fs\n * - Upstream version: @opentelemetry/instrumentation-fs@0.37.0\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n * - The OpenTelemetry tracer APIs were replaced with Sentry's `startSpan`/`startInactiveSpan`/`suppressTracing`\n * and the configurable `createHook`/`endHook`/`requireParentSpan` options were removed in favor of inlined,\n * Sentry-specific span attributes.\n * - Completely reworked to no longer reference OpenTelemetry.\n */\n\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_ERROR,\n getActiveSpan,\n startInactiveSpan,\n startSpan,\n suppressTracing,\n withActiveSpan,\n} from '@sentry/core';\nimport * as fs from 'fs';\nimport { promisify } from 'util';\nimport { CALLBACK_FUNCTIONS, PROMISE_FUNCTIONS, SYNC_FUNCTIONS } from './constants';\nimport type { FMember, FPMember, FsInstrumentationConfig, GenericFunction } from './types';\nimport { indexFs } from './utils';\n\nconst SPAN_ORIGIN = 'auto.file.fs';\nconst SPAN_OP = 'file';\n\n// The following lists categorize `fs` functions by the shape of their leading path arguments, so we can\n// record meaningful span attributes for them. These are Sentry-specific additions (not part of upstream).\nconst FS_OPERATIONS_WITH_OLD_PATH_NEW_PATH = ['rename', 'renameSync'];\nconst FS_OPERATIONS_WITH_SRC_DEST = ['copyFile', 'cp', 'copyFileSync', 'cpSync'];\nconst FS_OPERATIONS_WITH_EXISTING_PATH_NEW_PATH = ['link', 'linkSync'];\nconst FS_OPERATIONS_WITH_PREFIX = ['mkdtemp', 'mkdtempSync'];\nconst FS_OPERATIONS_WITH_TARGET_PATH = ['symlink', 'symlinkSync'];\nconst FS_OPERATIONS_WITH_PATH_ARG = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'exists',\n 'mkdir',\n 'lchown',\n 'lstat',\n 'lutimes',\n 'open',\n 'opendir',\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'realpath.native',\n 'rm',\n 'rmdir',\n 'stat',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile',\n 'accessSync',\n 'appendFileSync',\n 'chmodSync',\n 'chownSync',\n 'existsSync',\n 'lchownSync',\n 'lstatSync',\n 'lutimesSync',\n 'opendirSync',\n 'mkdirSync',\n 'openSync',\n 'readdirSync',\n 'readFileSync',\n 'readlinkSync',\n 'realpathSync',\n 'realpathSync.native',\n 'rmdirSync',\n 'rmSync',\n 'statSync',\n 'truncateSync',\n 'unlinkSync',\n 'utimesSync',\n 'writeFileSync',\n];\n\n/**\n * Builds the span attributes for a given `fs` operation, optionally including the file path arguments.\n */\nfunction getSpanAttributes(\n functionName: FMember | FPMember,\n args: ArrayLike<unknown>,\n config: FsInstrumentationConfig,\n): SpanAttributes {\n const attributes: SpanAttributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: SPAN_OP,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: SPAN_ORIGIN,\n };\n\n if (!config.recordFilePaths) {\n return attributes;\n }\n\n if (typeof args[0] === 'string' && FS_OPERATIONS_WITH_PATH_ARG.includes(functionName)) {\n attributes['path_argument'] = args[0];\n } else if (typeof args[0] === 'string' && typeof args[1] === 'string') {\n if (FS_OPERATIONS_WITH_TARGET_PATH.includes(functionName)) {\n attributes['target_argument'] = args[0];\n attributes['path_argument'] = args[1];\n } else if (FS_OPERATIONS_WITH_EXISTING_PATH_NEW_PATH.includes(functionName)) {\n attributes['existing_path_argument'] = args[0];\n attributes['new_path_argument'] = args[1];\n } else if (FS_OPERATIONS_WITH_SRC_DEST.includes(functionName)) {\n attributes['src_argument'] = args[0];\n attributes['dest_argument'] = args[1];\n } else if (FS_OPERATIONS_WITH_OLD_PATH_NEW_PATH.includes(functionName)) {\n attributes['old_path_argument'] = args[0];\n attributes['new_path_argument'] = args[1];\n }\n } else if (typeof args[0] === 'string' && FS_OPERATIONS_WITH_PREFIX.includes(functionName)) {\n attributes['prefix_argument'] = args[0];\n }\n\n return attributes;\n}\n\n/**\n * This is important for 2-level functions like `realpath.native` to retain the 2nd-level\n * when patching the 1st-level.\n */\nfunction patchedFunctionWithOriginalProperties<T extends GenericFunction>(patchedFunction: T, original: T): T {\n return Object.assign(patchedFunction, original);\n}\n\n// Tracks patched methods to prevent double-patching if `enableFsInstrumentation` is called more than once.\nconst _patched = new WeakMap<Record<string, GenericFunction>, Set<string>>();\n\nfunction _patchMethod(\n obj: Record<string, GenericFunction>,\n name: string,\n wrapper: (original: GenericFunction) => GenericFunction,\n): void {\n const original = obj[name];\n if (typeof original !== 'function') return;\n let patched = _patched.get(obj);\n if (!patched) {\n patched = new Set();\n _patched.set(obj, patched);\n }\n if (patched.has(name)) return;\n patched.add(name);\n obj[name] = wrapper(original);\n}\n\nfunction _patchSyncFunction<T extends GenericFunction>(\n functionName: FMember,\n original: T,\n config: FsInstrumentationConfig,\n): T {\n const patchedFunction = function (this: unknown, ...args: Parameters<T>): ReturnType<T> {\n const attributes = getSpanAttributes(functionName, args, config);\n return startSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes }, span => {\n try {\n return suppressTracing(() => original.apply(this, args)) as ReturnType<T>;\n } catch (error) {\n recordError(span, error, config);\n throw error;\n }\n });\n };\n return patchedFunctionWithOriginalProperties(patchedFunction as T, original);\n}\n\nfunction _patchCallbackFunction<T extends GenericFunction>(\n functionName: FMember,\n original: T,\n config: FsInstrumentationConfig,\n): T {\n const patchedFunction = function (this: unknown, ...args: Parameters<T>): ReturnType<T> {\n const lastIdx = args.length - 1;\n const cb: unknown = args[lastIdx];\n if (typeof cb !== 'function') {\n return original.apply(this, args) as ReturnType<T>;\n }\n\n const attributes = getSpanAttributes(functionName, args, config);\n const span = startInactiveSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes });\n const parentSpan = getActiveSpan();\n\n // Wrap the callback to end the span and restore the caller's active span context.\n // fs callbacks fire from Node's I/O event loop where the AsyncLocalStorage context\n // is lost, so any spans created inside the callback would otherwise have no parent.\n args[lastIdx] = function (this: unknown, ...cbArgs: unknown[]) {\n const error = cbArgs[0];\n if (error) {\n recordError(span, error, config);\n }\n span.end();\n if (parentSpan) {\n return withActiveSpan(parentSpan, () => (cb as GenericFunction).apply(this, cbArgs));\n }\n return (cb as GenericFunction).apply(this, cbArgs);\n };\n\n try {\n return suppressTracing(() => original.apply(this, args)) as ReturnType<T>;\n } catch (error) {\n recordError(span, error, config);\n span.end();\n throw error;\n }\n };\n return patchedFunctionWithOriginalProperties(patchedFunction as T, original);\n}\n\nfunction _patchExistsCallbackFunction<T extends GenericFunction>(original: T, config: FsInstrumentationConfig): T {\n const functionName = 'exists' as FMember;\n const patchedFunction = function (this: unknown, ...args: Parameters<T>): ReturnType<T> {\n const lastIdx = args.length - 1;\n const cb: unknown = args[lastIdx];\n if (typeof cb !== 'function') {\n return original.apply(this, args) as ReturnType<T>;\n }\n\n const attributes = getSpanAttributes(functionName, args, config);\n const span = startInactiveSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes });\n const parentSpan = getActiveSpan();\n\n // `exists` never calls the callback with an error\n args[lastIdx] = function (this: unknown, ...cbArgs: unknown[]) {\n span.end();\n if (parentSpan) {\n return withActiveSpan(parentSpan, () => (cb as GenericFunction).apply(this, cbArgs));\n }\n return (cb as GenericFunction).apply(this, cbArgs);\n };\n\n try {\n return suppressTracing(() => original.apply(this, args)) as ReturnType<T>;\n } catch (error) {\n recordError(span, error, config);\n span.end();\n throw error;\n }\n };\n const functionWithOriginalProperties = patchedFunctionWithOriginalProperties(patchedFunction as T, original);\n\n // `exists` has a custom promisify function because of the inconsistent signature\n // replicating that on the patched function\n const promisified = function (path: unknown): Promise<unknown> {\n return new Promise(resolve => (functionWithOriginalProperties as GenericFunction)(path, resolve));\n };\n Object.defineProperty(promisified, 'name', { value: functionName });\n Object.defineProperty(functionWithOriginalProperties, promisify.custom, {\n value: promisified,\n });\n\n return functionWithOriginalProperties;\n}\n\nfunction _patchPromiseFunction<T extends GenericFunction>(\n functionName: FPMember,\n original: T,\n config: FsInstrumentationConfig,\n): T {\n const patchedFunction = async function (this: unknown, ...args: Parameters<T>): Promise<unknown> {\n const attributes = getSpanAttributes(functionName, args, config);\n return startSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes }, async span => {\n try {\n return await suppressTracing(() => original.apply(this, args) as Promise<unknown>);\n } catch (error) {\n recordError(span, error, config);\n throw error;\n }\n });\n };\n return patchedFunctionWithOriginalProperties(patchedFunction as unknown as T, original);\n}\n\nexport function enableFsInstrumentation(config: FsInstrumentationConfig = {}): void {\n for (const fName of SYNC_FUNCTIONS) {\n const { objectToPatch, functionNameToPatch } = indexFs(fs, fName);\n _patchMethod(objectToPatch, functionNameToPatch, original => _patchSyncFunction(fName, original, config));\n }\n\n for (const fName of CALLBACK_FUNCTIONS) {\n const { objectToPatch, functionNameToPatch } = indexFs(fs, fName);\n if (fName === 'exists') {\n _patchMethod(objectToPatch, functionNameToPatch, original => _patchExistsCallbackFunction(original, config));\n } else {\n _patchMethod(objectToPatch, functionNameToPatch, original => _patchCallbackFunction(fName, original, config));\n }\n }\n\n // `fs.promises` and `import { readFile } from 'fs/promises'` share the same object in Node 14+,\n // so patching one covers both.\n const fsPromises = fs.promises as unknown as Record<string, GenericFunction>;\n for (const fName of PROMISE_FUNCTIONS) {\n _patchMethod(fsPromises, fName, original => _patchPromiseFunction(fName, original, config));\n }\n}\n\n/**\n * Sets the error status on the span and, if configured, records the error message as a span attribute.\n */\nfunction recordError(span: Span, error: unknown, config: FsInstrumentationConfig): void {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n if (config.recordErrorMessagesAsSpanAttributes && error instanceof Error) {\n span.setAttribute('fs_error', error.message);\n }\n}\n"],"names":[],"mappings":";;;;;;AA+BA,MAAM,WAAA,GAAc,cAAA;AACpB,MAAM,OAAA,GAAU,MAAA;AAIhB,MAAM,oCAAA,GAAuC,CAAC,QAAA,EAAU,YAAY,CAAA;AACpE,MAAM,2BAAA,GAA8B,CAAC,UAAA,EAAY,IAAA,EAAM,gBAAgB,QAAQ,CAAA;AAC/E,MAAM,yCAAA,GAA4C,CAAC,MAAA,EAAQ,UAAU,CAAA;AACrE,MAAM,yBAAA,GAA4B,CAAC,SAAA,EAAW,aAAa,CAAA;AAC3D,MAAM,8BAAA,GAAiC,CAAC,SAAA,EAAW,aAAa,CAAA;AAChE,MAAM,2BAAA,GAA8B;AAAA,EAClC,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,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AA,EAAqB,CAAA,QAAA,KAAY,mBAAmB,KAAA,EAAO,QAAA,EAAU,MAAM,CAAC,CAAA;AAAA,EAC1G;AAEA,EAAA,KAAA,MAAW,SAAS,kBAAA,EAAoB;AACtC,IAAA,MAAM,EAAE,aAAA,EAAe,mBAAA,EAAoB,GAAI,OAAA,CAAQ,IAAI,KAAK,CAAA;AAChE,IAAA,IAAI,UAAU,QAAA,EAAU;AACtB,MAAA,YAAA,CAAa,eAAe,mBAAA,EAAqB,CAAA,QAAA,KAAY,4BAAA,CAA6B,QAAA,EAAU,MAAM,CAAC,CAAA;AAAA,IAC7G,CAAA,MAAO;AACL,MAAA,YAAA,CAAa,eAAe,mBAAA,EAAqB,CAAA,QAAA,KAAY,uBAAuB,KAAA,EAAO,QAAA,EAAU,MAAM,CAAC,CAAA;AAAA,IAC9G;AAAA,EACF;AAIA,EAAA,MAAM,aAAa,EAAA,CAAG,QAAA;AACtB,EAAA,KAAA,MAAW,SAAS,iBAAA,EAAmB;AACrC,IAAA,YAAA,CAAa,YAAY,KAAA,EAAO,CAAA,QAAA,KAAY,sBAAsB,KAAA,EAAO,QAAA,EAAU,MAAM,CAAC,CAAA;AAAA,EAC5F;AACF;AAKA,SAAS,WAAA,CAAY,IAAA,EAAY,KAAA,EAAgB,MAAA,EAAuC;AACtF,EAAA,IAAA,CAAK,UAAU,EAAE,IAAA,EAAM,iBAAA,EAAmB,OAAA,EAAS,kBAAkB,CAAA;AACrE,EAAA,IAAI,MAAA,CAAO,mCAAA,IAAuC,KAAA,YAAiB,KAAA,EAAO;AACxE,IAAA,IAAA,CAAK,YAAA,CAAa,UAAA,EAAY,KAAA,CAAM,OAAO,CAAA;AAAA,EAC7C;AACF;;;;"}
1
+ {"version":3,"file":"instrumentation.js","sources":["../../../../../src/integrations/fs/vendored/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-fs\n * - Upstream version: @opentelemetry/instrumentation-fs@0.37.0\n * - Minor TypeScript strictness adjustments for this repository's compiler settings\n * - The OpenTelemetry tracer APIs were replaced with Sentry's `startSpan`/`startInactiveSpan`/`suppressTracing`\n * and the configurable `createHook`/`endHook`/`requireParentSpan` options were removed in favor of inlined,\n * Sentry-specific span attributes.\n * - Completely reworked to no longer reference OpenTelemetry.\n * - The upstream `fs_error` span attribute (the error message) was replaced with the conventions-backed\n * `error.type` (the syscall error code, e.g. `ENOENT`).\n */\n\nimport { ERROR_TYPE } from '@sentry/conventions/attributes';\nimport { FILE } from '@sentry/conventions/op';\nimport type { Span, SpanAttributes } from '@sentry/core';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_ERROR,\n getActiveSpan,\n startInactiveSpan,\n startSpan,\n suppressTracing,\n withActiveSpan,\n} from '@sentry/core';\nimport * as fs from 'fs';\nimport { promisify } from 'util';\nimport { CALLBACK_FUNCTIONS, PROMISE_FUNCTIONS, SYNC_FUNCTIONS } from './constants';\nimport type { FMember, FPMember, FsInstrumentationConfig, GenericFunction } from './types';\nimport { indexFs } from './utils';\n\nconst SPAN_ORIGIN = 'auto.file.fs';\nconst SPAN_OP = FILE;\n\n// The following lists categorize `fs` functions by the shape of their leading path arguments, so we can\n// record meaningful span attributes for them. These are Sentry-specific additions (not part of upstream).\nconst FS_OPERATIONS_WITH_OLD_PATH_NEW_PATH = ['rename', 'renameSync'];\nconst FS_OPERATIONS_WITH_SRC_DEST = ['copyFile', 'cp', 'copyFileSync', 'cpSync'];\nconst FS_OPERATIONS_WITH_EXISTING_PATH_NEW_PATH = ['link', 'linkSync'];\nconst FS_OPERATIONS_WITH_PREFIX = ['mkdtemp', 'mkdtempSync'];\nconst FS_OPERATIONS_WITH_TARGET_PATH = ['symlink', 'symlinkSync'];\nconst FS_OPERATIONS_WITH_PATH_ARG = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'exists',\n 'mkdir',\n 'lchown',\n 'lstat',\n 'lutimes',\n 'open',\n 'opendir',\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'realpath.native',\n 'rm',\n 'rmdir',\n 'stat',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile',\n 'accessSync',\n 'appendFileSync',\n 'chmodSync',\n 'chownSync',\n 'existsSync',\n 'lchownSync',\n 'lstatSync',\n 'lutimesSync',\n 'opendirSync',\n 'mkdirSync',\n 'openSync',\n 'readdirSync',\n 'readFileSync',\n 'readlinkSync',\n 'realpathSync',\n 'realpathSync.native',\n 'rmdirSync',\n 'rmSync',\n 'statSync',\n 'truncateSync',\n 'unlinkSync',\n 'utimesSync',\n 'writeFileSync',\n];\n\n/**\n * Builds the span attributes for a given `fs` operation, optionally including the file path arguments.\n */\nfunction getSpanAttributes(\n functionName: FMember | FPMember,\n args: ArrayLike<unknown>,\n config: FsInstrumentationConfig,\n): SpanAttributes {\n const attributes: SpanAttributes = {\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: SPAN_OP,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: SPAN_ORIGIN,\n };\n\n if (!config.recordFilePaths) {\n return attributes;\n }\n\n if (typeof args[0] === 'string' && FS_OPERATIONS_WITH_PATH_ARG.includes(functionName)) {\n attributes['path_argument'] = args[0];\n } else if (typeof args[0] === 'string' && typeof args[1] === 'string') {\n if (FS_OPERATIONS_WITH_TARGET_PATH.includes(functionName)) {\n attributes['target_argument'] = args[0];\n attributes['path_argument'] = args[1];\n } else if (FS_OPERATIONS_WITH_EXISTING_PATH_NEW_PATH.includes(functionName)) {\n attributes['existing_path_argument'] = args[0];\n attributes['new_path_argument'] = args[1];\n } else if (FS_OPERATIONS_WITH_SRC_DEST.includes(functionName)) {\n attributes['src_argument'] = args[0];\n attributes['dest_argument'] = args[1];\n } else if (FS_OPERATIONS_WITH_OLD_PATH_NEW_PATH.includes(functionName)) {\n attributes['old_path_argument'] = args[0];\n attributes['new_path_argument'] = args[1];\n }\n } else if (typeof args[0] === 'string' && FS_OPERATIONS_WITH_PREFIX.includes(functionName)) {\n attributes['prefix_argument'] = args[0];\n }\n\n return attributes;\n}\n\n/**\n * This is important for 2-level functions like `realpath.native` to retain the 2nd-level\n * when patching the 1st-level.\n */\nfunction patchedFunctionWithOriginalProperties<T extends GenericFunction>(patchedFunction: T, original: T): T {\n return Object.assign(patchedFunction, original);\n}\n\n// Tracks patched methods to prevent double-patching if `enableFsInstrumentation` is called more than once.\nconst _patched = new WeakMap<Record<string, GenericFunction>, Set<string>>();\n\nfunction _patchMethod(\n obj: Record<string, GenericFunction>,\n name: string,\n wrapper: (original: GenericFunction) => GenericFunction,\n): void {\n const original = obj[name];\n if (typeof original !== 'function') return;\n let patched = _patched.get(obj);\n if (!patched) {\n patched = new Set();\n _patched.set(obj, patched);\n }\n if (patched.has(name)) return;\n patched.add(name);\n obj[name] = wrapper(original);\n}\n\nfunction _patchSyncFunction<T extends GenericFunction>(\n functionName: FMember,\n original: T,\n config: FsInstrumentationConfig,\n): T {\n const patchedFunction = function (this: unknown, ...args: Parameters<T>): ReturnType<T> {\n const attributes = getSpanAttributes(functionName, args, config);\n return startSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes }, span => {\n try {\n return suppressTracing(() => original.apply(this, args)) as ReturnType<T>;\n } catch (error) {\n recordError(span, error, config);\n throw error;\n }\n });\n };\n return patchedFunctionWithOriginalProperties(patchedFunction as T, original);\n}\n\nfunction _patchCallbackFunction<T extends GenericFunction>(\n functionName: FMember,\n original: T,\n config: FsInstrumentationConfig,\n): T {\n const patchedFunction = function (this: unknown, ...args: Parameters<T>): ReturnType<T> {\n const lastIdx = args.length - 1;\n const cb: unknown = args[lastIdx];\n if (typeof cb !== 'function') {\n return original.apply(this, args) as ReturnType<T>;\n }\n\n const attributes = getSpanAttributes(functionName, args, config);\n const span = startInactiveSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes });\n const parentSpan = getActiveSpan();\n\n // Wrap the callback to end the span and restore the caller's active span context.\n // fs callbacks fire from Node's I/O event loop where the AsyncLocalStorage context\n // is lost, so any spans created inside the callback would otherwise have no parent.\n args[lastIdx] = function (this: unknown, ...cbArgs: unknown[]) {\n const error = cbArgs[0];\n if (error) {\n recordError(span, error, config);\n }\n span.end();\n if (parentSpan) {\n return withActiveSpan(parentSpan, () => (cb as GenericFunction).apply(this, cbArgs));\n }\n return (cb as GenericFunction).apply(this, cbArgs);\n };\n\n try {\n return suppressTracing(() => original.apply(this, args)) as ReturnType<T>;\n } catch (error) {\n recordError(span, error, config);\n span.end();\n throw error;\n }\n };\n return patchedFunctionWithOriginalProperties(patchedFunction as T, original);\n}\n\nfunction _patchExistsCallbackFunction<T extends GenericFunction>(original: T, config: FsInstrumentationConfig): T {\n const functionName = 'exists' as FMember;\n const patchedFunction = function (this: unknown, ...args: Parameters<T>): ReturnType<T> {\n const lastIdx = args.length - 1;\n const cb: unknown = args[lastIdx];\n if (typeof cb !== 'function') {\n return original.apply(this, args) as ReturnType<T>;\n }\n\n const attributes = getSpanAttributes(functionName, args, config);\n const span = startInactiveSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes });\n const parentSpan = getActiveSpan();\n\n // `exists` never calls the callback with an error\n args[lastIdx] = function (this: unknown, ...cbArgs: unknown[]) {\n span.end();\n if (parentSpan) {\n return withActiveSpan(parentSpan, () => (cb as GenericFunction).apply(this, cbArgs));\n }\n return (cb as GenericFunction).apply(this, cbArgs);\n };\n\n try {\n return suppressTracing(() => original.apply(this, args)) as ReturnType<T>;\n } catch (error) {\n recordError(span, error, config);\n span.end();\n throw error;\n }\n };\n const functionWithOriginalProperties = patchedFunctionWithOriginalProperties(patchedFunction as T, original);\n\n // `exists` has a custom promisify function because of the inconsistent signature\n // replicating that on the patched function\n const promisified = function (path: unknown): Promise<unknown> {\n return new Promise(resolve => (functionWithOriginalProperties as GenericFunction)(path, resolve));\n };\n Object.defineProperty(promisified, 'name', { value: functionName });\n Object.defineProperty(functionWithOriginalProperties, promisify.custom, {\n value: promisified,\n });\n\n return functionWithOriginalProperties;\n}\n\nfunction _patchPromiseFunction<T extends GenericFunction>(\n functionName: FPMember,\n original: T,\n config: FsInstrumentationConfig,\n): T {\n const patchedFunction = async function (this: unknown, ...args: Parameters<T>): Promise<unknown> {\n const attributes = getSpanAttributes(functionName, args, config);\n return startSpan({ name: `fs.${functionName}`, onlyIfParent: true, attributes }, async span => {\n try {\n return await suppressTracing(() => original.apply(this, args) as Promise<unknown>);\n } catch (error) {\n recordError(span, error, config);\n throw error;\n }\n });\n };\n return patchedFunctionWithOriginalProperties(patchedFunction as unknown as T, original);\n}\n\nexport function enableFsInstrumentation(config: FsInstrumentationConfig = {}): void {\n for (const fName of SYNC_FUNCTIONS) {\n const { objectToPatch, functionNameToPatch } = indexFs(fs, fName);\n _patchMethod(objectToPatch, functionNameToPatch, original => _patchSyncFunction(fName, original, config));\n }\n\n for (const fName of CALLBACK_FUNCTIONS) {\n const { objectToPatch, functionNameToPatch } = indexFs(fs, fName);\n if (fName === 'exists') {\n _patchMethod(objectToPatch, functionNameToPatch, original => _patchExistsCallbackFunction(original, config));\n } else {\n _patchMethod(objectToPatch, functionNameToPatch, original => _patchCallbackFunction(fName, original, config));\n }\n }\n\n // `fs.promises` and `import { readFile } from 'fs/promises'` share the same object in Node 14+,\n // so patching one covers both.\n const fsPromises = fs.promises as unknown as Record<string, GenericFunction>;\n for (const fName of PROMISE_FUNCTIONS) {\n _patchMethod(fsPromises, fName, original => _patchPromiseFunction(fName, original, config));\n }\n}\n\n/**\n * Sets the error status on the span and, if configured, records the error type as a span attribute.\n */\nfunction recordError(span: Span, error: unknown, config: FsInstrumentationConfig): void {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n if (config.recordErrorMessagesAsSpanAttributes && error instanceof Error) {\n span.setAttribute(ERROR_TYPE, (error as NodeJS.ErrnoException).code ?? error.name);\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAmCA,MAAM,WAAA,GAAc,cAAA;AACpB,MAAM,OAAA,GAAU,IAAA;AAIhB,MAAM,oCAAA,GAAuC,CAAC,QAAA,EAAU,YAAY,CAAA;AACpE,MAAM,2BAAA,GAA8B,CAAC,UAAA,EAAY,IAAA,EAAM,gBAAgB,QAAQ,CAAA;AAC/E,MAAM,yCAAA,GAA4C,CAAC,MAAA,EAAQ,UAAU,CAAA;AACrE,MAAM,yBAAA,GAA4B,CAAC,SAAA,EAAW,aAAa,CAAA;AAC3D,MAAM,8BAAA,GAAiC,CAAC,SAAA,EAAW,aAAa,CAAA;AAChE,MAAM,2BAAA,GAA8B;AAAA,EAClC,QAAA;AAAA,EACA,YAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,IAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,gBAAA;AAAA,EACA,WAAA;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,WAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,qBAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AA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e,mBAAA,EAAqB,CAAA,QAAA,KAAY,uBAAuB,KAAA,EAAO,QAAA,EAAU,MAAM,CAAC,CAAA;AAAA,IAC9G;AAAA,EACF;AAIA,EAAA,MAAM,aAAa,EAAA,CAAG,QAAA;AACtB,EAAA,KAAA,MAAW,SAAS,iBAAA,EAAmB;AACrC,IAAA,YAAA,CAAa,YAAY,KAAA,EAAO,CAAA,QAAA,KAAY,sBAAsB,KAAA,EAAO,QAAA,EAAU,MAAM,CAAC,CAAA;AAAA,EAC5F;AACF;AAKA,SAAS,WAAA,CAAY,IAAA,EAAY,KAAA,EAAgB,MAAA,EAAuC;AACtF,EAAA,IAAA,CAAK,UAAU,EAAE,IAAA,EAAM,iBAAA,EAAmB,OAAA,EAAS,kBAAkB,CAAA;AACrE,EAAA,IAAI,MAAA,CAAO,mCAAA,IAAuC,KAAA,YAAiB,KAAA,EAAO;AACxE,IAAA,IAAA,CAAK,YAAA,CAAa,UAAA,EAAa,KAAA,CAAgC,IAAA,IAAQ,MAAM,IAAI,CAAA;AAAA,EACnF;AACF;;;;"}
@@ -0,0 +1,60 @@
1
+ import { context, trace } from '@opentelemetry/api';
2
+ import { isTracingSuppressed } from '@sentry/core';
3
+ import { getHttpClientSubscriptions, HTTP_ON_CLIENT_REQUEST, patchHttpModuleClient, getRequestOptions } from '@sentry/core/server';
4
+ import { subscribeDiagnosticsChannel } from '@sentry/server-utils';
5
+ import { NODE_VERSION } from '../../nodeVersion.js';
6
+ import { errorMonitor } from 'node:events';
7
+ import * as http from 'node:http';
8
+
9
+ const FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL = NODE_VERSION.major === 22 && NODE_VERSION.minor >= 12 || NODE_VERSION.major === 23 && NODE_VERSION.minor >= 2 || NODE_VERSION.major >= 24;
10
+ function instrumentHttpOutgoingRequests(instrumentationOptions = {}) {
11
+ const { outgoingRequestApplyCustomAttributes: applyCustomAttributesOnSpan, ...options } = instrumentationOptions;
12
+ const patchOptions = {
13
+ applyCustomAttributesOnSpan,
14
+ ...options,
15
+ tracePropagation: options.tracePropagation ?? true,
16
+ spans: options.spans ?? true,
17
+ ignoreOutgoingRequests(url, request) {
18
+ return isTracingSuppressed() || !!options.ignoreOutgoingRequests?.(url, getRequestOptions(request));
19
+ },
20
+ outgoingRequestHook(span, request) {
21
+ options.outgoingRequestHook?.(span, request);
22
+ const originalOnce = request.once;
23
+ const newOnce = new Proxy(originalOnce, {
24
+ apply(target, thisArg, args) {
25
+ const [event] = args;
26
+ if (event !== "response") {
27
+ return target.apply(thisArg, args);
28
+ }
29
+ const parentContext = context.active();
30
+ const requestContext = trace.setSpan(parentContext, span);
31
+ return context.with(requestContext, () => {
32
+ return target.apply(thisArg, args);
33
+ });
34
+ }
35
+ });
36
+ request.once = newOnce;
37
+ },
38
+ outgoingResponseHook(span, response) {
39
+ options.outgoingResponseHook?.(span, response);
40
+ },
41
+ errorMonitor,
42
+ // Pass these in to detect OTel double-wrapping if we're enabling spans
43
+ http
44
+ };
45
+ if (FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL) {
46
+ instrumentHttpOutgoingRequestsViaChannel(patchOptions);
47
+ } else {
48
+ instrumentHttpOutgoingRequestsViaMonkeyPatching(patchOptions);
49
+ }
50
+ }
51
+ function instrumentHttpOutgoingRequestsViaChannel(options) {
52
+ const { [HTTP_ON_CLIENT_REQUEST]: onHttpClientRequestCreated } = getHttpClientSubscriptions(options);
53
+ subscribeDiagnosticsChannel(HTTP_ON_CLIENT_REQUEST, onHttpClientRequestCreated);
54
+ }
55
+ function instrumentHttpOutgoingRequestsViaMonkeyPatching(options) {
56
+ patchHttpModuleClient(http, options);
57
+ }
58
+
59
+ export { instrumentHttpOutgoingRequests };
60
+ //# sourceMappingURL=SentryHttpInstrumentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SentryHttpInstrumentation.js","sources":["../../../../src/integrations/http/SentryHttpInstrumentation.ts"],"sourcesContent":["import { context, trace } from '@opentelemetry/api';\nimport type { ClientRequest, IncomingMessage } from 'node:http';\nimport type { Span } from '@sentry/core';\nimport { isTracingSuppressed } from '@sentry/core';\nimport type { HttpClientRequest, HttpIncomingMessage, HttpInstrumentationOptions } from '@sentry/core/server';\nimport {\n getHttpClientSubscriptions,\n getRequestOptions,\n HTTP_ON_CLIENT_REQUEST,\n patchHttpModuleClient,\n} from '@sentry/core/server';\nimport { subscribeDiagnosticsChannel } from '@sentry/server-utils';\nimport { NODE_VERSION } from '../../nodeVersion';\nimport { errorMonitor } from 'node:events';\nimport * as http from 'node:http';\n\nconst FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL =\n (NODE_VERSION.major === 22 && NODE_VERSION.minor >= 12) ||\n (NODE_VERSION.major === 23 && NODE_VERSION.minor >= 2) ||\n NODE_VERSION.major >= 24;\n\nexport interface OutgoingHttpRequestInstrumentationOptions {\n /**\n * Whether breadcrumbs should be recorded for outgoing requests.\n *\n * @default `true`\n */\n breadcrumbs?: boolean;\n\n /**\n * Whether to create spans for outgoing requests.\n *\n * @default `true`\n */\n spans?: boolean;\n\n /**\n * Whether to propagate Sentry trace headers in outgoing requests.\n *\n * @default `true`\n */\n tracePropagation?: boolean;\n\n /**\n * Do not instrument outgoing HTTP requests to URLs where the given callback returns `true`.\n * When it returns `true`, the request is skipped entirely: no breadcrumb and no span are created,\n * and no trace headers are propagated for that request.\n *\n * @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.\n * @param request Contains the {@type RequestOptions} object used to make the outgoing request.\n */\n ignoreOutgoingRequests?: (url: string, request: http.RequestOptions) => boolean;\n\n /**\n * Hooks for outgoing request spans, only called when spans are created for outgoing requests\n * (i.e. when `spans` is enabled).\n */\n outgoingRequestHook?: (span: Span, request: ClientRequest) => void;\n outgoingResponseHook?: (span: Span, response: IncomingMessage) => void;\n outgoingRequestApplyCustomAttributes?: (\n span: Span,\n request: HttpClientRequest,\n response: HttpIncomingMessage,\n ) => void;\n}\n\n/**\n * This instruments the http modules for outgoing requests.\n * It uses the diagnostics channel if available, otherwise it falls back to monkey-patching.\n *\n * The instrumentation will start spans, create breadcrumbs, and propagate trace headers in outgoing requests (depending on the settings).\n */\nexport function instrumentHttpOutgoingRequests(\n instrumentationOptions: OutgoingHttpRequestInstrumentationOptions = {},\n): void {\n const { outgoingRequestApplyCustomAttributes: applyCustomAttributesOnSpan, ...options } = instrumentationOptions;\n const patchOptions = {\n applyCustomAttributesOnSpan,\n ...options,\n tracePropagation: options.tracePropagation ?? true,\n spans: options.spans ?? true,\n ignoreOutgoingRequests(url, request) {\n return isTracingSuppressed() || !!options.ignoreOutgoingRequests?.(url, getRequestOptions(request));\n },\n outgoingRequestHook(span, request) {\n options.outgoingRequestHook?.(span, request as ClientRequest);\n // We monkey-patch `req.once('response'), which is used to trigger\n // the callback of the request, so that it runs in the active context\n // eslint-disable-next-line @typescript-eslint/unbound-method, typescript/no-deprecated\n const originalOnce = request.once;\n\n const newOnce = new Proxy(originalOnce, {\n apply(target, thisArg, args: Parameters<typeof originalOnce>) {\n const [event] = args;\n if (event !== 'response') {\n return target.apply(thisArg, args);\n }\n\n const parentContext = context.active();\n const requestContext = trace.setSpan(parentContext, span);\n\n return context.with(requestContext, () => {\n return target.apply(thisArg, args);\n });\n },\n });\n\n // eslint-disable-next-line typescript/no-deprecated\n request.once = newOnce;\n },\n outgoingResponseHook(span, response) {\n options.outgoingResponseHook?.(span, response as IncomingMessage);\n },\n errorMonitor,\n // Pass these in to detect OTel double-wrapping if we're enabling spans\n http,\n } satisfies HttpInstrumentationOptions;\n\n if (FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL) {\n instrumentHttpOutgoingRequestsViaChannel(patchOptions);\n } else {\n instrumentHttpOutgoingRequestsViaMonkeyPatching(patchOptions);\n }\n}\n\nfunction instrumentHttpOutgoingRequestsViaChannel(options: HttpInstrumentationOptions): void {\n const { [HTTP_ON_CLIENT_REQUEST]: onHttpClientRequestCreated } = getHttpClientSubscriptions(options);\n subscribeDiagnosticsChannel(HTTP_ON_CLIENT_REQUEST, onHttpClientRequestCreated);\n}\n\n/**\n * Instrument outgoing HTTP(S) requests by old-school monkey-patching the `http` module.\n * This is the fallback for runtimes that do not fully support the `node:http` client diagnostics channel\n * (Node < 22.12).\n */\nfunction instrumentHttpOutgoingRequestsViaMonkeyPatching(options: HttpInstrumentationOptions): void {\n // Patching http also patches https, as this uses the same underlying object\n patchHttpModuleClient(http, options);\n}\n"],"names":[],"mappings":";;;;;;;;AAgBA,MAAM,uCAAA,GACH,YAAA,CAAa,KAAA,KAAU,EAAA,IAAM,aAAa,KAAA,IAAS,EAAA,IACnD,YAAA,CAAa,KAAA,KAAU,EAAA,IAAM,YAAA,CAAa,KAAA,IAAS,CAAA,IACpD,aAAa,KAAA,IAAS,EAAA;AAqDjB,SAAS,8BAAA,CACd,sBAAA,GAAoE,EAAC,EAC/D;AACN,EAAA,MAAM,EAAE,oCAAA,EAAsC,2BAAA,EAA6B,GAAG,SAAQ,GAAI,sBAAA;AAC1F,EAAA,MAAM,YAAA,GAAe;AAAA,IACnB,2BAAA;AAAA,IACA,GAAG,OAAA;AAAA,IACH,gBAAA,EAAkB,QAAQ,gBAAA,IAAoB,IAAA;AAAA,IAC9C,KAAA,EAAO,QAAQ,KAAA,IAAS,IAAA;AAAA,IACxB,sBAAA,CAAuB,KAAK,OAAA,EAAS;AACnC,MAAA,OAAO,mBAAA,MAAyB,CAAC,CAAC,QAAQ,sBAAA,GAAyB,GAAA,EAAK,iBAAA,CAAkB,OAAO,CAAC,CAAA;AAAA,IACpG,CAAA;AAAA,IACA,mBAAA,CAAoB,MAAM,OAAA,EAAS;AACjC,MAAA,OAAA,CAAQ,mBAAA,GAAsB,MAAM,OAAwB,CAAA;AAI5D,MAAA,MAAM,eAAe,OAAA,CAAQ,IAAA;AAE7B,MAAA,MAAM,OAAA,GAAU,IAAI,KAAA,CAAM,YAAA,EAAc;AAAA,QACtC,KAAA,CAAM,MAAA,EAAQ,OAAA,EAAS,IAAA,EAAuC;AAC5D,UAAA,MAAM,CAAC,KAAK,CAAA,GAAI,IAAA;AAChB,UAAA,IAAI,UAAU,UAAA,EAAY;AACxB,YAAA,OAAO,MAAA,CAAO,KAAA,CAAM,OAAA,EAAS,IAAI,CAAA;AAAA,UACnC;AAEA,UAAA,MAAM,aAAA,GAAgB,QAAQ,MAAA,EAAO;AACrC,UAAA,MAAM,cAAA,GAAiB,KAAA,CAAM,OAAA,CAAQ,aAAA,EAAe,IAAI,CAAA;AAExD,UAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,cAAA,EAAgB,MAAM;AACxC,YAAA,OAAO,MAAA,CAAO,KAAA,CAAM,OAAA,EAAS,IAAI,CAAA;AAAA,UACnC,CAAC,CAAA;AAAA,QACH;AAAA,OACD,CAAA;AAGD,MAAA,OAAA,CAAQ,IAAA,GAAO,OAAA;AAAA,IACjB,CAAA;AAAA,IACA,oBAAA,CAAqB,MAAM,QAAA,EAAU;AACnC,MAAA,OAAA,CAAQ,oBAAA,GAAuB,MAAM,QAA2B,CAAA;AAAA,IAClE,CAAA;AAAA,IACA,YAAA;AAAA;AAAA,IAEA;AAAA,GACF;AAEA,EAAA,IAAI,uCAAA,EAAyC;AAC3C,IAAA,wCAAA,CAAyC,YAAY,CAAA;AAAA,EACvD,CAAA,MAAO;AACL,IAAA,+CAAA,CAAgD,YAAY,CAAA;AAAA,EAC9D;AACF;AAEA,SAAS,yCAAyC,OAAA,EAA2C;AAC3F,EAAA,MAAM,EAAE,CAAC,sBAAsB,GAAG,0BAAA,EAA2B,GAAI,2BAA2B,OAAO,CAAA;AACnG,EAAA,2BAAA,CAA4B,wBAAwB,0BAA0B,CAAA;AAChF;AAOA,SAAS,gDAAgD,OAAA,EAA2C;AAElG,EAAA,qBAAA,CAAsB,MAAM,OAAO,CAAA;AACrC;;;;"}
@@ -0,0 +1,75 @@
1
+ import { createContextKey, context, propagation } from '@opentelemetry/api';
2
+ import { debug, getClient, addNonEnumerableProperty } from '@sentry/core';
3
+ import { getHttpServerSubscriptions, HTTP_ON_SERVER_REQUEST } from '@sentry/core/server';
4
+ export { recordRequestSession } from '@sentry/core/server';
5
+ import { subscribeDiagnosticsChannel } from '@sentry/server-utils';
6
+ import { DEBUG_BUILD } from '../../debug-build.js';
7
+
8
+ const HTTP_SERVER_INSTRUMENTED_KEY = createContextKey("sentry_http_server_instrumented");
9
+ const INTEGRATION_NAME = "Http.Server";
10
+ function addStartSpanCallback(request, callback) {
11
+ addNonEnumerableProperty(request, "_startSpanCallback", new WeakRef(callback));
12
+ }
13
+ const _httpServerIntegration = ((options = {}) => {
14
+ const _options = {
15
+ sessions: options.sessions ?? true,
16
+ sessionFlushingDelayMS: options.sessionFlushingDelayMS ?? 6e4,
17
+ maxRequestBodySize: options.maxRequestBodySize,
18
+ // Server spans are created by `httpServerSpansIntegration` via the
19
+ // `httpServerRequest` client event + `_startSpanCallback`, not by the
20
+ // core subscription helper. Explicitly opt out so the helper does not
21
+ // double-create spans when the client has tracing enabled.
22
+ spans: false,
23
+ // Cast: core uses HttpIncomingMessage; node consumers pass
24
+ // RequestOptions-typed callbacks.
25
+ // The two are structurally compatible for the fields the callback reads
26
+ // (url, method, headers).
27
+ ignoreRequestBody: options.ignoreRequestBody,
28
+ /**
29
+ * Hook called by core's `instrumentServer` to wrap the upstream
30
+ * `emit('request')` call.
31
+ *
32
+ * We use it to extract OTel context from request headers and re-enter
33
+ * the OTel context before the framework sees the request, so subsequent
34
+ * spans (eg from `httpServerSpansIntegration`) attach to the right trace.
35
+ */
36
+ wrapServerEmitRequest(request, response, normalizedRequest, next) {
37
+ const client = getClient();
38
+ if (!client) return next();
39
+ if (context.active().getValue(HTTP_SERVER_INSTRUMENTED_KEY)) {
40
+ return next();
41
+ }
42
+ const ctx = propagation.extract(context.active(), normalizedRequest.headers).setValue(HTTP_SERVER_INSTRUMENTED_KEY, true);
43
+ context.with(ctx, () => {
44
+ client.emit("httpServerRequest", request, response, normalizedRequest);
45
+ const callback = request._startSpanCallback?.deref();
46
+ if (callback) {
47
+ callback(() => {
48
+ next();
49
+ return true;
50
+ });
51
+ } else {
52
+ next();
53
+ }
54
+ });
55
+ }
56
+ };
57
+ return {
58
+ name: INTEGRATION_NAME,
59
+ setupOnce() {
60
+ const { [HTTP_ON_SERVER_REQUEST]: onHttpServerRequestStart } = getHttpServerSubscriptions(_options);
61
+ subscribeDiagnosticsChannel(HTTP_ON_SERVER_REQUEST, onHttpServerRequestStart);
62
+ },
63
+ afterAllSetup(client) {
64
+ if (DEBUG_BUILD && client.getIntegrationByName("Http")) {
65
+ debug.warn(
66
+ "It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`."
67
+ );
68
+ }
69
+ }
70
+ };
71
+ });
72
+ const httpServerIntegration = _httpServerIntegration;
73
+
74
+ export { addStartSpanCallback, httpServerIntegration };
75
+ //# sourceMappingURL=httpServerIntegration.js.map