@utk09/ui-observability 0.11.0 → 1.0.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 (557) hide show
  1. package/CHANGELOG.md +481 -0
  2. package/README.md +73 -669
  3. package/bin/uiobs.mjs +1 -1
  4. package/dist/{batch-CL9uWYY3.js → batch-CXmPmTse.js} +3 -3
  5. package/dist/batch-CXmPmTse.js.map +1 -0
  6. package/dist/{batch-C8OcWR2L.cjs → batch-mmPigCpi.cjs} +2 -2
  7. package/dist/batch-mmPigCpi.cjs.map +1 -0
  8. package/dist/bus/bus.d.cts +331 -0
  9. package/dist/bus/bus.d.ts +108 -57
  10. package/dist/bus/links.d.cts +132 -0
  11. package/dist/bus/links.d.ts +22 -7
  12. package/dist/bus/validation.d.cts +16 -0
  13. package/dist/bus/validation.d.ts +11 -2
  14. package/dist/bus-C39wspFV.js +775 -0
  15. package/dist/bus-C39wspFV.js.map +1 -0
  16. package/dist/bus-_EaOVPGq.cjs +2 -0
  17. package/dist/bus-_EaOVPGq.cjs.map +1 -0
  18. package/dist/capture/console.d.cts +37 -0
  19. package/dist/capture/console.d.ts +11 -11
  20. package/dist/capture/errors.d.cts +32 -0
  21. package/dist/capture/errors.d.ts +7 -7
  22. package/dist/capture/interactions.d.cts +48 -0
  23. package/dist/capture/interactions.d.ts +15 -15
  24. package/dist/capture/lifecycle.d.cts +20 -0
  25. package/dist/capture/lifecycle.d.ts +4 -4
  26. package/dist/capture/long-frames.d.cts +31 -0
  27. package/dist/capture/long-frames.d.ts +7 -7
  28. package/dist/capture/network.d.cts +57 -0
  29. package/dist/capture/network.d.ts +18 -18
  30. package/dist/capture/profiler-frames.d.cts +44 -0
  31. package/dist/capture/profiler-frames.d.ts +44 -0
  32. package/dist/capture/replay-buffer.d.cts +45 -0
  33. package/dist/capture/replay-buffer.d.ts +45 -0
  34. package/dist/capture/replay-upload.d.cts +79 -0
  35. package/dist/capture/replay-upload.d.ts +79 -0
  36. package/dist/capture/replay.d.cts +114 -0
  37. package/dist/capture/replay.d.ts +114 -0
  38. package/dist/capture/reports.d.cts +17 -0
  39. package/dist/capture/reports.d.ts +3 -3
  40. package/dist/capture/resource-timing.d.cts +14 -0
  41. package/dist/capture/resource-timing.d.ts +2 -2
  42. package/dist/capture/server-timing.d.cts +19 -0
  43. package/dist/capture/server-timing.d.ts +3 -3
  44. package/dist/capture/storm.d.cts +13 -0
  45. package/dist/capture/storm.d.ts +7 -7
  46. package/dist/capture/types.d.cts +128 -0
  47. package/dist/capture/types.d.ts +54 -41
  48. package/dist/capture/unclean-exit.d.cts +31 -0
  49. package/dist/capture/unclean-exit.d.ts +9 -9
  50. package/dist/capture/user-timing.d.cts +22 -0
  51. package/dist/capture/user-timing.d.ts +4 -4
  52. package/dist/capture/web-socket.d.cts +40 -0
  53. package/dist/capture/web-socket.d.ts +14 -14
  54. package/dist/capture/web-vitals.d.cts +40 -0
  55. package/dist/capture/web-vitals.d.ts +21 -8
  56. package/dist/compression-CvED_Jel.cjs +2 -0
  57. package/dist/compression-CvED_Jel.cjs.map +1 -0
  58. package/dist/compression-tVtXwVjX.js +11 -0
  59. package/dist/compression-tVtXwVjX.js.map +1 -0
  60. package/dist/config-DUs7uHHt.cjs +2 -0
  61. package/dist/config-DUs7uHHt.cjs.map +1 -0
  62. package/dist/config-SgQcCP1_.js +560 -0
  63. package/dist/config-SgQcCP1_.js.map +1 -0
  64. package/dist/console-BGgGnjSi.js +81 -0
  65. package/dist/console-BGgGnjSi.js.map +1 -0
  66. package/dist/console-CSZ5_Vx5.cjs +2 -0
  67. package/dist/console-CSZ5_Vx5.cjs.map +1 -0
  68. package/dist/constants-CUyd9cTZ.js +357 -0
  69. package/dist/constants-CUyd9cTZ.js.map +1 -0
  70. package/dist/constants-CqdJhTxH.cjs +2 -0
  71. package/dist/constants-CqdJhTxH.cjs.map +1 -0
  72. package/dist/constants.d.cts +751 -0
  73. package/dist/constants.d.ts +231 -116
  74. package/dist/core/breadcrumbs.d.cts +54 -0
  75. package/dist/core/breadcrumbs.d.ts +21 -15
  76. package/dist/core/config.d.cts +45 -0
  77. package/dist/core/config.d.ts +33 -5
  78. package/dist/core/context.d.cts +24 -0
  79. package/dist/core/context.d.ts +8 -13
  80. package/dist/core/debug-buffer.d.cts +34 -0
  81. package/dist/core/debug-buffer.d.ts +13 -13
  82. package/dist/core/debug-bundle.d.cts +12 -0
  83. package/dist/core/debug-bundle.d.ts +6 -6
  84. package/dist/core/deferred.d.cts +7 -0
  85. package/dist/core/deferred.d.ts +4 -4
  86. package/dist/core/diagnostics.d.cts +86 -0
  87. package/dist/core/diagnostics.d.ts +25 -22
  88. package/dist/core/drops.d.cts +39 -0
  89. package/dist/core/drops.d.ts +22 -12
  90. package/dist/core/hold-buffer.d.cts +36 -0
  91. package/dist/core/hold-buffer.d.ts +16 -7
  92. package/dist/core/journey.d.cts +148 -0
  93. package/dist/core/journey.d.ts +28 -29
  94. package/dist/core/logger.d.cts +141 -0
  95. package/dist/core/logger.d.ts +45 -51
  96. package/dist/core/measure.d.cts +30 -0
  97. package/dist/core/measure.d.ts +21 -10
  98. package/dist/core/meter.d.cts +78 -0
  99. package/dist/core/meter.d.ts +38 -28
  100. package/dist/core/pipeline.d.cts +227 -0
  101. package/dist/core/pipeline.d.ts +114 -50
  102. package/dist/core/profile-buckets.d.cts +31 -0
  103. package/dist/core/profile-buckets.d.ts +31 -0
  104. package/dist/core/profiler.d.cts +218 -0
  105. package/dist/core/profiler.d.ts +218 -0
  106. package/dist/core/record.d.cts +190 -0
  107. package/dist/core/record.d.ts +67 -35
  108. package/dist/core/remote-rules.d.cts +17 -0
  109. package/dist/core/remote-rules.d.ts +7 -7
  110. package/dist/core/remote-sampling.d.cts +74 -0
  111. package/dist/core/remote-sampling.d.ts +24 -23
  112. package/dist/core/rotation.d.cts +75 -0
  113. package/dist/core/rotation.d.ts +75 -0
  114. package/dist/core/runtime.d.cts +765 -0
  115. package/dist/core/runtime.d.ts +430 -186
  116. package/dist/core/sampling.d.cts +86 -0
  117. package/dist/core/sampling.d.ts +22 -22
  118. package/dist/core/sender.d.cts +161 -0
  119. package/dist/core/sender.d.ts +80 -34
  120. package/dist/core/spans.d.cts +39 -0
  121. package/dist/core/spans.d.ts +6 -6
  122. package/dist/{deadline-BOjOxNHj.js → deadline-C4ccAuk5.js} +3 -6
  123. package/dist/deadline-C4ccAuk5.js.map +1 -0
  124. package/dist/deadline-CUGbto-y.cjs +2 -0
  125. package/dist/deadline-CUGbto-y.cjs.map +1 -0
  126. package/dist/debug-bundle-BXIlwDKM.cjs +2 -0
  127. package/dist/debug-bundle-BXIlwDKM.cjs.map +1 -0
  128. package/dist/debug-bundle-CRpYV_ui.js +35 -0
  129. package/dist/debug-bundle-CRpYV_ui.js.map +1 -0
  130. package/dist/defineProperty-X1c4tIPD.cjs +1 -0
  131. package/dist/defineProperty-s2S8BXUc.js +35 -0
  132. package/dist/doctor.cjs +1 -1
  133. package/dist/doctor.cjs.map +1 -1
  134. package/dist/doctor.d.cts +36 -0
  135. package/dist/doctor.d.ts +19 -6
  136. package/dist/doctor.js +180 -53
  137. package/dist/doctor.js.map +1 -1
  138. package/dist/error-like-B11pB4aL.js.map +1 -1
  139. package/dist/error-like-gGRx2s36.cjs.map +1 -1
  140. package/dist/errors-BE_EZV7Q.js +86 -0
  141. package/dist/errors-BE_EZV7Q.js.map +1 -0
  142. package/dist/errors-CNPbesMs.cjs +3 -0
  143. package/dist/errors-CNPbesMs.cjs.map +1 -0
  144. package/dist/factory-CTi0Is3F.js +404 -0
  145. package/dist/factory-CTi0Is3F.js.map +1 -0
  146. package/dist/factory-hRrH32v5.cjs +2 -0
  147. package/dist/factory-hRrH32v5.cjs.map +1 -0
  148. package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
  149. package/dist/fixed-window-Dq3MLUUv.js.map +1 -1
  150. package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
  151. package/dist/global-scope-D9I8s-oN.js.map +1 -1
  152. package/dist/guards-BlYGRK4l.js +10 -0
  153. package/dist/guards-BlYGRK4l.js.map +1 -0
  154. package/dist/guards-EjG3ahFp.cjs +2 -0
  155. package/dist/guards-EjG3ahFp.cjs.map +1 -0
  156. package/dist/{identity-DT5VmvXy.js → identity-DdhKgrpk.js} +11 -15
  157. package/dist/identity-DdhKgrpk.js.map +1 -0
  158. package/dist/identity-DlWRIuwy.cjs +2 -0
  159. package/dist/identity-DlWRIuwy.cjs.map +1 -0
  160. package/dist/index.cjs +1 -1
  161. package/dist/index.cjs.map +1 -1
  162. package/dist/index.d.cts +300 -0
  163. package/dist/index.d.ts +165 -141
  164. package/dist/index.js +1283 -1468
  165. package/dist/index.js.map +1 -1
  166. package/dist/indexeddb-storage-CL9uqBCy.cjs +2 -0
  167. package/dist/indexeddb-storage-CL9uqBCy.cjs.map +1 -0
  168. package/dist/{indexeddb-storage-BJVtiQKm.js → indexeddb-storage-GHdl0t8A.js} +51 -47
  169. package/dist/indexeddb-storage-GHdl0t8A.js.map +1 -0
  170. package/dist/interactions-CUkzK8sR.cjs +2 -0
  171. package/dist/interactions-CUkzK8sR.cjs.map +1 -0
  172. package/dist/{interactions-DTgKy_6K.js → interactions-DiFvCosX.js} +41 -49
  173. package/dist/interactions-DiFvCosX.js.map +1 -0
  174. package/dist/journey-B4Adltjm.cjs +2 -0
  175. package/dist/journey-B4Adltjm.cjs.map +1 -0
  176. package/dist/{journey-CuJrHzEg.js → journey-D2_sia57.js} +51 -53
  177. package/dist/journey-D2_sia57.js.map +1 -0
  178. package/dist/{library-console-C1m6g1BR.js → library-console-Btrzt814.js} +2 -2
  179. package/dist/library-console-Btrzt814.js.map +1 -0
  180. package/dist/{library-console-D2GY9Or6.cjs → library-console-CPW6bvZH.cjs} +2 -2
  181. package/dist/library-console-CPW6bvZH.cjs.map +1 -0
  182. package/dist/{library-request-BQBT9N9Q.js → library-request-BJ9PLRaD.js} +2 -2
  183. package/dist/library-request-BJ9PLRaD.js.map +1 -0
  184. package/dist/{library-request-1BX_UlaX.cjs → library-request-D7OvTxZV.cjs} +2 -2
  185. package/dist/library-request-D7OvTxZV.cjs.map +1 -0
  186. package/dist/{lifecycle-BaKx_-32.js → lifecycle-22CUCrc9.js} +21 -29
  187. package/dist/lifecycle-22CUCrc9.js.map +1 -0
  188. package/dist/lifecycle-IaAm1mOC.cjs +2 -0
  189. package/dist/lifecycle-IaAm1mOC.cjs.map +1 -0
  190. package/dist/{log-record-CAoGBBf3.js → log-record-BNiLfqtL.js} +8 -7
  191. package/dist/log-record-BNiLfqtL.js.map +1 -0
  192. package/dist/log-record-CkivuiEl.cjs +2 -0
  193. package/dist/log-record-CkivuiEl.cjs.map +1 -0
  194. package/dist/long-frames-BUUbXd-B.cjs +2 -0
  195. package/dist/long-frames-BUUbXd-B.cjs.map +1 -0
  196. package/dist/long-frames-DNFaRnC3.js +62 -0
  197. package/dist/long-frames-DNFaRnC3.js.map +1 -0
  198. package/dist/models/batch.d.cts +57 -0
  199. package/dist/models/batch.d.ts +16 -17
  200. package/dist/models/bus.d.cts +158 -0
  201. package/dist/models/bus.d.ts +46 -26
  202. package/dist/models/config.d.cts +1540 -0
  203. package/dist/models/config.d.ts +692 -405
  204. package/dist/models/drop.d.cts +54 -0
  205. package/dist/models/drop.d.ts +29 -14
  206. package/dist/models/health.d.cts +148 -0
  207. package/dist/models/health.d.ts +119 -23
  208. package/dist/models/log-record.d.cts +61 -0
  209. package/dist/models/log-record.d.ts +13 -14
  210. package/dist/models/metric.d.cts +139 -0
  211. package/dist/models/metric.d.ts +94 -18
  212. package/dist/models/plugin.d.cts +47 -0
  213. package/dist/models/plugin.d.ts +16 -16
  214. package/dist/models/replay.d.cts +60 -0
  215. package/dist/models/replay.d.ts +60 -0
  216. package/dist/models/serializer.d.cts +23 -0
  217. package/dist/models/serializer.d.ts +3 -4
  218. package/dist/models/storage.d.cts +95 -0
  219. package/dist/models/storage.d.ts +17 -14
  220. package/dist/network-CGMLQ-mA.cjs +2 -0
  221. package/dist/network-CGMLQ-mA.cjs.map +1 -0
  222. package/dist/{network-DBNwApoF.js → network-on2zZT6H.js} +57 -57
  223. package/dist/network-on2zZT6H.js.map +1 -0
  224. package/dist/openfin-Bxelt0yg.js.map +1 -1
  225. package/dist/openfin-DtH2f7zX.cjs.map +1 -1
  226. package/dist/otlp-BENHf3g9.cjs +2 -0
  227. package/dist/otlp-BENHf3g9.cjs.map +1 -0
  228. package/dist/{otlp-BTJdIa6F.js → otlp-DimfrRor.js} +22 -29
  229. package/dist/otlp-DimfrRor.js.map +1 -0
  230. package/dist/patch-BX8KrPCT.cjs.map +1 -1
  231. package/dist/patch-UdPz1ea8.js.map +1 -1
  232. package/dist/{platform-DkcuXwe-.js → platform-BaaFIPCU.js} +8 -8
  233. package/dist/platform-BaaFIPCU.js.map +1 -0
  234. package/dist/{platform-C2Ez5kDc.cjs → platform-CfA3-7sJ.cjs} +2 -2
  235. package/dist/platform-CfA3-7sJ.cjs.map +1 -0
  236. package/dist/profiler-BAZoh7A4.js +292 -0
  237. package/dist/profiler-BAZoh7A4.js.map +1 -0
  238. package/dist/profiler-D4tJpDRc.cjs +2 -0
  239. package/dist/profiler-D4tJpDRc.cjs.map +1 -0
  240. package/dist/profiler-frames-C4xr7KfH.cjs +2 -0
  241. package/dist/profiler-frames-C4xr7KfH.cjs.map +1 -0
  242. package/dist/profiler-frames-cJMx9wNM.js +78 -0
  243. package/dist/profiler-frames-cJMx9wNM.js.map +1 -0
  244. package/dist/remote-rules-Dz9MRAsB.js +95 -0
  245. package/dist/remote-rules-Dz9MRAsB.js.map +1 -0
  246. package/dist/remote-rules-_tY0zj5o.cjs +2 -0
  247. package/dist/remote-rules-_tY0zj5o.cjs.map +1 -0
  248. package/dist/replay-B3gFXIZd.cjs +2 -0
  249. package/dist/replay-B3gFXIZd.cjs.map +1 -0
  250. package/dist/replay-Ds-ANH34.js +310 -0
  251. package/dist/replay-Ds-ANH34.js.map +1 -0
  252. package/dist/reports-BDSe4dFH.cjs +2 -0
  253. package/dist/reports-BDSe4dFH.cjs.map +1 -0
  254. package/dist/{reports-TA-zInnq.js → reports-C-thq-bk.js} +25 -30
  255. package/dist/reports-C-thq-bk.js.map +1 -0
  256. package/dist/resource-timing-C576gFIQ.cjs +2 -0
  257. package/dist/resource-timing-C576gFIQ.cjs.map +1 -0
  258. package/dist/{resource-timing-BLv3EA2A.js → resource-timing-eUl2dNgC.js} +20 -23
  259. package/dist/resource-timing-eUl2dNgC.js.map +1 -0
  260. package/dist/response-body-YdNl-HkR.cjs +3 -0
  261. package/dist/response-body-YdNl-HkR.cjs.map +1 -0
  262. package/dist/response-body-eoSQpLiH.js +331 -0
  263. package/dist/response-body-eoSQpLiH.js.map +1 -0
  264. package/dist/rotation-Cwct4ckk.js +94 -0
  265. package/dist/rotation-Cwct4ckk.js.map +1 -0
  266. package/dist/rotation-D4qUAHAu.cjs +2 -0
  267. package/dist/rotation-D4qUAHAu.cjs.map +1 -0
  268. package/dist/sampling-BlrI8jor.js +63 -0
  269. package/dist/sampling-BlrI8jor.js.map +1 -0
  270. package/dist/sampling-mXt4dstx.cjs +2 -0
  271. package/dist/sampling-mXt4dstx.cjs.map +1 -0
  272. package/dist/{sanitize-6ymPlVvP.js → sanitize-Ba0KqU06.js} +2 -2
  273. package/dist/sanitize-Ba0KqU06.js.map +1 -0
  274. package/dist/{sanitize-BAWzkZt0.cjs → sanitize-DQyiI_KY.cjs} +2 -2
  275. package/dist/sanitize-DQyiI_KY.cjs.map +1 -0
  276. package/dist/sender-BdRuNVhF.cjs +2 -0
  277. package/dist/sender-BdRuNVhF.cjs.map +1 -0
  278. package/dist/sender-Dv8rAmpV.js +979 -0
  279. package/dist/sender-Dv8rAmpV.js.map +1 -0
  280. package/dist/storage/context-storage.d.cts +90 -0
  281. package/dist/storage/context-storage.d.ts +38 -37
  282. package/dist/storage/emergency-queue.d.cts +27 -0
  283. package/dist/storage/emergency-queue.d.ts +13 -13
  284. package/dist/storage/eviction.d.cts +40 -0
  285. package/dist/storage/eviction.d.ts +13 -13
  286. package/dist/storage/factory.d.cts +21 -0
  287. package/dist/storage/factory.d.ts +11 -10
  288. package/dist/storage/gap.d.cts +20 -0
  289. package/dist/storage/gap.d.ts +9 -9
  290. package/dist/storage/idb-driver.d.cts +93 -0
  291. package/dist/storage/idb-driver.d.ts +32 -33
  292. package/dist/storage/indexeddb-storage.d.cts +97 -0
  293. package/dist/storage/indexeddb-storage.d.ts +38 -31
  294. package/dist/storage/keys.d.cts +17 -0
  295. package/dist/storage/keys.d.ts +9 -9
  296. package/dist/storage/local-storage.d.cts +139 -0
  297. package/dist/storage/local-storage.d.ts +49 -42
  298. package/dist/storage/memory-storage.d.cts +73 -0
  299. package/dist/storage/memory-storage.d.ts +25 -25
  300. package/dist/storage/persistence.d.cts +8 -0
  301. package/dist/storage/persistence.d.ts +3 -3
  302. package/dist/storage/stored-context.d.cts +34 -0
  303. package/dist/storage/stored-context.d.ts +34 -0
  304. package/dist/stored-context-B2EzVuYm.js +51 -0
  305. package/dist/stored-context-B2EzVuYm.js.map +1 -0
  306. package/dist/stored-context-CXt7eHZL.cjs +2 -0
  307. package/dist/stored-context-CXt7eHZL.cjs.map +1 -0
  308. package/dist/storm-C-zYSdDX.cjs +2 -0
  309. package/dist/storm-C-zYSdDX.cjs.map +1 -0
  310. package/dist/storm-DjKetLKZ.js +9 -0
  311. package/dist/storm-DjKetLKZ.js.map +1 -0
  312. package/dist/transport/compression.d.cts +7 -0
  313. package/dist/transport/compression.d.ts +2 -2
  314. package/dist/transport/custom-transport.d.cts +22 -0
  315. package/dist/transport/custom-transport.d.ts +6 -5
  316. package/dist/transport/errors.d.cts +31 -0
  317. package/dist/transport/errors.d.ts +7 -7
  318. package/dist/transport/exit-flush.d.cts +135 -0
  319. package/dist/transport/exit-flush.d.ts +62 -45
  320. package/dist/transport/headers.d.cts +8 -0
  321. package/dist/transport/headers.d.ts +4 -4
  322. package/dist/transport/http-transport.d.cts +116 -0
  323. package/dist/transport/http-transport.d.ts +48 -35
  324. package/dist/transport/memory-transport.d.cts +30 -0
  325. package/dist/transport/memory-transport.d.ts +8 -8
  326. package/dist/transport/response-body.d.cts +49 -0
  327. package/dist/transport/response-body.d.ts +49 -0
  328. package/dist/transport/retry-engine.d.cts +129 -0
  329. package/dist/transport/retry-engine.d.ts +62 -43
  330. package/dist/transport/serializers/ecs.d.cts +3 -0
  331. package/dist/transport/serializers/ecs.d.ts +2 -2
  332. package/dist/transport/serializers/otlp-metrics.d.cts +3 -0
  333. package/dist/transport/serializers/otlp-metrics.d.ts +2 -2
  334. package/dist/transport/serializers/otlp-traces.d.cts +3 -0
  335. package/dist/transport/serializers/otlp-traces.d.ts +2 -2
  336. package/dist/transport/serializers/otlp.d.cts +47 -0
  337. package/dist/transport/serializers/otlp.d.ts +18 -18
  338. package/dist/transport/serializers/select.d.cts +38 -0
  339. package/dist/transport/serializers/select.d.ts +11 -11
  340. package/dist/transport/status-transport.d.cts +129 -0
  341. package/dist/transport/status-transport.d.ts +45 -28
  342. package/dist/transport/worker-client.d.cts +23 -0
  343. package/dist/transport/worker-client.d.ts +12 -3
  344. package/dist/transport/worker-entry.d.cts +5 -0
  345. package/dist/transport/worker-entry.d.ts +1 -1
  346. package/dist/transport/worker-protocol.d.cts +38 -0
  347. package/dist/transport/worker-protocol.d.ts +7 -5
  348. package/dist/transport/worker-server.d.cts +3 -0
  349. package/dist/transport/worker-server.d.ts +1 -1
  350. package/dist/transport/worker-transport.d.cts +10 -0
  351. package/dist/transport/worker-transport.d.ts +5 -4
  352. package/dist/types-BAerHgCq.js.map +1 -1
  353. package/dist/types-C7WNpnG1.cjs.map +1 -1
  354. package/dist/{unclean-exit-CwcUhFOn.js → unclean-exit-DQD1cT7c.js} +23 -30
  355. package/dist/unclean-exit-DQD1cT7c.js.map +1 -0
  356. package/dist/unclean-exit-py99ApzT.cjs +2 -0
  357. package/dist/unclean-exit-py99ApzT.cjs.map +1 -0
  358. package/dist/unref-CU9Nyz_9.cjs +2 -0
  359. package/dist/unref-CU9Nyz_9.cjs.map +1 -0
  360. package/dist/unref-DgHPQeWv.js +7 -0
  361. package/dist/unref-DgHPQeWv.js.map +1 -0
  362. package/dist/{user-timing-_jZIhDKI.js → user-timing-BePqb1uN.js} +18 -18
  363. package/dist/user-timing-BePqb1uN.js.map +1 -0
  364. package/dist/user-timing-D6XTmpuM.cjs +2 -0
  365. package/dist/user-timing-D6XTmpuM.cjs.map +1 -0
  366. package/dist/utils/console.d.cts +36 -0
  367. package/dist/utils/console.d.ts +6 -6
  368. package/dist/utils/deadline.d.cts +14 -0
  369. package/dist/utils/deadline.d.ts +4 -4
  370. package/dist/utils/error-like.d.cts +25 -0
  371. package/dist/utils/error-like.d.ts +7 -7
  372. package/dist/utils/fixed-window.d.cts +25 -0
  373. package/dist/utils/fixed-window.d.ts +9 -8
  374. package/dist/utils/global-scope.d.cts +20 -0
  375. package/dist/utils/global-scope.d.ts +8 -8
  376. package/dist/utils/guards.d.cts +14 -0
  377. package/dist/utils/guards.d.ts +10 -2
  378. package/dist/utils/identity.d.cts +109 -0
  379. package/dist/utils/identity.d.ts +20 -21
  380. package/dist/utils/library-console.d.cts +11 -0
  381. package/dist/utils/library-console.d.ts +4 -4
  382. package/dist/utils/library-request.d.cts +24 -0
  383. package/dist/utils/library-request.d.ts +10 -10
  384. package/dist/utils/lock.d.cts +24 -0
  385. package/dist/utils/lock.d.ts +11 -10
  386. package/dist/utils/openfin.d.cts +48 -0
  387. package/dist/utils/openfin.d.ts +5 -5
  388. package/dist/utils/patch.d.cts +9 -0
  389. package/dist/utils/patch.d.ts +6 -6
  390. package/dist/utils/platform.d.cts +62 -0
  391. package/dist/utils/platform.d.ts +15 -13
  392. package/dist/utils/sanitize.d.cts +52 -0
  393. package/dist/utils/sanitize.d.ts +5 -5
  394. package/dist/utils/sequence.d.cts +10 -0
  395. package/dist/utils/tracing.d.cts +158 -0
  396. package/dist/utils/tracing.d.ts +49 -42
  397. package/dist/utils/unref.d.cts +9 -0
  398. package/dist/utils/unref.d.ts +3 -3
  399. package/dist/web-socket-CoIUBM3C.cjs +2 -0
  400. package/dist/web-socket-CoIUBM3C.cjs.map +1 -0
  401. package/dist/{web-socket-CV7yIMnm.js → web-socket-DSHgDiZ6.js} +23 -28
  402. package/dist/web-socket-DSHgDiZ6.js.map +1 -0
  403. package/dist/web-vitals-4pWACwaR.js +71 -0
  404. package/dist/web-vitals-4pWACwaR.js.map +1 -0
  405. package/dist/web-vitals-__X7t4pj.cjs +2 -0
  406. package/dist/web-vitals-__X7t4pj.cjs.map +1 -0
  407. package/dist/worker-protocol-QbvqNazn.cjs +2 -0
  408. package/dist/worker-protocol-QbvqNazn.cjs.map +1 -0
  409. package/dist/{worker-protocol-CrsdSDLn.js → worker-protocol-x074Rpet.js} +14 -11
  410. package/dist/worker-protocol-x074Rpet.js.map +1 -0
  411. package/dist/worker-server-CFe4nvos.cjs +2 -0
  412. package/dist/worker-server-CFe4nvos.cjs.map +1 -0
  413. package/dist/worker-server-iUVSjH8L.js +94 -0
  414. package/dist/worker-server-iUVSjH8L.js.map +1 -0
  415. package/dist/worker-transport-CRAX-09c.cjs +2 -0
  416. package/dist/worker-transport-CRAX-09c.cjs.map +1 -0
  417. package/dist/worker-transport-Dy1KMA7t.js +190 -0
  418. package/dist/worker-transport-Dy1KMA7t.js.map +1 -0
  419. package/llms.txt +397 -0
  420. package/package.json +55 -41
  421. package/dist/batch-C8OcWR2L.cjs.map +0 -1
  422. package/dist/batch-CL9uWYY3.js.map +0 -1
  423. package/dist/bus-BZ0GldpT.js +0 -660
  424. package/dist/bus-BZ0GldpT.js.map +0 -1
  425. package/dist/bus-VWlmM5xs.cjs +0 -2
  426. package/dist/bus-VWlmM5xs.cjs.map +0 -1
  427. package/dist/console-BPZCuSLc.cjs +0 -2
  428. package/dist/console-BPZCuSLc.cjs.map +0 -1
  429. package/dist/console-BeCF7n59.js +0 -82
  430. package/dist/console-BeCF7n59.js.map +0 -1
  431. package/dist/constants-DqKJH_MP.cjs +0 -2
  432. package/dist/constants-DqKJH_MP.cjs.map +0 -1
  433. package/dist/constants-zyrqveN4.js +0 -304
  434. package/dist/constants-zyrqveN4.js.map +0 -1
  435. package/dist/context-storage-BjzeBSxH.cjs +0 -2
  436. package/dist/context-storage-BjzeBSxH.cjs.map +0 -1
  437. package/dist/context-storage-BzkoHzkQ.js +0 -51
  438. package/dist/context-storage-BzkoHzkQ.js.map +0 -1
  439. package/dist/deadline-BOjOxNHj.js.map +0 -1
  440. package/dist/deadline-XSnm95pg.cjs +0 -2
  441. package/dist/deadline-XSnm95pg.cjs.map +0 -1
  442. package/dist/debug-bundle-BzJNpbF0.cjs +0 -2
  443. package/dist/debug-bundle-BzJNpbF0.cjs.map +0 -1
  444. package/dist/debug-bundle-C7UkHZ-q.js +0 -25
  445. package/dist/debug-bundle-C7UkHZ-q.js.map +0 -1
  446. package/dist/emergency-queue-CNTRui5t.cjs +0 -2
  447. package/dist/emergency-queue-CNTRui5t.cjs.map +0 -1
  448. package/dist/emergency-queue-Zy6lNafo.js +0 -67
  449. package/dist/emergency-queue-Zy6lNafo.js.map +0 -1
  450. package/dist/errors-Dh7kef0i.js +0 -92
  451. package/dist/errors-Dh7kef0i.js.map +0 -1
  452. package/dist/errors-tfEr48bS.cjs +0 -3
  453. package/dist/errors-tfEr48bS.cjs.map +0 -1
  454. package/dist/factory-BonqI3NL.js +0 -276
  455. package/dist/factory-BonqI3NL.js.map +0 -1
  456. package/dist/factory-CJXVYp0R.cjs +0 -2
  457. package/dist/factory-CJXVYp0R.cjs.map +0 -1
  458. package/dist/guards-Cidk71ME.js +0 -7
  459. package/dist/guards-Cidk71ME.js.map +0 -1
  460. package/dist/guards-nJ70syPt.cjs +0 -2
  461. package/dist/guards-nJ70syPt.cjs.map +0 -1
  462. package/dist/identity-Cxgj6pZX.cjs +0 -2
  463. package/dist/identity-Cxgj6pZX.cjs.map +0 -1
  464. package/dist/identity-DT5VmvXy.js.map +0 -1
  465. package/dist/indexeddb-storage-BJVtiQKm.js.map +0 -1
  466. package/dist/indexeddb-storage-CIoW21Xd.cjs +0 -2
  467. package/dist/indexeddb-storage-CIoW21Xd.cjs.map +0 -1
  468. package/dist/interactions-DTgKy_6K.js.map +0 -1
  469. package/dist/interactions-fEN6FbVo.cjs +0 -2
  470. package/dist/interactions-fEN6FbVo.cjs.map +0 -1
  471. package/dist/journey-CuJrHzEg.js.map +0 -1
  472. package/dist/journey-pffMVMfa.cjs +0 -2
  473. package/dist/journey-pffMVMfa.cjs.map +0 -1
  474. package/dist/keys-BHhw_0Wh.cjs +0 -2
  475. package/dist/keys-BHhw_0Wh.cjs.map +0 -1
  476. package/dist/keys-BU9j5YqW.js +0 -16
  477. package/dist/keys-BU9j5YqW.js.map +0 -1
  478. package/dist/library-console-C1m6g1BR.js.map +0 -1
  479. package/dist/library-console-D2GY9Or6.cjs.map +0 -1
  480. package/dist/library-request-1BX_UlaX.cjs.map +0 -1
  481. package/dist/library-request-BQBT9N9Q.js.map +0 -1
  482. package/dist/lifecycle-2EtUaRpo.cjs +0 -2
  483. package/dist/lifecycle-2EtUaRpo.cjs.map +0 -1
  484. package/dist/lifecycle-BaKx_-32.js.map +0 -1
  485. package/dist/log-record-CAoGBBf3.js.map +0 -1
  486. package/dist/log-record-i9zOTkpQ.cjs +0 -2
  487. package/dist/log-record-i9zOTkpQ.cjs.map +0 -1
  488. package/dist/long-frames-BVg4i5SC.cjs +0 -2
  489. package/dist/long-frames-BVg4i5SC.cjs.map +0 -1
  490. package/dist/long-frames-Czk7IupC.js +0 -64
  491. package/dist/long-frames-Czk7IupC.js.map +0 -1
  492. package/dist/models/stats.d.ts +0 -11
  493. package/dist/network-DBNwApoF.js.map +0 -1
  494. package/dist/network-xbbuvG_6.cjs +0 -2
  495. package/dist/network-xbbuvG_6.cjs.map +0 -1
  496. package/dist/otlp-BDvFrLnc.cjs +0 -2
  497. package/dist/otlp-BDvFrLnc.cjs.map +0 -1
  498. package/dist/otlp-BTJdIa6F.js.map +0 -1
  499. package/dist/platform-C2Ez5kDc.cjs.map +0 -1
  500. package/dist/platform-DkcuXwe-.js.map +0 -1
  501. package/dist/remote-rules-Cfb4K-Nl.js +0 -98
  502. package/dist/remote-rules-Cfb4K-Nl.js.map +0 -1
  503. package/dist/remote-rules-vzvk7aKf.cjs +0 -2
  504. package/dist/remote-rules-vzvk7aKf.cjs.map +0 -1
  505. package/dist/reports-Dk2YhKIh.cjs +0 -2
  506. package/dist/reports-Dk2YhKIh.cjs.map +0 -1
  507. package/dist/reports-TA-zInnq.js.map +0 -1
  508. package/dist/resource-timing-BLv3EA2A.js.map +0 -1
  509. package/dist/resource-timing-Cysw1S1f.cjs +0 -2
  510. package/dist/resource-timing-Cysw1S1f.cjs.map +0 -1
  511. package/dist/sampling-C4VV-1MS.js +0 -60
  512. package/dist/sampling-C4VV-1MS.js.map +0 -1
  513. package/dist/sampling-Ckh2yW9k.cjs +0 -2
  514. package/dist/sampling-Ckh2yW9k.cjs.map +0 -1
  515. package/dist/sanitize-6ymPlVvP.js.map +0 -1
  516. package/dist/sanitize-BAWzkZt0.cjs.map +0 -1
  517. package/dist/select-ZF4by-lF.cjs +0 -3
  518. package/dist/select-ZF4by-lF.cjs.map +0 -1
  519. package/dist/select-xtQaenIi.js +0 -270
  520. package/dist/select-xtQaenIi.js.map +0 -1
  521. package/dist/sender-CiMHC9YG.js +0 -856
  522. package/dist/sender-CiMHC9YG.js.map +0 -1
  523. package/dist/sender-D5wBoXA8.cjs +0 -2
  524. package/dist/sender-D5wBoXA8.cjs.map +0 -1
  525. package/dist/storage-BA9RqRO-.cjs +0 -2
  526. package/dist/storage-BA9RqRO-.cjs.map +0 -1
  527. package/dist/storage-DZwed89z.js +0 -16
  528. package/dist/storage-DZwed89z.js.map +0 -1
  529. package/dist/storm-CYi9Swpx.cjs +0 -2
  530. package/dist/storm-CYi9Swpx.cjs.map +0 -1
  531. package/dist/storm-VR024_QN.js +0 -9
  532. package/dist/storm-VR024_QN.js.map +0 -1
  533. package/dist/unclean-exit-CwcUhFOn.js.map +0 -1
  534. package/dist/unclean-exit-DFUN57wY.cjs +0 -2
  535. package/dist/unclean-exit-DFUN57wY.cjs.map +0 -1
  536. package/dist/user-timing-C9kfRq3J.cjs +0 -2
  537. package/dist/user-timing-C9kfRq3J.cjs.map +0 -1
  538. package/dist/user-timing-_jZIhDKI.js.map +0 -1
  539. package/dist/utils/timer.d.ts +0 -19
  540. package/dist/web-socket-BWUoqBh8.cjs +0 -2
  541. package/dist/web-socket-BWUoqBh8.cjs.map +0 -1
  542. package/dist/web-socket-CV7yIMnm.js.map +0 -1
  543. package/dist/web-vitals-Bq4WFHQo.js +0 -52
  544. package/dist/web-vitals-Bq4WFHQo.js.map +0 -1
  545. package/dist/web-vitals-DFuoTQbZ.cjs +0 -2
  546. package/dist/web-vitals-DFuoTQbZ.cjs.map +0 -1
  547. package/dist/worker-protocol-Bai7GAIA.cjs +0 -2
  548. package/dist/worker-protocol-Bai7GAIA.cjs.map +0 -1
  549. package/dist/worker-protocol-CrsdSDLn.js.map +0 -1
  550. package/dist/worker-server-BrIYkfoa.cjs +0 -2
  551. package/dist/worker-server-BrIYkfoa.cjs.map +0 -1
  552. package/dist/worker-server-Dp5HYm4b.js +0 -83
  553. package/dist/worker-server-Dp5HYm4b.js.map +0 -1
  554. package/dist/worker-transport-Bwej4N2e.cjs +0 -2
  555. package/dist/worker-transport-Bwej4N2e.cjs.map +0 -1
  556. package/dist/worker-transport-D6jtgpqN.js +0 -199
  557. package/dist/worker-transport-D6jtgpqN.js.map +0 -1
