@utk09/ui-observability 0.11.0 → 0.12.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 (383) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +273 -102
  3. package/bin/uiobs.mjs +1 -1
  4. package/dist/{batch-CL9uWYY3.js → batch-BjQUwjA6.js} +4 -4
  5. package/dist/batch-BjQUwjA6.js.map +1 -0
  6. package/dist/{batch-C8OcWR2L.cjs → batch-D5LlU4Q9.cjs} +2 -2
  7. package/dist/batch-D5LlU4Q9.cjs.map +1 -0
  8. package/dist/bus/bus.d.ts +48 -47
  9. package/dist/bus/links.d.ts +4 -4
  10. package/dist/bus/validation.d.ts +1 -1
  11. package/dist/bus-D_7pd7RN.cjs +2 -0
  12. package/dist/bus-D_7pd7RN.cjs.map +1 -0
  13. package/dist/{bus-BZ0GldpT.js → bus-ecxUNTja.js} +91 -91
  14. package/dist/bus-ecxUNTja.js.map +1 -0
  15. package/dist/capture/console.d.ts +10 -10
  16. package/dist/capture/errors.d.ts +6 -6
  17. package/dist/capture/interactions.d.ts +14 -14
  18. package/dist/capture/lifecycle.d.ts +3 -3
  19. package/dist/capture/long-frames.d.ts +6 -6
  20. package/dist/capture/network.d.ts +17 -17
  21. package/dist/capture/profiler-frames.d.ts +44 -0
  22. package/dist/capture/replay-buffer.d.ts +46 -0
  23. package/dist/capture/replay-upload.d.ts +74 -0
  24. package/dist/capture/replay.d.ts +114 -0
  25. package/dist/capture/reports.d.ts +2 -2
  26. package/dist/capture/resource-timing.d.ts +1 -1
  27. package/dist/capture/server-timing.d.ts +3 -3
  28. package/dist/capture/storm.d.ts +3 -3
  29. package/dist/capture/types.d.ts +45 -33
  30. package/dist/capture/unclean-exit.d.ts +8 -8
  31. package/dist/capture/user-timing.d.ts +3 -3
  32. package/dist/capture/web-socket.d.ts +11 -11
  33. package/dist/capture/web-vitals.d.ts +20 -7
  34. package/dist/compression-AJJCMBOa.js +11 -0
  35. package/dist/compression-AJJCMBOa.js.map +1 -0
  36. package/dist/compression-lD9abCcO.cjs +2 -0
  37. package/dist/compression-lD9abCcO.cjs.map +1 -0
  38. package/dist/{console-BPZCuSLc.cjs → console-CLz_PvFn.cjs} +2 -2
  39. package/dist/console-CLz_PvFn.cjs.map +1 -0
  40. package/dist/{console-BeCF7n59.js → console-cwgHKXvM.js} +4 -4
  41. package/dist/console-cwgHKXvM.js.map +1 -0
  42. package/dist/constants-Bwl_YtQi.js +349 -0
  43. package/dist/constants-Bwl_YtQi.js.map +1 -0
  44. package/dist/constants-DakMxVB2.cjs +2 -0
  45. package/dist/constants-DakMxVB2.cjs.map +1 -0
  46. package/dist/constants.d.ts +150 -103
  47. package/dist/context-storage-BjzeBSxH.cjs.map +1 -1
  48. package/dist/context-storage-BzkoHzkQ.js.map +1 -1
  49. package/dist/core/breadcrumbs.d.ts +16 -15
  50. package/dist/core/config.d.ts +3 -3
  51. package/dist/core/context.d.ts +7 -7
  52. package/dist/core/debug-buffer.d.ts +10 -10
  53. package/dist/core/debug-bundle.d.ts +3 -3
  54. package/dist/core/deferred.d.ts +2 -2
  55. package/dist/core/diagnostics.d.ts +24 -21
  56. package/dist/core/drops.d.ts +7 -7
  57. package/dist/core/hold-buffer.d.ts +1 -1
  58. package/dist/core/journey.d.ts +22 -23
  59. package/dist/core/logger.d.ts +22 -21
  60. package/dist/core/measure.d.ts +7 -7
  61. package/dist/core/meter.d.ts +25 -21
  62. package/dist/core/pipeline.d.ts +42 -41
  63. package/dist/core/profile-buckets.d.ts +31 -0
  64. package/dist/core/profiler.d.ts +218 -0
  65. package/dist/core/record.d.ts +23 -23
  66. package/dist/core/remote-rules.d.ts +4 -4
  67. package/dist/core/remote-sampling.d.ts +21 -20
  68. package/dist/core/runtime.d.ts +206 -137
  69. package/dist/core/sampling.d.ts +18 -18
  70. package/dist/core/sender.d.ts +22 -20
  71. package/dist/core/spans.d.ts +5 -5
  72. package/dist/{deadline-BOjOxNHj.js → deadline-C4ccAuk5.js} +3 -6
  73. package/dist/deadline-C4ccAuk5.js.map +1 -0
  74. package/dist/deadline-CUGbto-y.cjs +2 -0
  75. package/dist/deadline-CUGbto-y.cjs.map +1 -0
  76. package/dist/{debug-bundle-C7UkHZ-q.js → debug-bundle-BOdYmCeV.js} +10 -3
  77. package/dist/debug-bundle-BOdYmCeV.js.map +1 -0
  78. package/dist/debug-bundle-Ex4L_LSP.cjs +2 -0
  79. package/dist/debug-bundle-Ex4L_LSP.cjs.map +1 -0
  80. package/dist/doctor.cjs +1 -1
  81. package/dist/doctor.cjs.map +1 -1
  82. package/dist/doctor.d.ts +16 -6
  83. package/dist/doctor.js +147 -52
  84. package/dist/doctor.js.map +1 -1
  85. package/dist/{emergency-queue-Zy6lNafo.js → emergency-queue-B9WZxanZ.js} +4 -4
  86. package/dist/emergency-queue-B9WZxanZ.js.map +1 -0
  87. package/dist/{emergency-queue-CNTRui5t.cjs → emergency-queue-HBpL5r3V.cjs} +2 -2
  88. package/dist/emergency-queue-HBpL5r3V.cjs.map +1 -0
  89. package/dist/error-like-B11pB4aL.js.map +1 -1
  90. package/dist/error-like-gGRx2s36.cjs.map +1 -1
  91. package/dist/{errors-Dh7kef0i.js → errors-D6bwgJtO.js} +3 -3
  92. package/dist/errors-D6bwgJtO.js.map +1 -0
  93. package/dist/{errors-tfEr48bS.cjs → errors-DCOCRdSi.cjs} +2 -2
  94. package/dist/errors-DCOCRdSi.cjs.map +1 -0
  95. package/dist/{factory-CJXVYp0R.cjs → factory-DLFDjdLv.cjs} +2 -2
  96. package/dist/factory-DLFDjdLv.cjs.map +1 -0
  97. package/dist/{factory-BonqI3NL.js → factory-e9Qo3K0z.js} +13 -13
  98. package/dist/factory-e9Qo3K0z.js.map +1 -0
  99. package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
  100. package/dist/fixed-window-Dq3MLUUv.js.map +1 -1
  101. package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
  102. package/dist/global-scope-D9I8s-oN.js.map +1 -1
  103. package/dist/guards-Cidk71ME.js.map +1 -1
  104. package/dist/guards-nJ70syPt.cjs.map +1 -1
  105. package/dist/{identity-Cxgj6pZX.cjs → identity-BlvlgjrU.cjs} +2 -2
  106. package/dist/identity-BlvlgjrU.cjs.map +1 -0
  107. package/dist/{identity-DT5VmvXy.js → identity-BrQp_5J5.js} +19 -19
  108. package/dist/identity-BrQp_5J5.js.map +1 -0
  109. package/dist/index.cjs +1 -1
  110. package/dist/index.cjs.map +1 -1
  111. package/dist/index.d.ts +112 -79
  112. package/dist/index.js +783 -635
  113. package/dist/index.js.map +1 -1
  114. package/dist/{indexeddb-storage-CIoW21Xd.cjs → indexeddb-storage-CtLvZH1r.cjs} +2 -2
  115. package/dist/indexeddb-storage-CtLvZH1r.cjs.map +1 -0
  116. package/dist/{indexeddb-storage-BJVtiQKm.js → indexeddb-storage-DLXQzAGh.js} +4 -4
  117. package/dist/indexeddb-storage-DLXQzAGh.js.map +1 -0
  118. package/dist/{interactions-DTgKy_6K.js → interactions-B6z2I4tU.js} +3 -3
  119. package/dist/interactions-B6z2I4tU.js.map +1 -0
  120. package/dist/{interactions-fEN6FbVo.cjs → interactions-P6pz08Jn.cjs} +2 -2
  121. package/dist/interactions-P6pz08Jn.cjs.map +1 -0
  122. package/dist/{journey-CuJrHzEg.js → journey-35yCMNFo.js} +20 -19
  123. package/dist/journey-35yCMNFo.js.map +1 -0
  124. package/dist/journey-DAGh5h9k.cjs +2 -0
  125. package/dist/journey-DAGh5h9k.cjs.map +1 -0
  126. package/dist/keys-BHhw_0Wh.cjs.map +1 -1
  127. package/dist/keys-BU9j5YqW.js.map +1 -1
  128. package/dist/{library-console-D2GY9Or6.cjs → library-console-BFWEuQsl.cjs} +2 -2
  129. package/dist/library-console-BFWEuQsl.cjs.map +1 -0
  130. package/dist/{library-console-C1m6g1BR.js → library-console-Dl_Ly6DQ.js} +2 -2
  131. package/dist/library-console-Dl_Ly6DQ.js.map +1 -0
  132. package/dist/{library-request-1BX_UlaX.cjs → library-request-Da-CHKzT.cjs} +2 -2
  133. package/dist/library-request-Da-CHKzT.cjs.map +1 -0
  134. package/dist/{library-request-BQBT9N9Q.js → library-request-nI6pvI6I.js} +2 -2
  135. package/dist/library-request-nI6pvI6I.js.map +1 -0
  136. package/dist/{lifecycle-2EtUaRpo.cjs → lifecycle-BGGOcN4N.cjs} +2 -2
  137. package/dist/lifecycle-BGGOcN4N.cjs.map +1 -0
  138. package/dist/{lifecycle-BaKx_-32.js → lifecycle-CZ6RRXc6.js} +2 -2
  139. package/dist/lifecycle-CZ6RRXc6.js.map +1 -0
  140. package/dist/{log-record-i9zOTkpQ.cjs → log-record-D7bA1RPb.cjs} +2 -2
  141. package/dist/log-record-D7bA1RPb.cjs.map +1 -0
  142. package/dist/{log-record-CAoGBBf3.js → log-record-DIA6McNr.js} +2 -2
  143. package/dist/log-record-DIA6McNr.js.map +1 -0
  144. package/dist/{long-frames-Czk7IupC.js → long-frames-430_85Da.js} +8 -6
  145. package/dist/long-frames-430_85Da.js.map +1 -0
  146. package/dist/long-frames-Dd8tsi2U.cjs +2 -0
  147. package/dist/long-frames-Dd8tsi2U.cjs.map +1 -0
  148. package/dist/models/batch.d.ts +14 -15
  149. package/dist/models/bus.d.ts +24 -24
  150. package/dist/models/config.d.ts +402 -216
  151. package/dist/models/drop.d.ts +13 -11
  152. package/dist/models/health.d.ts +13 -13
  153. package/dist/models/log-record.d.ts +13 -14
  154. package/dist/models/metric.d.ts +82 -17
  155. package/dist/models/plugin.d.ts +13 -13
  156. package/dist/models/replay.d.ts +60 -0
  157. package/dist/models/serializer.d.ts +2 -3
  158. package/dist/models/stats.d.ts +2 -2
  159. package/dist/models/storage.d.ts +12 -11
  160. package/dist/{network-DBNwApoF.js → network-C7SkLf4v.js} +12 -12
  161. package/dist/network-C7SkLf4v.js.map +1 -0
  162. package/dist/{network-xbbuvG_6.cjs → network-pEX3PAJv.cjs} +2 -2
  163. package/dist/network-pEX3PAJv.cjs.map +1 -0
  164. package/dist/openfin-Bxelt0yg.js.map +1 -1
  165. package/dist/openfin-DtH2f7zX.cjs.map +1 -1
  166. package/dist/otlp-2MCrC3kd.cjs +2 -0
  167. package/dist/otlp-2MCrC3kd.cjs.map +1 -0
  168. package/dist/{otlp-BTJdIa6F.js → otlp-COq033e3.js} +25 -32
  169. package/dist/otlp-COq033e3.js.map +1 -0
  170. package/dist/patch-BX8KrPCT.cjs.map +1 -1
  171. package/dist/patch-UdPz1ea8.js.map +1 -1
  172. package/dist/{platform-C2Ez5kDc.cjs → platform-12uR7kBQ.cjs} +2 -2
  173. package/dist/platform-12uR7kBQ.cjs.map +1 -0
  174. package/dist/{platform-DkcuXwe-.js → platform-CVewe4wQ.js} +7 -7
  175. package/dist/platform-CVewe4wQ.js.map +1 -0
  176. package/dist/profiler-BVWIOgnq.js +310 -0
  177. package/dist/profiler-BVWIOgnq.js.map +1 -0
  178. package/dist/profiler-eVCknCzS.cjs +2 -0
  179. package/dist/profiler-eVCknCzS.cjs.map +1 -0
  180. package/dist/profiler-frames-CLXlT_xL.js +86 -0
  181. package/dist/profiler-frames-CLXlT_xL.js.map +1 -0
  182. package/dist/profiler-frames-Dg2OebB2.cjs +2 -0
  183. package/dist/profiler-frames-Dg2OebB2.cjs.map +1 -0
  184. package/dist/{remote-rules-Cfb4K-Nl.js → remote-rules-BJGDJGwA.js} +27 -27
  185. package/dist/remote-rules-BJGDJGwA.js.map +1 -0
  186. package/dist/{remote-rules-vzvk7aKf.cjs → remote-rules-CJD3ToVk.cjs} +2 -2
  187. package/dist/remote-rules-CJD3ToVk.cjs.map +1 -0
  188. package/dist/replay-0zAJv9T3.js +338 -0
  189. package/dist/replay-0zAJv9T3.js.map +1 -0
  190. package/dist/replay-DomJpXqW.cjs +2 -0
  191. package/dist/replay-DomJpXqW.cjs.map +1 -0
  192. package/dist/{reports-Dk2YhKIh.cjs → reports-BsbqmP8h.cjs} +2 -2
  193. package/dist/reports-BsbqmP8h.cjs.map +1 -0
  194. package/dist/{reports-TA-zInnq.js → reports-BuXekPOS.js} +3 -3
  195. package/dist/reports-BuXekPOS.js.map +1 -0
  196. package/dist/{resource-timing-BLv3EA2A.js → resource-timing-CXGHwFRD.js} +4 -4
  197. package/dist/resource-timing-CXGHwFRD.js.map +1 -0
  198. package/dist/{resource-timing-Cysw1S1f.cjs → resource-timing-DkycFGDa.cjs} +2 -2
  199. package/dist/resource-timing-DkycFGDa.cjs.map +1 -0
  200. package/dist/{sampling-Ckh2yW9k.cjs → sampling-Dd0wllyq.cjs} +2 -2
  201. package/dist/sampling-Dd0wllyq.cjs.map +1 -0
  202. package/dist/{sampling-C4VV-1MS.js → sampling-UUDbi3K0.js} +9 -9
  203. package/dist/sampling-UUDbi3K0.js.map +1 -0
  204. package/dist/{sanitize-6ymPlVvP.js → sanitize-CNmsD9r3.js} +2 -2
  205. package/dist/sanitize-CNmsD9r3.js.map +1 -0
  206. package/dist/{sanitize-BAWzkZt0.cjs → sanitize-ChLn97Ch.cjs} +2 -2
  207. package/dist/sanitize-ChLn97Ch.cjs.map +1 -0
  208. package/dist/{select-ZF4by-lF.cjs → select-CTk-K5mG.cjs} +3 -3
  209. package/dist/select-CTk-K5mG.cjs.map +1 -0
  210. package/dist/{select-xtQaenIi.js → select-DPv_j6wq.js} +61 -61
  211. package/dist/select-DPv_j6wq.js.map +1 -0
  212. package/dist/{sender-CiMHC9YG.js → sender-15zEsZpr.js} +61 -60
  213. package/dist/sender-15zEsZpr.js.map +1 -0
  214. package/dist/sender-Bfpv9tad.cjs +2 -0
  215. package/dist/sender-Bfpv9tad.cjs.map +1 -0
  216. package/dist/storage/context-storage.d.ts +34 -33
  217. package/dist/storage/emergency-queue.d.ts +9 -9
  218. package/dist/storage/eviction.d.ts +12 -12
  219. package/dist/storage/factory.d.ts +8 -7
  220. package/dist/storage/gap.d.ts +6 -6
  221. package/dist/storage/idb-driver.d.ts +31 -32
  222. package/dist/storage/indexeddb-storage.d.ts +26 -27
  223. package/dist/storage/keys.d.ts +7 -7
  224. package/dist/storage/local-storage.d.ts +38 -38
  225. package/dist/storage/memory-storage.d.ts +21 -22
  226. package/dist/storage/persistence.d.ts +1 -1
  227. package/dist/storage-BA9RqRO-.cjs.map +1 -1
  228. package/dist/storage-DZwed89z.js.map +1 -1
  229. package/dist/{storm-VR024_QN.js → storm-BTSNTIWI.js} +2 -2
  230. package/dist/storm-BTSNTIWI.js.map +1 -0
  231. package/dist/{storm-CYi9Swpx.cjs → storm-D0_qZOEg.cjs} +2 -2
  232. package/dist/storm-D0_qZOEg.cjs.map +1 -0
  233. package/dist/transport/compression.d.ts +2 -2
  234. package/dist/transport/errors.d.ts +7 -7
  235. package/dist/transport/exit-flush.d.ts +39 -39
  236. package/dist/transport/headers.d.ts +2 -2
  237. package/dist/transport/http-transport.d.ts +28 -27
  238. package/dist/transport/memory-transport.d.ts +6 -6
  239. package/dist/transport/retry-engine.d.ts +35 -34
  240. package/dist/transport/serializers/ecs.d.ts +1 -1
  241. package/dist/transport/serializers/otlp-metrics.d.ts +1 -1
  242. package/dist/transport/serializers/otlp-traces.d.ts +1 -1
  243. package/dist/transport/serializers/otlp.d.ts +16 -16
  244. package/dist/transport/serializers/select.d.ts +7 -7
  245. package/dist/transport/status-transport.d.ts +20 -20
  246. package/dist/transport/worker-protocol.d.ts +3 -3
  247. package/dist/types-BAerHgCq.js.map +1 -1
  248. package/dist/types-C7WNpnG1.cjs.map +1 -1
  249. package/dist/{unclean-exit-DFUN57wY.cjs → unclean-exit-ClGzrc2A.cjs} +2 -2
  250. package/dist/unclean-exit-ClGzrc2A.cjs.map +1 -0
  251. package/dist/{unclean-exit-CwcUhFOn.js → unclean-exit-Cob_jyTv.js} +2 -2
  252. package/dist/unclean-exit-Cob_jyTv.js.map +1 -0
  253. package/dist/unref-CU9Nyz_9.cjs +2 -0
  254. package/dist/unref-CU9Nyz_9.cjs.map +1 -0
  255. package/dist/unref-DgHPQeWv.js +7 -0
  256. package/dist/unref-DgHPQeWv.js.map +1 -0
  257. package/dist/user-timing-CdYqx3PF.cjs +2 -0
  258. package/dist/user-timing-CdYqx3PF.cjs.map +1 -0
  259. package/dist/{user-timing-_jZIhDKI.js → user-timing-DgHubxCI.js} +5 -3
  260. package/dist/user-timing-DgHubxCI.js.map +1 -0
  261. package/dist/utils/console.d.ts +2 -2
  262. package/dist/utils/deadline.d.ts +4 -4
  263. package/dist/utils/error-like.d.ts +7 -7
  264. package/dist/utils/fixed-window.d.ts +9 -8
  265. package/dist/utils/global-scope.d.ts +8 -8
  266. package/dist/utils/guards.d.ts +2 -2
  267. package/dist/utils/identity.d.ts +17 -17
  268. package/dist/utils/library-console.d.ts +4 -4
  269. package/dist/utils/library-request.d.ts +10 -10
  270. package/dist/utils/lock.d.ts +10 -9
  271. package/dist/utils/openfin.d.ts +5 -5
  272. package/dist/utils/patch.d.ts +6 -6
  273. package/dist/utils/platform.d.ts +13 -11
  274. package/dist/utils/sanitize.d.ts +4 -4
  275. package/dist/utils/timer.d.ts +1 -1
  276. package/dist/utils/tracing.d.ts +38 -38
  277. package/dist/utils/unref.d.ts +3 -3
  278. package/dist/{web-socket-BWUoqBh8.cjs → web-socket-BTuvYoJI.cjs} +2 -2
  279. package/dist/web-socket-BTuvYoJI.cjs.map +1 -0
  280. package/dist/{web-socket-CV7yIMnm.js → web-socket-DthJuSAg.js} +4 -4
  281. package/dist/web-socket-DthJuSAg.js.map +1 -0
  282. package/dist/web-vitals-Ch5BpDmo.cjs +2 -0
  283. package/dist/web-vitals-Ch5BpDmo.cjs.map +1 -0
  284. package/dist/web-vitals-CsGCWnUr.js +77 -0
  285. package/dist/web-vitals-CsGCWnUr.js.map +1 -0
  286. package/dist/{worker-protocol-CrsdSDLn.js → worker-protocol-B0_8rWy5.js} +4 -4
  287. package/dist/worker-protocol-B0_8rWy5.js.map +1 -0
  288. package/dist/{worker-protocol-Bai7GAIA.cjs → worker-protocol-BjzFORfq.cjs} +2 -2
  289. package/dist/worker-protocol-BjzFORfq.cjs.map +1 -0
  290. package/dist/worker-server-4en-Lt-3.cjs +2 -0
  291. package/dist/worker-server-4en-Lt-3.cjs.map +1 -0
  292. package/dist/{worker-server-Dp5HYm4b.js → worker-server-Cne9MX9I.js} +8 -8
  293. package/dist/{worker-server-Dp5HYm4b.js.map → worker-server-Cne9MX9I.js.map} +1 -1
  294. package/dist/worker-transport-B-GF4Aqn.cjs +2 -0
  295. package/dist/worker-transport-B-GF4Aqn.cjs.map +1 -0
  296. package/dist/{worker-transport-D6jtgpqN.js → worker-transport-C3SjJAEC.js} +62 -61
  297. package/dist/worker-transport-C3SjJAEC.js.map +1 -0
  298. package/package.json +8 -2
  299. package/dist/batch-C8OcWR2L.cjs.map +0 -1
  300. package/dist/batch-CL9uWYY3.js.map +0 -1
  301. package/dist/bus-BZ0GldpT.js.map +0 -1
  302. package/dist/bus-VWlmM5xs.cjs +0 -2
  303. package/dist/bus-VWlmM5xs.cjs.map +0 -1
  304. package/dist/console-BPZCuSLc.cjs.map +0 -1
  305. package/dist/console-BeCF7n59.js.map +0 -1
  306. package/dist/constants-DqKJH_MP.cjs +0 -2
  307. package/dist/constants-DqKJH_MP.cjs.map +0 -1
  308. package/dist/constants-zyrqveN4.js +0 -304
  309. package/dist/constants-zyrqveN4.js.map +0 -1
  310. package/dist/deadline-BOjOxNHj.js.map +0 -1
  311. package/dist/deadline-XSnm95pg.cjs +0 -2
  312. package/dist/deadline-XSnm95pg.cjs.map +0 -1
  313. package/dist/debug-bundle-BzJNpbF0.cjs +0 -2
  314. package/dist/debug-bundle-BzJNpbF0.cjs.map +0 -1
  315. package/dist/debug-bundle-C7UkHZ-q.js.map +0 -1
  316. package/dist/emergency-queue-CNTRui5t.cjs.map +0 -1
  317. package/dist/emergency-queue-Zy6lNafo.js.map +0 -1
  318. package/dist/errors-Dh7kef0i.js.map +0 -1
  319. package/dist/errors-tfEr48bS.cjs.map +0 -1
  320. package/dist/factory-BonqI3NL.js.map +0 -1
  321. package/dist/factory-CJXVYp0R.cjs.map +0 -1
  322. package/dist/identity-Cxgj6pZX.cjs.map +0 -1
  323. package/dist/identity-DT5VmvXy.js.map +0 -1
  324. package/dist/indexeddb-storage-BJVtiQKm.js.map +0 -1
  325. package/dist/indexeddb-storage-CIoW21Xd.cjs.map +0 -1
  326. package/dist/interactions-DTgKy_6K.js.map +0 -1
  327. package/dist/interactions-fEN6FbVo.cjs.map +0 -1
  328. package/dist/journey-CuJrHzEg.js.map +0 -1
  329. package/dist/journey-pffMVMfa.cjs +0 -2
  330. package/dist/journey-pffMVMfa.cjs.map +0 -1
  331. package/dist/library-console-C1m6g1BR.js.map +0 -1
  332. package/dist/library-console-D2GY9Or6.cjs.map +0 -1
  333. package/dist/library-request-1BX_UlaX.cjs.map +0 -1
  334. package/dist/library-request-BQBT9N9Q.js.map +0 -1
  335. package/dist/lifecycle-2EtUaRpo.cjs.map +0 -1
  336. package/dist/lifecycle-BaKx_-32.js.map +0 -1
  337. package/dist/log-record-CAoGBBf3.js.map +0 -1
  338. package/dist/log-record-i9zOTkpQ.cjs.map +0 -1
  339. package/dist/long-frames-BVg4i5SC.cjs +0 -2
  340. package/dist/long-frames-BVg4i5SC.cjs.map +0 -1
  341. package/dist/long-frames-Czk7IupC.js.map +0 -1
  342. package/dist/network-DBNwApoF.js.map +0 -1
  343. package/dist/network-xbbuvG_6.cjs.map +0 -1
  344. package/dist/otlp-BDvFrLnc.cjs +0 -2
  345. package/dist/otlp-BDvFrLnc.cjs.map +0 -1
  346. package/dist/otlp-BTJdIa6F.js.map +0 -1
  347. package/dist/platform-C2Ez5kDc.cjs.map +0 -1
  348. package/dist/platform-DkcuXwe-.js.map +0 -1
  349. package/dist/remote-rules-Cfb4K-Nl.js.map +0 -1
  350. package/dist/remote-rules-vzvk7aKf.cjs.map +0 -1
  351. package/dist/reports-Dk2YhKIh.cjs.map +0 -1
  352. package/dist/reports-TA-zInnq.js.map +0 -1
  353. package/dist/resource-timing-BLv3EA2A.js.map +0 -1
  354. package/dist/resource-timing-Cysw1S1f.cjs.map +0 -1
  355. package/dist/sampling-C4VV-1MS.js.map +0 -1
  356. package/dist/sampling-Ckh2yW9k.cjs.map +0 -1
  357. package/dist/sanitize-6ymPlVvP.js.map +0 -1
  358. package/dist/sanitize-BAWzkZt0.cjs.map +0 -1
  359. package/dist/select-ZF4by-lF.cjs.map +0 -1
  360. package/dist/select-xtQaenIi.js.map +0 -1
  361. package/dist/sender-CiMHC9YG.js.map +0 -1
  362. package/dist/sender-D5wBoXA8.cjs +0 -2
  363. package/dist/sender-D5wBoXA8.cjs.map +0 -1
  364. package/dist/storm-CYi9Swpx.cjs.map +0 -1
  365. package/dist/storm-VR024_QN.js.map +0 -1
  366. package/dist/unclean-exit-CwcUhFOn.js.map +0 -1
  367. package/dist/unclean-exit-DFUN57wY.cjs.map +0 -1
  368. package/dist/user-timing-C9kfRq3J.cjs +0 -2
  369. package/dist/user-timing-C9kfRq3J.cjs.map +0 -1
  370. package/dist/user-timing-_jZIhDKI.js.map +0 -1
  371. package/dist/web-socket-BWUoqBh8.cjs.map +0 -1
  372. package/dist/web-socket-CV7yIMnm.js.map +0 -1
  373. package/dist/web-vitals-Bq4WFHQo.js +0 -52
  374. package/dist/web-vitals-Bq4WFHQo.js.map +0 -1
  375. package/dist/web-vitals-DFuoTQbZ.cjs +0 -2
  376. package/dist/web-vitals-DFuoTQbZ.cjs.map +0 -1
  377. package/dist/worker-protocol-Bai7GAIA.cjs.map +0 -1
  378. package/dist/worker-protocol-CrsdSDLn.js.map +0 -1
  379. package/dist/worker-server-BrIYkfoa.cjs +0 -2
  380. package/dist/worker-server-BrIYkfoa.cjs.map +0 -1
  381. package/dist/worker-transport-Bwej4N2e.cjs +0 -2
  382. package/dist/worker-transport-Bwej4N2e.cjs.map +0 -1
  383. package/dist/worker-transport-D6jtgpqN.js.map +0 -1
