@sentry/node 7.105.0 → 8.0.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 (426) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +114 -38
  3. package/cjs/cron/index.js +15 -0
  4. package/cjs/cron/index.js.map +1 -0
  5. package/cjs/index.js +79 -99
  6. package/cjs/index.js.map +1 -1
  7. package/cjs/integrations/anr/index.js +4 -30
  8. package/cjs/integrations/anr/index.js.map +1 -1
  9. package/cjs/integrations/anr/worker-script.js +2 -2
  10. package/cjs/integrations/console.js +2 -13
  11. package/cjs/integrations/console.js.map +1 -1
  12. package/cjs/integrations/context.js +2 -16
  13. package/cjs/integrations/context.js.map +1 -1
  14. package/cjs/integrations/contextlines.js +6 -23
  15. package/cjs/integrations/contextlines.js.map +1 -1
  16. package/cjs/integrations/http.js +103 -354
  17. package/cjs/integrations/http.js.map +1 -1
  18. package/cjs/integrations/local-variables/index.js +0 -10
  19. package/cjs/integrations/local-variables/index.js.map +1 -1
  20. package/cjs/integrations/local-variables/local-variables-sync.js +29 -24
  21. package/cjs/integrations/local-variables/local-variables-sync.js.map +1 -1
  22. package/cjs/integrations/modules.js +19 -30
  23. package/cjs/integrations/modules.js.map +1 -1
  24. package/cjs/integrations/node-fetch.js +82 -0
  25. package/cjs/integrations/node-fetch.js.map +1 -0
  26. package/cjs/integrations/onuncaughtexception.js +15 -30
  27. package/cjs/integrations/onuncaughtexception.js.map +1 -1
  28. package/cjs/integrations/onunhandledrejection.js +3 -17
  29. package/cjs/integrations/onunhandledrejection.js.map +1 -1
  30. package/cjs/integrations/spotlight.js +4 -22
  31. package/cjs/integrations/spotlight.js.map +1 -1
  32. package/cjs/integrations/tracing/express.js +103 -0
  33. package/cjs/integrations/tracing/express.js.map +1 -0
  34. package/cjs/integrations/tracing/fastify.js +33 -0
  35. package/cjs/integrations/tracing/fastify.js.map +1 -0
  36. package/cjs/integrations/tracing/graphql.js +34 -0
  37. package/cjs/integrations/tracing/graphql.js.map +1 -0
  38. package/cjs/integrations/tracing/hapi/index.js +81 -0
  39. package/cjs/integrations/tracing/hapi/index.js.map +1 -0
  40. package/cjs/integrations/tracing/index.js +37 -0
  41. package/cjs/integrations/tracing/index.js.map +1 -0
  42. package/cjs/integrations/tracing/koa.js +21 -0
  43. package/cjs/integrations/tracing/koa.js.map +1 -0
  44. package/cjs/integrations/tracing/mongo.js +33 -0
  45. package/cjs/integrations/tracing/mongo.js.map +1 -0
  46. package/cjs/integrations/tracing/mongoose.js +33 -0
  47. package/cjs/integrations/tracing/mongoose.js.map +1 -0
  48. package/cjs/integrations/tracing/mysql.js +26 -0
  49. package/cjs/integrations/tracing/mysql.js.map +1 -0
  50. package/cjs/integrations/tracing/mysql2.js +33 -0
  51. package/cjs/integrations/tracing/mysql2.js.map +1 -0
  52. package/cjs/integrations/tracing/nest.js +26 -0
  53. package/cjs/integrations/tracing/nest.js.map +1 -0
  54. package/cjs/integrations/tracing/postgres.js +34 -0
  55. package/cjs/integrations/tracing/postgres.js.map +1 -0
  56. package/cjs/integrations/tracing/prisma.js +33 -0
  57. package/cjs/integrations/tracing/prisma.js.map +1 -0
  58. package/cjs/nodeVersion.js +5 -1
  59. package/cjs/nodeVersion.js.map +1 -1
  60. package/cjs/otel/contextManager.js +16 -0
  61. package/cjs/otel/contextManager.js.map +1 -0
  62. package/cjs/proxy/index.js +1 -2
  63. package/cjs/proxy/index.js.map +1 -1
  64. package/cjs/sdk/api.js +74 -0
  65. package/cjs/sdk/api.js.map +1 -0
  66. package/cjs/sdk/client.js +57 -0
  67. package/cjs/sdk/client.js.map +1 -0
  68. package/cjs/sdk/hub.js +104 -0
  69. package/cjs/sdk/hub.js.map +1 -0
  70. package/cjs/sdk/init.js +224 -0
  71. package/cjs/sdk/init.js.map +1 -0
  72. package/cjs/sdk/initOtel.js +70 -0
  73. package/cjs/sdk/initOtel.js.map +1 -0
  74. package/cjs/sdk/scope.js +18 -0
  75. package/cjs/sdk/scope.js.map +1 -0
  76. package/cjs/transports/http.js +2 -3
  77. package/cjs/transports/http.js.map +1 -1
  78. package/cjs/utils/addOriginToSpan.js +11 -0
  79. package/cjs/utils/addOriginToSpan.js.map +1 -0
  80. package/cjs/{integrations/utils → utils}/errorhandling.js +2 -1
  81. package/cjs/utils/errorhandling.js.map +1 -0
  82. package/cjs/utils/getRequestUrl.js +18 -0
  83. package/cjs/utils/getRequestUrl.js.map +1 -0
  84. package/cjs/utils/module.js.map +1 -0
  85. package/esm/cron/index.js +13 -0
  86. package/esm/cron/index.js.map +1 -0
  87. package/esm/index.js +28 -48
  88. package/esm/index.js.map +1 -1
  89. package/esm/integrations/anr/index.js +7 -32
  90. package/esm/integrations/anr/index.js.map +1 -1
  91. package/esm/integrations/anr/worker-script.js +2 -2
  92. package/esm/integrations/console.js +4 -14
  93. package/esm/integrations/console.js.map +1 -1
  94. package/esm/integrations/context.js +4 -17
  95. package/esm/integrations/context.js.map +1 -1
  96. package/esm/integrations/contextlines.js +8 -25
  97. package/esm/integrations/contextlines.js.map +1 -1
  98. package/esm/integrations/http.js +105 -353
  99. package/esm/integrations/http.js.map +1 -1
  100. package/esm/integrations/local-variables/index.js +2 -11
  101. package/esm/integrations/local-variables/index.js.map +1 -1
  102. package/esm/integrations/local-variables/local-variables-sync.js +31 -25
  103. package/esm/integrations/local-variables/local-variables-sync.js.map +1 -1
  104. package/esm/integrations/modules.js +21 -31
  105. package/esm/integrations/modules.js.map +1 -1
  106. package/esm/integrations/node-fetch.js +80 -0
  107. package/esm/integrations/node-fetch.js.map +1 -0
  108. package/esm/integrations/onuncaughtexception.js +17 -31
  109. package/esm/integrations/onuncaughtexception.js.map +1 -1
  110. package/esm/integrations/onunhandledrejection.js +5 -18
  111. package/esm/integrations/onunhandledrejection.js.map +1 -1
  112. package/esm/integrations/spotlight.js +3 -20
  113. package/esm/integrations/spotlight.js.map +1 -1
  114. package/esm/integrations/tracing/express.js +96 -0
  115. package/esm/integrations/tracing/express.js.map +1 -0
  116. package/esm/integrations/tracing/fastify.js +31 -0
  117. package/esm/integrations/tracing/fastify.js.map +1 -0
  118. package/esm/integrations/tracing/graphql.js +32 -0
  119. package/esm/integrations/tracing/graphql.js.map +1 -0
  120. package/esm/integrations/tracing/hapi/index.js +77 -0
  121. package/esm/integrations/tracing/hapi/index.js.map +1 -0
  122. package/esm/integrations/tracing/index.js +35 -0
  123. package/esm/integrations/tracing/index.js.map +1 -0
  124. package/esm/integrations/tracing/koa.js +19 -0
  125. package/esm/integrations/tracing/koa.js.map +1 -0
  126. package/esm/integrations/tracing/mongo.js +31 -0
  127. package/esm/integrations/tracing/mongo.js.map +1 -0
  128. package/esm/integrations/tracing/mongoose.js +31 -0
  129. package/esm/integrations/tracing/mongoose.js.map +1 -0
  130. package/esm/integrations/tracing/mysql.js +24 -0
  131. package/esm/integrations/tracing/mysql.js.map +1 -0
  132. package/esm/integrations/tracing/mysql2.js +31 -0
  133. package/esm/integrations/tracing/mysql2.js.map +1 -0
  134. package/esm/integrations/tracing/nest.js +24 -0
  135. package/esm/integrations/tracing/nest.js.map +1 -0
  136. package/esm/integrations/tracing/postgres.js +32 -0
  137. package/esm/integrations/tracing/postgres.js.map +1 -0
  138. package/esm/integrations/tracing/prisma.js +31 -0
  139. package/esm/integrations/tracing/prisma.js.map +1 -0
  140. package/esm/nodeVersion.js +5 -2
  141. package/esm/nodeVersion.js.map +1 -1
  142. package/esm/otel/contextManager.js +14 -0
  143. package/esm/otel/contextManager.js.map +1 -0
  144. package/esm/proxy/index.js +0 -1
  145. package/esm/proxy/index.js.map +1 -1
  146. package/esm/sdk/api.js +69 -0
  147. package/esm/sdk/api.js.map +1 -0
  148. package/esm/sdk/client.js +52 -0
  149. package/esm/sdk/client.js.map +1 -0
  150. package/esm/sdk/hub.js +102 -0
  151. package/esm/sdk/hub.js.map +1 -0
  152. package/esm/sdk/init.js +221 -0
  153. package/esm/sdk/init.js.map +1 -0
  154. package/esm/sdk/initOtel.js +67 -0
  155. package/esm/sdk/initOtel.js.map +1 -0
  156. package/esm/sdk/scope.js +16 -0
  157. package/esm/sdk/scope.js.map +1 -0
  158. package/esm/transports/http.js +0 -1
  159. package/esm/transports/http.js.map +1 -1
  160. package/esm/utils/addOriginToSpan.js +9 -0
  161. package/esm/utils/addOriginToSpan.js.map +1 -0
  162. package/esm/{integrations/utils → utils}/errorhandling.js +2 -1
  163. package/esm/utils/errorhandling.js.map +1 -0
  164. package/esm/utils/getRequestUrl.js +16 -0
  165. package/esm/utils/getRequestUrl.js.map +1 -0
  166. package/esm/utils/module.js.map +1 -0
  167. package/package.json +31 -23
  168. package/types/cron/index.d.ts +10 -0
  169. package/types/cron/index.d.ts.map +1 -0
  170. package/types/index.d.ts +30 -145
  171. package/types/index.d.ts.map +1 -1
  172. package/types/integrations/anr/index.d.ts +0 -15
  173. package/types/integrations/anr/index.d.ts.map +1 -1
  174. package/types/integrations/console.d.ts +2 -8
  175. package/types/integrations/console.d.ts.map +1 -1
  176. package/types/integrations/context.d.ts +3 -18
  177. package/types/integrations/context.d.ts.map +1 -1
  178. package/types/integrations/contextlines.d.ts +8 -10
  179. package/types/integrations/contextlines.d.ts.map +1 -1
  180. package/types/integrations/http.d.ts +8 -89
  181. package/types/integrations/http.d.ts.map +1 -1
  182. package/types/integrations/local-variables/index.d.ts +0 -11
  183. package/types/integrations/local-variables/index.d.ts.map +1 -1
  184. package/types/integrations/local-variables/local-variables-async.d.ts +1 -1
  185. package/types/integrations/local-variables/local-variables-async.d.ts.map +1 -1
  186. package/types/integrations/local-variables/local-variables-sync.d.ts +1 -1
  187. package/types/integrations/local-variables/local-variables-sync.d.ts.map +1 -1
  188. package/types/integrations/modules.d.ts +1 -7
  189. package/types/integrations/modules.d.ts.map +1 -1
  190. package/types/integrations/node-fetch.d.ts +15 -0
  191. package/types/integrations/node-fetch.d.ts.map +1 -0
  192. package/types/integrations/onuncaughtexception.d.ts +3 -12
  193. package/types/integrations/onuncaughtexception.d.ts.map +1 -1
  194. package/types/integrations/onunhandledrejection.d.ts +3 -10
  195. package/types/integrations/onunhandledrejection.d.ts.map +1 -1
  196. package/types/integrations/spotlight.d.ts +1 -10
  197. package/types/integrations/spotlight.d.ts.map +1 -1
  198. package/types/integrations/tracing/express.d.ts +37 -0
  199. package/types/integrations/tracing/express.d.ts.map +1 -0
  200. package/types/integrations/tracing/fastify.d.ts +7 -0
  201. package/types/integrations/tracing/fastify.d.ts.map +1 -0
  202. package/types/integrations/tracing/graphql.d.ts +7 -0
  203. package/types/integrations/tracing/graphql.d.ts.map +1 -0
  204. package/types/integrations/tracing/hapi/index.d.ts +18 -0
  205. package/types/integrations/tracing/hapi/index.d.ts.map +1 -0
  206. package/types/integrations/{hapi → tracing/hapi}/types.d.ts +1 -2
  207. package/types/integrations/tracing/hapi/types.d.ts.map +1 -0
  208. package/types/integrations/tracing/index.d.ts +6 -0
  209. package/types/integrations/tracing/index.d.ts.map +1 -0
  210. package/types/integrations/tracing/koa.d.ts +2 -0
  211. package/types/integrations/tracing/koa.d.ts.map +1 -0
  212. package/types/integrations/tracing/mongo.d.ts +7 -0
  213. package/types/integrations/tracing/mongo.d.ts.map +1 -0
  214. package/types/integrations/tracing/mongoose.d.ts +7 -0
  215. package/types/integrations/tracing/mongoose.d.ts.map +1 -0
  216. package/types/integrations/tracing/mysql.d.ts +7 -0
  217. package/types/integrations/tracing/mysql.d.ts.map +1 -0
  218. package/types/integrations/tracing/mysql2.d.ts +7 -0
  219. package/types/integrations/tracing/mysql2.d.ts.map +1 -0
  220. package/types/integrations/tracing/nest.d.ts +7 -0
  221. package/types/integrations/tracing/nest.d.ts.map +1 -0
  222. package/types/integrations/tracing/postgres.d.ts +7 -0
  223. package/types/integrations/tracing/postgres.d.ts.map +1 -0
  224. package/types/integrations/tracing/prisma.d.ts +11 -0
  225. package/types/integrations/tracing/prisma.d.ts.map +1 -0
  226. package/types/nodeVersion.d.ts +3 -3
  227. package/types/nodeVersion.d.ts.map +1 -1
  228. package/types/otel/contextManager.d.ts +10 -0
  229. package/types/otel/contextManager.d.ts.map +1 -0
  230. package/types/proxy/helpers.d.ts +0 -1
  231. package/types/proxy/helpers.d.ts.map +1 -1
  232. package/types/proxy/index.d.ts +0 -1
  233. package/types/proxy/index.d.ts.map +1 -1
  234. package/types/sdk/api.d.ts +18 -0
  235. package/types/sdk/api.d.ts.map +1 -0
  236. package/types/sdk/client.d.ts +17 -0
  237. package/types/sdk/client.d.ts.map +1 -0
  238. package/types/sdk/globals.d.ts +6 -0
  239. package/types/sdk/globals.d.ts.map +1 -0
  240. package/types/sdk/hub.d.ts +7 -0
  241. package/types/sdk/hub.d.ts.map +1 -0
  242. package/types/sdk/init.d.ts +9 -0
  243. package/types/sdk/init.d.ts.map +1 -0
  244. package/types/sdk/initOtel.d.ts +9 -0
  245. package/types/sdk/initOtel.d.ts.map +1 -0
  246. package/types/sdk/scope.d.ts +7 -0
  247. package/types/sdk/scope.d.ts.map +1 -0
  248. package/types/transports/http-module.d.ts +2 -5
  249. package/types/transports/http-module.d.ts.map +1 -1
  250. package/types/transports/http.d.ts.map +1 -1
  251. package/types/types.d.ts +18 -25
  252. package/types/types.d.ts.map +1 -1
  253. package/types/utils/addOriginToSpan.d.ts +5 -0
  254. package/types/utils/addOriginToSpan.d.ts.map +1 -0
  255. package/types/utils/errorhandling.d.ts.map +1 -0
  256. package/types/utils/getRequestUrl.d.ts +5 -0
  257. package/types/utils/getRequestUrl.d.ts.map +1 -0
  258. package/types/utils/module.d.ts.map +1 -0
  259. package/types/utils/prepareEvent.d.ts +17 -0
  260. package/types/utils/prepareEvent.d.ts.map +1 -0
  261. package/types-ts3.8/cron/index.d.ts +10 -0
  262. package/types-ts3.8/index.d.ts +30 -145
  263. package/types-ts3.8/integrations/anr/index.d.ts +0 -15
  264. package/types-ts3.8/integrations/console.d.ts +2 -8
  265. package/types-ts3.8/integrations/context.d.ts +3 -18
  266. package/types-ts3.8/integrations/contextlines.d.ts +8 -10
  267. package/types-ts3.8/integrations/http.d.ts +8 -89
  268. package/types-ts3.8/integrations/local-variables/index.d.ts +0 -11
  269. package/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +1 -1
  270. package/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +1 -1
  271. package/types-ts3.8/integrations/modules.d.ts +1 -7
  272. package/types-ts3.8/integrations/node-fetch.d.ts +15 -0
  273. package/types-ts3.8/integrations/onuncaughtexception.d.ts +3 -12
  274. package/types-ts3.8/integrations/onunhandledrejection.d.ts +3 -10
  275. package/types-ts3.8/integrations/spotlight.d.ts +1 -10
  276. package/types-ts3.8/integrations/tracing/express.d.ts +37 -0
  277. package/types-ts3.8/integrations/tracing/fastify.d.ts +7 -0
  278. package/types-ts3.8/integrations/tracing/graphql.d.ts +7 -0
  279. package/types-ts3.8/integrations/tracing/hapi/index.d.ts +18 -0
  280. package/types-ts3.8/integrations/{hapi → tracing/hapi}/types.d.ts +1 -2
  281. package/types-ts3.8/integrations/tracing/index.d.ts +6 -0
  282. package/types-ts3.8/integrations/tracing/koa.d.ts +2 -0
  283. package/types-ts3.8/integrations/tracing/mongo.d.ts +7 -0
  284. package/types-ts3.8/integrations/tracing/mongoose.d.ts +7 -0
  285. package/types-ts3.8/integrations/tracing/mysql.d.ts +7 -0
  286. package/types-ts3.8/integrations/tracing/mysql2.d.ts +7 -0
  287. package/types-ts3.8/integrations/tracing/nest.d.ts +7 -0
  288. package/types-ts3.8/integrations/tracing/postgres.d.ts +7 -0
  289. package/types-ts3.8/integrations/tracing/prisma.d.ts +11 -0
  290. package/types-ts3.8/nodeVersion.d.ts +3 -3
  291. package/types-ts3.8/otel/contextManager.d.ts +10 -0
  292. package/types-ts3.8/proxy/helpers.d.ts +0 -1
  293. package/types-ts3.8/proxy/index.d.ts +0 -1
  294. package/types-ts3.8/sdk/api.d.ts +18 -0
  295. package/types-ts3.8/sdk/client.d.ts +17 -0
  296. package/types-ts3.8/sdk/globals.d.ts +6 -0
  297. package/types-ts3.8/sdk/hub.d.ts +7 -0
  298. package/types-ts3.8/sdk/init.d.ts +9 -0
  299. package/types-ts3.8/sdk/initOtel.d.ts +9 -0
  300. package/types-ts3.8/sdk/scope.d.ts +7 -0
  301. package/types-ts3.8/transports/http-module.d.ts +2 -4
  302. package/types-ts3.8/types.d.ts +18 -25
  303. package/types-ts3.8/utils/addOriginToSpan.d.ts +5 -0
  304. package/types-ts3.8/utils/getRequestUrl.d.ts +5 -0
  305. package/types-ts3.8/utils/prepareEvent.d.ts +17 -0
  306. package/cjs/async/domain.js +0 -61
  307. package/cjs/async/domain.js.map +0 -1
  308. package/cjs/async/hooks.js +0 -50
  309. package/cjs/async/hooks.js.map +0 -1
  310. package/cjs/async/index.js +0 -22
  311. package/cjs/async/index.js.map +0 -1
  312. package/cjs/client.js +0 -39
  313. package/cjs/client.js.map +0 -1
  314. package/cjs/handlers.js +0 -340
  315. package/cjs/handlers.js.map +0 -1
  316. package/cjs/integrations/anr/legacy.js +0 -29
  317. package/cjs/integrations/anr/legacy.js.map +0 -1
  318. package/cjs/integrations/hapi/index.js +0 -161
  319. package/cjs/integrations/hapi/index.js.map +0 -1
  320. package/cjs/integrations/index.js +0 -32
  321. package/cjs/integrations/index.js.map +0 -1
  322. package/cjs/integrations/undici/index.js +0 -307
  323. package/cjs/integrations/undici/index.js.map +0 -1
  324. package/cjs/integrations/utils/errorhandling.js.map +0 -1
  325. package/cjs/integrations/utils/http.js +0 -225
  326. package/cjs/integrations/utils/http.js.map +0 -1
  327. package/cjs/module.js.map +0 -1
  328. package/cjs/requestDataDeprecated.js +0 -45
  329. package/cjs/requestDataDeprecated.js.map +0 -1
  330. package/cjs/sdk.js +0 -284
  331. package/cjs/sdk.js.map +0 -1
  332. package/cjs/tracing/index.js +0 -29
  333. package/cjs/tracing/index.js.map +0 -1
  334. package/cjs/tracing/integrations.js +0 -14
  335. package/cjs/tracing/integrations.js.map +0 -1
  336. package/cjs/utils.js +0 -45
  337. package/cjs/utils.js.map +0 -1
  338. package/esm/async/domain.js +0 -56
  339. package/esm/async/domain.js.map +0 -1
  340. package/esm/async/hooks.js +0 -45
  341. package/esm/async/hooks.js.map +0 -1
  342. package/esm/async/index.js +0 -20
  343. package/esm/async/index.js.map +0 -1
  344. package/esm/client.js +0 -37
  345. package/esm/client.js.map +0 -1
  346. package/esm/handlers.js +0 -330
  347. package/esm/handlers.js.map +0 -1
  348. package/esm/integrations/anr/legacy.js +0 -27
  349. package/esm/integrations/anr/legacy.js.map +0 -1
  350. package/esm/integrations/hapi/index.js +0 -156
  351. package/esm/integrations/hapi/index.js.map +0 -1
  352. package/esm/integrations/index.js +0 -16
  353. package/esm/integrations/index.js.map +0 -1
  354. package/esm/integrations/undici/index.js +0 -301
  355. package/esm/integrations/undici/index.js.map +0 -1
  356. package/esm/integrations/utils/errorhandling.js.map +0 -1
  357. package/esm/integrations/utils/http.js +0 -216
  358. package/esm/integrations/utils/http.js.map +0 -1
  359. package/esm/module.js.map +0 -1
  360. package/esm/requestDataDeprecated.js +0 -42
  361. package/esm/requestDataDeprecated.js.map +0 -1
  362. package/esm/sdk.js +0 -274
  363. package/esm/sdk.js.map +0 -1
  364. package/esm/tracing/index.js +0 -27
  365. package/esm/tracing/index.js.map +0 -1
  366. package/esm/tracing/integrations.js +0 -2
  367. package/esm/tracing/integrations.js.map +0 -1
  368. package/esm/utils.js +0 -43
  369. package/esm/utils.js.map +0 -1
  370. package/types/async/domain.d.ts +0 -5
  371. package/types/async/domain.d.ts.map +0 -1
  372. package/types/async/hooks.d.ts +0 -5
  373. package/types/async/hooks.d.ts.map +0 -1
  374. package/types/async/index.d.ts +0 -8
  375. package/types/async/index.d.ts.map +0 -1
  376. package/types/client.d.ts +0 -16
  377. package/types/client.d.ts.map +0 -1
  378. package/types/handlers.d.ts +0 -57
  379. package/types/handlers.d.ts.map +0 -1
  380. package/types/integrations/anr/legacy.d.ts +0 -22
  381. package/types/integrations/anr/legacy.d.ts.map +0 -1
  382. package/types/integrations/hapi/index.d.ts +0 -22
  383. package/types/integrations/hapi/index.d.ts.map +0 -1
  384. package/types/integrations/hapi/types.d.ts.map +0 -1
  385. package/types/integrations/index.d.ts +0 -14
  386. package/types/integrations/index.d.ts.map +0 -1
  387. package/types/integrations/undici/index.d.ts +0 -58
  388. package/types/integrations/undici/index.d.ts.map +0 -1
  389. package/types/integrations/undici/types.d.ts +0 -224
  390. package/types/integrations/undici/types.d.ts.map +0 -1
  391. package/types/integrations/utils/errorhandling.d.ts.map +0 -1
  392. package/types/integrations/utils/http.d.ts +0 -70
  393. package/types/integrations/utils/http.d.ts.map +0 -1
  394. package/types/module.d.ts.map +0 -1
  395. package/types/requestDataDeprecated.d.ts +0 -45
  396. package/types/requestDataDeprecated.d.ts.map +0 -1
  397. package/types/sdk.d.ts +0 -74
  398. package/types/sdk.d.ts.map +0 -1
  399. package/types/tracing/index.d.ts +0 -6
  400. package/types/tracing/index.d.ts.map +0 -1
  401. package/types/tracing/integrations.d.ts +0 -2
  402. package/types/tracing/integrations.d.ts.map +0 -1
  403. package/types/utils.d.ts +0 -10
  404. package/types/utils.d.ts.map +0 -1
  405. package/types-ts3.8/async/domain.d.ts +0 -5
  406. package/types-ts3.8/async/hooks.d.ts +0 -5
  407. package/types-ts3.8/async/index.d.ts +0 -8
  408. package/types-ts3.8/client.d.ts +0 -16
  409. package/types-ts3.8/handlers.d.ts +0 -57
  410. package/types-ts3.8/integrations/anr/legacy.d.ts +0 -22
  411. package/types-ts3.8/integrations/hapi/index.d.ts +0 -22
  412. package/types-ts3.8/integrations/index.d.ts +0 -14
  413. package/types-ts3.8/integrations/undici/index.d.ts +0 -58
  414. package/types-ts3.8/integrations/undici/types.d.ts +0 -223
  415. package/types-ts3.8/integrations/utils/http.d.ts +0 -80
  416. package/types-ts3.8/requestDataDeprecated.d.ts +0 -45
  417. package/types-ts3.8/sdk.d.ts +0 -74
  418. package/types-ts3.8/tracing/index.d.ts +0 -6
  419. package/types-ts3.8/tracing/integrations.d.ts +0 -2
  420. package/types-ts3.8/utils.d.ts +0 -10
  421. /package/cjs/{module.js → utils/module.js} +0 -0
  422. /package/esm/{module.js → utils/module.js} +0 -0
  423. /package/types/{integrations/utils → utils}/errorhandling.d.ts +0 -0
  424. /package/types/{module.d.ts → utils/module.d.ts} +0 -0
  425. /package/types-ts3.8/{integrations/utils → utils}/errorhandling.d.ts +0 -0
  426. /package/types-ts3.8/{module.d.ts → utils/module.d.ts} +0 -0