@@ -1,22 +1,26 @@
1
- import type { REMOTE_CAPTURE_FLAGS } from "../constants";
2
- import type { DiagnosticCode, DiagnosticHandler } from "../core/diagnostics";
3
- import type { DropSummary } from "./drop";
4
- import type { LogLevel, LogRecord } from "./log-record";
5
- import type { CapturePlugin } from "./plugin";
6
- import type { LogSerializer } from "./serializer";
1
+ import type { REMOTE_CAPTURE_FLAGS } from "../constants.js";
2
+ import type { DiagnosticCode, DiagnosticHandler } from "../core/diagnostics.js";
3
+ import type { DropSummary } from "./drop.js";
4
+ import type { LogLevel, LogRecord, LogType } from "./log-record.js";
5
+ import type { CapturePlugin } from "./plugin.js";
6
+ import type { ReplayLoader, ReplayMode, ReplayPluginLoader, ReplaySegment } from "./replay.js";
7
+ import type { LogSerializer } from "./serializer.js";
7
8
  /** Backing store for undelivered records. "auto" picks the best one the host supports. */
8
9
  export type StorageStrategy = "auto" | "indexeddb" | "localstorage" | "memory" | "none";
9
- /** Selects where the library keeps session, tab and journey ids. "storage" uses browser storage. "memory" writes nothing. */
10
+ /**
11
+ * Where the library keeps session, tab and journey ids. "storage" uses browser storage and
12
+ * "memory" writes nothing.
13
+ */
10
14
  export type IdentityStrategy = "storage" | "memory";