@@ -1,24 +1,28 @@
1
1
  import type { Counter, Histogram, HistogramOptions, InstrumentDef, InstrumentOptions, MetricAttributes } from "../models/metric";
2
2
  import type { Diagnostics } from "./diagnostics";
3
- /** Adds a value to an instrument of the runtime. */
3
+ /** Adds a value to one of the runtime's instruments. */
4
4
  export type RecordMetric = (def: InstrumentDef, value: number, attributes?: MetricAttributes) => void;
5
+ /** Called with whatever reading an options object threw. */
6
+ export type OptionsFault = (error: unknown) => void;
5
7
  /**
6
- * Makes a counter handle.
8
+ * Creates a counter handle. Never throws into the app.
7
9
  * @param name Metric name.
8
- * @param options Unit of the values.
10
+ * @param options Unit for the values.
9
11
  * @param record Adds a value to the instrument.
12
+ * @param fault Reports options that couldn't be read.
10
13
  * @returns The counter.
11
14
  */
12
- export declare function makeCounter(name: string, options: InstrumentOptions, record: RecordMetric): Counter;
15
+ export declare function makeCounter(name: string, options: InstrumentOptions, record: RecordMetric, fault: OptionsFault): Counter;
13
16
  /**
14
- * Makes a histogram handle.
17
+ * Creates a histogram handle. Never throws into the app.
15
18
  * @param name Metric name.
16
- * @param options Unit of the values and the bucket boundaries.
19
+ * @param options Unit for the values, and the bucket boundaries.
17
20
  * @param record Adds a value to the instrument.
21
+ * @param fault Reports options that couldn't be read.
18
22
  * @returns The histogram.
19
23
  */