@@ -2,7 +2,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
2
2
 
3
3
  const core = require('@sentry/core');
4
4
  const utils = require('@sentry/utils');
5
- const errorhandling = require('./utils/errorhandling.js');
5
+ const errorhandling = require('../utils/errorhandling.js');
6
6
 
7
7
  const INTEGRATION_NAME = 'OnUnhandledRejection';
8
8
 
@@ -11,29 +11,16 @@ const _onUnhandledRejectionIntegration = ((options = {}) => {
11
11
 
12
12
  return {
13
13
  name: INTEGRATION_NAME,
14
- // TODO v8: Remove this
15
- setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function
16
14
  setup(client) {
17
15
  global.process.on('unhandledRejection', makeUnhandledPromiseHandler(client, { mode }));
18
16
  },
19
17
  };
20
18
  }) ;
21
19
 
22
- const onUnhandledRejectionIntegration = core.defineIntegration(_onUnhandledRejectionIntegration);
23
-
24
20
  /**
25
- * Global Promise Rejection handler.
26
- * @deprecated Use `onUnhandledRejectionIntegration()` instead.
21
+ * Add a global promise rejection handler.
27
22
  */
28
- // eslint-disable-next-line deprecation/deprecation
29
- const OnUnhandledRejection = core.convertIntegrationFnToClass(
30
- INTEGRATION_NAME,
31
- onUnhandledRejectionIntegration,
32
- )
33
-
34
- ;
35
-
36
- // eslint-disable-next-line deprecation/deprecation
23
+ const onUnhandledRejectionIntegration = core.defineIntegration(_onUnhandledRejectionIntegration);
37
24
 
