@sentry/browser 10.24.0 → 10.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/build/npm/cjs/dev/client.js.map +1 -0
  2. package/build/npm/cjs/dev/debug-build.js.map +1 -0
  3. package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -0
  4. package/build/npm/cjs/dev/eventbuilder.js.map +1 -0
  5. package/build/npm/cjs/dev/feedbackAsync.js.map +1 -0
  6. package/build/npm/cjs/dev/feedbackSync.js.map +1 -0
  7. package/build/npm/cjs/dev/helpers.js.map +1 -0
  8. package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -0
  9. package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -0
  10. package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -0
  11. package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -0
  12. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
  13. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  14. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
  15. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
  16. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
  17. package/build/npm/cjs/{integrations → dev/integrations}/globalhandlers.js +1 -1
  18. package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -0
  19. package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -0
  20. package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -0
  21. package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -0
  22. package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -0
  23. package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -0
  24. package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -0
  25. package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -0
  26. package/build/npm/cjs/{profiling/lifecycleMode/traceLifecycleProfiler.js → dev/profiling/UIProfiler.js} +73 -75
  27. package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -0
  28. package/build/npm/cjs/{profiling → dev/profiling}/integration.js +5 -5
  29. package/build/npm/cjs/dev/profiling/integration.js.map +1 -0
  30. package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -0
  31. package/build/npm/cjs/dev/profiling/utils.js.map +1 -0
  32. package/build/npm/cjs/dev/report-dialog.js.map +1 -0
  33. package/build/npm/cjs/dev/sdk.js +133 -0
  34. package/build/npm/cjs/dev/sdk.js.map +1 -0
  35. package/build/npm/cjs/dev/stack-parsers.js.map +1 -0
  36. package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -0
  37. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -0
  38. package/build/npm/cjs/{tracing → dev/tracing}/linkedTraces.js +1 -0
  39. package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -0
  40. package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -0
  41. package/build/npm/cjs/dev/tracing/request.js.map +1 -0
  42. package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -0
  43. package/build/npm/cjs/dev/tracing/utils.js.map +1 -0
  44. package/build/npm/cjs/dev/transports/fetch.js.map +1 -0
  45. package/build/npm/cjs/dev/transports/offline.js.map +1 -0
  46. package/build/npm/cjs/dev/userfeedback.js.map +1 -0
  47. package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -0
  48. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -0
  49. package/build/npm/cjs/prod/client.js +125 -0
  50. package/build/npm/cjs/prod/client.js.map +1 -0
  51. package/build/npm/cjs/prod/debug-build.js +11 -0
  52. package/build/npm/cjs/prod/debug-build.js.map +1 -0
  53. package/build/npm/cjs/prod/diagnose-sdk.js +51 -0
  54. package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -0
  55. package/build/npm/cjs/prod/eventbuilder.js +397 -0
  56. package/build/npm/cjs/prod/eventbuilder.js.map +1 -0
  57. package/build/npm/cjs/prod/feedbackAsync.js +15 -0
  58. package/build/npm/cjs/prod/feedbackAsync.js.map +1 -0
  59. package/build/npm/cjs/prod/feedbackSync.js +12 -0
  60. package/build/npm/cjs/prod/feedbackSync.js.map +1 -0
  61. package/build/npm/cjs/prod/helpers.js +185 -0
  62. package/build/npm/cjs/prod/helpers.js.map +1 -0
  63. package/build/npm/cjs/prod/index.js +179 -0
  64. package/build/npm/cjs/prod/index.js.map +1 -0
  65. package/build/npm/cjs/prod/integrations/breadcrumbs.js +341 -0
  66. package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -0
  67. package/build/npm/cjs/prod/integrations/browserapierrors.js +259 -0
  68. package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -0
  69. package/build/npm/cjs/prod/integrations/browsersession.js +44 -0
  70. package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -0
  71. package/build/npm/cjs/prod/integrations/contextlines.js +89 -0
  72. package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -0
  73. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +29 -0
  74. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
  75. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +55 -0
  76. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  77. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +38 -0
  78. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
  79. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +48 -0
  80. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
  81. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +74 -0
  82. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
  83. package/build/npm/cjs/prod/integrations/globalhandlers.js +210 -0
  84. package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -0
  85. package/build/npm/cjs/prod/integrations/graphqlClient.js +180 -0
  86. package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -0
  87. package/build/npm/cjs/prod/integrations/httpclient.js +395 -0
  88. package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -0
  89. package/build/npm/cjs/prod/integrations/httpcontext.js +35 -0
  90. package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -0
  91. package/build/npm/cjs/prod/integrations/linkederrors.js +39 -0
  92. package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -0
  93. package/build/npm/cjs/prod/integrations/reportingobserver.js +85 -0
  94. package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -0
  95. package/build/npm/cjs/prod/integrations/spotlight.js +85 -0
  96. package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -0
  97. package/build/npm/cjs/prod/integrations/webWorker.js +251 -0
  98. package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -0
  99. package/build/npm/cjs/prod/profiling/UIProfiler.js +341 -0
  100. package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -0
  101. package/build/npm/cjs/prod/profiling/integration.js +150 -0
  102. package/build/npm/cjs/prod/profiling/integration.js.map +1 -0
  103. package/build/npm/cjs/prod/profiling/startProfileForSpan.js +144 -0
  104. package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -0
  105. package/build/npm/cjs/prod/profiling/utils.js +786 -0
  106. package/build/npm/cjs/prod/profiling/utils.js.map +1 -0
  107. package/build/npm/cjs/prod/report-dialog.js +68 -0
  108. package/build/npm/cjs/prod/report-dialog.js.map +1 -0
  109. package/build/npm/cjs/{sdk.js → prod/sdk.js} +5 -2
  110. package/build/npm/cjs/prod/sdk.js.map +1 -0
  111. package/build/npm/cjs/prod/stack-parsers.js +202 -0
  112. package/build/npm/cjs/prod/stack-parsers.js.map +1 -0
  113. package/build/npm/cjs/prod/tracing/backgroundtab.js +46 -0
  114. package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -0
  115. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +577 -0
  116. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -0
  117. package/build/npm/cjs/prod/tracing/linkedTraces.js +227 -0
  118. package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -0
  119. package/build/npm/cjs/prod/tracing/reportPageLoaded.js +18 -0
  120. package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -0
  121. package/build/npm/cjs/prod/tracing/request.js +342 -0
  122. package/build/npm/cjs/prod/tracing/request.js.map +1 -0
  123. package/build/npm/cjs/prod/tracing/setActiveSpan.js +68 -0
  124. package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -0
  125. package/build/npm/cjs/prod/tracing/utils.js +54 -0
  126. package/build/npm/cjs/prod/tracing/utils.js.map +1 -0
  127. package/build/npm/cjs/prod/transports/fetch.js +71 -0
  128. package/build/npm/cjs/prod/transports/fetch.js.map +1 -0
  129. package/build/npm/cjs/prod/transports/offline.js +168 -0
  130. package/build/npm/cjs/prod/transports/offline.js.map +1 -0
  131. package/build/npm/cjs/prod/userfeedback.js +42 -0
  132. package/build/npm/cjs/prod/userfeedback.js.map +1 -0
  133. package/build/npm/cjs/prod/utils/detectBrowserExtension.js +59 -0
  134. package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -0
  135. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +106 -0
  136. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -0
  137. package/build/npm/esm/dev/client.js.map +1 -0
  138. package/build/npm/esm/dev/debug-build.js.map +1 -0
  139. package/build/npm/esm/dev/diagnose-sdk.js.map +1 -0
  140. package/build/npm/esm/dev/eventbuilder.js.map +1 -0
  141. package/build/npm/esm/dev/feedbackAsync.js.map +1 -0
  142. package/build/npm/esm/dev/feedbackSync.js.map +1 -0
  143. package/build/npm/esm/dev/helpers.js.map +1 -0
  144. package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -0
  145. package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -0
  146. package/build/npm/esm/dev/integrations/browsersession.js.map +1 -0
  147. package/build/npm/esm/dev/integrations/contextlines.js.map +1 -0
  148. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -0
  149. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  150. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -0
  151. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -0
  152. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -0
  153. package/build/npm/esm/{integrations → dev/integrations}/globalhandlers.js +1 -1
  154. package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -0
  155. package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -0
  156. package/build/npm/esm/dev/integrations/httpclient.js.map +1 -0
  157. package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -0
  158. package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -0
  159. package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -0
  160. package/build/npm/esm/dev/integrations/spotlight.js.map +1 -0
  161. package/build/npm/esm/dev/integrations/webWorker.js.map +1 -0
  162. package/build/npm/esm/dev/package.json +1 -0
  163. package/build/npm/esm/{profiling/lifecycleMode/traceLifecycleProfiler.js → dev/profiling/UIProfiler.js} +74 -76
  164. package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -0
  165. package/build/npm/esm/{profiling → dev/profiling}/integration.js +2 -2
  166. package/build/npm/esm/dev/profiling/integration.js.map +1 -0
  167. package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -0
  168. package/build/npm/esm/dev/profiling/utils.js.map +1 -0
  169. package/build/npm/esm/dev/report-dialog.js.map +1 -0
  170. package/build/npm/esm/dev/sdk.js +128 -0
  171. package/build/npm/esm/dev/sdk.js.map +1 -0
  172. package/build/npm/esm/dev/stack-parsers.js.map +1 -0
  173. package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -0
  174. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -0
  175. package/build/npm/esm/{tracing → dev/tracing}/linkedTraces.js +1 -0
  176. package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -0
  177. package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -0
  178. package/build/npm/esm/dev/tracing/request.js.map +1 -0
  179. package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -0
  180. package/build/npm/esm/dev/tracing/utils.js.map +1 -0
  181. package/build/npm/esm/dev/transports/fetch.js.map +1 -0
  182. package/build/npm/esm/dev/transports/offline.js.map +1 -0
  183. package/build/npm/esm/dev/userfeedback.js.map +1 -0
  184. package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -0
  185. package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -0
  186. package/build/npm/esm/prod/client.js +122 -0
  187. package/build/npm/esm/prod/client.js.map +1 -0
  188. package/build/npm/esm/prod/debug-build.js +9 -0
  189. package/build/npm/esm/prod/debug-build.js.map +1 -0
  190. package/build/npm/esm/prod/diagnose-sdk.js +49 -0
  191. package/build/npm/esm/prod/diagnose-sdk.js.map +1 -0
  192. package/build/npm/esm/prod/eventbuilder.js +390 -0
  193. package/build/npm/esm/prod/eventbuilder.js.map +1 -0
  194. package/build/npm/esm/prod/feedbackAsync.js +13 -0
  195. package/build/npm/esm/prod/feedbackAsync.js.map +1 -0
  196. package/build/npm/esm/prod/feedbackSync.js +10 -0
  197. package/build/npm/esm/prod/feedbackSync.js.map +1 -0
  198. package/build/npm/esm/prod/helpers.js +179 -0
  199. package/build/npm/esm/prod/helpers.js.map +1 -0
  200. package/build/npm/esm/prod/index.js +40 -0
  201. package/build/npm/esm/prod/index.js.map +1 -0
  202. package/build/npm/esm/prod/integrations/breadcrumbs.js +339 -0
  203. package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -0
  204. package/build/npm/esm/prod/integrations/browserapierrors.js +257 -0
  205. package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -0
  206. package/build/npm/esm/prod/integrations/browsersession.js +42 -0
  207. package/build/npm/esm/prod/integrations/browsersession.js.map +1 -0
  208. package/build/npm/esm/prod/integrations/contextlines.js +86 -0
  209. package/build/npm/esm/prod/integrations/contextlines.js.map +1 -0
  210. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +27 -0
  211. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -0
  212. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +52 -0
  213. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
  214. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +35 -0
  215. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -0
  216. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +46 -0
  217. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -0
  218. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +72 -0
  219. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -0
  220. package/build/npm/esm/prod/integrations/globalhandlers.js +206 -0
  221. package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -0
  222. package/build/npm/esm/prod/integrations/graphqlClient.js +175 -0
  223. package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -0
  224. package/build/npm/esm/prod/integrations/httpclient.js +393 -0
  225. package/build/npm/esm/prod/integrations/httpclient.js.map +1 -0
  226. package/build/npm/esm/prod/integrations/httpcontext.js +33 -0
  227. package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -0
  228. package/build/npm/esm/prod/integrations/linkederrors.js +37 -0
  229. package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -0
  230. package/build/npm/esm/prod/integrations/reportingobserver.js +83 -0
  231. package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -0
  232. package/build/npm/esm/prod/integrations/spotlight.js +81 -0
  233. package/build/npm/esm/prod/integrations/spotlight.js.map +1 -0
  234. package/build/npm/esm/prod/integrations/webWorker.js +247 -0
  235. package/build/npm/esm/prod/integrations/webWorker.js.map +1 -0
  236. package/build/npm/esm/prod/package.json +1 -0
  237. package/build/npm/esm/prod/profiling/UIProfiler.js +339 -0
  238. package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -0
  239. package/build/npm/esm/prod/profiling/integration.js +148 -0
  240. package/build/npm/esm/prod/profiling/integration.js.map +1 -0
  241. package/build/npm/esm/prod/profiling/startProfileForSpan.js +142 -0
  242. package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -0
  243. package/build/npm/esm/prod/profiling/utils.js +763 -0
  244. package/build/npm/esm/prod/profiling/utils.js.map +1 -0
  245. package/build/npm/esm/prod/report-dialog.js +66 -0
  246. package/build/npm/esm/prod/report-dialog.js.map +1 -0
  247. package/build/npm/esm/{sdk.js → prod/sdk.js} +5 -2
  248. package/build/npm/esm/prod/sdk.js.map +1 -0
  249. package/build/npm/esm/prod/stack-parsers.js +194 -0
  250. package/build/npm/esm/prod/stack-parsers.js.map +1 -0
  251. package/build/npm/esm/prod/tracing/backgroundtab.js +44 -0
  252. package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -0
  253. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +571 -0
  254. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -0
  255. package/build/npm/esm/prod/tracing/linkedTraces.js +218 -0
  256. package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -0
  257. package/build/npm/esm/prod/tracing/reportPageLoaded.js +16 -0
  258. package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -0
  259. package/build/npm/esm/prod/tracing/request.js +338 -0
  260. package/build/npm/esm/prod/tracing/request.js.map +1 -0
  261. package/build/npm/esm/prod/tracing/setActiveSpan.js +66 -0
  262. package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -0
  263. package/build/npm/esm/prod/tracing/utils.js +49 -0
  264. package/build/npm/esm/prod/tracing/utils.js.map +1 -0
  265. package/build/npm/esm/prod/transports/fetch.js +69 -0
  266. package/build/npm/esm/prod/transports/fetch.js.map +1 -0
  267. package/build/npm/esm/prod/transports/offline.js +162 -0
  268. package/build/npm/esm/prod/transports/offline.js.map +1 -0
  269. package/build/npm/esm/prod/userfeedback.js +40 -0
  270. package/build/npm/esm/prod/userfeedback.js.map +1 -0
  271. package/build/npm/esm/prod/utils/detectBrowserExtension.js +57 -0
  272. package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -0
  273. package/build/npm/esm/prod/utils/lazyLoadIntegration.js +104 -0
  274. package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -0
  275. package/build/npm/types/client.d.ts +11 -0
  276. package/build/npm/types/client.d.ts.map +1 -1
  277. package/build/npm/types/profiling/{lifecycleMode/traceLifecycleProfiler.d.ts → UIProfiler.d.ts} +6 -2
  278. package/build/npm/types/profiling/UIProfiler.d.ts.map +1 -0
  279. package/build/npm/types/sdk.d.ts.map +1 -1
  280. package/build/npm/types-ts3.8/client.d.ts +11 -0
  281. package/build/npm/types-ts3.8/profiling/{lifecycleMode/traceLifecycleProfiler.d.ts → UIProfiler.d.ts} +6 -2
  282. package/package.json +21 -16
  283. package/build/npm/cjs/client.js.map +0 -1
  284. package/build/npm/cjs/debug-build.js.map +0 -1
  285. package/build/npm/cjs/diagnose-sdk.js.map +0 -1
  286. package/build/npm/cjs/eventbuilder.js.map +0 -1
  287. package/build/npm/cjs/feedbackAsync.js.map +0 -1
  288. package/build/npm/cjs/feedbackSync.js.map +0 -1
  289. package/build/npm/cjs/helpers.js.map +0 -1
  290. package/build/npm/cjs/integrations/breadcrumbs.js.map +0 -1
  291. package/build/npm/cjs/integrations/browserapierrors.js.map +0 -1
  292. package/build/npm/cjs/integrations/browsersession.js.map +0 -1
  293. package/build/npm/cjs/integrations/contextlines.js.map +0 -1
  294. package/build/npm/cjs/integrations/featureFlags/growthbook/integration.js.map +0 -1
  295. package/build/npm/cjs/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
  296. package/build/npm/cjs/integrations/featureFlags/openfeature/integration.js.map +0 -1
  297. package/build/npm/cjs/integrations/featureFlags/statsig/integration.js.map +0 -1
  298. package/build/npm/cjs/integrations/featureFlags/unleash/integration.js.map +0 -1
  299. package/build/npm/cjs/integrations/globalhandlers.js.map +0 -1
  300. package/build/npm/cjs/integrations/graphqlClient.js.map +0 -1
  301. package/build/npm/cjs/integrations/httpclient.js.map +0 -1
  302. package/build/npm/cjs/integrations/httpcontext.js.map +0 -1
  303. package/build/npm/cjs/integrations/linkederrors.js.map +0 -1
  304. package/build/npm/cjs/integrations/reportingobserver.js.map +0 -1
  305. package/build/npm/cjs/integrations/spotlight.js.map +0 -1
  306. package/build/npm/cjs/integrations/webWorker.js.map +0 -1
  307. package/build/npm/cjs/profiling/integration.js.map +0 -1
  308. package/build/npm/cjs/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
  309. package/build/npm/cjs/profiling/startProfileForSpan.js.map +0 -1
  310. package/build/npm/cjs/profiling/utils.js.map +0 -1
  311. package/build/npm/cjs/report-dialog.js.map +0 -1
  312. package/build/npm/cjs/sdk.js.map +0 -1
  313. package/build/npm/cjs/stack-parsers.js.map +0 -1
  314. package/build/npm/cjs/tracing/backgroundtab.js.map +0 -1
  315. package/build/npm/cjs/tracing/browserTracingIntegration.js.map +0 -1
  316. package/build/npm/cjs/tracing/linkedTraces.js.map +0 -1
  317. package/build/npm/cjs/tracing/reportPageLoaded.js.map +0 -1
  318. package/build/npm/cjs/tracing/request.js.map +0 -1
  319. package/build/npm/cjs/tracing/setActiveSpan.js.map +0 -1
  320. package/build/npm/cjs/tracing/utils.js.map +0 -1
  321. package/build/npm/cjs/transports/fetch.js.map +0 -1
  322. package/build/npm/cjs/transports/offline.js.map +0 -1
  323. package/build/npm/cjs/userfeedback.js.map +0 -1
  324. package/build/npm/cjs/utils/detectBrowserExtension.js.map +0 -1
  325. package/build/npm/cjs/utils/lazyLoadIntegration.js.map +0 -1
  326. package/build/npm/esm/client.js.map +0 -1
  327. package/build/npm/esm/debug-build.js.map +0 -1
  328. package/build/npm/esm/diagnose-sdk.js.map +0 -1
  329. package/build/npm/esm/eventbuilder.js.map +0 -1
  330. package/build/npm/esm/feedbackAsync.js.map +0 -1
  331. package/build/npm/esm/feedbackSync.js.map +0 -1
  332. package/build/npm/esm/helpers.js.map +0 -1
  333. package/build/npm/esm/integrations/breadcrumbs.js.map +0 -1
  334. package/build/npm/esm/integrations/browserapierrors.js.map +0 -1
  335. package/build/npm/esm/integrations/browsersession.js.map +0 -1
  336. package/build/npm/esm/integrations/contextlines.js.map +0 -1
  337. package/build/npm/esm/integrations/featureFlags/growthbook/integration.js.map +0 -1
  338. package/build/npm/esm/integrations/featureFlags/launchdarkly/integration.js.map +0 -1
  339. package/build/npm/esm/integrations/featureFlags/openfeature/integration.js.map +0 -1
  340. package/build/npm/esm/integrations/featureFlags/statsig/integration.js.map +0 -1
  341. package/build/npm/esm/integrations/featureFlags/unleash/integration.js.map +0 -1
  342. package/build/npm/esm/integrations/globalhandlers.js.map +0 -1
  343. package/build/npm/esm/integrations/graphqlClient.js.map +0 -1
  344. package/build/npm/esm/integrations/httpclient.js.map +0 -1
  345. package/build/npm/esm/integrations/httpcontext.js.map +0 -1
  346. package/build/npm/esm/integrations/linkederrors.js.map +0 -1
  347. package/build/npm/esm/integrations/reportingobserver.js.map +0 -1
  348. package/build/npm/esm/integrations/spotlight.js.map +0 -1
  349. package/build/npm/esm/integrations/webWorker.js.map +0 -1
  350. package/build/npm/esm/package.json +0 -1
  351. package/build/npm/esm/profiling/integration.js.map +0 -1
  352. package/build/npm/esm/profiling/lifecycleMode/traceLifecycleProfiler.js.map +0 -1
  353. package/build/npm/esm/profiling/startProfileForSpan.js.map +0 -1
  354. package/build/npm/esm/profiling/utils.js.map +0 -1
  355. package/build/npm/esm/report-dialog.js.map +0 -1
  356. package/build/npm/esm/sdk.js.map +0 -1
  357. package/build/npm/esm/stack-parsers.js.map +0 -1
  358. package/build/npm/esm/tracing/backgroundtab.js.map +0 -1
  359. package/build/npm/esm/tracing/browserTracingIntegration.js.map +0 -1
  360. package/build/npm/esm/tracing/linkedTraces.js.map +0 -1
  361. package/build/npm/esm/tracing/reportPageLoaded.js.map +0 -1
  362. package/build/npm/esm/tracing/request.js.map +0 -1
  363. package/build/npm/esm/tracing/setActiveSpan.js.map +0 -1
  364. package/build/npm/esm/tracing/utils.js.map +0 -1
  365. package/build/npm/esm/transports/fetch.js.map +0 -1
  366. package/build/npm/esm/transports/offline.js.map +0 -1
  367. package/build/npm/esm/userfeedback.js.map +0 -1
  368. package/build/npm/esm/utils/detectBrowserExtension.js.map +0 -1
  369. package/build/npm/esm/utils/lazyLoadIntegration.js.map +0 -1
  370. package/build/npm/types/profiling/lifecycleMode/traceLifecycleProfiler.d.ts.map +0 -1
  371. /package/build/npm/cjs/{client.js → dev/client.js} +0 -0
  372. /package/build/npm/cjs/{debug-build.js → dev/debug-build.js} +0 -0
  373. /package/build/npm/cjs/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
  374. /package/build/npm/cjs/{eventbuilder.js → dev/eventbuilder.js} +0 -0
  375. /package/build/npm/cjs/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
  376. /package/build/npm/cjs/{feedbackSync.js → dev/feedbackSync.js} +0 -0
  377. /package/build/npm/cjs/{helpers.js → dev/helpers.js} +0 -0
  378. /package/build/npm/cjs/{index.js → dev/index.js} +0 -0
  379. /package/build/npm/cjs/{index.js.map → dev/index.js.map} +0 -0
  380. /package/build/npm/cjs/{integrations → dev/integrations}/breadcrumbs.js +0 -0
  381. /package/build/npm/cjs/{integrations → dev/integrations}/browserapierrors.js +0 -0
  382. /package/build/npm/cjs/{integrations → dev/integrations}/browsersession.js +0 -0
  383. /package/build/npm/cjs/{integrations → dev/integrations}/contextlines.js +0 -0
  384. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
  385. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
  386. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
  387. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
  388. /package/build/npm/cjs/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
  389. /package/build/npm/cjs/{integrations → dev/integrations}/graphqlClient.js +0 -0
  390. /package/build/npm/cjs/{integrations → dev/integrations}/httpclient.js +0 -0
  391. /package/build/npm/cjs/{integrations → dev/integrations}/httpcontext.js +0 -0
  392. /package/build/npm/cjs/{integrations → dev/integrations}/linkederrors.js +0 -0
  393. /package/build/npm/cjs/{integrations → dev/integrations}/reportingobserver.js +0 -0
  394. /package/build/npm/cjs/{integrations → dev/integrations}/spotlight.js +0 -0
  395. /package/build/npm/cjs/{integrations → dev/integrations}/webWorker.js +0 -0
  396. /package/build/npm/cjs/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
  397. /package/build/npm/cjs/{profiling → dev/profiling}/utils.js +0 -0
  398. /package/build/npm/cjs/{report-dialog.js → dev/report-dialog.js} +0 -0
  399. /package/build/npm/cjs/{stack-parsers.js → dev/stack-parsers.js} +0 -0
  400. /package/build/npm/cjs/{tracing → dev/tracing}/backgroundtab.js +0 -0
  401. /package/build/npm/cjs/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
  402. /package/build/npm/cjs/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
  403. /package/build/npm/cjs/{tracing → dev/tracing}/request.js +0 -0
  404. /package/build/npm/cjs/{tracing → dev/tracing}/setActiveSpan.js +0 -0
  405. /package/build/npm/cjs/{tracing → dev/tracing}/utils.js +0 -0
  406. /package/build/npm/cjs/{transports → dev/transports}/fetch.js +0 -0
  407. /package/build/npm/cjs/{transports → dev/transports}/offline.js +0 -0
  408. /package/build/npm/cjs/{userfeedback.js → dev/userfeedback.js} +0 -0
  409. /package/build/npm/cjs/{utils → dev/utils}/detectBrowserExtension.js +0 -0
  410. /package/build/npm/cjs/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
  411. /package/build/npm/esm/{client.js → dev/client.js} +0 -0
  412. /package/build/npm/esm/{debug-build.js → dev/debug-build.js} +0 -0
  413. /package/build/npm/esm/{diagnose-sdk.js → dev/diagnose-sdk.js} +0 -0
  414. /package/build/npm/esm/{eventbuilder.js → dev/eventbuilder.js} +0 -0
  415. /package/build/npm/esm/{feedbackAsync.js → dev/feedbackAsync.js} +0 -0
  416. /package/build/npm/esm/{feedbackSync.js → dev/feedbackSync.js} +0 -0
  417. /package/build/npm/esm/{helpers.js → dev/helpers.js} +0 -0
  418. /package/build/npm/esm/{index.js → dev/index.js} +0 -0
  419. /package/build/npm/esm/{index.js.map → dev/index.js.map} +0 -0
  420. /package/build/npm/esm/{integrations → dev/integrations}/breadcrumbs.js +0 -0
  421. /package/build/npm/esm/{integrations → dev/integrations}/browserapierrors.js +0 -0
  422. /package/build/npm/esm/{integrations → dev/integrations}/browsersession.js +0 -0
  423. /package/build/npm/esm/{integrations → dev/integrations}/contextlines.js +0 -0
  424. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/growthbook/integration.js +0 -0
  425. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/launchdarkly/integration.js +0 -0
  426. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/openfeature/integration.js +0 -0
  427. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/statsig/integration.js +0 -0
  428. /package/build/npm/esm/{integrations → dev/integrations}/featureFlags/unleash/integration.js +0 -0
  429. /package/build/npm/esm/{integrations → dev/integrations}/graphqlClient.js +0 -0
  430. /package/build/npm/esm/{integrations → dev/integrations}/httpclient.js +0 -0
  431. /package/build/npm/esm/{integrations → dev/integrations}/httpcontext.js +0 -0
  432. /package/build/npm/esm/{integrations → dev/integrations}/linkederrors.js +0 -0
  433. /package/build/npm/esm/{integrations → dev/integrations}/reportingobserver.js +0 -0
  434. /package/build/npm/esm/{integrations → dev/integrations}/spotlight.js +0 -0
  435. /package/build/npm/esm/{integrations → dev/integrations}/webWorker.js +0 -0
  436. /package/build/npm/esm/{profiling → dev/profiling}/startProfileForSpan.js +0 -0
  437. /package/build/npm/esm/{profiling → dev/profiling}/utils.js +0 -0
  438. /package/build/npm/esm/{report-dialog.js → dev/report-dialog.js} +0 -0
  439. /package/build/npm/esm/{stack-parsers.js → dev/stack-parsers.js} +0 -0
  440. /package/build/npm/esm/{tracing → dev/tracing}/backgroundtab.js +0 -0
  441. /package/build/npm/esm/{tracing → dev/tracing}/browserTracingIntegration.js +0 -0
  442. /package/build/npm/esm/{tracing → dev/tracing}/reportPageLoaded.js +0 -0
  443. /package/build/npm/esm/{tracing → dev/tracing}/request.js +0 -0
  444. /package/build/npm/esm/{tracing → dev/tracing}/setActiveSpan.js +0 -0
  445. /package/build/npm/esm/{tracing → dev/tracing}/utils.js +0 -0
  446. /package/build/npm/esm/{transports → dev/transports}/fetch.js +0 -0
  447. /package/build/npm/esm/{transports → dev/transports}/offline.js +0 -0
  448. /package/build/npm/esm/{userfeedback.js → dev/userfeedback.js} +0 -0
  449. /package/build/npm/esm/{utils → dev/utils}/detectBrowserExtension.js +0 -0
  450. /package/build/npm/esm/{utils → dev/utils}/lazyLoadIntegration.js +0 -0