20
- export declare function makeHistogram(name: string, options: HistogramOptions, record: RecordMetric): Histogram;
21
- /** Sums the values of the counter and histogram instruments for one interval. */
24
+ export declare function makeHistogram(name: string, options: HistogramOptions, record: RecordMetric, fault: OptionsFault): Histogram;
25
+ /** Sums the values of counter and histogram instruments over one interval. */
22
26
  export declare class Meter {
23
27
  private readonly intervalMs;
24
28
  private readonly emit;
@@ -26,13 +30,13 @@ export declare class Meter {
26
30
  private readonly policy;
27
31
  /** Instruments with a value in the current interval. */
28
32
  private readonly instruments;
29
- /** Timer of the current interval. It runs only while a value waits. */
33
+ /** Timer for the current interval. Runs only while a value is waiting. */
30
34
  private timer;
31
- /** Time of the first value of the interval, in epoch milliseconds. */
35
+ /** Time of the interval's first value, in epoch milliseconds. */
32
36
  private startedAt;
33
37
  /**
34
- * @param intervalMs Gives the interval length, in milliseconds.
35
- * @param emit Builds and sends the record of one point from the call attributes and the
38
+ * @param intervalMs Returns the interval length, in milliseconds.
39
+ * @param emit Builds and sends the record for one point from the call attributes and the
36
40
  * metric fields.
37
41
  * @param diagnostics Diagnostics reporter.
38
42
  */
@@ -42,27 +46,27 @@ export declare class Meter {
42
46
  maxHistogramBoundaries: number;
43
47
  });
44
48
  /**
45
- * Adds a value to the series of its attribute set. It never throws into the call of the app.
46
- * @param def Definition of the instrument.
49
+ * Adds a value to the series for its attribute set. Never throws into the app.
50
+ * @param def The instrument's definition.
47
51
  * @param value Value to add.
48
- * @param attributes Attribute set of the value.
52
+ * @param attributes The value's attribute set.
49
53
  */
50
54
  record(def: InstrumentDef, value: number, attributes?: MetricAttributes): void;
51
- /** Sends one point for each series of the interval. It then starts a new interval. */
55
+ /** Sends one point per series in the interval, then starts a new interval. */
52
56
  collect(): void;
53
57
  /**
54
- * Finds the instrument of the interval. The first value of the interval sets its definition.
55
- * @param def Definition of the call.
58
+ * Finds the interval's instrument. The first value of the interval sets its definition.
59
+ * @param def The call's definition.
56
60
  * @returns The instrument, or null when the name has another kind.
57
61
  */
58
62
  private instrumentOf;
59
63
  /**
60
- * Adds a value to the series of an attribute set.
61
- * @param instrument Instrument of the value.
64
+ * Adds a value to an attribute set's series.
65
+ * @param instrument The value's instrument.
62
66
  * @param value Value to add.
63
67
  * @param attributes Clean attribute set.
64
68
  */
65
69
  private add;
66
- /** Starts the timer of the interval at its first value. An idle meter has no timer. */
70
+ /** Starts the interval's timer on its first value. An idle meter has no timer. */
67
71
  private arm;
68
72
  }