38
25
  /**
39
26
  * Send an exception with reason
@@ -98,7 +85,6 @@ function handleRejection(
98
85
  /* eslint-enable no-console */
99
86
  }
100
87
 
101
- exports.OnUnhandledRejection = OnUnhandledRejection;
102
88
  exports.makeUnhandledPromiseHandler = makeUnhandledPromiseHandler;
103
89
  exports.onUnhandledRejectionIntegration = onUnhandledRejectionIntegration;
104
90
  //# sourceMappingURL=onunhandledrejection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"onunhandledrejection.js","sources":["../../../src/integrations/onunhandledrejection.ts"],"sourcesContent":["import { captureException, convertIntegrationFnToClass, defineIntegration, getClient } from '@sentry/core';\nimport type { Client, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';\nimport { consoleSandbox } from '@sentry/utils';\n\nimport { logAndExitProcess } from './utils/errorhandling';\n\ntype UnhandledRejectionMode = 'none' | 'warn' | 'strict';\n\ninterface OnUnhandledRejectionOptions {\n /**\n * Option deciding what to do after capturing unhandledRejection,\n * that mimicks behavior of node's --unhandled-rejection flag.\n */\n mode: UnhandledRejectionMode;\n}\n\nconst INTEGRATION_NAME = 'OnUnhandledRejection';\n\nconst _onUnhandledRejectionIntegration = ((options: Partial<OnUnhandledRejectionOptions> = {}) => {\n const mode = options.mode || 'warn';\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n setup(client) {\n global.process.on('unhandledRejection', makeUnhandledPromiseHandler(client, { mode }));\n },\n };\n}) satisfies IntegrationFn;\n\nexport const onUnhandledRejectionIntegration = defineIntegration(_onUnhandledRejectionIntegration);\n\n/**\n * Global Promise Rejection handler.\n * @deprecated Use `onUnhandledRejectionIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const OnUnhandledRejection = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n onUnhandledRejectionIntegration,\n) as IntegrationClass<Integration & { setup: (client: Client) => void }> & {\n new (options?: Partial<{ mode: UnhandledRejectionMode }>): Integration;\n};\n\n// eslint-disable-next-line deprecation/deprecation\nexport type OnUnhandledRejection = typeof OnUnhandledRejection;\n\n/**\n * Send an exception with reason\n * @param reason string\n * @param promise promise\n *\n * Exported only for tests.\n */\nexport function makeUnhandledPromiseHandler(\n client: Client,\n options: OnUnhandledRejectionOptions,\n): (reason: unknown, promise: unknown) => void {\n return function sendUnhandledPromise(reason: unknown, promise: unknown): void {\n if (getClient() !== client) {\n return;\n }\n\n captureException(reason, {\n originalException: promise,\n captureContext: {\n extra: { unhandledPromiseRejection: true },\n },\n mechanism: {\n handled: false,\n type: 'onunhandledrejection',\n },\n });\n\n handleRejection(reason, options);\n };\n}\n\n/**\n * Handler for `mode` option\n\n */\nfunction handleRejection(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n reason: any,\n options: OnUnhandledRejectionOptions,\n): void {\n // https://github.com/nodejs/node/blob/7cf6f9e964aa00772965391c23acda6d71972a9a/lib/internal/process/promises.js#L234-L240\n const rejectionWarning =\n 'This error originated either by ' +\n 'throwing inside of an async function without a catch block, ' +\n 'or by rejecting a promise which was not handled with .catch().' +\n ' The promise rejected with the reason:';\n\n /* eslint-disable no-console */\n if (options.mode === 'warn') {\n consoleSandbox(() => {\n console.warn(rejectionWarning);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n console.error(reason && reason.stack ? reason.stack : reason);\n });\n } else if (options.mode === 'strict') {\n consoleSandbox(() => {\n console.warn(rejectionWarning);\n });\n logAndExitProcess(reason);\n }\n /* eslint-enable no-console */\n}\n"],"names":["defineIntegration","convertIntegrationFnToClass","getClient","captureException","consoleSandbox","logAndExitProcess"],"mappings":";;;;;;AAgBA,MAAM,gBAAA,GAAmB,sBAAsB,CAAA;AAC/C;AACA,MAAM,gCAAA,IAAoC,CAAC,OAAO,GAAyC,EAAE,KAAK;AAClG,EAAE,MAAM,IAAK,GAAE,OAAO,CAAC,IAAA,IAAQ,MAAM,CAAA;AACrC;AACA,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B;AACA,IAAI,SAAS,GAAG,EAAE;AAClB,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,oBAAoB,E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AAC,MAAM;AACzB,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;AACpC;AACA,MAAM,OAAO,CAAC,KAAK,CAAC,UAAU,MAAM,CAAC,KAAA,GAAQ,MAAM,CAAC,KAAM,GAAE,MAAM,CAAC,CAAA;AACnE,KAAK,CAAC,CAAA;AACN,GAAE,MAAO,IAAI,OAAO,CAAC,IAAA,KAAS,QAAQ,EAAE;AACxC,IAAIA,oBAAc,CAAC,MAAM;AACzB,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;AACpC,KAAK,CAAC,CAAA;AACN,IAAIC,+BAAiB,CAAC,MAAM,CAAC,CAAA;AAC7B,GAAE;AACF;AACA;;;;;;"}