@@ -0,0 +1,339 @@
1
+ import { uuid4, debug, getGlobalScope, getRootSpan, getSdkMetadataForEnvelopeHeader, createEnvelope, dsnToString } from '@sentry/core';
2
+ import { DEBUG_BUILD } from '../debug-build.js';
3
+ import { startJSSelfProfile, createProfileChunkPayload, validateProfileChunk } from './utils.js';
4
+
5
+ const CHUNK_INTERVAL_MS = 60000; // 1 minute
6
+ // Maximum length for trace lifecycle profiling per root span (e.g. if spanEnd never fires)
7
+ const MAX_ROOT_SPAN_PROFILE_MS = 300000; // 5 minutes
8
+
9
+ /**
10
+ * Browser trace-lifecycle profiler (UI Profiling / Profiling V2):
11
+ * - Starts when the first sampled root span starts
12
+ * - Stops when the last sampled root span ends
13
+ * - While running, periodically stops and restarts the JS self-profiling API to collect chunks
14
+ *
15
+ * Profiles are emitted as standalone `profile_chunk` envelopes either when:
16
+ * - there are no more sampled root spans, or
17
+ * - the 60s chunk timer elapses while profiling is running.
18
+ */
19
+ class UIProfiler {
20
+
21
+ // For keeping track of active root spans
22
+
23
+ // ID for Profiler session
24
+
25
+ constructor() {
26
+ this._client = undefined;
27
+ this._profiler = undefined;
28
+ this._chunkTimer = undefined;
29
+ this._activeRootSpanIds = new Set();
30
+ this._rootSpanTimeouts = new Map();
31
+ this._profilerId = undefined;
32
+ this._isRunning = false;
33
+ this._sessionSampled = false;
34
+ }
35
+
36
+ /**
37
+ * Initialize the profiler with client and session sampling decision computed by the integration.
38
+ */
39
+ initialize(client, sessionSampled) {
40
+ // One Profiler ID per profiling session (user session)
41
+ this._profilerId = uuid4();
42
+
43
+ DEBUG_BUILD && debug.log("[Profiling] Initializing profiler (lifecycle='trace').");
44
+
45
+ this._client = client;
46
+ this._sessionSampled = sessionSampled;
47
+
48
+ this._setupTraceLifecycleListeners(client);
49
+ }
50
+
51
+ /**
52
+ * Handle an already-active root span at integration setup time.
53
+ */
54
+ notifyRootSpanActive(rootSpan) {
55
+ if (!this._sessionSampled) {
56
+ return;
57
+ }
58
+
59
+ const spanId = rootSpan.spanContext().spanId;
60
+ if (!spanId || this._activeRootSpanIds.has(spanId)) {
61
+ return;
62
+ }
63
+
64
+ this._activeRootSpanIds.add(spanId);
65
+
66
+ const rootSpanCount = this._activeRootSpanIds.size;
67
+
68
+ if (rootSpanCount === 1) {
69
+ DEBUG_BUILD &&
70
+ debug.log('[Profiling] Detected already active root span during setup. Active root spans now:', rootSpanCount);
71
+
72
+ this.start();
73
+ }
74
+ }
75
+
76
+ /**
77
+ * Start profiling if not already running.
78
+ */
79
+ start() {
80
+ if (this._isRunning) {
81
+ return;
82
+ }
83
+ this._isRunning = true;
84
+
85
+ DEBUG_BUILD && debug.log('[Profiling] Started profiling with profile ID:', this._profilerId);
86
+
87
+ // Expose profiler_id to match root spans with profiles
88
+ getGlobalScope().setContext('profile', { profiler_id: this._profilerId });
89
+
90
+ this._startProfilerInstance();
91
+
92
+ if (!this._profiler) {
93
+ DEBUG_BUILD && debug.log('[Profiling] Stopping trace lifecycle profiling.');
94
+ this._resetProfilerInfo();
95
+ return;
96
+ }
97
+
98
+ this._startPeriodicChunking();
99
+ }
100
+
101
+ /**
102
+ * Stop profiling; final chunk will be collected and sent.
103
+ */
104
+ stop() {
105
+ if (!this._isRunning) {
106
+ return;
107
+ }
108
+
109
+ this._isRunning = false;
110
+ if (this._chunkTimer) {
111
+ clearTimeout(this._chunkTimer);
112
+ this._chunkTimer = undefined;
113
+ }
114
+
115
+ this._clearAllRootSpanTimeouts();
116
+
117
+ // Collect whatever was currently recording
118
+ this._collectCurrentChunk().catch(e => {
119
+ DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on `stop()`:', e);
120
+ });
121
+ }
122
+
123
+ /** Trace-mode: attach spanStart/spanEnd listeners. */
124
+ _setupTraceLifecycleListeners(client) {
125
+ client.on('spanStart', span => {
126
+ if (!this._sessionSampled) {
127
+ DEBUG_BUILD && debug.log('[Profiling] Session not sampled because of negative sampling decision.');
128
+ return;
129
+ }
130
+ if (span !== getRootSpan(span)) {
131
+ return; // only care about root spans
132
+ }
133
+ // Only count sampled root spans
134
+ if (!span.isRecording()) {
135
+ DEBUG_BUILD && debug.log('[Profiling] Discarding profile because root span was not sampled.');
136
+ return;
137
+ }
138
+
139
+ const spanId = span.spanContext().spanId;
140
+ if (!spanId || this._activeRootSpanIds.has(spanId)) {
141
+ return;
142
+ }
143
+
144
+ this._registerTraceRootSpan(spanId);
145
+
146
+ const rootSpanCount = this._activeRootSpanIds.size;
147
+ if (rootSpanCount === 1) {
148
+ DEBUG_BUILD &&
149
+ debug.log(
150
+ `[Profiling] Root span ${spanId} started. Profiling active while there are active root spans (count=${rootSpanCount}).`,
151
+ );
152
+ this.start();
153
+ }
154
+ });
155
+
156
+ client.on('spanEnd', span => {
157
+ if (!this._sessionSampled) {
158
+ return;
159
+ }
160
+ const spanId = span.spanContext().spanId;
161
+ if (!spanId || !this._activeRootSpanIds.has(spanId)) {
162
+ return;
163
+ }
164
+ this._activeRootSpanIds.delete(spanId);
165
+ const rootSpanCount = this._activeRootSpanIds.size;
166
+
167
+ DEBUG_BUILD &&
168
+ debug.log(
169
+ `[Profiling] Root span with ID ${spanId} ended. Will continue profiling for as long as there are active root spans (currently: ${rootSpanCount}).`,
170
+ );
171
+ if (rootSpanCount === 0) {
172
+ this._collectCurrentChunk().catch(e => {
173
+ DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on last `spanEnd`:', e);
174
+ });
175
+ this.stop();
176
+ }
177
+ });
178
+ }
179
+
180
+ /**
181
+ * Resets profiling information from scope and resets running state
182
+ */
183
+ _resetProfilerInfo() {
184
+ this._isRunning = false;
185
+ getGlobalScope().setContext('profile', {});
186
+ }
187
+
188
+ /**
189
+ * Clear and reset all per-root-span timeouts.
190
+ */
191
+ _clearAllRootSpanTimeouts() {
192
+ this._rootSpanTimeouts.forEach(timeout => clearTimeout(timeout));
193
+ this._rootSpanTimeouts.clear();
194
+ }
195
+
196
+ /** Register root span and schedule safeguard timeout (trace mode). */
197
+ _registerTraceRootSpan(spanId) {
198
+ this._activeRootSpanIds.add(spanId);
199
+ const timeout = setTimeout(() => this._onRootSpanTimeout(spanId), MAX_ROOT_SPAN_PROFILE_MS);
200
+ this._rootSpanTimeouts.set(spanId, timeout);
201
+ }
202
+
203
+ /**
204
+ * Start a profiler instance if needed.
205
+ */
206
+ _startProfilerInstance() {
207
+ if (this._profiler?.stopped === false) {
208
+ return;
209
+ }
210
+ const profiler = startJSSelfProfile();
211
+ if (!profiler) {
212
+ DEBUG_BUILD && debug.log('[Profiling] Failed to start JS Profiler in trace lifecycle.');
213
+ return;
214
+ }
215
+ this._profiler = profiler;
216
+ }
217
+
218
+ /**
219
+ * Schedule the next 60s chunk while running.
220
+ * Each tick collects a chunk and restarts the profiler.
221
+ * A chunk should be closed when there are no active root spans anymore OR when the maximum chunk interval is reached.
222
+ */
223
+ _startPeriodicChunking() {
224
+ if (!this._isRunning) {
225
+ return;
226
+ }
227
+
228
+ this._chunkTimer = setTimeout(() => {
229
+ this._collectCurrentChunk().catch(e => {
230
+ DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk during periodic chunking:', e);
231
+ });
232
+
233
+ if (this._isRunning) {
234
+ this._startProfilerInstance();
235
+
236
+ if (!this._profiler) {
237
+ // If restart failed, stop scheduling further chunks and reset context.
238
+ this._resetProfilerInfo();
239
+ return;
240
+ }
241
+
242
+ this._startPeriodicChunking();
243
+ }
244
+ }, CHUNK_INTERVAL_MS);
245
+ }
246
+
247
+ /**
248
+ * Handle timeout for a specific root span ID to avoid indefinitely running profiler if `spanEnd` never fires.
249
+ * If this was the last active root span, collect the current chunk and stop profiling.
250
+ */
251
+ _onRootSpanTimeout(rootSpanId) {
252
+ // If span already ended, ignore
253
+ if (!this._rootSpanTimeouts.has(rootSpanId)) {
254
+ return;
255
+ }
256
+ this._rootSpanTimeouts.delete(rootSpanId);
257
+
258
+ if (!this._activeRootSpanIds.has(rootSpanId)) {
259
+ return;
260
+ }
261
+
262
+ DEBUG_BUILD &&
263
+ debug.log(
264
+ `[Profiling] Reached 5-minute timeout for root span ${rootSpanId}. You likely started a manual root span that never called \`.end()\`.`,
265
+ );
266
+
267
+ this._activeRootSpanIds.delete(rootSpanId);
268
+
269
+ const rootSpanCount = this._activeRootSpanIds.size;
270
+ if (rootSpanCount === 0) {
271
+ this.stop();
272
+ }
273
+ }
274
+
275
+ /**
276
+ * Stop the current profiler, convert and send a profile chunk.
277
+ */
278
+ async _collectCurrentChunk() {
279
+ const prevProfiler = this._profiler;
280
+ this._profiler = undefined;
281
+
282
+ if (!prevProfiler) {
283
+ return;
284
+ }
285
+
286
+ try {
287
+ const profile = await prevProfiler.stop();
288
+
289
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
290
+ const chunk = createProfileChunkPayload(profile, this._client, this._profilerId);
291
+
292
+ // Validate chunk before sending
293
+ const validationReturn = validateProfileChunk(chunk);
294
+ if ('reason' in validationReturn) {
295
+ DEBUG_BUILD &&
296
+ debug.log(
297
+ '[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):',
298
+ validationReturn.reason,
299
+ );
300
+ return;
301
+ }
302
+
303
+ this._sendProfileChunk(chunk);
304
+
305
+ DEBUG_BUILD && debug.log('[Profiling] Collected browser profile chunk.');
306
+ } catch (e) {
307
+ DEBUG_BUILD && debug.log('[Profiling] Error while stopping JS Profiler for chunk:', e);
308
+ }
309
+ }
310
+
311
+ /**
312
+ * Send a profile chunk as a standalone envelope.
313
+ */
314
+ _sendProfileChunk(chunk) {
315
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
316
+ const client = this._client;
317
+
318
+ const sdkInfo = getSdkMetadataForEnvelopeHeader(client.getSdkMetadata?.());
319
+ const dsn = client.getDsn();
320
+ const tunnel = client.getOptions().tunnel;
321
+
322
+ const envelope = createEnvelope(
323
+ {
324
+ event_id: uuid4(),
325
+ sent_at: new Date().toISOString(),
326
+ ...(sdkInfo && { sdk: sdkInfo }),
327
+ ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),
328
+ },
329
+ [[{ type: 'profile_chunk' }, chunk]],
330
+ );
331
+
332
+ client.sendEnvelope(envelope).then(null, reason => {
333
+ DEBUG_BUILD && debug.error('Error while sending profile chunk envelope:', reason);
334
+ });
335
+ }
336
+ }
337
+
338
+ export { UIProfiler };
339
+ //# sourceMappingURL=UIProfiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UIProfiler.js","sources":["../../../../../src/profiling/UIProfiler.ts"],"sourcesContent":["import type { Client, ProfileChunk, Span } from '@sentry/core';\nimport {\n type ProfileChunkEnvelope,\n createEnvelope,\n debug,\n dsnToString,\n getGlobalScope,\n getRootSpan,\n getSdkMetadataForEnvelopeHeader,\n uuid4,\n} from '@sentry/core';\nimport { DEBUG_BUILD } from './../debug-build';\nimport type { JSSelfProfiler } from './jsSelfProfiling';\nimport { createProfileChunkPayload, startJSSelfProfile, validateProfileChunk } from './utils';\n\nconst CHUNK_INTERVAL_MS = 60_000; // 1 minute\n// Maximum length for trace lifecycle profiling per root span (e.g. if spanEnd never fires)\nconst MAX_ROOT_SPAN_PROFILE_MS = 300_000; // 5 minutes\n\n/**\n * Browser trace-lifecycle profiler (UI Profiling / Profiling V2):\n * - Starts when the first sampled root span starts\n * - Stops when the last sampled root span ends\n * - While running, periodically stops and restarts the JS self-profiling API to collect chunks\n *\n * Profiles are emitted as standalone `profile_chunk` envelopes either when:\n * - there are no more sampled root spans, or\n * - the 60s chunk timer elapses while profiling is running.\n */\nexport class UIProfiler {\n private _client: Client | undefined;\n private _profiler: JSSelfProfiler | undefined;\n private _chunkTimer: ReturnType<typeof setTimeout> | undefined;\n // For keeping track of active root spans\n private _activeRootSpanIds: Set<string>;\n private _rootSpanTimeouts: Map<string, ReturnType<typeof setTimeout>>;\n // ID for Profiler session\n private _profilerId: string | undefined;\n private _isRunning: boolean;\n private _sessionSampled: boolean;\n\n public constructor() {\n this._client = undefined;\n this._profiler = undefined;\n this._chunkTimer = undefined;\n this._activeRootSpanIds = new Set<string>();\n this._rootSpanTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n this._profilerId = undefined;\n this._isRunning = false;\n this._sessionSampled = false;\n }\n\n /**\n * Initialize the profiler with client and session sampling decision computed by the integration.\n */\n public initialize(client: Client, sessionSampled: boolean): void {\n // One Profiler ID per profiling session (user session)\n this._profilerId = uuid4();\n\n DEBUG_BUILD && debug.log(\"[Profiling] Initializing profiler (lifecycle='trace').\");\n\n this._client = client;\n this._sessionSampled = sessionSampled;\n\n this._setupTraceLifecycleListeners(client);\n }\n\n /**\n * Handle an already-active root span at integration setup time.\n */\n public notifyRootSpanActive(rootSpan: Span): void {\n if (!this._sessionSampled) {\n return;\n }\n\n const spanId = rootSpan.spanContext().spanId;\n if (!spanId || this._activeRootSpanIds.has(spanId)) {\n return;\n }\n\n this._activeRootSpanIds.add(spanId);\n\n const rootSpanCount = this._activeRootSpanIds.size;\n\n if (rootSpanCount === 1) {\n DEBUG_BUILD &&\n debug.log('[Profiling] Detected already active root span during setup. Active root spans now:', rootSpanCount);\n\n this.start();\n }\n }\n\n /**\n * Start profiling if not already running.\n */\n public start(): void {\n if (this._isRunning) {\n return;\n }\n this._isRunning = true;\n\n DEBUG_BUILD && debug.log('[Profiling] Started profiling with profile ID:', this._profilerId);\n\n // Expose profiler_id to match root spans with profiles\n getGlobalScope().setContext('profile', { profiler_id: this._profilerId });\n\n this._startProfilerInstance();\n\n if (!this._profiler) {\n DEBUG_BUILD && debug.log('[Profiling] Stopping trace lifecycle profiling.');\n this._resetProfilerInfo();\n return;\n }\n\n this._startPeriodicChunking();\n }\n\n /**\n * Stop profiling; final chunk will be collected and sent.\n */\n public stop(): void {\n if (!this._isRunning) {\n return;\n }\n\n this._isRunning = false;\n if (this._chunkTimer) {\n clearTimeout(this._chunkTimer);\n this._chunkTimer = undefined;\n }\n\n this._clearAllRootSpanTimeouts();\n\n // Collect whatever was currently recording\n this._collectCurrentChunk().catch(e => {\n DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on `stop()`:', e);\n });\n }\n\n /** Trace-mode: attach spanStart/spanEnd listeners. */\n private _setupTraceLifecycleListeners(client: Client): void {\n client.on('spanStart', span => {\n if (!this._sessionSampled) {\n DEBUG_BUILD && debug.log('[Profiling] Session not sampled because of negative sampling decision.');\n return;\n }\n if (span !== getRootSpan(span)) {\n return; // only care about root spans\n }\n // Only count sampled root spans\n if (!span.isRecording()) {\n DEBUG_BUILD && debug.log('[Profiling] Discarding profile because root span was not sampled.');\n return;\n }\n\n const spanId = span.spanContext().spanId;\n if (!spanId || this._activeRootSpanIds.has(spanId)) {\n return;\n }\n\n this._registerTraceRootSpan(spanId);\n\n const rootSpanCount = this._activeRootSpanIds.size;\n if (rootSpanCount === 1) {\n DEBUG_BUILD &&\n debug.log(\n `[Profiling] Root span ${spanId} started. Profiling active while there are active root spans (count=${rootSpanCount}).`,\n );\n this.start();\n }\n });\n\n client.on('spanEnd', span => {\n if (!this._sessionSampled) {\n return;\n }\n const spanId = span.spanContext().spanId;\n if (!spanId || !this._activeRootSpanIds.has(spanId)) {\n return;\n }\n this._activeRootSpanIds.delete(spanId);\n const rootSpanCount = this._activeRootSpanIds.size;\n\n DEBUG_BUILD &&\n debug.log(\n `[Profiling] Root span with ID ${spanId} ended. Will continue profiling for as long as there are active root spans (currently: ${rootSpanCount}).`,\n );\n if (rootSpanCount === 0) {\n this._collectCurrentChunk().catch(e => {\n DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk on last `spanEnd`:', e);\n });\n this.stop();\n }\n });\n }\n\n /**\n * Resets profiling information from scope and resets running state\n */\n private _resetProfilerInfo(): void {\n this._isRunning = false;\n getGlobalScope().setContext('profile', {});\n }\n\n /**\n * Clear and reset all per-root-span timeouts.\n */\n private _clearAllRootSpanTimeouts(): void {\n this._rootSpanTimeouts.forEach(timeout => clearTimeout(timeout));\n this._rootSpanTimeouts.clear();\n }\n\n /** Register root span and schedule safeguard timeout (trace mode). */\n private _registerTraceRootSpan(spanId: string): void {\n this._activeRootSpanIds.add(spanId);\n const timeout = setTimeout(() => this._onRootSpanTimeout(spanId), MAX_ROOT_SPAN_PROFILE_MS);\n this._rootSpanTimeouts.set(spanId, timeout);\n }\n\n /**\n * Start a profiler instance if needed.\n */\n private _startProfilerInstance(): void {\n if (this._profiler?.stopped === false) {\n return;\n }\n const profiler = startJSSelfProfile();\n if (!profiler) {\n DEBUG_BUILD && debug.log('[Profiling] Failed to start JS Profiler in trace lifecycle.');\n return;\n }\n this._profiler = profiler;\n }\n\n /**\n * Schedule the next 60s chunk while running.\n * Each tick collects a chunk and restarts the profiler.\n * A chunk should be closed when there are no active root spans anymore OR when the maximum chunk interval is reached.\n */\n private _startPeriodicChunking(): void {\n if (!this._isRunning) {\n return;\n }\n\n this._chunkTimer = setTimeout(() => {\n this._collectCurrentChunk().catch(e => {\n DEBUG_BUILD && debug.error('[Profiling] Failed to collect current profile chunk during periodic chunking:', e);\n });\n\n if (this._isRunning) {\n this._startProfilerInstance();\n\n if (!this._profiler) {\n // If restart failed, stop scheduling further chunks and reset context.\n this._resetProfilerInfo();\n return;\n }\n\n this._startPeriodicChunking();\n }\n }, CHUNK_INTERVAL_MS);\n }\n\n /**\n * Handle timeout for a specific root span ID to avoid indefinitely running profiler if `spanEnd` never fires.\n * If this was the last active root span, collect the current chunk and stop profiling.\n */\n private _onRootSpanTimeout(rootSpanId: string): void {\n // If span already ended, ignore\n if (!this._rootSpanTimeouts.has(rootSpanId)) {\n return;\n }\n this._rootSpanTimeouts.delete(rootSpanId);\n\n if (!this._activeRootSpanIds.has(rootSpanId)) {\n return;\n }\n\n DEBUG_BUILD &&\n debug.log(\n `[Profiling] Reached 5-minute timeout for root span ${rootSpanId}. You likely started a manual root span that never called \\`.end()\\`.`,\n );\n\n this._activeRootSpanIds.delete(rootSpanId);\n\n const rootSpanCount = this._activeRootSpanIds.size;\n if (rootSpanCount === 0) {\n this.stop();\n }\n }\n\n /**\n * Stop the current profiler, convert and send a profile chunk.\n */\n private async _collectCurrentChunk(): Promise<void> {\n const prevProfiler = this._profiler;\n this._profiler = undefined;\n\n if (!prevProfiler) {\n return;\n }\n\n try {\n const profile = await prevProfiler.stop();\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const chunk = createProfileChunkPayload(profile, this._client!, this._profilerId);\n\n // Validate chunk before sending\n const validationReturn = validateProfileChunk(chunk);\n if ('reason' in validationReturn) {\n DEBUG_BUILD &&\n debug.log(\n '[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):',\n validationReturn.reason,\n );\n return;\n }\n\n this._sendProfileChunk(chunk);\n\n DEBUG_BUILD && debug.log('[Profiling] Collected browser profile chunk.');\n } catch (e) {\n DEBUG_BUILD && debug.log('[Profiling] Error while stopping JS Profiler for chunk:', e);\n }\n }\n\n /**\n * Send a profile chunk as a standalone envelope.\n */\n private _sendProfileChunk(chunk: ProfileChunk): void {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const client = this._client!;\n\n const sdkInfo = getSdkMetadataForEnvelopeHeader(client.getSdkMetadata?.());\n const dsn = client.getDsn();\n const tunnel = client.getOptions().tunnel;\n\n const envelope = createEnvelope<ProfileChunkEnvelope>(\n {\n event_id: uuid4(),\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n },\n [[{ type: 'profile_chunk' }, chunk]],\n );\n\n client.sendEnvelope(envelope).then(null, reason => {\n DEBUG_BUILD && debug.error('Error while sending profile chunk envelope:', reason);\n });\n }\n}\n"],"names":[],"mappings":";;;;AAeA,MAAM,iBAAA,GAAoB,KAAM,CAAA;AAChC;AACA,MAAM,wBAAA,GAA2B,MAAO,CAAA;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,UAAA,CAAW;;AAIxB;;AAGA;;AAKA,GAAS,WAAW,GAAG;AACvB,IAAI,IAAI,CAAC,OAAA,GAAU,SAAS;AAC5B,IAAI,IAAI,CAAC,SAAA,GAAY,SAAS;AAC9B,IAAI,IAAI,CAAC,WAAA,GAAc,SAAS;AAChC,IAAI,IAAI,CAAC,kBAAA,GAAqB,IAAI,GAAG,EAAU;AAC/C,IAAI,IAAI,CAAC,iBAAA,GAAoB,IAAI,GAAG,EAAyC;AAC7E,IAAI,IAAI,CAAC,WAAA,GAAc,SAAS;AAChC,IAAI,IAAI,CAAC,UAAA,GAAa,KAAK;AAC3B,IAAI,IAAI,CAAC,eAAA,GAAkB,KA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I,MAAM,OAAA,GAAU,+BAA+B,CAAC,MAAM,CAAC,cAAc,IAAI,CAAC;AAC9E,IAAI,MAAM,GAAA,GAAM,MAAM,CAAC,MAAM,EAAE;AAC/B,IAAI,MAAM,SAAS,MAAM,CAAC,UAAU,EAAE,CAAC,MAAM;;AAE7C,IAAI,MAAM,QAAA,GAAW,cAAc;AACnC,MAAM;AACN,QAAQ,QAAQ,EAAE,KAAK,EAAE;AACzB,QAAQ,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;AACzC,QAAQ,IAAI,OAAA,IAAW,EAAE,GAAG,EAAE,OAAA,EAAS,CAAC;AACxC,QAAQ,IAAI,CAAC,CAAC,MAAA,IAAU,GAAA,IAAO,EAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAA,EAAG,CAAC;AACzD,OAAO;AACP,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,CAAC,CAAC;AAC1C,KAAK;;AAEL,IAAI,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,MAAA,IAAU;AACvD,MAAM,WAAA,IAAe,KAAK,CAAC,KAAK,CAAC,6CAA6C,EAAE,MAAM,CAAC;AACvF,IAAI,CAAC,CAAC;AACN,EAAE;AACF;;;;"}
@@ -0,0 +1,148 @@
1
+ import { defineIntegration, debug, getActiveSpan, getRootSpan, hasSpansEnabled } from '@sentry/core';
2
+ import { DEBUG_BUILD } from '../debug-build.js';
3
+ import { WINDOW } from '../helpers.js';
4
+ import { startProfileForSpan } from './startProfileForSpan.js';
5
+ import { UIProfiler } from './UIProfiler.js';
6
+ import { attachProfiledThreadToEvent, hasLegacyProfiling, shouldProfileSession, isAutomatedPageLoadSpan, shouldProfileSpanLegacy, getActiveProfilesCount, findProfiledTransactionsFromEnvelope, takeProfileFromGlobalCache, createProfilingEvent, addProfilesToEnvelope } from './utils.js';
7
+
8
+ const INTEGRATION_NAME = 'BrowserProfiling';
9
+
10
+ const _browserProfilingIntegration = (() => {
11
+ return {
12
+ name: INTEGRATION_NAME,
13
+ setup(client) {
14
+ const options = client.getOptions() ;
15
+
16
+ if (!hasLegacyProfiling(options) && !options.profileLifecycle) {
17
+ // Set default lifecycle mode
18
+ options.profileLifecycle = 'manual';
19
+ }
20
+
21
+ if (hasLegacyProfiling(options) && !options.profilesSampleRate) {
22
+ DEBUG_BUILD && debug.log('[Profiling] Profiling disabled, no profiling options found.');
23
+ return;
24
+ }
25
+
26
+ const activeSpan = getActiveSpan();
27
+ const rootSpan = activeSpan && getRootSpan(activeSpan);
28
+
29
+ if (hasLegacyProfiling(options) && options.profileSessionSampleRate !== undefined) {
30
+ DEBUG_BUILD &&
31
+ debug.warn(
32
+ '[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled.',
33
+ );
34
+ }
35
+
36
+ // UI PROFILING (Profiling V2)
37
+ if (!hasLegacyProfiling(options)) {
38
+ const sessionSampled = shouldProfileSession(options);
39
+ if (!sessionSampled) {
40
+ DEBUG_BUILD && debug.log('[Profiling] Session not sampled. Skipping lifecycle profiler initialization.');
41
+ }
42
+
43
+ const lifecycleMode = options.profileLifecycle;
44
+
45
+ if (lifecycleMode === 'trace') {
46
+ if (!hasSpansEnabled(options)) {
47
+ DEBUG_BUILD &&
48
+ debug.warn(
49
+ "[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing.",
50
+ );
51
+ return;
52
+ }
53
+
54
+ const traceLifecycleProfiler = new UIProfiler();
55
+ traceLifecycleProfiler.initialize(client, sessionSampled);
56
+
57
+ // If there is an active, sampled root span already, notify the profiler
58
+ if (rootSpan) {
59
+ traceLifecycleProfiler.notifyRootSpanActive(rootSpan);
60
+ }
61
+
62
+ // In case rootSpan is created slightly after setup -> schedule microtask to re-check and notify.
63
+ WINDOW.setTimeout(() => {
64
+ const laterActiveSpan = getActiveSpan();
65
+ const laterRootSpan = laterActiveSpan && getRootSpan(laterActiveSpan);
66
+ if (laterRootSpan) {
67
+ traceLifecycleProfiler.notifyRootSpanActive(laterRootSpan);
68
+ }
69
+ }, 0);
70
+ }
71
+ } else {
72
+ // LEGACY PROFILING (v1)
73
+ if (rootSpan && isAutomatedPageLoadSpan(rootSpan)) {
74
+ if (shouldProfileSpanLegacy(rootSpan)) {
75
+ startProfileForSpan(rootSpan);
76
+ }
77
+ }
78
+
79
+ client.on('spanStart', (span) => {
80
+ if (span === getRootSpan(span) && shouldProfileSpanLegacy(span)) {
81
+ startProfileForSpan(span);
82
+ }
83
+ });
84
+
85
+ client.on('beforeEnvelope', (envelope) => {
86
+ // if not profiles are in queue, there is nothing to add to the envelope.
87
+ if (!getActiveProfilesCount()) {
88
+ return;
89
+ }
90
+
91
+ const profiledTransactionEvents = findProfiledTransactionsFromEnvelope(envelope);
92
+ if (!profiledTransactionEvents.length) {
93
+ return;
94
+ }
95
+
96
+ const profilesToAddToEnvelope = [];
97
+
98
+ for (const profiledTransaction of profiledTransactionEvents) {
99
+ const context = profiledTransaction?.contexts;
100
+ const profile_id = context?.profile?.['profile_id'];
101
+ const start_timestamp = context?.profile?.['start_timestamp'];
102
+
103
+ if (typeof profile_id !== 'string') {
104
+ DEBUG_BUILD && debug.log('[Profiling] cannot find profile for a span without a profile context');
105
+ continue;
106
+ }
107
+
108
+ if (!profile_id) {
109
+ DEBUG_BUILD && debug.log('[Profiling] cannot find profile for a span without a profile context');
110
+ continue;
111
+ }
112
+
113
+ // Remove the profile from the span context before sending, relay will take care of the rest.
114
+ if (context?.profile) {
115
+ delete context.profile;
116
+ }
117
+
118
+ const profile = takeProfileFromGlobalCache(profile_id);
119
+ if (!profile) {
120
+ DEBUG_BUILD && debug.log(`[Profiling] Could not retrieve profile for span: ${profile_id}`);
121
+ continue;
122
+ }
123
+
124
+ const profileEvent = createProfilingEvent(
125
+ profile_id,
126
+ start_timestamp ,
127
+ profile,
128
+ profiledTransaction ,
129
+ );
130
+ if (profileEvent) {
131
+ profilesToAddToEnvelope.push(profileEvent);
132
+ }
133
+ }
134
+
135
+ addProfilesToEnvelope(envelope , profilesToAddToEnvelope);
136
+ });
137
+ }
138
+ },
139
+ processEvent(event) {
140
+ return attachProfiledThreadToEvent(event);
141
+ },
142
+ };
143
+ }) ;
144
+
145
+ const browserProfilingIntegration = defineIntegration(_browserProfilingIntegration);
146
+
147
+ export { browserProfilingIntegration };
148
+ //# sourceMappingURL=integration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.js","sources":["../../../../../src/profiling/integration.ts"],"sourcesContent":["import type { EventEnvelope, IntegrationFn, Profile, Span } from '@sentry/core';\nimport { debug, defineIntegration, getActiveSpan, getRootSpan, hasSpansEnabled } from '@sentry/core';\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 attachProfiledThreadToEvent,\n createProfilingEvent,\n findProfiledTransactionsFromEnvelope,\n getActiveProfilesCount,\n hasLegacyProfiling,\n isAutomatedPageLoadSpan,\n shouldProfileSession,\n shouldProfileSpanLegacy,\n takeProfileFromGlobalCache,\n} from './utils';\n\nconst INTEGRATION_NAME = 'BrowserProfiling';\n\nconst _browserProfilingIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n const options = client.getOptions() as BrowserOptions;\n\n if (!hasLegacyProfiling(options) && !options.profileLifecycle) {\n // Set default lifecycle mode\n options.profileLifecycle = 'manual';\n }\n\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 sessionSampled = shouldProfileSession(options);\n if (!sessionSampled) {\n DEBUG_BUILD && debug.log('[Profiling] Session not sampled. Skipping lifecycle profiler initialization.');\n }\n\n const lifecycleMode = options.profileLifecycle;\n\n 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 const traceLifecycleProfiler = new UIProfiler();\n traceLifecycleProfiler.initialize(client, sessionSampled);\n\n // If there is an active, sampled root span already, notify the profiler\n if (rootSpan) {\n traceLifecycleProfiler.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 traceLifecycleProfiler.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 if (span === getRootSpan(span) && shouldProfileSpanLegacy(span)) {\n startProfileForSpan(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 processEvent(event) {\n return attachProfiledThreadToEvent(event);\n },\n };\n}) satisfies IntegrationFn;\n\nexport const browserProfilingIntegration = defineIntegration(_browserProfilingIntegration);\n"],"names":[],"mappings":";;;;;;;AAqBA,MAAM,gBAAA,GAAmB,kBAAkB;;AAE3C,MAAM,4BAAA,IAAgC,MAAM;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,MAAM,OAAA,GAAU,MAAM,CAAC,UAAU,EAAC;;AAExC,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAA,IAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE;AACrE;AACA,QAAQ,OAAO,CAAC,gBAAA,GAAmB,QAAQ;AAC3C,MAAM;;AAEN,MAAM,IAAI,kBAAkB,CAAC,OAAO,CAAA,IAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE;AACtE,QAAQ,eAAe,KAAK,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