@utk09/ui-observability 0.11.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +481 -0
- package/README.md +73 -669
- package/bin/uiobs.mjs +1 -1
- package/dist/{batch-CL9uWYY3.js → batch-CXmPmTse.js} +3 -3
- package/dist/batch-CXmPmTse.js.map +1 -0
- package/dist/{batch-C8OcWR2L.cjs → batch-mmPigCpi.cjs} +2 -2
- package/dist/batch-mmPigCpi.cjs.map +1 -0
- package/dist/bus/bus.d.cts +331 -0
- package/dist/bus/bus.d.ts +108 -57
- package/dist/bus/links.d.cts +132 -0
- package/dist/bus/links.d.ts +22 -7
- package/dist/bus/validation.d.cts +16 -0
- package/dist/bus/validation.d.ts +11 -2
- package/dist/bus-C39wspFV.js +775 -0
- package/dist/bus-C39wspFV.js.map +1 -0
- package/dist/bus-_EaOVPGq.cjs +2 -0
- package/dist/bus-_EaOVPGq.cjs.map +1 -0
- package/dist/capture/console.d.cts +37 -0
- package/dist/capture/console.d.ts +11 -11
- package/dist/capture/errors.d.cts +32 -0
- package/dist/capture/errors.d.ts +7 -7
- package/dist/capture/interactions.d.cts +48 -0
- package/dist/capture/interactions.d.ts +15 -15
- package/dist/capture/lifecycle.d.cts +20 -0
- package/dist/capture/lifecycle.d.ts +4 -4
- package/dist/capture/long-frames.d.cts +31 -0
- package/dist/capture/long-frames.d.ts +7 -7
- package/dist/capture/network.d.cts +57 -0
- package/dist/capture/network.d.ts +18 -18
- package/dist/capture/profiler-frames.d.cts +44 -0
- package/dist/capture/profiler-frames.d.ts +44 -0
- package/dist/capture/replay-buffer.d.cts +45 -0
- package/dist/capture/replay-buffer.d.ts +45 -0
- package/dist/capture/replay-upload.d.cts +79 -0
- package/dist/capture/replay-upload.d.ts +79 -0
- package/dist/capture/replay.d.cts +114 -0
- package/dist/capture/replay.d.ts +114 -0
- package/dist/capture/reports.d.cts +17 -0
- package/dist/capture/reports.d.ts +3 -3
- package/dist/capture/resource-timing.d.cts +14 -0
- package/dist/capture/resource-timing.d.ts +2 -2
- package/dist/capture/server-timing.d.cts +19 -0
- package/dist/capture/server-timing.d.ts +3 -3
- package/dist/capture/storm.d.cts +13 -0
- package/dist/capture/storm.d.ts +7 -7
- package/dist/capture/types.d.cts +128 -0
- package/dist/capture/types.d.ts +54 -41
- package/dist/capture/unclean-exit.d.cts +31 -0
- package/dist/capture/unclean-exit.d.ts +9 -9
- package/dist/capture/user-timing.d.cts +22 -0
- package/dist/capture/user-timing.d.ts +4 -4
- package/dist/capture/web-socket.d.cts +40 -0
- package/dist/capture/web-socket.d.ts +14 -14
- package/dist/capture/web-vitals.d.cts +40 -0
- package/dist/capture/web-vitals.d.ts +21 -8
- package/dist/compression-CvED_Jel.cjs +2 -0
- package/dist/compression-CvED_Jel.cjs.map +1 -0
- package/dist/compression-tVtXwVjX.js +11 -0
- package/dist/compression-tVtXwVjX.js.map +1 -0
- package/dist/config-DUs7uHHt.cjs +2 -0
- package/dist/config-DUs7uHHt.cjs.map +1 -0
- package/dist/config-SgQcCP1_.js +560 -0
- package/dist/config-SgQcCP1_.js.map +1 -0
- package/dist/console-BGgGnjSi.js +81 -0
- package/dist/console-BGgGnjSi.js.map +1 -0
- package/dist/console-CSZ5_Vx5.cjs +2 -0
- package/dist/console-CSZ5_Vx5.cjs.map +1 -0
- package/dist/constants-CUyd9cTZ.js +357 -0
- package/dist/constants-CUyd9cTZ.js.map +1 -0
- package/dist/constants-CqdJhTxH.cjs +2 -0
- package/dist/constants-CqdJhTxH.cjs.map +1 -0
- package/dist/constants.d.cts +751 -0
- package/dist/constants.d.ts +231 -116
- package/dist/core/breadcrumbs.d.cts +54 -0
- package/dist/core/breadcrumbs.d.ts +21 -15
- package/dist/core/config.d.cts +45 -0
- package/dist/core/config.d.ts +33 -5
- package/dist/core/context.d.cts +24 -0
- package/dist/core/context.d.ts +8 -13
- package/dist/core/debug-buffer.d.cts +34 -0
- package/dist/core/debug-buffer.d.ts +13 -13
- package/dist/core/debug-bundle.d.cts +12 -0
- package/dist/core/debug-bundle.d.ts +6 -6
- package/dist/core/deferred.d.cts +7 -0
- package/dist/core/deferred.d.ts +4 -4
- package/dist/core/diagnostics.d.cts +86 -0
- package/dist/core/diagnostics.d.ts +25 -22
- package/dist/core/drops.d.cts +39 -0
- package/dist/core/drops.d.ts +22 -12
- package/dist/core/hold-buffer.d.cts +36 -0
- package/dist/core/hold-buffer.d.ts +16 -7
- package/dist/core/journey.d.cts +148 -0
- package/dist/core/journey.d.ts +28 -29
- package/dist/core/logger.d.cts +141 -0
- package/dist/core/logger.d.ts +45 -51
- package/dist/core/measure.d.cts +30 -0
- package/dist/core/measure.d.ts +21 -10
- package/dist/core/meter.d.cts +78 -0
- package/dist/core/meter.d.ts +38 -28
- package/dist/core/pipeline.d.cts +227 -0
- package/dist/core/pipeline.d.ts +114 -50
- package/dist/core/profile-buckets.d.cts +31 -0
- package/dist/core/profile-buckets.d.ts +31 -0
- package/dist/core/profiler.d.cts +218 -0
- package/dist/core/profiler.d.ts +218 -0
- package/dist/core/record.d.cts +190 -0
- package/dist/core/record.d.ts +67 -35
- package/dist/core/remote-rules.d.cts +17 -0
- package/dist/core/remote-rules.d.ts +7 -7
- package/dist/core/remote-sampling.d.cts +74 -0
- package/dist/core/remote-sampling.d.ts +24 -23
- package/dist/core/rotation.d.cts +75 -0
- package/dist/core/rotation.d.ts +75 -0
- package/dist/core/runtime.d.cts +765 -0
- package/dist/core/runtime.d.ts +430 -186
- package/dist/core/sampling.d.cts +86 -0
- package/dist/core/sampling.d.ts +22 -22
- package/dist/core/sender.d.cts +161 -0
- package/dist/core/sender.d.ts +80 -34
- package/dist/core/spans.d.cts +39 -0
- package/dist/core/spans.d.ts +6 -6
- 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-BXIlwDKM.cjs +2 -0
- package/dist/debug-bundle-BXIlwDKM.cjs.map +1 -0
- package/dist/debug-bundle-CRpYV_ui.js +35 -0
- package/dist/debug-bundle-CRpYV_ui.js.map +1 -0
- package/dist/defineProperty-X1c4tIPD.cjs +1 -0
- package/dist/defineProperty-s2S8BXUc.js +35 -0
- package/dist/doctor.cjs +1 -1
- package/dist/doctor.cjs.map +1 -1
- package/dist/doctor.d.cts +36 -0
- package/dist/doctor.d.ts +19 -6
- package/dist/doctor.js +180 -53
- package/dist/doctor.js.map +1 -1
- package/dist/error-like-B11pB4aL.js.map +1 -1
- package/dist/error-like-gGRx2s36.cjs.map +1 -1
- package/dist/errors-BE_EZV7Q.js +86 -0
- package/dist/errors-BE_EZV7Q.js.map +1 -0
- package/dist/errors-CNPbesMs.cjs +3 -0
- package/dist/errors-CNPbesMs.cjs.map +1 -0
- package/dist/factory-CTi0Is3F.js +404 -0
- package/dist/factory-CTi0Is3F.js.map +1 -0
- package/dist/factory-hRrH32v5.cjs +2 -0
- package/dist/factory-hRrH32v5.cjs.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-BlYGRK4l.js +10 -0
- package/dist/guards-BlYGRK4l.js.map +1 -0
- package/dist/guards-EjG3ahFp.cjs +2 -0
- package/dist/guards-EjG3ahFp.cjs.map +1 -0
- package/dist/{identity-DT5VmvXy.js → identity-DdhKgrpk.js} +11 -15
- package/dist/identity-DdhKgrpk.js.map +1 -0
- package/dist/identity-DlWRIuwy.cjs +2 -0
- package/dist/identity-DlWRIuwy.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +300 -0
- package/dist/index.d.ts +165 -141
- package/dist/index.js +1283 -1468
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-storage-CL9uqBCy.cjs +2 -0
- package/dist/indexeddb-storage-CL9uqBCy.cjs.map +1 -0
- package/dist/{indexeddb-storage-BJVtiQKm.js → indexeddb-storage-GHdl0t8A.js} +51 -47
- package/dist/indexeddb-storage-GHdl0t8A.js.map +1 -0
- package/dist/interactions-CUkzK8sR.cjs +2 -0
- package/dist/interactions-CUkzK8sR.cjs.map +1 -0
- package/dist/{interactions-DTgKy_6K.js → interactions-DiFvCosX.js} +41 -49
- package/dist/interactions-DiFvCosX.js.map +1 -0
- package/dist/journey-B4Adltjm.cjs +2 -0
- package/dist/journey-B4Adltjm.cjs.map +1 -0
- package/dist/{journey-CuJrHzEg.js → journey-D2_sia57.js} +51 -53
- package/dist/journey-D2_sia57.js.map +1 -0
- package/dist/{library-console-C1m6g1BR.js → library-console-Btrzt814.js} +2 -2
- package/dist/library-console-Btrzt814.js.map +1 -0
- package/dist/{library-console-D2GY9Or6.cjs → library-console-CPW6bvZH.cjs} +2 -2
- package/dist/library-console-CPW6bvZH.cjs.map +1 -0
- package/dist/{library-request-BQBT9N9Q.js → library-request-BJ9PLRaD.js} +2 -2
- package/dist/library-request-BJ9PLRaD.js.map +1 -0
- package/dist/{library-request-1BX_UlaX.cjs → library-request-D7OvTxZV.cjs} +2 -2
- package/dist/library-request-D7OvTxZV.cjs.map +1 -0
- package/dist/{lifecycle-BaKx_-32.js → lifecycle-22CUCrc9.js} +21 -29
- package/dist/lifecycle-22CUCrc9.js.map +1 -0
- package/dist/lifecycle-IaAm1mOC.cjs +2 -0
- package/dist/lifecycle-IaAm1mOC.cjs.map +1 -0
- package/dist/{log-record-CAoGBBf3.js → log-record-BNiLfqtL.js} +8 -7
- package/dist/log-record-BNiLfqtL.js.map +1 -0
- package/dist/log-record-CkivuiEl.cjs +2 -0
- package/dist/log-record-CkivuiEl.cjs.map +1 -0
- package/dist/long-frames-BUUbXd-B.cjs +2 -0
- package/dist/long-frames-BUUbXd-B.cjs.map +1 -0
- package/dist/long-frames-DNFaRnC3.js +62 -0
- package/dist/long-frames-DNFaRnC3.js.map +1 -0
- package/dist/models/batch.d.cts +57 -0
- package/dist/models/batch.d.ts +16 -17
- package/dist/models/bus.d.cts +158 -0
- package/dist/models/bus.d.ts +46 -26
- package/dist/models/config.d.cts +1540 -0
- package/dist/models/config.d.ts +692 -405
- package/dist/models/drop.d.cts +54 -0
- package/dist/models/drop.d.ts +29 -14
- package/dist/models/health.d.cts +148 -0
- package/dist/models/health.d.ts +119 -23
- package/dist/models/log-record.d.cts +61 -0
- package/dist/models/log-record.d.ts +13 -14
- package/dist/models/metric.d.cts +139 -0
- package/dist/models/metric.d.ts +94 -18
- package/dist/models/plugin.d.cts +47 -0
- package/dist/models/plugin.d.ts +16 -16
- package/dist/models/replay.d.cts +60 -0
- package/dist/models/replay.d.ts +60 -0
- package/dist/models/serializer.d.cts +23 -0
- package/dist/models/serializer.d.ts +3 -4
- package/dist/models/storage.d.cts +95 -0
- package/dist/models/storage.d.ts +17 -14
- package/dist/network-CGMLQ-mA.cjs +2 -0
- package/dist/network-CGMLQ-mA.cjs.map +1 -0
- package/dist/{network-DBNwApoF.js → network-on2zZT6H.js} +57 -57
- package/dist/network-on2zZT6H.js.map +1 -0
- package/dist/openfin-Bxelt0yg.js.map +1 -1
- package/dist/openfin-DtH2f7zX.cjs.map +1 -1
- package/dist/otlp-BENHf3g9.cjs +2 -0
- package/dist/otlp-BENHf3g9.cjs.map +1 -0
- package/dist/{otlp-BTJdIa6F.js → otlp-DimfrRor.js} +22 -29
- package/dist/otlp-DimfrRor.js.map +1 -0
- package/dist/patch-BX8KrPCT.cjs.map +1 -1
- package/dist/patch-UdPz1ea8.js.map +1 -1
- package/dist/{platform-DkcuXwe-.js → platform-BaaFIPCU.js} +8 -8
- package/dist/platform-BaaFIPCU.js.map +1 -0
- package/dist/{platform-C2Ez5kDc.cjs → platform-CfA3-7sJ.cjs} +2 -2
- package/dist/platform-CfA3-7sJ.cjs.map +1 -0
- package/dist/profiler-BAZoh7A4.js +292 -0
- package/dist/profiler-BAZoh7A4.js.map +1 -0
- package/dist/profiler-D4tJpDRc.cjs +2 -0
- package/dist/profiler-D4tJpDRc.cjs.map +1 -0
- package/dist/profiler-frames-C4xr7KfH.cjs +2 -0
- package/dist/profiler-frames-C4xr7KfH.cjs.map +1 -0
- package/dist/profiler-frames-cJMx9wNM.js +78 -0
- package/dist/profiler-frames-cJMx9wNM.js.map +1 -0
- package/dist/remote-rules-Dz9MRAsB.js +95 -0
- package/dist/remote-rules-Dz9MRAsB.js.map +1 -0
- package/dist/remote-rules-_tY0zj5o.cjs +2 -0
- package/dist/remote-rules-_tY0zj5o.cjs.map +1 -0
- package/dist/replay-B3gFXIZd.cjs +2 -0
- package/dist/replay-B3gFXIZd.cjs.map +1 -0
- package/dist/replay-Ds-ANH34.js +310 -0
- package/dist/replay-Ds-ANH34.js.map +1 -0
- package/dist/reports-BDSe4dFH.cjs +2 -0
- package/dist/reports-BDSe4dFH.cjs.map +1 -0
- package/dist/{reports-TA-zInnq.js → reports-C-thq-bk.js} +25 -30
- package/dist/reports-C-thq-bk.js.map +1 -0
- package/dist/resource-timing-C576gFIQ.cjs +2 -0
- package/dist/resource-timing-C576gFIQ.cjs.map +1 -0
- package/dist/{resource-timing-BLv3EA2A.js → resource-timing-eUl2dNgC.js} +20 -23
- package/dist/resource-timing-eUl2dNgC.js.map +1 -0
- package/dist/response-body-YdNl-HkR.cjs +3 -0
- package/dist/response-body-YdNl-HkR.cjs.map +1 -0
- package/dist/response-body-eoSQpLiH.js +331 -0
- package/dist/response-body-eoSQpLiH.js.map +1 -0
- package/dist/rotation-Cwct4ckk.js +94 -0
- package/dist/rotation-Cwct4ckk.js.map +1 -0
- package/dist/rotation-D4qUAHAu.cjs +2 -0
- package/dist/rotation-D4qUAHAu.cjs.map +1 -0
- package/dist/sampling-BlrI8jor.js +63 -0
- package/dist/sampling-BlrI8jor.js.map +1 -0
- package/dist/sampling-mXt4dstx.cjs +2 -0
- package/dist/sampling-mXt4dstx.cjs.map +1 -0
- package/dist/{sanitize-6ymPlVvP.js → sanitize-Ba0KqU06.js} +2 -2
- package/dist/sanitize-Ba0KqU06.js.map +1 -0
- package/dist/{sanitize-BAWzkZt0.cjs → sanitize-DQyiI_KY.cjs} +2 -2
- package/dist/sanitize-DQyiI_KY.cjs.map +1 -0
- package/dist/sender-BdRuNVhF.cjs +2 -0
- package/dist/sender-BdRuNVhF.cjs.map +1 -0
- package/dist/sender-Dv8rAmpV.js +979 -0
- package/dist/sender-Dv8rAmpV.js.map +1 -0
- package/dist/storage/context-storage.d.cts +90 -0
- package/dist/storage/context-storage.d.ts +38 -37
- package/dist/storage/emergency-queue.d.cts +27 -0
- package/dist/storage/emergency-queue.d.ts +13 -13
- package/dist/storage/eviction.d.cts +40 -0
- package/dist/storage/eviction.d.ts +13 -13
- package/dist/storage/factory.d.cts +21 -0
- package/dist/storage/factory.d.ts +11 -10
- package/dist/storage/gap.d.cts +20 -0
- package/dist/storage/gap.d.ts +9 -9
- package/dist/storage/idb-driver.d.cts +93 -0
- package/dist/storage/idb-driver.d.ts +32 -33
- package/dist/storage/indexeddb-storage.d.cts +97 -0
- package/dist/storage/indexeddb-storage.d.ts +38 -31
- package/dist/storage/keys.d.cts +17 -0
- package/dist/storage/keys.d.ts +9 -9
- package/dist/storage/local-storage.d.cts +139 -0
- package/dist/storage/local-storage.d.ts +49 -42
- package/dist/storage/memory-storage.d.cts +73 -0
- package/dist/storage/memory-storage.d.ts +25 -25
- package/dist/storage/persistence.d.cts +8 -0
- package/dist/storage/persistence.d.ts +3 -3
- package/dist/storage/stored-context.d.cts +34 -0
- package/dist/storage/stored-context.d.ts +34 -0
- package/dist/stored-context-B2EzVuYm.js +51 -0
- package/dist/stored-context-B2EzVuYm.js.map +1 -0
- package/dist/stored-context-CXt7eHZL.cjs +2 -0
- package/dist/stored-context-CXt7eHZL.cjs.map +1 -0
- package/dist/storm-C-zYSdDX.cjs +2 -0
- package/dist/storm-C-zYSdDX.cjs.map +1 -0
- package/dist/storm-DjKetLKZ.js +9 -0
- package/dist/storm-DjKetLKZ.js.map +1 -0
- package/dist/transport/compression.d.cts +7 -0
- package/dist/transport/compression.d.ts +2 -2
- package/dist/transport/custom-transport.d.cts +22 -0
- package/dist/transport/custom-transport.d.ts +6 -5
- package/dist/transport/errors.d.cts +31 -0
- package/dist/transport/errors.d.ts +7 -7
- package/dist/transport/exit-flush.d.cts +135 -0
- package/dist/transport/exit-flush.d.ts +62 -45
- package/dist/transport/headers.d.cts +8 -0
- package/dist/transport/headers.d.ts +4 -4
- package/dist/transport/http-transport.d.cts +116 -0
- package/dist/transport/http-transport.d.ts +48 -35
- package/dist/transport/memory-transport.d.cts +30 -0
- package/dist/transport/memory-transport.d.ts +8 -8
- package/dist/transport/response-body.d.cts +49 -0
- package/dist/transport/response-body.d.ts +49 -0
- package/dist/transport/retry-engine.d.cts +129 -0
- package/dist/transport/retry-engine.d.ts +62 -43
- package/dist/transport/serializers/ecs.d.cts +3 -0
- package/dist/transport/serializers/ecs.d.ts +2 -2
- package/dist/transport/serializers/otlp-metrics.d.cts +3 -0
- package/dist/transport/serializers/otlp-metrics.d.ts +2 -2
- package/dist/transport/serializers/otlp-traces.d.cts +3 -0
- package/dist/transport/serializers/otlp-traces.d.ts +2 -2
- package/dist/transport/serializers/otlp.d.cts +47 -0
- package/dist/transport/serializers/otlp.d.ts +18 -18
- package/dist/transport/serializers/select.d.cts +38 -0
- package/dist/transport/serializers/select.d.ts +11 -11
- package/dist/transport/status-transport.d.cts +129 -0
- package/dist/transport/status-transport.d.ts +45 -28
- package/dist/transport/worker-client.d.cts +23 -0
- package/dist/transport/worker-client.d.ts +12 -3
- package/dist/transport/worker-entry.d.cts +5 -0
- package/dist/transport/worker-entry.d.ts +1 -1
- package/dist/transport/worker-protocol.d.cts +38 -0
- package/dist/transport/worker-protocol.d.ts +7 -5
- package/dist/transport/worker-server.d.cts +3 -0
- package/dist/transport/worker-server.d.ts +1 -1
- package/dist/transport/worker-transport.d.cts +10 -0
- package/dist/transport/worker-transport.d.ts +5 -4
- package/dist/types-BAerHgCq.js.map +1 -1
- package/dist/types-C7WNpnG1.cjs.map +1 -1
- package/dist/{unclean-exit-CwcUhFOn.js → unclean-exit-DQD1cT7c.js} +23 -30
- package/dist/unclean-exit-DQD1cT7c.js.map +1 -0
- package/dist/unclean-exit-py99ApzT.cjs +2 -0
- package/dist/unclean-exit-py99ApzT.cjs.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-_jZIhDKI.js → user-timing-BePqb1uN.js} +18 -18
- package/dist/user-timing-BePqb1uN.js.map +1 -0
- package/dist/user-timing-D6XTmpuM.cjs +2 -0
- package/dist/user-timing-D6XTmpuM.cjs.map +1 -0
- package/dist/utils/console.d.cts +36 -0
- package/dist/utils/console.d.ts +6 -6
- package/dist/utils/deadline.d.cts +14 -0
- package/dist/utils/deadline.d.ts +4 -4
- package/dist/utils/error-like.d.cts +25 -0
- package/dist/utils/error-like.d.ts +7 -7
- package/dist/utils/fixed-window.d.cts +25 -0
- package/dist/utils/fixed-window.d.ts +9 -8
- package/dist/utils/global-scope.d.cts +20 -0
- package/dist/utils/global-scope.d.ts +8 -8
- package/dist/utils/guards.d.cts +14 -0
- package/dist/utils/guards.d.ts +10 -2
- package/dist/utils/identity.d.cts +109 -0
- package/dist/utils/identity.d.ts +20 -21
- package/dist/utils/library-console.d.cts +11 -0
- package/dist/utils/library-console.d.ts +4 -4
- package/dist/utils/library-request.d.cts +24 -0
- package/dist/utils/library-request.d.ts +10 -10
- package/dist/utils/lock.d.cts +24 -0
- package/dist/utils/lock.d.ts +11 -10
- package/dist/utils/openfin.d.cts +48 -0
- package/dist/utils/openfin.d.ts +5 -5
- package/dist/utils/patch.d.cts +9 -0
- package/dist/utils/patch.d.ts +6 -6
- package/dist/utils/platform.d.cts +62 -0
- package/dist/utils/platform.d.ts +15 -13
- package/dist/utils/sanitize.d.cts +52 -0
- package/dist/utils/sanitize.d.ts +5 -5
- package/dist/utils/sequence.d.cts +10 -0
- package/dist/utils/tracing.d.cts +158 -0
- package/dist/utils/tracing.d.ts +49 -42
- package/dist/utils/unref.d.cts +9 -0
- package/dist/utils/unref.d.ts +3 -3
- package/dist/web-socket-CoIUBM3C.cjs +2 -0
- package/dist/web-socket-CoIUBM3C.cjs.map +1 -0
- package/dist/{web-socket-CV7yIMnm.js → web-socket-DSHgDiZ6.js} +23 -28
- package/dist/web-socket-DSHgDiZ6.js.map +1 -0
- package/dist/web-vitals-4pWACwaR.js +71 -0
- package/dist/web-vitals-4pWACwaR.js.map +1 -0
- package/dist/web-vitals-__X7t4pj.cjs +2 -0
- package/dist/web-vitals-__X7t4pj.cjs.map +1 -0
- package/dist/worker-protocol-QbvqNazn.cjs +2 -0
- package/dist/worker-protocol-QbvqNazn.cjs.map +1 -0
- package/dist/{worker-protocol-CrsdSDLn.js → worker-protocol-x074Rpet.js} +14 -11
- package/dist/worker-protocol-x074Rpet.js.map +1 -0
- package/dist/worker-server-CFe4nvos.cjs +2 -0
- package/dist/worker-server-CFe4nvos.cjs.map +1 -0
- package/dist/worker-server-iUVSjH8L.js +94 -0
- package/dist/worker-server-iUVSjH8L.js.map +1 -0
- package/dist/worker-transport-CRAX-09c.cjs +2 -0
- package/dist/worker-transport-CRAX-09c.cjs.map +1 -0
- package/dist/worker-transport-Dy1KMA7t.js +190 -0
- package/dist/worker-transport-Dy1KMA7t.js.map +1 -0
- package/llms.txt +397 -0
- package/package.json +55 -41
- package/dist/batch-C8OcWR2L.cjs.map +0 -1
- package/dist/batch-CL9uWYY3.js.map +0 -1
- package/dist/bus-BZ0GldpT.js +0 -660
- 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 +0 -2
- package/dist/console-BPZCuSLc.cjs.map +0 -1
- package/dist/console-BeCF7n59.js +0 -82
- 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/context-storage-BjzeBSxH.cjs +0 -2
- package/dist/context-storage-BjzeBSxH.cjs.map +0 -1
- package/dist/context-storage-BzkoHzkQ.js +0 -51
- package/dist/context-storage-BzkoHzkQ.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 +0 -25
- package/dist/debug-bundle-C7UkHZ-q.js.map +0 -1
- package/dist/emergency-queue-CNTRui5t.cjs +0 -2
- package/dist/emergency-queue-CNTRui5t.cjs.map +0 -1
- package/dist/emergency-queue-Zy6lNafo.js +0 -67
- package/dist/emergency-queue-Zy6lNafo.js.map +0 -1
- package/dist/errors-Dh7kef0i.js +0 -92
- package/dist/errors-Dh7kef0i.js.map +0 -1
- package/dist/errors-tfEr48bS.cjs +0 -3
- package/dist/errors-tfEr48bS.cjs.map +0 -1
- package/dist/factory-BonqI3NL.js +0 -276
- package/dist/factory-BonqI3NL.js.map +0 -1
- package/dist/factory-CJXVYp0R.cjs +0 -2
- package/dist/factory-CJXVYp0R.cjs.map +0 -1
- package/dist/guards-Cidk71ME.js +0 -7
- package/dist/guards-Cidk71ME.js.map +0 -1
- package/dist/guards-nJ70syPt.cjs +0 -2
- package/dist/guards-nJ70syPt.cjs.map +0 -1
- package/dist/identity-Cxgj6pZX.cjs +0 -2
- 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 +0 -2
- package/dist/indexeddb-storage-CIoW21Xd.cjs.map +0 -1
- package/dist/interactions-DTgKy_6K.js.map +0 -1
- package/dist/interactions-fEN6FbVo.cjs +0 -2
- 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/keys-BHhw_0Wh.cjs +0 -2
- package/dist/keys-BHhw_0Wh.cjs.map +0 -1
- package/dist/keys-BU9j5YqW.js +0 -16
- package/dist/keys-BU9j5YqW.js.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 +0 -2
- 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 +0 -2
- 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 +0 -64
- package/dist/long-frames-Czk7IupC.js.map +0 -1
- package/dist/models/stats.d.ts +0 -11
- package/dist/network-DBNwApoF.js.map +0 -1
- package/dist/network-xbbuvG_6.cjs +0 -2
- 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 +0 -98
- package/dist/remote-rules-Cfb4K-Nl.js.map +0 -1
- package/dist/remote-rules-vzvk7aKf.cjs +0 -2
- package/dist/remote-rules-vzvk7aKf.cjs.map +0 -1
- package/dist/reports-Dk2YhKIh.cjs +0 -2
- 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 +0 -2
- package/dist/resource-timing-Cysw1S1f.cjs.map +0 -1
- package/dist/sampling-C4VV-1MS.js +0 -60
- package/dist/sampling-C4VV-1MS.js.map +0 -1
- package/dist/sampling-Ckh2yW9k.cjs +0 -2
- 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 +0 -3
- package/dist/select-ZF4by-lF.cjs.map +0 -1
- package/dist/select-xtQaenIi.js +0 -270
- package/dist/select-xtQaenIi.js.map +0 -1
- package/dist/sender-CiMHC9YG.js +0 -856
- 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/storage-BA9RqRO-.cjs +0 -2
- package/dist/storage-BA9RqRO-.cjs.map +0 -1
- package/dist/storage-DZwed89z.js +0 -16
- package/dist/storage-DZwed89z.js.map +0 -1
- package/dist/storm-CYi9Swpx.cjs +0 -2
- package/dist/storm-CYi9Swpx.cjs.map +0 -1
- package/dist/storm-VR024_QN.js +0 -9
- package/dist/storm-VR024_QN.js.map +0 -1
- package/dist/unclean-exit-CwcUhFOn.js.map +0 -1
- package/dist/unclean-exit-DFUN57wY.cjs +0 -2
- 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/utils/timer.d.ts +0 -19
- package/dist/web-socket-BWUoqBh8.cjs +0 -2
- 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 +0 -2
- 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-server-Dp5HYm4b.js +0 -83
- package/dist/worker-server-Dp5HYm4b.js.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 +0 -199
- package/dist/worker-transport-D6jtgpqN.js.map +0 -1
package/dist/core/pipeline.d.ts
CHANGED
|
@@ -1,21 +1,37 @@
|
|
|
1
|
-
import type { ResolvedConfig } from "../models/config";
|
|
2
|
-
import type { LossReporter } from "../models/drop";
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
5
|
-
import type
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
1
|
+
import type { ResolvedConfig } from "../models/config.js";
|
|
2
|
+
import type { LossReporter } from "../models/drop.js";
|
|
3
|
+
import type { FlushResult } from "../models/health.js";
|
|
4
|
+
import type { LogBatch } from "../models/batch.js";
|
|
5
|
+
import { type LogRecord } from "../models/log-record.js";
|
|
6
|
+
import type { StorageAdapter } from "../models/storage.js";
|
|
7
|
+
import type { BatchTransport } from "../transport/status-transport.js";
|
|
8
|
+
import type { RetryEngine } from "../transport/retry-engine.js";
|
|
9
|
+
import type { Diagnostics } from "./diagnostics.js";
|
|
9
10
|
/** Name of a pipeline stream. */
|
|
10
11
|
export type StreamName = "logs" | "metrics" | "traces";
|
|
12
|
+
/** What a flush counts in its snapshot of the pipeline. */
|
|
13
|
+
export type FlushCounts = Pick<FlushResult, "accepted" | "stored" | "dropped" | "pending">;
|
|
14
|
+
/** What a dispatch did with a batch's records. */
|
|
15
|
+
type BatchEnd = Omit<FlushCounts, "pending">;
|
|
11
16
|
/** Batching policy for one record stream. */
|
|
12
17
|
export interface StreamOptions {
|
|
13
|
-
/** Maximum time in milliseconds
|
|
18
|
+
/** Maximum time in milliseconds a partial batch waits before the pipeline sends it. */
|
|
14
19
|
flushIntervalMs: number;
|
|
15
|
-
/** Maximum records in a batch. At this count
|
|
20
|
+
/** Maximum records in a batch. At this count the pipeline sends the batch early. */
|
|
16
21
|
batchSize: number;
|
|
17
22
|
}
|
|
18
|
-
/**
|
|
23
|
+
/** A closed batch in the queue or in flight. */
|
|
24
|
+
interface Pending {
|
|
25
|
+
/** Batch to deliver. */
|
|
26
|
+
batch: LogBatch;
|
|
27
|
+
/** Resolves when the batch's dispatch ends, or on destroy. */
|
|
28
|
+
done: Promise<void>;
|
|
29
|
+
/** Resolves `done`. */
|
|
30
|
+
resolve: () => void;
|
|
31
|
+
/** What the dispatch did with the records. Unset while they have no final state. */
|
|
32
|
+
end?: BatchEnd;
|
|
33
|
+
}
|
|
34
|
+
/** Buffers the log, metric and trace streams, builds batches and sends them over HTTP. */
|
|
19
35
|
export declare class LogPipeline {
|
|
20
36
|
private readonly transport;
|
|
21
37
|
private readonly storage;
|
|
@@ -25,27 +41,34 @@ export declare class LogPipeline {
|
|
|
25
41
|
private readonly policy?;
|
|
26
42
|
private readonly onLoss;
|
|
27
43
|
private readonly clockOffset;
|
|
28
|
-
/** Buffer instances for logs and
|
|
44
|
+
/** Buffer instances for the logs, metrics and traces streams. */
|
|
29
45
|
private readonly streams;
|
|
30
|
-
/** In-flight batches
|
|
46
|
+
/** In-flight batches with no delivery confirmation yet. The exit flush sends them again. */
|
|
31
47
|
private readonly unconfirmed;
|
|
32
48
|
/** Closed batches waiting for a free dispatch slot. */
|
|
33
49
|
private readonly queue;
|
|
34
|
-
/**
|
|
50
|
+
/** Every batch in the queue or in flight. flushPending waits on them, destroy() resolves them. */
|
|
35
51
|
private readonly open;
|
|
36
52
|
/** Ceiling on the ERROR and FATAL records that bypass sampling. */
|
|
37
53
|
private readonly ceiling;
|
|
38
|
-
/** Requests that
|
|
54
|
+
/** Requests that haven't completed. Capped by delivery.maxConcurrentRequests. */
|
|
39
55
|
private inFlight;
|
|
40
|
-
/**
|
|
56
|
+
/** True while a pump is queued, so one microtask drains a whole burst. */
|
|
41
57
|
private pumpScheduled;
|
|
42
58
|
/** True after destroy() stops the pipeline. */
|
|
43
59
|
private stopped;
|
|
44
|
-
/**
|
|
60
|
+
/** True while `enabled` is false. The records stay in the buffers and in the queue. */
|
|
61
|
+
private paused;
|
|
62
|
+
/**
|
|
63
|
+
* Ends the wait of each flushPending() call in progress. hold(true) calls them, so a flush
|
|
64
|
+
* that waits on a queued batch doesn't wait out the pause.
|
|
65
|
+
*/
|
|
66
|
+
private readonly waiters;
|
|
67
|
+
/** Encoded byte count of every record in the buffers or in requests. */
|
|
45
68
|
private readonly held;
|
|
46
69
|
/** Total encoded bytes of the held records. */
|
|
47
70
|
private heldBytes;
|
|
48
|
-
/** True while the overflow storage operation
|
|
71
|
+
/** True while the overflow storage operation is still running. */
|
|
49
72
|
private persisting;
|
|
50
73
|
/**
|
|
51
74
|
* Removes completed or dropped records from the buffer counts.
|
|
@@ -53,8 +76,9 @@ export declare class LogPipeline {
|
|
|
53
76
|
*/
|
|
54
77
|
private release;
|
|
55
78
|
/**
|
|
56
|
-
* Removes records that
|
|
57
|
-
*
|
|
79
|
+
* Removes records that haven't reached the transport. A request that was already sent can't
|
|
80
|
+
* be removed.
|
|
81
|
+
* @returns True if a batch or a buffered group was removed.
|
|
58
82
|
*/
|
|
59
83
|
private evict;
|
|
60
84
|
/**
|
|
@@ -69,10 +93,10 @@ export declare class LogPipeline {
|
|
|
69
93
|
* @param retry Retry engine for redelivering persisted batches.
|
|
70
94
|
* @param diagnostics Diagnostics reporter.
|
|
71
95
|
* @param streamOptions Batching policy per stream, from the batching config.
|
|
72
|
-
* @param routingContextId
|
|
96
|
+
* @param routingContextId Returns the delivery context id for a new batch.
|
|
73
97
|
* @param policy Active configuration instance.
|
|
74
|
-
* @param onLoss Receives the records
|
|
75
|
-
* @param clockOffset
|
|
98
|
+
* @param onLoss Receives the records the pipeline loses.
|
|
99
|
+
* @param clockOffset Returns the clock offset for a new log or span record, if known.
|
|
76
100
|
*/
|
|
77
101
|
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
102
|
/**
|
|
@@ -82,28 +106,60 @@ export declare class LogPipeline {
|
|
|
82
106
|
push(record: LogRecord): void;
|
|
83
107
|
/**
|
|
84
108
|
* 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
|
|
109
|
+
* Records already handed to fetch go out again under a new batch ID, and the server can't
|
|
110
|
+
* deduplicate them. So the exit flush can deliver duplicates. That is intentional: a
|
|
111
|
+
* closing document can't confirm delivery.
|
|
112
|
+
* @returns One batch per stream, metrics first. A stream with no records gets no batch.
|
|
113
|
+
* A mixed batch would send a metric to the logs endpoint.
|
|
90
114
|
*/
|
|
91
115
|
drainForExit(): LogBatch[];
|
|
92
116
|
/**
|
|
93
|
-
* Sends the buffered records through the normal dispatch path
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* @
|
|
117
|
+
* Sends the buffered records through the normal dispatch path, then waits for every batch
|
|
118
|
+
* in the queue and in flight. The throttle check and the concurrency limit apply. A direct
|
|
119
|
+
* send would bypass both.
|
|
120
|
+
* @param expired Resolves at the caller's deadline, if it has one.
|
|
121
|
+
* @returns Promise that resolves to the batches the wait covered, once each one is sent or
|
|
122
|
+
* stored, or on a hold, a destroy or the deadline.
|
|
97
123
|
*/
|
|
98
|
-
flushPending(): Promise<
|
|
124
|
+
flushPending(expired?: Promise<void>): Promise<Pending[]>;
|
|
99
125
|
/**
|
|
100
|
-
*
|
|
126
|
+
* Claims the buffered records like flushPending(), then waits for the batches of this call
|
|
127
|
+
* until each one ends, a hold stops the queue or the deadline passes.
|
|
128
|
+
* @param expired Resolves at the caller's deadline.
|
|
129
|
+
* @returns The records of the call's batches by their state when the wait ends. A batch that
|
|
130
|
+
* ends later doesn't change them.
|
|
131
|
+
*/
|
|
132
|
+
flushUntil(expired: Promise<void>): Promise<FlushCounts>;
|
|
133
|
+
/**
|
|
134
|
+
* Counts the waiting records and the records in requests.
|
|
101
135
|
* @returns Records in the buffers and the queue, and records in dispatch.
|
|
102
136
|
*/
|
|
103
137
|
counts(): {
|
|
104
138
|
pending: number;
|
|
105
139
|
inFlight: number;
|
|
106
140
|
};
|
|
141
|
+
/**
|
|
142
|
+
* Stops or starts the dispatch while `enabled` is false. The records stay where they are, and
|
|
143
|
+
* a start sends them right away.
|
|
144
|
+
* @param on True to stop.
|
|
145
|
+
*/
|
|
146
|
+
hold(on: boolean): void;
|
|
147
|
+
/**
|
|
148
|
+
* Checks whether hold(true) is in force.
|
|
149
|
+
* @returns True while the pipeline sends nothing.
|
|
150
|
+
*/
|
|
151
|
+
isHeld(): boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Lists the records that only memory holds.
|
|
154
|
+
* @returns The records in requests and in the queue, then the buffered records.
|
|
155
|
+
*/
|
|
156
|
+
records(): LogRecord[];
|
|
157
|
+
/**
|
|
158
|
+
* Stops the pipeline without a send, for a discard at shutdown. A request in flight can still
|
|
159
|
+
* reach the server, so its records aren't returned.
|
|
160
|
+
* @returns The records in the queue and in the buffers.
|
|
161
|
+
*/
|
|
162
|
+
discard(): LogRecord[];
|
|
107
163
|
/** Stops the flush timers and refuses further records. */
|
|
108
164
|
destroy(): void;
|
|
109
165
|
/**
|
|
@@ -113,51 +169,59 @@ export declare class LogPipeline {
|
|
|
113
169
|
*/
|
|
114
170
|
private toBatch;
|
|
115
171
|
/**
|
|
116
|
-
* Sorts a record into its stream. Sampling already
|
|
117
|
-
* record
|
|
118
|
-
*
|
|
119
|
-
* log call
|
|
172
|
+
* Sorts a record into its stream. Sampling has already run: RecordBuilder samples a local
|
|
173
|
+
* record and the runtime samples a forwarded one. Every fault is caught here. A record
|
|
174
|
+
* without `attributes` makes streamOf throw, and an uncaught throw would land in the
|
|
175
|
+
* caller's log call.
|
|
120
176
|
* @param record Record to sort.
|
|
121
177
|
*/
|
|
122
178
|
private route;
|
|
123
179
|
/**
|
|
124
|
-
* Drains a stream buffer into a new batch and queues
|
|
125
|
-
*
|
|
126
|
-
*
|
|
180
|
+
* Drains a stream buffer into a new batch and queues it for dispatch. Called by a timer
|
|
181
|
+
* or a flush. An empty buffer produces no batch. Every `take` stops the timer that calls
|
|
182
|
+
* this method.
|
|
127
183
|
* @param stream Stream buffer to drain.
|
|
128
184
|
*/
|
|
129
185
|
private claim;
|
|
130
186
|
/**
|
|
131
|
-
* Queues a batch and schedules the pump on a microtask.
|
|
132
|
-
* a fetch inside the log call
|
|
187
|
+
* Queues a batch and schedules the pump on a microtask. Dispatching inline would start
|
|
188
|
+
* a fetch inside the application's log call.
|
|
133
189
|
* @param batch Batch ready for delivery, or null when the drain found no records.
|
|
134
190
|
*/
|
|
135
191
|
private enqueue;
|
|
192
|
+
/** Runs the pump on a microtask. Dispatching inline would start a fetch inside an app call. */
|
|
193
|
+
private schedulePump;
|
|
136
194
|
/** Starts queued dispatches up to the concurrency limit. */
|
|
137
195
|
private pump;
|
|
138
196
|
/**
|
|
139
|
-
* Delivers one batch
|
|
197
|
+
* Delivers one batch, then frees the concurrency slot and resolves the batch's promise.
|
|
140
198
|
* @param pending Batch to deliver.
|
|
141
199
|
*/
|
|
142
200
|
private run;
|
|
143
201
|
/**
|
|
144
|
-
* Sends a batch over the HTTP transport.
|
|
145
|
-
*
|
|
202
|
+
* Sends a batch over the HTTP transport. Stores the batch if the transport is throttled
|
|
203
|
+
* or fails.
|
|
146
204
|
* @param batch Batch to deliver.
|
|
205
|
+
* @returns What became of the records, or undefined when that isn't known yet.
|
|
147
206
|
*/
|
|
148
207
|
private dispatch;
|
|
149
208
|
/**
|
|
150
|
-
* Stores a batch that the transport refused. The retry engine splits a 413 and
|
|
151
|
-
*
|
|
209
|
+
* Stores a batch that the transport refused. The retry engine splits a 413 and drops a
|
|
210
|
+
* batch the server won't accept.
|
|
152
211
|
* @param batch Batch to persist, with its attempt already counted.
|
|
153
212
|
* @param error Failure thrown by the transport.
|
|
213
|
+
* @returns What became of the batch and the records that storage holds, or undefined when
|
|
214
|
+
* a storage call threw or ran past its deadline. A late save can still finish, so the caller
|
|
215
|
+
* reports no drop then.
|
|
154
216
|
*/
|
|
155
217
|
private storeFailed;
|
|
156
218
|
/**
|
|
157
|
-
* Stores an undelivered batch
|
|
158
|
-
*
|
|
219
|
+
* Stores an undelivered batch, then starts the retry engine. A deadline caps the wait,
|
|
220
|
+
* because a storage call that never settles holds this dispatch slot, and two of them
|
|
159
221
|
* stop the pipeline.
|
|
160
222
|
* @param batch Batch to persist.
|
|
223
|
+
* @returns What became of the batch, for the throttle report.
|
|
161
224
|
*/
|
|
162
225
|
private store;
|
|
163
226
|
}
|
|
227
|
+
export {};
|
|
@@ -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,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.cjs";
|
|
2
|
+
import type { Diagnostics } from "./diagnostics.cjs";
|
|
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;
|