@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
@@ -0,0 +1,218 @@
1
+ import type { MetricAttributes, Probe, ProbeOptions, Profiler } from "../models/metric.js";
2
+ import type { Diagnostics } from "./diagnostics.js";
3
+ /** What the runtime hands the core on attach. */
4
+ export interface ProfilerSink {
5
+ /** Max number of probes (profiler.maxProbes). */
6
+ capacity: number;
7
+ /** Interval length in ms. */
8
+ intervalMs(): number;
9
+ /**
10
+ * Builds and sends the record for one point.
11
+ * @param name Metric name.
12
+ * @param attributes Record attributes for the point.
13
+ * @param fields Metric fields for the point.
14
+ */
15
+ emit(name: string, attributes: MetricAttributes, fields: Record<string, unknown>): void;
16
+ /** The runtime's diagnostics reporter. */
17
+ diagnostics: Diagnostics;
18
+ /** False while the runtime can't accept records. */
19
+ ready(): boolean;
20
+ /**
21
+ * Leaves a breadcrumb for a span that ran longer than its probe's threshold.
22
+ * @param name Probe name.
23
+ * @param ms Span duration in ms.
24
+ */
25
+ outlier(name: string, ms: number): void;
26
+ }
27
+ /** Holds the probe names and all their timings. There is one core per library version. */
28
+ export declare class ProfilerCore implements Profiler {
29
+ /** Probes by name. Names are never removed, so insertion order is slot order. */
30
+ private readonly registry;
31
+ /** Rows in use. 0 while detached, so one compare covers both "off" and "over the limit". */
32
+ private limit;
33
+ /**
34
+ * Count, sum, min and max per slot. A row's four values sit in 32 adjacent bytes, so an add
35
+ * should touch a single cache line (hypothesis, not measured).
36
+ */
37
+ private stats;
38
+ /** Bucket counts, PROFILE_BUCKETS per slot. */
39
+ private hist;
40
+ /** Self-time bucket counts per slot. Spans without a stack frame don't add to it. */
41
+ private selfHist;
42
+ /** Frames for the open, nested spans. Each frame adds up the time of the spans inside it. */
43
+ private readonly stack;
44
+ /** Number of frames in use. */
45
+ private depth;
46
+ /** Recent spans, for linking to long animation frames. Empty until link() turns it on. */
47
+ private ring;
48
+ /** Next write offset in the ring. */
49
+ private ringAt;
50
+ /** Shortest span (ms) that goes into the ring. Infinity keeps the ring off. */
51
+ private linkMs;
52
+ /** Spans waiting for the next paint. */
53
+ private painted;
54
+ /** Gets us a task right after the paint. Created on the first wait. */
55
+ private channel;
56
+ /** Countdown and period per slot. */
57
+ private sampling;
58
+ /**
59
+ * Clock value at the last detach() or reset(). Spans that started at or before it are dropped.
60
+ * "At" matters: on a coarse clock, a span started in the reset's tick reads the same value.
61
+ */
62
+ private floor;
63
+ /** Timer for the current interval. It only runs while there is data waiting. */
64
+ private timer;
65
+ /** When the interval's first value arrived, in epoch ms. */
66
+ private startedAt;
67
+ /** Invalid tokens seen while on, since the last collect(). end() itself reports nothing. */
68
+ private badTokens;
69
+ /** Cost of one sampled begin()/end() pair, in ns. */
70
+ private overhead;
71
+ /** Set once calibration has run, so a too-coarse clock only blocks us once. */
72
+ private calibrated;
73
+ /** The runtime's sink. Null while detached. */
74
+ private sink;
75
+ /** True once this attach has reported a probe over the limit. */
76
+ private reported;
77
+ /** True while a limit report the throttle dropped is waiting for the next collect. */
78
+ private limitDue;
79
+ /**
80
+ * Returns the probe for a name. Never throws into the app.
81
+ * @param name Probe name. A JavaScript caller can pass anything.
82
+ * @param options Probe options. Only the options from the first call for a name count.
83
+ * @param diagnostics The current runtime's diagnostics. Without a runtime, nothing is reported.
84
+ * @returns The probe, or a no-op probe if the name is rejected.
85
+ */
86
+ probe(name: string, options?: ProbeOptions, diagnostics?: Diagnostics): Probe;
87
+ /**
88
+ * Calls a function and times it. If the result is a thenable, the span ends when it settles.
89
+ * The caller only ever sees errors from its own function.
90
+ * @param name Probe name.
91
+ * @param fn The app's function.
92
+ * @param diagnostics The current runtime's diagnostics, if there is one.
93
+ * @returns Whatever fn returned, or the result of its then() call.
94
+ */
95
+ time<T>(name: string, fn: () => T, diagnostics?: Diagnostics): T;
96
+ /**
97
+ * Turns the recent-span ring on or off. The frame phases capture reads from it.
98
+ * @param minMs Shortest span (ms) to keep. Infinity turns the ring off.
99
+ */
100
+ link(minMs: number): void;
101
+ /**
102
+ * Finds the probes that had a recent span inside a time range.
103
+ * @param from Range start, as a performance.now() value.
104
+ * @param to Range end.
105
+ * @returns The probe names, without duplicates.
106
+ */
107
+ linked(from: number, to: number): string[];
108
+ /**
109
+ * Turns the profiler on with a runtime's sink. Calling it again swaps the sink.
110
+ * @param sink The runtime's sink.
111
+ */
112
+ attach(sink: ProfilerSink): void;
113
+ /** Turns the profiler off and drops the data. The runtime calls collect(false) first. */
114
+ detach(): void;
115
+ /**
116
+ * Sends one summary record per probe that has data, then starts a new interval. Does nothing
117
+ * while the sink isn't ready.
118
+ * @param timed True when called from the interval timer. Only a timed collect calibrates.
119
+ */
120
+ collect(timed: boolean): void;
121
+ /** Drops the interval's data. The profiler stays on. */
122
+ reset(): void;
123
+ /** Drops the data and any open spans. Spans started at or before this call add nothing. */
124
+ private clear;
125
+ /**
126
+ * Reads the options for a new probe. Never throws into the app.
127
+ * @param name Probe name.
128
+ * @param options Options from the app.
129
+ * @param diagnostics The current runtime's diagnostics, if there is one.
130
+ * @returns The rules. Any invalid option falls back to its default.
131
+ */
132
+ private rulesOf;
133
+ /**
134
+ * Builds a probe's closures, once per probe, so destructured members still work.
135
+ * @param name Probe name.
136
+ * @param slot The probe's row.
137
+ * @param rules Validated probe options.
138
+ * @returns The registry entry, including the probe.
139
+ */
140
+ private makeProbe;
141
+ /**
142
+ * Pushes a frame for a new span.
143
+ * @param slot The probe's row.
144
+ * @param now Span start.
145
+ */
146
+ private push;
147
+ /**
148
+ * Pops a span's frame, along with any frames above it, and adds the span's duration to the
149
+ * child time of the frame below.
150
+ * @param slot The probe's row.
151
+ * @param token Span start.
152
+ * @param now Span end, or the time the span leaves the stack.
153
+ * @returns Self time in ms, or -1 if the span had no frame.
154
+ */
155
+ private pop;
156
+ /**
157
+ * Runs a function in the first task after the next paint.
158
+ * @param done Called with the time after the paint.
159
+ * @returns False where there is no frame callback, or when the page is hidden.
160
+ */
161
+ private afterPaint;
162
+ /**
163
+ * Writes a slot's sampling row so the next span gets measured.
164
+ * @param slot The probe's row.
165
+ * @param period Sampling period.
166
+ */
167
+ private prime;
168
+ /**
169
+ * Counts down a slot's sampling. A countdown gives an exact rate, which Math.random() wouldn't.
170
+ * @param slot The probe's row.
171
+ * @returns True if this span should be measured.
172
+ */
173
+ private sampled;
174
+ /**
175
+ * Adds one duration to a slot. This is the hot path: no Map lookup, no try.
176
+ * @param slot The probe's row.
177
+ * @param ms Duration in ms.
178
+ */
179
+ private add;
180
+ /**
181
+ * Starts the interval timer, unref'd so a pending timer doesn't keep Node.js alive.
182
+ * @param sink The runtime's sink.
183
+ */
184
+ private wait;
185
+ /** Collects at the end of an interval, or waits another one if the runtime isn't ready. */
186
+ private tick;
187
+ /** Stops the interval timer. */
188
+ private clearTimer;
189
+ /**
190
+ * Reports that there are more probes than the limit allows. If the throttle drops the report,
191
+ * the next collect tries again.
192
+ * @param sink The runtime's sink.
193
+ */
194
+ private reportLimit;
195
+ /**
196
+ * Checks whether any probe recorded a value in this interval.
197
+ * @returns True if a slot above 0 has a non-zero count.
198
+ */
199
+ private hasData;
200
+ /**
201
+ * Sends one slot's summary record and zeroes the slot. The sampling countdown is left alone.
202
+ * @param sink The runtime's sink.
203
+ * @param name Probe name.
204
+ * @param entry The probe's registry entry.
205
+ * @param start Interval start, in Unix nanoseconds.
206
+ */
207
+ private emitSlot;
208
+ /**
209
+ * Measures what one sampled begin()/end() pair costs, on slot 0. Runs once. If the clock never
210
+ * shows an edge or never ticks, no value is set.
211
+ */
212
+ private calibrate;
213
+ }
214
+ /**
215
+ * Returns the profiler core for this library version. Two copies of the same version share it.
216
+ * @returns The core.
217
+ */
218
+ export declare function profilerCore(): ProfilerCore;
@@ -0,0 +1,190 @@
1
+ import type { ResolvedConfig } from "../models/config.cjs";
2
+ import { type LogLevel, type LogRecord, type LogType } from "../models/log-record.cjs";
3
+ import type { Identity } from "../utils/identity.cjs";
4
+ import { type PlatformMetadata } from "../utils/platform.cjs";
5
+ import { type SanitizeLimits } from "../utils/sanitize.cjs";
6
+ import type { Sequence } from "../utils/sequence.cjs";
7
+ import type { TraceContext, TraceEngine } from "../utils/tracing.cjs";
8
+ import type { ContextStore } from "./context.cjs";
9
+ import type { DebugBuffer } from "./debug-buffer.cjs";
10
+ import type { Diagnostics } from "./diagnostics.cjs";
11
+ import type { Journey, JourneyEngine } from "./journey.cjs";
12
+ import type { RemoteSlot } from "./remote-sampling.cjs";
13
+ /** Injected dependencies required by RecordBuilder. */
14
+ export interface RecordBuilderDeps {
15
+ /** Active configuration object reference. */
16
+ config: ResolvedConfig;
17
+ /** Per-record size caps. */
18
+ limits: RecordLimits;
19
+ /** Diagnostics reporter instance. */
20
+ diagnostics: Diagnostics;
21
+ /** Ambient context store. */
22
+ context: ContextStore;
23
+ /** Active journey engine. */
24
+ journey: JourneyEngine;
25
+ /** Distributed tracing engine. */
26
+ tracing: TraceEngine;
27
+ /** Monotonic sequence counter. */
28
+ sequence: Sequence;
29
+ /** Context, session and tab identity. */
30
+ identity: Identity;
31
+ /** Detected host platform metadata. */
32
+ platform: PlatformMetadata;
33
+ /** Slot for the sampling rules from the ingest server. */
34
+ remote: RemoteSlot;
35
+ /** Keeps the records that minLevel or sampling drops, for the next error. */
36
+ debug?: DebugBuffer;
37
+ }
38
+ /** Per-record size limits. The builder applies them after sanitize and after redact. */
39
+ export interface RecordLimits extends SanitizeLimits {
40
+ /** Max record body length, in characters. */
41
+ maxBodyChars: number;
42
+ /** Max total attribute bytes per record. */
43
+ maxRecordBytes: number;
44
+ }
45
+ /**
46
+ * Reason a record was not built. "malformed" means a processor or the redact hook broke the
47
+ * record shape or set an unknown severityText.
48
+ */
49
+ export type DropReason = "level" | "sampling" | "processor" | "redact" | "malformed";
50
+ /** Outcome of one build call. */
51
+ export interface BuildResult {
52
+ /** Completed record, or null when the builder drops it. */
53
+ record: LogRecord | null;
54
+ /** Reason for the drop. Absent when a record was built. */
55
+ dropped?: DropReason;
56
+ }
57
+ /** Metadata captured before a deferred logger call reads its payload. */
58
+ export interface RecordSnapshot {
59
+ timeUnixNano: string;
60
+ trace: TraceContext;
61
+ journey: Journey | null;
62
+ context: Record<string, unknown>;
63
+ url: string;
64
+ }
65
+ /** Input parameters for constructing a single log record. */
66
+ export interface BuildInput {
67
+ /** Severity level of the log entry. */
68
+ level: LogLevel;
69
+ /** Telemetry type classification. */
70
+ type: LogType;
71
+ /** Primary log message body. */
72
+ body: string;
73
+ /** Originating application namespace. */
74
+ namespace: string;
75
+ /** Pre-merged scoped context from logger instance. */
76
+ scoped?: Record<string, unknown>;
77
+ /** Call-site payload attributes. */
78
+ payload?: Record<string, unknown>;
79
+ /**
80
+ * Fields the library builds with a fixed size bound, for example a point's buckets.
81
+ * The record limits don't trim them, and they override a payload key of the same name.
82
+ */
83
+ fixed?: Record<string, unknown>;
84
+ /** True for a counter or histogram point. Sampling keeps it. */
85
+ aggregated?: boolean;
86
+ /** A span's trace IDs. Without them the builder reads the active trace. */
87
+ trace?: TraceContext;
88
+ /** The call's metadata, captured before the deferred build. */
89
+ snapshot?: RecordSnapshot;
90
+ }
91
+ /** Builds validated and sanitized LogRecord instances from logger inputs. */
92
+ export declare class RecordBuilder {
93
+ private readonly deps;
94
+ /** Cached resource attributes block. */
95
+ private resourceCache;
96
+ /**
97
+ * @param deps Injected builder dependencies.
98
+ */
99
+ constructor(deps: RecordBuilderDeps);
100
+ /** Clears the cached resource attributes, so the next build computes them again. */
101
+ invalidateResource(): void;
102
+ /**
103
+ * Checks whether logging is on and the level is at or above the namespace's minimum level.
104
+ * The minimum level doesn't apply to an action or a metric.
105
+ * @param level Target log severity level.
106
+ * @param namespace Logger namespace. `minLevels` can set its level.
107
+ * @param type Record type. Without it, the minimum level applies.
108
+ * @returns True if the library builds a record of this level and type.
109
+ */
110
+ isEnabled(level: LogLevel, namespace: string, type?: LogType): boolean;
111
+ /**
112
+ * Checks the level against the namespace's minimum level, whatever `enabled` says.
113
+ * @param level Target log severity level.
114
+ * @param namespace Logger namespace.
115
+ * @param type Record type. An action, a metric or a span passes.
116
+ * @returns True if the level is high enough.
117
+ */
118
+ private passesLevel;
119
+ /**
120
+ * Keeps a record that minLevel or sampling dropped, when the debug buffer is on. The privacy
121
+ * hooks run now, and an error record from this context sends the kept record later.
122
+ * @param input The dropped record's input.
123
+ */
124
+ private keepForDebug;
125
+ /**
126
+ * Builds a structured LogRecord from the input, sanitizing attributes and applying size limits.
127
+ * @param input Logger call input parameters.
128
+ * @param forConsole True to skip delivery sampling and level checks. Privacy hooks still run.
129
+ * @returns The record, or null with the reason for the drop.
130
+ */
131
+ build(input: BuildInput, forConsole?: boolean): BuildResult;
132
+ /**
133
+ * Runs the redact hook on a record from another context. A child context without redact
134
+ * forwards raw records, so the sender is the last privacy gate.
135
+ * @param record Forwarded record.
136
+ * @returns The record to deliver, or null when the hook drops it.
137
+ */
138
+ redactForwarded(record: LogRecord): LogRecord | null;
139
+ /**
140
+ * Runs the hooks on a record that a log call built before the app's first configure(), and
141
+ * gives it the configured resource. That record never met the app's hooks, so the processors
142
+ * run as well as redact. The resource goes on first, so redact sees the record that leaves.
143
+ * @param record Held record.
144
+ * @returns The record to deliver, or null when a hook drops it.
145
+ */
146
+ rehook(record: LogRecord): LogRecord | null;
147
+ /**
148
+ * Drops the caller attributes of a record over maxRecordBytes, but keeps the index keys: a
149
+ * search can't find a record without journey.id and trace_id. Keeps the error fields, then
150
+ * the breadcrumbs if they fit, because they say why the record exists.
151
+ * @param record Record after the hooks.
152
+ * @param bytes Size of its attributes.
153
+ * @param index The type, the sequence and the namespace the library set on the record.
154
+ * @param fixed Fields the library builds. A point without its metric fields is lost.
155
+ * @returns The record, cut down when it's over the limit.
156
+ */
157
+ private fit;
158
+ /**
159
+ * Lists the app's hooks in the order they see a record.
160
+ * @returns The processors, then redact, which is the last privacy gate.
161
+ */
162
+ private hookStages;
163
+ /**
164
+ * Runs the hooks in order, then sanitizes and measures the attributes again.
165
+ * @param record Built record.
166
+ * @param stages Hooks and their stages.
167
+ * @param fixed Fields the library builds. The hooks can't change them.
168
+ * @returns The record and the size of its attributes, or the reason for the drop.
169
+ */
170
+ private applyHooks;
171
+ /**
172
+ * Runs one consumer hook on a record. A processor and the redact hook have the same contract.
173
+ * @param hook Processor or redact hook.
174
+ * @param stage Stage of the hook.
175
+ * @param record Record before the hook.
176
+ * @returns The record after the hook, or the reason for the drop.
177
+ */
178
+ private runHook;
179
+ /**
180
+ * Calls the config's contextProvider. A provider that throws or returns something that isn't
181
+ * an object adds nothing, and the record is still built. undefined means no attributes.
182
+ * @returns The attributes from the provider, or an empty object.
183
+ */
184
+ private provided;
185
+ /**
186
+ * Computes or returns cached resource metadata for this runtime context.
187
+ * @returns Resource attributes record.
188
+ */
189
+ private resource;
190
+ }
@@ -1,15 +1,15 @@
1
- import type { ResolvedConfig } from "../models/config";
2
- import { type LogLevel, type LogRecord, type LogType } from "../models/log-record";
3
- import type { Identity } from "../utils/identity";
4
- import { type PlatformMetadata } from "../utils/platform";
5
- import { type SanitizeLimits } from "../utils/sanitize";
6
- import type { Sequence } from "../utils/sequence";
7
- import type { TraceContext, TraceEngine } from "../utils/tracing";
8
- import type { ContextStore } from "./context";
9
- import type { DebugBuffer } from "./debug-buffer";
10
- import type { Diagnostics } from "./diagnostics";
11
- import type { Journey, JourneyEngine } from "./journey";
12
- import type { RemoteSlot } from "./remote-sampling";
1
+ import type { ResolvedConfig } from "../models/config.js";
2
+ import { type LogLevel, type LogRecord, type LogType } from "../models/log-record.js";
3
+ import type { Identity } from "../utils/identity.js";
4
+ import { type PlatformMetadata } from "../utils/platform.js";
5
+ import { type SanitizeLimits } from "../utils/sanitize.js";
6
+ import type { Sequence } from "../utils/sequence.js";
7
+ import type { TraceContext, TraceEngine } from "../utils/tracing.js";
8
+ import type { ContextStore } from "./context.js";
9
+ import type { DebugBuffer } from "./debug-buffer.js";
10
+ import type { Diagnostics } from "./diagnostics.js";
11
+ import type { Journey, JourneyEngine } from "./journey.js";
12
+ import type { RemoteSlot } from "./remote-sampling.js";
13
13
  /** Injected dependencies required by RecordBuilder. */
