@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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Category of a breadcrumb event. */
|
|
2
|
+
export type BreadcrumbCategory = "log" | "action" | "event" | "click" | "navigation" | "http" | "console" | "frame" | "profile" | "custom";
|
|
3
|
+
/** Short summary of one event, kept so an error record can carry it. */
|
|
4
|
+
export interface Breadcrumb {
|
|
5
|
+
/** Timestamp in epoch milliseconds. */
|
|
6
|
+
t: number;
|
|
7
|
+
/** Category of the event. */
|
|
8
|
+
category: BreadcrumbCategory;
|
|
9
|
+
/** Human-readable description of the event. */
|
|
10
|
+
message: string;
|
|
11
|
+
/** Optional contextual metadata. */
|
|
12
|
+
data?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
/** Fixed-size ring buffer that keeps recent breadcrumbs in time order. */
|
|
15
|
+
export declare class BreadcrumbBuffer {
|
|
16
|
+
/** The ring's backing array. */
|
|
17
|
+
private buffer;
|
|
18
|
+
/** Next write index in the circular buffer. */
|
|
19
|
+
private pointer;
|
|
20
|
+
/**
|
|
21
|
+
* True once the pointer has wrapped past the capacity. The pointer alone can't tell an
|
|
22
|
+
* empty ring from one that wrapped back to index 0.
|
|
23
|
+
*/
|
|
24
|
+
private filled;
|
|
25
|
+
/** Maximum number of breadcrumbs the buffer keeps. */
|
|
26
|
+
private capacity;
|
|
27
|
+
/**
|
|
28
|
+
* @param capacity Maximum number of breadcrumbs. 0 turns the buffer off. Any other value
|
|
29
|
+
* below the minimum size is raised to it.
|
|
30
|
+
*/
|
|
31
|
+
constructor(capacity: number);
|
|
32
|
+
/**
|
|
33
|
+
* Changes the capacity, keeping the most recent breadcrumbs that fit.
|
|
34
|
+
* @param capacity New capacity. Pass 0 to drop the stored breadcrumbs and turn the buffer off.
|
|
35
|
+
*/
|
|
36
|
+
resize(capacity: number): void;
|
|
37
|
+
/**
|
|
38
|
+
* Adds a breadcrumb. When the buffer is full, it overwrites the oldest one.
|
|
39
|
+
* @param crumb Breadcrumb to add.
|
|
40
|
+
*/
|
|
41
|
+
push(crumb: Breadcrumb): void;
|
|
42
|
+
/**
|
|
43
|
+
* Keeps only the breadcrumbs that pass the test, in their order.
|
|
44
|
+
* @param keep Returns true for a breadcrumb to keep.
|
|
45
|
+
*/
|
|
46
|
+
retain(keep: (crumb: Breadcrumb) => boolean): void;
|
|
47
|
+
/** Removes all breadcrumbs, so a new session never carries the previous user's trail. */
|
|
48
|
+
clear(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Returns all stored breadcrumbs, oldest to newest.
|
|
51
|
+
* @returns The breadcrumbs in time order.
|
|
52
|
+
*/
|
|
53
|
+
snapshot(): Breadcrumb[];
|
|
54
|
+
}
|
|
@@ -1,48 +1,54 @@
|
|
|
1
1
|
/** Category of a breadcrumb event. */
|
|
2
|
-
export type BreadcrumbCategory = "log" | "action" | "event" | "click" | "navigation" | "http" | "console" | "frame" | "custom";
|
|
3
|
-
/** Short summary of one event
|
|
2
|
+
export type BreadcrumbCategory = "log" | "action" | "event" | "click" | "navigation" | "http" | "console" | "frame" | "profile" | "custom";
|
|
3
|
+
/** Short summary of one event, kept so an error record can carry it. */
|
|
4
4
|
export interface Breadcrumb {
|
|
5
5
|
/** Timestamp in epoch milliseconds. */
|
|
6
6
|
t: number;
|
|
7
7
|
/** Category of the event. */
|
|
8
8
|
category: BreadcrumbCategory;
|
|
9
|
-
/**
|
|
9
|
+
/** Human-readable description of the event. */
|
|
10
10
|
message: string;
|
|
11
11
|
/** Optional contextual metadata. */
|
|
12
12
|
data?: Record<string, unknown>;
|
|
13
13
|
}
|
|
14
|
-
/**
|
|
14
|
+
/** Fixed-size ring buffer that keeps recent breadcrumbs in time order. */
|
|
15
15
|
export declare class BreadcrumbBuffer {
|
|
16
|
-
/**
|
|
16
|
+
/** The ring's backing array. */
|
|
17
17
|
private buffer;
|
|
18
18
|
/** Next write index in the circular buffer. */
|
|
19
19
|
private pointer;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* True once the pointer has wrapped past the capacity. The pointer alone can't tell an
|
|
22
|
+
* empty ring from one that wrapped back to index 0.
|
|
23
23
|
*/
|
|
24
24
|
private filled;
|
|
25
|
-
/** Maximum number of breadcrumbs
|
|
25
|
+
/** Maximum number of breadcrumbs the buffer keeps. */
|
|
26
26
|
private capacity;
|
|
27
27
|
/**
|
|
28
|
-
* @param capacity Maximum number of breadcrumbs.
|
|
28
|
+
* @param capacity Maximum number of breadcrumbs. 0 turns the buffer off. Any other value
|
|
29
|
+
* below the minimum size is raised to it.
|
|
29
30
|
*/
|
|
30
31
|
constructor(capacity: number);
|
|
31
32
|
/**
|
|
32
|
-
* Changes the capacity
|
|
33
|
-
* @param capacity New capacity.
|
|
33
|
+
* Changes the capacity, keeping the most recent breadcrumbs that fit.
|
|
34
|
+
* @param capacity New capacity. Pass 0 to drop the stored breadcrumbs and turn the buffer off.
|
|
34
35
|
*/
|
|
35
36
|
resize(capacity: number): void;
|
|
36
37
|
/**
|
|
37
|
-
* Adds a breadcrumb. When the buffer is full,
|
|
38
|
+
* Adds a breadcrumb. When the buffer is full, it overwrites the oldest one.
|
|
38
39
|
* @param crumb Breadcrumb to add.
|
|
39
40
|
*/
|
|
40
41
|
push(crumb: Breadcrumb): void;
|
|
41
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Keeps only the breadcrumbs that pass the test, in their order.
|
|
44
|
+
* @param keep Returns true for a breadcrumb to keep.
|
|
45
|
+
*/
|
|
46
|
+
retain(keep: (crumb: Breadcrumb) => boolean): void;
|
|
47
|
+
/** Removes all breadcrumbs, so a new session never carries the previous user's trail. */
|
|
42
48
|
clear(): void;
|
|
43
49
|
/**
|
|
44
|
-
* Returns all stored breadcrumbs
|
|
45
|
-
* @returns
|
|
50
|
+
* Returns all stored breadcrumbs, oldest to newest.
|
|
51
|
+
* @returns The breadcrumbs in time order.
|
|
46
52
|
*/
|
|
47
53
|
snapshot(): Breadcrumb[];
|
|
48
54
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ObservabilityConfig, ResolvedConfig } from "../models/config.cjs";
|
|
2
|
+
import type { Diagnostics } from "./diagnostics.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* Reads a destination that null turns off. An empty or blank string turns it off too, with a
|
|
5
|
+
* report, because an empty environment variable must not leave the records going to the old
|
|
6
|
+
* destination. A rotation runs it too, to find a refused URL.
|
|
7
|
+
* @param key Config key.
|
|
8
|
+
* @param value The value the consumer passed.
|
|
9
|
+
* @param fallback The current destination.
|
|
10
|
+
* @param diagnostics Diagnostics reporter.
|
|
11
|
+
* @returns The URL, null when it's off, or the fallback for a refused value.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveDestination(key: string, value: unknown, fallback: unknown, diagnostics: Diagnostics): unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Reads the endpoint. "" stays "", the value for "not set", so resolveConfig reports a missing
|
|
16
|
+
* endpoint. A blank string is refused, because it would send to the page itself. A rotation
|
|
17
|
+
* runs it too, to find a refused URL.
|
|
18
|
+
* @param value The value the consumer passed.
|
|
19
|
+
* @param fallback The current endpoint.
|
|
20
|
+
* @param diagnostics Diagnostics reporter.
|
|
21
|
+
* @returns The endpoint, null for console-only mode, or the fallback for a refused value.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveEndpoint(value: unknown, fallback: unknown, diagnostics: Diagnostics): unknown;
|
|
24
|
+
/**
|
|
25
|
+
* Stands in for a redact value that isn't a function when no redact hook was set before. The
|
|
26
|
+
* record builder drops each record while it's the hook, so a record the app meant to redact
|
|
27
|
+
* never leaves the page.
|
|
28
|
+
* @returns null, which drops the record.
|
|
29
|
+
*/
|
|
30
|
+
export declare const REFUSE_RECORDS: () => null;
|
|
31
|
+
/**
|
|
32
|
+
* Resolves partial configuration input into a validated ResolvedConfig.
|
|
33
|
+
* @param input Partial consumer configuration options.
|
|
34
|
+
* @param diagnostics Diagnostics reporter.
|
|
35
|
+
* @param previous The active configuration, for an incremental reconfigure.
|
|
36
|
+
* @returns Complete, validated configuration object.
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveConfig(input: Partial<ObservabilityConfig>, diagnostics: Diagnostics, previous?: ResolvedConfig): ResolvedConfig;
|
|
39
|
+
/**
|
|
40
|
+
* Changes the active configuration object in place, so subsystems holding a section
|
|
41
|
+
* reference see the update.
|
|
42
|
+
* @param target Active configuration object to change.
|
|
43
|
+
* @param next Configuration object with the new values.
|
|
44
|
+
*/
|
|
45
|
+
export declare function applyResolvedConfig(target: ResolvedConfig, next: ResolvedConfig): void;
|
package/dist/core/config.d.ts
CHANGED
|
@@ -1,15 +1,43 @@
|
|
|
1
|
-
import type { ObservabilityConfig, ResolvedConfig } from "../models/config";
|
|
2
|
-
import type { Diagnostics } from "./diagnostics";
|
|
1
|
+
import type { ObservabilityConfig, ResolvedConfig } from "../models/config.js";
|
|
2
|
+
import type { Diagnostics } from "./diagnostics.js";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Reads a destination that null turns off. An empty or blank string turns it off too, with a
|
|
5
|
+
* report, because an empty environment variable must not leave the records going to the old
|
|
6
|
+
* destination. A rotation runs it too, to find a refused URL.
|
|
7
|
+
* @param key Config key.
|
|
8
|
+
* @param value The value the consumer passed.
|
|
9
|
+
* @param fallback The current destination.
|
|
10
|
+
* @param diagnostics Diagnostics reporter.
|
|
11
|
+
* @returns The URL, null when it's off, or the fallback for a refused value.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveDestination(key: string, value: unknown, fallback: unknown, diagnostics: Diagnostics): unknown;
|
|
14
|
+
/**
|
|
15
|
+
* Reads the endpoint. "" stays "", the value for "not set", so resolveConfig reports a missing
|
|
16
|
+
* endpoint. A blank string is refused, because it would send to the page itself. A rotation
|
|
17
|
+
* runs it too, to find a refused URL.
|
|
18
|
+
* @param value The value the consumer passed.
|
|
19
|
+
* @param fallback The current endpoint.
|
|
20
|
+
* @param diagnostics Diagnostics reporter.
|
|
21
|
+
* @returns The endpoint, null for console-only mode, or the fallback for a refused value.
|
|
22
|
+
*/
|
|
23
|
+
export declare function resolveEndpoint(value: unknown, fallback: unknown, diagnostics: Diagnostics): unknown;
|
|
24
|
+
/**
|
|
25
|
+
* Stands in for a redact value that isn't a function when no redact hook was set before. The
|
|
26
|
+
* record builder drops each record while it's the hook, so a record the app meant to redact
|
|
27
|
+
* never leaves the page.
|
|
28
|
+
* @returns null, which drops the record.
|
|
29
|
+
*/
|
|
30
|
+
export declare const REFUSE_RECORDS: () => null;
|
|
31
|
+
/**
|
|
32
|
+
* Resolves partial configuration input into a validated ResolvedConfig.
|
|
5
33
|
* @param input Partial consumer configuration options.
|
|
6
34
|
* @param diagnostics Diagnostics reporter.
|
|
7
|
-
* @param previous
|
|
35
|
+
* @param previous The active configuration, for an incremental reconfigure.
|
|
8
36
|
* @returns Complete, validated configuration object.
|
|
9
37
|
*/
|
|
10
38
|
export declare function resolveConfig(input: Partial<ObservabilityConfig>, diagnostics: Diagnostics, previous?: ResolvedConfig): ResolvedConfig;
|
|
11
39
|
/**
|
|
12
|
-
* Changes the active configuration object in place
|
|
40
|
+
* Changes the active configuration object in place, so subsystems holding a section
|
|
13
41
|
* reference see the update.
|
|
14
42
|
* @param target Active configuration object to change.
|
|
15
43
|
* @param next Configuration object with the new values.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Key-value store for ambient context attributes attached to log records. */
|
|
2
|
+
export declare class ContextStore {
|
|
3
|
+
/** Backing store mapping attribute keys to raw values. */
|
|
4
|
+
private readonly map;
|
|
5
|
+
/**
|
|
6
|
+
* Merges attributes into the ambient context. null removes a key, and undefined keeps the
|
|
7
|
+
* current value, as in configure().
|
|
8
|
+
* @param values Attributes to merge.
|
|
9
|
+
*/
|
|
10
|
+
merge(values: Record<string, unknown>): void;
|
|
11
|
+
/**
|
|
12
|
+
* Removes an attribute from the ambient context.
|
|
13
|
+
* @param key Attribute key to remove.
|
|
14
|
+
*/
|
|
15
|
+
remove(key: string): void;
|
|
16
|
+
/** Removes all ambient context attributes. */
|
|
17
|
+
clear(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Returns a copy of all ambient context attributes, so a merge target or a sanitizer
|
|
20
|
+
* can't change the store.
|
|
21
|
+
* @returns Plain object with the stored key-value pairs.
|
|
22
|
+
*/
|
|
23
|
+
getAll(): Record<string, unknown>;
|
|
24
|
+
}
|
package/dist/core/context.d.ts
CHANGED
|
@@ -3,27 +3,22 @@ export declare class ContextStore {
|
|
|
3
3
|
/** Backing store mapping attribute keys to raw values. */
|
|
4
4
|
private readonly map;
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @param
|
|
6
|
+
* Merges attributes into the ambient context. null removes a key, and undefined keeps the
|
|
7
|
+
* current value, as in configure().
|
|
8
|
+
* @param values Attributes to merge.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
merge(values: Record<string, unknown>): void;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* @param values Record of attributes to merge.
|
|
14
|
-
*/
|
|
15
|
-
setMany(values: Record<string, unknown>): void;
|
|
16
|
-
/**
|
|
17
|
-
* Deletes an attribute from the ambient context store.
|
|
12
|
+
* Removes an attribute from the ambient context.
|
|
18
13
|
* @param key Attribute key to remove.
|
|
19
14
|
*/
|
|
20
15
|
remove(key: string): void;
|
|
21
16
|
/** Removes all ambient context attributes. */
|
|
22
17
|
clear(): void;
|
|
23
18
|
/**
|
|
24
|
-
* Returns a copy of all ambient context attributes
|
|
25
|
-
*
|
|
26
|
-
* @returns Plain object
|
|
19
|
+
* Returns a copy of all ambient context attributes, so a merge target or a sanitizer
|
|
20
|
+
* can't change the store.
|
|
21
|
+
* @returns Plain object with the stored key-value pairs.
|
|
27
22
|
*/
|
|
28
23
|
getAll(): Record<string, unknown>;
|
|
29
24
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { DebugBufferOptions } from "../models/config.cjs";
|
|
2
|
+
import type { LogRecord } from "../models/log-record.cjs";
|
|
3
|
+
/** Bounded list of the records that were dropped by level or by sampling. */
|
|
4
|
+
export declare class DebugBuffer {
|
|
5
|
+
private readonly policy;
|
|
6
|
+
/** Kept records, oldest first. Can grow to twice maxRecords between trims. */
|
|
7
|
+
private kept;
|
|
8
|
+
/**
|
|
9
|
+
* @param policy Returns the current settings. A later configure() can change them.
|
|
10
|
+
*/
|
|
11
|
+
constructor(policy: () => DebugBufferOptions);
|
|
12
|
+
/**
|
|
13
|
+
* Keeps a record. When the buffer is full, the oldest record goes first.
|
|
14
|
+
* @param record Built record. The privacy hooks have already run on it.
|
|
15
|
+
*/
|
|
16
|
+
push(record: LogRecord): void;
|
|
17
|
+
/**
|
|
18
|
+
* Takes the kept records that aren't too old and empties the buffer.
|
|
19
|
+
* @returns The records, oldest first, each with `uiobs.debug_buffer: true`.
|
|
20
|
+
*/
|
|
21
|
+
drain(): LogRecord[];
|
|
22
|
+
/**
|
|
23
|
+
* Returns the kept records without taking them.
|
|
24
|
+
* @returns The records, oldest first.
|
|
25
|
+
*/
|
|
26
|
+
snapshot(): LogRecord[];
|
|
27
|
+
/**
|
|
28
|
+
* Returns the kept records that the current settings allow. A disabled buffer empties itself.
|
|
29
|
+
* @returns The records, oldest first.
|
|
30
|
+
*/
|
|
31
|
+
private live;
|
|
32
|
+
/** Removes every kept record, so nothing from an old session or identity goes out. */
|
|
33
|
+
clear(): void;
|
|
34
|
+
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { LogRecord } from "../models/log-record";
|
|
3
|
-
/** Bounded list of the records that
|
|
1
|
+
import type { DebugBufferOptions } from "../models/config.js";
|
|
2
|
+
import type { LogRecord } from "../models/log-record.js";
|
|
3
|
+
/** Bounded list of the records that were dropped by level or by sampling. */
|
|
4
4
|
export declare class DebugBuffer {
|
|
5
5
|
private readonly policy;
|
|
6
|
-
/** Kept records, oldest first.
|
|
6
|
+
/** Kept records, oldest first. Can grow to twice maxRecords between trims. */
|
|
7
7
|
private kept;
|
|
8
8
|
/**
|
|
9
|
-
* @param policy
|
|
9
|
+
* @param policy Returns the current settings. A later configure() can change them.
|
|
10
10
|
*/
|
|
11
|
-
constructor(policy: () =>
|
|
11
|
+
constructor(policy: () => DebugBufferOptions);
|
|
12
12
|
/**
|
|
13
|
-
* Keeps a record. When the buffer is full, the oldest record
|
|
14
|
-
* @param record Built record. The privacy hooks already
|
|
13
|
+
* Keeps a record. When the buffer is full, the oldest record goes first.
|
|
14
|
+
* @param record Built record. The privacy hooks have already run on it.
|
|
15
15
|
*/
|
|
16
16
|
push(record: LogRecord): void;
|
|
17
17
|
/**
|
|
18
|
-
* Takes the kept records that
|
|
19
|
-
* @returns The records, oldest first
|
|
18
|
+
* Takes the kept records that aren't too old and empties the buffer.
|
|
19
|
+
* @returns The records, oldest first, each with `uiobs.debug_buffer: true`.
|
|
20
20
|
*/
|
|
21
21
|
drain(): LogRecord[];
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Returns the kept records without taking them.
|
|
24
24
|
* @returns The records, oldest first.
|
|
25
25
|
*/
|
|
26
26
|
snapshot(): LogRecord[];
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Returns the kept records that the current settings allow. A disabled buffer empties itself.
|
|
29
29
|
* @returns The records, oldest first.
|
|
30
30
|
*/
|
|
31
31
|
private live;
|
|
32
|
-
/** Removes
|
|
32
|
+
/** Removes every kept record, so nothing from an old session or identity goes out. */
|
|
33
33
|
clear(): void;
|
|
34
34
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ResolvedConfig } from "../models/config.cjs";
|
|
2
|
+
import { type SanitizeLimits } from "../utils/sanitize.cjs";
|
|
3
|
+
import type { Diagnostics } from "./diagnostics.cjs";
|
|
4
|
+
/**
|
|
5
|
+
* Copies the config for a support ticket, without the headers and with every URL trimmed. A
|
|
6
|
+
* function becomes its name and a RegExp its text.
|
|
7
|
+
* @param config Active configuration.
|
|
8
|
+
* @param limits Limits for the copy, the same as for record attributes.
|
|
9
|
+
* @param diagnostics Diagnostics reporter.
|
|
10
|
+
* @returns JSON-safe copy of the config.
|
|
11
|
+
*/
|
|
12
|
+
export declare function configSummary(config: ResolvedConfig, limits: SanitizeLimits, diagnostics: Diagnostics): Record<string, unknown>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { ResolvedConfig } from "../models/config";
|
|
2
|
-
import { type SanitizeLimits } from "../utils/sanitize";
|
|
3
|
-
import type { Diagnostics } from "./diagnostics";
|
|
1
|
+
import type { ResolvedConfig } from "../models/config.js";
|
|
2
|
+
import { type SanitizeLimits } from "../utils/sanitize.js";
|
|
3
|
+
import type { Diagnostics } from "./diagnostics.js";
|
|
4
4
|
/**
|
|
5
|
-
* Copies the config for a support ticket
|
|
6
|
-
* becomes its name
|
|
5
|
+
* Copies the config for a support ticket, without the headers and with every URL trimmed. A
|
|
6
|
+
* function becomes its name and a RegExp its text.
|
|
7
7
|
* @param config Active configuration.
|
|
8
|
-
* @param limits Limits
|
|
8
|
+
* @param limits Limits for the copy, the same as for record attributes.
|
|
9
9
|
* @param diagnostics Diagnostics reporter.
|
|
10
10
|
* @returns JSON-safe copy of the config.
|
|
11
11
|
*/
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Diagnostics } from "./diagnostics.cjs";
|
|
2
|
+
/** Queues a call without reading its payload. A full queue builds its pending calls first. */
|
|
3
|
+
export declare function deferWrite(owner: object, work: () => void, diagnostics: Diagnostics, limit: number | null): void;
|
|
4
|
+
/** Builds pending calls before a flush, a session change or a delivery identity change. */
|
|
5
|
+
export declare function drainDeferred(owner: object): void;
|
|
6
|
+
/** Releases calls that a hook queues during shutdown. No records were built for them. */
|
|
7
|
+
export declare function cancelDeferred(owner: object): void;
|
package/dist/core/deferred.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Diagnostics } from "./diagnostics";
|
|
2
|
-
/** Queues a call without reading its payload. A full queue
|
|
3
|
-
export declare function deferWrite(owner: object, work: () => void, diagnostics: Diagnostics, limit: number): void;
|
|
1
|
+
import type { Diagnostics } from "./diagnostics.js";
|
|
2
|
+
/** Queues a call without reading its payload. A full queue builds its pending calls first. */
|
|
3
|
+
export declare function deferWrite(owner: object, work: () => void, diagnostics: Diagnostics, limit: number | null): void;
|
|
4
4
|
/** Builds pending calls before a flush, a session change or a delivery identity change. */
|
|
5
5
|
export declare function drainDeferred(owner: object): void;
|
|
6
|
-
/** Releases calls that a hook queues during shutdown.
|
|
6
|
+
/** Releases calls that a hook queues during shutdown. No records were built for them. */
|
|
7
7
|
export declare function cancelDeferred(owner: object): void;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Closed set of diagnostic event codes emitted by library subsystems. */
|
|
2
|
+
export type DiagnosticCode = "config.locked" | "security.rotated" | "security.rotation_failed" | "security.context_mismatch" | "record.dropped_during_rotation" | "bus.rejected_message" | "config.invalid" | "config.reconfigured" | "record.sanitize_failed" | "record.truncated" | "record.dropped_by_level" | "record.dropped_by_sampling" | "record.dropped_by_ceiling" | "record.dropped_by_processor" | "record.dropped_by_redact" | "record.dropped_boot_buffer_full" | "record.dropped_malformed" | "record.dropped_no_destination" | "runtime.version_mismatch" | "journey.expired" | "journey.adopted" | "journey.token_too_large" | "trace.otel_failed" | "bus.role_resolved" | "bus.no_owner" | "bus.handshake_timeout" | "bus.untrusted_origin" | "bus.send_failed" | "bus.protocol_mismatch" | "transport.http_error" | "transport.timeout" | "transport.batch_split" | "transport.partial_success" | "transport.throttled" | "transport.dropped_permanent" | "transport.rejected_credentials" | "transport.serialize_failed" | "storage.unavailable" | "storage.degraded" | "storage.quota_exceeded" | "storage.evicted" | "storage.dead_lettered" | "pipeline.crashed" | "capture.install_failed" | "capture.rate_limited" | "capture.header_failed" | "capture.trace_header_kept" | "capture.record_failed" | "capture.transport_request" | "openfin.unavailable" | "platform.api_blocked" | "handler.threw";
|
|
3
|
+
/** Diagnostic event payload dispatched to consumer handlers. */
|
|
4
|
+
export interface DiagnosticEvent {
|
|
5
|
+
/** Diagnostic fault code. */
|
|
6
|
+
code: DiagnosticCode;
|
|
7
|
+
/** Human-readable description. */
|
|
8
|
+
message: string;
|
|
9
|
+
/** Structured context metadata. */
|
|
10
|
+
detail?: Record<string, unknown>;
|
|
11
|
+
/** Caught error instance or reason. */
|
|
12
|
+
cause?: unknown;
|
|
13
|
+
/** Event timestamp in epoch milliseconds. */
|
|
14
|
+
at: number;
|
|
15
|
+
/** Total count of this code since startup, including rate-limited occurrences. */
|
|
16
|
+
count: number;
|
|
17
|
+
}
|
|
18
|
+
/** Consumer callback for receiving rate-limited diagnostic events. */
|
|
19
|
+
export type DiagnosticHandler = (event: DiagnosticEvent) => void;
|
|
20
|
+
/** Reports internal errors. Dispatch is rate limited, but every event is counted. */
|
|
21
|
+
export declare class Diagnostics {
|
|
22
|
+
private handler?;
|
|
23
|
+
private throttleMs;
|
|
24
|
+
private consoleFallback;
|
|
25
|
+
/** Running occurrence counts per diagnostic code. */
|
|
26
|
+
private readonly counters;
|
|
27
|
+
/** Timestamp of the last emitted event per code, in epoch milliseconds. */
|
|
28
|
+
private readonly lastEmitted;
|
|
29
|
+
/**
|
|
30
|
+
* @param handler Optional listener for diagnostic events.
|
|
31
|
+
* @param throttleMs Minimum time in milliseconds between emitted events for one code.
|
|
32
|
+
* @param consoleFallback True to print a fixed warning if the diagnostic handler throws.
|
|
33
|
+
*/
|
|
34
|
+
constructor(handler?: DiagnosticHandler | undefined, throttleMs?: number, consoleFallback?: boolean);
|
|
35
|
+
/**
|
|
36
|
+
* Changes the report interval and the console fallback rule.
|
|
37
|
+
* @param throttleMs Minimum wait between reports of one code, in milliseconds.
|
|
38
|
+
* @param consoleFallback True to print a fixed warning if the handler throws.
|
|
39
|
+
*/
|
|
40
|
+
setPolicy(throttleMs: number, consoleFallback: boolean): void;
|
|
41
|
+
/**
|
|
42
|
+
* Replaces or removes the active diagnostic event handler.
|
|
43
|
+
* @param handler New diagnostic event handler.
|
|
44
|
+
*/
|
|
45
|
+
setHandler(handler?: DiagnosticHandler): void;
|
|
46
|
+
/**
|
|
47
|
+
* Increments the count for a code without calling the handler.
|
|
48
|
+
* @param code Diagnostic code to increment.
|
|
49
|
+
* @param by Amount to add.
|
|
50
|
+
* @returns New total for the code.
|
|
51
|
+
*/
|
|
52
|
+
count(code: DiagnosticCode, by?: number): number;
|
|
53
|
+
/**
|
|
54
|
+
* Bumps the counter for the code and, once the throttle window has passed, sends the event
|
|
55
|
+
* to the handler. Never throws.
|
|
56
|
+
* @param code Diagnostic code.
|
|
57
|
+
* @param message Event description.
|
|
58
|
+
* @param detail Optional structured metadata.
|
|
59
|
+
* @param cause Caught error instance or reason.
|
|
60
|
+
* @returns False if the throttle dropped the event.
|
|
61
|
+
*/
|
|
62
|
+
report(code: DiagnosticCode, message: string, detail?: Record<string, unknown>, cause?: unknown): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Runs a synchronous function and reports anything it throws to diagnostics.
|
|
65
|
+
* @param code Diagnostic code to report on throw.
|
|
66
|
+
* @param message ASD-STE100 sentence that states the failure. The handler receives it as the
|
|
67
|
+
* event message.
|
|
68
|
+
* @param fn Function to run.
|
|
69
|
+
* @returns The function's return value, or undefined if it threw.
|
|
70
|
+
*/
|
|
71
|
+
guard<T>(code: DiagnosticCode, message: string, fn: () => T): T | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Runs an asynchronous function and reports a rejected promise to diagnostics.
|
|
74
|
+
* @param code Diagnostic code to report on rejection.
|
|
75
|
+
* @param message ASD-STE100 sentence that states the failure. The handler receives it as the
|
|
76
|
+
* event message.
|
|
77
|
+
* @param fn Async function to run.
|
|
78
|
+
* @returns Promise that resolves to the return value, or to undefined on rejection.
|
|
79
|
+
*/
|
|
80
|
+
guardAsync<T>(code: DiagnosticCode, message: string, fn: () => Promise<T>): Promise<T | undefined>;
|
|
81
|
+
/**
|
|
82
|
+
* Returns a copy of the cumulative diagnostic counts since initialization.
|
|
83
|
+
* @returns Map of diagnostic codes to occurrence counts.
|
|
84
|
+
*/
|
|
85
|
+
snapshot(): Record<string, number>;
|
|
86
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** Closed set of diagnostic event codes emitted by library subsystems. */
|
|
2
|
-
export type DiagnosticCode = "config.locked" | "security.rotated" | "security.context_mismatch" | "record.dropped_during_rotation" | "bus.rejected_message" | "config.invalid" | "config.reconfigured" | "record.sanitize_failed" | "record.truncated" | "record.dropped_by_level" | "record.dropped_by_sampling" | "record.dropped_by_ceiling" | "record.dropped_by_processor" | "record.dropped_by_redact" | "record.dropped_boot_buffer_full" | "record.dropped_malformed" | "record.dropped_no_destination" | "runtime.version_mismatch" | "journey.expired" | "journey.adopted" | "journey.token_too_large" | "trace.otel_failed" | "bus.role_resolved" | "bus.no_owner" | "bus.handshake_timeout" | "bus.untrusted_origin" | "bus.send_failed" | "transport.http_error" | "transport.timeout" | "transport.batch_split" | "transport.throttled" | "transport.dropped_permanent" | "transport.rejected_credentials" | "transport.serialize_failed" | "storage.unavailable" | "storage.degraded" | "storage.quota_exceeded" | "storage.evicted" | "storage.dead_lettered" | "pipeline.crashed" | "capture.install_failed" | "capture.rate_limited" | "capture.header_failed" | "capture.record_failed" | "capture.transport_request" | "openfin.unavailable" | "platform.api_blocked" | "handler.threw";
|
|
2
|
+
export type DiagnosticCode = "config.locked" | "security.rotated" | "security.rotation_failed" | "security.context_mismatch" | "record.dropped_during_rotation" | "bus.rejected_message" | "config.invalid" | "config.reconfigured" | "record.sanitize_failed" | "record.truncated" | "record.dropped_by_level" | "record.dropped_by_sampling" | "record.dropped_by_ceiling" | "record.dropped_by_processor" | "record.dropped_by_redact" | "record.dropped_boot_buffer_full" | "record.dropped_malformed" | "record.dropped_no_destination" | "runtime.version_mismatch" | "journey.expired" | "journey.adopted" | "journey.token_too_large" | "trace.otel_failed" | "bus.role_resolved" | "bus.no_owner" | "bus.handshake_timeout" | "bus.untrusted_origin" | "bus.send_failed" | "bus.protocol_mismatch" | "transport.http_error" | "transport.timeout" | "transport.batch_split" | "transport.partial_success" | "transport.throttled" | "transport.dropped_permanent" | "transport.rejected_credentials" | "transport.serialize_failed" | "storage.unavailable" | "storage.degraded" | "storage.quota_exceeded" | "storage.evicted" | "storage.dead_lettered" | "pipeline.crashed" | "capture.install_failed" | "capture.rate_limited" | "capture.header_failed" | "capture.trace_header_kept" | "capture.record_failed" | "capture.transport_request" | "openfin.unavailable" | "platform.api_blocked" | "handler.threw";
|
|
3
3
|
/** Diagnostic event payload dispatched to consumer handlers. */
|
|
4
4
|
export interface DiagnosticEvent {
|
|
5
5
|
/** Diagnostic fault code. */
|
|
6
6
|
code: DiagnosticCode;
|
|
7
|
-
/**
|
|
7
|
+
/** Human-readable description. */
|
|
8
8
|
message: string;
|
|
9
9
|
/** Structured context metadata. */
|
|
10
10
|
detail?: Record<string, unknown>;
|
|
@@ -12,23 +12,23 @@ export interface DiagnosticEvent {
|
|
|
12
12
|
cause?: unknown;
|
|
13
13
|
/** Event timestamp in epoch milliseconds. */
|
|
14
14
|
at: number;
|
|
15
|
-
/** Total count of this code since startup
|
|
15
|
+
/** Total count of this code since startup, including rate-limited occurrences. */
|
|
16
16
|
count: number;
|
|
17
17
|
}
|
|
18
18
|
/** Consumer callback for receiving rate-limited diagnostic events. */
|
|
19
19
|
export type DiagnosticHandler = (event: DiagnosticEvent) => void;
|
|
20
|
-
/** Reports internal errors.
|
|
20
|
+
/** Reports internal errors. Dispatch is rate limited, but every event is counted. */
|
|
21
21
|
export declare class Diagnostics {
|
|
22
22
|
private handler?;
|
|
23
23
|
private throttleMs;
|
|
24
24
|
private consoleFallback;
|
|
25
25
|
/** Running occurrence counts per diagnostic code. */
|
|
26
26
|
private readonly counters;
|
|
27
|
-
/** Timestamp of last emitted event per code in epoch milliseconds. */
|
|
27
|
+
/** Timestamp of the last emitted event per code, in epoch milliseconds. */
|
|
28
28
|
private readonly lastEmitted;
|
|
29
29
|
/**
|
|
30
|
-
* @param handler Optional
|
|
31
|
-
* @param throttleMs Minimum
|
|
30
|
+
* @param handler Optional listener for diagnostic events.
|
|
31
|
+
* @param throttleMs Minimum time in milliseconds between emitted events for one code.
|
|
32
32
|
* @param consoleFallback True to print a fixed warning if the diagnostic handler throws.
|
|
33
33
|
*/
|
|
34
34
|
constructor(handler?: DiagnosticHandler | undefined, throttleMs?: number, consoleFallback?: boolean);
|
|
@@ -39,44 +39,47 @@ export declare class Diagnostics {
|
|
|
39
39
|
*/
|
|
40
40
|
setPolicy(throttleMs: number, consoleFallback: boolean): void;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Replaces or removes the active diagnostic event handler.
|
|
43
43
|
* @param handler New diagnostic event handler.
|
|
44
44
|
*/
|
|
45
45
|
setHandler(handler?: DiagnosticHandler): void;
|
|
46
46
|
/**
|
|
47
|
-
* Increments the count for a code
|
|
47
|
+
* Increments the count for a code without calling the handler.
|
|
48
48
|
* @param code Diagnostic code to increment.
|
|
49
|
-
* @param by
|
|
49
|
+
* @param by Amount to add.
|
|
50
50
|
* @returns New total for the code.
|
|
51
51
|
*/
|
|
52
52
|
count(code: DiagnosticCode, by?: number): number;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
54
|
+
* Bumps the counter for the code and, once the throttle window has passed, sends the event
|
|
55
|
+
* to the handler. Never throws.
|
|
56
56
|
* @param code Diagnostic code.
|
|
57
57
|
* @param message Event description.
|
|
58
58
|
* @param detail Optional structured metadata.
|
|
59
59
|
* @param cause Caught error instance or reason.
|
|
60
|
+
* @returns False if the throttle dropped the event.
|
|
60
61
|
*/
|
|
61
|
-
report(code: DiagnosticCode, message: string, detail?: Record<string, unknown>, cause?: unknown):
|
|
62
|
+
report(code: DiagnosticCode, message: string, detail?: Record<string, unknown>, cause?: unknown): boolean;
|
|
62
63
|
/**
|
|
63
|
-
*
|
|
64
|
+
* Runs a synchronous function and reports anything it throws to diagnostics.
|
|
64
65
|
* @param code Diagnostic code to report on throw.
|
|
65
|
-
* @param message ASD-STE100 sentence that states the failure. The handler
|
|
66
|
-
*
|
|
67
|
-
* @
|
|
66
|
+
* @param message ASD-STE100 sentence that states the failure. The handler receives it as the
|
|
67
|
+
* event message.
|
|
68
|
+
* @param fn Function to run.
|
|
69
|
+
* @returns The function's return value, or undefined if it threw.
|
|
68
70
|
*/
|
|
69
71
|
guard<T>(code: DiagnosticCode, message: string, fn: () => T): T | undefined;
|
|
70
72
|
/**
|
|
71
|
-
*
|
|
73
|
+
* Runs an asynchronous function and reports a rejected promise to diagnostics.
|
|
72
74
|
* @param code Diagnostic code to report on rejection.
|
|
73
|
-
* @param message ASD-STE100 sentence that states the failure. The handler
|
|
74
|
-
*
|
|
75
|
-
* @
|
|
75
|
+
* @param message ASD-STE100 sentence that states the failure. The handler receives it as the
|
|
76
|
+
* event message.
|
|
77
|
+
* @param fn Async function to run.
|
|
78
|
+
* @returns Promise that resolves to the return value, or to undefined on rejection.
|
|
76
79
|
*/
|
|
77
80
|
guardAsync<T>(code: DiagnosticCode, message: string, fn: () => Promise<T>): Promise<T | undefined>;
|
|
78
81
|
/**
|
|
79
|
-
* Returns a copy of
|
|
82
|
+
* Returns a copy of the cumulative diagnostic counts since initialization.
|
|
80
83
|
* @returns Map of diagnostic codes to occurrence counts.
|
|
81
84
|
*/
|
|
82
85
|
snapshot(): Record<string, number>;
|