1
+ {"version":3,"file":"onunhandledrejection.js","sources":["../../../src/integrations/onunhandledrejection.ts"],"sourcesContent":["import { captureException, defineIntegration, getClient } from '@sentry/core';\nimport type { Client, IntegrationFn } from '@sentry/types';\nimport { consoleSandbox } from '@sentry/utils';\nimport { logAndExitProcess } from '../utils/errorhandling';\n\ntype UnhandledRejectionMode = 'none' | 'warn' | 'strict';\n\ninterface OnUnhandledRejectionOptions {\n /**\n * Option deciding what to do after capturing unhandledRejection,\n * that mimicks behavior of node's --unhandled-rejection flag.\n */\n mode: UnhandledRejectionMode;\n}\n\nconst INTEGRATION_NAME = 'OnUnhandledRejection';\n\nconst _onUnhandledRejectionIntegration = ((options: Partial<OnUnhandledRejectionOptions> = {}) => {\n const mode = options.mode || 'warn';\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n global.process.on('unhandledRejection', makeUnhandledPromiseHandler(client, { mode }));\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Add a global promise rejection handler.\n */\nexport const onUnhandledRejectionIntegration = defineIntegration(_onUnhandledRejectionIntegration);\n\n/**\n * Send an exception with reason\n * @param reason string\n * @param promise promise\n *\n * Exported only for tests.\n */\nexport function makeUnhandledPromiseHandler(\n client: Client,\n options: OnUnhandledRejectionOptions,\n): (reason: unknown, promise: unknown) => void {\n return function sendUnhandledPromise(reason: unknown, promise: unknown): void {\n if (getClient() !== client) {\n return;\n }\n\n captureException(reason, {\n originalException: promise,\n captureContext: {\n extra: { unhandledPromiseRejection: true },\n },\n mechanism: {\n handled: false,\n type: 'onunhandledrejection',\n },\n });\n\n handleRejection(reason, options);\n };\n}\n\n/**\n * Handler for `mode` option\n\n */\nfunction handleRejection(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n reason: any,\n options: OnUnhandledRejectionOptions,\n): void {\n // https://github.com/nodejs/node/blob/7cf6f9e964aa00772965391c23acda6d71972a9a/lib/internal/process/promises.js#L234-L240\n const rejectionWarning =\n 'This error originated either by ' +\n 'throwing inside of an async function without a catch block, ' +\n 'or by rejecting a promise which was not handled with .catch().' +\n ' The promise rejected with the reason:';\n\n /* eslint-disable no-console */\n if (options.mode === 'warn') {\n consoleSandbox(() => {\n console.warn(rejectionWarning);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n console.error(reason && reason.stack ? reason.stack : reason);\n });\n } else if (options.mode === 'strict') {\n consoleSandbox(() => {\n console.warn(rejectionWarning);\n });\n logAndExitProcess(reason);\n }\n /* eslint-enable no-console */\n}\n"],"names":["defineIntegration","getClient","captureException","consoleSandbox","logAndExitProcess"],"mappings":";;;;;;AAeA,MAAM,gBAAA,GAAmB,sBAAsB,CAAA;AAC/C;AACA,MAAM,gCAAA,IAAoC,CAAC,OAAO,GAAyC,EAAE,KAAK;AAClG,EAAE,MAAM,IAAK,GAAE,OAAO,CAAC,IAAA,IAAQ,MAAM,CAAA;AACrC;AACA,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,2BAA2B,CAAC,MAAM,EAAE,EAAE,IAAK,EAAC,CAAC,CAAC,CAAA;AAC5F,KAAK;AACL,GAAG,CAA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AE,MAAO,IAAI,OAAO,CAAC,IAAA,KAAS,QAAQ,EAAE;AACxC,IAAIA,oBAAc,CAAC,MAAM;AACzB,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;AACpC,KAAK,CAAC,CAAA;AACN,IAAIC,+BAAiB,CAAC,MAAM,CAAC,CAAA;AAC7B,GAAE;AACF;AACA;;;;;"}
@@ -1,7 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
 
3
3
  const http = require('http');
4
- const url = require('url');
5
4
  const core = require('@sentry/core');
6
5
  const utils = require('@sentry/utils');
7
6
 