@@ -10,12 +10,12 @@ import type { Diagnostics } from "./diagnostics";
10
10
  export type StreamName = "logs" | "metrics" | "traces";
11
11
  /** Batching policy for one record stream. */
12
12
  export interface StreamOptions {
13
- /** Maximum time in milliseconds that a partial batch waits before the pipeline sends it. */
13
+ /** Maximum time in milliseconds a partial batch waits before the pipeline sends it. */
14
14
  flushIntervalMs: number;
15
- /** Maximum records in a batch. At this count, the pipeline sends the batch early. */
15
+ /** Maximum records in a batch. At this count the pipeline sends the batch early. */
16
16
  batchSize: number;
17
17
  }
18
- /** Buffers the log and metric streams. It makes batches. It sends them over HTTP. */
18
+ /** Buffers the log, metric and trace streams, builds batches and sends them over HTTP. */
19
19
  export declare class LogPipeline {
20
20
  private readonly transport;
21
21
  private readonly storage;
@@ -25,27 +25,27 @@ export declare class LogPipeline {
25
25
  private readonly policy?;
26
26
  private readonly onLoss;
27
27
  private readonly clockOffset;
28
- /** Buffer instances for logs and metrics streams. */
28
+ /** Buffer instances for the logs, metrics and traces streams. */
29
29
  private readonly streams;
30
- /** In-flight batches without delivery confirmation. The exit flush sends them again. */
30
+ /** In-flight batches with no delivery confirmation yet. The exit flush sends them again. */
31
31
  private readonly unconfirmed;
32
32
  /** Closed batches waiting for a free dispatch slot. */
33
33
  private readonly queue;
34
- /** Each batch in the queue or in flight. flushPending waits for them. destroy() resolves them. */
34
+ /** Every batch in the queue or in flight. flushPending waits on them, destroy() resolves them. */
35
35
  private readonly open;
36
36
  /** Ceiling on the ERROR and FATAL records that bypass sampling. */
37
37
  private readonly ceiling;
38
- /** Requests that have not completed. delivery.maxConcurrentRequests sets their limit. */
38
+ /** Requests that haven't completed. Capped by delivery.maxConcurrentRequests. */
39
39
  private inFlight;
40
- /** It is true when a pump is in the queue. One microtask then drains a burst. */
40
+ /** True while a pump is queued, so one microtask drains a whole burst. */
41
41
  private pumpScheduled;
42
42
  /** True after destroy() stops the pipeline. */
43
43
  private stopped;
44
- /** Encoded byte count of each record in the buffers or requests. */
44
+ /** Encoded byte count of every record in the buffers or in requests. */
45
45
  private readonly held;
46
46
  /** Total encoded bytes of the held records. */
47
47
  private heldBytes;
48
- /** True while the overflow storage operation has not completed. */
48
+ /** True while the overflow storage operation is still running. */
49
49
  private persisting;
50
50
  /**
51
51
  * Removes completed or dropped records from the buffer counts.
@@ -53,8 +53,9 @@ export declare class LogPipeline {
53
53
  */
54
54
  private release;
55
55
  /**
56
- * Removes records that have not reached the transport. A request already sent cannot be removed.
57
- * @returns True if the method removed a batch or a buffered group.
56
+ * Removes records that haven't reached the transport. A request that was already sent can't
57
+ * be removed.
58
+ * @returns True if a batch or a buffered group was removed.
58
59
  */
59
60
  private evict;
60
61
  /**
@@ -69,10 +70,10 @@ export declare class LogPipeline {
69
70
  * @param retry Retry engine for redelivering persisted batches.
70
71
  * @param diagnostics Diagnostics reporter.
71
72
  * @param streamOptions Batching policy per stream, from the batching config.
72
- * @param routingContextId Gives the delivery context id of a new batch.
73
+ * @param routingContextId Returns the delivery context id for a new batch.
73
74
  * @param policy Active configuration instance.
74
- * @param onLoss Receives the records that the pipeline loses.
75
- * @param clockOffset Gives the clock offset for a new log or span record, if known.
75
+ * @param onLoss Receives the records the pipeline loses.
76
+ * @param clockOffset Returns the clock offset for a new log or span record, if known.
76
77
  */
77
78
  constructor(transport: BatchTransport, storage: StorageAdapter, retry: RetryEngine, diagnostics: Diagnostics, streamOptions: Record<StreamName, StreamOptions>, routingContextId?: (() => string | undefined) | undefined, policy?: ResolvedConfig | undefined, onLoss?: LossReporter, clockOffset?: () => number | undefined);
78
79
  /**
@@ -82,22 +83,22 @@ export declare class LogPipeline {
82
83
  push(record: LogRecord): void;
83
84
  /**
84
85
  * Drains all buffered and unconfirmed in-flight records into exit batches in one step.
85
- * Records already given to fetch go again under a new batch ID. The server cannot
86
- * deduplicate them. Thus the exit flush can deliver duplicates. This is intentional.
87
- * A closing document cannot confirm delivery.
88
- * @returns One batch for each stream, metrics first. A stream with no records has no batch.
89
- * A mixed batch sends a metric to the endpoint of the logs.
86
+ * Records already handed to fetch go out again under a new batch ID, and the server can't
87
+ * deduplicate them. So the exit flush can deliver duplicates. That is intentional: a
88
+ * closing document can't confirm delivery.
89
+ * @returns One batch per stream, metrics first. A stream with no records gets no batch.
90
+ * A mixed batch would send a metric to the logs endpoint.
90
91
  */
91
92
  drainForExit(): LogBatch[];
92
93
  /**
93
- * Sends the buffered records through the normal dispatch path. Then it waits for each
94
- * batch in the queue and in flight. The throttle check and the concurrency limit apply.
95
- * A direct send goes around both.
96
- * @returns Promise that resolves when the pipeline sends or stores each batch, or on destroy.
94
+ * Sends the buffered records through the normal dispatch path, then waits for every batch
95
+ * in the queue and in flight. The throttle check and the concurrency limit apply. A direct
96
+ * send would bypass both.
97
+ * @returns Promise that resolves once every batch is sent or stored, or on destroy.
97
98
  */
98
99
  flushPending(): Promise<void>;
99
100
  /**
100
- * Counts the records that wait and the records in requests.
101
+ * Counts the waiting records and the records in requests.
101
102
  * @returns Records in the buffers and the queue, and records in dispatch.
102
103
  */
103
104
  counts(): {
@@ -113,49 +114,49 @@ export declare class LogPipeline {
113
114
  */
114
115
  private toBatch;
115
116
  /**
116
- * Sorts a record into its stream. Sampling already ran. RecordBuilder samples a local
117
- * record. The runtime samples a forwarded record. This method catches each fault.
118
- * A record without `attributes` makes streamOf throw. An uncaught throw goes into the
119
- * log call of the caller.
117
+ * Sorts a record into its stream. Sampling has already run: RecordBuilder samples a local
118
+ * record and the runtime samples a forwarded one. Every fault is caught here. A record
119
+ * without `attributes` makes streamOf throw, and an uncaught throw would land in the
120
+ * caller's log call.
120
121
  * @param record Record to sort.
121
122
  */
122
123
  private route;
123
124
  /**
124
- * Drains a stream buffer into a new batch and queues the batch for dispatch.
125
- * A timer or a flush calls it. An empty buffer gives no batch.
126
- * Each `take` stops the timer that calls this method.
125
+ * Drains a stream buffer into a new batch and queues it for dispatch. Called by a timer
126
+ * or a flush. An empty buffer produces no batch. Every `take` stops the timer that calls
127
+ * this method.
127
128
  * @param stream Stream buffer to drain.
128
129
  */
129
130
  private claim;
130
131
  /**
131
- * Queues a batch and schedules the pump on a microtask. An inline dispatch starts
132
- * a fetch inside the log call of the application.
132
+ * Queues a batch and schedules the pump on a microtask. Dispatching inline would start
133
+ * a fetch inside the application's log call.
133
134
  * @param batch Batch ready for delivery, or null when the drain found no records.
134
135
  */
135
136
  private enqueue;
136
137
  /** Starts queued dispatches up to the concurrency limit. */
137
138
  private pump;
138
139
  /**
139
- * Delivers one batch. It then frees the concurrency slot. It resolves the promise of the batch.
140
+ * Delivers one batch, then frees the concurrency slot and resolves the batch's promise.
140
141
  * @param pending Batch to deliver.
141
142
  */
142
143
  private run;
143
144
  /**
144
- * Sends a batch over the HTTP transport. If the transport throttles or fails, it stores
145
- * the batch.
145
+ * Sends a batch over the HTTP transport. Stores the batch if the transport is throttled
146
+ * or fails.
146
147
  * @param batch Batch to deliver.
147
148
  */
148
149
  private dispatch;
149
150
  /**
150
- * Stores a batch that the transport refused. The retry engine splits a 413 and
151
- * drops a batch that the server does not accept.
151
+ * Stores a batch that the transport refused. The retry engine splits a 413 and drops a
152
+ * batch the server won't accept.
152
153
  * @param batch Batch to persist, with its attempt already counted.
153
154
  * @param error Failure thrown by the transport.
154
155
  */
155
156
  private storeFailed;
156
157
  /**
157
- * Stores an undelivered batch. Then it starts the retry engine. A deadline limits the
158
- * wait. A storage call that does not settle holds this dispatch slot. Two such calls
158
+ * Stores an undelivered batch, then starts the retry engine. A deadline caps the wait,
159
+ * because a storage call that never settles holds this dispatch slot, and two of them
159
160
  * stop the pipeline.
160
161
  * @param batch Batch to persist.
161
162
  */
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Returns the bucket for a duration. Runs on the hot path, once per value.
3
+ * @param us Duration in microseconds, a non-negative integer.
4
+ * @returns The bucket index, 0 to 367. Anything above PROFILE_MAX_US lands in 367.
5
+ */
6
+ export declare function bucketOf(us: number): number;
7
+ /**
8
+ * Returns the largest duration that still falls into a bucket.
9
+ * @param index Bucket index, 0 to 367.
10
+ * @returns The inclusive upper bound, in microseconds.
11
+ */
12
+ export declare function upperOf(index: number): number;
13
+ /**
14
+ * Reads a percentile from one probe's histogram. Allocates nothing.
15
+ * @param buckets Bucket counts for all probes.
16
+ * @param base Index of the probe's first bucket.
17
+ * @param count Sum of the probe's buckets. Must be above 0.
18
+ * @param q Percentile as a fraction, e.g. 0.99.
19
+ * @returns The upper bound of the bucket that holds the rank, in microseconds.
20
+ */
21
+ export declare function percentileOf(buckets: Uint32Array, base: number, count: number, q: number): number;
22
+ /**
23
+ * Builds the explicit-bounds histogram for a summary record.
24
+ * @param buckets Bucket counts for all probes.
25
+ * @param base Index of the probe's first bucket.
26
+ * @returns Bounds in ms and the count per group. There is one more count than there are bounds.
27
+ */
28
+ export declare function pointBuckets(buckets: Uint32Array, base: number): {
29
+ bounds: number[];
30
+ counts: number[];
31
+ };
@@ -0,0 +1,218 @@
1
+ import type { MetricAttributes, Probe, ProbeOptions, Profiler } from "../models/metric";
2
+ import type { Diagnostics } from "./diagnostics";
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;
@@ -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,43 @@ 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
111
  /**
112
112
  * 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.
113
+ * hooks run now, and an error record from this context sends the kept record later.
114
+ * @param input The dropped record's input.
115
115
  */
116
116
  private keepForDebug;
117
117
  /**
118
- * Builds a structured LogRecord from the input. It sanitizes attributes and applies size limits.
118
+ * Builds a structured LogRecord from the input, sanitizing attributes and applying size limits.
119
119
  * @param input Logger call input parameters.
120
120
  * @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.
121
+ * @returns The record, or null with the reason for the drop.
122
122
  */
123
123
  build(input: BuildInput, forConsole?: boolean): BuildResult;
124
124
  /**
125
125
  * 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.
126
+ * forwards raw records, so the sender is the last privacy gate.
127
127
  * @param record Forwarded record.
128
128
  * @returns The record to deliver, or null when the hook drops it.
129
129
  */
130
130
  redactForwarded(record: LogRecord): LogRecord | null;
131
131
  /**
132
- * Runs the hooks in order. Then it sanitizes and measures the attributes again.
132
+ * Runs the hooks in order, then sanitizes and measures the attributes again.
133
133
  * @param record Built record.
134
134
  * @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.
135
+ * @param fixed Fields the library builds. The hooks can't change them.
136
+ * @returns The record and the size of its attributes, or the reason for the drop.
137
137
  */
138
138
  private applyHooks;
139
139
  /**
@@ -141,12 +141,12 @@ export declare class RecordBuilder {
141
141
  * @param hook Processor or redact hook.
142
142
  * @param stage Stage of the hook.
143
143
  * @param record Record before the hook.
144
- * @returns The record after the hook, or the reason of the drop.
144
+ * @returns The record after the hook, or the reason for the drop.
145
145
  */
146
146
  private runHook;
147
147
  /**
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.
148
+ * Calls the config's contextProvider. A provider that throws or returns something that isn't
149
+ * an object adds nothing, and the record is still built. undefined means no attributes.
150
150
  * @returns The attributes from the provider, or an empty object.
151
151
  */
152
152
  private provided;
@@ -2,15 +2,15 @@ import type { ResolvedConfig } from "../models/config";
2
2
  import type { Diagnostics } from "./diagnostics";
3
3
  import { type RemoteSlot, type RemoteUpdate } from "./remote-sampling";
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
  */