@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.
- package/CHANGELOG.md +61 -0
- package/README.md +273 -102
- package/bin/uiobs.mjs +1 -1
- package/dist/{batch-CL9uWYY3.js → batch-BjQUwjA6.js} +4 -4
- package/dist/batch-BjQUwjA6.js.map +1 -0
- package/dist/{batch-C8OcWR2L.cjs → batch-D5LlU4Q9.cjs} +2 -2
- package/dist/batch-D5LlU4Q9.cjs.map +1 -0
- package/dist/bus/bus.d.ts +48 -47
- package/dist/bus/links.d.ts +4 -4
- package/dist/bus/validation.d.ts +1 -1
- package/dist/bus-D_7pd7RN.cjs +2 -0
- package/dist/bus-D_7pd7RN.cjs.map +1 -0
- package/dist/{bus-BZ0GldpT.js → bus-ecxUNTja.js} +91 -91
- package/dist/bus-ecxUNTja.js.map +1 -0
- package/dist/capture/console.d.ts +10 -10
- package/dist/capture/errors.d.ts +6 -6
- package/dist/capture/interactions.d.ts +14 -14
- package/dist/capture/lifecycle.d.ts +3 -3
- package/dist/capture/long-frames.d.ts +6 -6
- package/dist/capture/network.d.ts +17 -17
- package/dist/capture/profiler-frames.d.ts +44 -0
- package/dist/capture/replay-buffer.d.ts +46 -0
- package/dist/capture/replay-upload.d.ts +74 -0
- package/dist/capture/replay.d.ts +114 -0
- package/dist/capture/reports.d.ts +2 -2
- package/dist/capture/resource-timing.d.ts +1 -1
- package/dist/capture/server-timing.d.ts +3 -3
- package/dist/capture/storm.d.ts +3 -3
- package/dist/capture/types.d.ts +45 -33
- package/dist/capture/unclean-exit.d.ts +8 -8
- package/dist/capture/user-timing.d.ts +3 -3
- package/dist/capture/web-socket.d.ts +11 -11
- package/dist/capture/web-vitals.d.ts +20 -7
- package/dist/compression-AJJCMBOa.js +11 -0
- package/dist/compression-AJJCMBOa.js.map +1 -0
- package/dist/compression-lD9abCcO.cjs +2 -0
- package/dist/compression-lD9abCcO.cjs.map +1 -0
- package/dist/{console-BPZCuSLc.cjs → console-CLz_PvFn.cjs} +2 -2
- package/dist/console-CLz_PvFn.cjs.map +1 -0
- package/dist/{console-BeCF7n59.js → console-cwgHKXvM.js} +4 -4
- package/dist/console-cwgHKXvM.js.map +1 -0
- package/dist/constants-Bwl_YtQi.js +349 -0
- package/dist/constants-Bwl_YtQi.js.map +1 -0
- package/dist/constants-DakMxVB2.cjs +2 -0
- package/dist/constants-DakMxVB2.cjs.map +1 -0
- package/dist/constants.d.ts +150 -103
- package/dist/context-storage-BjzeBSxH.cjs.map +1 -1
- package/dist/context-storage-BzkoHzkQ.js.map +1 -1
- package/dist/core/breadcrumbs.d.ts +16 -15
- package/dist/core/config.d.ts +3 -3
- package/dist/core/context.d.ts +7 -7
- package/dist/core/debug-buffer.d.ts +10 -10
- package/dist/core/debug-bundle.d.ts +3 -3
- package/dist/core/deferred.d.ts +2 -2
- package/dist/core/diagnostics.d.ts +24 -21
- package/dist/core/drops.d.ts +7 -7
- package/dist/core/hold-buffer.d.ts +1 -1
- package/dist/core/journey.d.ts +22 -23
- package/dist/core/logger.d.ts +22 -21
- package/dist/core/measure.d.ts +7 -7
- package/dist/core/meter.d.ts +25 -21
- package/dist/core/pipeline.d.ts +42 -41
- package/dist/core/profile-buckets.d.ts +31 -0
- package/dist/core/profiler.d.ts +218 -0
- package/dist/core/record.d.ts +23 -23
- package/dist/core/remote-rules.d.ts +4 -4
- package/dist/core/remote-sampling.d.ts +21 -20
- package/dist/core/runtime.d.ts +206 -137
- package/dist/core/sampling.d.ts +18 -18
- package/dist/core/sender.d.ts +22 -20
- package/dist/core/spans.d.ts +5 -5
- package/dist/{deadline-BOjOxNHj.js → deadline-C4ccAuk5.js} +3 -6
- package/dist/deadline-C4ccAuk5.js.map +1 -0
- package/dist/deadline-CUGbto-y.cjs +2 -0
- package/dist/deadline-CUGbto-y.cjs.map +1 -0
- package/dist/{debug-bundle-C7UkHZ-q.js → debug-bundle-BOdYmCeV.js} +10 -3
- package/dist/debug-bundle-BOdYmCeV.js.map +1 -0
- package/dist/debug-bundle-Ex4L_LSP.cjs +2 -0
- package/dist/debug-bundle-Ex4L_LSP.cjs.map +1 -0
- package/dist/doctor.cjs +1 -1
- package/dist/doctor.cjs.map +1 -1
- package/dist/doctor.d.ts +16 -6
- package/dist/doctor.js +147 -52
- package/dist/doctor.js.map +1 -1
- package/dist/{emergency-queue-Zy6lNafo.js → emergency-queue-B9WZxanZ.js} +4 -4
- package/dist/emergency-queue-B9WZxanZ.js.map +1 -0
- package/dist/{emergency-queue-CNTRui5t.cjs → emergency-queue-HBpL5r3V.cjs} +2 -2
- package/dist/emergency-queue-HBpL5r3V.cjs.map +1 -0
- package/dist/error-like-B11pB4aL.js.map +1 -1
- package/dist/error-like-gGRx2s36.cjs.map +1 -1
- package/dist/{errors-Dh7kef0i.js → errors-D6bwgJtO.js} +3 -3
- package/dist/errors-D6bwgJtO.js.map +1 -0
- package/dist/{errors-tfEr48bS.cjs → errors-DCOCRdSi.cjs} +2 -2
- package/dist/errors-DCOCRdSi.cjs.map +1 -0
- package/dist/{factory-CJXVYp0R.cjs → factory-DLFDjdLv.cjs} +2 -2
- package/dist/factory-DLFDjdLv.cjs.map +1 -0
- package/dist/{factory-BonqI3NL.js → factory-e9Qo3K0z.js} +13 -13
- package/dist/factory-e9Qo3K0z.js.map +1 -0
- package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
- package/dist/fixed-window-Dq3MLUUv.js.map +1 -1
- package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
- package/dist/global-scope-D9I8s-oN.js.map +1 -1
- package/dist/guards-Cidk71ME.js.map +1 -1
- package/dist/guards-nJ70syPt.cjs.map +1 -1
- package/dist/{identity-Cxgj6pZX.cjs → identity-BlvlgjrU.cjs} +2 -2
- package/dist/identity-BlvlgjrU.cjs.map +1 -0
- package/dist/{identity-DT5VmvXy.js → identity-BrQp_5J5.js} +19 -19
- package/dist/identity-BrQp_5J5.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +112 -79
- package/dist/index.js +783 -635
- package/dist/index.js.map +1 -1
- package/dist/{indexeddb-storage-CIoW21Xd.cjs → indexeddb-storage-CtLvZH1r.cjs} +2 -2
- package/dist/indexeddb-storage-CtLvZH1r.cjs.map +1 -0
- package/dist/{indexeddb-storage-BJVtiQKm.js → indexeddb-storage-DLXQzAGh.js} +4 -4
- package/dist/indexeddb-storage-DLXQzAGh.js.map +1 -0
- package/dist/{interactions-DTgKy_6K.js → interactions-B6z2I4tU.js} +3 -3
- package/dist/interactions-B6z2I4tU.js.map +1 -0
- package/dist/{interactions-fEN6FbVo.cjs → interactions-P6pz08Jn.cjs} +2 -2
- package/dist/interactions-P6pz08Jn.cjs.map +1 -0
- package/dist/{journey-CuJrHzEg.js → journey-35yCMNFo.js} +20 -19
- package/dist/journey-35yCMNFo.js.map +1 -0
- package/dist/journey-DAGh5h9k.cjs +2 -0
- package/dist/journey-DAGh5h9k.cjs.map +1 -0
- package/dist/keys-BHhw_0Wh.cjs.map +1 -1
- package/dist/keys-BU9j5YqW.js.map +1 -1
- package/dist/{library-console-D2GY9Or6.cjs → library-console-BFWEuQsl.cjs} +2 -2
- package/dist/library-console-BFWEuQsl.cjs.map +1 -0
- package/dist/{library-console-C1m6g1BR.js → library-console-Dl_Ly6DQ.js} +2 -2
- package/dist/library-console-Dl_Ly6DQ.js.map +1 -0
- package/dist/{library-request-1BX_UlaX.cjs → library-request-Da-CHKzT.cjs} +2 -2
- package/dist/library-request-Da-CHKzT.cjs.map +1 -0
- package/dist/{library-request-BQBT9N9Q.js → library-request-nI6pvI6I.js} +2 -2
- package/dist/library-request-nI6pvI6I.js.map +1 -0
- package/dist/{lifecycle-2EtUaRpo.cjs → lifecycle-BGGOcN4N.cjs} +2 -2
- package/dist/lifecycle-BGGOcN4N.cjs.map +1 -0
- package/dist/{lifecycle-BaKx_-32.js → lifecycle-CZ6RRXc6.js} +2 -2
- package/dist/lifecycle-CZ6RRXc6.js.map +1 -0
- package/dist/{log-record-i9zOTkpQ.cjs → log-record-D7bA1RPb.cjs} +2 -2
- package/dist/log-record-D7bA1RPb.cjs.map +1 -0
- package/dist/{log-record-CAoGBBf3.js → log-record-DIA6McNr.js} +2 -2
- package/dist/log-record-DIA6McNr.js.map +1 -0
- package/dist/{long-frames-Czk7IupC.js → long-frames-430_85Da.js} +8 -6
- package/dist/long-frames-430_85Da.js.map +1 -0
- package/dist/long-frames-Dd8tsi2U.cjs +2 -0
- package/dist/long-frames-Dd8tsi2U.cjs.map +1 -0
- package/dist/models/batch.d.ts +14 -15
- package/dist/models/bus.d.ts +24 -24
- package/dist/models/config.d.ts +402 -216
- package/dist/models/drop.d.ts +13 -11
- package/dist/models/health.d.ts +13 -13
- package/dist/models/log-record.d.ts +13 -14
- package/dist/models/metric.d.ts +82 -17
- package/dist/models/plugin.d.ts +13 -13
- package/dist/models/replay.d.ts +60 -0
- package/dist/models/serializer.d.ts +2 -3
- package/dist/models/stats.d.ts +2 -2
- package/dist/models/storage.d.ts +12 -11
- package/dist/{network-DBNwApoF.js → network-C7SkLf4v.js} +12 -12
- package/dist/network-C7SkLf4v.js.map +1 -0
- package/dist/{network-xbbuvG_6.cjs → network-pEX3PAJv.cjs} +2 -2
- package/dist/network-pEX3PAJv.cjs.map +1 -0
- package/dist/openfin-Bxelt0yg.js.map +1 -1
- package/dist/openfin-DtH2f7zX.cjs.map +1 -1
- package/dist/otlp-2MCrC3kd.cjs +2 -0
- package/dist/otlp-2MCrC3kd.cjs.map +1 -0
- package/dist/{otlp-BTJdIa6F.js → otlp-COq033e3.js} +25 -32
- package/dist/otlp-COq033e3.js.map +1 -0
- package/dist/patch-BX8KrPCT.cjs.map +1 -1
- package/dist/patch-UdPz1ea8.js.map +1 -1
- package/dist/{platform-C2Ez5kDc.cjs → platform-12uR7kBQ.cjs} +2 -2
- package/dist/platform-12uR7kBQ.cjs.map +1 -0
- package/dist/{platform-DkcuXwe-.js → platform-CVewe4wQ.js} +7 -7
- package/dist/platform-CVewe4wQ.js.map +1 -0
- package/dist/profiler-BVWIOgnq.js +310 -0
- package/dist/profiler-BVWIOgnq.js.map +1 -0
- package/dist/profiler-eVCknCzS.cjs +2 -0
- package/dist/profiler-eVCknCzS.cjs.map +1 -0
- package/dist/profiler-frames-CLXlT_xL.js +86 -0
- package/dist/profiler-frames-CLXlT_xL.js.map +1 -0
- package/dist/profiler-frames-Dg2OebB2.cjs +2 -0
- package/dist/profiler-frames-Dg2OebB2.cjs.map +1 -0
- package/dist/{remote-rules-Cfb4K-Nl.js → remote-rules-BJGDJGwA.js} +27 -27
- package/dist/remote-rules-BJGDJGwA.js.map +1 -0
- package/dist/{remote-rules-vzvk7aKf.cjs → remote-rules-CJD3ToVk.cjs} +2 -2
- package/dist/remote-rules-CJD3ToVk.cjs.map +1 -0
- package/dist/replay-0zAJv9T3.js +338 -0
- package/dist/replay-0zAJv9T3.js.map +1 -0
- package/dist/replay-DomJpXqW.cjs +2 -0
- package/dist/replay-DomJpXqW.cjs.map +1 -0
- package/dist/{reports-Dk2YhKIh.cjs → reports-BsbqmP8h.cjs} +2 -2
- package/dist/reports-BsbqmP8h.cjs.map +1 -0
- package/dist/{reports-TA-zInnq.js → reports-BuXekPOS.js} +3 -3
- package/dist/reports-BuXekPOS.js.map +1 -0
- package/dist/{resource-timing-BLv3EA2A.js → resource-timing-CXGHwFRD.js} +4 -4
- package/dist/resource-timing-CXGHwFRD.js.map +1 -0
- package/dist/{resource-timing-Cysw1S1f.cjs → resource-timing-DkycFGDa.cjs} +2 -2
- package/dist/resource-timing-DkycFGDa.cjs.map +1 -0
- package/dist/{sampling-Ckh2yW9k.cjs → sampling-Dd0wllyq.cjs} +2 -2
- package/dist/sampling-Dd0wllyq.cjs.map +1 -0
- package/dist/{sampling-C4VV-1MS.js → sampling-UUDbi3K0.js} +9 -9
- package/dist/sampling-UUDbi3K0.js.map +1 -0
- package/dist/{sanitize-6ymPlVvP.js → sanitize-CNmsD9r3.js} +2 -2
- package/dist/sanitize-CNmsD9r3.js.map +1 -0
- package/dist/{sanitize-BAWzkZt0.cjs → sanitize-ChLn97Ch.cjs} +2 -2
- package/dist/sanitize-ChLn97Ch.cjs.map +1 -0
- package/dist/{select-ZF4by-lF.cjs → select-CTk-K5mG.cjs} +3 -3
- package/dist/select-CTk-K5mG.cjs.map +1 -0
- package/dist/{select-xtQaenIi.js → select-DPv_j6wq.js} +61 -61
- package/dist/select-DPv_j6wq.js.map +1 -0
- package/dist/{sender-CiMHC9YG.js → sender-15zEsZpr.js} +61 -60
- package/dist/sender-15zEsZpr.js.map +1 -0
- package/dist/sender-Bfpv9tad.cjs +2 -0
- package/dist/sender-Bfpv9tad.cjs.map +1 -0
- package/dist/storage/context-storage.d.ts +34 -33
- package/dist/storage/emergency-queue.d.ts +9 -9
- package/dist/storage/eviction.d.ts +12 -12
- package/dist/storage/factory.d.ts +8 -7
- package/dist/storage/gap.d.ts +6 -6
- package/dist/storage/idb-driver.d.ts +31 -32
- package/dist/storage/indexeddb-storage.d.ts +26 -27
- package/dist/storage/keys.d.ts +7 -7
- package/dist/storage/local-storage.d.ts +38 -38
- package/dist/storage/memory-storage.d.ts +21 -22
- package/dist/storage/persistence.d.ts +1 -1
- package/dist/storage-BA9RqRO-.cjs.map +1 -1
- package/dist/storage-DZwed89z.js.map +1 -1
- package/dist/{storm-VR024_QN.js → storm-BTSNTIWI.js} +2 -2
- package/dist/storm-BTSNTIWI.js.map +1 -0
- package/dist/{storm-CYi9Swpx.cjs → storm-D0_qZOEg.cjs} +2 -2
- package/dist/storm-D0_qZOEg.cjs.map +1 -0
- package/dist/transport/compression.d.ts +2 -2
- package/dist/transport/errors.d.ts +7 -7
- package/dist/transport/exit-flush.d.ts +39 -39
- package/dist/transport/headers.d.ts +2 -2
- package/dist/transport/http-transport.d.ts +28 -27
- package/dist/transport/memory-transport.d.ts +6 -6
- package/dist/transport/retry-engine.d.ts +35 -34
- package/dist/transport/serializers/ecs.d.ts +1 -1
- package/dist/transport/serializers/otlp-metrics.d.ts +1 -1
- package/dist/transport/serializers/otlp-traces.d.ts +1 -1
- package/dist/transport/serializers/otlp.d.ts +16 -16
- package/dist/transport/serializers/select.d.ts +7 -7
- package/dist/transport/status-transport.d.ts +20 -20
- package/dist/transport/worker-protocol.d.ts +3 -3
- package/dist/types-BAerHgCq.js.map +1 -1
- package/dist/types-C7WNpnG1.cjs.map +1 -1
- package/dist/{unclean-exit-DFUN57wY.cjs → unclean-exit-ClGzrc2A.cjs} +2 -2
- package/dist/unclean-exit-ClGzrc2A.cjs.map +1 -0
- package/dist/{unclean-exit-CwcUhFOn.js → unclean-exit-Cob_jyTv.js} +2 -2
- package/dist/unclean-exit-Cob_jyTv.js.map +1 -0
- package/dist/unref-CU9Nyz_9.cjs +2 -0
- package/dist/unref-CU9Nyz_9.cjs.map +1 -0
- package/dist/unref-DgHPQeWv.js +7 -0
- package/dist/unref-DgHPQeWv.js.map +1 -0
- package/dist/user-timing-CdYqx3PF.cjs +2 -0
- package/dist/user-timing-CdYqx3PF.cjs.map +1 -0
- package/dist/{user-timing-_jZIhDKI.js → user-timing-DgHubxCI.js} +5 -3
- package/dist/user-timing-DgHubxCI.js.map +1 -0
- package/dist/utils/console.d.ts +2 -2
- package/dist/utils/deadline.d.ts +4 -4
- package/dist/utils/error-like.d.ts +7 -7
- package/dist/utils/fixed-window.d.ts +9 -8
- package/dist/utils/global-scope.d.ts +8 -8
- package/dist/utils/guards.d.ts +2 -2
- package/dist/utils/identity.d.ts +17 -17
- package/dist/utils/library-console.d.ts +4 -4
- package/dist/utils/library-request.d.ts +10 -10
- package/dist/utils/lock.d.ts +10 -9
- package/dist/utils/openfin.d.ts +5 -5
- package/dist/utils/patch.d.ts +6 -6
- package/dist/utils/platform.d.ts +13 -11
- package/dist/utils/sanitize.d.ts +4 -4
- package/dist/utils/timer.d.ts +1 -1
- package/dist/utils/tracing.d.ts +38 -38
- package/dist/utils/unref.d.ts +3 -3
- package/dist/{web-socket-BWUoqBh8.cjs → web-socket-BTuvYoJI.cjs} +2 -2
- package/dist/web-socket-BTuvYoJI.cjs.map +1 -0
- package/dist/{web-socket-CV7yIMnm.js → web-socket-DthJuSAg.js} +4 -4
- package/dist/web-socket-DthJuSAg.js.map +1 -0
- package/dist/web-vitals-Ch5BpDmo.cjs +2 -0
- package/dist/web-vitals-Ch5BpDmo.cjs.map +1 -0
- package/dist/web-vitals-CsGCWnUr.js +77 -0
- package/dist/web-vitals-CsGCWnUr.js.map +1 -0
- package/dist/{worker-protocol-CrsdSDLn.js → worker-protocol-B0_8rWy5.js} +4 -4
- package/dist/worker-protocol-B0_8rWy5.js.map +1 -0
- package/dist/{worker-protocol-Bai7GAIA.cjs → worker-protocol-BjzFORfq.cjs} +2 -2
- package/dist/worker-protocol-BjzFORfq.cjs.map +1 -0
- package/dist/worker-server-4en-Lt-3.cjs +2 -0
- package/dist/worker-server-4en-Lt-3.cjs.map +1 -0
- package/dist/{worker-server-Dp5HYm4b.js → worker-server-Cne9MX9I.js} +8 -8
- package/dist/{worker-server-Dp5HYm4b.js.map → worker-server-Cne9MX9I.js.map} +1 -1
- package/dist/worker-transport-B-GF4Aqn.cjs +2 -0
- package/dist/worker-transport-B-GF4Aqn.cjs.map +1 -0
- package/dist/{worker-transport-D6jtgpqN.js → worker-transport-C3SjJAEC.js} +62 -61
- package/dist/worker-transport-C3SjJAEC.js.map +1 -0
- package/package.json +8 -2
- package/dist/batch-C8OcWR2L.cjs.map +0 -1
- package/dist/batch-CL9uWYY3.js.map +0 -1
- package/dist/bus-BZ0GldpT.js.map +0 -1
- package/dist/bus-VWlmM5xs.cjs +0 -2
- package/dist/bus-VWlmM5xs.cjs.map +0 -1
- package/dist/console-BPZCuSLc.cjs.map +0 -1
- package/dist/console-BeCF7n59.js.map +0 -1
- package/dist/constants-DqKJH_MP.cjs +0 -2
- package/dist/constants-DqKJH_MP.cjs.map +0 -1
- package/dist/constants-zyrqveN4.js +0 -304
- package/dist/constants-zyrqveN4.js.map +0 -1
- package/dist/deadline-BOjOxNHj.js.map +0 -1
- package/dist/deadline-XSnm95pg.cjs +0 -2
- package/dist/deadline-XSnm95pg.cjs.map +0 -1
- package/dist/debug-bundle-BzJNpbF0.cjs +0 -2
- package/dist/debug-bundle-BzJNpbF0.cjs.map +0 -1
- package/dist/debug-bundle-C7UkHZ-q.js.map +0 -1
- package/dist/emergency-queue-CNTRui5t.cjs.map +0 -1
- package/dist/emergency-queue-Zy6lNafo.js.map +0 -1
- package/dist/errors-Dh7kef0i.js.map +0 -1
- package/dist/errors-tfEr48bS.cjs.map +0 -1
- package/dist/factory-BonqI3NL.js.map +0 -1
- package/dist/factory-CJXVYp0R.cjs.map +0 -1
- package/dist/identity-Cxgj6pZX.cjs.map +0 -1
- package/dist/identity-DT5VmvXy.js.map +0 -1
- package/dist/indexeddb-storage-BJVtiQKm.js.map +0 -1
- package/dist/indexeddb-storage-CIoW21Xd.cjs.map +0 -1
- package/dist/interactions-DTgKy_6K.js.map +0 -1
- package/dist/interactions-fEN6FbVo.cjs.map +0 -1
- package/dist/journey-CuJrHzEg.js.map +0 -1
- package/dist/journey-pffMVMfa.cjs +0 -2
- package/dist/journey-pffMVMfa.cjs.map +0 -1
- package/dist/library-console-C1m6g1BR.js.map +0 -1
- package/dist/library-console-D2GY9Or6.cjs.map +0 -1
- package/dist/library-request-1BX_UlaX.cjs.map +0 -1
- package/dist/library-request-BQBT9N9Q.js.map +0 -1
- package/dist/lifecycle-2EtUaRpo.cjs.map +0 -1
- package/dist/lifecycle-BaKx_-32.js.map +0 -1
- package/dist/log-record-CAoGBBf3.js.map +0 -1
- package/dist/log-record-i9zOTkpQ.cjs.map +0 -1
- package/dist/long-frames-BVg4i5SC.cjs +0 -2
- package/dist/long-frames-BVg4i5SC.cjs.map +0 -1
- package/dist/long-frames-Czk7IupC.js.map +0 -1
- package/dist/network-DBNwApoF.js.map +0 -1
- package/dist/network-xbbuvG_6.cjs.map +0 -1
- package/dist/otlp-BDvFrLnc.cjs +0 -2
- package/dist/otlp-BDvFrLnc.cjs.map +0 -1
- package/dist/otlp-BTJdIa6F.js.map +0 -1
- package/dist/platform-C2Ez5kDc.cjs.map +0 -1
- package/dist/platform-DkcuXwe-.js.map +0 -1
- package/dist/remote-rules-Cfb4K-Nl.js.map +0 -1
- package/dist/remote-rules-vzvk7aKf.cjs.map +0 -1
- package/dist/reports-Dk2YhKIh.cjs.map +0 -1
- package/dist/reports-TA-zInnq.js.map +0 -1
- package/dist/resource-timing-BLv3EA2A.js.map +0 -1
- package/dist/resource-timing-Cysw1S1f.cjs.map +0 -1
- package/dist/sampling-C4VV-1MS.js.map +0 -1
- package/dist/sampling-Ckh2yW9k.cjs.map +0 -1
- package/dist/sanitize-6ymPlVvP.js.map +0 -1
- package/dist/sanitize-BAWzkZt0.cjs.map +0 -1
- package/dist/select-ZF4by-lF.cjs.map +0 -1
- package/dist/select-xtQaenIi.js.map +0 -1
- package/dist/sender-CiMHC9YG.js.map +0 -1
- package/dist/sender-D5wBoXA8.cjs +0 -2
- package/dist/sender-D5wBoXA8.cjs.map +0 -1
- package/dist/storm-CYi9Swpx.cjs.map +0 -1
- package/dist/storm-VR024_QN.js.map +0 -1
- package/dist/unclean-exit-CwcUhFOn.js.map +0 -1
- package/dist/unclean-exit-DFUN57wY.cjs.map +0 -1
- package/dist/user-timing-C9kfRq3J.cjs +0 -2
- package/dist/user-timing-C9kfRq3J.cjs.map +0 -1
- package/dist/user-timing-_jZIhDKI.js.map +0 -1
- package/dist/web-socket-BWUoqBh8.cjs.map +0 -1
- package/dist/web-socket-CV7yIMnm.js.map +0 -1
- package/dist/web-vitals-Bq4WFHQo.js +0 -52
- package/dist/web-vitals-Bq4WFHQo.js.map +0 -1
- package/dist/web-vitals-DFuoTQbZ.cjs +0 -2
- package/dist/web-vitals-DFuoTQbZ.cjs.map +0 -1
- package/dist/worker-protocol-Bai7GAIA.cjs.map +0 -1
- package/dist/worker-protocol-CrsdSDLn.js.map +0 -1
- package/dist/worker-server-BrIYkfoa.cjs +0 -2
- package/dist/worker-server-BrIYkfoa.cjs.map +0 -1
- package/dist/worker-transport-Bwej4N2e.cjs +0 -2
- package/dist/worker-transport-Bwej4N2e.cjs.map +0 -1
- package/dist/worker-transport-D6jtgpqN.js.map +0 -1
package/dist/core/meter.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
*
|
|
8
|
+
* Creates a counter handle. Never throws into the app.
|
|
7
9
|
* @param name Metric name.
|
|
8
|
-
* @param options Unit
|
|
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
|
-
*
|
|
17
|
+
* Creates a histogram handle. Never throws into the app.
|
|
15
18
|
* @param name Metric name.
|
|
16
|
-
* @param options Unit
|
|
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
|
|
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
|
|
33
|
+
/** Timer for the current interval. Runs only while a value is waiting. */
|
|
30
34
|
private timer;
|
|
31
|
-
/** Time of the first value
|
|
35
|
+
/** Time of the interval's first value, in epoch milliseconds. */
|
|
32
36
|
private startedAt;
|
|
33
37
|
/**
|
|
34
|
-
* @param intervalMs
|
|
35
|
-
* @param emit Builds and sends the record
|
|
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
|
|
46
|
-
* @param def
|
|
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
|
|
52
|
+
* @param attributes The value's attribute set.
|
|
49
53
|
*/
|
|
50
54
|
record(def: InstrumentDef, value: number, attributes?: MetricAttributes): void;
|
|
51
|
-
/** Sends one point
|
|
55
|
+
/** Sends one point per series in the interval, then starts a new interval. */
|
|
52
56
|
collect(): void;
|
|
53
57
|
/**
|
|
54
|
-
* Finds the instrument
|
|
55
|
-
* @param def
|
|
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
|
|
61
|
-
* @param instrument
|
|
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
|
|
70
|
+
/** Starts the interval's timer on its first value. An idle meter has no timer. */
|
|
67
71
|
private arm;
|
|
68
72
|
}
|
package/dist/core/pipeline.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
28
|
+
/** Buffer instances for the logs, metrics and traces streams. */
|
|
29
29
|
private readonly streams;
|
|
30
|
-
/** In-flight batches
|
|
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
|
-
/**
|
|
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
|
|
38
|
+
/** Requests that haven't completed. Capped by delivery.maxConcurrentRequests. */
|
|
39
39
|
private inFlight;
|
|
40
|
-
/**
|
|
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
|
|
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
|
|
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
|
|
57
|
-
*
|
|
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
|
|
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
|
|
75
|
-
* @param clockOffset
|
|
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
|
|
86
|
-
* deduplicate them.
|
|
87
|
-
*
|
|
88
|
-
* @returns One batch
|
|
89
|
-
* A mixed batch
|
|
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
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* @returns Promise that resolves
|
|
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
|
|
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
|
|
117
|
-
* record
|
|
118
|
-
*
|
|
119
|
-
* log call
|
|
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
|
|
125
|
-
*
|
|
126
|
-
*
|
|
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.
|
|
132
|
-
* a fetch inside the log call
|
|
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
|
|
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.
|
|
145
|
-
*
|
|
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
|
-
*
|
|
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
|
|
158
|
-
*
|
|
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;
|
package/dist/core/record.d.ts
CHANGED
|
@@ -30,12 +30,12 @@ export interface RecordBuilderDeps {
|
|
|
30
30
|
identity: Identity;
|
|
31
31
|
/** Detected host platform metadata. */
|
|
32
32
|
platform: PlatformMetadata;
|
|
33
|
-
/** Slot
|
|
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
|
-
/**
|
|
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.
|
|
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
|
|
81
|
-
* The record limits
|
|
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
|
|
84
|
+
/** True for a counter or histogram point. Sampling keeps it. */
|
|
85
85
|
aggregated?: boolean;
|
|
86
|
-
/**
|
|
86
|
+
/** A span's trace IDs. Without them the builder reads the active trace. */
|
|
87
87
|
trace?: TraceContext;
|
|
88
|
-
/**
|
|
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
|
|
100
|
+
/** Clears the cached resource attributes, so the next build computes them again. */
|
|
101
101
|
invalidateResource(): void;
|
|
102
102
|
/**
|
|
103
|
-
* Checks
|
|
104
|
-
* The minimum level
|
|
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
|
|
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
|
|
114
|
-
* @param input
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
136
|
-
* @returns The record and the size of its attributes, or the reason
|
|
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
|
|
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
|
|
149
|
-
* an object adds nothing
|
|
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.
|
|
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
|
|
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
|
|
13
|
-
* @param slot
|
|
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
|
*/
|