@sentry/browser 10.70.0 → 11.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 (344) hide show
  1. package/build/npm/cjs/dev/client.js +1 -0
  2. package/build/npm/cjs/dev/client.js.map +1 -1
  3. package/build/npm/cjs/dev/eventbuilder.js +8 -8
  4. package/build/npm/cjs/dev/eventbuilder.js.map +1 -1
  5. package/build/npm/cjs/dev/index.js +3 -9
  6. package/build/npm/cjs/dev/index.js.map +1 -1
  7. package/build/npm/cjs/dev/integrations/browsersession.js +1 -1
  8. package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -1
  9. package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js +2 -1
  10. package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js.map +1 -1
  11. package/build/npm/cjs/dev/integrations/graphqlClient.js +4 -4
  12. package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
  13. package/build/npm/cjs/dev/integrations/httpclient.js +1 -6
  14. package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
  15. package/build/npm/cjs/dev/integrations/httpcontext.js +18 -10
  16. package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
  17. package/build/npm/cjs/dev/integrations/spanstreaming.js +4 -19
  18. package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -1
  19. package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
  20. package/build/npm/cjs/dev/integrations/view-hierarchy.js +1 -0
  21. package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -1
  22. package/build/npm/cjs/dev/integrations/webVitals.js +9 -14
  23. package/build/npm/cjs/dev/integrations/webVitals.js.map +1 -1
  24. package/build/npm/cjs/dev/profiling/index.js.map +1 -1
  25. package/build/npm/cjs/dev/profiling/integration.js +21 -91
  26. package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
  27. package/build/npm/cjs/dev/profiling/utils.js +1 -284
  28. package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
  29. package/build/npm/cjs/dev/sdk.js +10 -7
  30. package/build/npm/cjs/dev/sdk.js.map +1 -1
  31. package/build/npm/cjs/dev/tracing/backgroundtab.js +6 -2
  32. package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
  33. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +30 -42
  34. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
  35. package/build/npm/cjs/dev/tracing/linkedTraces.js +4 -2
  36. package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
  37. package/build/npm/cjs/dev/tracing/request.js +10 -17
  38. package/build/npm/cjs/dev/tracing/request.js.map +1 -1
  39. package/build/npm/cjs/dev/transports/fetch.js.map +1 -1
  40. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +2 -8
  41. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -1
  42. package/build/npm/cjs/prod/client.js +1 -0
  43. package/build/npm/cjs/prod/client.js.map +1 -1
  44. package/build/npm/cjs/prod/eventbuilder.js +8 -8
  45. package/build/npm/cjs/prod/eventbuilder.js.map +1 -1
  46. package/build/npm/cjs/prod/index.js +3 -9
  47. package/build/npm/cjs/prod/index.js.map +1 -1
  48. package/build/npm/cjs/prod/integrations/browsersession.js +1 -1
  49. package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -1
  50. package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js +2 -1
  51. package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js.map +1 -1
  52. package/build/npm/cjs/prod/integrations/graphqlClient.js +4 -4
  53. package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
  54. package/build/npm/cjs/prod/integrations/httpclient.js +1 -6
  55. package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
  56. package/build/npm/cjs/prod/integrations/httpcontext.js +18 -10
  57. package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
  58. package/build/npm/cjs/prod/integrations/spanstreaming.js +4 -19
  59. package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -1
  60. package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
  61. package/build/npm/cjs/prod/integrations/view-hierarchy.js +1 -0
  62. package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -1
  63. package/build/npm/cjs/prod/integrations/webVitals.js +9 -14
  64. package/build/npm/cjs/prod/integrations/webVitals.js.map +1 -1
  65. package/build/npm/cjs/prod/profiling/index.js.map +1 -1
  66. package/build/npm/cjs/prod/profiling/integration.js +21 -91
  67. package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
  68. package/build/npm/cjs/prod/profiling/utils.js +1 -284
  69. package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
  70. package/build/npm/cjs/prod/sdk.js +10 -7
  71. package/build/npm/cjs/prod/sdk.js.map +1 -1
  72. package/build/npm/cjs/prod/tracing/backgroundtab.js +6 -2
  73. package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
  74. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +30 -42
  75. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
  76. package/build/npm/cjs/prod/tracing/linkedTraces.js +4 -2
  77. package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
  78. package/build/npm/cjs/prod/tracing/request.js +10 -17
  79. package/build/npm/cjs/prod/tracing/request.js.map +1 -1
  80. package/build/npm/cjs/prod/transports/fetch.js.map +1 -1
  81. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +2 -8
  82. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -1
  83. package/build/npm/esm/dev/client.js +1 -0
  84. package/build/npm/esm/dev/client.js.map +1 -1
  85. package/build/npm/esm/dev/eventbuilder.js +8 -8
  86. package/build/npm/esm/dev/eventbuilder.js.map +1 -1
  87. package/build/npm/esm/dev/index.js +2 -2
  88. package/build/npm/esm/dev/integrations/browsersession.js +1 -1
  89. package/build/npm/esm/dev/integrations/browsersession.js.map +1 -1
  90. package/build/npm/esm/dev/integrations/fetchStreamPerformance.js +3 -2
  91. package/build/npm/esm/dev/integrations/fetchStreamPerformance.js.map +1 -1
  92. package/build/npm/esm/dev/integrations/graphqlClient.js +6 -6
  93. package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
  94. package/build/npm/esm/dev/integrations/httpclient.js +1 -6
  95. package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
  96. package/build/npm/esm/dev/integrations/httpcontext.js +19 -11
  97. package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
  98. package/build/npm/esm/dev/integrations/spanstreaming.js +5 -21
  99. package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -1
  100. package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
  101. package/build/npm/esm/dev/integrations/view-hierarchy.js +1 -0
  102. package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -1
  103. package/build/npm/esm/dev/integrations/webVitals.js +10 -15
  104. package/build/npm/esm/dev/integrations/webVitals.js.map +1 -1
  105. package/build/npm/esm/dev/package.json +1 -1
  106. package/build/npm/esm/dev/profiling/index.js.map +1 -1
  107. package/build/npm/esm/dev/profiling/integration.js +22 -92
  108. package/build/npm/esm/dev/profiling/integration.js.map +1 -1
  109. package/build/npm/esm/dev/profiling/utils.js +3 -273
  110. package/build/npm/esm/dev/profiling/utils.js.map +1 -1
  111. package/build/npm/esm/dev/sdk.js +11 -8
  112. package/build/npm/esm/dev/sdk.js.map +1 -1
  113. package/build/npm/esm/dev/tracing/backgroundtab.js +6 -2
  114. package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
  115. package/build/npm/esm/dev/tracing/browserTracingIntegration.js +32 -44
  116. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
  117. package/build/npm/esm/dev/tracing/linkedTraces.js +4 -2
  118. package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
  119. package/build/npm/esm/dev/tracing/request.js +12 -19
  120. package/build/npm/esm/dev/tracing/request.js.map +1 -1
  121. package/build/npm/esm/dev/transports/fetch.js.map +1 -1
  122. package/build/npm/esm/dev/utils/lazyLoadIntegration.js +2 -8
  123. package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -1
  124. package/build/npm/esm/prod/client.js +1 -0
  125. package/build/npm/esm/prod/client.js.map +1 -1
  126. package/build/npm/esm/prod/eventbuilder.js +8 -8
  127. package/build/npm/esm/prod/eventbuilder.js.map +1 -1
  128. package/build/npm/esm/prod/index.js +2 -2
  129. package/build/npm/esm/prod/integrations/browsersession.js +1 -1
  130. package/build/npm/esm/prod/integrations/browsersession.js.map +1 -1
  131. package/build/npm/esm/prod/integrations/fetchStreamPerformance.js +3 -2
  132. package/build/npm/esm/prod/integrations/fetchStreamPerformance.js.map +1 -1
  133. package/build/npm/esm/prod/integrations/graphqlClient.js +6 -6
  134. package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
  135. package/build/npm/esm/prod/integrations/httpclient.js +1 -6
  136. package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
  137. package/build/npm/esm/prod/integrations/httpcontext.js +19 -11
  138. package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
  139. package/build/npm/esm/prod/integrations/spanstreaming.js +5 -21
  140. package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -1
  141. package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
  142. package/build/npm/esm/prod/integrations/view-hierarchy.js +1 -0
  143. package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -1
  144. package/build/npm/esm/prod/integrations/webVitals.js +10 -15
  145. package/build/npm/esm/prod/integrations/webVitals.js.map +1 -1
  146. package/build/npm/esm/prod/package.json +1 -1
  147. package/build/npm/esm/prod/profiling/index.js.map +1 -1
  148. package/build/npm/esm/prod/profiling/integration.js +22 -92
  149. package/build/npm/esm/prod/profiling/integration.js.map +1 -1
  150. package/build/npm/esm/prod/profiling/utils.js +3 -273
  151. package/build/npm/esm/prod/profiling/utils.js.map +1 -1
  152. package/build/npm/esm/prod/sdk.js +11 -8
  153. package/build/npm/esm/prod/sdk.js.map +1 -1
  154. package/build/npm/esm/prod/tracing/backgroundtab.js +6 -2
  155. package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
  156. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +32 -44
  157. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
  158. package/build/npm/esm/prod/tracing/linkedTraces.js +4 -2
  159. package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
  160. package/build/npm/esm/prod/tracing/request.js +12 -19
  161. package/build/npm/esm/prod/tracing/request.js.map +1 -1
  162. package/build/npm/esm/prod/transports/fetch.js.map +1 -1
  163. package/build/npm/esm/prod/utils/lazyLoadIntegration.js +2 -8
  164. package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -1
  165. package/build/npm/types/client.d.ts.map +1 -1
  166. package/build/npm/types/eventbuilder.d.ts.map +1 -1
  167. package/build/npm/types/exports.d.ts +1 -1
  168. package/build/npm/types/exports.d.ts.map +1 -1
  169. package/build/npm/types/index.bundle.d.ts +2 -2
  170. package/build/npm/types/index.bundle.d.ts.map +1 -1
  171. package/build/npm/types/index.bundle.feedback.d.ts +2 -2
  172. package/build/npm/types/index.bundle.feedback.d.ts.map +1 -1
  173. package/build/npm/types/index.bundle.logs.metrics.d.ts +1 -1
  174. package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
  175. package/build/npm/types/index.bundle.replay.d.ts +2 -2
  176. package/build/npm/types/index.bundle.replay.d.ts.map +1 -1
  177. package/build/npm/types/index.bundle.replay.feedback.d.ts +2 -2
  178. package/build/npm/types/index.bundle.replay.feedback.d.ts.map +1 -1
  179. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +1 -1
  180. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
  181. package/build/npm/types/index.bundle.tracing.d.ts +2 -2
  182. package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
  183. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +1 -1
  184. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -1
  185. package/build/npm/types/index.bundle.tracing.replay.d.ts +2 -2
  186. package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
  187. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +2 -2
  188. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
  189. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -1
  190. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -1
  191. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +1 -1
  192. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
  193. package/build/npm/types/index.d.ts +2 -2
  194. package/build/npm/types/index.d.ts.map +1 -1
  195. package/build/npm/types/integrations/browsersession.d.ts +3 -5
  196. package/build/npm/types/integrations/browsersession.d.ts.map +1 -1
  197. package/build/npm/types/integrations/featureFlags/openfeature/integration.d.ts.map +1 -1
  198. package/build/npm/types/integrations/featureFlags/openfeature/types.d.ts +9 -9
  199. package/build/npm/types/integrations/featureFlags/openfeature/types.d.ts.map +1 -1
  200. package/build/npm/types/integrations/fetchStreamPerformance.d.ts.map +1 -1
  201. package/build/npm/types/integrations/graphqlClient.d.ts.map +1 -1
  202. package/build/npm/types/integrations/httpcontext.d.ts.map +1 -1
  203. package/build/npm/types/integrations/spanstreaming.d.ts +1 -0
  204. package/build/npm/types/integrations/spanstreaming.d.ts.map +1 -1
  205. package/build/npm/types/integrations/spotlight.d.ts +1 -1
  206. package/build/npm/types/integrations/usertiming.d.ts +2 -0
  207. package/build/npm/types/integrations/usertiming.d.ts.map +1 -0
  208. package/build/npm/types/integrations/view-hierarchy.d.ts.map +1 -1
  209. package/build/npm/types/integrations/webVitals.d.ts +1 -8
  210. package/build/npm/types/integrations/webVitals.d.ts.map +1 -1
  211. package/build/npm/types/integrations/webWorker.d.ts +1 -1
  212. package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -1
  213. package/build/npm/types/profiling/index.d.ts.map +1 -1
  214. package/build/npm/types/profiling/integration.d.ts.map +1 -1
  215. package/build/npm/types/profiling/utils.d.ts +1 -74
  216. package/build/npm/types/profiling/utils.d.ts.map +1 -1
  217. package/build/npm/types/sdk.d.ts.map +1 -1
  218. package/build/npm/types/tracing/backgroundtab.d.ts.map +1 -1
  219. package/build/npm/types/tracing/browserTracingIntegration.d.ts +1 -47
  220. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  221. package/build/npm/types/tracing/linkedTraces.d.ts.map +1 -1
  222. package/build/npm/types/tracing/request.d.ts +0 -13
  223. package/build/npm/types/tracing/request.d.ts.map +1 -1
  224. package/build/npm/types/utils/lazyLoadIntegration.d.ts +1 -1
  225. package/build/npm/types/utils/lazyLoadIntegration.d.ts.map +1 -1
  226. package/package.json +12 -21
  227. package/build/npm/cjs/dev/profiling/startProfileForSpan.js +0 -91
  228. package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +0 -1
  229. package/build/npm/cjs/prod/profiling/startProfileForSpan.js +0 -91
  230. package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +0 -1
  231. package/build/npm/esm/dev/profiling/startProfileForSpan.js +0 -89
  232. package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +0 -1
  233. package/build/npm/esm/prod/profiling/startProfileForSpan.js +0 -89
  234. package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +0 -1
  235. package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts +0 -2
  236. package/build/npm/types/integrations-bundle/index.createlangchaincallbackhandler.d.ts.map +0 -1
  237. package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts +0 -2
  238. package/build/npm/types/integrations-bundle/index.instrumentanthropicaiclient.d.ts.map +0 -1
  239. package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +0 -2
  240. package/build/npm/types/integrations-bundle/index.instrumentgooglegenaiclient.d.ts.map +0 -1
  241. package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts +0 -2
  242. package/build/npm/types/integrations-bundle/index.instrumentlangchainembeddings.d.ts.map +0 -1
  243. package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts +0 -2
  244. package/build/npm/types/integrations-bundle/index.instrumentlanggraph.d.ts.map +0 -1
  245. package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts +0 -2
  246. package/build/npm/types/integrations-bundle/index.instrumentopenaiclient.d.ts.map +0 -1
  247. package/build/npm/types/integrations-bundle/index.instrumentstategraph.d.ts +0 -2
  248. package/build/npm/types/integrations-bundle/index.instrumentstategraph.d.ts.map +0 -1
  249. package/build/npm/types/profiling/startProfileForSpan.d.ts +0 -8
  250. package/build/npm/types/profiling/startProfileForSpan.d.ts.map +0 -1
  251. package/build/npm/types-ts3.8/client.d.ts +0 -76
  252. package/build/npm/types-ts3.8/debug-build.d.ts +0 -7
  253. package/build/npm/types-ts3.8/diagnose-sdk.d.ts +0 -11
  254. package/build/npm/types-ts3.8/eventbuilder.d.ts +0 -40
  255. package/build/npm/types-ts3.8/exports.d.ts +0 -21
  256. package/build/npm/types-ts3.8/feedbackAsync.d.ts +0 -7
  257. package/build/npm/types-ts3.8/feedbackSync.d.ts +0 -4
  258. package/build/npm/types-ts3.8/helpers.d.ts +0 -27
  259. package/build/npm/types-ts3.8/index.bundle.base.d.ts +0 -2
  260. package/build/npm/types-ts3.8/index.bundle.d.ts +0 -5
  261. package/build/npm/types-ts3.8/index.bundle.feedback.d.ts +0 -7
  262. package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +0 -6
  263. package/build/npm/types-ts3.8/index.bundle.replay.d.ts +0 -6
  264. package/build/npm/types-ts3.8/index.bundle.replay.feedback.d.ts +0 -8
  265. package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +0 -7
  266. package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +0 -13
  267. package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +0 -13
  268. package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +0 -14
  269. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +0 -16
  270. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +0 -14
  271. package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +0 -14
  272. package/build/npm/types-ts3.8/index.d.ts +0 -38
  273. package/build/npm/types-ts3.8/integrations/breadcrumbs.d.ts +0 -16
  274. package/build/npm/types-ts3.8/integrations/browserapierrors.d.ts +0 -23
  275. package/build/npm/types-ts3.8/integrations/browserprofiling.d.ts +0 -2
  276. package/build/npm/types-ts3.8/integrations/browsersession.d.ts +0 -25
  277. package/build/npm/types-ts3.8/integrations/contextlines.d.ts +0 -32
  278. package/build/npm/types-ts3.8/integrations/culturecontext.d.ts +0 -18
  279. package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/index.d.ts +0 -2
  280. package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/integration.d.ts +0 -25
  281. package/build/npm/types-ts3.8/integrations/featureFlags/growthbook/types.d.ts +0 -6
  282. package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/index.d.ts +0 -2
  283. package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/integration.d.ts +0 -27
  284. package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/types.d.ts +0 -44
  285. package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/index.d.ts +0 -2
  286. package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/integration.d.ts +0 -18
  287. package/build/npm/types-ts3.8/integrations/featureFlags/openfeature/types.d.ts +0 -78
  288. package/build/npm/types-ts3.8/integrations/featureFlags/statsig/index.d.ts +0 -2
  289. package/build/npm/types-ts3.8/integrations/featureFlags/statsig/integration.d.ts +0 -30
  290. package/build/npm/types-ts3.8/integrations/featureFlags/statsig/types.d.ts +0 -14
  291. package/build/npm/types-ts3.8/integrations/featureFlags/unleash/index.d.ts +0 -2
  292. package/build/npm/types-ts3.8/integrations/featureFlags/unleash/integration.d.ts +0 -31
  293. package/build/npm/types-ts3.8/integrations/featureFlags/unleash/types.d.ts +0 -21
  294. package/build/npm/types-ts3.8/integrations/fetchStreamPerformance.d.ts +0 -16
  295. package/build/npm/types-ts3.8/integrations/globalhandlers.d.ts +0 -19
  296. package/build/npm/types-ts3.8/integrations/graphqlClient.d.ts +0 -60
  297. package/build/npm/types-ts3.8/integrations/httpclient.d.ts +0 -32
  298. package/build/npm/types-ts3.8/integrations/httpcontext.d.ts +0 -8
  299. package/build/npm/types-ts3.8/integrations/linkederrors.d.ts +0 -12
  300. package/build/npm/types-ts3.8/integrations/reportingobserver.d.ts +0 -12
  301. package/build/npm/types-ts3.8/integrations/spanstreaming.d.ts +0 -4
  302. package/build/npm/types-ts3.8/integrations/spotlight.d.ts +0 -21
  303. package/build/npm/types-ts3.8/integrations/view-hierarchy.d.ts +0 -51
  304. package/build/npm/types-ts3.8/integrations/webVitals.d.ts +0 -26
  305. package/build/npm/types-ts3.8/integrations/webWorker.d.ts +0 -129
  306. package/build/npm/types-ts3.8/integrations-bundle/index.captureconsole.d.ts +0 -2
  307. package/build/npm/types-ts3.8/integrations-bundle/index.createlangchaincallbackhandler.d.ts +0 -2
  308. package/build/npm/types-ts3.8/integrations-bundle/index.dedupe.d.ts +0 -2
  309. package/build/npm/types-ts3.8/integrations-bundle/index.extraerrordata.d.ts +0 -2
  310. package/build/npm/types-ts3.8/integrations-bundle/index.feedback.d.ts +0 -5
  311. package/build/npm/types-ts3.8/integrations-bundle/index.graphqlclient.d.ts +0 -2
  312. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentanthropicaiclient.d.ts +0 -2
  313. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentgooglegenaiclient.d.ts +0 -2
  314. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlangchainembeddings.d.ts +0 -2
  315. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentlanggraph.d.ts +0 -2
  316. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentopenaiclient.d.ts +0 -2
  317. package/build/npm/types-ts3.8/integrations-bundle/index.instrumentstategraph.d.ts +0 -2
  318. package/build/npm/types-ts3.8/integrations-bundle/index.modulemetadata.d.ts +0 -2
  319. package/build/npm/types-ts3.8/integrations-bundle/index.rewriteframes.d.ts +0 -2
  320. package/build/npm/types-ts3.8/integrations-bundle/index.spotlight.d.ts +0 -2
  321. package/build/npm/types-ts3.8/normalizeStringifyValue.d.ts +0 -15
  322. package/build/npm/types-ts3.8/pluggable-exports-bundle/index.multiplexedtransport.d.ts +0 -2
  323. package/build/npm/types-ts3.8/profiling/UIProfiler.d.ts +0 -75
  324. package/build/npm/types-ts3.8/profiling/index.d.ts +0 -8
  325. package/build/npm/types-ts3.8/profiling/integration.d.ts +0 -4
  326. package/build/npm/types-ts3.8/profiling/jsSelfProfiling.d.ts +0 -41
  327. package/build/npm/types-ts3.8/profiling/startProfileForSpan.d.ts +0 -8
  328. package/build/npm/types-ts3.8/profiling/utils.d.ts +0 -112
  329. package/build/npm/types-ts3.8/report-dialog.d.ts +0 -8
  330. package/build/npm/types-ts3.8/sdk.d.ts +0 -62
  331. package/build/npm/types-ts3.8/stack-parsers.d.ts +0 -9
  332. package/build/npm/types-ts3.8/tracing/backgroundtab.d.ts +0 -6
  333. package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +0 -271
  334. package/build/npm/types-ts3.8/tracing/linkedTraces.d.ts +0 -52
  335. package/build/npm/types-ts3.8/tracing/reportPageLoaded.d.ts +0 -11
  336. package/build/npm/types-ts3.8/tracing/request.d.ts +0 -87
  337. package/build/npm/types-ts3.8/tracing/setActiveSpan.d.ts +0 -39
  338. package/build/npm/types-ts3.8/tracing/utils.d.ts +0 -17
  339. package/build/npm/types-ts3.8/transports/fetch.d.ts +0 -8
  340. package/build/npm/types-ts3.8/transports/offline.d.ts +0 -33
  341. package/build/npm/types-ts3.8/transports/types.d.ts +0 -6
  342. package/build/npm/types-ts3.8/userfeedback.d.ts +0 -10
  343. package/build/npm/types-ts3.8/utils/detectBrowserExtension.d.ts +0 -6
  344. package/build/npm/types-ts3.8/utils/lazyLoadIntegration.d.ts +0 -35
