@sentry/browser 10.53.1 → 10.54.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 (445) hide show
  1. package/build/npm/cjs/dev/client.js +15 -54
  2. package/build/npm/cjs/dev/client.js.map +1 -1
  3. package/build/npm/cjs/dev/debug-build.js +0 -5
  4. package/build/npm/cjs/dev/debug-build.js.map +1 -1
  5. package/build/npm/cjs/dev/diagnose-sdk.js +15 -37
  6. package/build/npm/cjs/dev/diagnose-sdk.js.map +1 -1
  7. package/build/npm/cjs/dev/eventbuilder.js +59 -217
  8. package/build/npm/cjs/dev/eventbuilder.js.map +1 -1
  9. package/build/npm/cjs/dev/feedbackAsync.js +1 -5
  10. package/build/npm/cjs/dev/feedbackAsync.js.map +1 -1
  11. package/build/npm/cjs/dev/feedbackSync.js +1 -2
  12. package/build/npm/cjs/dev/feedbackSync.js.map +1 -1
  13. package/build/npm/cjs/dev/helpers.js +24 -102
  14. package/build/npm/cjs/dev/helpers.js.map +1 -1
  15. package/build/npm/cjs/dev/index.js +2 -0
  16. package/build/npm/cjs/dev/index.js.map +1 -1
  17. package/build/npm/cjs/dev/integrations/breadcrumbs.js +52 -134
  18. package/build/npm/cjs/dev/integrations/breadcrumbs.js.map +1 -1
  19. package/build/npm/cjs/dev/integrations/browserapierrors.js +45 -111
  20. package/build/npm/cjs/dev/integrations/browserapierrors.js.map +1 -1
  21. package/build/npm/cjs/dev/integrations/browsersession.js +7 -35
  22. package/build/npm/cjs/dev/integrations/browsersession.js.map +1 -1
  23. package/build/npm/cjs/dev/integrations/contextlines.js +9 -45
  24. package/build/npm/cjs/dev/integrations/contextlines.js.map +1 -1
  25. package/build/npm/cjs/dev/integrations/culturecontext.js +11 -36
  26. package/build/npm/cjs/dev/integrations/culturecontext.js.map +1 -1
  27. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js +1 -22
  28. package/build/npm/cjs/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
  29. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js +6 -31
  30. package/build/npm/cjs/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  31. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js +6 -12
  32. package/build/npm/cjs/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
  33. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js +5 -30
  34. package/build/npm/cjs/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
  35. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js +10 -47
  36. package/build/npm/cjs/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
  37. package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js +60 -0
  38. package/build/npm/cjs/dev/integrations/fetchStreamPerformance.js.map +1 -0
  39. package/build/npm/cjs/dev/integrations/globalhandlers.js +38 -99
  40. package/build/npm/cjs/dev/integrations/globalhandlers.js.map +1 -1
  41. package/build/npm/cjs/dev/integrations/graphqlClient.js +31 -119
  42. package/build/npm/cjs/dev/integrations/graphqlClient.js.map +1 -1
  43. package/build/npm/cjs/dev/integrations/httpclient.js +43 -203
  44. package/build/npm/cjs/dev/integrations/httpclient.js.map +1 -1
  45. package/build/npm/cjs/dev/integrations/httpcontext.js +7 -17
  46. package/build/npm/cjs/dev/integrations/httpcontext.js.map +1 -1
  47. package/build/npm/cjs/dev/integrations/linkederrors.js +7 -15
  48. package/build/npm/cjs/dev/integrations/linkederrors.js.map +1 -1
  49. package/build/npm/cjs/dev/integrations/reportingobserver.js +19 -44
  50. package/build/npm/cjs/dev/integrations/reportingobserver.js.map +1 -1
  51. package/build/npm/cjs/dev/integrations/spanstreaming.js +11 -29
  52. package/build/npm/cjs/dev/integrations/spanstreaming.js.map +1 -1
  53. package/build/npm/cjs/dev/integrations/spotlight.js +17 -30
  54. package/build/npm/cjs/dev/integrations/spotlight.js.map +1 -1
  55. package/build/npm/cjs/dev/integrations/view-hierarchy.js +19 -46
  56. package/build/npm/cjs/dev/integrations/view-hierarchy.js.map +1 -1
  57. package/build/npm/cjs/dev/integrations/webWorker.js +40 -211
  58. package/build/npm/cjs/dev/integrations/webWorker.js.map +1 -1
  59. package/build/npm/cjs/dev/profiling/UIProfiler.js +87 -190
  60. package/build/npm/cjs/dev/profiling/UIProfiler.js.map +1 -1
  61. package/build/npm/cjs/dev/profiling/index.js +9 -30
  62. package/build/npm/cjs/dev/profiling/index.js.map +1 -1
  63. package/build/npm/cjs/dev/profiling/integration.js +30 -64
  64. package/build/npm/cjs/dev/profiling/integration.js.map +1 -1
  65. package/build/npm/cjs/dev/profiling/startProfileForSpan.js +28 -84
  66. package/build/npm/cjs/dev/profiling/startProfileForSpan.js.map +1 -1
  67. package/build/npm/cjs/dev/profiling/utils.js +131 -398
  68. package/build/npm/cjs/dev/profiling/utils.js.map +1 -1
  69. package/build/npm/cjs/dev/report-dialog.js +10 -25
  70. package/build/npm/cjs/dev/report-dialog.js.map +1 -1
  71. package/build/npm/cjs/dev/sdk.js +8 -76
  72. package/build/npm/cjs/dev/sdk.js.map +1 -1
  73. package/build/npm/cjs/dev/stack-parsers.js +42 -126
  74. package/build/npm/cjs/dev/stack-parsers.js.map +1 -1
  75. package/build/npm/cjs/dev/tracing/backgroundtab.js +4 -16
  76. package/build/npm/cjs/dev/tracing/backgroundtab.js.map +1 -1
  77. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js +102 -291
  78. package/build/npm/cjs/dev/tracing/browserTracingIntegration.js.map +1 -1
  79. package/build/npm/cjs/dev/tracing/linkedTraces.js +25 -116
  80. package/build/npm/cjs/dev/tracing/linkedTraces.js.map +1 -1
  81. package/build/npm/cjs/dev/tracing/reportPageLoaded.js +1 -9
  82. package/build/npm/cjs/dev/tracing/reportPageLoaded.js.map +1 -1
  83. package/build/npm/cjs/dev/tracing/request.js +58 -223
  84. package/build/npm/cjs/dev/tracing/request.js.map +1 -1
  85. package/build/npm/cjs/dev/tracing/setActiveSpan.js +1 -48
  86. package/build/npm/cjs/dev/tracing/setActiveSpan.js.map +1 -1
  87. package/build/npm/cjs/dev/tracing/utils.js +4 -27
  88. package/build/npm/cjs/dev/tracing/utils.js.map +1 -1
  89. package/build/npm/cjs/dev/transports/fetch.js +10 -23
  90. package/build/npm/cjs/dev/transports/fetch.js.map +1 -1
  91. package/build/npm/cjs/dev/transports/offline.js +27 -84
  92. package/build/npm/cjs/dev/transports/offline.js.map +1 -1
  93. package/build/npm/cjs/dev/userfeedback.js +12 -22
  94. package/build/npm/cjs/dev/userfeedback.js.map +1 -1
  95. package/build/npm/cjs/dev/utils/detectBrowserExtension.js +5 -26
  96. package/build/npm/cjs/dev/utils/detectBrowserExtension.js.map +1 -1
  97. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js +40 -75
  98. package/build/npm/cjs/dev/utils/lazyLoadIntegration.js.map +1 -1
  99. package/build/npm/cjs/prod/client.js +15 -54
  100. package/build/npm/cjs/prod/client.js.map +1 -1
  101. package/build/npm/cjs/prod/debug-build.js +0 -5
  102. package/build/npm/cjs/prod/debug-build.js.map +1 -1
  103. package/build/npm/cjs/prod/diagnose-sdk.js +15 -37
  104. package/build/npm/cjs/prod/diagnose-sdk.js.map +1 -1
  105. package/build/npm/cjs/prod/eventbuilder.js +59 -217
  106. package/build/npm/cjs/prod/eventbuilder.js.map +1 -1
  107. package/build/npm/cjs/prod/feedbackAsync.js +1 -5
  108. package/build/npm/cjs/prod/feedbackAsync.js.map +1 -1
  109. package/build/npm/cjs/prod/feedbackSync.js +1 -2
  110. package/build/npm/cjs/prod/feedbackSync.js.map +1 -1
  111. package/build/npm/cjs/prod/helpers.js +24 -102
  112. package/build/npm/cjs/prod/helpers.js.map +1 -1
  113. package/build/npm/cjs/prod/index.js +2 -0
  114. package/build/npm/cjs/prod/index.js.map +1 -1
  115. package/build/npm/cjs/prod/integrations/breadcrumbs.js +52 -134
  116. package/build/npm/cjs/prod/integrations/breadcrumbs.js.map +1 -1
  117. package/build/npm/cjs/prod/integrations/browserapierrors.js +45 -111
  118. package/build/npm/cjs/prod/integrations/browserapierrors.js.map +1 -1
  119. package/build/npm/cjs/prod/integrations/browsersession.js +7 -35
  120. package/build/npm/cjs/prod/integrations/browsersession.js.map +1 -1
  121. package/build/npm/cjs/prod/integrations/contextlines.js +9 -45
  122. package/build/npm/cjs/prod/integrations/contextlines.js.map +1 -1
  123. package/build/npm/cjs/prod/integrations/culturecontext.js +11 -36
  124. package/build/npm/cjs/prod/integrations/culturecontext.js.map +1 -1
  125. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js +1 -22
  126. package/build/npm/cjs/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
  127. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js +6 -31
  128. package/build/npm/cjs/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  129. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js +6 -12
  130. package/build/npm/cjs/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
  131. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js +5 -30
  132. package/build/npm/cjs/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
  133. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js +10 -47
  134. package/build/npm/cjs/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
  135. package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js +60 -0
  136. package/build/npm/cjs/prod/integrations/fetchStreamPerformance.js.map +1 -0
  137. package/build/npm/cjs/prod/integrations/globalhandlers.js +38 -99
  138. package/build/npm/cjs/prod/integrations/globalhandlers.js.map +1 -1
  139. package/build/npm/cjs/prod/integrations/graphqlClient.js +31 -119
  140. package/build/npm/cjs/prod/integrations/graphqlClient.js.map +1 -1
  141. package/build/npm/cjs/prod/integrations/httpclient.js +43 -203
  142. package/build/npm/cjs/prod/integrations/httpclient.js.map +1 -1
  143. package/build/npm/cjs/prod/integrations/httpcontext.js +7 -17
  144. package/build/npm/cjs/prod/integrations/httpcontext.js.map +1 -1
  145. package/build/npm/cjs/prod/integrations/linkederrors.js +7 -15
  146. package/build/npm/cjs/prod/integrations/linkederrors.js.map +1 -1
  147. package/build/npm/cjs/prod/integrations/reportingobserver.js +19 -44
  148. package/build/npm/cjs/prod/integrations/reportingobserver.js.map +1 -1
  149. package/build/npm/cjs/prod/integrations/spanstreaming.js +11 -29
  150. package/build/npm/cjs/prod/integrations/spanstreaming.js.map +1 -1
  151. package/build/npm/cjs/prod/integrations/spotlight.js +17 -30
  152. package/build/npm/cjs/prod/integrations/spotlight.js.map +1 -1
  153. package/build/npm/cjs/prod/integrations/view-hierarchy.js +19 -46
  154. package/build/npm/cjs/prod/integrations/view-hierarchy.js.map +1 -1
  155. package/build/npm/cjs/prod/integrations/webWorker.js +40 -211
  156. package/build/npm/cjs/prod/integrations/webWorker.js.map +1 -1
  157. package/build/npm/cjs/prod/profiling/UIProfiler.js +87 -190
  158. package/build/npm/cjs/prod/profiling/UIProfiler.js.map +1 -1
  159. package/build/npm/cjs/prod/profiling/index.js +9 -30
  160. package/build/npm/cjs/prod/profiling/index.js.map +1 -1
  161. package/build/npm/cjs/prod/profiling/integration.js +30 -64
  162. package/build/npm/cjs/prod/profiling/integration.js.map +1 -1
  163. package/build/npm/cjs/prod/profiling/startProfileForSpan.js +28 -84
  164. package/build/npm/cjs/prod/profiling/startProfileForSpan.js.map +1 -1
  165. package/build/npm/cjs/prod/profiling/utils.js +131 -398
  166. package/build/npm/cjs/prod/profiling/utils.js.map +1 -1
  167. package/build/npm/cjs/prod/report-dialog.js +10 -25
  168. package/build/npm/cjs/prod/report-dialog.js.map +1 -1
  169. package/build/npm/cjs/prod/sdk.js +5 -73
  170. package/build/npm/cjs/prod/sdk.js.map +1 -1
  171. package/build/npm/cjs/prod/stack-parsers.js +42 -126
  172. package/build/npm/cjs/prod/stack-parsers.js.map +1 -1
  173. package/build/npm/cjs/prod/tracing/backgroundtab.js +4 -16
  174. package/build/npm/cjs/prod/tracing/backgroundtab.js.map +1 -1
  175. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js +102 -291
  176. package/build/npm/cjs/prod/tracing/browserTracingIntegration.js.map +1 -1
  177. package/build/npm/cjs/prod/tracing/linkedTraces.js +25 -117
  178. package/build/npm/cjs/prod/tracing/linkedTraces.js.map +1 -1
  179. package/build/npm/cjs/prod/tracing/reportPageLoaded.js +1 -9
  180. package/build/npm/cjs/prod/tracing/reportPageLoaded.js.map +1 -1
  181. package/build/npm/cjs/prod/tracing/request.js +58 -223
  182. package/build/npm/cjs/prod/tracing/request.js.map +1 -1
  183. package/build/npm/cjs/prod/tracing/setActiveSpan.js +1 -48
  184. package/build/npm/cjs/prod/tracing/setActiveSpan.js.map +1 -1
  185. package/build/npm/cjs/prod/tracing/utils.js +4 -27
  186. package/build/npm/cjs/prod/tracing/utils.js.map +1 -1
  187. package/build/npm/cjs/prod/transports/fetch.js +10 -23
  188. package/build/npm/cjs/prod/transports/fetch.js.map +1 -1
  189. package/build/npm/cjs/prod/transports/offline.js +27 -84
  190. package/build/npm/cjs/prod/transports/offline.js.map +1 -1
  191. package/build/npm/cjs/prod/userfeedback.js +12 -22
  192. package/build/npm/cjs/prod/userfeedback.js.map +1 -1
  193. package/build/npm/cjs/prod/utils/detectBrowserExtension.js +5 -26
  194. package/build/npm/cjs/prod/utils/detectBrowserExtension.js.map +1 -1
  195. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js +40 -75
  196. package/build/npm/cjs/prod/utils/lazyLoadIntegration.js.map +1 -1
  197. package/build/npm/esm/dev/client.js +15 -54
  198. package/build/npm/esm/dev/client.js.map +1 -1
  199. package/build/npm/esm/dev/debug-build.js +0 -5
  200. package/build/npm/esm/dev/debug-build.js.map +1 -1
  201. package/build/npm/esm/dev/diagnose-sdk.js +15 -37
  202. package/build/npm/esm/dev/diagnose-sdk.js.map +1 -1
  203. package/build/npm/esm/dev/eventbuilder.js +59 -217
  204. package/build/npm/esm/dev/eventbuilder.js.map +1 -1
  205. package/build/npm/esm/dev/feedbackAsync.js +1 -5
  206. package/build/npm/esm/dev/feedbackAsync.js.map +1 -1
  207. package/build/npm/esm/dev/feedbackSync.js +1 -2
  208. package/build/npm/esm/dev/feedbackSync.js.map +1 -1
  209. package/build/npm/esm/dev/helpers.js +24 -102
  210. package/build/npm/esm/dev/helpers.js.map +1 -1
  211. package/build/npm/esm/dev/index.js +1 -0
  212. package/build/npm/esm/dev/index.js.map +1 -1
  213. package/build/npm/esm/dev/integrations/breadcrumbs.js +52 -134
  214. package/build/npm/esm/dev/integrations/breadcrumbs.js.map +1 -1
  215. package/build/npm/esm/dev/integrations/browserapierrors.js +45 -111
  216. package/build/npm/esm/dev/integrations/browserapierrors.js.map +1 -1
  217. package/build/npm/esm/dev/integrations/browsersession.js +7 -35
  218. package/build/npm/esm/dev/integrations/browsersession.js.map +1 -1
  219. package/build/npm/esm/dev/integrations/contextlines.js +9 -45
  220. package/build/npm/esm/dev/integrations/contextlines.js.map +1 -1
  221. package/build/npm/esm/dev/integrations/culturecontext.js +11 -36
  222. package/build/npm/esm/dev/integrations/culturecontext.js.map +1 -1
  223. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js +1 -22
  224. package/build/npm/esm/dev/integrations/featureFlags/growthbook/integration.js.map +1 -1
  225. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js +6 -31
  226. package/build/npm/esm/dev/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  227. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js +6 -12
  228. package/build/npm/esm/dev/integrations/featureFlags/openfeature/integration.js.map +1 -1
  229. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js +5 -30
  230. package/build/npm/esm/dev/integrations/featureFlags/statsig/integration.js.map +1 -1
  231. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js +10 -47
  232. package/build/npm/esm/dev/integrations/featureFlags/unleash/integration.js.map +1 -1
  233. package/build/npm/esm/dev/integrations/fetchStreamPerformance.js +58 -0
  234. package/build/npm/esm/dev/integrations/fetchStreamPerformance.js.map +1 -0
  235. package/build/npm/esm/dev/integrations/globalhandlers.js +38 -99
  236. package/build/npm/esm/dev/integrations/globalhandlers.js.map +1 -1
  237. package/build/npm/esm/dev/integrations/graphqlClient.js +31 -119
  238. package/build/npm/esm/dev/integrations/graphqlClient.js.map +1 -1
  239. package/build/npm/esm/dev/integrations/httpclient.js +43 -203
  240. package/build/npm/esm/dev/integrations/httpclient.js.map +1 -1
  241. package/build/npm/esm/dev/integrations/httpcontext.js +7 -17
  242. package/build/npm/esm/dev/integrations/httpcontext.js.map +1 -1
  243. package/build/npm/esm/dev/integrations/linkederrors.js +7 -15
  244. package/build/npm/esm/dev/integrations/linkederrors.js.map +1 -1
  245. package/build/npm/esm/dev/integrations/reportingobserver.js +19 -44
  246. package/build/npm/esm/dev/integrations/reportingobserver.js.map +1 -1
  247. package/build/npm/esm/dev/integrations/spanstreaming.js +11 -29
  248. package/build/npm/esm/dev/integrations/spanstreaming.js.map +1 -1
  249. package/build/npm/esm/dev/integrations/spotlight.js +17 -30
  250. package/build/npm/esm/dev/integrations/spotlight.js.map +1 -1
  251. package/build/npm/esm/dev/integrations/view-hierarchy.js +19 -46
  252. package/build/npm/esm/dev/integrations/view-hierarchy.js.map +1 -1
  253. package/build/npm/esm/dev/integrations/webWorker.js +40 -211
  254. package/build/npm/esm/dev/integrations/webWorker.js.map +1 -1
  255. package/build/npm/esm/dev/package.json +1 -1
  256. package/build/npm/esm/dev/profiling/UIProfiler.js +87 -190
  257. package/build/npm/esm/dev/profiling/UIProfiler.js.map +1 -1
  258. package/build/npm/esm/dev/profiling/index.js +9 -30
  259. package/build/npm/esm/dev/profiling/index.js.map +1 -1
  260. package/build/npm/esm/dev/profiling/integration.js +30 -64
  261. package/build/npm/esm/dev/profiling/integration.js.map +1 -1
  262. package/build/npm/esm/dev/profiling/startProfileForSpan.js +28 -84
  263. package/build/npm/esm/dev/profiling/startProfileForSpan.js.map +1 -1
  264. package/build/npm/esm/dev/profiling/utils.js +131 -398
  265. package/build/npm/esm/dev/profiling/utils.js.map +1 -1
  266. package/build/npm/esm/dev/report-dialog.js +10 -25
  267. package/build/npm/esm/dev/report-dialog.js.map +1 -1
  268. package/build/npm/esm/dev/sdk.js +8 -76
  269. package/build/npm/esm/dev/sdk.js.map +1 -1
  270. package/build/npm/esm/dev/stack-parsers.js +42 -126
  271. package/build/npm/esm/dev/stack-parsers.js.map +1 -1
  272. package/build/npm/esm/dev/tracing/backgroundtab.js +4 -16
  273. package/build/npm/esm/dev/tracing/backgroundtab.js.map +1 -1
  274. package/build/npm/esm/dev/tracing/browserTracingIntegration.js +102 -291
  275. package/build/npm/esm/dev/tracing/browserTracingIntegration.js.map +1 -1
  276. package/build/npm/esm/dev/tracing/linkedTraces.js +25 -116
  277. package/build/npm/esm/dev/tracing/linkedTraces.js.map +1 -1
  278. package/build/npm/esm/dev/tracing/reportPageLoaded.js +1 -9
  279. package/build/npm/esm/dev/tracing/reportPageLoaded.js.map +1 -1
  280. package/build/npm/esm/dev/tracing/request.js +59 -224
  281. package/build/npm/esm/dev/tracing/request.js.map +1 -1
  282. package/build/npm/esm/dev/tracing/setActiveSpan.js +1 -48
  283. package/build/npm/esm/dev/tracing/setActiveSpan.js.map +1 -1
  284. package/build/npm/esm/dev/tracing/utils.js +4 -27
  285. package/build/npm/esm/dev/tracing/utils.js.map +1 -1
  286. package/build/npm/esm/dev/transports/fetch.js +10 -23
  287. package/build/npm/esm/dev/transports/fetch.js.map +1 -1
  288. package/build/npm/esm/dev/transports/offline.js +27 -84
  289. package/build/npm/esm/dev/transports/offline.js.map +1 -1
  290. package/build/npm/esm/dev/userfeedback.js +12 -22
  291. package/build/npm/esm/dev/userfeedback.js.map +1 -1
  292. package/build/npm/esm/dev/utils/detectBrowserExtension.js +5 -26
  293. package/build/npm/esm/dev/utils/detectBrowserExtension.js.map +1 -1
  294. package/build/npm/esm/dev/utils/lazyLoadIntegration.js +40 -75
  295. package/build/npm/esm/dev/utils/lazyLoadIntegration.js.map +1 -1
  296. package/build/npm/esm/prod/client.js +15 -54
  297. package/build/npm/esm/prod/client.js.map +1 -1
  298. package/build/npm/esm/prod/debug-build.js +0 -5
  299. package/build/npm/esm/prod/debug-build.js.map +1 -1
  300. package/build/npm/esm/prod/diagnose-sdk.js +15 -37
  301. package/build/npm/esm/prod/diagnose-sdk.js.map +1 -1
  302. package/build/npm/esm/prod/eventbuilder.js +59 -217
  303. package/build/npm/esm/prod/eventbuilder.js.map +1 -1
  304. package/build/npm/esm/prod/feedbackAsync.js +1 -5
  305. package/build/npm/esm/prod/feedbackAsync.js.map +1 -1
  306. package/build/npm/esm/prod/feedbackSync.js +1 -2
  307. package/build/npm/esm/prod/feedbackSync.js.map +1 -1
  308. package/build/npm/esm/prod/helpers.js +24 -102
  309. package/build/npm/esm/prod/helpers.js.map +1 -1
  310. package/build/npm/esm/prod/index.js +1 -0
  311. package/build/npm/esm/prod/index.js.map +1 -1
  312. package/build/npm/esm/prod/integrations/breadcrumbs.js +52 -134
  313. package/build/npm/esm/prod/integrations/breadcrumbs.js.map +1 -1
  314. package/build/npm/esm/prod/integrations/browserapierrors.js +45 -111
  315. package/build/npm/esm/prod/integrations/browserapierrors.js.map +1 -1
  316. package/build/npm/esm/prod/integrations/browsersession.js +7 -35
  317. package/build/npm/esm/prod/integrations/browsersession.js.map +1 -1
  318. package/build/npm/esm/prod/integrations/contextlines.js +9 -45
  319. package/build/npm/esm/prod/integrations/contextlines.js.map +1 -1
  320. package/build/npm/esm/prod/integrations/culturecontext.js +11 -36
  321. package/build/npm/esm/prod/integrations/culturecontext.js.map +1 -1
  322. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js +1 -22
  323. package/build/npm/esm/prod/integrations/featureFlags/growthbook/integration.js.map +1 -1
  324. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js +6 -31
  325. package/build/npm/esm/prod/integrations/featureFlags/launchdarkly/integration.js.map +1 -1
  326. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js +6 -12
  327. package/build/npm/esm/prod/integrations/featureFlags/openfeature/integration.js.map +1 -1
  328. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js +5 -30
  329. package/build/npm/esm/prod/integrations/featureFlags/statsig/integration.js.map +1 -1
  330. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js +10 -47
  331. package/build/npm/esm/prod/integrations/featureFlags/unleash/integration.js.map +1 -1
  332. package/build/npm/esm/prod/integrations/fetchStreamPerformance.js +58 -0
  333. package/build/npm/esm/prod/integrations/fetchStreamPerformance.js.map +1 -0
  334. package/build/npm/esm/prod/integrations/globalhandlers.js +38 -99
  335. package/build/npm/esm/prod/integrations/globalhandlers.js.map +1 -1
  336. package/build/npm/esm/prod/integrations/graphqlClient.js +31 -119
  337. package/build/npm/esm/prod/integrations/graphqlClient.js.map +1 -1
  338. package/build/npm/esm/prod/integrations/httpclient.js +43 -203
  339. package/build/npm/esm/prod/integrations/httpclient.js.map +1 -1
  340. package/build/npm/esm/prod/integrations/httpcontext.js +7 -17
  341. package/build/npm/esm/prod/integrations/httpcontext.js.map +1 -1
  342. package/build/npm/esm/prod/integrations/linkederrors.js +7 -15
  343. package/build/npm/esm/prod/integrations/linkederrors.js.map +1 -1
  344. package/build/npm/esm/prod/integrations/reportingobserver.js +19 -44
  345. package/build/npm/esm/prod/integrations/reportingobserver.js.map +1 -1
  346. package/build/npm/esm/prod/integrations/spanstreaming.js +11 -29
  347. package/build/npm/esm/prod/integrations/spanstreaming.js.map +1 -1
  348. package/build/npm/esm/prod/integrations/spotlight.js +17 -30
  349. package/build/npm/esm/prod/integrations/spotlight.js.map +1 -1
  350. package/build/npm/esm/prod/integrations/view-hierarchy.js +19 -46
  351. package/build/npm/esm/prod/integrations/view-hierarchy.js.map +1 -1
  352. package/build/npm/esm/prod/integrations/webWorker.js +40 -211
  353. package/build/npm/esm/prod/integrations/webWorker.js.map +1 -1
  354. package/build/npm/esm/prod/package.json +1 -1
  355. package/build/npm/esm/prod/profiling/UIProfiler.js +87 -190
  356. package/build/npm/esm/prod/profiling/UIProfiler.js.map +1 -1
  357. package/build/npm/esm/prod/profiling/index.js +9 -30
  358. package/build/npm/esm/prod/profiling/index.js.map +1 -1
  359. package/build/npm/esm/prod/profiling/integration.js +30 -64
  360. package/build/npm/esm/prod/profiling/integration.js.map +1 -1
  361. package/build/npm/esm/prod/profiling/startProfileForSpan.js +28 -84
  362. package/build/npm/esm/prod/profiling/startProfileForSpan.js.map +1 -1
  363. package/build/npm/esm/prod/profiling/utils.js +131 -398
  364. package/build/npm/esm/prod/profiling/utils.js.map +1 -1
  365. package/build/npm/esm/prod/report-dialog.js +10 -25
  366. package/build/npm/esm/prod/report-dialog.js.map +1 -1
  367. package/build/npm/esm/prod/sdk.js +5 -73
  368. package/build/npm/esm/prod/sdk.js.map +1 -1
  369. package/build/npm/esm/prod/stack-parsers.js +42 -126
  370. package/build/npm/esm/prod/stack-parsers.js.map +1 -1
  371. package/build/npm/esm/prod/tracing/backgroundtab.js +4 -16
  372. package/build/npm/esm/prod/tracing/backgroundtab.js.map +1 -1
  373. package/build/npm/esm/prod/tracing/browserTracingIntegration.js +102 -291
  374. package/build/npm/esm/prod/tracing/browserTracingIntegration.js.map +1 -1
  375. package/build/npm/esm/prod/tracing/linkedTraces.js +25 -117
  376. package/build/npm/esm/prod/tracing/linkedTraces.js.map +1 -1
  377. package/build/npm/esm/prod/tracing/reportPageLoaded.js +1 -9
  378. package/build/npm/esm/prod/tracing/reportPageLoaded.js.map +1 -1
  379. package/build/npm/esm/prod/tracing/request.js +59 -224
  380. package/build/npm/esm/prod/tracing/request.js.map +1 -1
  381. package/build/npm/esm/prod/tracing/setActiveSpan.js +1 -48
  382. package/build/npm/esm/prod/tracing/setActiveSpan.js.map +1 -1
  383. package/build/npm/esm/prod/tracing/utils.js +4 -27
  384. package/build/npm/esm/prod/tracing/utils.js.map +1 -1
  385. package/build/npm/esm/prod/transports/fetch.js +10 -23
  386. package/build/npm/esm/prod/transports/fetch.js.map +1 -1
  387. package/build/npm/esm/prod/transports/offline.js +27 -84
  388. package/build/npm/esm/prod/transports/offline.js.map +1 -1
  389. package/build/npm/esm/prod/userfeedback.js +12 -22
  390. package/build/npm/esm/prod/userfeedback.js.map +1 -1
  391. package/build/npm/esm/prod/utils/detectBrowserExtension.js +5 -26
  392. package/build/npm/esm/prod/utils/detectBrowserExtension.js.map +1 -1
  393. package/build/npm/esm/prod/utils/lazyLoadIntegration.js +40 -75
  394. package/build/npm/esm/prod/utils/lazyLoadIntegration.js.map +1 -1
  395. package/build/npm/types/eventbuilder.d.ts.map +1 -1
  396. package/build/npm/types/helpers.d.ts.map +1 -1
  397. package/build/npm/types/index.bundle.d.ts +2 -2
  398. package/build/npm/types/index.bundle.d.ts.map +1 -1
  399. package/build/npm/types/index.bundle.feedback.d.ts +2 -2
  400. package/build/npm/types/index.bundle.feedback.d.ts.map +1 -1
  401. package/build/npm/types/index.bundle.logs.metrics.d.ts +2 -2
  402. package/build/npm/types/index.bundle.logs.metrics.d.ts.map +1 -1
  403. package/build/npm/types/index.bundle.replay.d.ts +2 -2
  404. package/build/npm/types/index.bundle.replay.d.ts.map +1 -1
  405. package/build/npm/types/index.bundle.replay.feedback.d.ts +2 -2
  406. package/build/npm/types/index.bundle.replay.feedback.d.ts.map +1 -1
  407. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts +2 -2
  408. package/build/npm/types/index.bundle.replay.logs.metrics.d.ts.map +1 -1
  409. package/build/npm/types/index.bundle.tracing.d.ts +1 -0
  410. package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
  411. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts +1 -0
  412. package/build/npm/types/index.bundle.tracing.logs.metrics.d.ts.map +1 -1
  413. package/build/npm/types/index.bundle.tracing.replay.d.ts +1 -0
  414. package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
  415. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +1 -0
  416. package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
  417. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -0
  418. package/build/npm/types/index.bundle.tracing.replay.feedback.logs.metrics.d.ts.map +1 -1
  419. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts +1 -0
  420. package/build/npm/types/index.bundle.tracing.replay.logs.metrics.d.ts.map +1 -1
  421. package/build/npm/types/index.d.ts +1 -0
  422. package/build/npm/types/index.d.ts.map +1 -1
  423. package/build/npm/types/integrations/fetchStreamPerformance.d.ts +14 -0
  424. package/build/npm/types/integrations/fetchStreamPerformance.d.ts.map +1 -0
  425. package/build/npm/types/tracing/browserTracingIntegration.d.ts +3 -0
  426. package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
  427. package/build/npm/types/tracing/request.d.ts +3 -0
  428. package/build/npm/types/tracing/request.d.ts.map +1 -1
  429. package/build/npm/types-ts3.8/index.bundle.d.ts +2 -2
  430. package/build/npm/types-ts3.8/index.bundle.feedback.d.ts +2 -2
  431. package/build/npm/types-ts3.8/index.bundle.logs.metrics.d.ts +2 -2
  432. package/build/npm/types-ts3.8/index.bundle.replay.d.ts +2 -2
  433. package/build/npm/types-ts3.8/index.bundle.replay.feedback.d.ts +2 -2
  434. package/build/npm/types-ts3.8/index.bundle.replay.logs.metrics.d.ts +2 -2
  435. package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -0
  436. package/build/npm/types-ts3.8/index.bundle.tracing.logs.metrics.d.ts +1 -0
  437. package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -0
  438. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -0
  439. package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.logs.metrics.d.ts +1 -0
  440. package/build/npm/types-ts3.8/index.bundle.tracing.replay.logs.metrics.d.ts +1 -0
  441. package/build/npm/types-ts3.8/index.d.ts +1 -0
  442. package/build/npm/types-ts3.8/integrations/fetchStreamPerformance.d.ts +14 -0
  443. package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +3 -0
  444. package/build/npm/types-ts3.8/tracing/request.d.ts +3 -0
  445. package/package.json +7 -7
