@sentry/node 9.35.0 → 9.36.0-alpha.1

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 (474) hide show
  1. package/build/cjs/index.js +38 -56
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/fs.js +2 -2
  4. package/build/cjs/integrations/fs.js.map +1 -1
  5. package/build/cjs/integrations/http/index.js +7 -11
  6. package/build/cjs/integrations/http/index.js.map +1 -1
  7. package/build/cjs/integrations/node-fetch/index.js +4 -5
  8. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  9. package/build/cjs/integrations/tracing/amqplib.js +4 -5
  10. package/build/cjs/integrations/tracing/amqplib.js.map +1 -1
  11. package/build/cjs/integrations/tracing/connect.js +3 -4
  12. package/build/cjs/integrations/tracing/connect.js.map +1 -1
  13. package/build/cjs/integrations/tracing/dataloader.js +3 -3
  14. package/build/cjs/integrations/tracing/dataloader.js.map +1 -1
  15. package/build/cjs/integrations/tracing/express.js +5 -7
  16. package/build/cjs/integrations/tracing/express.js.map +1 -1
  17. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js +3 -3
  18. package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  19. package/build/cjs/integrations/tracing/fastify/index.js +6 -6
  20. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -1
  21. package/build/cjs/integrations/tracing/genericPool.js +3 -3
  22. package/build/cjs/integrations/tracing/genericPool.js.map +1 -1
  23. package/build/cjs/integrations/tracing/graphql.js +3 -4
  24. package/build/cjs/integrations/tracing/graphql.js.map +1 -1
  25. package/build/cjs/integrations/tracing/hapi/index.js +3 -4
  26. package/build/cjs/integrations/tracing/hapi/index.js.map +1 -1
  27. package/build/cjs/integrations/tracing/kafka.js +4 -5
  28. package/build/cjs/integrations/tracing/kafka.js.map +1 -1
  29. package/build/cjs/integrations/tracing/knex.js +3 -3
  30. package/build/cjs/integrations/tracing/knex.js.map +1 -1
  31. package/build/cjs/integrations/tracing/koa.js +4 -6
  32. package/build/cjs/integrations/tracing/koa.js.map +1 -1
  33. package/build/cjs/integrations/tracing/lrumemoizer.js +2 -2
  34. package/build/cjs/integrations/tracing/lrumemoizer.js.map +1 -1
  35. package/build/cjs/integrations/tracing/mongo.js +3 -4
  36. package/build/cjs/integrations/tracing/mongo.js.map +1 -1
  37. package/build/cjs/integrations/tracing/mongoose.js +3 -4
  38. package/build/cjs/integrations/tracing/mongoose.js.map +1 -1
  39. package/build/cjs/integrations/tracing/mysql.js +2 -2
  40. package/build/cjs/integrations/tracing/mysql.js.map +1 -1
  41. package/build/cjs/integrations/tracing/mysql2.js +3 -4
  42. package/build/cjs/integrations/tracing/mysql2.js.map +1 -1
  43. package/build/cjs/integrations/tracing/postgres.js +3 -4
  44. package/build/cjs/integrations/tracing/postgres.js.map +1 -1
  45. package/build/cjs/integrations/tracing/postgresjs.js +3 -4
  46. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  47. package/build/cjs/integrations/tracing/prisma.js +2 -2
  48. package/build/cjs/integrations/tracing/prisma.js.map +1 -1
  49. package/build/cjs/integrations/tracing/redis.js +3 -3
  50. package/build/cjs/integrations/tracing/redis.js.map +1 -1
  51. package/build/cjs/integrations/tracing/tedious.js +3 -3
  52. package/build/cjs/integrations/tracing/tedious.js.map +1 -1
  53. package/build/cjs/integrations/tracing/vercelai/index.js +2 -2
  54. package/build/cjs/integrations/tracing/vercelai/index.js.map +1 -1
  55. package/build/cjs/preload.js +2 -2
  56. package/build/cjs/preload.js.map +1 -1
  57. package/build/cjs/sdk/index.js +22 -203
  58. package/build/cjs/sdk/index.js.map +1 -1
  59. package/build/cjs/sdk/initOtel.js +4 -22
  60. package/build/cjs/sdk/initOtel.js.map +1 -1
  61. package/build/esm/index.js +2 -21
  62. package/build/esm/index.js.map +1 -1
  63. package/build/esm/integrations/fs.js +1 -1
  64. package/build/esm/integrations/fs.js.map +1 -1
  65. package/build/esm/integrations/http/index.js +1 -5
  66. package/build/esm/integrations/http/index.js.map +1 -1
  67. package/build/esm/integrations/node-fetch/index.js +2 -3
  68. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  69. package/build/esm/integrations/tracing/amqplib.js +1 -2
  70. package/build/esm/integrations/tracing/amqplib.js.map +1 -1
  71. package/build/esm/integrations/tracing/connect.js +1 -2
  72. package/build/esm/integrations/tracing/connect.js.map +1 -1
  73. package/build/esm/integrations/tracing/dataloader.js +1 -1
  74. package/build/esm/integrations/tracing/dataloader.js.map +1 -1
  75. package/build/esm/integrations/tracing/express.js +2 -4
  76. package/build/esm/integrations/tracing/express.js.map +1 -1
  77. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js +3 -3
  78. package/build/esm/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
  79. package/build/esm/integrations/tracing/fastify/index.js +5 -5
  80. package/build/esm/integrations/tracing/fastify/index.js.map +1 -1
  81. package/build/esm/integrations/tracing/genericPool.js +1 -1
  82. package/build/esm/integrations/tracing/genericPool.js.map +1 -1
  83. package/build/esm/integrations/tracing/graphql.js +2 -3
  84. package/build/esm/integrations/tracing/graphql.js.map +1 -1
  85. package/build/esm/integrations/tracing/hapi/index.js +1 -2
  86. package/build/esm/integrations/tracing/hapi/index.js.map +1 -1
  87. package/build/esm/integrations/tracing/kafka.js +1 -2
  88. package/build/esm/integrations/tracing/kafka.js.map +1 -1
  89. package/build/esm/integrations/tracing/knex.js +1 -1
  90. package/build/esm/integrations/tracing/knex.js.map +1 -1
  91. package/build/esm/integrations/tracing/koa.js +2 -4
  92. package/build/esm/integrations/tracing/koa.js.map +1 -1
  93. package/build/esm/integrations/tracing/lrumemoizer.js +1 -1
  94. package/build/esm/integrations/tracing/lrumemoizer.js.map +1 -1
  95. package/build/esm/integrations/tracing/mongo.js +1 -2
  96. package/build/esm/integrations/tracing/mongo.js.map +1 -1
  97. package/build/esm/integrations/tracing/mongoose.js +1 -2
  98. package/build/esm/integrations/tracing/mongoose.js.map +1 -1
  99. package/build/esm/integrations/tracing/mysql.js +1 -1
  100. package/build/esm/integrations/tracing/mysql.js.map +1 -1
  101. package/build/esm/integrations/tracing/mysql2.js +1 -2
  102. package/build/esm/integrations/tracing/mysql2.js.map +1 -1
  103. package/build/esm/integrations/tracing/postgres.js +1 -2
  104. package/build/esm/integrations/tracing/postgres.js.map +1 -1
  105. package/build/esm/integrations/tracing/postgresjs.js +2 -3
  106. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  107. package/build/esm/integrations/tracing/prisma.js +1 -1
  108. package/build/esm/integrations/tracing/prisma.js.map +1 -1
  109. package/build/esm/integrations/tracing/redis.js +1 -1
  110. package/build/esm/integrations/tracing/redis.js.map +1 -1
  111. package/build/esm/integrations/tracing/tedious.js +1 -1
  112. package/build/esm/integrations/tracing/tedious.js.map +1 -1
  113. package/build/esm/integrations/tracing/vercelai/index.js +1 -1
  114. package/build/esm/integrations/tracing/vercelai/index.js.map +1 -1
  115. package/build/esm/package.json +1 -1
  116. package/build/esm/preload.js +1 -1
  117. package/build/esm/preload.js.map +1 -1
  118. package/build/esm/sdk/index.js +22 -202
  119. package/build/esm/sdk/index.js.map +1 -1
  120. package/build/esm/sdk/initOtel.js +3 -21
  121. package/build/esm/sdk/initOtel.js.map +1 -1
  122. package/build/types/index.d.ts +2 -21
  123. package/build/types/index.d.ts.map +1 -1
  124. package/build/types/integrations/http/index.d.ts +1 -1
  125. package/build/types/integrations/http/index.d.ts.map +1 -1
  126. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  127. package/build/types/integrations/tracing/amqplib.d.ts.map +1 -1
  128. package/build/types/integrations/tracing/connect.d.ts.map +1 -1
  129. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  130. package/build/types/integrations/tracing/graphql.d.ts.map +1 -1
  131. package/build/types/integrations/tracing/hapi/index.d.ts.map +1 -1
  132. package/build/types/integrations/tracing/kafka.d.ts.map +1 -1
  133. package/build/types/integrations/tracing/koa.d.ts.map +1 -1
  134. package/build/types/integrations/tracing/mongo.d.ts.map +1 -1
  135. package/build/types/integrations/tracing/mongoose.d.ts.map +1 -1
  136. package/build/types/integrations/tracing/mysql2.d.ts.map +1 -1
  137. package/build/types/integrations/tracing/postgres.d.ts.map +1 -1
  138. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
  139. package/build/types/integrations/tracing/vercelai/index.d.ts.map +1 -1
  140. package/build/types/sdk/index.d.ts +2 -6
  141. package/build/types/sdk/index.d.ts.map +1 -1
  142. package/build/types/sdk/initOtel.d.ts +1 -1
  143. package/build/types/sdk/initOtel.d.ts.map +1 -1
  144. package/build/types/types.d.ts +1 -1
  145. package/build/types/types.d.ts.map +1 -1
  146. package/build/types-ts3.8/index.d.ts +2 -21
  147. package/build/types-ts3.8/integrations/http/index.d.ts +1 -1
  148. package/build/types-ts3.8/sdk/index.d.ts +2 -6
  149. package/build/types-ts3.8/sdk/initOtel.d.ts +1 -1
  150. package/build/types-ts3.8/types.d.ts +1 -1
  151. package/package.json +4 -3
  152. package/build/cjs/cron/common.js +0 -56
  153. package/build/cjs/cron/common.js.map +0 -1
  154. package/build/cjs/cron/cron.js +0 -112
  155. package/build/cjs/cron/cron.js.map +0 -1
  156. package/build/cjs/cron/index.js +0 -15
  157. package/build/cjs/cron/index.js.map +0 -1
  158. package/build/cjs/cron/node-cron.js +0 -71
  159. package/build/cjs/cron/node-cron.js.map +0 -1
  160. package/build/cjs/cron/node-schedule.js +0 -65
  161. package/build/cjs/cron/node-schedule.js.map +0 -1
  162. package/build/cjs/integrations/anr/index.js +0 -238
  163. package/build/cjs/integrations/anr/index.js.map +0 -1
  164. package/build/cjs/integrations/childProcess.js +0 -100
  165. package/build/cjs/integrations/childProcess.js.map +0 -1
  166. package/build/cjs/integrations/context.js +0 -457
  167. package/build/cjs/integrations/context.js.map +0 -1
  168. package/build/cjs/integrations/contextlines.js +0 -405
  169. package/build/cjs/integrations/contextlines.js.map +0 -1
  170. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +0 -558
  171. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  172. package/build/cjs/integrations/local-variables/common.js +0 -69
  173. package/build/cjs/integrations/local-variables/common.js.map +0 -1
  174. package/build/cjs/integrations/local-variables/index.js +0 -12
  175. package/build/cjs/integrations/local-variables/index.js.map +0 -1
  176. package/build/cjs/integrations/local-variables/local-variables-async.js +0 -143
  177. package/build/cjs/integrations/local-variables/local-variables-async.js.map +0 -1
  178. package/build/cjs/integrations/local-variables/local-variables-sync.js +0 -410
  179. package/build/cjs/integrations/local-variables/local-variables-sync.js.map +0 -1
  180. package/build/cjs/integrations/modules.js +0 -135
  181. package/build/cjs/integrations/modules.js.map +0 -1
  182. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -291
  183. package/build/cjs/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  184. package/build/cjs/integrations/onuncaughtexception.js +0 -134
  185. package/build/cjs/integrations/onuncaughtexception.js.map +0 -1
  186. package/build/cjs/integrations/onunhandledrejection.js +0 -89
  187. package/build/cjs/integrations/onunhandledrejection.js.map +0 -1
  188. package/build/cjs/integrations/processSession.js +0 -36
  189. package/build/cjs/integrations/processSession.js.map +0 -1
  190. package/build/cjs/integrations/spotlight.js +0 -101
  191. package/build/cjs/integrations/spotlight.js.map +0 -1
  192. package/build/cjs/integrations/winston.js +0 -151
  193. package/build/cjs/integrations/winston.js.map +0 -1
  194. package/build/cjs/logs/capture.js +0 -29
  195. package/build/cjs/logs/capture.js.map +0 -1
  196. package/build/cjs/logs/exports.js +0 -178
  197. package/build/cjs/logs/exports.js.map +0 -1
  198. package/build/cjs/nodeVersion.js +0 -12
  199. package/build/cjs/nodeVersion.js.map +0 -1
  200. package/build/cjs/otel/contextManager.js +0 -16
  201. package/build/cjs/otel/contextManager.js.map +0 -1
  202. package/build/cjs/otel/instrument.js +0 -139
  203. package/build/cjs/otel/instrument.js.map +0 -1
  204. package/build/cjs/proxy/base.js +0 -122
  205. package/build/cjs/proxy/base.js.map +0 -1
  206. package/build/cjs/proxy/index.js +0 -173
  207. package/build/cjs/proxy/index.js.map +0 -1
  208. package/build/cjs/proxy/parse-proxy-response.js +0 -104
  209. package/build/cjs/proxy/parse-proxy-response.js.map +0 -1
  210. package/build/cjs/sdk/api.js +0 -117
  211. package/build/cjs/sdk/api.js.map +0 -1
  212. package/build/cjs/sdk/client.js +0 -156
  213. package/build/cjs/sdk/client.js.map +0 -1
  214. package/build/cjs/transports/http.js +0 -158
  215. package/build/cjs/transports/http.js.map +0 -1
  216. package/build/cjs/utils/addOriginToSpan.js +0 -11
  217. package/build/cjs/utils/addOriginToSpan.js.map +0 -1
  218. package/build/cjs/utils/baggage.js +0 -36
  219. package/build/cjs/utils/baggage.js.map +0 -1
  220. package/build/cjs/utils/commonjs.js +0 -13
  221. package/build/cjs/utils/commonjs.js.map +0 -1
  222. package/build/cjs/utils/createMissingInstrumentationContext.js +0 -11
  223. package/build/cjs/utils/createMissingInstrumentationContext.js.map +0 -1
  224. package/build/cjs/utils/debug.js +0 -23
  225. package/build/cjs/utils/debug.js.map +0 -1
  226. package/build/cjs/utils/ensureIsWrapped.js +0 -41
  227. package/build/cjs/utils/ensureIsWrapped.js.map +0 -1
  228. package/build/cjs/utils/envToBool.js +0 -32
  229. package/build/cjs/utils/envToBool.js.map +0 -1
  230. package/build/cjs/utils/errorhandling.js +0 -42
  231. package/build/cjs/utils/errorhandling.js.map +0 -1
  232. package/build/cjs/utils/getRequestUrl.js +0 -18
  233. package/build/cjs/utils/getRequestUrl.js.map +0 -1
  234. package/build/cjs/utils/module.js +0 -60
  235. package/build/cjs/utils/module.js.map +0 -1
  236. package/build/esm/cron/common.js +0 -54
  237. package/build/esm/cron/common.js.map +0 -1
  238. package/build/esm/cron/cron.js +0 -110
  239. package/build/esm/cron/cron.js.map +0 -1
  240. package/build/esm/cron/index.js +0 -13
  241. package/build/esm/cron/index.js.map +0 -1
  242. package/build/esm/cron/node-cron.js +0 -69
  243. package/build/esm/cron/node-cron.js.map +0 -1
  244. package/build/esm/cron/node-schedule.js +0 -63
  245. package/build/esm/cron/node-schedule.js.map +0 -1
  246. package/build/esm/integrations/anr/index.js +0 -234
  247. package/build/esm/integrations/anr/index.js.map +0 -1
  248. package/build/esm/integrations/anr/worker-script.js +0 -2
  249. package/build/esm/integrations/childProcess.js +0 -98
  250. package/build/esm/integrations/childProcess.js.map +0 -1
  251. package/build/esm/integrations/context.js +0 -451
  252. package/build/esm/integrations/context.js.map +0 -1
  253. package/build/esm/integrations/contextlines.js +0 -399
  254. package/build/esm/integrations/contextlines.js.map +0 -1
  255. package/build/esm/integrations/http/SentryHttpInstrumentation.js +0 -555
  256. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +0 -1
  257. package/build/esm/integrations/local-variables/common.js +0 -64
  258. package/build/esm/integrations/local-variables/common.js.map +0 -1
  259. package/build/esm/integrations/local-variables/index.js +0 -10
  260. package/build/esm/integrations/local-variables/index.js.map +0 -1
  261. package/build/esm/integrations/local-variables/local-variables-async.js +0 -140
  262. package/build/esm/integrations/local-variables/local-variables-async.js.map +0 -1
  263. package/build/esm/integrations/local-variables/local-variables-sync.js +0 -405
  264. package/build/esm/integrations/local-variables/local-variables-sync.js.map +0 -1
  265. package/build/esm/integrations/local-variables/worker-script.js +0 -2
  266. package/build/esm/integrations/modules.js +0 -133
  267. package/build/esm/integrations/modules.js.map +0 -1
  268. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js +0 -289
  269. package/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js.map +0 -1
  270. package/build/esm/integrations/onuncaughtexception.js +0 -131
  271. package/build/esm/integrations/onuncaughtexception.js.map +0 -1
  272. package/build/esm/integrations/onunhandledrejection.js +0 -86
  273. package/build/esm/integrations/onunhandledrejection.js.map +0 -1
  274. package/build/esm/integrations/processSession.js +0 -34
  275. package/build/esm/integrations/processSession.js.map +0 -1
  276. package/build/esm/integrations/spotlight.js +0 -98
  277. package/build/esm/integrations/spotlight.js.map +0 -1
  278. package/build/esm/integrations/winston.js +0 -149
  279. package/build/esm/integrations/winston.js.map +0 -1
  280. package/build/esm/logs/capture.js +0 -27
  281. package/build/esm/logs/capture.js.map +0 -1
  282. package/build/esm/logs/exports.js +0 -170
  283. package/build/esm/logs/exports.js.map +0 -1
  284. package/build/esm/nodeVersion.js +0 -8
  285. package/build/esm/nodeVersion.js.map +0 -1
  286. package/build/esm/otel/contextManager.js +0 -14
  287. package/build/esm/otel/contextManager.js.map +0 -1
  288. package/build/esm/otel/instrument.js +0 -135
  289. package/build/esm/otel/instrument.js.map +0 -1
  290. package/build/esm/proxy/base.js +0 -120
  291. package/build/esm/proxy/base.js.map +0 -1
  292. package/build/esm/proxy/index.js +0 -171
  293. package/build/esm/proxy/index.js.map +0 -1
  294. package/build/esm/proxy/parse-proxy-response.js +0 -102
  295. package/build/esm/proxy/parse-proxy-response.js.map +0 -1
  296. package/build/esm/sdk/api.js +0 -114
  297. package/build/esm/sdk/api.js.map +0 -1
  298. package/build/esm/sdk/client.js +0 -154
  299. package/build/esm/sdk/client.js.map +0 -1
  300. package/build/esm/transports/http.js +0 -156
  301. package/build/esm/transports/http.js.map +0 -1
  302. package/build/esm/utils/addOriginToSpan.js +0 -9
  303. package/build/esm/utils/addOriginToSpan.js.map +0 -1
  304. package/build/esm/utils/baggage.js +0 -34
  305. package/build/esm/utils/baggage.js.map +0 -1
  306. package/build/esm/utils/commonjs.js +0 -11
  307. package/build/esm/utils/commonjs.js.map +0 -1
  308. package/build/esm/utils/createMissingInstrumentationContext.js +0 -9
  309. package/build/esm/utils/createMissingInstrumentationContext.js.map +0 -1
  310. package/build/esm/utils/debug.js +0 -21
  311. package/build/esm/utils/debug.js.map +0 -1
  312. package/build/esm/utils/ensureIsWrapped.js +0 -39
  313. package/build/esm/utils/ensureIsWrapped.js.map +0 -1
  314. package/build/esm/utils/envToBool.js +0 -28
  315. package/build/esm/utils/envToBool.js.map +0 -1
  316. package/build/esm/utils/errorhandling.js +0 -40
  317. package/build/esm/utils/errorhandling.js.map +0 -1
  318. package/build/esm/utils/getRequestUrl.js +0 -16
  319. package/build/esm/utils/getRequestUrl.js.map +0 -1
  320. package/build/esm/utils/module.js +0 -58
  321. package/build/esm/utils/module.js.map +0 -1
  322. package/build/types/cron/common.d.ts +0 -5
  323. package/build/types/cron/common.d.ts.map +0 -1
  324. package/build/types/cron/cron.d.ts +0 -43
  325. package/build/types/cron/cron.d.ts.map +0 -1
  326. package/build/types/cron/index.d.ts +0 -10
  327. package/build/types/cron/index.d.ts.map +0 -1
  328. package/build/types/cron/node-cron.d.ts +0 -27
  329. package/build/types/cron/node-cron.d.ts.map +0 -1
  330. package/build/types/cron/node-schedule.d.ts +0 -19
  331. package/build/types/cron/node-schedule.d.ts.map +0 -1
  332. package/build/types/integrations/anr/common.d.ts +0 -52
  333. package/build/types/integrations/anr/common.d.ts.map +0 -1
  334. package/build/types/integrations/anr/index.d.ts +0 -13
  335. package/build/types/integrations/anr/index.d.ts.map +0 -1
  336. package/build/types/integrations/anr/worker.d.ts +0 -2
  337. package/build/types/integrations/anr/worker.d.ts.map +0 -1
  338. package/build/types/integrations/childProcess.d.ts +0 -20
  339. package/build/types/integrations/childProcess.d.ts.map +0 -1
  340. package/build/types/integrations/context.d.ts +0 -30
  341. package/build/types/integrations/context.d.ts.map +0 -1
  342. package/build/types/integrations/contextlines.d.ts +0 -31
  343. package/build/types/integrations/contextlines.d.ts.map +0 -1
  344. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +0 -131
  345. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +0 -1
  346. package/build/types/integrations/local-variables/common.d.ts +0 -66
  347. package/build/types/integrations/local-variables/common.d.ts.map +0 -1
  348. package/build/types/integrations/local-variables/index.d.ts +0 -4
  349. package/build/types/integrations/local-variables/index.d.ts.map +0 -1
  350. package/build/types/integrations/local-variables/local-variables-async.d.ts +0 -7
  351. package/build/types/integrations/local-variables/local-variables-async.d.ts.map +0 -1
  352. package/build/types/integrations/local-variables/local-variables-sync.d.ts +0 -34
  353. package/build/types/integrations/local-variables/local-variables-sync.d.ts.map +0 -1
  354. package/build/types/integrations/local-variables/worker.d.ts +0 -2
  355. package/build/types/integrations/local-variables/worker.d.ts.map +0 -1
  356. package/build/types/integrations/modules.d.ts +0 -17
  357. package/build/types/integrations/modules.d.ts.map +0 -1
  358. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  359. package/build/types/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts.map +0 -1
  360. package/build/types/integrations/onuncaughtexception.d.ts +0 -31
  361. package/build/types/integrations/onuncaughtexception.d.ts.map +0 -1
  362. package/build/types/integrations/onunhandledrejection.d.ts +0 -23
  363. package/build/types/integrations/onunhandledrejection.d.ts.map +0 -1
  364. package/build/types/integrations/processSession.d.ts +0 -5
  365. package/build/types/integrations/processSession.d.ts.map +0 -1
  366. package/build/types/integrations/spotlight.d.ts +0 -18
  367. package/build/types/integrations/spotlight.d.ts.map +0 -1
  368. package/build/types/integrations/winston.d.ts +0 -44
  369. package/build/types/integrations/winston.d.ts.map +0 -1
  370. package/build/types/logs/capture.d.ts +0 -11
  371. package/build/types/logs/capture.d.ts.map +0 -1
  372. package/build/types/logs/exports.d.ts +0 -150
  373. package/build/types/logs/exports.d.ts.map +0 -1
  374. package/build/types/nodeVersion.d.ts +0 -8
  375. package/build/types/nodeVersion.d.ts.map +0 -1
  376. package/build/types/otel/contextManager.d.ts +0 -10
  377. package/build/types/otel/contextManager.d.ts.map +0 -1
  378. package/build/types/otel/instrument.d.ts +0 -23
  379. package/build/types/otel/instrument.d.ts.map +0 -1
  380. package/build/types/proxy/base.d.ts +0 -65
  381. package/build/types/proxy/base.d.ts.map +0 -1
  382. package/build/types/proxy/helpers.d.ts +0 -42
  383. package/build/types/proxy/helpers.d.ts.map +0 -1
  384. package/build/types/proxy/index.d.ts +0 -73
  385. package/build/types/proxy/index.d.ts.map +0 -1
  386. package/build/types/proxy/parse-proxy-response.d.ts +0 -43
  387. package/build/types/proxy/parse-proxy-response.d.ts.map +0 -1
  388. package/build/types/sdk/api.d.ts +0 -8
  389. package/build/types/sdk/api.d.ts.map +0 -1
  390. package/build/types/sdk/client.d.ts +0 -29
  391. package/build/types/sdk/client.d.ts.map +0 -1
  392. package/build/types/sdk/scope.d.ts +0 -7
  393. package/build/types/sdk/scope.d.ts.map +0 -1
  394. package/build/types/transports/http-module.d.ts +0 -31
  395. package/build/types/transports/http-module.d.ts.map +0 -1
  396. package/build/types/transports/http.d.ts +0 -21
  397. package/build/types/transports/http.d.ts.map +0 -1
  398. package/build/types/transports/index.d.ts +0 -3
  399. package/build/types/transports/index.d.ts.map +0 -1
  400. package/build/types/utils/addOriginToSpan.d.ts +0 -5
  401. package/build/types/utils/addOriginToSpan.d.ts.map +0 -1
  402. package/build/types/utils/baggage.d.ts +0 -6
  403. package/build/types/utils/baggage.d.ts.map +0 -1
  404. package/build/types/utils/commonjs.d.ts +0 -3
  405. package/build/types/utils/commonjs.d.ts.map +0 -1
  406. package/build/types/utils/createMissingInstrumentationContext.d.ts +0 -3
  407. package/build/types/utils/createMissingInstrumentationContext.d.ts.map +0 -1
  408. package/build/types/utils/debug.d.ts +0 -5
  409. package/build/types/utils/debug.d.ts.map +0 -1
  410. package/build/types/utils/ensureIsWrapped.d.ts +0 -5
  411. package/build/types/utils/ensureIsWrapped.d.ts.map +0 -1
  412. package/build/types/utils/entry-point.d.ts +0 -24
  413. package/build/types/utils/entry-point.d.ts.map +0 -1
  414. package/build/types/utils/envToBool.d.ts +0 -13
  415. package/build/types/utils/envToBool.d.ts.map +0 -1
  416. package/build/types/utils/errorhandling.d.ts +0 -5
  417. package/build/types/utils/errorhandling.d.ts.map +0 -1
  418. package/build/types/utils/getRequestUrl.d.ts +0 -5
  419. package/build/types/utils/getRequestUrl.d.ts.map +0 -1
  420. package/build/types/utils/module.d.ts +0 -3
  421. package/build/types/utils/module.d.ts.map +0 -1
  422. package/build/types/utils/prepareEvent.d.ts +0 -17
  423. package/build/types/utils/prepareEvent.d.ts.map +0 -1
  424. package/build/types-ts3.8/cron/common.d.ts +0 -5
  425. package/build/types-ts3.8/cron/cron.d.ts +0 -43
  426. package/build/types-ts3.8/cron/index.d.ts +0 -10
  427. package/build/types-ts3.8/cron/node-cron.d.ts +0 -27
  428. package/build/types-ts3.8/cron/node-schedule.d.ts +0 -19
  429. package/build/types-ts3.8/integrations/anr/common.d.ts +0 -52
  430. package/build/types-ts3.8/integrations/anr/index.d.ts +0 -13
  431. package/build/types-ts3.8/integrations/anr/worker.d.ts +0 -2
  432. package/build/types-ts3.8/integrations/childProcess.d.ts +0 -20
  433. package/build/types-ts3.8/integrations/context.d.ts +0 -30
  434. package/build/types-ts3.8/integrations/contextlines.d.ts +0 -31
  435. package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +0 -133
  436. package/build/types-ts3.8/integrations/local-variables/common.d.ts +0 -66
  437. package/build/types-ts3.8/integrations/local-variables/index.d.ts +0 -4
  438. package/build/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +0 -7
  439. package/build/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +0 -34
  440. package/build/types-ts3.8/integrations/local-variables/worker.d.ts +0 -2
  441. package/build/types-ts3.8/integrations/modules.d.ts +0 -17
  442. package/build/types-ts3.8/integrations/node-fetch/SentryNodeFetchInstrumentation.d.ts +0 -56
  443. package/build/types-ts3.8/integrations/onuncaughtexception.d.ts +0 -31
  444. package/build/types-ts3.8/integrations/onunhandledrejection.d.ts +0 -23
  445. package/build/types-ts3.8/integrations/processSession.d.ts +0 -5
  446. package/build/types-ts3.8/integrations/spotlight.d.ts +0 -18
  447. package/build/types-ts3.8/integrations/winston.d.ts +0 -44
  448. package/build/types-ts3.8/logs/capture.d.ts +0 -18
  449. package/build/types-ts3.8/logs/exports.d.ts +0 -150
  450. package/build/types-ts3.8/nodeVersion.d.ts +0 -8
  451. package/build/types-ts3.8/otel/contextManager.d.ts +0 -10
  452. package/build/types-ts3.8/otel/instrument.d.ts +0 -23
  453. package/build/types-ts3.8/proxy/base.d.ts +0 -60
  454. package/build/types-ts3.8/proxy/helpers.d.ts +0 -38
  455. package/build/types-ts3.8/proxy/index.d.ts +0 -74
  456. package/build/types-ts3.8/proxy/parse-proxy-response.d.ts +0 -40
  457. package/build/types-ts3.8/sdk/api.d.ts +0 -8
  458. package/build/types-ts3.8/sdk/client.d.ts +0 -32
  459. package/build/types-ts3.8/sdk/scope.d.ts +0 -7
  460. package/build/types-ts3.8/transports/http-module.d.ts +0 -28
  461. package/build/types-ts3.8/transports/http.d.ts +0 -20
  462. package/build/types-ts3.8/transports/index.d.ts +0 -3
  463. package/build/types-ts3.8/utils/addOriginToSpan.d.ts +0 -5
  464. package/build/types-ts3.8/utils/baggage.d.ts +0 -6
  465. package/build/types-ts3.8/utils/commonjs.d.ts +0 -3
  466. package/build/types-ts3.8/utils/createMissingInstrumentationContext.d.ts +0 -3
  467. package/build/types-ts3.8/utils/debug.d.ts +0 -5
  468. package/build/types-ts3.8/utils/ensureIsWrapped.d.ts +0 -5
  469. package/build/types-ts3.8/utils/entry-point.d.ts +0 -24
  470. package/build/types-ts3.8/utils/envToBool.d.ts +0 -13
  471. package/build/types-ts3.8/utils/errorhandling.d.ts +0 -5
  472. package/build/types-ts3.8/utils/getRequestUrl.d.ts +0 -5
  473. package/build/types-ts3.8/utils/module.d.ts +0 -3
  474. package/build/types-ts3.8/utils/prepareEvent.d.ts +0 -17
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/integrations/anr/index.ts"],"sourcesContent":["import { types } from 'node:util';\nimport { Worker } from 'node:worker_threads';\nimport type { Contexts, Event, EventHint, Integration, IntegrationFn, ScopeData } from '@sentry/core';\nimport {\n defineIntegration,\n getClient,\n getCurrentScope,\n getFilenameToDebugIdMap,\n getGlobalScope,\n getIsolationScope,\n GLOBAL_OBJ,\n logger,\n mergeScopeData,\n} from '@sentry/core';\nimport { NODE_VERSION } from '../../nodeVersion';\nimport type { NodeClient } from '../../sdk/client';\nimport { isDebuggerEnabled } from '../../utils/debug';\nimport type { AnrIntegrationOptions, WorkerStartData } from './common';\n\nconst { isPromise } = types;\n\n// This string is a placeholder that gets overwritten with the worker code.\nexport const base64WorkerScript = '###AnrWorkerScript###';\n\nconst DEFAULT_INTERVAL = 50;\nconst DEFAULT_HANG_THRESHOLD = 5000;\n\nfunction log(message: string, ...args: unknown[]): void {\n logger.log(`[ANR] ${message}`, ...args);\n}\n\nfunction globalWithScopeFetchFn(): typeof GLOBAL_OBJ & { __SENTRY_GET_SCOPES__?: () => ScopeData } {\n return GLOBAL_OBJ;\n}\n\n/** Fetches merged scope data */\nfunction getScopeData(): ScopeData {\n const scope = getGlobalScope().getScopeData();\n mergeScopeData(scope, getIsolationScope().getScopeData());\n mergeScopeData(scope, getCurrentScope().getScopeData());\n\n // We remove attachments because they likely won't serialize well as json\n scope.attachments = [];\n // We can't serialize event processor functions\n scope.eventProcessors = [];\n\n return scope;\n}\n\n/**\n * Gets contexts by calling all event processors. This shouldn't be called until all integrations are setup\n */\nasync function getContexts(client: NodeClient): Promise<Contexts> {\n let event: Event | null = { message: 'ANR' };\n const eventHint: EventHint = {};\n\n for (const processor of client.getEventProcessors()) {\n if (event === null) break;\n event = await processor(event, eventHint);\n }\n\n return event?.contexts || {};\n}\n\nconst INTEGRATION_NAME = 'Anr';\n\ntype AnrInternal = { startWorker: () => void; stopWorker: () => void };\n\nconst _anrIntegration = ((options: Partial<AnrIntegrationOptions> = {}) => {\n if (NODE_VERSION.major < 16 || (NODE_VERSION.major === 16 && NODE_VERSION.minor < 17)) {\n throw new Error('ANR detection requires Node 16.17.0 or later');\n }\n\n let worker: Promise<() => void> | undefined;\n let client: NodeClient | undefined;\n\n // Hookup the scope fetch function to the global object so that it can be called from the worker thread via the\n // debugger when it pauses\n const gbl = globalWithScopeFetchFn();\n gbl.__SENTRY_GET_SCOPES__ = getScopeData;\n\n return {\n name: INTEGRATION_NAME,\n startWorker: () => {\n if (worker) {\n return;\n }\n\n if (client) {\n worker = _startWorker(client, options);\n }\n },\n stopWorker: () => {\n if (worker) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n worker.then(stop => {\n stop();\n worker = undefined;\n });\n }\n },\n async setup(initClient: NodeClient) {\n client = initClient;\n\n if (options.captureStackTrace && (await isDebuggerEnabled())) {\n logger.warn('ANR captureStackTrace has been disabled because the debugger was already enabled');\n options.captureStackTrace = false;\n }\n\n // setImmediate is used to ensure that all other integrations have had their setup called first.\n // This allows us to call into all integrations to fetch the full context\n setImmediate(() => this.startWorker());\n },\n } as Integration & AnrInternal;\n}) satisfies IntegrationFn;\n\ntype AnrReturn = (options?: Partial<AnrIntegrationOptions>) => Integration & AnrInternal;\n\nexport const anrIntegration = defineIntegration(_anrIntegration) as AnrReturn;\n\n/**\n * Starts the ANR worker thread\n *\n * @returns A function to stop the worker\n */\nasync function _startWorker(\n client: NodeClient,\n integrationOptions: Partial<AnrIntegrationOptions>,\n): Promise<() => void> {\n const dsn = client.getDsn();\n\n if (!dsn) {\n return () => {\n //\n };\n }\n\n const contexts = await getContexts(client);\n\n // These will not be accurate if sent later from the worker thread\n delete contexts.app?.app_memory;\n delete contexts.device?.free_memory;\n\n const initOptions = client.getOptions();\n\n const sdkMetadata = client.getSdkMetadata() || {};\n if (sdkMetadata.sdk) {\n sdkMetadata.sdk.integrations = initOptions.integrations.map(i => i.name);\n }\n\n const options: WorkerStartData = {\n debug: logger.isEnabled(),\n dsn,\n tunnel: initOptions.tunnel,\n environment: initOptions.environment || 'production',\n release: initOptions.release,\n dist: initOptions.dist,\n sdkMetadata,\n appRootPath: integrationOptions.appRootPath,\n pollInterval: integrationOptions.pollInterval || DEFAULT_INTERVAL,\n anrThreshold: integrationOptions.anrThreshold || DEFAULT_HANG_THRESHOLD,\n captureStackTrace: !!integrationOptions.captureStackTrace,\n maxAnrEvents: integrationOptions.maxAnrEvents || 1,\n staticTags: integrationOptions.staticTags || {},\n contexts,\n };\n\n if (options.captureStackTrace) {\n const inspector = await import('node:inspector');\n if (!inspector.url()) {\n inspector.open(0);\n }\n }\n\n const worker = new Worker(new URL(`data:application/javascript;base64,${base64WorkerScript}`), {\n workerData: options,\n // We don't want any Node args to be passed to the worker\n execArgv: [],\n env: { ...process.env, NODE_OPTIONS: undefined },\n });\n\n process.on('exit', () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n worker.terminate();\n });\n\n const timer = setInterval(() => {\n try {\n const currentSession = getIsolationScope().getSession();\n // We need to copy the session object and remove the toJSON method so it can be sent to the worker\n // serialized without making it a SerializedSession\n const session = currentSession ? { ...currentSession, toJSON: undefined } : undefined;\n // message the worker to tell it the main event loop is still running\n worker.postMessage({ session, debugImages: getFilenameToDebugIdMap(initOptions.stackParser) });\n } catch (_) {\n //\n }\n }, options.pollInterval);\n // Timer should not block exit\n timer.unref();\n\n worker.on('message', (msg: string) => {\n if (msg === 'session-ended') {\n log('ANR event sent from ANR worker. Clearing session in this thread.');\n getIsolationScope().setSession(undefined);\n }\n });\n\n worker.once('error', (err: Error) => {\n clearInterval(timer);\n log('ANR worker error', err);\n });\n\n worker.once('exit', (code: number) => {\n clearInterval(timer);\n log('ANR worker exit', code);\n });\n\n // Ensure this thread can't block app exit\n worker.unref();\n\n return () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n worker.terminate();\n clearInterval(timer);\n };\n}\n\nexport function disableAnrDetectionForCallback<T>(callback: () => T): T;\nexport function disableAnrDetectionForCallback<T>(callback: () => Promise<T>): Promise<T>;\n/**\n * Disables ANR detection for the duration of the callback\n */\nexport function disableAnrDetectionForCallback<T>(callback: () => T | Promise<T>): T | Promise<T> {\n const integration = getClient()?.getIntegrationByName(INTEGRATION_NAME) as AnrInternal | undefined;\n\n if (!integration) {\n return callback();\n }\n\n integration.stopWorker();\n\n const result = callback();\n if (isPromise(result)) {\n return result.finally(() => integration.startWorker());\n }\n\n integration.startWorker();\n return result;\n}\n"],"names":["types","logger","GLOBAL_OBJ","getGlobalScope","mergeScopeData","getIsolationScope","getCurrentScope","NODE_VERSION","isDebuggerEnabled","defineIntegration","Worker","getFilenameToDebugIdMap","getClient"],"mappings":";;;;;;;;AAmBA,MAAM,EAAE,SAAA,EAAY,GAAEA,eAAK;;AAE3B;AACO,MAAM,kBAAmB,GAAE;;AAElC,MAAM,gBAAA,GAAmB,EAAE;AAC3B,MAAM,sBAAA,GAAyB,IAAI;;AAEnC,SAAS,GAAG,CAAC,OAAO,EAAU,GAAG,IAAI,EAAmB;AACxD,EAAEC,WAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA,EAAA,GAAA,IAAA,CAAA;AACA;;AAEA,SAAA,sBAAA,GAAA;AACA,EAAA,OAAAC,eAAA;AACA;;AAEA;AACA,SAAA,YAAA,GAAA;AACA,EAAA,MAAA,KAAA,GAAAC,mBAAA,EAAA,CAAA,YAAA,EAAA;AACA,EAAAC,mBAAA,CAAA,KAAA,EAAAC,sBAAA,EAAA,CAAA,YAAA,EAAA,CAAA;AACA,EAAAD,mBAAA,CAAA,KAAA,EAAAE,oBAAA,EAAA,CAAA,YAAA,EAAA,CAAA;;AAEA;AACA,EAAA,KAAA,CAAA,WAAA,GAAA,EAAA;AACA;AACA,EAAA,KAAA,CAAA,eAAA,GAAA,EAAA;;AAEA,EAAA,OAAA,KAAA;AACA;;AAEA;AACA;AACA;AACA,eAAA,WAAA,CAAA,MAAA,EAAA;AACA,EAAA,IAAA,KAAA,GAAA,EAAA,OAAA,EAAA,KAAA,EAAA;AACA,EAAA,MAAA,SAAA,GAAA,EAAA;;AAEA,EAAA,KAAA,MAAA,SAAA,IAAA,MAAA,CAAA,kBAAA,EAAA,EAAA;AACA,IAAA,IAAA,KAAA,KAAA,IAAA,EAAA;AACA,IAAA,KAAA,GAAA,MAAA,SAAA,CAAA,KAAA,EAAA,SAAA,CAAA;AACA;;AAEA,EAAA,OAAA,KAAA,EAAA,QAAA,IAAA,E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sChannel = require('node:diagnostics_channel');
4
- const core = require('@sentry/core');
5
-
6
- const INTEGRATION_NAME = 'ChildProcess';
7
-
8
- /**
9
- * Capture breadcrumbs and events for child processes and worker threads.
10
- */
11
- const childProcessIntegration = core.defineIntegration((options = {}) => {
12
- return {
13
- name: INTEGRATION_NAME,
14
- setup() {
15
- diagnosticsChannel.channel('child_process').subscribe((event) => {
16
- if (event && typeof event === 'object' && 'process' in event) {
17
- captureChildProcessEvents(event.process , options);
18
- }
19
- });
20
-
21
- diagnosticsChannel.channel('worker_threads').subscribe((event) => {
22
- if (event && typeof event === 'object' && 'worker' in event) {
23
- captureWorkerThreadEvents(event.worker , options);
24
- }
25
- });
26
- },
27
- };
28
- });
29
-
30
- function captureChildProcessEvents(child, options) {
31
- let hasExited = false;
32
- let data;
33
-
34
- child
35
- .on('spawn', () => {
36
- // This is Sentry getting macOS OS context
37
- if (child.spawnfile === '/usr/bin/sw_vers') {
38
- hasExited = true;
39
- return;
40
- }
41
-
42
- data = { spawnfile: child.spawnfile };
43
- if (options.includeChildProcessArgs) {
44
- data.spawnargs = child.spawnargs;
45
- }
46
- })
47
- .on('exit', code => {
48
- if (!hasExited) {
49
- hasExited = true;
50
-
51
- // Only log for non-zero exit codes
52
- if (code !== null && code !== 0) {
53
- core.addBreadcrumb({
54
- category: 'child_process',
55
- message: `Child process exited with code '${code}'`,
56
- level: code === 0 ? 'info' : 'warning',
57
- data,
58
- });
59
- }
60
- }
61
- })
62
- .on('error', error => {
63
- if (!hasExited) {
64
- hasExited = true;
65
-
66
- core.addBreadcrumb({
67
- category: 'child_process',
68
- message: `Child process errored with '${error.message}'`,
69
- level: 'error',
70
- data,
71
- });
72
- }
73
- });
74
- }
75
-
76
- function captureWorkerThreadEvents(worker, options) {
77
- let threadId;
78
-
79
- worker
80
- .on('online', () => {
81
- threadId = worker.threadId;
82
- })
83
- .on('error', error => {
84
- if (options.captureWorkerErrors !== false) {
85
- core.captureException(error, {
86
- mechanism: { type: 'instrument', handled: false, data: { threadId: String(threadId) } },
87
- });
88
- } else {
89
- core.addBreadcrumb({
90
- category: 'worker_thread',
91
- message: `Worker thread errored with '${error.message}'`,
92
- level: 'error',
93
- data: { threadId },
94
- });
95
- }
96
- });
97
- }
98
-
99
- exports.childProcessIntegration = childProcessIntegration;
100
- //# sourceMappingURL=childProcess.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"childProcess.js","sources":["../../../src/integrations/childProcess.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process';\nimport * as diagnosticsChannel from 'node:diagnostics_channel';\nimport type { Worker } from 'node:worker_threads';\nimport { addBreadcrumb, captureException, defineIntegration } from '@sentry/core';\n\ninterface Options {\n /**\n * Whether to include child process arguments in breadcrumbs data.\n *\n * @default false\n */\n includeChildProcessArgs?: boolean;\n\n /**\n * Whether to capture errors from worker threads.\n *\n * @default true\n */\n captureWorkerErrors?: boolean;\n}\n\nconst INTEGRATION_NAME = 'ChildProcess';\n\n/**\n * Capture breadcrumbs and events for child processes and worker threads.\n */\nexport const childProcessIntegration = defineIntegration((options: Options = {}) => {\n return {\n name: INTEGRATION_NAME,\n setup() {\n diagnosticsChannel.channel('child_process').subscribe((event: unknown) => {\n if (event && typeof event === 'object' && 'process' in event) {\n captureChildProcessEvents(event.process as ChildProcess, options);\n }\n });\n\n diagnosticsChannel.channel('worker_threads').subscribe((event: unknown) => {\n if (event && typeof event === 'object' && 'worker' in event) {\n captureWorkerThreadEvents(event.worker as Worker, options);\n }\n });\n },\n };\n});\n\nfunction captureChildProcessEvents(child: ChildProcess, options: Options): void {\n let hasExited = false;\n let data: Record<string, unknown> | undefined;\n\n child\n .on('spawn', () => {\n // This is Sentry getting macOS OS context\n if (child.spawnfile === '/usr/bin/sw_vers') {\n hasExited = true;\n return;\n }\n\n data = { spawnfile: child.spawnfile };\n if (options.includeChildProcessArgs) {\n data.spawnargs = child.spawnargs;\n }\n })\n .on('exit', code => {\n if (!hasExited) {\n hasExited = true;\n\n // Only log for non-zero exit codes\n if (code !== null && code !== 0) {\n addBreadcrumb({\n category: 'child_process',\n message: `Child process exited with code '${code}'`,\n level: code === 0 ? 'info' : 'warning',\n data,\n });\n }\n }\n })\n .on('error', error => {\n if (!hasExited) {\n hasExited = true;\n\n addBreadcrumb({\n category: 'child_process',\n message: `Child process errored with '${error.message}'`,\n level: 'error',\n data,\n });\n }\n });\n}\n\nfunction captureWorkerThreadEvents(worker: Worker, options: Options): void {\n let threadId: number | undefined;\n\n worker\n .on('online', () => {\n threadId = worker.threadId;\n })\n .on('error', error => {\n if (options.captureWorkerErrors !== false) {\n captureException(error, {\n mechanism: { type: 'instrument', handled: false, data: { threadId: String(threadId) } },\n });\n } else {\n addBreadcrumb({\n category: 'worker_thread',\n message: `Worker thread errored with '${error.message}'`,\n level: 'error',\n data: { threadId },\n });\n }\n });\n}\n"],"names":["defineIntegration","addBreadcrumb","captureException"],"mappings":";;;;;AAqBA,MAAM,gBAAA,GAAmB,cAAc;;AAEvC;AACA;AACA;AACa,MAAA,uBAAA,GAA0BA,sBAAiB,CAAC,CAAC,OAAO,GAAY,EAAE,KAAK;AACpF,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,GAAG;AACZ,MAAM,kBAAkB,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,KAAc;AAChF,QAAQ,IAAI,KAAM,IAAG,OAAO,KAAA,KAAU,QAAA,IAAY,SAAA,IAAa,KAAK,EAAE;AACtE,UAAU,yBAAyB,CAAC,KAAK,CAAC,OAAQ,GAAiB,OAAO,CAAC;AAC3E;AACA,OAAO,CAAC;;AAER,MAAM,kBAAkB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,KAAc;AACjF,QAAQ,IAAI,KAAM,IAAG,OAAO,KAAA,KAAU,QAAA,IAAY,QAAA,IAAY,KAAK,EAAE;AACrE,UAAU,yBAAyB,CAAC,KAAK,CAAC,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E,OAAO;AACxB,UAAU,IAAI;AACd,SAAS,CAAC;AACV;AACA,KAAK,CAAC;AACN;;AAEA,SAAS,yBAAyB,CAAC,MAAM,EAAU,OAAO,EAAiB;AAC3E,EAAE,IAAI,QAAQ;;AAEd,EAAE;AACF,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM;AACxB,MAAM,QAAS,GAAE,MAAM,CAAC,QAAQ;AAChC,KAAK;AACL,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS;AAC1B,MAAM,IAAI,OAAO,CAAC,mBAAoB,KAAI,KAAK,EAAE;AACjD,QAAQC,qBAAgB,CAAC,KAAK,EAAE;AAChC,UAAU,SAAS,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAE,EAAA,EAAG;AACjG,SAAS,CAAC;AACV,aAAa;AACb,QAAQD,kBAAa,CAAC;AACtB,UAAU,QAAQ,EAAE,eAAe;AACnC,UAAU,OAAO,EAAE,CAAC,4BAA4B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAClE,UAAU,KAAK,EAAE,OAAO;AACxB,UAAU,IAAI,EAAE,EAAE,QAAA,EAAU;AAC5B,SAAS,CAAC;AACV;AACA,KAAK,CAAC;AACN;;;;"}
@@ -1,457 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const node_child_process = require('node:child_process');
4
- const node_fs = require('node:fs');
5
- const os = require('node:os');
6
- const node_path = require('node:path');
7
- const node_util = require('node:util');
8
- const core = require('@sentry/core');
9
-
10
- /* eslint-disable max-lines */
11
-
12
-
13
- const readFileAsync = node_util.promisify(node_fs.readFile);
14
- const readDirAsync = node_util.promisify(node_fs.readdir);
15
-
16
- // Process enhanced with methods from Node 18, 20, 22 as @types/node
17
- // is on `14.18.0` to match minimum version requirements of the SDK
18
-
19
- const INTEGRATION_NAME = 'Context';
20
-
21
- const _nodeContextIntegration = ((options = {}) => {
22
- let cachedContext;
23
-
24
- const _options = {
25
- app: true,
26
- os: true,
27
- device: true,
28
- culture: true,
29
- cloudResource: true,
30
- ...options,
31
- };
32
-
33
- /** Add contexts to the event. Caches the context so we only look it up once. */
34
- async function addContext(event) {
35
- if (cachedContext === undefined) {
36
- cachedContext = _getContexts();
37
- }
38
-
39
- const updatedContext = _updateContext(await cachedContext);
40
-
41
- // TODO(v10): conditional with `sendDefaultPii` here?
42
- event.contexts = {
43
- ...event.contexts,
44
- app: { ...updatedContext.app, ...event.contexts?.app },
45
- os: { ...updatedContext.os, ...event.contexts?.os },
46
- device: { ...updatedContext.device, ...event.contexts?.device },
47
- culture: { ...updatedContext.culture, ...event.contexts?.culture },
48
- cloud_resource: { ...updatedContext.cloud_resource, ...event.contexts?.cloud_resource },
49
- };
50
-
51
- return event;
52
- }
53
-
54
- /** Get the contexts from node. */
55
- async function _getContexts() {
56
- const contexts = {};
57
-
58
- if (_options.os) {
59
- contexts.os = await getOsContext();
60
- }
61
-
62
- if (_options.app) {
63
- contexts.app = getAppContext();
64
- }
65
-
66
- if (_options.device) {
67
- contexts.device = getDeviceContext(_options.device);
68
- }
69
-
70
- if (_options.culture) {
71
- const culture = getCultureContext();
72
-
73
- if (culture) {
74
- contexts.culture = culture;
75
- }
76
- }
77
-
78
- if (_options.cloudResource) {
79
- contexts.cloud_resource = getCloudResourceContext();
80
- }
81
-
82
- return contexts;
83
- }
84
-
85
- return {
86
- name: INTEGRATION_NAME,
87
- processEvent(event) {
88
- return addContext(event);
89
- },
90
- };
91
- }) ;
92
-
93
- /**
94
- * Capture context about the environment and the device that the client is running on, to events.
95
- */
96
- const nodeContextIntegration = core.defineIntegration(_nodeContextIntegration);
97
-
98
- /**
99
- * Updates the context with dynamic values that can change
100
- */
101
- function _updateContext(contexts) {
102
- // Only update properties if they exist
103
-
104
- if (contexts.app?.app_memory) {
105
- contexts.app.app_memory = process.memoryUsage().rss;
106
- }
107
-
108
- if (contexts.app?.free_memory && typeof (process ).availableMemory === 'function') {
109
- const freeMemory = (process ).availableMemory?.();
110
- if (freeMemory != null) {
111
- contexts.app.free_memory = freeMemory;
112
- }
113
- }
114
-
115
- if (contexts.device?.free_memory) {
116
- contexts.device.free_memory = os.freemem();
117
- }
118
-
119
- return contexts;
120
- }
121
-
122
- /**
123
- * Returns the operating system context.
124
- *
125
- * Based on the current platform, this uses a different strategy to provide the
126
- * most accurate OS information. Since this might involve spawning subprocesses
127
- * or accessing the file system, this should only be executed lazily and cached.
128
- *
129
- * - On macOS (Darwin), this will execute the `sw_vers` utility. The context
130
- * has a `name`, `version`, `build` and `kernel_version` set.
131
- * - On Linux, this will try to load a distribution release from `/etc` and set
132
- * the `name`, `version` and `kernel_version` fields.
133
- * - On all other platforms, only a `name` and `version` will be returned. Note
134
- * that `version` might actually be the kernel version.
135
- */
136
- async function getOsContext() {
137
- const platformId = os.platform();
138
- switch (platformId) {
139
- case 'darwin':
140
- return getDarwinInfo();
141
- case 'linux':
142
- return getLinuxInfo();
143
- default:
144
- return {
145
- name: PLATFORM_NAMES[platformId] || platformId,
146
- version: os.release(),
147
- };
148
- }
149
- }
150
-
151
- function getCultureContext() {
152
- try {
153
- if (typeof process.versions.icu !== 'string') {
154
- // Node was built without ICU support
155
- return;
156
- }
157
-
158
- // Check that node was built with full Intl support. Its possible it was built without support for non-English
159
- // locales which will make resolvedOptions inaccurate
160
- //
161
- // https://nodejs.org/api/intl.html#detecting-internationalization-support
162
- const january = new Date(9e8);
163
- const spanish = new Intl.DateTimeFormat('es', { month: 'long' });
164
- if (spanish.format(january) === 'enero') {
165
- const options = Intl.DateTimeFormat().resolvedOptions();
166
-
167
- return {
168
- locale: options.locale,
169
- timezone: options.timeZone,
170
- };
171
- }
172
- } catch (err) {
173
- //
174
- }
175
-
176
- return;
177
- }
178
-
179
- /**
180
- * Get app context information from process
181
- */
182
- function getAppContext() {
183
- const app_memory = process.memoryUsage().rss;
184
- const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString();
185
- // https://nodejs.org/api/process.html#processavailablememory
186
- const appContext = { app_start_time, app_memory };
187
-
188
- if (typeof (process ).availableMemory === 'function') {
189
- const freeMemory = (process ).availableMemory?.();
190
- if (freeMemory != null) {
191
- appContext.free_memory = freeMemory;
192
- }
193
- }
194
-
195
- return appContext;
196
- }
197
-
198
- /**
199
- * Gets device information from os
200
- */
201
- function getDeviceContext(deviceOpt) {
202
- const device = {};
203
-
204
- // Sometimes os.uptime() throws due to lacking permissions: https://github.com/getsentry/sentry-javascript/issues/8202
205
- let uptime;
206
- try {
207
- uptime = os.uptime();
208
- } catch (e) {
209
- // noop
210
- }
211
-
212
- // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions).
213
- // Hence, we only set boot time, if we get a valid uptime value.
214
- // @see https://github.com/getsentry/sentry-javascript/issues/5856
215
- if (typeof uptime === 'number') {
216
- device.boot_time = new Date(Date.now() - uptime * 1000).toISOString();
217
- }
218
-
219
- device.arch = os.arch();
220
-
221
- if (deviceOpt === true || deviceOpt.memory) {
222
- device.memory_size = os.totalmem();
223
- device.free_memory = os.freemem();
224
- }
225
-
226
- if (deviceOpt === true || deviceOpt.cpu) {
227
- const cpuInfo = os.cpus() ;
228
- const firstCpu = cpuInfo?.[0];
229
- if (firstCpu) {
230
- device.processor_count = cpuInfo.length;
231
- device.cpu_description = firstCpu.model;
232
- device.processor_frequency = firstCpu.speed;
233
- }
234
- }
235
-
236
- return device;
237
- }
238
-
239
- /** Mapping of Node's platform names to actual OS names. */
240
- const PLATFORM_NAMES = {
241
- aix: 'IBM AIX',
242
- freebsd: 'FreeBSD',
243
- openbsd: 'OpenBSD',
244
- sunos: 'SunOS',
245
- win32: 'Windows',
246
- };
247
-
248
- /** Linux version file to check for a distribution. */
249
-
250
- /** Mapping of linux release files located in /etc to distributions. */
251
- const LINUX_DISTROS = [
252
- { name: 'fedora-release', distros: ['Fedora'] },
253
- { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },
254
- { name: 'redhat_version', distros: ['Red Hat Linux'] },
255
- { name: 'SuSE-release', distros: ['SUSE Linux'] },
256
- { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },
257
- { name: 'debian_version', distros: ['Debian'] },
258
- { name: 'debian_release', distros: ['Debian'] },
259
- { name: 'arch-release', distros: ['Arch Linux'] },
260
- { name: 'gentoo-release', distros: ['Gentoo Linux'] },
261
- { name: 'novell-release', distros: ['SUSE Linux'] },
262
- { name: 'alpine-release', distros: ['Alpine Linux'] },
263
- ];
264
-
265
- /** Functions to extract the OS version from Linux release files. */
266
- const LINUX_VERSIONS
267
-
268
- = {
269
- alpine: content => content,
270
- arch: content => matchFirst(/distrib_release=(.*)/, content),
271
- centos: content => matchFirst(/release ([^ ]+)/, content),
272
- debian: content => content,
273
- fedora: content => matchFirst(/release (..)/, content),
274
- mint: content => matchFirst(/distrib_release=(.*)/, content),
275
- red: content => matchFirst(/release ([^ ]+)/, content),
276
- suse: content => matchFirst(/VERSION = (.*)\n/, content),
277
- ubuntu: content => matchFirst(/distrib_release=(.*)/, content),
278
- };
279
-
280
- /**
281
- * Executes a regular expression with one capture group.
282
- *
283
- * @param regex A regular expression to execute.
284
- * @param text Content to execute the RegEx on.
285
- * @returns The captured string if matched; otherwise undefined.
286
- */
287
- function matchFirst(regex, text) {
288
- const match = regex.exec(text);
289
- return match ? match[1] : undefined;
290
- }
291
-
292
- /** Loads the macOS operating system context. */
293
- async function getDarwinInfo() {
294
- // Default values that will be used in case no operating system information
295
- // can be loaded. The default version is computed via heuristics from the
296
- // kernel version, but the build ID is missing.
297
- const darwinInfo = {
298
- kernel_version: os.release(),
299
- name: 'Mac OS X',
300
- version: `10.${Number(os.release().split('.')[0]) - 4}`,
301
- };
302
-
303
- try {
304
- // We try to load the actual macOS version by executing the `sw_vers` tool.
305
- // This tool should be available on every standard macOS installation. In
306
- // case this fails, we stick with the values computed above.
307
-
308
- const output = await new Promise((resolve, reject) => {
309
- node_child_process.execFile('/usr/bin/sw_vers', (error, stdout) => {
310
- if (error) {
311
- reject(error);
312
- return;
313
- }
314
- resolve(stdout);
315
- });
316
- });
317
-
318
- darwinInfo.name = matchFirst(/^ProductName:\s+(.*)$/m, output);
319
- darwinInfo.version = matchFirst(/^ProductVersion:\s+(.*)$/m, output);
320
- darwinInfo.build = matchFirst(/^BuildVersion:\s+(.*)$/m, output);
321
- } catch (e) {
322
- // ignore
323
- }
324
-
325
- return darwinInfo;
326
- }
327
-
328
- /** Returns a distribution identifier to look up version callbacks. */
329
- function getLinuxDistroId(name) {
330
- return (name.split(' ') )[0].toLowerCase();
331
- }
332
-
333
- /** Loads the Linux operating system context. */
334
- async function getLinuxInfo() {
335
- // By default, we cannot assume anything about the distribution or Linux
336
- // version. `os.release()` returns the kernel version and we assume a generic
337
- // "Linux" name, which will be replaced down below.
338
- const linuxInfo = {
339
- kernel_version: os.release(),
340
- name: 'Linux',
341
- };
342
-
343
- try {
344
- // We start guessing the distribution by listing files in the /etc
345
- // directory. This is were most Linux distributions (except Knoppix) store
346
- // release files with certain distribution-dependent meta data. We search
347
- // for exactly one known file defined in `LINUX_DISTROS` and exit if none
348
- // are found. In case there are more than one file, we just stick with the
349
- // first one.
350
- const etcFiles = await readDirAsync('/etc');
351
- const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name));
352
- if (!distroFile) {
353
- return linuxInfo;
354
- }
355
-
356
- // Once that file is known, load its contents. To make searching in those
357
- // files easier, we lowercase the file contents. Since these files are
358
- // usually quite small, this should not allocate too much memory and we only
359
- // hold on to it for a very short amount of time.
360
- const distroPath = node_path.join('/etc', distroFile.name);
361
- const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) ).toLowerCase();
362
-
363
- // Some Linux distributions store their release information in the same file
364
- // (e.g. RHEL and Centos). In those cases, we scan the file for an
365
- // identifier, that basically consists of the first word of the linux
366
- // distribution name (e.g. "red" for Red Hat). In case there is no match, we
367
- // just assume the first distribution in our list.
368
- const { distros } = distroFile;
369
- linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];
370
-
371
- // Based on the found distribution, we can now compute the actual version
372
- // number. This is different for every distribution, so several strategies
373
- // are computed in `LINUX_VERSIONS`.
374
- const id = getLinuxDistroId(linuxInfo.name);
375
- linuxInfo.version = LINUX_VERSIONS[id]?.(contents);
376
- } catch (e) {
377
- // ignore
378
- }
379
-
380
- return linuxInfo;
381
- }
382
-
383
- /**
384
- * Grabs some information about hosting provider based on best effort.
385
- */
386
- function getCloudResourceContext() {
387
- if (process.env.VERCEL) {
388
- // https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables
389
- return {
390
- 'cloud.provider': 'vercel',
391
- 'cloud.region': process.env.VERCEL_REGION,
392
- };
393
- } else if (process.env.AWS_REGION) {
394
- // https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html
395
- return {
396
- 'cloud.provider': 'aws',
397
- 'cloud.region': process.env.AWS_REGION,
398
- 'cloud.platform': process.env.AWS_EXECUTION_ENV,
399
- };
400
- } else if (process.env.GCP_PROJECT) {
401
- // https://cloud.google.com/composer/docs/how-to/managing/environment-variables#reserved_variables
402
- return {
403
- 'cloud.provider': 'gcp',
404
- };
405
- } else if (process.env.ALIYUN_REGION_ID) {
406
- // TODO: find where I found these environment variables - at least gc.github.com returns something
407
- return {
408
- 'cloud.provider': 'alibaba_cloud',
409
- 'cloud.region': process.env.ALIYUN_REGION_ID,
410
- };
411
- } else if (process.env.WEBSITE_SITE_NAME && process.env.REGION_NAME) {
412
- // https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#app-environment
413
- return {
414
- 'cloud.provider': 'azure',
415
- 'cloud.region': process.env.REGION_NAME,
416
- };
417
- } else if (process.env.IBM_CLOUD_REGION) {
418
- // TODO: find where I found these environment variables - at least gc.github.com returns something
419
- return {
420
- 'cloud.provider': 'ibm_cloud',
421
- 'cloud.region': process.env.IBM_CLOUD_REGION,
422
- };
423
- } else if (process.env.TENCENTCLOUD_REGION) {
424
- // https://www.tencentcloud.com/document/product/583/32748
425
- return {
426
- 'cloud.provider': 'tencent_cloud',
427
- 'cloud.region': process.env.TENCENTCLOUD_REGION,
428
- 'cloud.account.id': process.env.TENCENTCLOUD_APPID,
429
- 'cloud.availability_zone': process.env.TENCENTCLOUD_ZONE,
430
- };
431
- } else if (process.env.NETLIFY) {
432
- // https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables
433
- return {
434
- 'cloud.provider': 'netlify',
435
- };
436
- } else if (process.env.FLY_REGION) {
437
- // https://fly.io/docs/reference/runtime-environment/
438
- return {
439
- 'cloud.provider': 'fly.io',
440
- 'cloud.region': process.env.FLY_REGION,
441
- };
442
- } else if (process.env.DYNO) {
443
- // https://devcenter.heroku.com/articles/dynos#local-environment-variables
444
- return {
445
- 'cloud.provider': 'heroku',
446
- };
447
- } else {
448
- return undefined;
449
- }
450
- }
451
-
452
- exports.getAppContext = getAppContext;
453
- exports.getDeviceContext = getDeviceContext;
454
- exports.nodeContextIntegration = nodeContextIntegration;
455
- exports.readDirAsync = readDirAsync;
456
- exports.readFileAsync = readFileAsync;
457
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.js","sources":["../../../src/integrations/context.ts"],"sourcesContent":["/* eslint-disable max-lines */\n\nimport { execFile } from 'node:child_process';\nimport { readdir, readFile } from 'node:fs';\nimport * as os from 'node:os';\nimport { join } from 'node:path';\nimport { promisify } from 'node:util';\nimport type {\n AppContext,\n CloudResourceContext,\n Contexts,\n CultureContext,\n DeviceContext,\n Event,\n IntegrationFn,\n OsContext,\n} from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\n\nexport const readFileAsync = promisify(readFile);\nexport const readDirAsync = promisify(readdir);\n\n// Process enhanced with methods from Node 18, 20, 22 as @types/node\n// is on `14.18.0` to match minimum version requirements of the SDK\ninterface ProcessWithCurrentValues extends NodeJS.Process {\n availableMemory?(): number;\n}\n\nconst INTEGRATION_NAME = 'Context';\n\ninterface DeviceContextOptions {\n cpu?: boolean;\n memory?: boolean;\n}\n\ninterface ContextOptions {\n app?: boolean;\n os?: boolean;\n device?: DeviceContextOptions | boolean;\n culture?: boolean;\n cloudResource?: boolean;\n}\n\nconst _nodeContextIntegration = ((options: ContextOptions = {}) => {\n let cachedContext: Promise<Contexts> | undefined;\n\n const _options = {\n app: true,\n os: true,\n device: true,\n culture: true,\n cloudResource: true,\n ...options,\n };\n\n /** Add contexts to the event. Caches the context so we only look it up once. */\n async function addContext(event: Event): Promise<Event> {\n if (cachedContext === undefined) {\n cachedContext = _getContexts();\n }\n\n const updatedContext = _updateContext(await cachedContext);\n\n // TODO(v10): conditional with `sendDefaultPii` here?\n event.contexts = {\n ...event.contexts,\n app: { ...updatedContext.app, ...event.contexts?.app },\n os: { ...updatedContext.os, ...event.contexts?.os },\n device: { ...updatedContext.device, ...event.contexts?.device },\n culture: { ...updatedContext.culture, ...event.contexts?.culture },\n cloud_resource: { ...updatedContext.cloud_resource, ...event.contexts?.cloud_resource },\n };\n\n return event;\n }\n\n /** Get the contexts from node. */\n async function _getContexts(): Promise<Contexts> {\n const contexts: Contexts = {};\n\n if (_options.os) {\n contexts.os = await getOsContext();\n }\n\n if (_options.app) {\n contexts.app = getAppContext();\n }\n\n if (_options.device) {\n contexts.device = getDeviceContext(_options.device);\n }\n\n if (_options.culture) {\n const culture = getCultureContext();\n\n if (culture) {\n contexts.culture = culture;\n }\n }\n\n if (_options.cloudResource) {\n contexts.cloud_resource = getCloudResourceContext();\n }\n\n return contexts;\n }\n\n return {\n name: INTEGRATION_NAME,\n processEvent(event) {\n return addContext(event);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Capture context about the environment and the device that the client is running on, to events.\n */\nexport const nodeContextIntegration = defineIntegration(_nodeContextIntegration);\n\n/**\n * Updates the context with dynamic values that can change\n */\nfunction _updateContext(contexts: Contexts): Contexts {\n // Only update properties if they exist\n\n if (contexts.app?.app_memory) {\n contexts.app.app_memory = process.memoryUsage().rss;\n }\n\n if (contexts.app?.free_memory && typeof (process as ProcessWithCurrentValues).availableMemory === 'function') {\n const freeMemory = (process as ProcessWithCurrentValues).availableMemory?.();\n if (freeMemory != null) {\n contexts.app.free_memory = freeMemory;\n }\n }\n\n if (contexts.device?.free_memory) {\n contexts.device.free_memory = os.freemem();\n }\n\n return contexts;\n}\n\n/**\n * Returns the operating system context.\n *\n * Based on the current platform, this uses a different strategy to provide the\n * most accurate OS information. Since this might involve spawning subprocesses\n * or accessing the file system, this should only be executed lazily and cached.\n *\n * - On macOS (Darwin), this will execute the `sw_vers` utility. The context\n * has a `name`, `version`, `build` and `kernel_version` set.\n * - On Linux, this will try to load a distribution release from `/etc` and set\n * the `name`, `version` and `kernel_version` fields.\n * - On all other platforms, only a `name` and `version` will be returned. Note\n * that `version` might actually be the kernel version.\n */\nasync function getOsContext(): Promise<OsContext> {\n const platformId = os.platform();\n switch (platformId) {\n case 'darwin':\n return getDarwinInfo();\n case 'linux':\n return getLinuxInfo();\n default:\n return {\n name: PLATFORM_NAMES[platformId] || platformId,\n version: os.release(),\n };\n }\n}\n\nfunction getCultureContext(): CultureContext | undefined {\n try {\n if (typeof process.versions.icu !== 'string') {\n // Node was built without ICU support\n return;\n }\n\n // Check that node was built with full Intl support. Its possible it was built without support for non-English\n // locales which will make resolvedOptions inaccurate\n //\n // https://nodejs.org/api/intl.html#detecting-internationalization-support\n const january = new Date(9e8);\n const spanish = new Intl.DateTimeFormat('es', { month: 'long' });\n if (spanish.format(january) === 'enero') {\n const options = Intl.DateTimeFormat().resolvedOptions();\n\n return {\n locale: options.locale,\n timezone: options.timeZone,\n };\n }\n } catch (err) {\n //\n }\n\n return;\n}\n\n/**\n * Get app context information from process\n */\nexport function getAppContext(): AppContext {\n const app_memory = process.memoryUsage().rss;\n const app_start_time = new Date(Date.now() - process.uptime() * 1000).toISOString();\n // https://nodejs.org/api/process.html#processavailablememory\n const appContext: AppContext = { app_start_time, app_memory };\n\n if (typeof (process as ProcessWithCurrentValues).availableMemory === 'function') {\n const freeMemory = (process as ProcessWithCurrentValues).availableMemory?.();\n if (freeMemory != null) {\n appContext.free_memory = freeMemory;\n }\n }\n\n return appContext;\n}\n\n/**\n * Gets device information from os\n */\nexport function getDeviceContext(deviceOpt: DeviceContextOptions | true): DeviceContext {\n const device: DeviceContext = {};\n\n // Sometimes os.uptime() throws due to lacking permissions: https://github.com/getsentry/sentry-javascript/issues/8202\n let uptime;\n try {\n uptime = os.uptime();\n } catch (e) {\n // noop\n }\n\n // os.uptime or its return value seem to be undefined in certain environments (e.g. Azure functions).\n // Hence, we only set boot time, if we get a valid uptime value.\n // @see https://github.com/getsentry/sentry-javascript/issues/5856\n if (typeof uptime === 'number') {\n device.boot_time = new Date(Date.now() - uptime * 1000).toISOString();\n }\n\n device.arch = os.arch();\n\n if (deviceOpt === true || deviceOpt.memory) {\n device.memory_size = os.totalmem();\n device.free_memory = os.freemem();\n }\n\n if (deviceOpt === true || deviceOpt.cpu) {\n const cpuInfo = os.cpus() as os.CpuInfo[] | undefined;\n const firstCpu = cpuInfo?.[0];\n if (firstCpu) {\n device.processor_count = cpuInfo.length;\n device.cpu_description = firstCpu.model;\n device.processor_frequency = firstCpu.speed;\n }\n }\n\n return device;\n}\n\n/** Mapping of Node's platform names to actual OS names. */\nconst PLATFORM_NAMES: { [platform: string]: string } = {\n aix: 'IBM AIX',\n freebsd: 'FreeBSD',\n openbsd: 'OpenBSD',\n sunos: 'SunOS',\n win32: 'Windows',\n};\n\n/** Linux version file to check for a distribution. */\ninterface DistroFile {\n /** The file name, located in `/etc`. */\n name: string;\n /** Potential distributions to check. */\n distros: [string, ...string[]];\n}\n\n/** Mapping of linux release files located in /etc to distributions. */\nconst LINUX_DISTROS: DistroFile[] = [\n { name: 'fedora-release', distros: ['Fedora'] },\n { name: 'redhat-release', distros: ['Red Hat Linux', 'Centos'] },\n { name: 'redhat_version', distros: ['Red Hat Linux'] },\n { name: 'SuSE-release', distros: ['SUSE Linux'] },\n { name: 'lsb-release', distros: ['Ubuntu Linux', 'Arch Linux'] },\n { name: 'debian_version', distros: ['Debian'] },\n { name: 'debian_release', distros: ['Debian'] },\n { name: 'arch-release', distros: ['Arch Linux'] },\n { name: 'gentoo-release', distros: ['Gentoo Linux'] },\n { name: 'novell-release', distros: ['SUSE Linux'] },\n { name: 'alpine-release', distros: ['Alpine Linux'] },\n];\n\n/** Functions to extract the OS version from Linux release files. */\nconst LINUX_VERSIONS: {\n [identifier: string]: (content: string) => string | undefined;\n} = {\n alpine: content => content,\n arch: content => matchFirst(/distrib_release=(.*)/, content),\n centos: content => matchFirst(/release ([^ ]+)/, content),\n debian: content => content,\n fedora: content => matchFirst(/release (..)/, content),\n mint: content => matchFirst(/distrib_release=(.*)/, content),\n red: content => matchFirst(/release ([^ ]+)/, content),\n suse: content => matchFirst(/VERSION = (.*)\\n/, content),\n ubuntu: content => matchFirst(/distrib_release=(.*)/, content),\n};\n\n/**\n * Executes a regular expression with one capture group.\n *\n * @param regex A regular expression to execute.\n * @param text Content to execute the RegEx on.\n * @returns The captured string if matched; otherwise undefined.\n */\nfunction matchFirst(regex: RegExp, text: string): string | undefined {\n const match = regex.exec(text);\n return match ? match[1] : undefined;\n}\n\n/** Loads the macOS operating system context. */\nasync function getDarwinInfo(): Promise<OsContext> {\n // Default values that will be used in case no operating system information\n // can be loaded. The default version is computed via heuristics from the\n // kernel version, but the build ID is missing.\n const darwinInfo: OsContext = {\n kernel_version: os.release(),\n name: 'Mac OS X',\n version: `10.${Number(os.release().split('.')[0]) - 4}`,\n };\n\n try {\n // We try to load the actual macOS version by executing the `sw_vers` tool.\n // This tool should be available on every standard macOS installation. In\n // case this fails, we stick with the values computed above.\n\n const output = await new Promise<string>((resolve, reject) => {\n execFile('/usr/bin/sw_vers', (error: Error | null, stdout: string) => {\n if (error) {\n reject(error);\n return;\n }\n resolve(stdout);\n });\n });\n\n darwinInfo.name = matchFirst(/^ProductName:\\s+(.*)$/m, output);\n darwinInfo.version = matchFirst(/^ProductVersion:\\s+(.*)$/m, output);\n darwinInfo.build = matchFirst(/^BuildVersion:\\s+(.*)$/m, output);\n } catch (e) {\n // ignore\n }\n\n return darwinInfo;\n}\n\n/** Returns a distribution identifier to look up version callbacks. */\nfunction getLinuxDistroId(name: string): string {\n return (name.split(' ') as [string])[0].toLowerCase();\n}\n\n/** Loads the Linux operating system context. */\nasync function getLinuxInfo(): Promise<OsContext> {\n // By default, we cannot assume anything about the distribution or Linux\n // version. `os.release()` returns the kernel version and we assume a generic\n // \"Linux\" name, which will be replaced down below.\n const linuxInfo: OsContext = {\n kernel_version: os.release(),\n name: 'Linux',\n };\n\n try {\n // We start guessing the distribution by listing files in the /etc\n // directory. This is were most Linux distributions (except Knoppix) store\n // release files with certain distribution-dependent meta data. We search\n // for exactly one known file defined in `LINUX_DISTROS` and exit if none\n // are found. In case there are more than one file, we just stick with the\n // first one.\n const etcFiles = await readDirAsync('/etc');\n const distroFile = LINUX_DISTROS.find(file => etcFiles.includes(file.name));\n if (!distroFile) {\n return linuxInfo;\n }\n\n // Once that file is known, load its contents. To make searching in those\n // files easier, we lowercase the file contents. Since these files are\n // usually quite small, this should not allocate too much memory and we only\n // hold on to it for a very short amount of time.\n const distroPath = join('/etc', distroFile.name);\n const contents = ((await readFileAsync(distroPath, { encoding: 'utf-8' })) as string).toLowerCase();\n\n // Some Linux distributions store their release information in the same file\n // (e.g. RHEL and Centos). In those cases, we scan the file for an\n // identifier, that basically consists of the first word of the linux\n // distribution name (e.g. \"red\" for Red Hat). In case there is no match, we\n // just assume the first distribution in our list.\n const { distros } = distroFile;\n linuxInfo.name = distros.find(d => contents.indexOf(getLinuxDistroId(d)) >= 0) || distros[0];\n\n // Based on the found distribution, we can now compute the actual version\n // number. This is different for every distribution, so several strategies\n // are computed in `LINUX_VERSIONS`.\n const id = getLinuxDistroId(linuxInfo.name);\n linuxInfo.version = LINUX_VERSIONS[id]?.(contents);\n } catch (e) {\n // ignore\n }\n\n return linuxInfo;\n}\n\n/**\n * Grabs some information about hosting provider based on best effort.\n */\nfunction getCloudResourceContext(): CloudResourceContext | undefined {\n if (process.env.VERCEL) {\n // https://vercel.com/docs/concepts/projects/environment-variables/system-environment-variables#system-environment-variables\n return {\n 'cloud.provider': 'vercel',\n 'cloud.region': process.env.VERCEL_REGION,\n };\n } else if (process.env.AWS_REGION) {\n // https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html\n return {\n 'cloud.provider': 'aws',\n 'cloud.region': process.env.AWS_REGION,\n 'cloud.platform': process.env.AWS_EXECUTION_ENV,\n };\n } else if (process.env.GCP_PROJECT) {\n // https://cloud.google.com/composer/docs/how-to/managing/environment-variables#reserved_variables\n return {\n 'cloud.provider': 'gcp',\n };\n } else if (process.env.ALIYUN_REGION_ID) {\n // TODO: find where I found these environment variables - at least gc.github.com returns something\n return {\n 'cloud.provider': 'alibaba_cloud',\n 'cloud.region': process.env.ALIYUN_REGION_ID,\n };\n } else if (process.env.WEBSITE_SITE_NAME && process.env.REGION_NAME) {\n // https://learn.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet#app-environment\n return {\n 'cloud.provider': 'azure',\n 'cloud.region': process.env.REGION_NAME,\n };\n } else if (process.env.IBM_CLOUD_REGION) {\n // TODO: find where I found these environment variables - at least gc.github.com returns something\n return {\n 'cloud.provider': 'ibm_cloud',\n 'cloud.region': process.env.IBM_CLOUD_REGION,\n };\n } else if (process.env.TENCENTCLOUD_REGION) {\n // https://www.tencentcloud.com/document/product/583/32748\n return {\n 'cloud.provider': 'tencent_cloud',\n 'cloud.region': process.env.TENCENTCLOUD_REGION,\n 'cloud.account.id': process.env.TENCENTCLOUD_APPID,\n 'cloud.availability_zone': process.env.TENCENTCLOUD_ZONE,\n };\n } else if (process.env.NETLIFY) {\n // https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables\n return {\n 'cloud.provider': 'netlify',\n };\n } else if (process.env.FLY_REGION) {\n // https://fly.io/docs/reference/runtime-environment/\n return {\n 'cloud.provider': 'fly.io',\n 'cloud.region': process.env.FLY_REGION,\n };\n } else if (process.env.DYNO) {\n // https://devcenter.heroku.com/articles/dynos#local-environment-variables\n return {\n 'cloud.provider': 'heroku',\n };\n } else {\n return undefined;\n }\n}\n"],"names":["promisify","readFile","readdir","defineIntegration","execFile","join"],"mappings":";;;;;;;;;AAAA;;;MAmBa,aAAc,GAAEA,mBAAS,CAACC,gBAAQ;MAClC,YAAa,GAAED,mBAAS,CAACE,eAAO;;AAE7C;AACA;;AAKA,MAAM,gBAAA,GAAmB,SAAS;;AAelC,MAAM,uBAAA,IAA2B,CAAC,OAAO,GAAmB,EAAE,KAAK;AACnE,EAAE,IAAI,aAAa;;AAEnB,EAAE,MAAM,WAAW;AACnB,IAAI,GAAG,EAAE,IAAI;AACb,IAAI,EAAE,EAAE,IAAI;AACZ,IAAI,MAAM,EAAE,IAAI;AAChB,IAAI,OAAO,EAAE,IAAI;AACjB,IAAI,aAAa,EAAE,IAAI;AACvB,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH;AACA,EAAE,eAAe,UAAU,CAAC,KAAK,EAAyB;AAC1D,IAAI,IAAI,aAAc,KAAI,SAAS,EAAE;AACrC,MAAM,aAAc,GAAE,YAAY,EAAE;AACpC;;AAEA,IAAI,MAAM,cAAe,GAAE,cAAc,CAAC,MAAM,aAAa,CAAC;;AAE9D;AACA,IAAI,KAAK,CAAC,QAAA,GAAW;AACrB,MAAM,GAAG,KAAK,CAAC,QAAQ;AACvB,MAAM,GAAG,EAAE,EAAE,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK;AAC5D,MAAM,EAAE,EAAE,EAAE,GAAG,cAAc,CAAC,EAAE,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI;AACzD,MAAM,MAAM,EAAE,EAAE,GAAG,cAAc,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,QA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