11
15
  /**
12
- * What this context does with its records. `sender` delivers its own records.
13
- * `forwarder` gives them to another context. `auto` selects a role at startup.
14
- * `off` turns off the bus. The context then delivers its own records.
16
+ * What this context does with its records. `sender` delivers its own records, `forwarder`
17
+ * hands them to another context, and `auto` picks a role at startup. `off` turns the bus off,
18
+ * so the context delivers its own records.
15
19
  */
16
20
  export type BusMode = "auto" | "sender" | "forwarder" | "off";
17
21
  /**
18
- * Structural type for the metric shape of the `web-vitals` package. With this type,
19
- * the library has no hard dependency on the package.
22
+ * Structural type for the metric shape of the `web-vitals` package, so the library has no
23
+ * hard dependency on it.
20
24
  */
21
25
  export interface WebVitalsMetric {
22
26
  /** Measurement value, in the metric's own unit. */
@@ -112,7 +116,7 @@ export interface OtelApi {
112
116
  * @returns A promise that resolves to the module.
113
117
  */
114
118
  export type OtelLoader = () => Promise<OtelApi>;
115
- /** Sampling policy. It controls which records the library keeps. */
119
+ /** Sampling policy. Controls which records the library keeps. */
116
120
  export interface SamplingOptions {
117
121
  /**
118
122
  * Default fraction of records kept, 0 to 1.
@@ -120,7 +124,9 @@ export interface SamplingOptions {
120
124
  */
121
125
  defaultRate: number;
122
126
  /**
123
- * Rate override for each namespace, keyed by `app.namespace`. The most specific prefix applies.
127
+ * Per-namespace rate overrides, keyed by `app.namespace`. The most specific prefix wins. A
128
+ * new map replaces the current one. A rate outside 0 to 1 is left out with a report, so a
129
+ * shorter prefix or `defaultRate` applies.
124
130
  * @default {}
125
131
  */
126
132
  rates: Record<string, number>;
@@ -128,86 +134,88 @@ export interface SamplingOptions {
128
134
  * Log types always kept, regardless of the sampling rate.
129
135
  * @default ["action"]
130
136
  */
131
- alwaysSampleTypes: string[];
137
+ alwaysSampleTypes: LogType[];
132
138
  /**
133
- * Lowest level that the sampling rate never drops. `capturePolicy.errorCeiling` limits
134
- * the log records at this level and higher.
139
+ * Lowest level that the sampling rate never drops. `errorCeiling` limits the log records at
140
+ * this level and higher.
135
141
  * @default "ERROR"
136
142
  */
137
143
  alwaysSampleFrom: LogLevel;
138
144
  /**
139
- * Read sampling rules from the `X-UiObs-Sampling` header of each accepted batch.
140
- * The rules stay in force for their `ttlMs`. Set it in each context of the page.
145
+ * Maximum log records at or above `alwaysSampleFrom` in one `errorCeilingWindowMs` window.
146
+ * Metric points and spans do not count. Set 0 to drop every one, or null for no limit.
147
+ * @default 500
148
+ */
149
+ errorCeiling: number | null;
150
+ /**
151
+ * Length of the `errorCeiling` window, in milliseconds, 1 or more.
152
+ * @default 10000
153
+ */
154
+ errorCeilingWindowMs: number;
155
+ /**
156
+ * Read sampling rules from the `X-UiObs-Sampling` header of every accepted batch. The rules
157
+ * stay in effect for their `ttlMs`. Set this in every context on the page.
141
158
  * @default false
142
159
  */
143
160
  remote: boolean;
144
161
  /**
145
- * Highest rate that a remote rule can set, 0 to 1. It applies to `defaultRate` and each namespace rate.
162
+ * Highest rate a remote rule can set, 0 to 1. Applies to `defaultRate` and to every
163
+ * namespace rate.
146
164
  * @default 1
147
165
  */
148
166
  remoteMaxRate: number;
149
167
  }
150
- /** Bus settings. They control how this context finds, trusts, and sends messages to others. */
168
+ /** Bus settings. Controls how this context finds, trusts and sends messages to others. */
151
169
  export interface BusOptions {
152
170
  /**
153
- * Rule for accepting child windows. "registered" requires a window registration.
171
+ * Which child windows are accepted. "registered" requires a window registration, while
154
172
  * "trusted-origin" accepts child windows from a trusted origin.
155
173
  * @default "registered"
156
174
  */
157
175
  sourcePolicy: "registered" | "trusted-origin";
158
176
  /**
159
- * Message checks. "strict" checks each record and control message.
160
- * "envelope" checks the protocol tag only.
161
- * @default "strict"
162
- */
163
- validation: "strict" | "envelope";
164
- /**
165
- * Maximum encoded bytes in one message. Set 0 for no size limit.
177
+ * Maximum encoded bytes in one message, 1 or more. Set null for no size limit.
166
178
  * @default 262144
167
179
  */
168
- maxMessageBytes: number;
180
+ maxMessageBytes: number | null;
169
181
  /**
170
- * Maximum records in one message. Set 0 for no record limit.
182
+ * Maximum records in one message, 1 or more. Set null for no record limit.
171
183
  * @default 100
172
184
  */
173
- maxRecordsPerMessage: number;
185
+ maxRecordsPerMessage: number | null;
174
186
  /**
175
- * Maximum messages from one source in one second. Set 0 for no rate limit.
187
+ * Maximum messages from one source in one second, 1 or more. Set null for no rate limit.
176
188
  * @default 100
177
189
  */
178
- maxMessagesPerSecond: number;
179
- /**
180
- * Maximum named sources to track, for example OpenFin identities. Set 0 for no limit.
181
- * @default 256
182
- */
183
- maxTrackedSources: number;
190
+ maxMessagesPerSecond: number | null;
184
191
  /**
185
- * This context's role.
192
+ * This context's role. Can't be changed after startup.
186
193
  * @default "auto"
187
194
  */
188
195
  mode: BusMode;
189
196
  /**
190
197
  * Additional trusted parent origins. With sourcePolicy "trusted-origin", the list also
191
- * permits child origins. A registered child uses the exact origin in its registration.
192
- * The library does not accept "null". A sandboxed frame must set `mode: "sender"`.
198
+ * permits child origins. A registered child uses the exact origin from its registration.
199
+ * "null" is never accepted, so a sandboxed frame must set `mode: "sender"`. A new entry
200
+ * doesn't reconnect a parent link that already exists.
193
201
  * @default []
194
202
  */
195
203
  trustedOrigins: string[];
196
204
  /**
197
- * Which OpenFin context this is. Only the platform provider answers a handshake.
198
- * With an incorrect value, each view sends its own records. "auto" treats the
199
- * window whose name equals its application uuid as the provider.
205
+ * Which OpenFin context this is. Only the platform provider answers a handshake, so with
206
+ * the wrong value every view sends its own records. "auto" treats the window whose name
207
+ * equals its application uuid as the provider. Can't be changed after startup.
200
208
  * @default "auto"
201
209
  */
202
210
  openFinRole: "auto" | "provider" | "client";
203
211
  }
204
212
  /**
205
213
  * Where a journey id applies.
206
- * - "context": each document, frame or worker keeps its own journey.
207
- * - "tab": a frame or a worker adopts the journey of the context that owns it. A journey
208
- * does not go to another tab.
209
- * - "origin": each context of the origin adopts each journey. The broadcast link also reaches
210
- * other tabs.
214
+ * - "context": every document, frame or worker keeps its own journey.
215
+ * - "tab": a frame or worker adopts the journey of the context that owns it. A journey never
216
+ * crosses to another tab.
217
+ * - "origin": every context on the origin adopts every journey. The broadcast link also
218
+ * reaches other tabs.
211
219
  * - "auto": "origin" in OpenFin and "tab" in a browser.
212
220
  */
213
221
  export type JourneyScope = "auto" | "context" | "tab" | "origin";
@@ -219,123 +227,153 @@ export interface JourneyOptions {
219
227
  */
220
228
  scope: JourneyScope;
221
229
  /**
222
- * Maximum open time of a journey, in milliseconds. Then the library ends it. The range is
223
- * 1 minute to 24 hours. You cannot change this value after startup.
230
+ * How long a journey can stay open, in milliseconds, before the library ends it. 1 minute
231
+ * to 24 hours. Can't be changed after startup.
224
232
  * @default 1800000
225
233
  */
226
234
  maxAgeMs: number;
227
235
  }
228
- /** Batch size and flush interval of each record stream. You cannot change them after startup. */
236
+ /**
237
+ * Batch sizes, and the flush interval of log and span batches. The log keys also apply to spans.
238
+ * A metric batch waits `metrics.intervalMs`. Can't be changed after startup.
239
+ */
229
240
  export interface BatchingOptions {
230
241
  /**
231
- * Maximum wait of a partial log batch, in milliseconds. The range is 100 to 60000.
242
+ * How long a partial log or span batch waits before it is sent, in milliseconds. 100 to 60000.
232
243
  * @default 2000
233
244
  */
234
245
  logFlushIntervalMs: number;
235
246
  /**
236
- * Maximum records in one log batch. The range is 1 to 1000.
247
+ * Maximum records in one log or span batch. 1 to 1000.
237
248
  * @default 100
238
249
  */
239
250
  logBatchSize: number;
240
251
  /**
241
- * Maximum wait of a partial metric batch, in milliseconds. The range is 100 to 60000.
242
- * @default 10000
243
- */
244
- metricFlushIntervalMs: number;
245
- /**
246
- * Maximum records in one metric batch. The range is 1 to 1000.
252
+ * Maximum records in one metric batch. 1 to 1000.
247
253
  * @default 500
248
254
  */
249
255
  metricBatchSize: number;
250
256
  }
251
257
  /**
252
- * How long the library keeps an undelivered batch.
253
- * - "limited": the batch stays until `maxAgeMs` or `maxAttempts`.
254
- * - "until-delivered": the batch has no age limit and no attempt limit. `maxBatches` still
255
- * applies. A permanent error still drops the batch.
258
+ * Retention of undelivered batches. Can't be changed after startup. To keep a batch until it is
259
+ * delivered, set `maxAgeMs` and `maxAttempts` to null. `maxBatches` still applies, and a
260
+ * permanent error still drops the batch.
256
261
  */
257
- export type RetentionMode = "limited" | "until-delivered";
258
- /** Retention of undelivered batches. You cannot change it after startup. */
259
262
  export interface RetentionOptions {
260
263
  /**
261
- * Retention rule.
262
- * @default "limited"
263
- */
264
- mode: RetentionMode;
265
- /**
266
- * Maximum stored batches. A new batch evicts the oldest batch without an action first. The
267
- * range is 1 to 5000.
264
+ * Maximum stored batches. A new batch evicts the oldest batch that holds no action first.
265
+ * 1 to 5000.
268
266
  * @default 500
269
267
  */
270
268
  maxBatches: number;
271
269
  /**
272
- * Maximum age of a stored batch, in milliseconds. The range is 1 minute to 7 days.
270
+ * Maximum age of a stored batch, in milliseconds. 1 minute to 7 days. Set null for no age
271
+ * limit.
273
272
  * @default 86400000
274
273
  */
275
- maxAgeMs: number;
274
+ maxAgeMs: number | null;
276
275
  /**
277
- * Maximum send attempts of a stored batch. The range is 1 to 20.
276
+ * Maximum send attempts for a stored batch. 1 to 20. Set null for no attempt limit.
278
277
  * @default 5
279
278
  */
280
- maxAttempts: number;
279
+ maxAttempts: number | null;
281
280
  }
282
- /** Size limits for each record. You cannot change them after startup. */
283
- export interface LimitOptions {
281
+ /** Size limits for each record. Can't be changed after startup. */
282
+ export interface LimitsOptions {
284
283
  /**
285
- * Maximum body length, in characters. The range is 256 to 65536.
284
+ * Maximum body length, in characters. 256 to 65536.
286
285
  * @default 4096
287
286
  */
288
287
  maxBodyChars: number;
289
288
  /**
290
- * Maximum length of a string attribute, in characters. The range is 256 to 65536.
289
+ * Maximum length of a string attribute, in characters. 256 to 65536.
291
290
  * @default 8192
292
291
  */
293
292
  maxAttributeChars: number;
294
293
  /**
295
- * Maximum keys in one object. The range is 1 to 1024.
294
+ * Maximum keys in one object. 1 to 1024.
296
295
  * @default 128
297
296
  */
298
297
  maxAttributeCount: number;
299
298
  /**
300
- * Maximum length of an error stack, in characters. The range is 256 to 65536.
299
+ * Maximum length of an error stack, in characters. 256 to 65536.
301
300
  * @default 8192
302
301
  */
303
302
  maxStackChars: number;
304
303
  /**
305
- * Maximum depth of a nested value. The range is 1 to 16.
304
+ * Maximum depth of a nested value. 1 to 16.
306
305
  * @default 6
307
306
  */
308
307
  maxDepth: number;
309
308
  /**
310
- * Maximum items in one array, set or map. The range is 1 to 10000.
309
+ * Maximum items in one array, set or map. 1 to 10000.
311
310
  * @default 100
312
311
  */
313
312
  maxArrayLength: number;
314
313
  /**
315
- * Maximum values in one sanitize pass. The range is 100 to 100000.
314
+ * Maximum values in one sanitize pass. 100 to 100000.
316
315
  * @default 10000
317
316
  */
318
317
  maxNodes: number;
319
318
  /**
320
- * Maximum attribute bytes of one record. Above it, the library drops the caller attributes.
321
- * The range is 1024 to 60000.
319
+ * Maximum attribute bytes in one record. Above that, the library drops the caller's
320
+ * attributes. 1024 to 60000.
322
321
  * @default 32768
323
322
  */
324
323
  maxRecordBytes: number;
325
324
  }
326
325
  /** Console method that the console capture can wrap. */
327
326
  export type CapturedConsoleMethod = "error" | "warn" | "info" | "log";
328
- /** Resource timing settings. An object turns on capture. */
327
+ /** Console capture settings. An object turns the capture on, and true uses the defaults below. */
328
+ export interface ConsoleCaptureOptions {
329
+ /**
330
+ * Console methods to wrap. `error` produces an ERROR record and `warn` a WARN record, while
331
+ * `info` and `log` only add a breadcrumb. An empty list wraps nothing.
332
+ * @default ["error", "warn"]
333
+ */
334
+ levels?: CapturedConsoleMethod[];
335
+ }
336
+ /** Long frame settings. An object turns the capture on, and true uses the defaults below. */
337
+ export interface LongFramesOptions {
338
+ /**
339
+ * Minimum frame duration to report, in milliseconds, 0 or more.
340
+ * @default 100
341
+ */
342
+ thresholdMs?: number;
343
+ }
344
+ /** User timing settings. An object turns the capture on, and true uses the defaults below. */
345
+ export interface UserTimingOptions {
346
+ /**
347
+ * Names of the marks and measures to record, as strings and RegExp patterns. A string matches
348
+ * any part of the name. An empty list records every name.
349
+ * @default []
350
+ */
351
+ include?: (string | RegExp)[];
352
+ }
353
+ /** Web vitals settings. An object turns the capture on, and true uses the defaults below. */
354
+ export interface WebVitalsOptions {
355
+ /**
356
+ * Supplies the `web-vitals` module without a hard dependency on the package, for example
357
+ * `() => import("web-vitals")`. Without it, the library reports `config.invalid` and records
358
+ * only the navigation timing. Set null to remove it.
359
+ * @returns A promise that resolves to the `web-vitals` module.
360
+ */
361
+ loader?: (() => Promise<WebVitalsModule>) | null;
362
+ }
363
+ /** Resource timing settings. Passing an object turns the capture on. */
329
364
  export interface ResourceTimingOptions {
330
- /** Minimum duration of a ui.resource.slow event, in milliseconds. Set 0 for no slow events. @default 1000 */
365
+ /**
366
+ * Minimum duration for a ui.resource.slow event, in milliseconds. Set 0 for no slow events.
367
+ * @default 1000
368
+ */
331
369
  slowMs?: number;
332
370
  }
333
371
  /** Capture switch that a remote rule can change. */
334
372
  export type RemoteCaptureFlag = (typeof REMOTE_CAPTURE_FLAGS)[number];
335
- /** Click settings. An object turns on capture. With true, capture uses the defaults below. */
373
+ /** Click settings. An object turns the capture on, and true uses the defaults below. */
336
374
  export interface InteractionOptions {
337
375
  /**
338
- * Record the textContent of the clicked element.
376
+ * Record the clicked element's textContent.
339
377
  * @default false
340
378
  */
341
379
  text?: boolean;
@@ -345,7 +383,8 @@ export interface InteractionOptions {
345
383
  */
346
384
  selector?: boolean;
347
385
  /**
348
- * CSS selector for regions to exclude. Set null to include all regions.
386
+ * CSS selector for regions to exclude. Set null to include all regions. Session replay always
387
+ * blocks `[data-observability-ignore]`, whatever this value is.
349
388
  * @default "[data-observability-ignore]"
350
389
  */
351
390
  ignoreSelector?: string | null;
@@ -355,96 +394,151 @@ export interface InteractionOptions {
355
394
  */
356
395
  maxTextChars?: number;
357
396
  /**
358
- * Attribute that names the click action, for example "data-testid". The closest element with
359
- * the attribute gives the breadcrumb message. Use letters, digits, hyphens and underscores.
397
+ * Attribute that names the click action, for example "data-testid". The closest element
398
+ * that has it supplies the breadcrumb message. Use letters, digits, hyphens and underscores.
360
399
  * @default "data-observability-action"
361
400
  */
362
401
  actionAttribute?: string;
363
402
  /**
364
- * Record one event `ui.rage_click` for each burst of `rageClickCount` clicks on one element
365
- * in `rageClickWindowMs`. The event has the action name and the click count.
403
+ * Record one `ui.rage_click` event for every burst of `rageClickCount` clicks on one element
404
+ * within `rageClickWindowMs`. The event carries the action name and the click count.
366
405
  * @default false
367
406
  */
368
407
  rageClicks?: boolean;
369
408
  /**
370
- * Clicks that make a rage click. The range is 2 to 20.
409
+ * Number of clicks that count as a rage click. 2 to 20.
371
410
  * @default 3
372
411
  */
373
412
  rageClickCount?: number;
374
413
  /**
375
- * Time in which the clicks of a rage click occur, in milliseconds. The range is 100 to 10000.
414
+ * Time window that the clicks of a rage click must fall in, in milliseconds. 100 to 10000.
376
415
  * @default 1000
377
416
  */
378
417
  rageClickWindowMs?: number;
379
418
  /**
380
- * Record the event `ui.dead_click` when a click on a control gives no DOM change, no navigation
381
- * and no scroll in `deadClickMs`. The event has the action name only. A click on a
382
- * `target="_blank"` or `download` link gives no event.
419
+ * Record a `ui.dead_click` event when a click on a control causes no DOM change, no
420
+ * navigation and no scroll within `deadClickMs`. The event carries only the action name. A
421
+ * click on a `target="_blank"` or `download` link produces no event.
383
422
  * @default false
384
423
  */
385
424
  deadClicks?: boolean;
386
425
  /**
387
- * Wait for a visible response to a click, in milliseconds. The range is 100 to 10000.
426
+ * How long to wait for a visible response to a click, in milliseconds. 100 to 10000.
388
427
  * @default 1000
389
428
  */
390
429
  deadClickMs?: number;
391
430
  }
392
- /** Cache settings. A logger that the app holds stays valid after removal from the cache. */
431
+ /** Cache settings. A logger the app still holds keeps working after it leaves the cache. */
393
432
  export interface LoggerCacheOptions {
394
433
  /**
395
- * Maximum cached loggers. The cache removes the least recently used logger first.
396
- * Set 0 for no cache. Set null for no cache limit.
434
+ * Maximum cached loggers. The least recently used logger is removed first. Set 0 for no
435
+ * cache. Set null for no cache limit.
397
436
  * @default 256
398
437
  */
399
438
  maxEntries: number | null;
400
439
  }
401
440
  /** Identity of one delivery context. Do not put secrets or personal data in the id. */
402
441
  export interface SecurityContextOptions {
403
- /** Stable id for delivery after a page reload. An empty id gives this runtime a new id. */
442
+ /** Stable id for delivery after a page reload. With an empty id, the runtime creates one. */
404
443
  id: string;
405
444
  /**
406
- * Keep stored batches in separate contexts. With true, change delivery settings through
445
+ * Keep stored batches in separate contexts. When true, change the routing settings through
407
446
  * rotateSecurityContext() instead of configure().
408
447
  * @default true
409
448
  */
410
449
  isolation: boolean;
411
450
  }
412
- /** Delivery settings that the runtime replaces together when the security context changes. */
413
- export type DeliveryOptions = Pick<ObservabilityConfig, "endpoint" | "metricsEndpoint" | "tracesEndpoint" | "headers" | "credentials" | "transport" | "transportOnExit" | "transportWorker">;
414
- /** New security context. A delivery field that is not supplied resets to its default. */
451
+ /**
452
+ * Routing settings: where records go and how a request authenticates. The runtime replaces
453
+ * them together when the security context changes.
454
+ */
455
+ export type RoutingOptions = Pick<ObservabilityConfig, "endpoint" | "metricsEndpoint" | "tracesEndpoint" | "headers" | "credentials" | "transport" | "transportOnExit" | "transportWorker">;
456
+ /** New security context. Any routing field that is left out or undefined resets to its default. */
415
457
  export interface SecurityContextUpdate {
416
- /** New delivery context id. If not supplied, the runtime makes a new id. */
458
+ /** New delivery context id. If omitted, the runtime creates one. */
417
459
  id?: string;
418
- /** New delivery settings. A field that is not supplied resets to its default. */
419
- delivery: DeliveryOptions;
420
- /** New ambient attributes. If not supplied, the runtime removes the old attributes. */
460
+ /**
461
+ * New routing settings. Any field that is left out or undefined resets to its default, unlike
462
+ * configure(), because a rotation must not carry an old token into the new context. A key that
463
+ * isn't a routing setting reports `config.invalid` and the rotation ignores it, so the other
464
+ * settings stay.
465
+ */
466
+ routing: RoutingOptions;
467
+ /**
468
+ * New ambient attributes. If omitted, the runtime removes the old ones. A null or undefined
469
+ * value sets no key, as in setContext().
470
+ */
421
471
  context?: Record<string, unknown>;
422
472
  }
423
473
  /** Policy for old records. */
424
474
  export interface SecurityContextRotationOptions {
425
475
  /**
426
- * Rule for old records. "discard" removes them. "flush" tries delivery, then removes them.
427
- * "retain" keeps them in the old context. "carry" gives them to the new context.
476
+ * What to do with old records. "discard" removes them, and "flush" tries to deliver them
477
+ * before it removes them. "retain" keeps them in the old context, and "carry" moves them to
478
+ * the new context.
428
479
  * @default "discard"
429
480
  */
430
481
  pending?: "discard" | "flush" | "retain" | "carry";
431
482
  /**
432
- * Maximum wait for a flush of old records, in milliseconds.
483
+ * How long to wait for the old records to flush, in milliseconds. 0 to 600000. A value
484
+ * outside the range rejects the rotation.
485
+ * @default 5000
486
+ */
487
+ timeoutMs?: number;
488
+ }
489
+ /** Whose stored records `shutdown()` removes. */
490
+ export type StorageScope = "context" | "namespace";
491
+ /**
492
+ * What `shutdown()` does with the records that wait, and which storage it removes. A value that
493
+ * isn't an object reports `config.invalid` and discards.
494
+ */
495
+ export interface ShutdownOptions {
496
+ /**
497
+ * What to do with the records in memory. "flush" sends them, then runs the exit flush.
498
+ * "discard" sends nothing and reports each one to `onDrop` with the reason "discarded". A
499
+ * request in flight can still reach the server. Any other value reports `config.invalid` and
500
+ * discards.
501
+ * @default "flush"
502
+ */
503
+ pending?: "flush" | "discard";
504
+ /**
505
+ * Also removes the stored batches, the emergency queue entries, and the stored session id,
506
+ * tab id and journey. "context" removes the batches of the active security context and the
507
+ * ones a carry left, and "namespace" removes every batch in `storage.namespace`. It always
508
+ * discards, and with `pending: "flush"` it reports `config.invalid`. null removes nothing, as
509
+ * when unset. Any other value reports `config.invalid`, discards and removes the "context"
510
+ * scope. Before the first `configure()` call that works, no store is known, and it removes
511
+ * nothing. After an earlier `shutdown()`, it still removes the stopped runtime's stored data.
512
+ * Unset by default, which removes nothing.
513
+ */
514
+ clearStorage?: StorageScope | null;
515
+ }
516
+ /**
517
+ * How long `flush()` waits. Options that aren't an object report `config.invalid` and use the
518
+ * default. null or undefined options use the default with no report.
519
+ */
520
+ export interface FlushOptions {
521
+ /**
522
+ * How long to wait, in milliseconds. 0 to 600000. The wait also covers startup and the load
523
+ * of the delivery stack. A value that isn't a number in the range reports `config.invalid`
524
+ * and uses the default. null uses the default with no report.
433
525
  * @default 5000
434
526
  */
435
527
  timeoutMs?: number;
436
528
  }
437
529
  /**
438
530
  * What the library instruments automatically. By default, only `errors` and `rejections`
439
- * are on.
531
+ * are on. A capture that takes an options object also takes true for its defaults.
440
532
  */
441
533
  export interface CaptureOptions {
442
534
  /**
443
- * Changes a URL before capture records it. Applies to page, HTTP, resource and WebSocket URLs.
535
+ * Rewrites a URL before the capture records it. Applies to page, HTTP, resource and
536
+ * WebSocket URLs.
537
+ * Set null to remove it.
444
538
  * @param url Original URL, before the default URL changes.
445
- * @returns URL to record. Null, an invalid result or an exception gives an empty URL.
539
+ * @returns URL to record. Null, an invalid result or an exception produces an empty URL.
446
540
  */
447
- urlTransform?: (url: string) => string | null;
541
+ urlTransform?: ((url: string) => string | null) | null;
448
542
  /**
449
543
  * Log uncaught errors from `window.onerror`.
450
544
  * @default true
@@ -471,8 +565,8 @@ export interface CaptureOptions {
471
565
  */
472
566
  xhr: boolean;
473
567
  /**
474
- * Record the `http.client.request.duration` histogram of each request that `fetch` or `xhr`
475
- * capture sees. The histogram is in seconds.
568
+ * Record the `http.client.request.duration` histogram for every request the `fetch` or
569
+ * `xhr` capture sees. The histogram is in seconds.
476
570
  * @default true
477
571
  */
478
572
  httpMetrics: boolean;
@@ -487,79 +581,69 @@ export interface CaptureOptions {
487
581
  */
488
582
  navigation: boolean;
489
583
  /**
490
- * Report web vitals as metrics. This option requires `webVitalsLoader`.
584
+ * Report web vitals as metrics, and the navigation timing. LCP, CLS and INP need a loader.
491
585
  * @default false
492
586
  */
493
- webVitals: boolean;
587
+ webVitals: boolean | WebVitalsOptions;
494
588
  /**
495
- * Report long animation frames as the histogram `ui.long_frame.duration`. A long frame
589
+ * Report long animation frames as the `ui.long_frame.duration` histogram. A long frame
496
590
  * freezes the page. Browsers without `long-animation-frame` report `longtask` entries.
497
591
  * @default false
498
592
  */
499
- longFrames: boolean;
500
- /**
501
- * Minimum frame duration that `longFrames` reports, in milliseconds.
502
- * @default 100
503
- */
504
- longFrameThresholdMs: number;
593
+ longFrames: boolean | LongFramesOptions;
505
594
  /**
506
- * Record the app's console calls. `true` wraps `error` and `warn`. A list selects the methods.
507
- * `error` gives an ERROR record and `warn` gives a WARN record.
508
- * `info` and `log` give a breadcrumb only.
595
+ * Record the app's console calls. `true` wraps `error` and `warn`, and `levels` picks the
596
+ * methods.
509
597
  * @default false
510
598
  */
511
- console: boolean | CapturedConsoleMethod[];
599
+ console: boolean | ConsoleCaptureOptions;
512
600
  /**
513
- * Keep the query string and fragment on every URL the library records.
514
- * When off, the library removes them from page URLs, request targets and failed resource URLs.
601
+ * Keep the query string and fragment on every URL the library records. When off, they are
602
+ * removed from page URLs, request targets and failed resource URLs.
515
603
  * @default false
516
604
  */
517
605
  fullUrls: boolean;
518
606
  /**
519
- * URLs that the library does not log. The library always adds the ingest endpoint.
607
+ * URLs the library doesn't log. The ingest endpoint is always included.
520
608
  * @default []
521
609
  */
522
610
  ignoreUrls: (string | RegExp)[];
523
611
  /**
524
- * Targets that receive a `traceparent` header. A string is an origin and matches a request
525
- * to that origin only. A RegExp tests the full URL. Start each RegExp with `^`. A pattern that
526
- * matches all URLs breaks CORS on third-party endpoints.
612
+ * Targets that receive a `traceparent` header. A string is an origin and matches only
613
+ * requests to that origin. A RegExp tests the full URL. Start every RegExp with `^`, because
614
+ * a pattern that matches all URLs breaks CORS on third-party endpoints. Needs `fetch` or `xhr`.
527
615
  * @default []
528
616
  */
529
617
  propagateTraceHeaderTo: (string | RegExp)[];
530
618
  /**
531
- * Record the open, close and error events of each WebSocket, and count its messages in the
532
- * counter `ui.websocket.messages`. The library never records the content of a message.
619
+ * Record every WebSocket's open, close and error events, and count its messages in the
620
+ * `ui.websocket.messages` counter. Message content is never recorded.
533
621
  * @default false
534
622
  */
535
623
  webSocket: boolean;
536
624
  /**
537
- * Report a page of this tab that stopped without a clean close, for example after a crash.
538
- * The next page of the tab logs WARN `ui.unclean_exit`. It writes one sessionStorage key.
539
- * A popup with an opener reports nothing. `identity: "memory"` turns this capture off.
625
+ * Report a page in this tab that ended without a clean close, for example after a crash.
626
+ * The tab's next page logs WARN `ui.unclean_exit`. The capture writes one sessionStorage
627
+ * key. A popup with an opener reports nothing, and `identity: "memory"` turns this off.
540
628
  * @default false
541
629
  */
542
630
  uncleanExit: boolean;
543
631
  /**
544
- * Record each `performance.measure()` of the app in the histogram `ui.user_timing.duration`,
545
- * in milliseconds, with `user_timing.name`. Each `performance.mark()` adds a breadcrumb.
546
- * Names follow `fullUrls`.
632
+ * Record every `performance.measure()` the app makes in the `ui.user_timing.duration`
633
+ * histogram, in milliseconds, with `user_timing.name`. Every `performance.mark()` adds a
634
+ * breadcrumb. Names follow `fullUrls`.
547
635
  * @default false
548
636
  */
549
- userTiming: boolean;
550
- /**
551
- * Names of the marks and measures that userTiming records, as strings and RegExp patterns.
552
- * A string matches a part of the name. An empty list records each name.
553
- * @default []
554
- */
555
- userTimingInclude: (string | RegExp)[];
637
+ userTiming: boolean | UserTimingOptions;
556
638
  /**
557
639
  * Capture switches that remote sampling rules can change for their TTL. Privacy controls stay local.
640
+ * Needs `sampling.remote`.
558
641
  * @default []
559
642
  */
560
643
  remoteToggles: RemoteCaptureFlag[];
561
644
  /**
562
- * Add response Server-Timing entries to fetch and XHR records. Link a traceparent entry to the client span.
645
+ * Add the response's Server-Timing entries to fetch and XHR records, and link a traceparent
646
+ * entry to the client span.
563
647
  * @default false
564
648
  */
565
649
  serverTiming: boolean;
@@ -579,17 +663,15 @@ export interface CaptureOptions {
579
663
  */
580
664
  lifecycle: boolean;
581
665
  /**
582
- * Capture modules from the app. A new list replaces the list in force.
666
+ * Capture modules supplied by the app. A new list replaces the current one.
583
667
  * @default []
584
668
  */
585
669
  plugins: CapturePlugin[];
586
- /**
587
- * Supplies the `web-vitals` module without a hard dependency on the package.
588
- * @returns A promise that resolves to the `web-vitals` module.
589
- */
590
- webVitalsLoader?: () => Promise<WebVitalsModule>;
591
670
  }
592
- /** Serializer option after resolution. A name stays a name. The transport selects the implementation. */
671
+ /**
672
+ * Serializer option after resolution. A name stays a name, and the transport picks the
673
+ * implementation.
674
+ */
593
675
  export type SerializerChoice = "otlp" | "ecs" | LogSerializer;
594
676
  /** Part of the console prefix that a style applies to: the namespace or one level. */
595
677
  export type ConsoleStyleKey = "namespace" | LogLevel;
@@ -598,21 +680,16 @@ export type ConsoleStyleKey = "namespace" | LogLevel;
598
680
  * A browser applies it with `%c`. Node prints the text without the style.
599
681
  */
600
682
  export type ConsoleStyles = Partial<Record<ConsoleStyleKey, string>>;
601
- /** Object form of the console option. */
602
- export interface ConsoleOptions {
683
+ /** Object form of the consoleOutput option. */
684
+ export interface ConsoleOutputOptions {
603
685
  /**
604
- * Lowest level that the console prints. If you do not set it, the level in force stays.
605
- * If no level is in force, the console prints from DEBUG up.
686
+ * Lowest level the console prints. If you leave it unset, the current level stays, and a
687
+ * console that is off stays off.
606
688
  */
607
689
  level?: LogLevel;
608
- /** CSS for the namespace and for each level. A key that you do not set keeps its style. */
690
+ /** CSS for the namespace and for each level. Any key you leave unset keeps its style. */
609
691
  styles?: ConsoleStyles;
610
692
  }
611
- /**
612
- * Console mirroring. `false` turns it off. `true` prints records at DEBUG and above.
613
- * A level prints records at that level and above. An object sets the level and the styles.
614
- */
615
- export type ConsoleOption = boolean | LogLevel | ConsoleOptions;
616
693
  /** Console settings after resolution. */
617
694
  export interface ResolvedConsole {
618
695
  /** Lowest level that the console prints, or null when the console is off. */
@@ -621,21 +698,24 @@ export interface ResolvedConsole {
621
698
  styles: Required<ConsoleStyles>;
622
699
  }
623
700
  /**
624
- * Kind of a batch. A batch of metric records is "metrics" when `metricsEndpoint` is set. Its body
625
- * is then an OTLP `ExportMetricsServiceRequest`. A batch of span records is "traces". Its body is
626
- * an OTLP `ExportTraceServiceRequest`.
701
+ * Kind of batch. A batch of metric records is "metrics" when `metricsEndpoint` is set, and its
702
+ * body is then an OTLP `ExportMetricsServiceRequest`. A batch of span records is "traces",
703
+ * with an OTLP `ExportTraceServiceRequest` as its body.
627
704
  */
628
705
  export type BatchKind = "logs" | "metrics" | "traces";
629
- /** One batch that the library gives to a custom transport. */
706
+ /** One batch that the library hands to a custom transport. */
630
707
  export interface TransportRequest {
631
708
  /**
632
- * Abort signal for this delivery context. It aborts at `shutdown()` and at a rotation. A custom
633
- * transport must check it to cancel its work.
709
+ * Abort signal for this delivery context. It aborts on `shutdown()` and on a rotation. A
710
+ * custom transport must check it to cancel its work.
634
711
  */
635
712
  signal?: AbortSignal;
636
713
  /** Delivery context of this batch. */
637
714
  routingContextId?: string;
638
- /** Kind of the batch. Send a "metrics" body to your metrics endpoint, and a "traces" body to your traces endpoint. */
715
+ /**
716
+ * Kind of batch. Send a "metrics" body to your metrics endpoint and a "traces" body to your
717
+ * traces endpoint.
718
+ */
639
719
  kind: BatchKind;
640
720
  /** Serialized batch from the configured serializer. The library does not compress it. */
641
721
  body: string;
@@ -643,16 +723,16 @@ export interface TransportRequest {
643
723
  contentType: string;
644
724
  /** Batch id. Send it to the server for deduplication, for example as `X-UiObs-Batch-Id`. */
645
725
  batchId: string;
646
- /** Number of earlier send attempts. It is 0 for the first send. */
726
+ /** Number of earlier send attempts, 0 for the first send. */
647
727
  attempt: number;
648
- /** Built records after `redact`. Do not change them. The retry engine can send them again. */
728
+ /** Built records after `redact`. Don't change them, because the retry engine can resend them. */
649
729
  records: readonly LogRecord[];
650
730
  }
651
- /** Answer of a custom transport. The status code has the meaning of the ingest contract. */
731
+ /** A custom transport's answer. The status code means what it does in the ingest contract. */
652
732
  export interface TransportResponse {
653
733
  /**
654
734
  * HTTP-like status code. 2xx accepts the batch. 413 splits it. 429 and 503 throttle.
655
- * 408 and 5xx retry. Each other code drops the batch.
735
+ * 408 and 5xx retry. Any other code drops the batch.
656
736
  */
657
737
  status: number;
658
738
  /** Delay before the next send, for 429 and 503, in milliseconds. */
@@ -660,18 +740,18 @@ export interface TransportResponse {
660
740
  /** Largest payload that the server accepts, for 413, in bytes. */
661
741
  maxBytes?: number;
662
742
  /**
663
- * Sampling rules for a 2xx answer, as the header text or as a parsed object.
664
- * The library reads it only with `sampling.remote`.
743
+ * Sampling rules for a 2xx answer, as the header text or as a parsed object. Only read when
744
+ * `sampling.remote` is on.
665
745
  */
666
746
  sampling?: unknown;
667
747
  /** `Date` header of a 2xx answer. The library computes `uiobs.clock_offset_ms` from it. */
668
748
  date?: string;
669
749
  }
670
750
  /**
671
- * Sends one batch through a channel of the app, such as an API client, a WebSocket or IPC.
672
- * A rejected promise counts as a network error. The library then sends the batch again.
751
+ * Sends one batch through one of the app's own channels, such as an API client, a WebSocket
752
+ * or IPC. A rejected promise counts as a network error, so the library sends the batch again.
673
753
  * @param request Batch to send.
674
- * @returns Promise that resolves to the answer of the server.
754
+ * @returns Promise that resolves to the server's answer.
675
755
  */
676
756
  export type Transport = (request: TransportRequest) => Promise<TransportResponse>;
677
757
  /**
@@ -681,14 +761,15 @@ export type Transport = (request: TransportRequest) => Promise<TransportResponse
681
761
  */
682
762
  export type ExitTransport = (request: TransportRequest) => boolean;
683
763
  /** Request timing, retry timing and delivery capacity. Durations are in milliseconds. */
684
- export interface DeliveryPolicy {
764
+ export interface DeliveryOptions {
685
765
  /**
686
- * Maximum wait for one request. The value must be at least 1.
766
+ * Maximum wait for one request. Must be at least 1.
687
767
  * @default 15000
688
768
  */
689
769
  requestTimeoutMs: number;
690
770
  /**
691
- * Maximum requests that have not completed. The value must be at least 1.
771
+ * Maximum live requests in flight at once. Must be at least 1. The retry drain sends one
772
+ * stored batch at a time on top of this limit.
692
773
  * @default 2
693
774
  */
694
775
  maxConcurrentRequests: number;
@@ -698,104 +779,115 @@ export interface DeliveryPolicy {
698
779
  */
699
780
  retryBaseDelayMs: number;
700
781
  /**
701
- * Maximum retry delay. It must be at least retryBaseDelayMs.
782
+ * Maximum retry delay. Must be at least retryBaseDelayMs.
702
783
  * @default 60000
703
784
  */
704
785
  retryMaxDelayMs: number;
705
786
  /**
706
- * Wait before the next check for stored work.
707
- * @default 30000
708
- */
709
- retryIdleDelayMs: number;
710
- /**
711
- * Maximum batches in one delivery pass. The value must be at least 1.
712
- * @default 20
713
- */
714
- batchesPerDrain: number;
715
- /**
716
- * Fetch priority of each batch request. With "low", the requests of the app go first.
717
- * The exit flush and a keepalive send from a hidden page use the browser default.
787
+ * Fetch priority of every batch request. With "low", the app's own requests go first. The
788
+ * exit flush and a keepalive send from a hidden page use the browser default.
718
789
  * @default "low"
719
790
  */
720
791
  priority: "low" | "auto" | "high";
721
792
  }
722
- /** Record and byte limits for the live delivery buffers. */
723
- export interface BufferingPolicy {
793
+ /** Record and byte limits for the live delivery buffers, and the cap of a hold buffer. */
794
+ export interface BufferingOptions {
724
795
  /**
725
- * Maximum records in the buffers and requests. Set 0 for no record limit.
796
+ * Maximum records in the buffers and requests, 1 or more. Set null for no record limit.
726
797
  * @default 10000
727
798
  */
728
- maxPendingRecords: number;
799
+ maxPendingRecords: number | null;
729
800
  /**
730
- * Maximum encoded JSON bytes in the buffers and requests. Set 0 for no byte limit.
801
+ * Maximum encoded JSON bytes in the buffers and requests, 1 or more. Set null for no byte
802
+ * limit.
731
803
  * @default 16777216
732
804
  */
733
- maxPendingBytes: number;
805
+ maxPendingBytes: number | null;
806
+ /**
807
+ * Maximum records other than actions in one hold buffer. A hold buffer keeps the records
808
+ * that arrive before startup ends, or while the sender loads. A full one keeps its first
809
+ * 100 records and drops the oldest record after them. A lower value removes no held record.
810
+ * 200 to 10000.
811
+ * @default 500
812
+ */
813
+ maxHeldRecords: number;
734
814
  /**
735
- * Rule when a new record does not fit. Remove old records, drop the new record, or try storage.
815
+ * What to do when a new record does not fit: remove old records, drop the new record, or
816
+ * try storage.
736
817
  * @default "drop-oldest"
737
818
  */
738
819
  overflow: "drop-oldest" | "drop-newest" | "persist";
739
820
  }
740
- /** Metric capacity in one collection interval. */
741
- export interface MetricsPolicy {
821
+ /** The metric interval, and the metric capacity in one interval. */
822
+ export interface MetricsOptions {
823
+ /**
824
+ * How often counters, histograms and profiler probes send their points, in milliseconds. A
825
+ * partial metric batch also waits this long before it is sent. 1000 to 600000.
826
+ * @default 10000
827
+ */
828
+ intervalMs: number;
742
829
  /**
743
- * Maximum histogram boundaries. Set 0 for no limit.
830
+ * Maximum histogram boundaries. With 0, only a histogram without boundaries is valid. Set
831
+ * null for no limit.
744
832
  * @default 50
745
833
  */
746
- maxHistogramBoundaries: number;
834
+ maxHistogramBoundaries: number | null;
747
835
  /**
748
- * Maximum attribute sets per instrument. Extra sets use the overflow set. Set 0 for no limit.
836
+ * Maximum attribute sets per instrument. Extra sets go into the overflow set, so 0 puts every
837
+ * value there. Set null for no limit.
749
838
  * @default 100
750
839
  */
751
- maxSeries: number;
840
+ maxSeries: number | null;
752
841
  /**
753
- * Maximum instrument names. Drop extra names. Set 0 for no limit.
842
+ * Maximum instrument names. Extra names are dropped, so 0 drops every metric value. Set null
843
+ * for no limit.
754
844
  * @default 1000
755
845
  */
756
- maxInstruments: number;
846
+ maxInstruments: number | null;
757
847
  }
758
848
  /** Session and trace timing. The runtime sets these values at startup. */
759
- export interface CorrelationPolicy {
849
+ export interface CorrelationOptions {
760
850
  /**
761
- * Maximum idle time of a stored session, in milliseconds. Set 0 for no idle expiration.
851
+ * How long a stored session can stay idle, in milliseconds, 1 or more. Set null for no idle
852
+ * expiration.
762
853
  * @default 1800000
763
854
  */
764
- sessionIdleMs: number;
765
- /**
766
- * Minimum wait between session activity writes, in milliseconds. Set 0 to write each time.
767
- * @default 60000
768
- */
769
- sessionTouchMs: number;
855
+ sessionIdleMs: number | null;
770
856
  /**
771
- * Maximum idle time of an ambient trace, in milliseconds. Set 0 for no idle expiration.
857
+ * Maximum age of an ambient trace, in milliseconds, 1 or more. The age counts from the trace's
858
+ * start, and the next record after it gets a new trace. Set null for no age limit.
772
859
  * @default 300000
773
860
  */
774
- traceMaxAgeMs: number;
861
+ traceMaxAgeMs: number | null;
775
862
  }
776
863
  /** Rules for diagnostic reports and the console fallback. */
777
- export interface DiagnosticsPolicy {
864
+ export interface DiagnosticsOptions {
778
865
  /**
779
- * Minimum wait between reports of one code, in milliseconds. Set 0 to report each event.
866
+ * Minimum wait between reports of one code, in milliseconds. Set 0 to report every event.
780
867
  * @default 1000
781
868
  */
782
869
  throttleMs: number;
783
870
  /**
784
- * Print a fixed warning if onDiagnostic throws. Do not print the exception.
871
+ * Print a fixed warning if onDiagnostic throws. The exception itself is not printed.
785
872
  * @default false
786
873
  */
787
874
  consoleFallback: boolean;
788
875
  /**
789
- * Also send each reported diagnostic as a record in the namespace `uiobs.diagnostics`.
790
- * A list of codes sends only those codes. The interval of `throttleMs` applies. A diagnostic
791
- * of the first `configure()` gives no record. In a record, the `url` and `endpoint` detail
792
- * fields have no query and no fragment. `onDiagnostic` gets the full values.
876
+ * Also send every reported diagnostic as a record in the `uiobs.diagnostics` namespace. A
877
+ * list of codes sends only those codes. The `throttleMs` interval applies. A diagnostic from
878
+ * the first `configure()` produces no record. In a record, the `url` and `endpoint` detail
879
+ * fields have no query and no fragment, while `onDiagnostic` gets the full values.
793
880
  * @default false
794
881
  */
795
882
  records: boolean | DiagnosticCode[];
796
883
  }
797
- /** Application storage settings. The runtime sets these values at startup. */
798
- export interface PersistencePolicy {
884
+ /** Storage of undelivered batches. Can't be changed after startup. */
885
+ export interface StorageOptions {
886
+ /**
887
+ * Backing store for undelivered batches. "auto" picks the best one the host supports.
888
+ * @default "auto"
889
+ */
890
+ backend: StorageStrategy;
799
891
  /**
800
892
  * Namespace for batch storage and emergency queues. An empty value uses the previous storage keys.
801
893
  * @default ""
@@ -809,9 +901,9 @@ export interface PersistencePolicy {
809
901
  requestPersistent: boolean;
810
902
  }
811
903
  /** Resource and page fields that the SDK records. */
812
- export interface MetadataPolicy {
904
+ export interface MetadataOptions {
813
905
  /**
814
- * Record the page URL. With false, page.url is empty.
906
+ * Record the page URL. When false, page.url is empty.
815
907
  * @default true
816
908
  */
817
909
  pageUrl: boolean;
@@ -826,108 +918,272 @@ export interface MetadataPolicy {
826
918
  */
827
919
  openfin: boolean;
828
920
  /**
829
- * Add `uiobs.clock_offset_ms` to each log and span record. The value comes from the `Date`
830
- * header of the last accepted answer. The server must expose that header.
921
+ * Add `uiobs.clock_offset_ms` to every log and span record. The value comes from the `Date`
922
+ * header of the last accepted answer, so the server must expose that header.
831
923
  * @default true
832
924
  */
833
925
  clockOffset: boolean;
834
926
  }
835
927
  /** Capture capacity, duplicate checks and rate limits. */
836
- export interface CapturePolicy {
928
+ export interface CaptureLimitsOptions {
837
929
  /**
838
930
  * Maximum breadcrumbs to keep. Set 0 to keep none.
839
931
  * @default 50
840
932
  */
841
933
  breadcrumbs: number;
842
934
  /**
843
- * Time to suppress repeated errors, in milliseconds. Set 0 to report each error.
935
+ * How long repeated errors are suppressed, in milliseconds. Set 0 to report every error.
844
936
  * @default 5000
845
937
  */
846
938
  errorDedupeMs: number;
847
939
  /**
848
- * Maximum error signatures to keep for duplicate checks. Set 0 for no limit.
849
- * @default 200
940
+ * Maximum captured errors in one window. Set 0 to capture none, or null for no limit.
941
+ * @default 20
850
942
  */
851
- maxErrorSignatures: number;
943
+ errorsPerWindow: number | null;
852
944
  /**
853
- * Maximum captured errors in one window. Set 0 for no limit.
945
+ * Maximum captured console records in one window. Set 0 to capture none, or null for no
946
+ * limit.
854
947
  * @default 20
855
948
  */
856
- errorsPerWindow: number;
949
+ consolePerWindow: number | null;
857
950
  /**
858
- * Maximum captured console records in one window. Set 0 for no limit.
951
+ * Maximum long frames in one window. Set 0 to capture none, or null for no limit.
859
952
  * @default 20
860
953
  */
861
- consolePerWindow: number;
954
+ longFramesPerWindow: number | null;
862
955
  /**
863
- * Maximum long frames in one window. Set 0 for no limit.
956
+ * Maximum WebSocket events in one window. Set 0 to capture none, or null for no limit.
864
957
  * @default 20
865
958
  */
866
- longFramesPerWindow: number;
959
+ webSocketPerWindow: number | null;
960
+ /** Maximum reports in one window. Set 0 to capture none, or null for no limit. @default 20 */
961
+ reportsPerWindow: number | null;
962
+ /**
963
+ * Maximum resource entries in one window. Set 0 to capture none, or null for no limit.
964
+ * @default 100
965
+ */
966
+ resourcesPerWindow: number | null;
867
967
  /**
868
- * Maximum WebSocket events in one window. Set 0 for no limit.
968
+ * Maximum lifecycle events in one window. Set 0 to capture none, or null for no limit.
869
969
  * @default 20
870
970
  */
871
- webSocketPerWindow: number;
872
- /** Maximum reports in one window. Set 0 for no limit. @default 20 */
873
- reportsPerWindow: number;
874
- /** Maximum resource entries in one window. Set 0 for no limit. @default 100 */
875
- resourcesPerWindow: number;
876
- /** Maximum lifecycle events in one window. Set 0 for no limit. @default 20 */
877
- lifecyclePerWindow: number;
971
+ lifecyclePerWindow: number | null;
878
972
  /**
879
- * Rate limit window, in milliseconds. Set 0 to reset the window for each event.
973
+ * Window of the capture rate limits above, in milliseconds, 1 or more. To turn the rate
974
+ * limits off, set the limits of each window to null.
880
975
  * @default 10000
881
976
  */
882
977
  windowMs: number;
883
- /**
884
- * Maximum log records at or above `sampling.alwaysSampleFrom` in one window. Metric points
885
- * and spans do not count.
886
- * Set 0 for no limit.
887
- * @default 500
888
- */
889
- errorCeiling: number;
890
978
  }
891
979
  /** Records that minLevel or sampling drops, kept for the next error. */
892
- export interface DebugBufferPolicy {
980
+ export interface DebugBufferOptions {
893
981
  /**
894
- * Keep the records that minLevel or sampling drops. An ERROR or FATAL record of this context
895
- * sends them first, with `uiobs.debug_buffer: true`. A later change of `redact` or `processors`
896
- * empties the buffer.
982
+ * Keep the records that minLevel or sampling drops. An ERROR or FATAL record from this
983
+ * context sends them first, with `uiobs.debug_buffer: true`. A later change to `redact` or
984
+ * `processors` empties the buffer.
897
985
  * @default false
898
986
  */
899
987
  enabled: boolean;
900
988
  /**
901
- * Maximum kept records. The oldest record leaves first. The range is 1 to 10000.
989
+ * Maximum kept records. The oldest record is dropped first. 1 to 10000.
902
990
  * @default 200
903
991
  */
904
992
  maxRecords: number;
905
993
  /**
906
- * Maximum age of a kept record when the library reads it, in milliseconds. Set 0 for no limit.
994
+ * Maximum age of a kept record when the library reads it, in milliseconds, 1 or more. Set
995
+ * null for no age limit.
907
996
  * @default 60000
908
997
  */
909
- maxAgeMs: number;
998
+ maxAgeMs: number | null;
999
+ }
1000
+ /** Duration probes. Each probe is reported as a histogram summary record. */
1001
+ export interface ProfilerOptions {
1002
+ /**
1003
+ * Record probe durations. When false, probes do nothing and don't even read the clock.
1004
+ * @default false
1005
+ */
1006
+ enabled: boolean;
1007
+ /**
1008
+ * Maximum number of probes, 1 to 1024. Can't be changed after startup.
1009
+ * @default 64
1010
+ */
1011
+ maxProbes: number;
1012
+ /**
1013
+ * Attribute the phases of each long animation frame to every probe that had a span of 1 ms
1014
+ * or more in it. The phases are script, render callbacks, style and layout, and forced
1015
+ * layout. Needs `enabled` and a browser that supports long animation frames.
1016
+ * @default false
1017
+ */
1018
+ framePhases: boolean;
1019
+ /**
1020
+ * Measure the time between frames with the `frame.interval` probe. Needs `enabled`. Runs one
1021
+ * frame callback per frame while the page is visible.
1022
+ * @default false
1023
+ */
1024
+ framePacing: boolean;
1025
+ }
1026
+ /**
1027
+ * Session replay. The app's recorder records the DOM, and the library keeps the recent events
1028
+ * in memory and sends them in segments after an error.
1029
+ */
1030
+ export interface ReplayOptions {
1031
+ /**
1032
+ * Record the DOM. Needs `loader`, plus either `endpoint` or `onSegment`.
1033
+ * @default false
1034
+ */
1035
+ enabled: boolean;
1036
+ /**
1037
+ * `"onError"` uploads the buffer after an ERROR or FATAL record.
1038
+ * @default "onError"
1039
+ */
1040
+ mode: ReplayMode;
1041
+ /**
1042
+ * URL that each segment is POSTed to. This is separate from the log endpoint. Set null to
1043
+ * turn it off. An empty or blank string also turns it off, and reports `config.invalid`.
1044
+ * @default null
1045
+ */
1046
+ endpoint: string | null;
1047
+ /**
1048
+ * When true, nothing is recorded until `startReplay()` is called.
1049
+ * @default false
1050
+ */
1051
+ requireConsent: boolean;
1052
+ /**
1053
+ * How much time before an error the buffer keeps, in milliseconds. At any moment the buffer
1054
+ * holds between 1x and 1.5x this much. 5000 to 600000.
1055
+ * @default 60000
1056
+ */
1057
+ bufferMs: number;
1058
+ /**
1059
+ * Maximum buffer size, measured as the JSON length of its events. When it is exceeded, the
1060
+ * buffer drops its oldest part. 100000 to 200000000.
1061
+ * @default 10000000
1062
+ */
1063
+ maxBufferBytes: number;
1064
+ /**
1065
+ * How long the library keeps sending events after an error, in milliseconds. Another error
1066
+ * inside that time doesn't extend it. 0 to 600000.
1067
+ * @default 5000
1068
+ */
1069
+ afterErrorMs: number;
1070
+ /**
1071
+ * Maximum uploads in one `uploadWindowMs` window. Set 0 to upload nothing, or null for no
1072
+ * limit.
1073
+ * @default 3
1074
+ */
1075
+ uploadsPerWindow: number | null;
1076
+ /**
1077
+ * Length of the `uploadsPerWindow` window, in milliseconds, 1 or more.
1078
+ * @default 10000
1079
+ */
1080
+ uploadWindowMs: number;
1081
+ /**
1082
+ * Maximum events in one segment. 1 to 10000.
1083
+ * @default 200
1084
+ */
1085
+ maxSegmentEvents: number;
1086
+ /**
1087
+ * Maximum segment size, measured as the JSON length of its events. A single event larger
1088
+ * than this gets a segment to itself. 10000 to 10000000.
1089
+ * @default 512000
1090
+ */
1091
+ maxSegmentBytes: number;
1092
+ /**
1093
+ * How long a partial segment waits before it is sent, in milliseconds. 100 to 60000.
1094
+ * @default 2000
1095
+ */
1096
+ flushIntervalMs: number;
1097
+ /**
1098
+ * Maximum total size of the segments waiting to be sent. When it is exceeded, the library
1099
+ * drops the oldest segment. 100000 to 200000000.
1100
+ * @default 20000000
1101
+ */
1102
+ maxQueueBytes: number;
1103
+ /**
1104
+ * Maximum send attempts per segment. 1 to 10.
1105
+ * @default 3
1106
+ */
1107
+ maxAttempts: number;
1108
+ /**
1109
+ * Mask all element text. Only text inside an element with `data-observability-unmask` is left alone.
1110
+ * The recorder does not mask attribute values, URLs, CSS text or comments.
1111
+ * @default true
1112
+ */
1113
+ maskText: boolean;
1114
+ /**
1115
+ * Mask the value of every `input`, `textarea` and `select`, including hidden and file
1116
+ * inputs. Password inputs are always masked. The recorder does not mask the `value` of
1117
+ * checkboxes, radio buttons, buttons or `<option>` elements.
1118
+ * @default true
1119
+ */
1120
+ maskInputs: boolean;
1121
+ /**
1122
+ * Record canvas elements.
1123
+ * @default false
1124
+ */
1125
+ recordCanvas: boolean;
1126
+ /**
1127
+ * CSS selectors for elements whose text is always masked.
1128
+ * @default []
1129
+ */
1130
+ maskSelectors: string[];
1131
+ /**
1132
+ * CSS selectors for elements the recorder should skip entirely. The recorder also always
1133
+ * skips `[data-observability-ignore]`, the regions click capture ignores.
1134
+ * @default []
1135
+ */
1136
+ blockSelectors: string[];
1137
+ /**
1138
+ * Loads the recorder, e.g. `() => import("@rrweb/record")`.
1139
+ * @default null
1140
+ */
1141
+ loader: ReplayLoader | null;
1142
+ /**
1143
+ * Receives each segment instead of the POST to `endpoint`.
1144
+ * @default null
1145
+ */
1146
+ onSegment: ((segment: ReplaySegment) => void | Promise<void>) | null;
1147
+ /**
1148
+ * Request headers for `endpoint`, or a function that returns them. The log endpoint's
1149
+ * `headers` are never sent to the replay endpoint.
1150
+ * @default null
1151
+ */
1152
+ headers: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>) | null;
1153
+ /**
1154
+ * Loaders for the recorder's record plugins.
1155
+ * @default []
1156
+ */
1157
+ plugins: ReplayPluginLoader[];
1158
+ /**
1159
+ * Extra options for the `record` function, such as `sampling` and `slimDOMOptions`. The
1160
+ * library sets the mask, block, canvas, plugin and event options itself and ignores them here.
1161
+ * @default {}
1162
+ */
1163
+ recordOptions: Record<string, unknown>;
910
1164
  }
911
1165
  /** Options passed to `configure()`. */
912
1166
  export interface ObservabilityConfig {
913
1167
  /** Capture capacity and rate limits. */
914
- capturePolicy?: Partial<CapturePolicy>;
1168
+ captureLimits?: Partial<CaptureLimitsOptions>;
915
1169
  /** Resource and page fields to record. */
916
- metadata?: Partial<MetadataPolicy>;
917
- /** Application storage namespace. */
918
- persistence?: Partial<PersistencePolicy>;
1170
+ metadata?: Partial<MetadataOptions>;
919
1171
  /** Diagnostic report and console fallback settings. */
920
- diagnostics?: Partial<DiagnosticsPolicy>;
1172
+ diagnostics?: Partial<DiagnosticsOptions>;
921
1173
  /** Session and trace timing. */
922
- correlation?: Partial<CorrelationPolicy>;
923
- /** Metric capacity in one interval. */
924
- metrics?: Partial<MetricsPolicy>;
1174
+ correlation?: Partial<CorrelationOptions>;
1175
+ /** The metric interval and the metric capacity in one interval. */
1176
+ metrics?: Partial<MetricsOptions>;
925
1177
  /** Live buffer capacity and the overflow rule. */
926
- buffering?: Partial<BufferingPolicy>;
1178
+ buffering?: Partial<BufferingOptions>;
927
1179
  /** Request timing and delivery capacity. */
928
- delivery?: Partial<DeliveryPolicy>;
1180
+ delivery?: Partial<DeliveryOptions>;
929
1181
  /** Records that minLevel or sampling drops, kept for the next error. */
930
- debugBuffer?: Partial<DebugBufferPolicy>;
1182
+ debugBuffer?: Partial<DebugBufferOptions>;
1183
+ /** Duration probes. Each probe is reported as a histogram summary record. */
1184
+ profiler?: Partial<ProfilerOptions>;
1185
+ /** Session replay. Off by default. */
1186
+ replay?: Partial<ReplayOptions>;
931
1187
  /**
932
1188
  * Refuse changes through configure(). Call setConfigurationLocked(false) to permit changes again.
933
1189
  * @default false
@@ -938,51 +1194,65 @@ export interface ObservabilityConfig {
938
1194
  /** Delivery identity and isolation rule. Use rotateSecurityContext() to change the identity. */
939
1195
  securityContext?: Partial<SecurityContextOptions>;
940
1196
  /**
941
- * Ingest endpoint URL. Set `null` for console-only mode.
942
- * In console-only mode, the library sends nothing. It writes records to the console
943
- * if you set `console`.
944
- * If the key is missing or `""`, the library reports `config.invalid`.
1197
+ * Ingest endpoint URL. Set `null` for console-only mode, where the library sends nothing
1198
+ * and writes records to the console only if you set `consoleOutput`. If the key is missing or
1199
+ * `""`, the library reports `config.invalid`. A relative URL resolves against the page, and a
1200
+ * URL with a user name or a password is refused.
945
1201
  */
946
1202
  endpoint?: string | null;
947
1203
  /**
948
- * OTLP metrics endpoint URL, for example `"https://ingest.example/v1/metrics"`. With this key,
949
- * the library sends each batch of metric records there as an OTLP `ExportMetricsServiceRequest`.
950
- * Without it, metric records are log records on `endpoint`. The key needs `serializer: "otlp"`.
951
- * Set `""` to turn it off.
952
- * @default ""
1204
+ * OTLP metrics endpoint URL, for example `"https://ingest.example/v1/metrics"`. When set,
1205
+ * the library sends every batch of metric records there as an OTLP
1206
+ * `ExportMetricsServiceRequest`. Without it, metric records are log records on `endpoint`.
1207
+ * Needs `serializer: "otlp"`. Set null to turn it off. A blank string also turns it off, and
1208
+ * reports `config.invalid`.
1209
+ * @default null
953
1210
  */
954
- metricsEndpoint?: string;
1211
+ metricsEndpoint?: string | null;
955
1212
  /**
956
- * OTLP traces endpoint URL, for example `"https://ingest.example/v1/traces"`. With this key, the
957
- * library records one root span for each trace of the library, and one CLIENT span for each
958
- * request that gets `traceparent`. It sends them there as an OTLP `ExportTraceServiceRequest`.
959
- * Without it, the library sends no span. The key needs `serializer: "otlp"`. Set `""` to turn
960
- * it off.
961
- * @default ""
1213
+ * OTLP traces endpoint URL, for example `"https://ingest.example/v1/traces"`. When set, the
1214
+ * library records one root span for every trace it creates and one CLIENT span for every
1215
+ * request that gets `traceparent`, and sends them there as an OTLP
1216
+ * `ExportTraceServiceRequest`. Without it, the library sends no spans. Needs
1217
+ * `serializer: "otlp"`. Set null to turn it off. A blank string also turns it off, and reports
1218
+ * `config.invalid`.
1219
+ * @default null
962
1220
  */
963
- tracesEndpoint?: string;
1221
+ tracesEndpoint?: string | null;
964
1222
  /**
965
- * The library reports this value as `service.name`.
1223
+ * Reported as `service.name`.
966
1224
  * @default ""
967
1225
  */
968
1226
  serviceName?: string;
969
1227
  /**
970
- * The library reports this value as `service.version`.
1228
+ * Reported as `service.version`.
971
1229
  * @default ""
972
1230
  */
973
1231
  serviceVersion?: string;
974
1232
  /**
975
- * The library reports this value as `deployment.environment`.
1233
+ * Reported as `deployment.environment`.
976
1234
  * @default ""
977
1235
  */
978
1236
  environment?: string;
979
1237
  /**
980
- * Master switch. With false, each log call does nothing.
1238
+ * Master switch. False pauses the library, also in the first `configure()` call. Log calls
1239
+ * then do nothing. The pause first sends the open interval of the counters, histograms and
1240
+ * probes, and they then record nothing. The library removes its captures, the replay recorder
1241
+ * and its network patches, so it adds no trace header. The sender sends nothing, and the pause
1242
+ * stores no new record. Storage still changes in four cases: a request in flight at the pause
1243
+ * fails and stores its batch, a sender load that ends during the pause moves the emergency
1244
+ * queue into storage, a `retain` rotation stores the waiting records, and a `discard` or
1245
+ * `flush` rotation removes the old context's stored batches.
1246
+ * Records collected before the pause stay in memory or in storage, and they go out after
1247
+ * `enabled: true`. The bus of a running runtime stays connected. A record from a child
1248
+ * context is lost with the `onDrop` reason "disabled", also in a paused forwarder. A first
1249
+ * `configure()` call with `enabled: false` writes nothing to storage and starts no bus.
981
1250
  * @default true
982
1251
  */
983
1252
  enabled?: boolean;
984
1253
  /**
985
- * Copy payloads at the call, or keep their references until idle time. The debug buffer always builds at the call.
1254
+ * Copy payloads at the call, or keep references to them until idle time. The debug buffer
1255
+ * always builds at the call.
986
1256
  * @default "copy"
987
1257
  */
988
1258
  payloadMode?: "copy" | "defer";
@@ -993,40 +1263,44 @@ export interface ObservabilityConfig {
993
1263
  minLevel?: LogLevel;
994
1264
  /**
995
1265
  * Minimum level for each namespace prefix. The longest matching prefix wins. For example,
996
- * `{ "trading.ticks": "DEBUG" }` logs the DEBUG records of `trading.ticks` and of its child
997
- * namespaces. A namespace with no match uses `minLevel`. A new map replaces the map in force.
1266
+ * `{ "trading.ticks": "DEBUG" }` logs the DEBUG records of `trading.ticks` and its child
1267
+ * namespaces. A namespace with no match uses `minLevel`. A new map replaces the current one.
998
1268
  * @default {}
999
1269
  */
1000
1270
  minLevels?: Record<string, LogLevel>;
1001
1271
  /**
1002
- * Set "gzip" to compress a payload that is larger than the compression threshold.
1003
- * Set "none" for an ingest endpoint that rejects gzip.
1272
+ * "gzip" compresses any payload larger than the compression threshold. Use "none" for an
1273
+ * ingest endpoint that rejects gzip.
1004
1274
  * @default "gzip"
1005
1275
  */
1006
1276
  compression?: "gzip" | "none";
1007
1277
  /**
1008
- * Payload format. Give a name or a custom implementation.
1278
+ * Payload format, either a name or a custom implementation.
1009
1279
  * @default "otlp"
1010
1280
  */
1011
1281
  serializer?: SerializerChoice;
1012
1282
  /**
1013
- * The library passes this value to `fetch`. Set "include" for an ingest endpoint that
1014
- * authenticates with cookies.
1283
+ * Passed to `fetch`. Set "include" for an ingest endpoint that authenticates with cookies.
1015
1284
  * @default "omit"
1016
1285
  */
1017
1286
  credentials?: RequestCredentials;
1018
- /** Extra request headers, or a function returning them. `undefined` removes the headers. */
1019
- headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
1020
1287
  /**
1021
- * Backing store for undelivered records.
1022
- * @default "auto"
1288
+ * Extra request headers, or a function returning them. undefined keeps the current headers.
1289
+ * With isolation off, null removes them. With isolation on, the default, use
1290
+ * rotateSecurityContext() at logout, because configure() refuses a routing change. The
1291
+ * library has no default headers.
1292
+ */
1293
+ headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>) | null;
1294
+ /**
1295
+ * Backing store, namespace and persistence request for undelivered batches. Can't be changed
1296
+ * after startup.
1297
+ * @see {@link StorageOptions}
1023
1298
  */
1024
- storage?: StorageStrategy;
1299
+ storage?: Partial<StorageOptions>;
1025
1300
  /**
1026
- * Selects where the library keeps session, tab and journey ids.
1027
- * Set "memory" to write no key to localStorage or sessionStorage.
1028
- * With "memory", each page load starts a new session.
1029
- * You cannot change this value after startup.
1301
+ * Where the library keeps session, tab and journey ids. "memory" writes no key to
1302
+ * localStorage or sessionStorage, so every page load starts a new session. Can't be changed
1303
+ * after startup.
1030
1304
  * @default "storage"
1031
1305
  */
1032
1306
  identity?: IdentityStrategy;
@@ -1046,7 +1320,7 @@ export interface ObservabilityConfig {
1046
1320
  */
1047
1321
  journey?: Partial<JourneyOptions>;
1048
1322
  /**
1049
- * Batch size and flush interval of each record stream.
1323
+ * Batch size and flush interval for each record stream.
1050
1324
  * @see {@link BatchingOptions}
1051
1325
  */
1052
1326
  batching?: Partial<BatchingOptions>;
@@ -1057,120 +1331,133 @@ export interface ObservabilityConfig {
1057
1331
  retention?: Partial<RetentionOptions>;
1058
1332
  /**
1059
1333
  * Size limits for each record.
1060
- * @see {@link LimitOptions}
1334
+ * @see {@link LimitsOptions}
1061
1335
  */
1062
- limits?: Partial<LimitOptions>;
1336
+ limits?: Partial<LimitsOptions>;
1063
1337
  /**
1064
1338
  * Automatic instrumentation.
1065
1339
  * @see {@link CaptureOptions}
1066
1340
  */
1067
1341
  capture?: Partial<CaptureOptions>;
1068
1342
  /**
1069
- * Console mirroring. The line format is `[namespace][LEVEL] message`.
1343
+ * Prints records to the browser console. The line format is `[namespace][LEVEL] message`.
1344
+ * `false` turns it off, and `true` prints records at DEBUG and above. A level prints records
1345
+ * at that level and above. An object sets the level and the styles.
1070
1346
  * @default false
1071
1347
  */
1072
- console?: ConsoleOption;
1348
+ consoleOutput?: boolean | LogLevel | ConsoleOutputOptions;
1073
1349
  /**
1074
- * Sends batches through a channel of the app in place of HTTP. With `transport`, `endpoint`
1075
- * is optional. The library does not compress the body for a custom transport.
1350
+ * Sends batches through one of the app's own channels instead of HTTP. With `transport`,
1351
+ * `endpoint` is optional. The library does not compress the body for a custom transport.
1352
+ * Set null to remove it.
1076
1353
  * @see {@link Transport}
1077
1354
  */
1078
- transport?: Transport;
1355
+ transport?: Transport | null;
1079
1356
  /**
1080
1357
  * Sends the last batch while the page closes, for a custom transport. Without it, the
1081
- * library puts that batch in the emergency queue. The next page load sends it.
1358
+ * library puts that batch in the emergency queue and the next page load sends it. Needs
1359
+ * `transport`. Set null to remove it.
1082
1360
  * @see {@link ExitTransport}
1083
1361
  */
1084
- transportOnExit?: ExitTransport;
1362
+ transportOnExit?: ExitTransport | null;
1085
1363
  /**
1086
1364
  * Creates a dedicated worker for encoding, compression and HTTP sends. The worker calls serveTransportWorker().
1087
- * Headers functions, retries, storage and exit sends stay on the main thread. A custom transport takes precedence.
1365
+ * Headers functions, retries, storage and exit sends stay on the main thread. With `transport`
1366
+ * set, the library doesn't start the worker. Set null to remove it.
1088
1367
  */
1089
- transportWorker?: () => Worker;
1368
+ transportWorker?: (() => Worker) | null;
1090
1369
  /**
1091
1370
  * Loads the `@opentelemetry/api` module. Example: `() => import("@opentelemetry/api")`.
1092
- * If you do not set it, OTel is off.
1371
+ * OTel stays off unless you set it. Set null to remove it.
1093
1372
  * @see {@link OtelLoader}
1094
1373
  */
1095
- otelLoader?: OtelLoader;
1374
+ otelLoader?: OtelLoader | null;
1096
1375
  /**
1097
- * Gives attributes for each record that the library builds. Its values override `setContext()`
1098
- * values. The logger scope and the call payload override its values. The library calls it for
1099
- * each built record. This includes records used only for the console or breadcrumbs.
1100
- * Keep it fast and synchronous. If it throws or returns a value that is not an object,
1101
- * it adds nothing to the record.
1376
+ * Returns attributes for every record the library builds. Its values override `setContext()`
1377
+ * values, and the logger scope and the call payload override its values. It is called for
1378
+ * every built record, including records used only for the console or breadcrumbs. Keep it
1379
+ * fast and synchronous. If it throws or returns a non-object, it adds nothing to the record.
1380
+ * Set null to remove it.
1102
1381
  * @returns The attributes, or undefined for none.
1103
1382
  */
1104
- contextProvider?: () => Record<string, unknown> | undefined;
1383
+ contextProvider?: (() => Record<string, unknown> | undefined) | null;
1105
1384
  /**
1106
- * Changes or drops a record. The processors run in list order, before `redact`. A processor has
1107
- * the contract of `redact`. If it throws or returns a value that is not a record, the library
1108
- * drops the record.
1385
+ * Change or drop a record. Processors run in list order, before `redact`, and follow the
1386
+ * same contract as `redact`. If one throws or returns something that isn't a record, the
1387
+ * library drops the record. A list with an entry that isn't a function keeps the current list,
1388
+ * and with no current list the library drops every record until a later call sets a list of
1389
+ * functions or [].
1109
1390
  */
1110
1391
  processors?: ((record: LogRecord) => LogRecord | null)[];
1111
1392
  /**
1112
- * Changes or drops a record before the SDK prints or sends it. If the hook throws or returns a
1113
- * value that is not a record, the library drops the record.
1114
- * @param record Record to process. It can be used only for the console or breadcrumbs.
1393
+ * Changes or drops a record before the SDK prints or sends it. If the hook throws or returns
1394
+ * something that isn't a record, the library drops the record. An omitted key or undefined
1395
+ * keeps the current hook. Set null to remove it. A value that isn't a function keeps the
1396
+ * current hook, and with no current hook the library drops every record until a later call
1397
+ * sets a function or null.
1398
+ * @param record Record to process. It may be destined only for the console or breadcrumbs.
1115
1399
  * @returns The record to send, or `null` to drop it.
1116
1400
  */
1117
- redact?: (record: LogRecord) => LogRecord | null;
1401
+ redact?: ((record: LogRecord) => LogRecord | null) | null;
1118
1402
  /**
1119
- * Reports this library's own faults.
1403
+ * Reports this library's own faults. Set null to remove it.
1120
1404
  * @see {@link DiagnosticHandler}
1121
1405
  */
1122
- onDiagnostic?: DiagnosticHandler;
1406
+ onDiagnostic?: DiagnosticHandler | null;
1123
1407
  /**
1124
- * Receives a summary when the library loses records that it built. Sampling, `minLevel`,
1125
- * `processors` and `redact` do not cause a loss. The library joins the losses of one reason in one task.
1126
- * Do not log through the library in the hook. A record from the hook can evict a stored batch.
1127
- * A batch that storage evicts during its send can still reach the server.
1128
- * @param summary Reason, record count, batch ids, journey ids and action names of the loss.
1408
+ * Receives a summary when the library loses records it has already built. Sampling,
1409
+ * `minLevel`, `processors` and `redact` do not cause a loss. Losses with the same reason in
1410
+ * the same task are merged. Do not log through the library in the hook, because a record
1411
+ * from the hook can evict a stored batch. A batch that storage evicts during its send can
1412
+ * still reach the server. Set null to remove it.
1413
+ * @param summary The loss's reason, record count, batch ids, journey ids and action names.
1129
1414
  * @see {@link DropSummary}
1130
1415
  */
1131
- onDrop?: (summary: DropSummary) => void;
1416
+ onDrop?: ((summary: DropSummary) => void) | null;
1132
1417
  }
1133
1418
  /** Fully resolved configuration that the runtime holds. */
1134
1419
  export interface ResolvedConfig {
1135
1420
  /** Capture capacity and rate limits. */
1136
- capturePolicy: CapturePolicy;
1421
+ captureLimits: CaptureLimitsOptions;
1137
1422
  /** Resource and page fields to record. */
1138
- metadata: MetadataPolicy;
1139
- /** Application storage namespace. */
1140
- persistence: PersistencePolicy;
1423
+ metadata: MetadataOptions;
1141
1424
  /** Diagnostic report and console fallback settings. */
1142
- diagnostics: DiagnosticsPolicy;
1425
+ diagnostics: DiagnosticsOptions;
1143
1426
  /** Session and trace timing. */
1144
- correlation: CorrelationPolicy;
1145
- /** Metric capacity in one interval. */
1146
- metrics: MetricsPolicy;
1427
+ correlation: CorrelationOptions;
1428
+ /** The metric interval and the metric capacity in one interval. */
1429
+ metrics: MetricsOptions;
1147
1430
  /** Live buffer capacity and the overflow rule. */
1148
- buffering: BufferingPolicy;
1431
+ buffering: BufferingOptions;
1149
1432
  /** Request timing and delivery capacity. */
1150
- delivery: DeliveryPolicy;
1433
+ delivery: DeliveryOptions;
1151
1434
  /** Records that minLevel or sampling drops, kept for the next error. */
1152
- debugBuffer: DebugBufferPolicy;
1435
+ debugBuffer: DebugBufferOptions;
1436
+ /** Duration probes. Each probe is reported as a histogram summary record. */
1437
+ profiler: ProfilerOptions;
1438
+ /** Session replay settings. */
1439
+ replay: ReplayOptions;
1153
1440
  /** True if configure() must refuse changes to the active settings. */
1154
1441
  lockConfiguration: boolean;
1155
- /** Capacity of the logger cache. */
1442
+ /** Logger cache capacity. */
1156
1443
  loggerCache: LoggerCacheOptions;
1157
1444
  /** Active delivery context id and isolation rule. */
1158
1445
  securityContext: SecurityContextOptions;
1159
1446
  /** Ingest endpoint URL, or null in console-only mode. */
1160
1447
  endpoint: string | null;
1161
- /** OTLP metrics endpoint URL. An empty string sends metric records as log records. */
1162
- metricsEndpoint: string;
1163
- /** OTLP traces endpoint URL, or "" when the library sends no span. */
1164
- tracesEndpoint: string;
1165
- /** The library reports this value as `service.name`. */
1448
+ /** OTLP metrics endpoint URL, or null to send metric records as log records. */
1449
+ metricsEndpoint: string | null;
1450
+ /** OTLP traces endpoint URL, or null when the library sends no span. */
1451
+ tracesEndpoint: string | null;
1452
+ /** Reported as `service.name`. */
1166
1453
  serviceName: string;
1167
- /** The library reports this value as `service.version`. */
1454
+ /** Reported as `service.version`. */
1168
1455
  serviceVersion: string;
1169
- /** The library reports this value as `deployment.environment`. */
1456
+ /** Reported as `deployment.environment`. */
1170
1457
  environment: string;
1171
- /** Master switch. With false, each log call does nothing. */
1458
+ /** Master switch. When false, every log call does nothing. */
1172
1459
  enabled: boolean;
1173
- /** Time at which logger calls read their payloads. */
1460
+ /** When logger calls read their payloads. */
1174
1461
  payloadMode: "copy" | "defer";
1175
1462
  /** Minimum level that the library logs. */
1176
1463
  minLevel: LogLevel;
@@ -1178,13 +1465,13 @@ export interface ResolvedConfig {
1178
1465
  minLevels: Record<string, LogLevel>;
1179
1466
  /** Hooks that change or drop a record before `redact`. */
1180
1467
  processors: NonNullable<ObservabilityConfig["processors"]>;
1181
- /** "gzip" compresses a payload that is larger than the compression threshold. */
1468
+ /** "gzip" compresses any payload larger than the compression threshold. */
1182
1469
  compression: "gzip" | "none";
1183
- /** The library passes this value to `fetch`. */
1470
+ /** Passed to `fetch`. */
1184
1471
  credentials: RequestCredentials;
1185
- /** Backing store for undelivered records. */
1186
- storage: StorageStrategy;
1187
- /** Store for session, tab and journey ids. */
1472
+ /** Backing store, namespace and persistence request for undelivered batches. */
1473
+ storage: StorageOptions;
1474
+ /** Where session, tab and journey ids are kept. */
1188
1475
  identity: IdentityStrategy;
1189
1476
  /**
1190
1477
  * Sampling policy.
@@ -1202,7 +1489,7 @@ export interface ResolvedConfig {
1202
1489
  */
1203
1490
  journey: JourneyOptions;
1204
1491
  /**
1205
- * Batch size and flush interval of each record stream.
1492
+ * Batch size and flush interval for each record stream.
1206
1493
  * @see {@link BatchingOptions}
1207
1494
  */
1208
1495
  batching: BatchingOptions;
@@ -1213,41 +1500,41 @@ export interface ResolvedConfig {
1213
1500
  retention: RetentionOptions;
1214
1501
  /**
1215
1502
  * Size limits for each record.
1216
- * @see {@link LimitOptions}
1503
+ * @see {@link LimitsOptions}
1217
1504
  */
1218
- limits: LimitOptions;
1505
+ limits: LimitsOptions;
1219
1506
  /**
1220
1507
  * Automatic instrumentation.
1221
1508
  * @see {@link CaptureOptions}
1222
1509
  */
1223
1510
  capture: CaptureOptions;
1224
- /** Console level and styles. */
1225
- console: ResolvedConsole;
1511
+ /** Console output level and styles. */
1512
+ consoleOutput: ResolvedConsole;
1226
1513
  /** Payload format name, or a custom implementation. */
1227
1514
  serializer: SerializerChoice;
1228
1515
  /** Extra request headers, or a function returning them. */
1229
- headers?: ObservabilityConfig["headers"];
1230
- /** Sends batches through a channel of the app in place of HTTP. */
1516
+ headers?: NonNullable<ObservabilityConfig["headers"]>;
1517
+ /** Sends batches through one of the app's own channels instead of HTTP. */
1231
1518
  transport?: Transport;
1232
1519
  /** Sends the last batch while the page closes, for a custom transport. */
1233
1520
  transportOnExit?: ExitTransport;
1234
1521
  /** Creates the dedicated HTTP transport worker. */
1235
- transportWorker?: ObservabilityConfig["transportWorker"];
1522
+ transportWorker?: NonNullable<ObservabilityConfig["transportWorker"]>;
1236
1523
  /** Supplies the `@opentelemetry/api` module in place of importing it. */
1237
1524
  otelLoader?: OtelLoader;
1238
- /** Gives attributes for each record that the library builds. */
1239
- contextProvider?: ObservabilityConfig["contextProvider"];
1525
+ /** Returns attributes for every record the library builds. */
1526
+ contextProvider?: NonNullable<ObservabilityConfig["contextProvider"]>;
1240
1527
  /**
1241
1528
  * Changes or drops a record before the SDK prints or sends it.
1242
- * @param record Record to process. It can be used only for the console or breadcrumbs.
1529
+ * @param record Record to process. It may be destined only for the console or breadcrumbs.
1243
1530
  * @returns The record to send, or `null` to drop it.
1244
1531
  */
1245
- redact?: ObservabilityConfig["redact"];
1532
+ redact?: NonNullable<ObservabilityConfig["redact"]>;
1246
1533
  /**
1247
1534
  * Reports this library's own faults.
1248
1535
  * @see {@link DiagnosticHandler}
1249
1536
  */
1250
1537
  onDiagnostic?: DiagnosticHandler;
1251
- /** Receives a summary when the library loses records that it built. */
1252
- onDrop?: ObservabilityConfig["onDrop"];
1538
+ /** Receives a summary when the library loses records it has already built. */
1539
+ onDrop?: NonNullable<ObservabilityConfig["onDrop"]>;
1253
1540
  }