@@ -2,38 +2,46 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const browser = require('@sentry/core/browser');
4
4
  const helpers = require('../helpers.js');
5
+ const core = require('@sentry/core');
5
6
  const attributes = require('@sentry/conventions/attributes');
6
7
 
7
8
  const httpContextIntegration = browser.defineIntegration(() => {
8
9
  return {
9
10
  name: "HttpContext",
10
- preprocessEvent(event) {
11
+ preprocessEvent(event, _hint, client) {
11
12
  if (!helpers.WINDOW.navigator && !helpers.WINDOW.location && !helpers.WINDOW.document) {
12
13
  return;
13
14
  }
14
- const reqData = helpers.getHttpRequestData();
15
+ const { url, headers: collectedHeaders } = helpers.getHttpRequestData();
16
+ const behavior = client.getDataCollectionOptions().httpHeaders.request;
17
+ const userHeaders = Object.entries(event.request?.headers ?? {}).filter(([key]) => !(key in collectedHeaders));
15
18
  const headers = {
16
- ...reqData.headers,
17
- ...event.request?.headers
19
+ ...browser._INTERNAL_filterKeyValueData(collectedHeaders, behavior),
20
+ ...Object.fromEntries(userHeaders)
18
21
  };
19
22
  event.request = {
20
- ...reqData,
23
+ // The URL isn't gated by `dataCollection`, same as on the server.
24
+ url,
21
25
  ...event.request,
22
- headers
26
+ ...Object.keys(headers).length > 0 ? { headers } : { headers: void 0 }
23
27
  };
24
28
  },
25
- processSegmentSpan(span) {
29
+ processSegmentSpan(span, client) {
26
30
  const spanOp = span.attributes?.[browser.SEMANTIC_ATTRIBUTE_SENTRY_OP];
27
31
  if (!helpers.WINDOW.navigator && !helpers.WINDOW.location && !helpers.WINDOW.document) {
28
32
  return;
29
33
  }
30
34
  const reqData = helpers.getHttpRequestData();
35
+ const headers = browser._INTERNAL_filterKeyValueData(
36
+ reqData.headers,
37
+ client.getDataCollectionOptions().httpHeaders.request
38
+ );
31
39
  browser.safeSetSpanJSONAttributes(span, {
32
40
  // Coerce empty string to undefined so the helper's nullish check drops it,
33
41
  // rather than writing an empty `url.full` attribute onto the span.
34
- [attributes.URL_FULL]: spanOp !== "http.client" ? reqData.url : void 0,
35
- "http.request.header.user_agent": reqData.headers["User-Agent"],
36
- "http.request.header.referer": reqData.headers["Referer"]
42
+ [attributes.URL_FULL]: spanOp !== "http.client" ? core.filterCollectedUrl(reqData.url) : void 0,
43
+ "http.request.header.user_agent": headers["User-Agent"],
44
+ "http.request.header.referer": headers["Referer"]
37
45
  });
38
46
  }
39
47
  };
@@ -1 +1 @@
1
- {"version":3,"file":"httpcontext.js","sources":["../../../../../src/integrations/httpcontext.ts"],"sourcesContent":["import { defineIntegration, safeSetSpanJSONAttributes, SEMANTIC_ATTRIBUTE_SENTRY_OP } from '@sentry/core/browser';\nimport { getHttpRequestData, WINDOW } from '../helpers';\nimport { URL_FULL } from '@sentry/conventions/attributes';\n\n/**\n * Collects information about HTTP request headers and\n * attaches them to the event.\n */\nexport const httpContextIntegration = defineIntegration(() => {\n return {\n name: 'HttpContext' as const,\n preprocessEvent(event) {\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n const reqData = getHttpRequestData();\n const headers = {\n ...reqData.headers,\n ...event.request?.headers,\n };\n\n event.request = {\n ...reqData,\n ...event.request,\n headers,\n };\n },\n processSegmentSpan(span) {\n const spanOp = span.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_OP];\n\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n const reqData = getHttpRequestData();\n\n safeSetSpanJSONAttributes(span, {\n // Coerce empty string to undefined so the helper's nullish check drops it,\n // rather than writing an empty `url.full` attribute onto the span.\n [URL_FULL]: spanOp !== 'http.client' ? reqData.url : undefined,\n 'http.request.header.user_agent': reqData.headers['User-Agent'],\n 'http.request.header.referer': reqData.headers['Referer'],\n });\n },\n };\n});\n"],"names":["defineIntegration","WINDOW","getHttpRequestData","SEMANTIC_ATTRIBUTE_SENTRY_OP","safeSetSpanJSONAttributes","URL_FULL"],"mappings":";;;;;;AAQO,MAAM,sBAAA,GAAyBA,0BAAkB,MAAM;AAC5D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,aAAA;AAAA,IACN,gBAAgB,KAAA,EAAO;AAErB,MAAA,IAAI,CAACC,eAAO,SAAA,IAAa,CAACA,eAAO,QAAA,IAAY,CAACA,eAAO,QAAA,EAAU;AAC7D,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,UAAUC,0BAAA,EAAmB;AACnC,MAAA,MAAM,OAAA,GAAU;AAAA,QACd,GAAG,OAAA,CAAQ,OAAA;AAAA,QACX,GAAG,MAAM,OAAA,EAAS;AAAA,OACpB;AAEA,MAAA,KAAA,CAAM,OAAA,GAAU;AAAA,QACd,GAAG,OAAA;AAAA,QACH,GAAG,KAAA,CAAM,OAAA;AAAA,QACT;AAAA,OACF;AAAA,IACF,CAAA;AAAA,IACA,mBAAmB,IAAA,EAAM;AACvB,MAAA,MAAM,MAAA,GAAS,IAAA,CAAK,UAAA,GAAaC,oCAA4B,CAAA;AAG7D,MAAA,IAAI,CAACF,eAAO,SAAA,IAAa,CAACA,eAAO,QAAA,IAAY,CAACA,eAAO,QAAA,EAAU;AAC7D,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,UAAUC,0BAAA,EAAmB;AAEnC,MAAAE,iCAAA,CAA0B,IAAA,EAAM;AAAA;AAAA;AAAA,QAG9B,CAACC,mBAAQ,GAAG,MAAA,KAAW,aAAA,GAAgB,QAAQ,GAAA,GAAM,MAAA;AAAA,QACrD,gCAAA,EAAkC,OAAA,CAAQ,OAAA,CAAQ,YAAY,CAAA;AAAA,QAC9D,6BAAA,EAA+B,OAAA,CAAQ,OAAA,CAAQ,SAAS;AAAA,OACzD,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"httpcontext.js","sources":["../../../../../src/integrations/httpcontext.ts"],"sourcesContent":["import {\n _INTERNAL_filterKeyValueData,\n defineIntegration,\n safeSetSpanJSONAttributes,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n} from '@sentry/core/browser';\nimport { getHttpRequestData, WINDOW } from '../helpers';\nimport { filterCollectedUrl } from '@sentry/core';\nimport { URL_FULL } from '@sentry/conventions/attributes';\n\n/**\n * Collects information about HTTP request headers and\n * attaches them to the event.\n */\nexport const httpContextIntegration = defineIntegration(() => {\n return {\n name: 'HttpContext' as const,\n preprocessEvent(event, _hint, client) {\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n const { url, headers: collectedHeaders } = getHttpRequestData();\n\n // We only filter the headers we collected ourselves, so headers the user set are left alone. Going by key\n // means we also catch these headers when `browserTracingIntegration` already put them on the event.\n const behavior = client.getDataCollectionOptions().httpHeaders.request;\n const userHeaders = Object.entries(event.request?.headers ?? {}).filter(([key]) => !(key in collectedHeaders));\n\n const headers = {\n ..._INTERNAL_filterKeyValueData(collectedHeaders, behavior),\n ...Object.fromEntries(userHeaders),\n };\n\n event.request = {\n // The URL isn't gated by `dataCollection`, same as on the server.\n url,\n ...event.request,\n ...(Object.keys(headers).length > 0 ? { headers } : { headers: undefined }),\n };\n },\n processSegmentSpan(span, client) {\n const spanOp = span.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_OP];\n\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n const reqData = getHttpRequestData();\n\n // `httpHeadersToSpanAttributes` would also work here, but its cookie and array handling never runs for these\n // two headers and costs every browser bundle ~400B gzip.\n const headers = _INTERNAL_filterKeyValueData(\n reqData.headers,\n client.getDataCollectionOptions().httpHeaders.request,\n );\n\n safeSetSpanJSONAttributes(span, {\n // Coerce empty string to undefined so the helper's nullish check drops it,\n // rather than writing an empty `url.full` attribute onto the span.\n [URL_FULL]: spanOp !== 'http.client' ? filterCollectedUrl(reqData.url) : undefined,\n 'http.request.header.user_agent': headers['User-Agent'],\n 'http.request.header.referer': headers['Referer'],\n });\n },\n };\n});\n"],"names":["defineIntegration","WINDOW","getHttpRequestData","_INTERNAL_filterKeyValueData","SEMANTIC_ATTRIBUTE_SENTRY_OP","safeSetSpanJSONAttributes","URL_FULL","filterCollectedUrl"],"mappings":";;;;;;;AAcO,MAAM,sBAAA,GAAyBA,0BAAkB,MAAM;AAC5D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,aAAA;AAAA,IACN,eAAA,CAAgB,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ;AAEpC,MAAA,IAAI,CAACC,eAAO,SAAA,IAAa,CAACA,eAAO,QAAA,IAAY,CAACA,eAAO,QAAA,EAAU;AAC7D,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,EAAE,GAAA,EAAK,OAAA,EAAS,gBAAA,KAAqBC,0BAAA,EAAmB;AAI9D,MAAA,MAAM,QAAA,GAAW,MAAA,CAAO,wBAAA,EAAyB,CAAE,WAAA,CAAY,OAAA;AAC/D,MAAA,MAAM,cAAc,MAAA,CAAO,OAAA,CAAQ,KAAA,CAAM,OAAA,EAAS,WAAW,EAAE,CAAA,CAAE,MAAA,CAAO,CAAC,CAAC,GAAG,CAAA,KAAM,EAAE,OAAO,gBAAA,CAAiB,CAAA;AAE7G,MAAA,MAAM,OAAA,GAAU;AAAA,QACd,GAAGC,oCAAA,CAA6B,gBAAA,EAAkB,QAAQ,CAAA;AAAA,QAC1D,GAAG,MAAA,CAAO,WAAA,CAAY,WAAW;AAAA,OACnC;AAEA,MAAA,KAAA,CAAM,OAAA,GAAU;AAAA;AAAA,QAEd,GAAA;AAAA,QACA,GAAG,KAAA,CAAM,OAAA;AAAA,QACT,GAAI,MAAA,CAAO,IAAA,CAAK,OAAO,CAAA,CAAE,MAAA,GAAS,CAAA,GAAI,EAAE,OAAA,EAAQ,GAAI,EAAE,OAAA,EAAS,MAAA;AAAU,OAC3E;AAAA,IACF,CAAA;AAAA,IACA,kBAAA,CAAmB,MAAM,MAAA,EAAQ;AAC/B,MAAA,MAAM,MAAA,GAAS,IAAA,CAAK,UAAA,GAAaC,oCAA4B,CAAA;AAG7D,MAAA,IAAI,CAACH,eAAO,SAAA,IAAa,CAACA,eAAO,QAAA,IAAY,CAACA,eAAO,QAAA,EAAU;AAC7D,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,UAAUC,0BAAA,EAAmB;AAInC,MAAA,MAAM,OAAA,GAAUC,oCAAA;AAAA,QACd,OAAA,CAAQ,OAAA;AAAA,QACR,MAAA,CAAO,wBAAA,EAAyB,CAAE,WAAA,CAAY;AAAA,OAChD;AAEA,MAAAE,iCAAA,CAA0B,IAAA,EAAM;AAAA;AAAA;AAAA,QAG9B,CAACC,mBAAQ,GAAG,MAAA,KAAW,gBAAgBC,uBAAA,CAAmB,OAAA,CAAQ,GAAG,CAAA,GAAI,MAAA;AAAA,QACzE,gCAAA,EAAkC,QAAQ,YAAY,CAAA;AAAA,QACtD,6BAAA,EAA+B,QAAQ,SAAS;AAAA,OACjD,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAC;;;;"}
@@ -3,29 +3,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
3
  const browser = require('@sentry/core/browser');
4
4
  const debugBuild = require('../debug-build.js');
5
5
 
6
+ const INTEGRATION_NAME = "SpanStreaming";
6
7
  const spanStreamingIntegration = browser.defineIntegration(() => {
7
8
  return {
8
- name: "SpanStreaming",
9
- beforeSetup(client) {
10
- const clientOptions = client.getOptions();
11
- if (!clientOptions.traceLifecycle) {
12
- debugBuild.DEBUG_BUILD && browser.debug.log('[SpanStreaming] setting `traceLifecycle` to "stream"');
13
- clientOptions.traceLifecycle = "stream";
14
- }
15
- },
9
+ name: INTEGRATION_NAME,
16
10
  setup(client) {
17
- const initialMessage = "SpanStreaming integration requires";
18
- const fallbackMsg = "Falling back to static trace lifecycle.";
19
- const clientOptions = client.getOptions();
20
11
  if (!browser.hasSpanStreamingEnabled(client)) {
21
- clientOptions.traceLifecycle = "static";
22
- debugBuild.DEBUG_BUILD && browser.debug.warn(`${initialMessage} \`traceLifecycle\` to be set to "stream"! ${fallbackMsg}`);
23
- return;
24
- }
25
- const beforeSendSpan = clientOptions.beforeSendSpan;
26
- if (beforeSendSpan && !browser.isStreamedBeforeSendSpanCallback(beforeSendSpan)) {
27
- clientOptions.traceLifecycle = "static";
28
- debugBuild.DEBUG_BUILD && browser.debug.warn(`${initialMessage} a beforeSendSpan callback using \`withStreamedSpan\`! ${fallbackMsg}`);
12
+ debugBuild.DEBUG_BUILD && browser.debug.log(`[${INTEGRATION_NAME}] \`traceLifecycle\` is "static", skipping setup.`);
29
13
  return;
30
14
  }
31
15
  const buffer = new browser.SpanBuffer(client);
@@ -45,5 +29,6 @@ const spanStreamingIntegration = browser.defineIntegration(() => {
45
29
  };
46
30
  });
47
31
 
32
+ exports.INTEGRATION_NAME = INTEGRATION_NAME;
48
33
  exports.spanStreamingIntegration = spanStreamingIntegration;
49
34
  //# sourceMappingURL=spanstreaming.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spanstreaming.js","sources":["../../../../../src/integrations/spanstreaming.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport {\n captureSpan,\n debug,\n defineIntegration,\n hasSpanStreamingEnabled,\n isStreamedBeforeSendSpanCallback,\n SpanBuffer,\n spanIsSampled,\n} from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\n\nexport const spanStreamingIntegration = defineIntegration(() => {\n return {\n name: 'SpanStreaming' as const,\n\n beforeSetup(client) {\n // If users only set spanStreamingIntegration, without traceLifecycle, we set it to \"stream\" for them.\n // This avoids the classic double-opt-in problem we'd otherwise have in the browser SDK.\n const clientOptions = client.getOptions();\n if (!clientOptions.traceLifecycle) {\n DEBUG_BUILD && debug.log('[SpanStreaming] setting `traceLifecycle` to \"stream\"');\n clientOptions.traceLifecycle = 'stream';\n }\n },\n\n setup(client) {\n const initialMessage = 'SpanStreaming integration requires';\n const fallbackMsg = 'Falling back to static trace lifecycle.';\n const clientOptions = client.getOptions();\n\n if (!hasSpanStreamingEnabled(client)) {\n clientOptions.traceLifecycle = 'static';\n DEBUG_BUILD && debug.warn(`${initialMessage} \\`traceLifecycle\\` to be set to \"stream\"! ${fallbackMsg}`);\n return;\n }\n\n const beforeSendSpan = clientOptions.beforeSendSpan;\n // If users misconfigure their SDK by opting into span streaming but\n // using an incompatible beforeSendSpan callback, we fall back to the static trace lifecycle.\n if (beforeSendSpan && !isStreamedBeforeSendSpanCallback(beforeSendSpan)) {\n clientOptions.traceLifecycle = 'static';\n DEBUG_BUILD &&\n debug.warn(`${initialMessage} a beforeSendSpan callback using \\`withStreamedSpan\\`! ${fallbackMsg}`);\n return;\n }\n\n const buffer = new SpanBuffer(client);\n\n client.on('afterSpanEnd', span => {\n // Negatively sampled spans must not be captured.\n // This happens because OTel and we create non-recording spans for negatively sampled spans\n // that go through the same life cycle as recording spans.\n if (!spanIsSampled(span)) {\n return;\n }\n buffer.add(captureSpan(span, client));\n });\n\n // In addition to capturing the span, we also flush the trace when the segment\n // span ends to ensure things are sent timely. We never know when the browser\n // is closed, users navigate away, etc.\n client.on('afterSegmentSpanEnd', segmentSpan => {\n const traceId = segmentSpan.spanContext().traceId;\n setTimeout(() => {\n buffer.flush(traceId);\n }, 500);\n });\n },\n };\n}) satisfies IntegrationFn;\n"],"names":["defineIntegration","DEBUG_BUILD","debug","hasSpanStreamingEnabled","isStreamedBeforeSendSpanCallback","SpanBuffer","spanIsSampled","captureSpan"],"mappings":";;;;;AAYO,MAAM,wBAAA,GAA2BA,0BAAkB,MAAM;A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A,CAAY,IAAA,EAAM,MAAM,CAAC,CAAA;AAAA,MACtC,CAAC,CAAA;AAKD,MAAA,MAAA,CAAO,EAAA,CAAG,uBAAuB,CAAA,WAAA,KAAe;AAC9C,QAAA,MAAM,OAAA,GAAU,WAAA,CAAY,WAAA,EAAY,CAAE,OAAA;AAC1C,QAAA,UAAA,CAAW,MAAM;AACf,UAAA,MAAA,CAAO,MAAM,OAAO,CAAA;AAAA,QACtB,GAAG,GAAG,CAAA;AAAA,MACR,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"spanstreaming.js","sources":["../../../../../src/integrations/spanstreaming.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport {\n captureSpan,\n debug,\n defineIntegration,\n hasSpanStreamingEnabled,\n SpanBuffer,\n spanIsSampled,\n} from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\n\nexport const INTEGRATION_NAME = 'SpanStreaming' as const;\n\nexport const spanStreamingIntegration = defineIntegration(() => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n if (!hasSpanStreamingEnabled(client)) {\n DEBUG_BUILD && debug.log(`[${INTEGRATION_NAME}] \\`traceLifecycle\\` is \"static\", skipping setup.`);\n return;\n }\n\n const buffer = new SpanBuffer(client);\n\n client.on('afterSpanEnd', span => {\n // Negatively sampled spans must not be captured.\n // This happens because OTel and we create non-recording spans for negatively sampled spans\n // that go through the same life cycle as recording spans.\n if (!spanIsSampled(span)) {\n return;\n }\n buffer.add(captureSpan(span, client));\n });\n\n // In addition to capturing the span, we also flush the trace when the segment\n // span ends to ensure things are sent timely. We never know when the browser\n // is closed, users navigate away, etc.\n client.on('afterSegmentSpanEnd', segmentSpan => {\n const traceId = segmentSpan.spanContext().traceId;\n setTimeout(() => {\n buffer.flush(traceId);\n }, 500);\n });\n },\n };\n}) satisfies IntegrationFn;\n"],"names":["defineIntegration","hasSpanStreamingEnabled","DEBUG_BUILD","debug","SpanBuffer","spanIsSampled","captureSpan"],"mappings":";;;;;AAWO,MAAM,gBAAA,GAAmB;AAEzB,MAAM,wBAAA,GAA2BA,0BAAkB,MAAM;AAC9D,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,MAAM,MAAA,EAAQ;AACZ,MAAA,IAAI,CAACC,+BAAA,CAAwB,MAAM,CAAA,EAAG;AACpC,QAAAC,sBAAA,IAAeC,aAAA,CAAM,GAAA,CAAI,CAAA,CAAA,EAAI,gBAAgB,CAAA,iDAAA,CAAmD,CAAA;AAChG,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,MAAA,GAAS,IAAIC,kBAAA,CAAW,MAAM,CAAA;AAEpC,MAAA,MAAA,CAAO,EAAA,CAAG,gBAAgB,CAAA,IAAA,KAAQ;AAIhC,QAAA,IAAI,CAACC,qBAAA,CAAc,IAAI,CAAA,EAAG;AACxB,UAAA;AAAA,QACF;AACA,QAAA,MAAA,CAAO,GAAA,CAAIC,mBAAA,CAAY,IAAA,EAAM,MAAM,CAAC,CAAA;AAAA,MACtC,CAAC,CAAA;AAKD,MAAA,MAAA,CAAO,EAAA,CAAG,uBAAuB,CAAA,WAAA,KAAe;AAC9C,QAAA,MAAM,OAAA,GAAU,WAAA,CAAY,WAAA,EAAY,CAAE,OAAA;AAC1C,QAAA,UAAA,CAAW,MAAM;AACf,UAAA,MAAA,CAAO,MAAM,OAAO,CAAA;AAAA,QACtB,GAAG,GAAG,CAAA;AAAA,MACR,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF,CAAC;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"spotlight.js","sources":["../../../../../src/integrations/spotlight.ts"],"sourcesContent":["import type { Client, Envelope, IntegrationFn } from '@sentry/core/browser';\nimport { debug, defineIntegration, serializeEnvelope } from '@sentry/core/browser';\nimport { getNativeImplementation } from '@sentry/browser-utils';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { WINDOW } from '../helpers';\n\nexport type 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\nexport const INTEGRATION_NAME = 'SpotlightBrowser' as const;\n\nexport const SPOTLIGHT_IGNORE_SPANS = [{ op: 'ui.interaction.click', name: '#sentry-spotlight' }];\n\nconst _spotlightIntegration = ((options: Partial<SpotlightConnectionOptions> = {}) => {\n const sidecarUrl = options.sidecarUrl || 'http://localhost:8969/stream';\n\n return {\n name: INTEGRATION_NAME,\n setup: () => {\n DEBUG_BUILD && debug.log('Using Sidecar URL', sidecarUrl);\n },\n beforeSetup(client: Client) {\n const opts = client.getOptions();\n opts.ignoreSpans = [...(opts.ignoreSpans || []), ...SPOTLIGHT_IGNORE_SPANS];\n },\n afterAllSetup: (client: Client) => {\n setupSidecarForwarding(client, sidecarUrl);\n },\n };\n}) satisfies IntegrationFn;\n\nfunction setupSidecarForwarding(client: Client, sidecarUrl: string): void {\n const makeFetch: typeof WINDOW.fetch | undefined = getNativeImplementation('fetch');\n let failCount = 0;\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (failCount > 3) {\n debug.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:', failCount);\n return;\n }\n\n makeFetch(sidecarUrl, {\n method: 'POST',\n body: serializeEnvelope(envelope),\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n mode: 'cors',\n }).then(\n res => {\n if (res.status >= 200 && res.status < 400) {\n // Reset failed requests counter on success\n failCount = 0;\n }\n },\n err => {\n failCount++;\n debug.error(\n \"Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/\",\n err,\n );\n },\n );\n });\n}\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n */\nexport const spotlightBrowserIntegration = defineIntegration(_spotlightIntegration);\n"],"names":["DEBUG_BUILD","debug","getNativeImplementation","serializeEnvelope","defineIntegration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ACA,IAAA,EAAM;AAAA,KACP,CAAA,CAAE,IAAA;AAAA,MACD,CAAA,GAAA,KAAO;AACL,QAAA,IAAI,GAAA,CAAI,MAAA,IAAU,GAAA,IAAO,GAAA,CAAI,SAAS,GAAA,EAAK;AAEzC,UAAA,SAAA,GAAY,CAAA;AAAA,QACd;AAAA,MACF,CAAA;AAAA,MACA,CAAA,GAAA,KAAO;AACL,QAAA,SAAA,EAAA;AACA,QAAAF,aAAA,CAAM,KAAA;AAAA,UACJ,8FAAA;AAAA,UACA;AAAA,SACF;AAAA,MACF;AAAA,KACF;AAAA,EACF,CAAC,CAAA;AACH;AAOO,MAAM,2BAAA,GAA8BG,0BAAkB,qBAAqB;;;;;;"}
1
+ {"version":3,"file":"spotlight.js","sources":["../../../../../src/integrations/spotlight.ts"],"sourcesContent":["import type { Client, Envelope, IntegrationFn } from '@sentry/core/browser';\nimport { debug, defineIntegration, serializeEnvelope } from '@sentry/core/browser';\nimport { getNativeImplementation } from '@sentry/browser-utils';\nimport { DEBUG_BUILD } from '../debug-build';\nimport type { WINDOW } from '../helpers';\n\nexport type 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\nexport const INTEGRATION_NAME = 'SpotlightBrowser' as const;\n\nexport const SPOTLIGHT_IGNORE_SPANS = [{ op: 'ui.interaction.click', name: '#sentry-spotlight' }];\n\nconst _spotlightIntegration = ((options: Partial<SpotlightConnectionOptions> = {}) => {\n const sidecarUrl = options.sidecarUrl || 'http://localhost:8969/stream';\n\n return {\n name: INTEGRATION_NAME,\n setup: () => {\n DEBUG_BUILD && debug.log('Using Sidecar URL', sidecarUrl);\n },\n beforeSetup(client: Client) {\n const opts = client.getOptions();\n opts.ignoreSpans = [...(opts.ignoreSpans || []), ...SPOTLIGHT_IGNORE_SPANS];\n },\n afterAllSetup: (client: Client) => {\n setupSidecarForwarding(client, sidecarUrl);\n },\n };\n}) satisfies IntegrationFn;\n\nfunction setupSidecarForwarding(client: Client, sidecarUrl: string): void {\n const makeFetch: typeof WINDOW.fetch | undefined = getNativeImplementation('fetch');\n let failCount = 0;\n\n client.on('beforeEnvelope', (envelope: Envelope) => {\n if (failCount > 3) {\n debug.warn('[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:', failCount);\n return;\n }\n\n makeFetch(sidecarUrl, {\n method: 'POST',\n body: serializeEnvelope(envelope) as BodyInit,\n headers: {\n 'Content-Type': 'application/x-sentry-envelope',\n },\n mode: 'cors',\n }).then(\n res => {\n if (res.status >= 200 && res.status < 400) {\n // Reset failed requests counter on success\n failCount = 0;\n }\n },\n err => {\n failCount++;\n debug.error(\n \"Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/\",\n err,\n );\n },\n );\n });\n}\n\n/**\n * Use this integration to send errors and transactions to Spotlight.\n *\n * Learn more about spotlight at https://spotlightjs.com\n */\nexport const spotlightBrowserIntegration = defineIntegration(_spotlightIntegration);\n"],"names":["DEBUG_BUILD","debug","getNativeImplementation","serializeEnvelope","defineIntegration"],"mappings":";;;;;;AAcO,MAAM,gBAAA,GAAmB;AAEzB,MAAM,yBAAyB,CAAC,EAAE,IAAI,sBAAA,EAAwB,IAAA,EAAM,qBAAqB;AAEhG,MAAM,qBAAA,IAAyB,CAAC,OAAA,GAA+C,EAAC,KAAM;AACpF,EAAA,MAAM,UAAA,GAAa,QAAQ,UAAA,IAAc,8BAAA;AAEzC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,OAAO,MAAM;AACX,MAAAA,sBAAA,IAAeC,aAAA,CAAM,GAAA,CAAI,mBAAA,EAAqB,UAAU,CAAA;AAAA,IAC1D,CAAA;AAAA,IACA,YAAY,MAAA,EAAgB;AAC1B,MAAA,MAAM,IAAA,GAAO,OAAO,UAAA,EAAW;AAC/B,MAAA,IAAA,CAAK,WAAA,GAAc,CAAC,GAAI,IAAA,CAAK,eAAe,EAAC,EAAI,GAAG,sBAAsB,CAAA;AAAA,IAC5E,CAAA;AAAA,IACA,aAAA,EAAe,CAAC,MAAA,KAAmB;AACjC,MAAA,sBAAA,CAAuB,QAAQ,UAAU,CAAA;AAAA,IAC3C;AAAA,GACF;AACF,CAAA,CAAA;AAEA,SAAS,sBAAA,CAAuB,QAAgB,UAAA,EAA0B;AACxE,EAAA,MAAM,SAAA,GAA6CC,qCAAwB,OAAO,CAAA;AAClF,EAAA,IAAI,SAAA,GAAY,CAAA;AAEhB,EAAA,MAAA,CAAO,EAAA,CAAG,gBAAA,EAAkB,CAAC,QAAA,KAAuB;AAClD,IAAA,IAAI,YAAY,CAAA,EAAG;AACjB,MAAAD,aAAA,CAAM,IAAA,CAAK,yFAAyF,SAAS,CAAA;AAC7G,MAAA;AAAA,IACF;AAEA,IAAA,SAAA,CAAU,UAAA,EAAY;AAAA,MACpB,MAAA,EAAQ,MAAA;AAAA,MACR,IAAA,EAAME,0BAAkB,QAAQ,CAAA;AAAA,MAChC,OAAA,EAAS;AAAA,QACP,cAAA,EAAgB;AAAA,OAClB;AAAA,MACA,IAAA,EAAM;AAAA,KACP,CAAA,CAAE,IAAA;AAAA,MACD,CAAA,GAAA,KAAO;AACL,QAAA,IAAI,GAAA,CAAI,MAAA,IAAU,GAAA,IAAO,GAAA,CAAI,SAAS,GAAA,EAAK;AAEzC,UAAA,SAAA,GAAY,CAAA;AAAA,QACd;AAAA,MACF,CAAA;AAAA,MACA,CAAA,GAAA,KAAO;AACL,QAAA,SAAA,EAAA;AACA,QAAAF,aAAA,CAAM,KAAA;AAAA,UACJ,8FAAA;AAAA,UACA;AAAA,SACF;AAAA,MACF;AAAA,KACF;AAAA,EACF,CAAC,CAAA;AACH;AAOO,MAAM,2BAAA,GAA8BG,0BAAkB,qBAAqB;;;;;;"}
@@ -29,6 +29,7 @@ const viewHierarchyIntegration = browser.defineIntegration((options = {}) => {
29
29
  }
30
30
  const { x, y, width, height } = child.getBoundingClientRect();
31
31
  const window = {
32
+ // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- rule false positive: the cast drops `undefined` to satisfy `identifier: string`; tsc errors without it
32
33
  identifier: child.id || void 0,
33
34
  type: componentName || tagName,
34
35
  visible: true,
@@ -1 +1 @@
1
- {"version":3,"file":"view-hierarchy.js","sources":["../../../../../src/integrations/view-hierarchy.ts"],"sourcesContent":["import type { Attachment, Event, EventHint, ViewHierarchyData, ViewHierarchyWindow } from '@sentry/core/browser';\nimport { defineIntegration, getComponentName } from '@sentry/core/browser';\nimport { WINDOW } from '../helpers';\n\ninterface OnElementArgs {\n /**\n * The element being processed.\n */\n element: HTMLElement;\n /**\n * Lowercase tag name of the element.\n */\n tagName: string;\n /**\n * The component name of the element.\n */\n componentName?: string;\n\n /**\n * The current depth of the element in the view hierarchy. The root element will have a depth of 0.\n *\n * This allows you to limit the traversal depth for large DOM trees.\n */\n depth?: number;\n}\n\ninterface Options {\n /**\n * Whether to attach the view hierarchy to the event.\n *\n * Default: Always attach.\n */\n shouldAttach?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * A function that returns the root element to start walking the DOM from.\n *\n * Default: `window.document.body`\n */\n rootElement?: () => HTMLElement | undefined;\n\n /**\n * Called for each HTMLElement as we walk the DOM.\n *\n * Return an object to include the element with any additional properties.\n * Return `skip` to exclude the element and its children.\n * Return `children` to skip the element but include its children.\n */\n onElement?: (prop: OnElementArgs) => Record<string, string | number | boolean> | 'skip' | 'children';\n}\n\n/**\n * An integration to include a view hierarchy attachment which contains the DOM.\n */\nexport const viewHierarchyIntegration = defineIntegration((options: Options = {}) => {\n const skipHtmlTags = ['script'];\n\n /** Walk an element */\n function walk(element: HTMLElement, windows: ViewHierarchyWindow[], depth = 0): void {\n if (!element) {\n return;\n }\n\n // With Web Components, we need to walk into shadow DOMs\n const children = 'shadowRoot' in element && element.shadowRoot ? element.shadowRoot.children : element.children;\n\n for (const child of children) {\n if (!(child instanceof HTMLElement)) {\n continue;\n }\n\n const componentName = getComponentName(child, 1) || undefined;\n const tagName = child.tagName.toLowerCase();\n\n if (skipHtmlTags.includes(tagName)) {\n continue;\n }\n\n const result = options.onElement?.({ element: child, componentName, tagName, depth }) || {};\n\n if (result === 'skip') {\n continue;\n }\n\n // Skip this element but include its children\n if (result === 'children') {\n walk(child, windows, depth + 1);\n continue;\n }\n\n const { x, y, width, height } = child.getBoundingClientRect();\n\n const window: ViewHierarchyWindow = {\n identifier: (child.id || undefined) as string,\n type: componentName || tagName,\n visible: true,\n alpha: 1,\n height,\n width,\n x,\n y,\n ...result,\n };\n\n const children: ViewHierarchyWindow[] = [];\n window.children = children;\n\n // Recursively walk the children\n walk(child, window.children, depth + 1);\n\n windows.push(window);\n }\n }\n\n return {\n name: 'ViewHierarchy' as const,\n processEvent: (event, hint) => {\n // only capture for error events\n if (event.type !== undefined || options.shouldAttach?.(event, hint) === false) {\n return event;\n }\n\n const root: ViewHierarchyData = {\n rendering_system: 'DOM',\n positioning: 'absolute',\n windows: [],\n };\n\n walk(options.rootElement?.() || WINDOW.document.body, root.windows);\n\n const attachment: Attachment = {\n filename: 'view-hierarchy.json',\n attachmentType: 'event.view_hierarchy',\n contentType: 'application/json',\n data: JSON.stringify(root),\n };\n\n hint.attachments = hint.attachments || [];\n hint.attachments.push(attachment);\n\n return event;\n },\n };\n});\n"],"names":["defineIntegration","getComponentName","children","WINDOW"],"mappings":";;;;;AAsDO,MAAM,wBAAA,GAA2BA,yBAAA,CAAkB,CAAC,OAAA,GAAmB,EAAC,KAAM;AACnF,EAAA,MAAM,YAAA,GAAe,CAAC,QAAQ,CAAA;AAG9B,EAAA,SAAS,IAAA,CAAK,OAAA,EAAsB,OAAA,EAAgC,KAAA,GAAQ,CAAA,EAAS;AACnF,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA;AAAA,IACF;AAGA,IAAA,MAAM,QAAA,GAAW,gBAAgB,OAAA,IAAW,OAAA,CAAQ,aAAa,OAAA,CAAQ,UAAA,CAAW,WAAW,OAAA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EtC,MAAA,OAAA,CAAQ,KAAK,MAAM,CAAA;AAAA,IACrB;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,eAAA;AAAA,IACN,YAAA,EAAc,CAAC,KAAA,EAAO,IAAA,KAAS;AAE7B,MAAA,IAAI,KAAA,CAAM,SAAS,MAAA,IAAa,OAAA,CAAQ,eAAe,KAAA,EAAO,IAAI,MAAM,KAAA,EAAO;AAC7E,QAAA,OAAO,KAAA;AAAA,MACT;AAEA,MAAA,MAAM,IAAA,GAA0B;AAAA,QAC9B,gBAAA,EAAkB,KAAA;AAAA,QAClB,WAAA,EAAa,UAAA;AAAA,QACb,SAAS;AAAC,OACZ;AAEA,MAAA,IAAA,CAAK,QAAQ,WAAA,IAAc,IAAKC,eAAO,QAAA,CAAS,IAAA,EAAM,KAAK,OAAO,CAAA;AAElE,MAAA,MAAM,UAAA,GAAyB;AAAA,QAC7B,QAAA,EAAU,qBAAA;AAAA,QACV,cAAA,EAAgB,sBAAA;AAAA,QAChB,WAAA,EAAa,kBAAA;AAAA,QACb,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,IAAI;AAAA,OAC3B;AAEA,MAAA,IAAA,CAAK,WAAA,GAAc,IAAA,CAAK,WAAA,IAAe,EAAC;AACxC,MAAA,IAAA,CAAK,WAAA,CAAY,KAAK,UAAU,CAAA;AAEhC,MAAA,OAAO,KAAA;AAAA,IACT;AAAA,GACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"view-hierarchy.js","sources":["../../../../../src/integrations/view-hierarchy.ts"],"sourcesContent":["import type { Attachment, Event, EventHint, ViewHierarchyData, ViewHierarchyWindow } from '@sentry/core/browser';\nimport { defineIntegration, getComponentName } from '@sentry/core/browser';\nimport { WINDOW } from '../helpers';\n\ninterface OnElementArgs {\n /**\n * The element being processed.\n */\n element: HTMLElement;\n /**\n * Lowercase tag name of the element.\n */\n tagName: string;\n /**\n * The component name of the element.\n */\n componentName?: string;\n\n /**\n * The current depth of the element in the view hierarchy. The root element will have a depth of 0.\n *\n * This allows you to limit the traversal depth for large DOM trees.\n */\n depth?: number;\n}\n\ninterface Options {\n /**\n * Whether to attach the view hierarchy to the event.\n *\n * Default: Always attach.\n */\n shouldAttach?: (event: Event, hint: EventHint) => boolean;\n\n /**\n * A function that returns the root element to start walking the DOM from.\n *\n * Default: `window.document.body`\n */\n rootElement?: () => HTMLElement | undefined;\n\n /**\n * Called for each HTMLElement as we walk the DOM.\n *\n * Return an object to include the element with any additional properties.\n * Return `skip` to exclude the element and its children.\n * Return `children` to skip the element but include its children.\n */\n onElement?: (prop: OnElementArgs) => Record<string, string | number | boolean> | 'skip' | 'children';\n}\n\n/**\n * An integration to include a view hierarchy attachment which contains the DOM.\n */\nexport const viewHierarchyIntegration = defineIntegration((options: Options = {}) => {\n const skipHtmlTags = ['script'];\n\n /** Walk an element */\n function walk(element: HTMLElement, windows: ViewHierarchyWindow[], depth = 0): void {\n if (!element) {\n return;\n }\n\n // With Web Components, we need to walk into shadow DOMs\n const children = 'shadowRoot' in element && element.shadowRoot ? element.shadowRoot.children : element.children;\n\n for (const child of children) {\n if (!(child instanceof HTMLElement)) {\n continue;\n }\n\n const componentName = getComponentName(child, 1) || undefined;\n const tagName = child.tagName.toLowerCase();\n\n if (skipHtmlTags.includes(tagName)) {\n continue;\n }\n\n const result = options.onElement?.({ element: child, componentName, tagName, depth }) || {};\n\n if (result === 'skip') {\n continue;\n }\n\n // Skip this element but include its children\n if (result === 'children') {\n walk(child, windows, depth + 1);\n continue;\n }\n\n const { x, y, width, height } = child.getBoundingClientRect();\n\n const window: ViewHierarchyWindow = {\n // oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- rule false positive: the cast drops `undefined` to satisfy `identifier: string`; tsc errors without it\n identifier: (child.id || undefined) as string,\n type: componentName || tagName,\n visible: true,\n alpha: 1,\n height,\n width,\n x,\n y,\n ...result,\n };\n\n const children: ViewHierarchyWindow[] = [];\n window.children = children;\n\n // Recursively walk the children\n walk(child, window.children, depth + 1);\n\n windows.push(window);\n }\n }\n\n return {\n name: 'ViewHierarchy' as const,\n processEvent: (event, hint) => {\n // only capture for error events\n if (event.type !== undefined || options.shouldAttach?.(event, hint) === false) {\n return event;\n }\n\n const root: ViewHierarchyData = {\n rendering_system: 'DOM',\n positioning: 'absolute',\n windows: [],\n };\n\n walk(options.rootElement?.() || WINDOW.document.body, root.windows);\n\n const attachment: Attachment = {\n filename: 'view-hierarchy.json',\n attachmentType: 'event.view_hierarchy',\n contentType: 'application/json',\n data: JSON.stringify(root),\n };\n\n hint.attachments = hint.attachments || [];\n hint.attachments.push(attachment);\n\n return event;\n },\n };\n});\n"],"names":["defineIntegration","getComponentName","children","WINDOW"],"mappings":";;;;;AAsDO,MAAM,wBAAA,GAA2BA,yBAAA,CAAkB,CAAC,OAAA,GAAmB,EAAC,KAAM;AACnF,EAAA,MAAM,YAAA,GAAe,CAAC,QAAQ,CAAA;AAG9B,EAAA,SAAS,IAAA,CAAK,OAAA,EAAsB,OAAA,EAAgC,KAAA,GAAQ,CAAA,EAAS;AACnF,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA;AAAA,IACF;AAGA,IAAA,MAAM,QAAA,GAAW,gBAAgB,OAAA,IAAW,OAAA,CAAQ,aAAa,OAAA,CAAQ,UAAA,CAAW,WAAW,OAAA,CAAQ,QAAA;AAEvG,IAAA,KAAA,MAAW,SAAS,QAAA,EAAU;AAC5B,MAAA,IAAI,EAAE,iBAAiB,WAAA,CAAA,EAAc;AACnC,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,aAAA,GAAgBC,wBAAA,CAAiB,KAAA,EAAO,CAAC,CAAA,IAAK,MAAA;AACpD,MAAA,MAAM,OAAA,GAAU,KAAA,CAAM,OAAA,CAAQ,WAAA,EAAY;AAE1C,MAAA,IAAI,YAAA,CAAa,QAAA,CAAS,OAAO,CAAA,EAAG;AAClC,QAAA;AAAA,MACF;AAEA,MAAA,MAAM,MAAA,GAAS,OAAA,CAAQ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AA,QACb,SAAS;AAAC,OACZ;AAEA,MAAA,IAAA,CAAK,QAAQ,WAAA,IAAc,IAAKC,eAAO,QAAA,CAAS,IAAA,EAAM,KAAK,OAAO,CAAA;AAElE,MAAA,MAAM,UAAA,GAAyB;AAAA,QAC7B,QAAA,EAAU,qBAAA;AAAA,QACV,cAAA,EAAgB,sBAAA;AAAA,QAChB,WAAA,EAAa,kBAAA;AAAA,QACb,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,IAAI;AAAA,OAC3B;AAEA,MAAA,IAAA,CAAK,WAAA,GAAc,IAAA,CAAK,WAAA,IAAe,EAAC;AACxC,MAAA,IAAA,CAAK,WAAA,CAAY,KAAK,UAAU,CAAA;AAEhC,MAAA,OAAO,KAAA;AAAA,IACT;AAAA,GACF;AACF,CAAC;;;;"}
@@ -10,12 +10,11 @@ const webVitalsIntegration = browser.defineIntegration((options = {}) => {
10
10
  name: WEB_VITALS_INTEGRATION_NAME,
11
11
  setup(client) {
12
12
  const spanStreamingEnabled = browser.hasSpanStreamingEnabled(client);
13
- const { enableStandaloneClsSpans, enableStandaloneLcpSpans } = options._experiments ?? {};
14
- const recordClsStandaloneSpans = spanStreamingEnabled || ignored.has("cls") ? void 0 : enableStandaloneClsSpans || false;
15
- const recordLcpStandaloneSpans = spanStreamingEnabled || ignored.has("lcp") ? void 0 : enableStandaloneLcpSpans || false;
13
+ const trackClsOnPageloadSpan = !spanStreamingEnabled && !ignored.has("cls");
14
+ const trackLcpOnPageloadSpan = !spanStreamingEnabled && !ignored.has("lcp");
16
15
  const finalizeWebVitals = browserUtils.startTrackingWebVitals({
17
- recordClsStandaloneSpans,
18
- recordLcpStandaloneSpans,
16
+ trackCls: trackClsOnPageloadSpan,
17
+ trackLcp: trackLcpOnPageloadSpan,
19
18
  client
20
19
  });
21
20
  const pageloadSpans = /* @__PURE__ */ new WeakSet();
@@ -28,10 +27,8 @@ const webVitalsIntegration = browser.defineIntegration((options = {}) => {
28
27
  }
29
28
  finalizeWebVitals();
30
29
  browserUtils.addWebVitalsToSpan(span, {
31
- // CLS/LCP are recorded as pageload span measurements only when they're neither
32
- // tracked as standalone spans nor handled by span streaming (and not ignored).
33
- recordClsOnPageloadSpan: recordClsStandaloneSpans === false,
34
- recordLcpOnPageloadSpan: recordLcpStandaloneSpans === false,
30
+ recordClsOnPageloadSpan: trackClsOnPageloadSpan,
31
+ recordLcpOnPageloadSpan: trackLcpOnPageloadSpan,
35
32
  spanStreamingEnabled
36
33
  });
37
34
  });
@@ -42,11 +39,9 @@ const webVitalsIntegration = browser.defineIntegration((options = {}) => {
42
39
  if (!ignored.has("cls")) {
43
40
  browserUtils.trackClsAsSpan(client);
44
41
  }
45
- if (!ignored.has("inp")) {
46
- browserUtils.trackInpAsSpan();
47
- }
48
- } else if (!ignored.has("inp")) {
49
- browserUtils.startTrackingINP();
42
+ }
43
+ if (!ignored.has("inp")) {
44
+ browserUtils.trackInpAsSpan(client);
50
45
  }
51
46
  },
52
47
  afterAllSetup() {
@@ -1 +1 @@
1
- {"version":3,"file":"webVitals.js","sources":["../../../../../src/integrations/webVitals.ts"],"sourcesContent":["import type { IntegrationFn, Span } from '@sentry/core/browser';\nimport { defineIntegration, hasSpanStreamingEnabled } from '@sentry/core/browser';\nimport {\n addWebVitalsToSpan,\n registerInpInteractionListener,\n startTrackingINP,\n startTrackingWebVitals,\n trackClsAsSpan,\n trackInpAsSpan,\n trackLcpAsSpan,\n} from '@sentry/browser-utils';\n\nexport const WEB_VITALS_INTEGRATION_NAME = 'WebVitals' as const;\n\nexport type WebVitalName = 'cls' | 'inp' | 'lcp';\n\nexport interface WebVitalsOptions {\n /**\n * Web vitals to skip.\n */\n ignore?: WebVitalName[];\n\n /**\n * @experimental\n */\n _experiments?: Partial<{\n enableStandaloneClsSpans: boolean;\n enableStandaloneLcpSpans: boolean;\n }>;\n}\n\n/**\n * Captures Core Web Vitals (LCP, CLS, INP) and related pageload vitals.\n *\n * `browserTracingIntegration` auto-registers this integration if no\n * `webVitalsIntegration` is already present, so explicit registration is only\n * needed to customize options or to use it without `browserTracingIntegration`.\n */\nexport const webVitalsIntegration = defineIntegration((options: WebVitalsOptions = {}) => {\n const ignored = new Set(options.ignore ?? []);\n\n return {\n name: WEB_VITALS_INTEGRATION_NAME,\n setup(client) {\n const spanStreamingEnabled = hasSpanStreamingEnabled(client);\n const { enableStandaloneClsSpans, enableStandaloneLcpSpans } = options._experiments ?? {};\n\n const recordClsStandaloneSpans =\n spanStreamingEnabled || ignored.has('cls') ? undefined : enableStandaloneClsSpans || false;\n const recordLcpStandaloneSpans =\n spanStreamingEnabled || ignored.has('lcp') ? undefined : enableStandaloneLcpSpans || false;\n\n // eslint-disable-next-line typescript/no-deprecated\n const finalizeWebVitals = startTrackingWebVitals({\n recordClsStandaloneSpans,\n recordLcpStandaloneSpans,\n client,\n });\n\n const pageloadSpans = new WeakSet<Span>();\n\n client.on('afterStartPageLoadSpan', span => {\n pageloadSpans.add(span);\n });\n\n client.on('spanEnd', span => {\n if (!pageloadSpans.delete(span)) {\n return;\n }\n\n finalizeWebVitals();\n addWebVitalsToSpan(span, {\n // CLS/LCP are recorded as pageload span measurements only when they're neither\n // tracked as standalone spans nor handled by span streaming (and not ignored).\n recordClsOnPageloadSpan: recordClsStandaloneSpans === false,\n recordLcpOnPageloadSpan: recordLcpStandaloneSpans === false,\n spanStreamingEnabled,\n });\n });\n\n if (spanStreamingEnabled) {\n if (!ignored.has('lcp')) {\n trackLcpAsSpan(client);\n }\n if (!ignored.has('cls')) {\n trackClsAsSpan(client);\n }\n if (!ignored.has('inp')) {\n trackInpAsSpan();\n }\n } else if (!ignored.has('inp')) {\n startTrackingINP();\n }\n },\n afterAllSetup() {\n if (!ignored.has('inp')) {\n registerInpInteractionListener();\n }\n },\n };\n}) satisfies IntegrationFn;\n"],"names":["defineIntegration","hasSpanStreamingEnabled","startTrackingWebVitals","addWebVitalsToSpan","trackLcpAsSpan","trackClsAsSpan","trackInpAsSpan","startTrackingINP","registerInpInteractionListener"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AAAA,SACD,CAAA;AAAA,MACH,CAAC,CAAA;AAED,MAAA,IAAI,oBAAA,EAAsB;AACxB,QAAA,IAAI,CAAC,OAAA,CAAQ,GAAA,CAAI,KAAK,CAAA,EAAG;AACvB,UAAAC,2BAAA,CAAe,MAAM,CAAA;AAAA,QACvB;AACA,QAAA,IAAI,CAAC,OAAA,CAAQ,GAAA,CAAI,KAAK,CAAA,EAAG;AACvB,UAAAC,2BAAA,CAAe,MAAM,CAAA;AAAA,QACvB;AACA,QAAA,IAAI,CAAC,OAAA,CAAQ,GAAA,CAAI,KAAK,CAAA,EAAG;AACvB,UAAAC,2BAAA,EAAe;AAAA,QACjB;AAAA,MACF,CAAA,MAAA,IAAW,CAAC,OAAA,CAAQ,GAAA,CAAI,KAAK,CAAA,EAAG;AAC9B,QAAAC,6BAAA,EAAiB;AAAA,MACnB;AAAA,IACF,CAAA;AAAA,IACA,aAAA,GAAgB;AACd,MAAA,IAAI,CAAC,OAAA,CAAQ,GAAA,CAAI,KAAK,CAAA,EAAG;AACvB,QAAAC,2CAAA,EAA+B;AAAA,MACjC;AAAA,IACF;AAAA,GACF;AACF,CAAC;;;;;"}
1
+ {"version":3,"file":"webVitals.js","sources":["../../../../../src/integrations/webVitals.ts"],"sourcesContent":["import type { IntegrationFn, Span } from '@sentry/core/browser';\nimport { defineIntegration, hasSpanStreamingEnabled } from '@sentry/core/browser';\nimport {\n addWebVitalsToSpan,\n registerInpInteractionListener,\n startTrackingWebVitals,\n trackClsAsSpan,\n trackInpAsSpan,\n trackLcpAsSpan,\n} from '@sentry/browser-utils';\n\nexport const WEB_VITALS_INTEGRATION_NAME = 'WebVitals' as const;\n\nexport type WebVitalName = 'cls' | 'inp' | 'lcp';\n\nexport interface WebVitalsOptions {\n /**\n * Web vitals to skip.\n */\n ignore?: WebVitalName[];\n}\n\n/**\n * Captures Core Web Vitals (LCP, CLS, INP) and related pageload vitals.\n *\n * `browserTracingIntegration` auto-registers this integration if no\n * `webVitalsIntegration` is already present, so explicit registration is only\n * needed to customize options or to use it without `browserTracingIntegration`.\n */\nexport const webVitalsIntegration = defineIntegration((options: WebVitalsOptions = {}) => {\n const ignored = new Set(options.ignore ?? []);\n\n return {\n name: WEB_VITALS_INTEGRATION_NAME,\n setup(client) {\n const spanStreamingEnabled = hasSpanStreamingEnabled(client);\n\n // With span streaming enabled, CLS and LCP are tracked as standalone v2 spans (like INP).\n // Otherwise, they're recorded as measurements on the pageload span.\n const trackClsOnPageloadSpan = !spanStreamingEnabled && !ignored.has('cls');\n const trackLcpOnPageloadSpan = !spanStreamingEnabled && !ignored.has('lcp');\n\n const finalizeWebVitals = startTrackingWebVitals({\n trackCls: trackClsOnPageloadSpan,\n trackLcp: trackLcpOnPageloadSpan,\n client,\n });\n\n const pageloadSpans = new WeakSet<Span>();\n\n client.on('afterStartPageLoadSpan', span => {\n pageloadSpans.add(span);\n });\n\n client.on('spanEnd', span => {\n if (!pageloadSpans.delete(span)) {\n return;\n }\n\n finalizeWebVitals();\n addWebVitalsToSpan(span, {\n recordClsOnPageloadSpan: trackClsOnPageloadSpan,\n recordLcpOnPageloadSpan: trackLcpOnPageloadSpan,\n spanStreamingEnabled,\n });\n });\n\n if (spanStreamingEnabled) {\n if (!ignored.has('lcp')) {\n trackLcpAsSpan(client);\n }\n if (!ignored.has('cls')) {\n trackClsAsSpan(client);\n }\n }\n\n // INP is always sent as a streamed web vital span. When span streaming is disabled, INP still\n // streams (it overrides the static trace lifecycle for INP only), see `trackInpAsSpan`.\n if (!ignored.has('inp')) {\n trackInpAsSpan(client);\n }\n },\n afterAllSetup() {\n if (!ignored.has('inp')) {\n registerInpInteractionListener();\n }\n },\n };\n}) satisfies IntegrationFn;\n"],"names":["defineIntegration","hasSpanStreamingEnabled","startTrackingWebVitals","addWebVitalsToSpan","trackLcpAsSpan","trackClsAsSpan","trackInpAsSpan","registerInpInteractionListener"],"mappings":";;;;;AAWO,MAAM,2BAAA,GAA8B;AAkBpC,MAAM,oBAAA,GAAuBA,yBA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AAI,CAAC,OAAA,CAAQ,GAAA,CAAI,KAAK,CAAA,EAAG;AACvB,UAAAC,2BAAA,CAAe,MAAM,CAAA;AAAA,QACvB;AAAA,MACF;AAIA,MAAA,IAAI,CAAC,OAAA,CAAQ,GAAA,CAAI,KAAK,CAAA,EAAG;AACvB,QAAAC,2BAAA,CAAe,MAAM,CAAA;AAAA,MACvB;AAAA,IACF,CAAA;AAAA,IACA,aAAA,GAAgB;AACd,MAAA,IAAI,CAAC,OAAA,CAAQ,GAAA,CAAI,KAAK,CAAA,EAAG;AACvB,QAAAC,2CAAA,EAA+B;AAAA,MACjC;AAAA,IACF;AAAA,GACF;AACF,CAAC;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/profiling/index.ts"],"sourcesContent":["import type { Profiler } from '@sentry/core/browser';\nimport { debug, getClient } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\n\n/**\n * Starts the Sentry UI profiler.\n * This mode is exclusive with the transaction profiler and will only work if the profilesSampleRate is set to a falsy value.\n * In UI profiling mode, the profiler will keep reporting profile chunks to Sentry until it is stopped, which allows for continuous profiling of the application.\n */\nfunction startProfiler(): void {\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && debug.warn('No Sentry client available, profiling is not started');\n return;\n }\n\n const integration = client.getIntegrationByName('BrowserProfiling');\n\n if (!integration) {\n DEBUG_BUILD && debug.warn('BrowserProfiling integration is not available');\n return;\n }\n\n client.emit('startUIProfiler');\n}\n\n/**\n * Stops the Sentry UI profiler.\n * Calls to stop will stop the profiler and flush the currently collected profile data to Sentry.\n */\nfunction stopProfiler(): void {\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && debug.warn('No Sentry client available, profiling is not started');\n return;\n }\n\n const integration = client.getIntegrationByName('BrowserProfiling');\n if (!integration) {\n DEBUG_BUILD && debug.warn('ProfilingIntegration is not available');\n return;\n }\n\n client.emit('stopUIProfiler');\n}\n\n/**\n * Profiler namespace for controlling the JS profiler in 'manual' mode.\n *\n * Requires the `browserProfilingIntegration` from the `@sentry/browser` package.\n */\nexport const uiProfiler: Profiler = {\n startProfiler,\n stopProfiler,\n};\n"],"names":["getClient","DEBUG_BUILD","debug"],"mappings":";;;;;AASA,SAAS,aAAA,GAAsB;AAC7B,EAAA,MAAM,SAASA,iBAAA,EAAU;AACzB,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAAC,sBAAA,IAAeC,aAAA,CAAM,KAAK,sDAAsD,CAAA;AAChF,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,WAAA,GAAc,MAAA,CAAO,oBAAA,CAAqB,kBAAkB,CAAA;AAElE,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAAD,sBAAA,IAAeC,aAAA,CAAM,KAAK,+CAA+C,CAAA;AACzE,IAAA;AAAA,EACF;AAEA,EAAA,MAAA,CAAO,KAAK,iBAAiB,CAAA;AAC/B;AAMA,SAAS,YAAA,GAAqB;AAC5B,EAAA,MAAM,SAASF,iBAAA,EAAU;AACzB,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAAC,sBAAA,IAAeC,aAAA,CAAM,KAAK,sDAAsD,CAAA;AAChF,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,WAAA,GAAc,MAAA,CAAO,oBAAA,CAAqB,kBAAkB,CAAA;AAClE,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAAD,sBAAA,IAAeC,aAAA,CAAM,KAAK,uCAAuC,CAAA;AACjE,IAAA;AAAA,EACF;AAEA,EAAA,MAAA,CAAO,KAAK,gBAAgB,CAAA;AAC9B;AAOO,MAAM,UAAA,GAAuB;AAAA,EAClC,aAAA;AAAA,EACA;AACF;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/profiling/index.ts"],"sourcesContent":["import type { Profiler } from '@sentry/core/browser';\nimport { debug, getClient } from '@sentry/core/browser';\nimport { DEBUG_BUILD } from '../debug-build';\n\n/**\n * Starts a manually controlled Sentry UI profiling session.\n *\n * Profiling starts only when the integration sampled the current session and `profileLifecycle` is `manual`.\n * While running, the profiler periodically sends profile chunks to Sentry until `stopProfiler()` is called.\n */\nfunction startProfiler(): void {\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && debug.warn('No Sentry client available, profiling is not started');\n return;\n }\n\n const integration = client.getIntegrationByName('BrowserProfiling');\n\n if (!integration) {\n DEBUG_BUILD && debug.warn('BrowserProfiling integration is not available');\n return;\n }\n\n client.emit('startUIProfiler');\n}\n\n/**\n * Stops a manually controlled Sentry UI profiling session.\n *\n * Calls to stop will stop the profiler and flush the currently collected profile data to Sentry.\n */\nfunction stopProfiler(): void {\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && debug.warn('No Sentry client available, profiling is not started');\n return;\n }\n\n const integration = client.getIntegrationByName('BrowserProfiling');\n if (!integration) {\n DEBUG_BUILD && debug.warn('ProfilingIntegration is not available');\n return;\n }\n\n client.emit('stopUIProfiler');\n}\n\n/**\n * Profiler namespace for controlling the JS profiler in 'manual' mode.\n *\n * Requires the `browserProfilingIntegration` from the `@sentry/browser` package.\n */\nexport const uiProfiler: Profiler = {\n startProfiler,\n stopProfiler,\n};\n"],"names":["getClient","DEBUG_BUILD","debug"],"mappings":";;;;;AAUA,SAAS,aAAA,GAAsB;AAC7B,EAAA,MAAM,SAASA,iBAAA,EAAU;AACzB,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAAC,sBAAA,IAAeC,aAAA,CAAM,KAAK,sDAAsD,CAAA;AAChF,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,WAAA,GAAc,MAAA,CAAO,oBAAA,CAAqB,kBAAkB,CAAA;AAElE,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAAD,sBAAA,IAAeC,aAAA,CAAM,KAAK,+CAA+C,CAAA;AACzE,IAAA;AAAA,EACF;AAEA,EAAA,MAAA,CAAO,KAAK,iBAAiB,CAAA;AAC/B;AAOA,SAAS,YAAA,GAAqB;AAC5B,EAAA,MAAM,SAASF,iBAAA,EAAU;AACzB,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAAC,sBAAA,IAAeC,aAAA,CAAM,KAAK,sDAAsD,CAAA;AAChF,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,WAAA,GAAc,MAAA,CAAO,oBAAA,CAAqB,kBAAkB,CAAA;AAClE,EAAA,IAAI,CAAC,WAAA,EAAa;AAChB,IAAAD,sBAAA,IAAeC,aAAA,CAAM,KAAK,uCAAuC,CAAA;AACjE,IAAA;AAAA,EACF;AAEA,EAAA,MAAA,CAAO,KAAK,gBAAgB,CAAA;AAC9B;AAOO,MAAM,UAAA,GAAuB;AAAA,EAClC,aAAA;AAAA,EACA;AACF;;;;"}
@@ -3,9 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
3
3
  const browser = require('@sentry/core/browser');
4
4
  const debugBuild = require('../debug-build.js');
5
5
  const helpers = require('../helpers.js');
6
- const startProfileForSpan = require('./startProfileForSpan.js');
7
6
  const UIProfiler = require('./UIProfiler.js');
8
- const utils = require('./utils.js');
9
7
 
10
8
  const INTEGRATION_NAME = "BrowserProfiling";
11
9
  const _browserProfilingIntegration = (() => {
@@ -14,102 +12,34 @@ const _browserProfilingIntegration = (() => {
14
12
  setup(client) {
15
13
  const options = client.getOptions();
16
14
  const profiler = new UIProfiler.UIProfiler();
17
- if (!utils.hasLegacyProfiling(options) && !options.profileLifecycle) {
15
+ if (!options.profileLifecycle) {
18
16
  options.profileLifecycle = "manual";
19
17
  }
20
- if (utils.hasLegacyProfiling(options) && !options.profilesSampleRate) {
21
- debugBuild.DEBUG_BUILD && browser.debug.log("[Profiling] Profiling disabled, no profiling options found.");
22
- return;
23
- }
24
18
  const activeSpan = browser.getActiveSpan();
25
19
  const rootSpan = activeSpan && browser.getRootSpan(activeSpan);
26
- if (utils.hasLegacyProfiling(options) && options.profileSessionSampleRate !== void 0) {
27
- debugBuild.DEBUG_BUILD && browser.debug.warn(
28
- "[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."
29
- );
30
- }
31
- if (!utils.hasLegacyProfiling(options)) {
32
- const lifecycleMode = options.profileLifecycle;
33
- client.on("startUIProfiler", () => profiler.start());
34
- client.on("stopUIProfiler", () => profiler.stop());
35
- if (lifecycleMode === "manual") {
36
- profiler.initialize(client);
37
- } else if (lifecycleMode === "trace") {
38
- if (!browser.hasSpansEnabled(options)) {
39
- debugBuild.DEBUG_BUILD && browser.debug.warn(
40
- "[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing."
41
- );
42
- return;
43
- }
44
- profiler.initialize(client);
45
- if (rootSpan) {
46
- profiler.notifyRootSpanActive(rootSpan);
47
- }
48
- helpers.WINDOW.setTimeout(() => {
49
- const laterActiveSpan = browser.getActiveSpan();
50
- const laterRootSpan = laterActiveSpan && browser.getRootSpan(laterActiveSpan);
51
- if (laterRootSpan) {
52
- profiler.notifyRootSpanActive(laterRootSpan);
53
- }
54
- }, 0);
20
+ const lifecycleMode = options.profileLifecycle;
21
+ client.on("startUIProfiler", () => profiler.start());
22
+ client.on("stopUIProfiler", () => profiler.stop());
23
+ if (lifecycleMode === "manual") {
24
+ profiler.initialize(client);
25
+ } else if (lifecycleMode === "trace") {
26
+ if (!browser.hasSpansEnabled(options)) {
27
+ debugBuild.DEBUG_BUILD && browser.debug.warn(
28
+ "[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing."
29
+ );
30
+ return;
55
31
  }
56
- } else {
57
- if (rootSpan && utils.isAutomatedPageLoadSpan(rootSpan)) {
58
- if (utils.shouldProfileSpanLegacy(rootSpan)) {
59
- startProfileForSpan.startProfileForSpan(rootSpan);
60
- }
32
+ profiler.initialize(client);
33
+ if (rootSpan) {
34
+ profiler.notifyRootSpanActive(rootSpan);
61
35
  }
62
- client.on("spanStart", (span) => {
63
- const rootSpan2 = browser.getRootSpan(span);
64
- if (span === rootSpan2) {
65
- if (utils.shouldProfileSpanLegacy(span)) {
66
- startProfileForSpan.startProfileForSpan(span);
67
- }
68
- } else if (utils.PROFILED_ROOT_SPANS.has(rootSpan2)) {
69
- utils.setThreadAttributes(span);
70
- }
71
- });
72
- client.on("beforeEnvelope", (envelope) => {
73
- if (!utils.getActiveProfilesCount()) {
74
- return;
75
- }
76
- const profiledTransactionEvents = utils.findProfiledTransactionsFromEnvelope(envelope);
77
- if (!profiledTransactionEvents.length) {
78
- return;
79
- }
80
- const profilesToAddToEnvelope = [];
81
- for (const profiledTransaction of profiledTransactionEvents) {
82
- const context = profiledTransaction?.contexts;
83
- const profile_id = context?.profile?.["profile_id"];
84
- const start_timestamp = context?.profile?.["start_timestamp"];
85
- if (typeof profile_id !== "string") {
86
- debugBuild.DEBUG_BUILD && browser.debug.log("[Profiling] cannot find profile for a span without a profile context");
87
- continue;
88
- }
89
- if (!profile_id) {
90
- debugBuild.DEBUG_BUILD && browser.debug.log("[Profiling] cannot find profile for a span without a profile context");
91
- continue;
92
- }
93
- if (context?.profile) {
94
- delete context.profile;
95
- }
96
- const profile = utils.takeProfileFromGlobalCache(profile_id);
97
- if (!profile) {
98
- debugBuild.DEBUG_BUILD && browser.debug.log(`[Profiling] Could not retrieve profile for span: ${profile_id}`);
99
- continue;
100
- }
101
- const profileEvent = utils.createProfilingEvent(
102
- profile_id,
103
- start_timestamp,
104
- profile,
105
- profiledTransaction
106
- );
107
- if (profileEvent) {
108
- profilesToAddToEnvelope.push(profileEvent);
109
- }
36
+ helpers.WINDOW.setTimeout(() => {
37
+ const laterActiveSpan = browser.getActiveSpan();
38
+ const laterRootSpan = laterActiveSpan && browser.getRootSpan(laterActiveSpan);
39
+ if (laterRootSpan) {
40
+ profiler.notifyRootSpanActive(laterRootSpan);
110
41
  }
111
- utils.addProfilesToEnvelope(envelope, profilesToAddToEnvelope);
112
- });
42
+ }, 0);
113
43
  }
114
44
  }
115
45
  };
@@ -1 +1 @@
1
- {"version":3,"file":"integration.js","sources":["../../../../../src/profiling/integration.ts"],"sourcesContent":["import type { EventEnvelope, IntegrationFn, Profile, Span } from '@sentry/core/browser';\nimport { debug, defineIntegration, getActiveSpan, getRootSpan, hasSpansEnabled } from '@sentry/core/browser';\nimport type { BrowserOptions } from '../client';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\nimport { startProfileForSpan } from './startProfileForSpan';\nimport { UIProfiler } from './UIProfiler';\nimport type { ProfiledEvent } from './utils';\nimport {\n addProfilesToEnvelope,\n createProfilingEvent,\n findProfiledTransactionsFromEnvelope,\n getActiveProfilesCount,\n hasLegacyProfiling,\n isAutomatedPageLoadSpan,\n PROFILED_ROOT_SPANS,\n setThreadAttributes,\n shouldProfileSpanLegacy,\n takeProfileFromGlobalCache,\n} from './utils';\n\nconst INTEGRATION_NAME = 'BrowserProfiling' as const;\n\nconst _browserProfilingIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n const options = client.getOptions() as BrowserOptions;\n const profiler = new UIProfiler();\n\n if (!hasLegacyProfiling(options) && !options.profileLifecycle) {\n // Set default lifecycle mode\n options.profileLifecycle = 'manual';\n }\n\n // eslint-disable-next-line typescript/no-deprecated\n if (hasLegacyProfiling(options) && !options.profilesSampleRate) {\n DEBUG_BUILD && debug.log('[Profiling] Profiling disabled, no profiling options found.');\n return;\n }\n\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan && getRootSpan(activeSpan);\n\n if (hasLegacyProfiling(options) && options.profileSessionSampleRate !== undefined) {\n DEBUG_BUILD &&\n debug.warn(\n '[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled.',\n );\n }\n\n // UI PROFILING (Profiling V2)\n if (!hasLegacyProfiling(options)) {\n const lifecycleMode = options.profileLifecycle;\n\n // Registering hooks in all lifecycle modes to be able to notify users in case they want to start/stop the profiler manually in `trace` mode\n client.on('startUIProfiler', () => profiler.start());\n client.on('stopUIProfiler', () => profiler.stop());\n\n if (lifecycleMode === 'manual') {\n profiler.initialize(client);\n } else if (lifecycleMode === 'trace') {\n if (!hasSpansEnabled(options)) {\n DEBUG_BUILD &&\n debug.warn(\n \"[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.\",\n );\n return;\n }\n\n profiler.initialize(client);\n\n // If there is an active, sampled root span already, notify the profiler\n if (rootSpan) {\n profiler.notifyRootSpanActive(rootSpan);\n }\n\n // In case rootSpan is created slightly after setup -> schedule microtask to re-check and notify.\n WINDOW.setTimeout(() => {\n const laterActiveSpan = getActiveSpan();\n const laterRootSpan = laterActiveSpan && getRootSpan(laterActiveSpan);\n if (laterRootSpan) {\n profiler.notifyRootSpanActive(laterRootSpan);\n }\n }, 0);\n }\n } else {\n // LEGACY PROFILING (v1)\n if (rootSpan && isAutomatedPageLoadSpan(rootSpan)) {\n if (shouldProfileSpanLegacy(rootSpan)) {\n startProfileForSpan(rootSpan);\n }\n }\n\n client.on('spanStart', (span: Span) => {\n const rootSpan = getRootSpan(span);\n if (span === rootSpan) {\n if (shouldProfileSpanLegacy(span)) {\n startProfileForSpan(span);\n }\n } else if (PROFILED_ROOT_SPANS.has(rootSpan)) {\n setThreadAttributes(span);\n }\n });\n\n client.on('beforeEnvelope', (envelope): void => {\n // if not profiles are in queue, there is nothing to add to the envelope.\n if (!getActiveProfilesCount()) {\n return;\n }\n\n const profiledTransactionEvents = findProfiledTransactionsFromEnvelope(envelope);\n if (!profiledTransactionEvents.length) {\n return;\n }\n\n const profilesToAddToEnvelope: Profile[] = [];\n\n for (const profiledTransaction of profiledTransactionEvents) {\n const context = profiledTransaction?.contexts;\n const profile_id = context?.profile?.['profile_id'];\n const start_timestamp = context?.profile?.['start_timestamp'];\n\n if (typeof profile_id !== 'string') {\n DEBUG_BUILD && debug.log('[Profiling] cannot find profile for a span without a profile context');\n continue;\n }\n\n if (!profile_id) {\n DEBUG_BUILD && debug.log('[Profiling] cannot find profile for a span without a profile context');\n continue;\n }\n\n // Remove the profile from the span context before sending, relay will take care of the rest.\n if (context?.profile) {\n delete context.profile;\n }\n\n const profile = takeProfileFromGlobalCache(profile_id);\n if (!profile) {\n DEBUG_BUILD && debug.log(`[Profiling] Could not retrieve profile for span: ${profile_id}`);\n continue;\n }\n\n const profileEvent = createProfilingEvent(\n profile_id,\n start_timestamp as number | undefined,\n profile,\n profiledTransaction as ProfiledEvent,\n );\n if (profileEvent) {\n profilesToAddToEnvelope.push(profileEvent);\n }\n }\n\n addProfilesToEnvelope(envelope as EventEnvelope, profilesToAddToEnvelope);\n });\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const browserProfilingIntegration = defineIntegration(_browserProfilingIntegration);\n"],"names":["UIProfiler","hasLegacyProfiling","DEBUG_BUILD","debug","getActiveSpan","getRootSpan","hasSpansEnabled","WINDOW","isAutomatedPageLoadSpan","shouldProfileSpanLegacy","startProfileForSpan","rootSpan","PROFILED_ROOT_SPANS","setThreadAttributes","getActiveProfilesCount","findProfiledTransactionsFromEnvelope","takeProfileFromGlobalCache","createProfilingEvent","addProfilesToEnvelope","defineIntegration"],"mappings":";;;;;;;;;AAqBA,MAAM,gBAAA,GAAmB,kBAAA;AAEzB,MAAM,gCAAgC,MAAM;AAC1C,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,MAAM,MAAA,EAAQ;AACZ,MAAA,MAAM,OAAA,GAAU,OAAO,UAAA,EAAW;AAClC,MAAA,MAAM,QAAA,GAAW,IAAIA,qBAAA,EAAW;AAEhC,MAAA,IAAI,CAACC,wBAAA,CAAmB,OAAO,CAAA,IAAK,CAAC,QAAQ,gBAAA,EAAkB;AAE7D,QAAA,OAAA,CAAQ,gBAAA,GAAmB,QAAA;AAAA,MAC7B;AAGA,MAAA,IAAIA,wBAAA,CAAmB,OAAO,CAAA,IAAK,CAAC,QAAQ,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AA;AAE5D,YAAA,IAAI,OAAO,eAAe,QAAA,EAAU;AAClC,cAAAb,sBAAA,IAAeC,aAAA,CAAM,IAAI,sEAAsE,CAAA;AAC/F,cAAA;AAAA,YACF;AAEA,YAAA,IAAI,CAAC,UAAA,EAAY;AACf,cAAAD,sBAAA,IAAeC,aAAA,CAAM,IAAI,sEAAsE,CAAA;AAC/F,cAAA;AAAA,YACF;AAGA,YAAA,IAAI,SAAS,OAAA,EAAS;AACpB,cAAA,OAAO,OAAA,CAAQ,OAAA;AAAA,YACjB;AAEA,YAAA,MAAM,OAAA,GAAUa,iCAA2B,UAAU,CAAA;AACrD,YAAA,IAAI,CAAC,OAAA,EAAS;AACZ,cAAAd,sBAAA,IAAeC,aAAA,CAAM,GAAA,CAAI,CAAA,iDAAA,EAAoD,UAAU,CAAA,CAAE,CAAA;AACzF,cAAA;AAAA,YACF;AAEA,YAAA,MAAM,YAAA,GAAec,0BAAA;AAAA,cACnB,UAAA;AAAA,cACA,eAAA;AAAA,cACA,OAAA;AAAA,cACA;AAAA,aACF;AACA,YAAA,IAAI,YAAA,EAAc;AAChB,cAAA,uBAAA,CAAwB,KAAK,YAAY,CAAA;AAAA,YAC3C;AAAA,UACF;AAEA,UAAAC,2BAAA,CAAsB,UAA2B,uBAAuB,CAAA;AAAA,QAC1E,CAAC,CAAA;AAAA,MACH;AAAA,IACF;AAAA,GACF;AACF,CAAA,CAAA;AAEO,MAAM,2BAAA,GAA8BC,0BAAkB,4BAA4B;;;;"}
1
+ {"version":3,"file":"integration.js","sources":["../../../../../src/profiling/integration.ts"],"sourcesContent":["import type { IntegrationFn } from '@sentry/core/browser';\nimport { debug, defineIntegration, getActiveSpan, getRootSpan, hasSpansEnabled } from '@sentry/core/browser';\nimport type { BrowserOptions } from '../client';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { WINDOW } from '../helpers';\nimport { UIProfiler } from './UIProfiler';\n\nconst INTEGRATION_NAME = 'BrowserProfiling' as const;\n\nconst _browserProfilingIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n const options = client.getOptions() as BrowserOptions;\n const profiler = new UIProfiler();\n\n if (!options.profileLifecycle) {\n // Set default lifecycle mode\n options.profileLifecycle = 'manual';\n }\n\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan && getRootSpan(activeSpan);\n const lifecycleMode = options.profileLifecycle;\n\n // Registering hooks in all lifecycle modes to be able to notify users in case they want to start/stop the profiler manually in `trace` mode\n client.on('startUIProfiler', () => profiler.start());\n client.on('stopUIProfiler', () => profiler.stop());\n\n if (lifecycleMode === 'manual') {\n profiler.initialize(client);\n } else if (lifecycleMode === 'trace') {\n if (!hasSpansEnabled(options)) {\n DEBUG_BUILD &&\n debug.warn(\n \"[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.\",\n );\n return;\n }\n\n profiler.initialize(client);\n\n // If there is an active, sampled root span already, notify the profiler\n if (rootSpan) {\n profiler.notifyRootSpanActive(rootSpan);\n }\n\n // In case rootSpan is created slightly after setup -> schedule microtask to re-check and notify.\n WINDOW.setTimeout(() => {\n const laterActiveSpan = getActiveSpan();\n const laterRootSpan = laterActiveSpan && getRootSpan(laterActiveSpan);\n if (laterRootSpan) {\n profiler.notifyRootSpanActive(laterRootSpan);\n }\n }, 0);\n }\n },\n };\n}) satisfies IntegrationFn;\n\nexport const browserProfilingIntegration = defineIntegration(_browserProfilingIntegration);\n"],"names":["UIProfiler","getActiveSpan","getRootSpan","hasSpansEnabled","DEBUG_BUILD","debug","WINDOW","defineIntegration"],"mappings":";;;;;;;AAOA,MAAM,gBAAA,GAAmB,kBAAA;AAEzB,MAAM,gCAAgC,MAAM;AAC1C,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,MAAM,MAAA,EAAQ;AACZ,MAAA,MAAM,OAAA,GAAU,OAAO,UAAA,EAAW;AAClC,MAAA,MAAM,QAAA,GAAW,IAAIA,qBAAA,EA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