14
14
  export interface RecordBuilderDeps {
15
15
  /** Active configuration object reference. */
@@ -30,12 +30,12 @@ export interface RecordBuilderDeps {
30
30
  identity: Identity;
31
31
  /** Detected host platform metadata. */
32
32
  platform: PlatformMetadata;
33
- /** Slot of the sampling rules from the ingest server. */
33
+ /** Slot for the sampling rules from the ingest server. */
34
34
  remote: RemoteSlot;
35
35
  /** Keeps the records that minLevel or sampling drops, for the next error. */
36
36
  debug?: DebugBuffer;
37
37
  }
38
- /** Size limits for each record. The builder applies them after sanitize and after redact. */
38
+ /** Per-record size limits. The builder applies them after sanitize and after redact. */
39
39
  export interface RecordLimits extends SanitizeLimits {
40
40
  /** Max record body length, in characters. */
41
41
  maxBodyChars: number;
@@ -51,7 +51,7 @@ export type DropReason = "level" | "sampling" | "processor" | "redact" | "malfor
51
51
  export interface BuildResult {
52
52
  /** Completed record, or null when the builder drops it. */
53
53
  record: LogRecord | null;
54
- /** Reason for the drop. It is absent when the builder built a record. */
54
+ /** Reason for the drop. Absent when a record was built. */
55
55
  dropped?: DropReason;
56
56
  }
57
57
  /** Metadata captured before a deferred logger call reads its payload. */
@@ -77,15 +77,15 @@ export interface BuildInput {
77
77
  /** Call-site payload attributes. */
78
78
  payload?: Record<string, unknown>;
79
79
  /**
80
- * Fields that the library builds with a fixed size bound, for example the buckets of a point.
81
- * The record limits do not cut them. They override a payload key of the same name.
80
+ * Fields the library builds with a fixed size bound, for example a point's buckets.
81
+ * The record limits don't trim them, and they override a payload key of the same name.
82
82
  */
83
83
  fixed?: Record<string, unknown>;
84
- /** True for a point of a counter or histogram. Sampling keeps it. */
84
+ /** True for a counter or histogram point. Sampling keeps it. */
85
85
  aggregated?: boolean;
86
- /** Trace IDs of a span. Without them, the builder reads the active trace. */
86
+ /** A span's trace IDs. Without them the builder reads the active trace. */
87
87
  trace?: TraceContext;
88
- /** Metadata of the call before the deferred build. */
88
+ /** The call's metadata, captured before the deferred build. */
89
89
  snapshot?: RecordSnapshot;
90
90
  }
91
91
  /** Builds validated and sanitized LogRecord instances from logger inputs. */
@@ -97,43 +97,75 @@ export declare class RecordBuilder {
97
97
  * @param deps Injected builder dependencies.
98
98
  */
99
99
  constructor(deps: RecordBuilderDeps);
100
- /** Clears the cached resource attributes. The next build computes them again. */
100
+ /** Clears the cached resource attributes, so the next build computes them again. */
101
101
  invalidateResource(): void;
102
102
  /**
103
- * Checks if logging is on and the level is at or above the minimum level of the namespace.
104
- * The minimum level does not apply to an action or a metric.
103
+ * Checks whether logging is on and the level is at or above the namespace's minimum level.
104
+ * The minimum level doesn't apply to an action or a metric.
105
105
  * @param level Target log severity level.
106
106
  * @param namespace Logger namespace. `minLevels` can set its level.
107
- * @param type Record type. Without it, the check applies the minimum level.
107
+ * @param type Record type. Without it, the minimum level applies.
108
108
  * @returns True if the library builds a record of this level and type.
109
109
  */
110
110
  isEnabled(level: LogLevel, namespace: string, type?: LogType): boolean;
111
+ /**
112
+ * Checks the level against the namespace's minimum level, whatever `enabled` says.
113
+ * @param level Target log severity level.
114
+ * @param namespace Logger namespace.
115
+ * @param type Record type. An action, a metric or a span passes.
116
+ * @returns True if the level is high enough.
117
+ */
118
+ private passesLevel;
111
119
  /**
112
120
  * Keeps a record that minLevel or sampling dropped, when the debug buffer is on. The privacy
113
- * hooks run now. An error record of this context sends the kept record later.
114
- * @param input Input of the dropped record.
121
+ * hooks run now, and an error record from this context sends the kept record later.
122
+ * @param input The dropped record's input.
115
123
  */
116
124
  private keepForDebug;
117
125
  /**
118
- * Builds a structured LogRecord from the input. It sanitizes attributes and applies size limits.
126
+ * Builds a structured LogRecord from the input, sanitizing attributes and applying size limits.
119
127
  * @param input Logger call input parameters.
120
128
  * @param forConsole True to skip delivery sampling and level checks. Privacy hooks still run.
121
- * @returns The record, or null with the reason of the drop.
129
+ * @returns The record, or null with the reason for the drop.
122
130
  */
123
131
  build(input: BuildInput, forConsole?: boolean): BuildResult;
124
132
  /**
125
133
  * Runs the redact hook on a record from another context. A child context without redact
126
- * forwards raw records. The sender is the last privacy gate.
134
+ * forwards raw records, so the sender is the last privacy gate.
127
135
  * @param record Forwarded record.
128
136
  * @returns The record to deliver, or null when the hook drops it.
129
137
  */
130
138
  redactForwarded(record: LogRecord): LogRecord | null;
131
139
  /**
132
- * Runs the hooks in order. Then it sanitizes and measures the attributes again.
140
+ * Runs the hooks on a record that a log call built before the app's first configure(), and
141
+ * gives it the configured resource. That record never met the app's hooks, so the processors
142
+ * run as well as redact. The resource goes on first, so redact sees the record that leaves.
143
+ * @param record Held record.
144
+ * @returns The record to deliver, or null when a hook drops it.
145
+ */
146
+ rehook(record: LogRecord): LogRecord | null;
147
+ /**
148
+ * Drops the caller attributes of a record over maxRecordBytes, but keeps the index keys: a
149
+ * search can't find a record without journey.id and trace_id. Keeps the error fields, then
150
+ * the breadcrumbs if they fit, because they say why the record exists.
151
+ * @param record Record after the hooks.
152
+ * @param bytes Size of its attributes.
153
+ * @param index The type, the sequence and the namespace the library set on the record.
154
+ * @param fixed Fields the library builds. A point without its metric fields is lost.
155
+ * @returns The record, cut down when it's over the limit.
156
+ */
157
+ private fit;
158
+ /**
159
+ * Lists the app's hooks in the order they see a record.
160
+ * @returns The processors, then redact, which is the last privacy gate.
161
+ */
162
+ private hookStages;
163
+ /**
164
+ * Runs the hooks in order, then sanitizes and measures the attributes again.
133
165
  * @param record Built record.
134
166
  * @param stages Hooks and their stages.
135
- * @param fixed Fields that the library builds. The hooks cannot change them.
136
- * @returns The record and the size of its attributes, or the reason of the drop.
167
+ * @param fixed Fields the library builds. The hooks can't change them.
168
+ * @returns The record and the size of its attributes, or the reason for the drop.
137
169
  */
138
170
  private applyHooks;
139
171
  /**
@@ -141,12 +173,12 @@ export declare class RecordBuilder {
141
173
  * @param hook Processor or redact hook.
142
174
  * @param stage Stage of the hook.
143
175
  * @param record Record before the hook.
144
- * @returns The record after the hook, or the reason of the drop.
176
+ * @returns The record after the hook, or the reason for the drop.
145
177
  */
146
178
  private runHook;
147
179
  /**
148
- * Calls the contextProvider of the config. A provider that throws or gives a value that is not
149
- * an object adds nothing. The record is still built. undefined means no attributes.
180
+ * Calls the config's contextProvider. A provider that throws or returns something that isn't
181
+ * an object adds nothing, and the record is still built. undefined means no attributes.
150
182
  * @returns The attributes from the provider, or an empty object.
151
183
  */
152
184
  private provided;
@@ -0,0 +1,17 @@
1
+ import type { ResolvedConfig } from "../models/config.cjs";
2
+ import type { Diagnostics } from "./diagnostics.cjs";
3
+ import { type RemoteSlot, type RemoteUpdate } from "./remote-sampling.cjs";
4
+ /**
5
+ * Validates sampling rules from the server. One invalid rule rejects all of them.
6
+ * @param raw Header text, or a parsed object from a custom transport or the bus.
7
+ * @param diagnostics Diagnostics reporter.
8
+ * @returns The rules and their TTL, or null if they are invalid.
9
+ */
10
+ export declare function parseRemoteRules(raw: unknown, diagnostics: Diagnostics): RemoteUpdate | null;
11
+ /**
12
+ * Puts rules into effect in the runtime's slot. Creates the overlay for the first rules.
13
+ * @param slot The runtime's slot.
14
+ * @param config Active configuration instance.
15
+ * @param update Validated rules, or null when the upstream has no rules.
16
+ */
17
+ export declare function applyRemote(slot: RemoteSlot, config: ResolvedConfig, update: RemoteUpdate | null): void;
@@ -1,16 +1,16 @@
1
- import type { ResolvedConfig } from "../models/config";
2
- import type { Diagnostics } from "./diagnostics";
3
- import { type RemoteSlot, type RemoteUpdate } from "./remote-sampling";
1
+ import type { ResolvedConfig } from "../models/config.js";
2
+ import type { Diagnostics } from "./diagnostics.js";
3
+ import { type RemoteSlot, type RemoteUpdate } from "./remote-sampling.js";
4
4
  /**
5
- * Validates sampling rules from the server. A rule that is not valid rejects all the rules.
5
+ * Validates sampling rules from the server. One invalid rule rejects all of them.
6
6
  * @param raw Header text, or a parsed object from a custom transport or the bus.
7
7
  * @param diagnostics Diagnostics reporter.
8
- * @returns The rules and their TTL, or null if they are not valid.
8
+ * @returns The rules and their TTL, or null if they are invalid.
9
9
  */
10
10
  export declare function parseRemoteRules(raw: unknown, diagnostics: Diagnostics): RemoteUpdate | null;
11
11
  /**
12
- * Puts rules in force in the slot of the runtime. It makes the overlay for the first rules.
13
- * @param slot Slot of the runtime.
12
+ * Puts rules into effect in the runtime's slot. Creates the overlay for the first rules.
13
+ * @param slot The runtime's slot.
14
14
  * @param config Active configuration instance.
15
15
  * @param update Validated rules, or null when the upstream has no rules.
16
16
  */