@@ -2,28 +2,20 @@ import { TRACING_DEFAULTS, consoleSandbox, getLocationHref, browserPerformanceTi
2
2
  import { addHistoryInstrumentationHandler, registerInpInteractionListener, startTrackingWebVitals, trackLcpAsSpan, trackClsAsSpan, trackInpAsSpan, startTrackingINP, startTrackingLongAnimationFrames, startTrackingLongTasks, startTrackingInteractions, addPerformanceEntries } from '@sentry-internal/browser-utils';
3
3
  import { DEBUG_BUILD } from '../debug-build.js';
4
4
  import { WINDOW, getHttpRequestData } from '../helpers.js';
5
+ import { fetchStreamPerformanceIntegration } from '../integrations/fetchStreamPerformance.js';
5
6
  import { registerBackgroundTabDetection } from './backgroundtab.js';
6
7
  import { linkTraces } from './linkedTraces.js';
7
8
  import { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './request.js';
8
9
 
9
- const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing';
10
-
11
- /**
12
- * We don't want to start a bunch of idle timers and PerformanceObservers
13
- * for web crawlers, as they may prevent the page from being seen as "idle"
14
- * by the crawler's rendering engine (e.g. Googlebot's headless Chromium).
15
- */
16
- const BOT_USER_AGENT_RE =
17
- /Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;
18
-
10
+ const BROWSER_TRACING_INTEGRATION_ID = "BrowserTracing";
11
+ const BOT_USER_AGENT_RE = /Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;
19
12
  function isBotUserAgent() {
20
- const nav = WINDOW.navigator ;
13
+ const nav = WINDOW.navigator;
21
14
  if (!nav?.userAgent) {
22
15
  return false;
23
16
  }
24
17
  return BOT_USER_AGENT_RE.test(nav.userAgent);
25
18
  }
26
-
27
19
  const DEFAULT_BROWSER_TRACING_OPTIONS = {
28
20
  ...TRACING_DEFAULTS,
29
21
  instrumentNavigation: true,
@@ -35,43 +27,25 @@ const DEFAULT_BROWSER_TRACING_OPTIONS = {
35
27
  ignoreResourceSpans: [],
36
28
  ignorePerformanceApiSpans: [],
37
29
  detectRedirects: true,
38
- linkPreviousTrace: 'in-memory',
30
+ linkPreviousTrace: "in-memory",
39
31
  consistentTraceSampling: false,
40
32
  enableReportPageLoaded: false,
41
33
  _experiments: {},
42
- ...defaultRequestInstrumentationOptions,
34
+ ...defaultRequestInstrumentationOptions
43
35
  };
44
-
45
- /**
46
- * The Browser Tracing integration automatically instruments browser pageload/navigation
47
- * actions as transactions, and captures requests, metrics and errors as spans.
48
- *
49
- * The integration can be configured with a variety of options, and can be extended to use
50
- * any routing library.
51
- *
52
- * We explicitly export the proper type here, as this has to be extended in some cases.
53
- */
54
36
  const browserTracingIntegration = ((options = {}) => {
55
- if ('enableElementTiming' in options) {
37
+ if ("enableElementTiming" in options) {
56
38
  consoleSandbox(() => {
57
- // oxlint-disable-next-line no-console
58
39
  console.warn(
59
- '[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.',
40
+ "[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead."
60
41
  );
61
42
  });
62
43
  }
63
-
64
44
  const latestRoute = {
65
- name: undefined,
66
- source: undefined,
45
+ name: void 0,
46
+ source: void 0
67
47
  };
68
-
69
- /**
70
- * This is just a small wrapper that makes `document` optional.
71
- * We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
72
- */
73
- const optionalWindowDocument = WINDOW.document ;
74
-
48
+ const optionalWindowDocument = WINDOW.document;
75
49
  const {
76
50
  enableInp,
77
51
  enableLongTask,
@@ -96,59 +70,41 @@ const browserTracingIntegration = ((options = {}) => {
96
70
  consistentTraceSampling,
97
71
  enableReportPageLoaded,
98
72
  onRequestSpanStart,
99
- onRequestSpanEnd,
73
+ onRequestSpanEnd
100
74
  } = {
101
75
  ...DEFAULT_BROWSER_TRACING_OPTIONS,
102
- ...options,
76
+ ...options
103
77
  };
104
-
105
78
  const _isBot = isBotUserAgent();
106
-
107
79
  let _collectWebVitals;
108
80
  let lastInteractionTimestamp;
109
-
110
81
  let _pageloadSpan;
111
-
112
- /** Create routing idle transaction. */
113
82
  function _createRouteSpan(client, startSpanOptions, makeActive = true) {
114
- const isPageloadSpan = startSpanOptions.op === 'pageload';
115
-
83
+ const isPageloadSpan = startSpanOptions.op === "pageload";
116
84
  const initialSpanName = startSpanOptions.name;
117
- const finalStartSpanOptions = beforeStartSpan
118
- ? beforeStartSpan(startSpanOptions)
119
- : startSpanOptions;
120
-
85
+ const finalStartSpanOptions = beforeStartSpan ? beforeStartSpan(startSpanOptions) : startSpanOptions;
121
86
  const attributes = finalStartSpanOptions.attributes || {};
122
-
123
- // If `finalStartSpanOptions.name` is different than `startSpanOptions.name`
124
- // it is because `beforeStartSpan` set a custom name. Therefore we set the source to 'custom'.
125
87
  if (initialSpanName !== finalStartSpanOptions.name) {
126
- attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = 'custom';
88
+ attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = "custom";
127
89
  finalStartSpanOptions.attributes = attributes;
128
90
  }
129
-
130
91
  if (!makeActive) {
131
- // We want to ensure this has 0s duration
132
92
  const now = dateTimestampInSeconds();
133
93
  startInactiveSpan({
134
94
  ...finalStartSpanOptions,
135
- startTime: now,
95
+ startTime: now
136
96
  }).end(now);
137
97
  return;
138
98
  }
139
-
140
99
  latestRoute.name = finalStartSpanOptions.name;
141
100
  latestRoute.source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];
142
-
143
101
  const idleSpan = startIdleSpan(finalStartSpanOptions, {
144
102
  idleTimeout,
145
103
  finalTimeout,
146
104
  childSpanTimeout,
147
105
  // should wait for finish signal if it's a pageload transaction
148
106
  disableAutoFinish: isPageloadSpan,
149
- beforeSpanEnd: span => {
150
- // This will generally always be defined here, because it is set in `setup()` of the integration
151
- // but technically, it is optional, so we guard here to be extra safe
107
+ beforeSpanEnd: (span) => {
152
108
  _collectWebVitals?.();
153
109
  const spanStreamingEnabled = hasSpanStreamingEnabled(client);
154
110
  addPerformanceEntries(span, {
@@ -156,71 +112,53 @@ const browserTracingIntegration = ((options = {}) => {
156
112
  recordLcpOnPageloadSpan: !spanStreamingEnabled && !enableStandaloneLcpSpans,
157
113
  ignoreResourceSpans,
158
114
  ignorePerformanceApiSpans,
159
- spanStreamingEnabled,
115
+ spanStreamingEnabled
160
116
  });
161
- setActiveIdleSpan(client, undefined);
162
-
163
- // A trace should stay consistent over the entire timespan of one route - even after the pageload/navigation ended.
164
- // Only when another navigation happens, we want to create a new trace.
165
- // This way, e.g. errors that occur after the pageload span ended are still associated to the pageload trace.
117
+ setActiveIdleSpan(client, void 0);
166
118
  const scope = getCurrentScope();
167
119
  const oldPropagationContext = scope.getPropagationContext();
168
-
169
120
  scope.setPropagationContext({
170
121
  ...oldPropagationContext,
171
122
  traceId: idleSpan.spanContext().traceId,
172
123
  sampled: spanIsSampled(idleSpan),
173
- dsc: getDynamicSamplingContextFromSpan(span),
124
+ dsc: getDynamicSamplingContextFromSpan(span)
174
125
  });
175
-
176
126
  if (isPageloadSpan) {
177
- // clean up the stored pageload span on the intergration.
178
- _pageloadSpan = undefined;
127
+ _pageloadSpan = void 0;
179
128
  }
180
129
  },
181
- trimIdleSpanEndTimestamp: !enableReportPageLoaded,
130
+ trimIdleSpanEndTimestamp: !enableReportPageLoaded
182
131
  });
183
-
184
132
  if (isPageloadSpan && enableReportPageLoaded) {
185
133
  _pageloadSpan = idleSpan;
186
134
  }
187
-
188
135
  setActiveIdleSpan(client, idleSpan);
189
-
190
136
  function emitFinish() {
191
- if (optionalWindowDocument && ['interactive', 'complete'].includes(optionalWindowDocument.readyState)) {
192
- client.emit('idleSpanEnableAutoFinish', idleSpan);
137
+ if (optionalWindowDocument && ["interactive", "complete"].includes(optionalWindowDocument.readyState)) {
138
+ client.emit("idleSpanEnableAutoFinish", idleSpan);
193
139
  }
194
140
  }
195
-
196
- // Enable auto finish of the pageload span if users are not explicitly ending it
197
141
  if (isPageloadSpan && !enableReportPageLoaded && optionalWindowDocument) {
198
- optionalWindowDocument.addEventListener('readystatechange', () => {
142
+ optionalWindowDocument.addEventListener("readystatechange", () => {
199
143
  emitFinish();
200
144
  });
201
-
202
145
  emitFinish();
203
146
  }
204
147
  }
205
-
206
148
  return {
207
149
  name: BROWSER_TRACING_INTEGRATION_ID,
208
150
  setup(client) {
209
151
  if (_isBot) {
210
- DEBUG_BUILD && debug.log('[Tracing] Skipping browserTracingIntegration setup for bot user agent.');
152
+ DEBUG_BUILD && debug.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");
211
153
  return;
212
154
  }
213
-
214
155
  registerSpanErrorInstrumentation();
215
-
216
156
  const spanStreamingEnabled = hasSpanStreamingEnabled(client);
217
-
218
157
  _collectWebVitals = startTrackingWebVitals({
219
- recordClsStandaloneSpans: spanStreamingEnabled ? undefined : enableStandaloneClsSpans || false,
220
- recordLcpStandaloneSpans: spanStreamingEnabled ? undefined : enableStandaloneLcpSpans || false,
221
- client,
158
+ recordClsStandaloneSpans: spanStreamingEnabled ? void 0 : enableStandaloneClsSpans || false,
159
+ recordLcpStandaloneSpans: spanStreamingEnabled ? void 0 : enableStandaloneLcpSpans || false,
160
+ client
222
161
  });
223
-
224
162
  if (spanStreamingEnabled) {
225
163
  trackLcpAsSpan(client);
226
164
  trackClsAsSpan(client);
@@ -230,387 +168,260 @@ const browserTracingIntegration = ((options = {}) => {
230
168
  } else if (enableInp) {
231
169
  startTrackingINP();
232
170
  }
233
-
234
- if (
235
- enableLongAnimationFrame &&
236
- GLOBAL_OBJ.PerformanceObserver &&
237
- PerformanceObserver.supportedEntryTypes?.includes('long-animation-frame')
238
- ) {
171
+ if (enableLongAnimationFrame && GLOBAL_OBJ.PerformanceObserver && PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")) {
239
172
  startTrackingLongAnimationFrames();
240
173
  } else if (enableLongTask) {
241
174
  startTrackingLongTasks();
242
175
  }
243
-
244
176
  if (enableInteractions) {
245
177
  startTrackingInteractions();
246
178
  }
247
-
248
179
  if (detectRedirects && optionalWindowDocument) {
249
180
  const interactionHandler = () => {
250
181
  lastInteractionTimestamp = timestampInSeconds();
251
182
  };
252
- addEventListener('click', interactionHandler, { capture: true });
253
- addEventListener('keydown', interactionHandler, { capture: true, passive: true });
183
+ addEventListener("click", interactionHandler, { capture: true });
184
+ addEventListener("keydown", interactionHandler, { capture: true, passive: true });
254
185
  }
255
-
256
186
  function maybeEndActiveSpan() {
257
187
  const activeSpan = getActiveIdleSpan(client);
258
-
259
188
  if (activeSpan && !spanToJSON(activeSpan).timestamp) {
260
189
  DEBUG_BUILD && debug.log(`[Tracing] Finishing current active span with op: ${spanToJSON(activeSpan).op}`);
261
- // If there's an open active span, we need to finish it before creating an new one.
262
- activeSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, 'cancelled');
190
+ activeSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "cancelled");
263
191
  activeSpan.end();
264
192
  }
265
193
  }
266
-
267
- client.on('startNavigationSpan', (startSpanOptions, navigationOptions) => {
194
+ client.on("startNavigationSpan", (startSpanOptions, navigationOptions) => {
268
195
  if (getClient() !== client) {
269
196
  return;
270
197
  }
271
-
272
198
  if (navigationOptions?.isRedirect) {
273
- DEBUG_BUILD &&
274
- debug.warn('[Tracing] Detected redirect, navigation span will not be the root span, but a child span.');
199
+ DEBUG_BUILD && debug.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span.");
275
200
  _createRouteSpan(
276
201
  client,
277
202
  {
278
- op: 'navigation.redirect',
279
- ...startSpanOptions,
203
+ op: "navigation.redirect",
204
+ ...startSpanOptions
280
205
  },
281
- false,
206
+ false
282
207
  );
283
208
  return;
284
209
  }
285
-
286
- // Reset the last interaction timestamp since we now start a new navigation.
287
- // Any subsequent navigation span starts could again be a redirect, so we
288
- // should reset our heuristic detectors.
289
- lastInteractionTimestamp = undefined;
290
-
210
+ lastInteractionTimestamp = void 0;
291
211
  maybeEndActiveSpan();
292
-
293
212
  getIsolationScope().setPropagationContext({
294
213
  traceId: generateTraceId(),
295
214
  sampleRand: Math.random(),
296
- propagationSpanId: hasSpansEnabled() ? undefined : generateSpanId(),
215
+ propagationSpanId: hasSpansEnabled() ? void 0 : generateSpanId()
297
216
  });
298
-
299
217
  const scope = getCurrentScope();
300
218
  scope.setPropagationContext({
301
219
  traceId: generateTraceId(),
302
220
  sampleRand: Math.random(),
303
- propagationSpanId: hasSpansEnabled() ? undefined : generateSpanId(),
221
+ propagationSpanId: hasSpansEnabled() ? void 0 : generateSpanId()
304
222
  });
305
-
306
- // We reset this to ensure we do not have lingering incorrect data here
307
- // places that call this hook may set this where appropriate - else, the URL at span sending time is used
308
223
  scope.setSDKProcessingMetadata({
309
- normalizedRequest: undefined,
224
+ normalizedRequest: void 0
310
225
  });
311
-
312
226
  _createRouteSpan(client, {
313
- op: 'navigation',
227
+ op: "navigation",
314
228
  ...startSpanOptions,
315
229
  // Navigation starts a new trace and is NOT parented under any active interaction (e.g. ui.action.click)
316
230
  parentSpan: null,
317
- forceTransaction: true,
231
+ forceTransaction: true
318
232
  });
319
233
  });
320
-
321
- client.on('startPageLoadSpan', (startSpanOptions, traceOptions = {}) => {
234
+ client.on("startPageLoadSpan", (startSpanOptions, traceOptions = {}) => {
322
235
  if (getClient() !== client) {
323
236
  return;
324
237
  }
325
238
  maybeEndActiveSpan();
326
-
327
- const sentryTrace =
328
- traceOptions.sentryTrace || getMetaContent('sentry-trace') || getServerTiming('sentry-trace');
329
- const baggage = traceOptions.baggage || getMetaContent('baggage') || getServerTiming('baggage');
330
-
239
+ const sentryTrace = traceOptions.sentryTrace || getMetaContent("sentry-trace") || getServerTiming("sentry-trace");
240
+ const baggage = traceOptions.baggage || getMetaContent("baggage") || getServerTiming("baggage");
331
241
  const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);
332
-
333
242
  const scope = getCurrentScope();
334
243
  scope.setPropagationContext(propagationContext);
335
244
  if (!hasSpansEnabled()) {
336
- // for browser, we wanna keep the spanIds consistent during the entire lifetime of the trace
337
- // this works by setting the propagationSpanId to a random spanId so that we have a consistent
338
- // span id to propagate in TwP mode (!hasSpansEnabled())
339
245
  scope.getPropagationContext().propagationSpanId = generateSpanId();
340
246
  }
341
-
342
- // We store the normalized request data on the scope, so we get the request data at time of span creation
343
- // otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL
344
247
  scope.setSDKProcessingMetadata({
345
- normalizedRequest: getHttpRequestData(),
248
+ normalizedRequest: getHttpRequestData()
346
249
  });
347
-
348
250
  _createRouteSpan(client, {
349
- op: 'pageload',
350
- ...startSpanOptions,
251
+ op: "pageload",
252
+ ...startSpanOptions
351
253
  });
352
254
  });
353
-
354
- client.on('endPageloadSpan', () => {
255
+ client.on("endPageloadSpan", () => {
355
256
  if (enableReportPageLoaded && _pageloadSpan) {
356
- _pageloadSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, 'reportPageLoaded');
257
+ _pageloadSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "reportPageLoaded");
357
258
  _pageloadSpan.end();
358
259
  }
359
260
  });
360
261
  },
361
-
362
262
  afterAllSetup(client) {
363
263
  if (_isBot) {
364
264
  return;
365
265
  }
366
-
367
266
  let startingUrl = getLocationHref();
368
-
369
- if (linkPreviousTrace !== 'off') {
267
+ if (linkPreviousTrace !== "off") {
370
268
  linkTraces(client, { linkPreviousTrace, consistentTraceSampling });
371
269
  }
372
-
373
270
  if (WINDOW.location) {
374
271
  if (instrumentPageLoad) {
375
272
  const origin = browserPerformanceTimeOrigin();
376
273
  startBrowserTracingPageLoadSpan(client, {
377
274
  name: WINDOW.location.pathname,
378
275
  // pageload should always start at timeOrigin (and needs to be in s, not ms)
379
- startTime: origin ? origin / 1000 : undefined,
276
+ startTime: origin ? origin / 1e3 : void 0,
380
277
  attributes: {
381
- [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
382
- [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser',
383
- },
278
+ [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url",
279
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.pageload.browser"
280
+ }
384
281
  });
385
282
  }
386
-
387
283
  if (instrumentNavigation) {
388
284
  addHistoryInstrumentationHandler(({ to, from }) => {
389
- /**
390
- * This early return is there to account for some cases where a navigation transaction starts right after
391
- * long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't
392
- * create an uneccessary navigation transaction.
393
- *
394
- * This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also
395
- * only be caused in certain development environments where the usage of a hot module reloader is causing
396
- * errors.
397
- */
398
- if (from === undefined && startingUrl?.indexOf(to) !== -1) {
399
- startingUrl = undefined;
285
+ if (from === void 0 && startingUrl?.indexOf(to) !== -1) {
286
+ startingUrl = void 0;
400
287
  return;
401
288
  }
402
-
403
- startingUrl = undefined;
289
+ startingUrl = void 0;
404
290
  const parsed = parseStringToURLObject(to);
405
291
  const activeSpan = getActiveIdleSpan(client);
406
- const navigationIsRedirect =
407
- activeSpan && detectRedirects && isRedirect(activeSpan, lastInteractionTimestamp);
408
-
292
+ const navigationIsRedirect = activeSpan && detectRedirects && isRedirect(activeSpan, lastInteractionTimestamp);
409
293
  startBrowserTracingNavigationSpan(
410
294
  client,
411
295
  {
412
296
  name: parsed?.pathname || WINDOW.location.pathname,
413
297
  attributes: {
414
- [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
415
- [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser',
416
- },
298
+ [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "url",
299
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.navigation.browser"
300
+ }
417
301
  },
418
- { url: to, isRedirect: navigationIsRedirect },
302
+ { url: to, isRedirect: navigationIsRedirect }
419
303
  );
420
304
  });
421
305
  }
422
306
  }
423
-
424
307
  if (markBackgroundSpan) {
425
308
  registerBackgroundTabDetection();
426
309
  }
427
-
428
310
  if (enableInteractions) {
429
311
  registerInteractionListener(client, idleTimeout, finalTimeout, childSpanTimeout, latestRoute);
430
312
  }
431
-
432
313
  if (enableInp) {
433
314
  registerInpInteractionListener();
434
315
  }
435
-
436
316
  instrumentOutgoingRequests(client, {
437
317
  traceFetch,
438
318
  traceXHR,
439
- trackFetchStreamPerformance,
440
319
  tracePropagationTargets: client.getOptions().tracePropagationTargets,
441
320
  shouldCreateSpanForRequest,
442
321
  enableHTTPTimings,
443
322
  onRequestSpanStart,
444
- onRequestSpanEnd,
323
+ onRequestSpanEnd
445
324
  });
446
- },
325
+ if (trackFetchStreamPerformance) {
326
+ client.addIntegration(fetchStreamPerformanceIntegration());
327
+ }
328
+ }
447
329
  };
448
- }) ;
449
-
450
- /**
451
- * Manually start a page load span.
452
- * This will only do something if a browser tracing integration integration has been setup.
453
- *
454
- * If you provide a custom `traceOptions` object, it will be used to continue the trace
455
- * instead of the default behavior, which is to look it up on the <meta> tags.
456
- */
457
- function startBrowserTracingPageLoadSpan(
458
- client,
459
- spanOptions,
460
- traceOptions,
461
- ) {
462
- client.emit('startPageLoadSpan', spanOptions, traceOptions);
330
+ });
331
+ function startBrowserTracingPageLoadSpan(client, spanOptions, traceOptions) {
332
+ client.emit("startPageLoadSpan", spanOptions, traceOptions);
463
333
  getCurrentScope().setTransactionName(spanOptions.name);
464
-
465
334
  const pageloadSpan = getActiveIdleSpan(client);
466
-
467
335
  if (pageloadSpan) {
468
- client.emit('afterStartPageLoadSpan', pageloadSpan);
336
+ client.emit("afterStartPageLoadSpan", pageloadSpan);
469
337
  }
470
-
471
338
  return pageloadSpan;
472
339
  }
473
-
474
- /**
475
- * Manually start a navigation span.
476
- * This will only do something if a browser tracing integration has been setup.
477
- */
478
- function startBrowserTracingNavigationSpan(
479
- client,
480
- spanOptions,
481
- options,
482
- ) {
483
- const { url, isRedirect } = options || {};
484
- client.emit('beforeStartNavigationSpan', spanOptions, { isRedirect });
485
- client.emit('startNavigationSpan', spanOptions, { isRedirect });
486
-
340
+ function startBrowserTracingNavigationSpan(client, spanOptions, options) {
341
+ const { url, isRedirect: isRedirect2 } = options || {};
342
+ client.emit("beforeStartNavigationSpan", spanOptions, { isRedirect: isRedirect2 });
343
+ client.emit("startNavigationSpan", spanOptions, { isRedirect: isRedirect2 });
487
344
  const scope = getCurrentScope();
488
345
  scope.setTransactionName(spanOptions.name);
489
-
490
- // We store the normalized request data on the scope, so we get the request data at time of span creation
491
- // otherwise, the URL etc. may already be of the following navigation, and we'd report the wrong URL
492
- if (url && !isRedirect) {
346
+ if (url && !isRedirect2) {
493
347
  scope.setSDKProcessingMetadata({
494
348
  normalizedRequest: {
495
349
  ...getHttpRequestData(),
496
- url,
497
- },
350
+ url
351
+ }
498
352
  });
499
353
  }
500
-
501
354
  return getActiveIdleSpan(client);
502
355
  }
503
-
504
- /** Returns the value of a meta tag */
505
356
  function getMetaContent(metaName) {
506
- /**
507
- * This is just a small wrapper that makes `document` optional.
508
- * We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
509
- */
510
- const optionalWindowDocument = WINDOW.document ;
511
-
357
+ const optionalWindowDocument = WINDOW.document;
512
358
  const metaTag = optionalWindowDocument?.querySelector(`meta[name=${metaName}]`);
513
- return metaTag?.getAttribute('content') || undefined;
359
+ return metaTag?.getAttribute("content") || void 0;
514
360
  }
515
-
516
- /** Returns the description of a server timing entry */
517
361
  function getServerTiming(name) {
518
- const navigation = WINDOW.performance?.getEntriesByType?.('navigation')[0] ;
519
- const entry = navigation?.serverTiming?.find(entry => entry.name === name);
362
+ const navigation = WINDOW.performance?.getEntriesByType?.("navigation")[0];
363
+ const entry = navigation?.serverTiming?.find((entry2) => entry2.name === name);
520
364
  return entry?.description;
521
365
  }
522
-
523
- /** Start listener for interaction transactions */
524
- function registerInteractionListener(
525
- client,
526
- idleTimeout,
527
- finalTimeout,
528
- childSpanTimeout,
529
- latestRoute,
530
- ) {
531
- /**
532
- * This is just a small wrapper that makes `document` optional.
533
- * We want to be extra-safe and always check that this exists, to ensure weird environments do not blow up.
534
- */
535
- const optionalWindowDocument = WINDOW.document ;
536
-
366
+ function registerInteractionListener(client, idleTimeout, finalTimeout, childSpanTimeout, latestRoute) {
367
+ const optionalWindowDocument = WINDOW.document;
537
368
  let inflightInteractionSpan;
538
369
  const registerInteractionTransaction = () => {
539
- const op = 'ui.action.click';
540
-
370
+ const op = "ui.action.click";
541
371
  const activeIdleSpan = getActiveIdleSpan(client);
542
372
  if (activeIdleSpan) {
543
373
  const currentRootSpanOp = spanToJSON(activeIdleSpan).op;
544
- if (['navigation', 'pageload'].includes(currentRootSpanOp )) {
545
- DEBUG_BUILD &&
546
- debug.warn(`[Tracing] Did not create ${op} span because a pageload or navigation span is in progress.`);
547
- return undefined;
374
+ if (["navigation", "pageload"].includes(currentRootSpanOp)) {
375
+ DEBUG_BUILD && debug.warn(`[Tracing] Did not create ${op} span because a pageload or navigation span is in progress.`);
376
+ return void 0;
548
377
  }
549
378
  }
550
-
551
379
  if (inflightInteractionSpan) {
552
- inflightInteractionSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, 'interactionInterrupted');
380
+ inflightInteractionSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, "interactionInterrupted");
553
381
  inflightInteractionSpan.end();
554
- inflightInteractionSpan = undefined;
382
+ inflightInteractionSpan = void 0;
555
383
  }
556
-
557
384
  if (!latestRoute.name) {
558
385
  DEBUG_BUILD && debug.warn(`[Tracing] Did not create ${op} transaction because _latestRouteName is missing.`);
559
- return undefined;
386
+ return void 0;
560
387
  }
561
-
562
388
  inflightInteractionSpan = startIdleSpan(
563
389
  {
564
390
  name: latestRoute.name,
565
391
  op,
566
392
  attributes: {
567
- [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || 'url',
568
- },
393
+ [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: latestRoute.source || "url"
394
+ }
569
395
  },
570
396
  {
571
397
  idleTimeout,
572
398
  finalTimeout,
573
- childSpanTimeout,
574
- },
399
+ childSpanTimeout
400
+ }
575
401
  );
576
402
  };
577
-
578
403
  if (optionalWindowDocument) {
579
- addEventListener('click', registerInteractionTransaction, { capture: true });
404
+ addEventListener("click", registerInteractionTransaction, { capture: true });
580
405
  }
581
406
  }
582
-
583
- // We store the active idle span on the client object, so we can access it from exported functions
584
- const ACTIVE_IDLE_SPAN_PROPERTY = '_sentry_idleSpan';
407
+ const ACTIVE_IDLE_SPAN_PROPERTY = "_sentry_idleSpan";
585
408
  function getActiveIdleSpan(client) {
586
- return (client )[ACTIVE_IDLE_SPAN_PROPERTY];
409
+ return client[ACTIVE_IDLE_SPAN_PROPERTY];
587
410
  }
588
-
589
411
  function setActiveIdleSpan(client, span) {
590
412
  addNonEnumerableProperty(client, ACTIVE_IDLE_SPAN_PROPERTY, span);
591
413
  }
592
-
593
- // The max. time in seconds between two pageload/navigation spans that makes us consider the second one a redirect
594
414
  const REDIRECT_THRESHOLD = 1.5;
595
-
596
415
  function isRedirect(activeSpan, lastInteractionTimestamp) {
597
416
  const spanData = spanToJSON(activeSpan);
598
-
599
417
  const now = dateTimestampInSeconds();
600
-
601
- // More than REDIRECT_THRESHOLD seconds since last navigation/pageload span?
602
- // --> never consider this a redirect
603
418
  const startTimestamp = spanData.start_timestamp;
604
419
  if (now - startTimestamp > REDIRECT_THRESHOLD) {
605
420
  return false;
606
421
  }
607
-
608
- // A click happened in the last REDIRECT_THRESHOLD seconds?
609
- // --> never consider this a redirect
610
422
  if (lastInteractionTimestamp && now - lastInteractionTimestamp <= REDIRECT_THRESHOLD) {
611
423
  return false;
612
424
  }
613
-
614
425
  return true;
615
426
  }
616
427