@@ -14,8 +13,6 @@ const _spotlightIntegration = ((options = {}) => {
14
13
 
15
14
  return {
16
15
  name: INTEGRATION_NAME,
17
- // TODO v8: Remove this
18
- setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function
19
16
  setup(client) {
20
17
  if (typeof process === 'object' && process.env && process.env.NODE_ENV !== 'development') {
21
18
  utils.logger.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?");
@@ -25,23 +22,14 @@ const _spotlightIntegration = ((options = {}) => {
25
22
  };
26
23
  }) ;
27
24
 
28
- const spotlightIntegration = core.defineIntegration(_spotlightIntegration);
29
-
30
25
  /**
31
26
  * Use this integration to send errors and transactions to Spotlight.
32
27
  *
33
28
  * Learn more about spotlight at https://spotlightjs.com
34
29
  *
35
30
  * Important: This integration only works with Node 18 or newer.
36
- *
37
- * @deprecated Use `spotlightIntegration()` instead.
38
31
  */
39
- // eslint-disable-next-line deprecation/deprecation
40
- const Spotlight = core.convertIntegrationFnToClass(INTEGRATION_NAME, spotlightIntegration)
41
-
42
- ;
43
-
44
- // eslint-disable-next-line deprecation/deprecation
32
+ const spotlightIntegration = core.defineIntegration(_spotlightIntegration);
45
33
 
46
34
  function connectToSpotlight(client, options) {
47
35
  const spotlightUrl = parseSidecarUrl(options.sidecarUrl);
@@ -51,11 +39,6 @@ function connectToSpotlight(client, options) {
51
39
 
52
40
  let failedRequests = 0;
53
41
 
54
- if (typeof client.on !== 'function') {
55
- utils.logger.warn('[Spotlight] Cannot connect to spotlight due to missing method on SDK client (`client.on`)');
56
- return;
57
- }
58
-
59
42
  client.on('beforeEnvelope', (envelope) => {
60
43
  if (failedRequests > 3) {
61
44
  utils.logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests');
@@ -96,11 +79,11 @@ function connectToSpotlight(client, options) {
96
79
  });
97
80
  }
98
81
 
99
- function parseSidecarUrl(url$1) {
82
+ function parseSidecarUrl(url) {
100
83
  try {
101
- return new url.URL(`${url$1}`);
84
+ return new URL(`${url}`);
102
85
  } catch (e) {
103
- utils.logger.warn(`[Spotlight] Invalid sidecar URL: ${url$1}`);
86
+ utils.logger.warn(`[Spotlight] Invalid sidecar URL: ${url}`);
104
87
  return undefined;
105
88
  }
106
89
  }
@@ -121,7 +104,6 @@ function isWrapped(impl) {
121
104
  return '__sentry_original__' in impl;
122
105
  }
123
106
 
124
- exports.Spotlight = Spotlight;
125
107
  exports.getNativeHttpRequest = getNativeHttpRequest;
126
108
  exports.spotlightIntegration = spotlightIntegration;
127
109
  //# sourceMappingURL=spotlight.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spotlight.js","sources":["../../../src/integrations/spotlight.ts"],"sourcesContent":["import * as http from 'http';\nimport { URL } from 'url';\nimport { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';\nimport type { Client, Envelope, Integration, IntegrationClass, IntegrationFn } from '@sentry/types';\nimport { logger, serializeEnvelope } from '@sentry/utils';\n\ntype SpotlightConnectionOptions = {\n /**\n * Set this if the Spotlight Sidecar is not running on localhost:8969\n * By default, the Url is set to http://localhost:8969/stream\n */\n sidecarUrl?: string;\n};\n\nconst INTEGRATION_NAME = 'Spotlight';\n\nconst _spotlightIntegration = ((options: Partial<SpotlightConnectionOptions> = {}) => {\n const _options = {\n sidecarUrl: options.sidecarUrl || 'http://localhost:8969/stream',\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n setup(client) {\n if (typeof process === 'object' && process.env && process.env.NODE_ENV !== 'development') {\n logger.warn(\"[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?\");\n }\n connectToSpotlight(client, _options);\n },\n };\n}) satisfies IntegrationFn;\n\nexport const spotlightIntegration = defineIntegration(_spotlightIntegration);\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n *\n * Important: This integration only works with Node 18 or newer.\n *\n * @deprecated Use `spotlightIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nexport const Spotlight = convertIntegrationFnToClass(INTEGRATION_NAME, spotlightIntegration) as IntegrationClass<\n Integration & { setup: (client: Client) => void }\n> & {\n new (\n options?: Partial<{\n sidecarUrl?: string;\n }>,\n ): Integration;\n};\n\n// eslint-disable-next-line deprecation/deprecation\nexport type Spotlight = typeof Spotlight;\n\nfunction connectToSpotlight(client: Client, options: Required<SpotlightConnectionOptions>): void {\n const spotlightUrl = parseSidecarUrl(options.sidecarUrl);\n if (!spotlightUrl) {\n return;\n }\n\n let failedRequests = 0;\n\n if (typeof client.on !== 'function') {\n logger.warn('[Spotlight] Cannot connect to spotlight due to missing method on SDK client (`client.on`)');\n return;\n }\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (failedRequests > 3) {\n logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests');\n return;\n }\n\n const serializedEnvelope = serializeEnvelope(envelope);\n\n const request = getNativeHttpRequest();\n const req = request(\n {\n method: 'POST',\n path: spotlightUrl.pathname,\n hostname: spotlightUrl.hostname,\n port: spotlightUrl.port,\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n },\n res => {\n res.on('data', () => {\n // Drain socket\n });\n\n res.on('end', () => {\n // Drain socket\n });\n res.setEncoding('utf8');\n },\n );\n\n req.on('error', () => {\n failedRequests++;\n logger.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar');\n });\n req.write(serializedEnvelope);\n req.end();\n });\n}\n\nfunction parseSidecarUrl(url: string): URL | undefined {\n try {\n return new URL(`${url}`);\n } catch {\n logger.warn(`[Spotlight] Invalid sidecar URL: ${url}`);\n return undefined;\n }\n}\n\ntype HttpRequestImpl = typeof http.request;\ntype WrappedHttpRequest = HttpRequestImpl & { __sentry_original__: HttpRequestImpl };\n\n/**\n * We want to get an unpatched http request implementation to avoid capturing our own calls.\n */\nexport function getNativeHttpRequest(): HttpRequestImpl {\n const { request } = http;\n if (isWrapped(request)) {\n return request.__sentry_original__;\n }\n\n return request;\n}\n\nfunction isWrapped(impl: HttpRequestImpl): impl is WrappedHttpRequest {\n return '__sentry_original__' in impl;\n}\n"],"names":["logger","defineIntegration","convertIntegrationFnToClass","serializeEnvelope","url","URL"],"mappings":";;;;;;;AAcA,MAAM,gBAAA,GAAmB,WAAW,CAAA;AACpC;AACA,MAAM,qBAAA,IAAyB,CAAC,OAAO,GAAwC,EAAE,KAAK;AACtF,EAAE,MAAM,WAAW;AACnB,IAAI,UAAU,EAAE,OAAO,CAAC,UAAA,IAAc,8BAA8B;AACpE,GAAG,CAAA;AACH;AACA,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B;AACA,IAAI,SAAS,GAAG,EAAE;AAClB,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,IAAI,OAAO,YAAY,QAAA,IAAY,OAAO,CAAC,GAAI,IAAG,OAAO,CAAC,GAAG,CAAC,QAAS,KAAI,aAAa,EAAE;AAChG,QAAQA,YAAM,CAAC,IAAI,CAAC,4FAA4F,CAAC,CAAA;AACjH,OAAM;AACN,MAAM,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAC1C,KAAK;AACL,GAAG,CAAA;AACH,CAAC,CAAE,EAAA;AACH;MACa,oBAAqB,GAAEC,sBAAiB,CAAC,qBAAqB,EAAC;AAC5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CAAC,CAAA;AACV;AACA,QAAQ,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM;AAC5B;AACA,SAAS,CAAC,CAAA;AACV,QAAQ,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;AAC/B,OAAO;AACP,KAAK,CAAA;AACL;AACA,IAAI,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM;AAC1B,MAAM,cAAc,EAAE,CAAA;AACtB,MAAMH,YAAM,CAAC,IAAI,CAAC,0DAA0D,CAAC,CAAA;AAC7E,KAAK,CAAC,CAAA;AACN,IAAI,GAAG,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;AACjC,IAAI,GAAG,CAAC,GAAG,EAAE,CAAA;AACb,GAAG,CAAC,CAAA;AACJ,CAAA;AACA;AACA,SAAS,eAAe,CAACI,KAAG,EAA2B;AACvD,EAAE,IAAI;AACN,IAAI,OAAO,IAAIC,OAAG,CAAC,CAAC,EAAAD,KAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAAJ,YAAA,CAAA,IAAA,CAAA,CAAA,iCAAA,EAAAI,KAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA;AACA,CAAA;;AAKA;AACA;AACA;AACA,SAAA,oBAAA,GAAA;AACA,EAAA,MAAA,EAAA,OAAA,EAAA,GAAA,IAAA,CAAA;AACA,EAAA,IAAA,SAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,OAAA,CAAA,mBAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,OAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,SAAA,CAAA,IAAA,EAAA;AACA,EAAA,OAAA,qBAAA,IAAA,IAAA,CAAA;AACA;;;;;;"}
1
+ {"version":3,"file":"spotlight.js","sources":["../../../src/integrations/spotlight.ts"],"sourcesContent":["import * as http from 'http';\nimport { defineIntegration } from '@sentry/core';\nimport type { Client, Envelope, IntegrationFn } from '@sentry/types';\nimport { logger, serializeEnvelope } from '@sentry/utils';\n\ntype SpotlightConnectionOptions = {\n /**\n * Set this if the Spotlight Sidecar is not running on localhost:8969\n * By default, the Url is set to http://localhost:8969/stream\n */\n sidecarUrl?: string;\n};\n\nconst INTEGRATION_NAME = 'Spotlight';\n\nconst _spotlightIntegration = ((options: Partial<SpotlightConnectionOptions> = {}) => {\n const _options = {\n sidecarUrl: options.sidecarUrl || 'http://localhost:8969/stream',\n };\n\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n if (typeof process === 'object' && process.env && process.env.NODE_ENV !== 'development') {\n logger.warn(\"[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?\");\n }\n connectToSpotlight(client, _options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n *\n * Important: This integration only works with Node 18 or newer.\n */\nexport const spotlightIntegration = defineIntegration(_spotlightIntegration);\n\nfunction connectToSpotlight(client: Client, options: Required<SpotlightConnectionOptions>): void {\n const spotlightUrl = parseSidecarUrl(options.sidecarUrl);\n if (!spotlightUrl) {\n return;\n }\n\n let failedRequests = 0;\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (failedRequests > 3) {\n logger.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests');\n return;\n }\n\n const serializedEnvelope = serializeEnvelope(envelope);\n\n const request = getNativeHttpRequest();\n const req = request(\n {\n method: 'POST',\n path: spotlightUrl.pathname,\n hostname: spotlightUrl.hostname,\n port: spotlightUrl.port,\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n },\n res => {\n res.on('data', () => {\n // Drain socket\n });\n\n res.on('end', () => {\n // Drain socket\n });\n res.setEncoding('utf8');\n },\n );\n\n req.on('error', () => {\n failedRequests++;\n logger.warn('[Spotlight] Failed to send envelope to Spotlight Sidecar');\n });\n req.write(serializedEnvelope);\n req.end();\n });\n}\n\nfunction parseSidecarUrl(url: string): URL | undefined {\n try {\n return new URL(`${url}`);\n } catch {\n logger.warn(`[Spotlight] Invalid sidecar URL: ${url}`);\n return undefined;\n }\n}\n\ntype HttpRequestImpl = typeof http.request;\ntype WrappedHttpRequest = HttpRequestImpl & { __sentry_original__: HttpRequestImpl };\n\n/**\n * We want to get an unpatched http request implementation to avoid capturing our own calls.\n */\nexport function getNativeHttpRequest(): HttpRequestImpl {\n const { request } = http;\n if (isWrapped(request)) {\n return request.__sentry_original__;\n }\n\n return request;\n}\n\nfunction isWrapped(impl: HttpRequestImpl): impl is WrappedHttpRequest {\n return '__sentry_original__' in impl;\n}\n"],"names":["logger","defineIntegration","serializeEnvelope"],"mappings":";;;;;;AAaA,MAAM,gBAAA,GAAmB,WAAW,CAAA;AACpC;AACA,MAAM,qBAAA,IAAyB,CAAC,OAAO,GAAwC,EAAE,KAAK;AACtF,EAAE,MAAM,WAAW;AACnB,IAAI,UAAU,EAAE,OAAO,CAAC,UAAA,IAAc,8BAA8B;AACpE,GAAG,CAAA;AACH;AACA,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,IAAI,OAAO,YAAY,QAAA,IAAY,OAAO,CAAC,GAAI,IAAG,OAAO,CAAC,GAAG,CAAC,QAAS,KAAI,aAAa,EAAE;AAChG,QAAQA,YAAM,CAAC,IAAI,CAAC,4FAA4F,CAAC,CAAA;AACjH,OAAM;AACN,MAAM,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;AAC1C,KAAK;AACL,GAAG,CAAA;AACH,CAAC,CAAE,EAAA;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,oBAAqB,GAAEC,sBAAiB,CAAC,qBAAqB,EAAC;AAC5E;AACA,SAAS,kBAAkB,CAAC,MAAM,EAAU,OAAO,EAA8C;AACjG,EAAE,MAAM,eAAe,eAAe,CA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GAAG,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;AACjC,IAAI,GAAG,CAAC,GAAG,EAAE,CAAA;AACb,GAAG,CAAC,CAAA;AACJ,CAAA;AACA;AACA,SAAS,eAAe,CAAC,GAAG,EAA2B;AACvD,EAAE,IAAI;AACN,IAAI,OAAO,IAAI,GAAG,CAAC,CAAC,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AACA,GAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAAA,YAAA,CAAA,IAAA,CAAA,CAAA,iCAAA,EAAA,GAAA,CAAA,CAAA,CAAA,CAAA;AACA,IAAA,OAAA,SAAA,CAAA;AACA,GAAA;AACA,CAAA;;AAKA;AACA;AACA;AACA,SAAA,oBAAA,GAAA;AACA,EAAA,MAAA,EAAA,OAAA,EAAA,GAAA,IAAA,CAAA;AACA,EAAA,IAAA,SAAA,CAAA,OAAA,CAAA,EAAA;AACA,IAAA,OAAA,OAAA,CAAA,mBAAA,CAAA;AACA,GAAA;AACA;AACA,EAAA,OAAA,OAAA,CAAA;AACA,CAAA;AACA;AACA,SAAA,SAAA,CAAA,IAAA,EAAA;AACA,EAAA,OAAA,qBAAA,IAAA,IAAA,CAAA;AACA;;;;;"}
@@ -0,0 +1,103 @@
1
+ var {
2
+ _optionalChain
3
+ } = require('@sentry/utils');
4
+
5
+ Object.defineProperty(exports, '__esModule', { value: true });
6
+
7
+ const instrumentation = require('@opentelemetry/instrumentation');
8
+ const instrumentationExpress = require('@opentelemetry/instrumentation-express');
9
+ const core = require('@sentry/core');
10
+ const addOriginToSpan = require('../../utils/addOriginToSpan.js');
11
+
12
+ const _expressIntegration = (() => {
13
+ return {
14
+ name: 'Express',
15
+ setupOnce() {
16
+ instrumentation.registerInstrumentations({
17
+ instrumentations: [
18
+ new instrumentationExpress.ExpressInstrumentation({
19
+ requestHook(span) {
20
+ addOriginToSpan.addOriginToSpan(span, 'auto.http.otel.express');
21
+ },
22
+ }),
23
+ ],
24
+ });
25
+ },
26
+ };
27
+ }) ;
28
+
29
+ /**
30
+ * Express integration
31
+ *
32
+ * Capture tracing data for express.
33
+ * In order to capture exceptions, you have to call `setupExpressErrorHandler(app)` before any other middleware and after all controllers.
34
+ */
35
+ const expressIntegration = core.defineIntegration(_expressIntegration);
36
+
37
+ /**
38
+ * An Express-compatible error handler.
39
+ */
40
+ function expressErrorHandler(options
41
+
42
+ ) {
43
+ return function sentryErrorMiddleware(
44
+ error,
45
+ _req,
46
+ res,
47
+ next,
48
+ ) {
49
+ const shouldHandleError = _optionalChain([options, 'optionalAccess', _ => _.shouldHandleError]) || defaultShouldHandleError;
50
+
51
+ if (shouldHandleError(error)) {
52
+ const client = core.getClient();
53
+ if (client && client.getOptions().autoSessionTracking) {
54
+ // Check if the `SessionFlusher` is instantiated on the client to go into this branch that marks the
55
+ // `requestSession.status` as `Crashed`, and this check is necessary because the `SessionFlusher` is only
56
+ // instantiated when the the`requestHandler` middleware is initialised, which indicates that we should be
57
+ // running in SessionAggregates mode
58
+ const isSessionAggregatesMode = client['_sessionFlusher'] !== undefined;
59
+ if (isSessionAggregatesMode) {
60
+ const requestSession = core.getIsolationScope().getRequestSession();
61
+ // If an error bubbles to the `errorHandler`, then this is an unhandled error, and should be reported as a
62
+ // Crashed session. The `_requestSession.status` is checked to ensure that this error is happening within
63
+ // the bounds of a request, and if so the status is updated
64
+ if (requestSession && requestSession.status !== undefined) {
65
+ requestSession.status = 'crashed';
66
+ }
67
+ }
68
+ }
69
+
70
+ const eventId = core.captureException(error, { mechanism: { type: 'middleware', handled: false } });
71
+ (res ).sentry = eventId;
72
+ next(error);
73
+
74
+ return;
75
+ }
76
+
77
+ next(error);
78
+ };
79
+ }
80
+
81
+ /**
82
+ * Setup an error handler for Express.
83
+ * The error handler must be before any other middleware and after all controllers.
84
+ */
85
+ function setupExpressErrorHandler(app) {
86
+ app.use(expressErrorHandler());
87
+ }
88
+
89
+ function getStatusCodeFromResponse(error) {
90
+ const statusCode = error.status || error.statusCode || error.status_code || (error.output && error.output.statusCode);
91
+ return statusCode ? parseInt(statusCode , 10) : 500;
92
+ }
93
+
94
+ /** Returns true if response code is internal server error */
95
+ function defaultShouldHandleError(error) {
96
+ const status = getStatusCodeFromResponse(error);
97
+ return status >= 500;
98
+ }
99
+
100
+ exports.expressErrorHandler = expressErrorHandler;
101
+ exports.expressIntegration = expressIntegration;
102
+ exports.setupExpressErrorHandler = setupExpressErrorHandler;
103
+ //# sourceMappingURL=express.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"express.js","sources":["../../../../src/integrations/tracing/express.ts"],"sourcesContent":["import type * as http from 'http';\nimport { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { ExpressInstrumentation } from '@opentelemetry/instrumentation-express';\nimport { defineIntegration } from '@sentry/core';\nimport { captureException, getClient, getIsolationScope } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\n\nimport type { NodeClient } from '../../sdk/client';\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\n\nconst _expressIntegration = (() => {\n return {\n name: 'Express',\n setupOnce() {\n registerInstrumentations({\n instrumentations: [\n new ExpressInstrumentation({\n requestHook(span) {\n addOriginToSpan(span, 'auto.http.otel.express');\n },\n }),\n ],\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Express integration\n *\n * Capture tracing data for express.\n * In order to capture exceptions, you have to call `setupExpressErrorHandler(app)` before any other middleware and after all controllers.\n */\nexport const expressIntegration = defineIntegration(_expressIntegration);\n\ninterface MiddlewareError extends Error {\n status?: number | string;\n statusCode?: number | string;\n status_code?: number | string;\n output?: {\n statusCode?: number | string;\n };\n}\n\ntype ExpressMiddleware = (\n error: MiddlewareError,\n req: http.IncomingMessage,\n res: http.ServerResponse,\n next: (error: MiddlewareError) => void,\n) => void;\n\n/**\n * An Express-compatible error handler.\n */\nexport function expressErrorHandler(options?: {\n /**\n * Callback method deciding whether error should be captured and sent to Sentry\n * @param error Captured middleware error\n */\n shouldHandleError?(this: void, error: MiddlewareError): boolean;\n}): ExpressMiddleware {\n return function sentryErrorMiddleware(\n error: MiddlewareError,\n _req: http.IncomingMessage,\n res: http.ServerResponse,\n next: (error: MiddlewareError) => void,\n ): void {\n const shouldHandleError = options?.shouldHandleError || defaultShouldHandleError;\n\n if (shouldHandleError(error)) {\n const client = getClient<NodeClient>();\n if (client && client.getOptions().autoSessionTracking) {\n // Check if the `SessionFlusher` is instantiated on the client to go into this branch that marks the\n // `requestSession.status` as `Crashed`, and this check is necessary because the `SessionFlusher` is only\n // instantiated when the the`requestHandler` middleware is initialised, which indicates that we should be\n // running in SessionAggregates mode\n const isSessionAggregatesMode = client['_sessionFlusher'] !== undefined;\n if (isSessionAggregatesMode) {\n const requestSession = getIsolationScope().getRequestSession();\n // If an error bubbles to the `errorHandler`, then this is an unhandled error, and should be reported as a\n // Crashed session. The `_requestSession.status` is checked to ensure that this error is happening within\n // the bounds of a request, and if so the status is updated\n if (requestSession && requestSession.status !== undefined) {\n requestSession.status = 'crashed';\n }\n }\n }\n\n const eventId = captureException(error, { mechanism: { type: 'middleware', handled: false } });\n (res as { sentry?: string }).sentry = eventId;\n next(error);\n\n return;\n }\n\n next(error);\n };\n}\n\n/**\n * Setup an error handler for Express.\n * The error handler must be before any other middleware and after all controllers.\n */\nexport function setupExpressErrorHandler(app: { use: (middleware: ExpressMiddleware) => unknown }): void {\n app.use(expressErrorHandler());\n}\n\nfunction getStatusCodeFromResponse(error: MiddlewareError): number {\n const statusCode = error.status || error.statusCode || error.status_code || (error.output && error.output.statusCode);\n return statusCode ? parseInt(statusCode as string, 10) : 500;\n}\n\n/** Returns true if response code is internal server error */\nfunction defaultShouldHandleError(error: MiddlewareError): boolean {\n const status = getStatusCodeFromResponse(error);\n return status >= 500;\n}\n"],"names":["registerInstrumentations","ExpressInstrumentation","addOriginToSpan","defineIntegration","getClient","getIsolationScope","captureException"],"mappings":";;;;;;;;;;;AAUA,CAAM,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAA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A,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAwB,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,EAA4B;EACjE,MAAM,CAAO,CAAA,CAAA,CAAA,CAAA,EAAA,EAAE,yBAAyB,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC;EAC/C,CAAO,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,EAAA,CAAA,CAAA,CAAG;AACtB;;;;"}
@@ -0,0 +1,33 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const instrumentation = require('@opentelemetry/instrumentation');
4
+ const instrumentationFastify = require('@opentelemetry/instrumentation-fastify');
5
+ const core = require('@sentry/core');
6
+ const addOriginToSpan = require('../../utils/addOriginToSpan.js');
7
+
8
+ const _fastifyIntegration = (() => {
9
+ return {
10
+ name: 'Fastify',
11
+ setupOnce() {
12
+ instrumentation.registerInstrumentations({
13
+ instrumentations: [
14
+ new instrumentationFastify.FastifyInstrumentation({
15
+ requestHook(span) {
16
+ addOriginToSpan.addOriginToSpan(span, 'auto.http.otel.fastify');
17
+ },
18
+ }),
19
+ ],
20
+ });
21
+ },
22
+ };
23
+ }) ;
24
+
25
+ /**
26
+ * Express integration
27
+ *
28
+ * Capture tracing data for fastify.
29
+ */
30
+ const fastifyIntegration = core.defineIntegration(_fastifyIntegration);
31
+
32
+ exports.fastifyIntegration = fastifyIntegration;
33
+ //# sourceMappingURL=fastify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fastify.js","sources":["../../../../src/integrations/tracing/fastify.ts"],"sourcesContent":["import { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { FastifyInstrumentation } from '@opentelemetry/instrumentation-fastify';\nimport { defineIntegration } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\n\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\n\nconst _fastifyIntegration = (() => {\n return {\n name: 'Fastify',\n setupOnce() {\n registerInstrumentations({\n instrumentations: [\n new FastifyInstrumentation({\n requestHook(span) {\n addOriginToSpan(span, 'auto.http.otel.fastify');\n },\n }),\n ],\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Express integration\n *\n * Capture tracing data for fastify.\n */\nexport const fastifyIntegration = defineIntegration(_fastifyIntegration);\n"],"names":["registerInstrumentations","FastifyInstrumentation","addOriginToSpan","defineIntegration"],"mappings":";;;;;;;AAOA,MAAM,mBAAoB,IAAG,MAAM;AACnC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,SAAS;AACnB,IAAI,SAAS,GAAG;AAChB,MAAMA,wCAAwB,CAAC;AAC/B,QAAQ,gBAAgB,EAAE;AAC1B,UAAU,IAAIC,6CAAsB,CAAC;AACrC,YAAY,WAAW,CAAC,IAAI,EAAE;AAC9B,cAAcC,+BAAe,CAAC,IAAI,EAAE,wBAAwB,CAAC,CAAA;AAC7D,aAAa;AACb,WAAW,CAAC;AACZ,SAAS;AACT,OAAO,CAAC,CAAA;AACR,KAAK;AACL,GAAG,CAAA;AACH,CAAC,CAAE,EAAA;AACH;AACA;AACA;AACA;AACA;AACA;MACa,kBAAmB,GAAEC,sBAAiB,CAAC,mBAAmB;;;;"}
@@ -0,0 +1,34 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const instrumentation = require('@opentelemetry/instrumentation');
4
+ const instrumentationGraphql = require('@opentelemetry/instrumentation-graphql');
5
+ const core = require('@sentry/core');
6
+ const addOriginToSpan = require('../../utils/addOriginToSpan.js');
7
+
8
+ const _graphqlIntegration = (() => {
9
+ return {
10
+ name: 'Graphql',
11
+ setupOnce() {
12
+ instrumentation.registerInstrumentations({
13
+ instrumentations: [
14
+ new instrumentationGraphql.GraphQLInstrumentation({
15
+ ignoreTrivialResolveSpans: true,
16
+ responseHook(span) {
17
+ addOriginToSpan.addOriginToSpan(span, 'auto.graphql.otel.graphql');
18
+ },
19
+ }),
20
+ ],
21
+ });
22
+ },
23
+ };
24
+ }) ;
25
+
26
+ /**
27
+ * GraphQL integration
28
+ *
29
+ * Capture tracing data for GraphQL.
30
+ */
31
+ const graphqlIntegration = core.defineIntegration(_graphqlIntegration);
32
+
33
+ exports.graphqlIntegration = graphqlIntegration;
34
+ //# sourceMappingURL=graphql.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql.js","sources":["../../../../src/integrations/tracing/graphql.ts"],"sourcesContent":["import { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { GraphQLInstrumentation } from '@opentelemetry/instrumentation-graphql';\nimport { defineIntegration } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\n\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\n\nconst _graphqlIntegration = (() => {\n return {\n name: 'Graphql',\n setupOnce() {\n registerInstrumentations({\n instrumentations: [\n new GraphQLInstrumentation({\n ignoreTrivialResolveSpans: true,\n responseHook(span) {\n addOriginToSpan(span, 'auto.graphql.otel.graphql');\n },\n }),\n ],\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * GraphQL integration\n *\n * Capture tracing data for GraphQL.\n */\nexport const graphqlIntegration = defineIntegration(_graphqlIntegration);\n"],"names":["registerInstrumentations","GraphQLInstrumentation","addOriginToSpan","defineIntegration"],"mappings":";;;;;;;AAOA,MAAM,mBAAoB,IAAG,MAAM;AACnC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,SAAS;AACnB,IAAI,SAAS,GAAG;AAChB,MAAMA,wCAAwB,CAAC;AAC/B,QAAQ,gBAAgB,EAAE;AAC1B,UAAU,IAAIC,6CAAsB,CAAC;AACrC,YAAY,yBAAyB,EAAE,IAAI;AAC3C,YAAY,YAAY,CAAC,IAAI,EAAE;AAC/B,cAAcC,+BAAe,CAAC,IAAI,EAAE,2BAA2B,CAAC,CAAA;AAChE,aAAa;AACb,WAAW,CAAC;AACZ,SAAS;AACT,OAAO,CAAC,CAAA;AACR,KAAK;AACL,GAAG,CAAA;AACH,CAAC,CAAE,EAAA;AACH;AACA;AACA;AACA;AACA;AACA;MACa,kBAAmB,GAAEC,sBAAiB,CAAC,mBAAmB;;;;"}
@@ -0,0 +1,81 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const instrumentation = require('@opentelemetry/instrumentation');
4
+ const instrumentationHapi = require('@opentelemetry/instrumentation-hapi');
5
+ const core = require('@sentry/core');
6
+
7
+ const _hapiIntegration = (() => {
8
+ return {
9
+ name: 'Hapi',
10
+ setupOnce() {
11
+ instrumentation.registerInstrumentations({
12
+ instrumentations: [new instrumentationHapi.HapiInstrumentation()],
13
+ });
14
+ },
15
+ };
16
+ }) ;
17
+
18
+ /**
19
+ * Hapi integration
20
+ *
21
+ * Capture tracing data for Hapi.
22
+ * If you also want to capture errors, you need to call `setupHapiErrorHandler(server)` after you set up your server.
23
+ */
24
+ const hapiIntegration = core.defineIntegration(_hapiIntegration);
25
+
26
+ function isBoomObject(response) {
27
+ return response && (response ).isBoom !== undefined;
28
+ }
29
+
30
+ function isErrorEvent(event) {
31
+ return event && (event ).error !== undefined;
32
+ }
33
+
34
+ function sendErrorToSentry(errorData) {
35
+ core.captureException(errorData, {
36
+ mechanism: {
37
+ type: 'hapi',
38
+ handled: false,
39
+ data: {
40
+ function: 'hapiErrorPlugin',
41
+ },
42
+ },
43
+ });
44
+ }
45
+
46
+ const hapiErrorPlugin = {
47
+ name: 'SentryHapiErrorPlugin',
48
+ version: core.SDK_VERSION,
49
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
+ register: async function (serverArg) {
51
+ const server = serverArg ;
52
+
53
+ server.events.on('request', (request, event) => {
54
+ const activeSpan = core.getActiveSpan();
55
+ const rootSpan = activeSpan ? core.getRootSpan(activeSpan) : undefined;
56
+
57
+ if (request.response && isBoomObject(request.response)) {
58
+ sendErrorToSentry(request.response);
59
+ } else if (isErrorEvent(event)) {
60
+ sendErrorToSentry(event.error);
61
+ }
62
+
63
+ if (rootSpan) {
64
+ rootSpan.setStatus('internal_error');
65
+ rootSpan.end();
66
+ }
67
+ });
68
+ },
69
+ };
70
+
71
+ /**
72
+ * Add a Hapi plugin to capture errors to Sentry.
73
+ */
74
+ async function setupHapiErrorHandler(server) {
75
+ await server.register(hapiErrorPlugin);
76
+ }
77
+
78
+ exports.hapiErrorPlugin = hapiErrorPlugin;
79
+ exports.hapiIntegration = hapiIntegration;
80
+ exports.setupHapiErrorHandler = setupHapiErrorHandler;
81
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/hapi/index.ts"],"sourcesContent":["import { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { HapiInstrumentation } from '@opentelemetry/instrumentation-hapi';\nimport { SDK_VERSION, captureException, defineIntegration, getActiveSpan, getRootSpan } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\nimport type { Boom, RequestEvent, ResponseObject, Server } from './types';\n\nconst _hapiIntegration = (() => {\n return {\n name: 'Hapi',\n setupOnce() {\n registerInstrumentations({\n instrumentations: [new HapiInstrumentation()],\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Hapi integration\n *\n * Capture tracing data for Hapi.\n * If you also want to capture errors, you need to call `setupHapiErrorHandler(server)` after you set up your server.\n */\nexport const hapiIntegration = defineIntegration(_hapiIntegration);\n\nfunction isBoomObject(response: ResponseObject | Boom): response is Boom {\n return response && (response as Boom).isBoom !== undefined;\n}\n\nfunction isErrorEvent(event: RequestEvent): event is RequestEvent {\n return event && (event as RequestEvent).error !== undefined;\n}\n\nfunction sendErrorToSentry(errorData: object): void {\n captureException(errorData, {\n mechanism: {\n type: 'hapi',\n handled: false,\n data: {\n function: 'hapiErrorPlugin',\n },\n },\n });\n}\n\nexport const hapiErrorPlugin = {\n name: 'SentryHapiErrorPlugin',\n version: SDK_VERSION,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: async function (serverArg: Record<any, any>) {\n const server = serverArg as unknown as Server;\n\n server.events.on('request', (request, event) => {\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan ? getRootSpan(activeSpan) : undefined;\n\n if (request.response && isBoomObject(request.response)) {\n sendErrorToSentry(request.response);\n } else if (isErrorEvent(event)) {\n sendErrorToSentry(event.error);\n }\n\n if (rootSpan) {\n rootSpan.setStatus('internal_error');\n rootSpan.end();\n }\n });\n },\n};\n\n/**\n * Add a Hapi plugin to capture errors to Sentry.\n */\nexport async function setupHapiErrorHandler(server: Server): Promise<void> {\n await server.register(hapiErrorPlugin);\n}\n"],"names":["registerInstrumentations","HapiInstrumentation","defineIntegration","captureException","SDK_VERSION","getActiveSpan","getRootSpan"],"mappings":";;;;;;AAMA,MAAM,gBAAiB,IAAG,MAAM;AAChC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,SAAS,GAAG;AAChB,MAAMA,wCAAwB,CAAC;AAC/B,QAAQ,gBAAgB,EAAE,CAAC,IAAIC,uCAAmB,EAAE,CAAC;AACrD,OAAO,CAAC,CAAA;AACR,KAAK;AACL,GAAG,CAAA;AACH,CAAC,CAAE,EAAA;AACH;AACA;AACA;AACA;AACA;AACA;AACA;MACa,eAAgB,GAAEC,sBAAiB,CAAC,gBAAgB,EAAC;AAClE;AACA,SAAS,YAAY,CAAC,QAAQ,EAA2C;AACzE,EAAE,OAAO,YAAY,CAAC,WAAkB,MAAO,KAAI,SAAS,CAAA;AAC5D,CAAA;AACA;AACA,SAAS,YAAY,CAAC,K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,CAAA;AACN,GAAG;AACH,EAAC;AACD;AACA;AACA;AACA;AACO,eAAe,qBAAqB,CAAC,MAAM,EAAyB;AAC3E,EAAE,MAAM,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAA;AACxC;;;;;;"}
@@ -0,0 +1,37 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const express = require('./express.js');
4
+ const fastify = require('./fastify.js');
5
+ const graphql = require('./graphql.js');
6
+ const index = require('./hapi/index.js');
7
+ const koa = require('./koa.js');
8
+ const mongo = require('./mongo.js');
9
+ const mongoose = require('./mongoose.js');
10
+ const mysql = require('./mysql.js');
11
+ const mysql2 = require('./mysql2.js');
12
+ const nest = require('./nest.js');
13
+ const postgres = require('./postgres.js');
14
+ const prisma = require('./prisma.js');
15
+
16
+ /**
17
+ * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.
18
+ */
19
+ function getAutoPerformanceIntegrations() {
20
+ return [
21
+ express.expressIntegration(),
22
+ fastify.fastifyIntegration(),
23
+ graphql.graphqlIntegration(),
24
+ mongo.mongoIntegration(),
25
+ mongoose.mongooseIntegration(),
26
+ mysql.mysqlIntegration(),
27
+ mysql2.mysql2Integration(),
28
+ postgres.postgresIntegration(),
29
+ prisma.prismaIntegration(),
30
+ nest.nestIntegration(),
31
+ index.hapiIntegration(),
32
+ koa.koaIntegration(),
33
+ ];
34
+ }
35
+
36
+ exports.getAutoPerformanceIntegrations = getAutoPerformanceIntegrations;
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/types';\n\nimport { expressIntegration } from './express';\nimport { fastifyIntegration } from './fastify';\nimport { graphqlIntegration } from './graphql';\nimport { hapiIntegration } from './hapi';\nimport { koaIntegration } from './koa';\nimport { mongoIntegration } from './mongo';\nimport { mongooseIntegration } from './mongoose';\nimport { mysqlIntegration } from './mysql';\nimport { mysql2Integration } from './mysql2';\nimport { nestIntegration } from './nest';\nimport { postgresIntegration } from './postgres';\nimport { prismaIntegration } from './prisma';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n postgresIntegration(),\n prismaIntegration(),\n nestIntegration(),\n hapiIntegration(),\n koaIntegration(),\n ];\n}\n"],"names":["expressIntegration","fastifyIntegration","graphqlIntegration","mongoIntegration","mongooseIntegration","mysqlIntegration","mysql2Integration","postgresIntegration","prismaIntegration","nestIntegration","hapiIntegration","koaIntegration"],"mappings":";;;;;;;;;;;;;;;AAeA;AACA;AACA;AACO,SAAS,8BAA8B,GAAkB;AAChE,EAAE,OAAO;AACT,IAAIA,0BAAkB,EAAE;AACxB,IAAIC,0BAAkB,EAAE;AACxB,IAAIC,0BAAkB,EAAE;AACxB,IAAIC,sBAAgB,EAAE;AACtB,IAAIC,4BAAmB,EAAE;AACzB,IAAIC,sBAAgB,EAAE;AACtB,IAAIC,wBAAiB,EAAE;AACvB,IAAIC,4BAAmB,EAAE;AACzB,IAAIC,wBAAiB,EAAE;AACvB,IAAIC,oBAAe,EAAE;AACrB,IAAIC,qBAAe,EAAE;AACrB,IAAIC,kBAAc,EAAE;AACpB,GAAG,CAAA;AACH;;;;"}
@@ -0,0 +1,21 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const instrumentation = require('@opentelemetry/instrumentation');
4
+ const instrumentationKoa = require('@opentelemetry/instrumentation-koa');
5
+ const core = require('@sentry/core');
6
+
7
+ const _koaIntegration = (() => {
8
+ return {
9
+ name: 'Koa',
10
+ setupOnce() {
11
+ instrumentation.registerInstrumentations({
12
+ instrumentations: [new instrumentationKoa.KoaInstrumentation()],
13
+ });
14
+ },
15
+ };
16
+ }) ;
17
+
18
+ const koaIntegration = core.defineIntegration(_koaIntegration);
19
+
20
+ exports.koaIntegration = koaIntegration;
21
+ //# sourceMappingURL=koa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"koa.js","sources":["../../../../src/integrations/tracing/koa.ts"],"sourcesContent":["import { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { KoaInstrumentation } from '@opentelemetry/instrumentation-koa';\nimport { defineIntegration } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\n\nconst _koaIntegration = (() => {\n return {\n name: 'Koa',\n setupOnce() {\n registerInstrumentations({\n instrumentations: [new KoaInstrumentation()],\n });\n },\n };\n}) satisfies IntegrationFn;\n\nexport const koaIntegration = defineIntegration(_koaIntegration);\n"],"names":["registerInstrumentations","KoaInstrumentation","defineIntegration"],"mappings":";;;;;;AAKA,MAAM,eAAgB,IAAG,MAAM;AAC/B,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,KAAK;AACf,IAAI,SAAS,GAAG;AAChB,MAAMA,wCAAwB,CAAC;AAC/B,QAAQ,gBAAgB,EAAE,CAAC,IAAIC,qCAAkB,EAAE,CAAC;AACpD,OAAO,CAAC,CAAA;AACR,KAAK;AACL,GAAG,CAAA;AACH,CAAC,CAAE,EAAA;AACH;MACa,cAAe,GAAEC,sBAAiB,CAAC,eAAe;;;;"}
@@ -0,0 +1,33 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const instrumentation = require('@opentelemetry/instrumentation');
4
+ const instrumentationMongodb = require('@opentelemetry/instrumentation-mongodb');
5
+ const core = require('@sentry/core');
6
+ const addOriginToSpan = require('../../utils/addOriginToSpan.js');
7
+
8
+ const _mongoIntegration = (() => {
9
+ return {
10
+ name: 'Mongo',
11
+ setupOnce() {
12
+ instrumentation.registerInstrumentations({
13
+ instrumentations: [
14
+ new instrumentationMongodb.MongoDBInstrumentation({
15
+ responseHook(span) {
16
+ addOriginToSpan.addOriginToSpan(span, 'auto.db.otel.mongo');
17
+ },
18
+ }),
19
+ ],
20
+ });
21
+ },
22
+ };
23
+ }) ;
24
+
25
+ /**
26
+ * MongoDB integration
27
+ *
28
+ * Capture tracing data for MongoDB.
29
+ */
30
+ const mongoIntegration = core.defineIntegration(_mongoIntegration);
31
+
32
+ exports.mongoIntegration = mongoIntegration;
33
+ //# sourceMappingURL=mongo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo.js","sources":["../../../../src/integrations/tracing/mongo.ts"],"sourcesContent":["import { registerInstrumentations } from '@opentelemetry/instrumentation';\nimport { MongoDBInstrumentation } from '@opentelemetry/instrumentation-mongodb';\nimport { defineIntegration } from '@sentry/core';\nimport type { IntegrationFn } from '@sentry/types';\n\nimport { addOriginToSpan } from '../../utils/addOriginToSpan';\n\nconst _mongoIntegration = (() => {\n return {\n name: 'Mongo',\n setupOnce() {\n registerInstrumentations({\n instrumentations: [\n new MongoDBInstrumentation({\n responseHook(span) {\n addOriginToSpan(span, 'auto.db.otel.mongo');\n },\n }),\n ],\n });\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * MongoDB integration\n *\n * Capture tracing data for MongoDB.\n */\nexport const mongoIntegration = defineIntegration(_mongoIntegration);\n"],"names":["registerInstrumentations","MongoDBInstrumentation","addOriginToSpan","defineIntegration"],"mappings":";;;;;;;AAOA,MAAM,iBAAkB,IAAG,MAAM;AACjC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,SAAS,GAAG;AAChB,MAAMA,wCAAwB,CAAC;AAC/B,QAAQ,gBAAgB,EAAE;AAC1B,UAAU,IAAIC,6CAAsB,CAAC;AACrC,YAAY,YAAY,CAAC,IAAI,EAAE;AAC/B,cAAcC,+BAAe,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAA;AACzD,aAAa;AACb,WAAW,CAAC;AACZ,SAAS;AACT,OAAO,CAAC,CAAA;AACR,KAAK;AACL,GAAG,CAAA;AACH,CAAC,CAAE,EAAA;AACH;AACA;AACA;AACA;AACA;AACA;MACa,gBAAiB,GAAEC,sBAAiB,CAAC,iBAAiB;;;;"}
@@ -0,0 +1,33 @@
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ const instrumentation = require('@opentelemetry/instrumentation');
4
+ const instrumentationMongoose = require('@opentelemetry/instrumentation-mongoose');
5
+ const core = require('@sentry/core');
6
+ const addOriginToSpan = require('../../utils/addOriginToSpan.js');
7
+
8
+ const _mongooseIntegration = (() => {
9
+ return {
10
+ name: 'Mongoose',
11
+ setupOnce() {
12
+ instrumentation.registerInstrumentations({
13
+ instrumentations: [
14
+ new instrumentationMongoose.MongooseInstrumentation({
15
+ responseHook(span) {
16
+ addOriginToSpan.addOriginToSpan(span, 'auto.db.otel.mongoose');
17
+ },
18
+ }),
19
+ ],
20
+ });
21
+ },
22
+ };
23
+ }) ;
24
+
25
+ /**
26
+ * Mongoose integration
27
+ *
28
+ * Capture tracing data for Mongoose.
29
+ */
30
+ const mongooseIntegration = core.defineIntegration(_mongooseIntegration);
31
+
32
+ exports.mongooseIntegration = mongooseIntegration;
33
+ //# sourceMappingURL=mongoose.js.map