@utk09/ui-observability 0.12.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 +420 -0
- package/README.md +72 -839
- package/dist/{batch-BjQUwjA6.js → batch-CXmPmTse.js} +4 -4
- package/dist/{batch-BjQUwjA6.js.map → batch-CXmPmTse.js.map} +1 -1
- package/dist/{batch-D5LlU4Q9.cjs → batch-mmPigCpi.cjs} +2 -2
- package/dist/{batch-D5LlU4Q9.cjs.map → batch-mmPigCpi.cjs.map} +1 -1
- package/dist/bus/bus.d.cts +331 -0
- package/dist/bus/bus.d.ts +60 -10
- package/dist/bus/links.d.cts +132 -0
- package/dist/bus/links.d.ts +18 -3
- package/dist/bus/validation.d.cts +16 -0
- package/dist/bus/validation.d.ts +10 -1
- package/dist/{bus-ecxUNTja.js → bus-C39wspFV.js} +308 -193
- 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 +1 -1
- package/dist/capture/errors.d.cts +32 -0
- package/dist/capture/errors.d.ts +1 -1
- package/dist/capture/interactions.d.cts +48 -0
- package/dist/capture/interactions.d.ts +1 -1
- package/dist/capture/lifecycle.d.cts +20 -0
- package/dist/capture/lifecycle.d.ts +1 -1
- package/dist/capture/long-frames.d.cts +31 -0
- package/dist/capture/long-frames.d.ts +1 -1
- package/dist/capture/network.d.cts +57 -0
- package/dist/capture/network.d.ts +1 -1
- package/dist/capture/profiler-frames.d.cts +44 -0
- package/dist/capture/profiler-frames.d.ts +1 -1
- package/dist/capture/replay-buffer.d.cts +45 -0
- package/dist/capture/replay-buffer.d.ts +9 -10
- package/dist/capture/replay-upload.d.cts +79 -0
- package/dist/capture/replay-upload.d.ts +7 -2
- package/dist/capture/replay.d.cts +114 -0
- package/dist/capture/replay.d.ts +1 -1
- package/dist/capture/reports.d.cts +17 -0
- package/dist/capture/reports.d.ts +1 -1
- package/dist/capture/resource-timing.d.cts +14 -0
- package/dist/capture/resource-timing.d.ts +1 -1
- package/dist/capture/server-timing.d.cts +19 -0
- package/dist/capture/storm.d.cts +13 -0
- package/dist/capture/storm.d.ts +5 -5
- package/dist/capture/types.d.cts +128 -0
- package/dist/capture/types.d.ts +10 -9
- package/dist/capture/unclean-exit.d.cts +31 -0
- package/dist/capture/unclean-exit.d.ts +1 -1
- package/dist/capture/user-timing.d.cts +22 -0
- package/dist/capture/user-timing.d.ts +2 -2
- package/dist/capture/web-socket.d.cts +40 -0
- package/dist/capture/web-socket.d.ts +3 -3
- package/dist/capture/web-vitals.d.cts +40 -0
- package/dist/capture/web-vitals.d.ts +1 -1
- package/dist/{compression-lD9abCcO.cjs → compression-CvED_Jel.cjs} +2 -2
- package/dist/{compression-lD9abCcO.cjs.map → compression-CvED_Jel.cjs.map} +1 -1
- package/dist/{compression-AJJCMBOa.js → compression-tVtXwVjX.js} +2 -2
- package/dist/{compression-AJJCMBOa.js.map → compression-tVtXwVjX.js.map} +1 -1
- 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 +88 -20
- package/dist/core/breadcrumbs.d.cts +54 -0
- package/dist/core/breadcrumbs.d.ts +5 -0
- package/dist/core/config.d.cts +45 -0
- package/dist/core/config.d.ts +30 -2
- package/dist/core/context.d.cts +24 -0
- package/dist/core/context.d.ts +3 -8
- package/dist/core/debug-buffer.d.cts +34 -0
- package/dist/core/debug-buffer.d.ts +3 -3
- package/dist/core/debug-bundle.d.cts +12 -0
- package/dist/core/debug-bundle.d.ts +3 -3
- package/dist/core/deferred.d.cts +7 -0
- package/dist/core/deferred.d.ts +2 -2
- package/dist/core/diagnostics.d.cts +86 -0
- package/dist/core/diagnostics.d.ts +1 -1
- package/dist/core/drops.d.cts +39 -0
- package/dist/core/drops.d.ts +16 -6
- 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 +7 -7
- package/dist/core/logger.d.cts +141 -0
- package/dist/core/logger.d.ts +23 -30
- package/dist/core/measure.d.cts +30 -0
- package/dist/core/measure.d.ts +14 -3
- package/dist/core/meter.d.cts +78 -0
- package/dist/core/meter.d.ts +14 -8
- package/dist/core/pipeline.d.cts +227 -0
- package/dist/core/pipeline.d.ts +73 -10
- package/dist/core/profile-buckets.d.cts +31 -0
- package/dist/core/profiler.d.cts +218 -0
- package/dist/core/profiler.d.ts +2 -2
- package/dist/core/record.d.cts +190 -0
- package/dist/core/record.d.ts +44 -12
- package/dist/core/remote-rules.d.cts +17 -0
- package/dist/core/remote-rules.d.ts +3 -3
- package/dist/core/remote-sampling.d.cts +74 -0
- package/dist/core/remote-sampling.d.ts +3 -3
- 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 +245 -70
- package/dist/core/sampling.d.cts +86 -0
- package/dist/core/sampling.d.ts +5 -5
- package/dist/core/sender.d.cts +161 -0
- package/dist/core/sender.d.ts +59 -15
- package/dist/core/spans.d.cts +39 -0
- package/dist/core/spans.d.ts +1 -1
- 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 +5 -2
- package/dist/doctor.js +121 -89
- package/dist/doctor.js.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/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-BrQp_5J5.js → identity-DdhKgrpk.js} +20 -24
- 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 +89 -98
- package/dist/index.js +1173 -1506
- 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-DLXQzAGh.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-B6z2I4tU.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-35yCMNFo.js → journey-D2_sia57.js} +45 -48
- package/dist/journey-D2_sia57.js.map +1 -0
- package/dist/{library-console-Dl_Ly6DQ.js → library-console-Btrzt814.js} +2 -2
- package/dist/{library-console-Dl_Ly6DQ.js.map → library-console-Btrzt814.js.map} +1 -1
- package/dist/{library-console-BFWEuQsl.cjs → library-console-CPW6bvZH.cjs} +2 -2
- package/dist/{library-console-BFWEuQsl.cjs.map → library-console-CPW6bvZH.cjs.map} +1 -1
- package/dist/{library-request-nI6pvI6I.js → library-request-BJ9PLRaD.js} +2 -2
- package/dist/{library-request-nI6pvI6I.js.map → library-request-BJ9PLRaD.js.map} +1 -1
- package/dist/{library-request-Da-CHKzT.cjs → library-request-D7OvTxZV.cjs} +2 -2
- package/dist/{library-request-Da-CHKzT.cjs.map → library-request-D7OvTxZV.cjs.map} +1 -1
- package/dist/{lifecycle-CZ6RRXc6.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-DIA6McNr.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-430_85Da.js → long-frames-DNFaRnC3.js} +18 -22
- package/dist/long-frames-DNFaRnC3.js.map +1 -0
- package/dist/models/batch.d.cts +57 -0
- package/dist/models/batch.d.ts +2 -2
- package/dist/models/bus.d.cts +158 -0
- package/dist/models/bus.d.ts +22 -2
- package/dist/models/config.d.cts +1540 -0
- package/dist/models/config.d.ts +360 -259
- package/dist/models/drop.d.cts +54 -0
- package/dist/models/drop.d.ts +16 -3
- package/dist/models/health.d.cts +148 -0
- package/dist/models/health.d.ts +108 -12
- package/dist/models/log-record.d.cts +61 -0
- package/dist/models/metric.d.cts +139 -0
- package/dist/models/metric.d.ts +13 -2
- package/dist/models/plugin.d.cts +47 -0
- package/dist/models/plugin.d.ts +3 -3
- package/dist/models/replay.d.cts +60 -0
- package/dist/models/serializer.d.cts +23 -0
- package/dist/models/serializer.d.ts +1 -1
- package/dist/models/storage.d.cts +95 -0
- package/dist/models/storage.d.ts +7 -5
- package/dist/network-CGMLQ-mA.cjs +2 -0
- package/dist/network-CGMLQ-mA.cjs.map +1 -0
- package/dist/{network-C7SkLf4v.js → network-on2zZT6H.js} +51 -51
- package/dist/network-on2zZT6H.js.map +1 -0
- package/dist/{otlp-2MCrC3kd.cjs → otlp-BENHf3g9.cjs} +2 -2
- package/dist/{otlp-2MCrC3kd.cjs.map → otlp-BENHf3g9.cjs.map} +1 -1
- package/dist/{otlp-COq033e3.js → otlp-DimfrRor.js} +12 -12
- package/dist/{otlp-COq033e3.js.map → otlp-DimfrRor.js.map} +1 -1
- package/dist/{platform-CVewe4wQ.js → platform-BaaFIPCU.js} +10 -10
- package/dist/{platform-CVewe4wQ.js.map → platform-BaaFIPCU.js.map} +1 -1
- package/dist/{platform-12uR7kBQ.cjs → platform-CfA3-7sJ.cjs} +2 -2
- package/dist/{platform-12uR7kBQ.cjs.map → platform-CfA3-7sJ.cjs.map} +1 -1
- package/dist/{profiler-BVWIOgnq.js → profiler-BAZoh7A4.js} +89 -107
- 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-CLXlT_xL.js → profiler-frames-cJMx9wNM.js} +29 -37
- 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-BuXekPOS.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-CXGHwFRD.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-CNmsD9r3.js → sanitize-Ba0KqU06.js} +2 -2
- package/dist/sanitize-Ba0KqU06.js.map +1 -0
- package/dist/{sanitize-ChLn97Ch.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 +5 -5
- package/dist/storage/emergency-queue.d.cts +27 -0
- package/dist/storage/emergency-queue.d.ts +4 -4
- package/dist/storage/eviction.d.cts +40 -0
- package/dist/storage/eviction.d.ts +1 -1
- package/dist/storage/factory.d.cts +21 -0
- package/dist/storage/factory.d.ts +3 -3
- package/dist/storage/gap.d.cts +20 -0
- package/dist/storage/gap.d.ts +3 -3
- package/dist/storage/idb-driver.d.cts +93 -0
- package/dist/storage/idb-driver.d.ts +1 -1
- package/dist/storage/indexeddb-storage.d.cts +97 -0
- package/dist/storage/indexeddb-storage.d.ts +12 -4
- package/dist/storage/keys.d.cts +17 -0
- package/dist/storage/keys.d.ts +2 -2
- package/dist/storage/local-storage.d.cts +139 -0
- package/dist/storage/local-storage.d.ts +11 -4
- package/dist/storage/memory-storage.d.cts +73 -0
- package/dist/storage/memory-storage.d.ts +4 -3
- package/dist/storage/persistence.d.cts +8 -0
- package/dist/storage/persistence.d.ts +2 -2
- 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/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/exit-flush.d.cts +135 -0
- package/dist/transport/exit-flush.d.ts +30 -13
- package/dist/transport/headers.d.cts +8 -0
- package/dist/transport/headers.d.ts +2 -2
- package/dist/transport/http-transport.d.cts +116 -0
- package/dist/transport/http-transport.d.ts +20 -8
- package/dist/transport/memory-transport.d.cts +30 -0
- package/dist/transport/memory-transport.d.ts +2 -2
- 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 +27 -9
- package/dist/transport/serializers/ecs.d.cts +3 -0
- package/dist/transport/serializers/ecs.d.ts +1 -1
- package/dist/transport/serializers/otlp-metrics.d.cts +3 -0
- package/dist/transport/serializers/otlp-metrics.d.ts +1 -1
- package/dist/transport/serializers/otlp-traces.d.cts +3 -0
- package/dist/transport/serializers/otlp-traces.d.ts +1 -1
- package/dist/transport/serializers/otlp.d.cts +47 -0
- package/dist/transport/serializers/otlp.d.ts +2 -2
- package/dist/transport/serializers/select.d.cts +38 -0
- package/dist/transport/serializers/select.d.ts +5 -5
- package/dist/transport/status-transport.d.cts +129 -0
- package/dist/transport/status-transport.d.ts +25 -8
- 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 +4 -2
- 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-Cob_jyTv.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/{user-timing-DgHubxCI.js → user-timing-BePqb1uN.js} +15 -17
- 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 +4 -4
- package/dist/utils/deadline.d.cts +14 -0
- package/dist/utils/error-like.d.cts +25 -0
- package/dist/utils/fixed-window.d.cts +25 -0
- package/dist/utils/global-scope.d.cts +20 -0
- package/dist/utils/guards.d.cts +14 -0
- package/dist/utils/guards.d.ts +8 -0
- package/dist/utils/identity.d.cts +109 -0
- package/dist/utils/identity.d.ts +3 -4
- package/dist/utils/library-console.d.cts +11 -0
- package/dist/utils/library-request.d.cts +24 -0
- package/dist/utils/lock.d.cts +24 -0
- package/dist/utils/lock.d.ts +1 -1
- package/dist/utils/openfin.d.cts +48 -0
- package/dist/utils/patch.d.cts +9 -0
- package/dist/utils/platform.d.cts +62 -0
- package/dist/utils/platform.d.ts +2 -2
- package/dist/utils/sanitize.d.cts +52 -0
- package/dist/utils/sanitize.d.ts +1 -1
- package/dist/utils/sequence.d.cts +10 -0
- package/dist/utils/tracing.d.cts +158 -0
- package/dist/utils/tracing.d.ts +11 -4
- package/dist/utils/unref.d.cts +9 -0
- package/dist/web-socket-CoIUBM3C.cjs +2 -0
- package/dist/{web-socket-DthJuSAg.js.map → web-socket-CoIUBM3C.cjs.map} +1 -1
- package/dist/{web-socket-DthJuSAg.js → web-socket-DSHgDiZ6.js} +23 -28
- package/dist/web-socket-DSHgDiZ6.js.map +1 -0
- package/dist/{web-vitals-CsGCWnUr.js → web-vitals-4pWACwaR.js} +15 -21
- 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-B0_8rWy5.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 +54 -46
- package/dist/bus-D_7pd7RN.cjs +0 -2
- package/dist/bus-D_7pd7RN.cjs.map +0 -1
- package/dist/bus-ecxUNTja.js.map +0 -1
- package/dist/console-CLz_PvFn.cjs +0 -2
- package/dist/console-CLz_PvFn.cjs.map +0 -1
- package/dist/console-cwgHKXvM.js +0 -82
- package/dist/console-cwgHKXvM.js.map +0 -1
- package/dist/constants-Bwl_YtQi.js +0 -349
- package/dist/constants-Bwl_YtQi.js.map +0 -1
- package/dist/constants-DakMxVB2.cjs +0 -2
- package/dist/constants-DakMxVB2.cjs.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/debug-bundle-BOdYmCeV.js +0 -32
- package/dist/debug-bundle-BOdYmCeV.js.map +0 -1
- package/dist/debug-bundle-Ex4L_LSP.cjs +0 -2
- package/dist/debug-bundle-Ex4L_LSP.cjs.map +0 -1
- package/dist/emergency-queue-B9WZxanZ.js +0 -67
- package/dist/emergency-queue-B9WZxanZ.js.map +0 -1
- package/dist/emergency-queue-HBpL5r3V.cjs +0 -2
- package/dist/emergency-queue-HBpL5r3V.cjs.map +0 -1
- package/dist/errors-D6bwgJtO.js +0 -92
- package/dist/errors-D6bwgJtO.js.map +0 -1
- package/dist/errors-DCOCRdSi.cjs +0 -3
- package/dist/errors-DCOCRdSi.cjs.map +0 -1
- package/dist/factory-DLFDjdLv.cjs +0 -2
- package/dist/factory-DLFDjdLv.cjs.map +0 -1
- package/dist/factory-e9Qo3K0z.js +0 -276
- package/dist/factory-e9Qo3K0z.js.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-BlvlgjrU.cjs +0 -2
- package/dist/identity-BlvlgjrU.cjs.map +0 -1
- package/dist/identity-BrQp_5J5.js.map +0 -1
- package/dist/indexeddb-storage-CtLvZH1r.cjs +0 -2
- package/dist/indexeddb-storage-CtLvZH1r.cjs.map +0 -1
- package/dist/indexeddb-storage-DLXQzAGh.js.map +0 -1
- package/dist/interactions-B6z2I4tU.js.map +0 -1
- package/dist/interactions-P6pz08Jn.cjs +0 -2
- package/dist/interactions-P6pz08Jn.cjs.map +0 -1
- package/dist/journey-35yCMNFo.js.map +0 -1
- package/dist/journey-DAGh5h9k.cjs +0 -2
- package/dist/journey-DAGh5h9k.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/lifecycle-BGGOcN4N.cjs +0 -2
- package/dist/lifecycle-BGGOcN4N.cjs.map +0 -1
- package/dist/lifecycle-CZ6RRXc6.js.map +0 -1
- package/dist/log-record-D7bA1RPb.cjs +0 -2
- package/dist/log-record-D7bA1RPb.cjs.map +0 -1
- package/dist/log-record-DIA6McNr.js.map +0 -1
- package/dist/long-frames-430_85Da.js.map +0 -1
- package/dist/long-frames-Dd8tsi2U.cjs +0 -2
- package/dist/long-frames-Dd8tsi2U.cjs.map +0 -1
- package/dist/models/stats.d.ts +0 -11
- package/dist/network-C7SkLf4v.js.map +0 -1
- package/dist/network-pEX3PAJv.cjs +0 -2
- package/dist/network-pEX3PAJv.cjs.map +0 -1
- package/dist/profiler-BVWIOgnq.js.map +0 -1
- package/dist/profiler-eVCknCzS.cjs +0 -2
- package/dist/profiler-eVCknCzS.cjs.map +0 -1
- package/dist/profiler-frames-CLXlT_xL.js.map +0 -1
- package/dist/profiler-frames-Dg2OebB2.cjs +0 -2
- package/dist/profiler-frames-Dg2OebB2.cjs.map +0 -1
- package/dist/remote-rules-BJGDJGwA.js +0 -98
- package/dist/remote-rules-BJGDJGwA.js.map +0 -1
- package/dist/remote-rules-CJD3ToVk.cjs +0 -2
- package/dist/remote-rules-CJD3ToVk.cjs.map +0 -1
- package/dist/replay-0zAJv9T3.js +0 -338
- package/dist/replay-0zAJv9T3.js.map +0 -1
- package/dist/replay-DomJpXqW.cjs +0 -2
- package/dist/replay-DomJpXqW.cjs.map +0 -1
- package/dist/reports-BsbqmP8h.cjs +0 -2
- package/dist/reports-BsbqmP8h.cjs.map +0 -1
- package/dist/reports-BuXekPOS.js.map +0 -1
- package/dist/resource-timing-CXGHwFRD.js.map +0 -1
- package/dist/resource-timing-DkycFGDa.cjs +0 -2
- package/dist/resource-timing-DkycFGDa.cjs.map +0 -1
- package/dist/sampling-Dd0wllyq.cjs +0 -2
- package/dist/sampling-Dd0wllyq.cjs.map +0 -1
- package/dist/sampling-UUDbi3K0.js +0 -60
- package/dist/sampling-UUDbi3K0.js.map +0 -1
- package/dist/sanitize-CNmsD9r3.js.map +0 -1
- package/dist/sanitize-ChLn97Ch.cjs.map +0 -1
- package/dist/select-CTk-K5mG.cjs +0 -3
- package/dist/select-CTk-K5mG.cjs.map +0 -1
- package/dist/select-DPv_j6wq.js +0 -270
- package/dist/select-DPv_j6wq.js.map +0 -1
- package/dist/sender-15zEsZpr.js +0 -857
- package/dist/sender-15zEsZpr.js.map +0 -1
- package/dist/sender-Bfpv9tad.cjs +0 -2
- package/dist/sender-Bfpv9tad.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-BTSNTIWI.js +0 -9
- package/dist/storm-BTSNTIWI.js.map +0 -1
- package/dist/storm-D0_qZOEg.cjs +0 -2
- package/dist/storm-D0_qZOEg.cjs.map +0 -1
- package/dist/unclean-exit-ClGzrc2A.cjs +0 -2
- package/dist/unclean-exit-ClGzrc2A.cjs.map +0 -1
- package/dist/unclean-exit-Cob_jyTv.js.map +0 -1
- package/dist/user-timing-CdYqx3PF.cjs +0 -2
- package/dist/user-timing-CdYqx3PF.cjs.map +0 -1
- package/dist/user-timing-DgHubxCI.js.map +0 -1
- package/dist/utils/timer.d.ts +0 -19
- package/dist/web-socket-BTuvYoJI.cjs +0 -2
- package/dist/web-socket-BTuvYoJI.cjs.map +0 -1
- package/dist/web-vitals-Ch5BpDmo.cjs +0 -2
- package/dist/web-vitals-Ch5BpDmo.cjs.map +0 -1
- package/dist/web-vitals-CsGCWnUr.js.map +0 -1
- package/dist/worker-protocol-B0_8rWy5.js.map +0 -1
- package/dist/worker-protocol-BjzFORfq.cjs +0 -2
- package/dist/worker-protocol-BjzFORfq.cjs.map +0 -1
- package/dist/worker-server-4en-Lt-3.cjs +0 -2
- package/dist/worker-server-4en-Lt-3.cjs.map +0 -1
- package/dist/worker-server-Cne9MX9I.js +0 -83
- package/dist/worker-server-Cne9MX9I.js.map +0 -1
- package/dist/worker-transport-B-GF4Aqn.cjs +0 -2
- package/dist/worker-transport-B-GF4Aqn.cjs.map +0 -1
- package/dist/worker-transport-C3SjJAEC.js +0 -200
- package/dist/worker-transport-C3SjJAEC.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LogBatch } from "../models/batch";
|
|
2
|
-
import { StatusTransport } from "./status-transport";
|
|
1
|
+
import type { LogBatch } from "../models/batch.js";
|
|
2
|
+
import { StatusTransport } from "./status-transport.js";
|
|
3
3
|
/** Advice for an HTTP send answered with a 401 or a 403, on the main thread or in the worker. */
|
|
4
4
|
export declare const CREDENTIAL_ADVICE: string;
|
|
5
5
|
/**
|
|
@@ -7,19 +7,28 @@ export declare const CREDENTIAL_ADVICE: string;
|
|
|
7
7
|
* classifies errors.
|
|
8
8
|
*/
|
|
9
9
|
export declare class HttpTransport extends StatusTransport {
|
|
10
|
+
/** Body bytes of this transport's keepalive requests that haven't settled yet. */
|
|
11
|
+
private keepaliveBytes;
|
|
10
12
|
/**
|
|
11
13
|
* Sends one log batch over HTTP. A metrics batch goes to metricsEndpoint and a traces batch
|
|
12
14
|
* to tracesEndpoint. A batch without an endpoint goes nowhere.
|
|
13
15
|
* @param batch Batch to send.
|
|
14
16
|
* @param onKeepalive Runs when one of the batch's requests starts with keepalive.
|
|
17
|
+
* @returns Promise that resolves to the records lost in a send that ends without an error.
|
|
15
18
|
* @throws TransportError on transient, throttled, 413, or permanent network failures.
|
|
16
19
|
*/
|
|
17
|
-
send(batch: LogBatch, onKeepalive?: () => void): Promise<
|
|
20
|
+
send(batch: LogBatch, onKeepalive?: () => void): Promise<number>;
|
|
18
21
|
/**
|
|
19
22
|
* Returns the headers for the exit flush, because a closing document can't await headers().
|
|
20
23
|
* @returns The static headers, the last result of the current headers function, or undefined.
|
|
21
24
|
*/
|
|
22
25
|
lastHeaders(): Record<string, string> | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the body bytes of the keepalive requests that haven't settled. The browser has one
|
|
28
|
+
* budget for them and the exit sends, so the exit flush starts its count from this number.
|
|
29
|
+
* @returns Bytes in flight, or 0.
|
|
30
|
+
*/
|
|
31
|
+
keepaliveInFlight(): number;
|
|
23
32
|
/**
|
|
24
33
|
* Serializes, encodes and sends a batch. Throws a classified TransportError
|
|
25
34
|
* on failure.
|
|
@@ -28,6 +37,7 @@ export declare class HttpTransport extends StatusTransport {
|
|
|
28
37
|
* @param endpoint Ingest URL. The caller reads it once, so a reconfigure during the send
|
|
29
38
|
* can't change it.
|
|
30
39
|
* @param onKeepalive Runs when one of the batch's requests starts with keepalive.
|
|
40
|
+
* @returns The records lost in an accepted batch, or all of them when serializing fails.
|
|
31
41
|
*/
|
|
32
42
|
private post;
|
|
33
43
|
/**
|
|
@@ -42,8 +52,9 @@ export declare class HttpTransport extends StatusTransport {
|
|
|
42
52
|
* @param batch Batch to deliver.
|
|
43
53
|
* @param endpoint Ingest URL.
|
|
44
54
|
* @param serialized Serialized batch.
|
|
55
|
+
* @param otlp True when the batch is in an OTLP format, so a 2xx can carry a partialSuccess.
|
|
45
56
|
* @param onKeepalive Runs when the request starts with keepalive.
|
|
46
|
-
* @returns Promise that resolves to the
|
|
57
|
+
* @returns Promise that resolves to the response and the body text its status needs.
|
|
47
58
|
* @throws TransportError on timeout or network failure.
|
|
48
59
|
*/
|
|
49
60
|
private attempt;
|
|
@@ -77,7 +88,8 @@ export declare class HttpTransport extends StatusTransport {
|
|
|
77
88
|
* @param body Request body string or byte array.
|
|
78
89
|
* @param deadline Epoch time in milliseconds at which the request times out.
|
|
79
90
|
* @param keepalive True if the request continues after unload.
|
|
80
|
-
* @
|
|
91
|
+
* @param otlp True when the batch is in an OTLP format, so a 2xx can carry a partialSuccess.
|
|
92
|
+
* @returns Promise that resolves to the response and the body text its status needs.
|
|
81
93
|
* @throws TransportError on network failure, timeout, or offline status.
|
|
82
94
|
*/
|
|
83
95
|
private dispatch;
|
|
@@ -85,14 +97,14 @@ export declare class HttpTransport extends StatusTransport {
|
|
|
85
97
|
* Checks whether a send uses keepalive. A mobile OS can stop a hidden page without a
|
|
86
98
|
* pagehide, and a keepalive request continues after that. The browser limits the keepalive
|
|
87
99
|
* bodies in flight.
|
|
88
|
-
* @param
|
|
100
|
+
* @param bytes Size of the request body.
|
|
89
101
|
* @returns True for a hidden document and a body of BEACON_LIMIT_BYTES or less.
|
|
90
102
|
*/
|
|
91
103
|
private keepalive;
|
|
92
104
|
/**
|
|
93
105
|
* Reads the optional maxBytes limit from a 413 response body.
|
|
94
|
-
* @param
|
|
95
|
-
* @returns
|
|
106
|
+
* @param body The 413 body text.
|
|
107
|
+
* @returns The limit in bytes, or undefined.
|
|
96
108
|
*/
|
|
97
109
|
private readMaxBytes;
|
|
98
110
|
/**
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Transport, TransportRequest } from "../models/config.cjs";
|
|
2
|
+
import type { LogRecord } from "../models/log-record.cjs";
|
|
3
|
+
/** A transport for tests that keeps every batch in memory. */
|
|
4
|
+
export interface MemoryTransport {
|
|
5
|
+
/** Pass this function as `transport` to `configure()`. */
|
|
6
|
+
transport: Transport;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the records of every accepted batch, in send order.
|
|
9
|
+
* @returns The accepted records.
|
|
10
|
+
*/
|
|
11
|
+
records(): LogRecord[];
|
|
12
|
+
/**
|
|
13
|
+
* Returns every request, accepted or refused, in send order.
|
|
14
|
+
* @returns The requests.
|
|
15
|
+
*/
|
|
16
|
+
batches(): TransportRequest[];
|
|
17
|
+
/** Forgets every batch. The answer set with respondWith stays. */
|
|
18
|
+
clear(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Sets the answer for all later batches. The default answer is 200.
|
|
21
|
+
* @param status Status code to answer with, for example 413, 429 or 500.
|
|
22
|
+
* @param retryAfterMs Delay to answer with, for 429 and 503.
|
|
23
|
+
*/
|
|
24
|
+
respondWith(status: number, retryAfterMs?: number): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Creates a transport that keeps every batch in memory. Use it in tests, with `configure()`.
|
|
28
|
+
* @returns The memory transport.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createMemoryTransport(): MemoryTransport;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Transport, TransportRequest } from "../models/config";
|
|
2
|
-
import type { LogRecord } from "../models/log-record";
|
|
1
|
+
import type { Transport, TransportRequest } from "../models/config.js";
|
|
2
|
+
import type { LogRecord } from "../models/log-record.js";
|
|
3
3
|
/** A transport for tests that keeps every batch in memory. */
|
|
4
4
|
export interface MemoryTransport {
|
|
5
5
|
/** Pass this function as `transport` to `configure()`. */
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Diagnostics } from "../core/diagnostics.cjs";
|
|
2
|
+
import type { BatchKind, SerializerChoice } from "../models/config.cjs";
|
|
3
|
+
/** What an OTLP server rejected or warned about in a batch it accepted. */
|
|
4
|
+
export interface PartialSuccess {
|
|
5
|
+
/** Number of records the server rejected. 0 means a warning only. */
|
|
6
|
+
rejected: number;
|
|
7
|
+
/** The server's errorMessage, cut to SERVER_MESSAGE_MAX_CHARS. Empty when it sent none. */
|
|
8
|
+
message: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Checks whether a batch goes out in an OTLP format. Metrics and traces always do.
|
|
12
|
+
* @param kind Kind of the batch.
|
|
13
|
+
* @param serializer The log serializer option.
|
|
14
|
+
* @returns True for an OTLP batch.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isOtlpBatch(kind: BatchKind, serializer: SerializerChoice): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Checks whether the library reads a response's body. A 413 can carry a size hint, and an OTLP
|
|
19
|
+
* answer in JSON can carry a partialSuccess.
|
|
20
|
+
* @param response Response whose headers have arrived.
|
|
21
|
+
* @param otlp True when the batch went out in an OTLP format.
|
|
22
|
+
* @returns True when the body has something the library uses.
|
|
23
|
+
*/
|
|
24
|
+
export declare function needsBody(response: Response, otlp: boolean): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Reads a body that only adds detail to the status. A body that fails or runs out of time gives
|
|
27
|
+
* undefined, because the server has answered and a retry would send an accepted batch again.
|
|
28
|
+
* @param response Response whose headers have arrived.
|
|
29
|
+
* @param signal The request's abort signal. An abort ends the read.
|
|
30
|
+
* @param diagnostics Reports a read that fails.
|
|
31
|
+
* @returns The text, or undefined when the read fails or the body is larger than the limit.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readOptionalBody(response: Response, signal: AbortSignal, diagnostics: Diagnostics): Promise<string | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* Reads the optional size hint of a 413 body, for example {"maxBytes":65536}.
|
|
36
|
+
* @param text The body text.
|
|
37
|
+
* @returns The hint when it's a positive safe integer, otherwise undefined.
|
|
38
|
+
* @throws SyntaxError when the text isn't JSON.
|
|
39
|
+
*/
|
|
40
|
+
export declare function maxBytesOf(text: string): number | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Reads the partialSuccess of an OTLP export answer, for example
|
|
43
|
+
* {"partialSuccess":{"rejectedLogRecords":"2","errorMessage":"..."}}.
|
|
44
|
+
* @param text The answer's body text.
|
|
45
|
+
* @param kind Kind of the batch, which names the count's field.
|
|
46
|
+
* @returns What the server rejected or warned about, or undefined for a full success.
|
|
47
|
+
* @throws SyntaxError when the text isn't JSON.
|
|
48
|
+
*/
|
|
49
|
+
export declare function partialSuccessOf(text: string, kind: BatchKind): PartialSuccess | undefined;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Diagnostics } from "../core/diagnostics.js";
|
|
2
|
+
import type { BatchKind, SerializerChoice } from "../models/config.js";
|
|
3
|
+
/** What an OTLP server rejected or warned about in a batch it accepted. */
|
|
4
|
+
export interface PartialSuccess {
|
|
5
|
+
/** Number of records the server rejected. 0 means a warning only. */
|
|
6
|
+
rejected: number;
|
|
7
|
+
/** The server's errorMessage, cut to SERVER_MESSAGE_MAX_CHARS. Empty when it sent none. */
|
|
8
|
+
message: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Checks whether a batch goes out in an OTLP format. Metrics and traces always do.
|
|
12
|
+
* @param kind Kind of the batch.
|
|
13
|
+
* @param serializer The log serializer option.
|
|
14
|
+
* @returns True for an OTLP batch.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isOtlpBatch(kind: BatchKind, serializer: SerializerChoice): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Checks whether the library reads a response's body. A 413 can carry a size hint, and an OTLP
|
|
19
|
+
* answer in JSON can carry a partialSuccess.
|
|
20
|
+
* @param response Response whose headers have arrived.
|
|
21
|
+
* @param otlp True when the batch went out in an OTLP format.
|
|
22
|
+
* @returns True when the body has something the library uses.
|
|
23
|
+
*/
|
|
24
|
+
export declare function needsBody(response: Response, otlp: boolean): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Reads a body that only adds detail to the status. A body that fails or runs out of time gives
|
|
27
|
+
* undefined, because the server has answered and a retry would send an accepted batch again.
|
|
28
|
+
* @param response Response whose headers have arrived.
|
|
29
|
+
* @param signal The request's abort signal. An abort ends the read.
|
|
30
|
+
* @param diagnostics Reports a read that fails.
|
|
31
|
+
* @returns The text, or undefined when the read fails or the body is larger than the limit.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readOptionalBody(response: Response, signal: AbortSignal, diagnostics: Diagnostics): Promise<string | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* Reads the optional size hint of a 413 body, for example {"maxBytes":65536}.
|
|
36
|
+
* @param text The body text.
|
|
37
|
+
* @returns The hint when it's a positive safe integer, otherwise undefined.
|
|
38
|
+
* @throws SyntaxError when the text isn't JSON.
|
|
39
|
+
*/
|
|
40
|
+
export declare function maxBytesOf(text: string): number | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Reads the partialSuccess of an OTLP export answer, for example
|
|
43
|
+
* {"partialSuccess":{"rejectedLogRecords":"2","errorMessage":"..."}}.
|
|
44
|
+
* @param text The answer's body text.
|
|
45
|
+
* @param kind Kind of the batch, which names the count's field.
|
|
46
|
+
* @returns What the server rejected or warned about, or undefined for a full success.
|
|
47
|
+
* @throws SyntaxError when the text isn't JSON.
|
|
48
|
+
*/
|
|
49
|
+
export declare function partialSuccessOf(text: string, kind: BatchKind): PartialSuccess | undefined;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { Diagnostics } from "../core/diagnostics.cjs";
|
|
2
|
+
import { type LogBatch } from "../models/batch.cjs";
|
|
3
|
+
import type { ResolvedConfig } from "../models/config.cjs";
|
|
4
|
+
import type { LossReporter } from "../models/drop.cjs";
|
|
5
|
+
import { type StorageAdapter } from "../models/storage.cjs";
|
|
6
|
+
import type { BatchTransport } from "./status-transport.cjs";
|
|
7
|
+
/**
|
|
8
|
+
* What became of a batch whose live send failed. The pipeline picks its report from this, so
|
|
9
|
+
* the report never promises a resend that can't happen.
|
|
10
|
+
* - "stored": storage holds the whole batch, and the drain sends it again.
|
|
11
|
+
* - "split": the server said the batch is too large, and storage holds its two halves.
|
|
12
|
+
* - "rejected": no later send can succeed, so the engine dropped the batch.
|
|
13
|
+
* - "not_stored": storage didn't keep the batch, or kept only one half of a split.
|
|
14
|
+
*/
|
|
15
|
+
export type StoreOutcome = "stored" | "split" | "rejected" | "not_stored";
|
|
16
|
+
/** What storeFailed() did with a batch, and how many of its records storage holds now. */
|
|
17
|
+
export interface StoreReport {
|
|
18
|
+
/** What became of the batch. */
|
|
19
|
+
outcome: StoreOutcome;
|
|
20
|
+
/** Records that storage holds after the call. Only one half of a split can be in storage. */
|
|
21
|
+
stored: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resends persisted offline batches on a timer, with backoff, a cross-tab drain lock and
|
|
25
|
+
* batch splitting.
|
|
26
|
+
*/
|
|
27
|
+
export declare class RetryEngine {
|
|
28
|
+
private readonly storage;
|
|
29
|
+
private readonly transport;
|
|
30
|
+
private readonly diagnostics;
|
|
31
|
+
private readonly config;
|
|
32
|
+
private readonly batchesPerDrain;
|
|
33
|
+
private readonly onLoss;
|
|
34
|
+
/** The active retry timer handle, or null when no timer is running. */
|
|
35
|
+
private timer;
|
|
36
|
+
/** Consecutive failed deliveries. Feeds the backoff calculation. */
|
|
37
|
+
private attempt;
|
|
38
|
+
/** True while a storage drain is running. */
|
|
39
|
+
private draining;
|
|
40
|
+
/** True after stop(). */
|
|
41
|
+
private stopped;
|
|
42
|
+
/** Attempt limit for a stored batch. Retention can't change after the delivery stack loads. */
|
|
43
|
+
private readonly maxAttempts;
|
|
44
|
+
/** Runs on the online event. Resets the attempt count and starts a drain. */
|
|
45
|
+
private readonly onOnline;
|
|
46
|
+
/**
|
|
47
|
+
* @param storage Storage adapter holding undelivered batches.
|
|
48
|
+
* @param transport HTTP transport for batch delivery.
|
|
49
|
+
* @param diagnostics Diagnostics reporter.
|
|
50
|
+
* @param config Active configuration instance.
|
|
51
|
+
* @param batchesPerDrain Maximum batches processed per drain tick.
|
|
52
|
+
* @param onLoss Receives the records of every batch that the engine drops.
|
|
53
|
+
*/
|
|
54
|
+
constructor(storage: StorageAdapter, transport: BatchTransport, diagnostics: Diagnostics, config: ResolvedConfig, batchesPerDrain?: number, onLoss?: LossReporter);
|
|
55
|
+
/** Starts the engine. Listens for online events and arms the first timer. */
|
|
56
|
+
start(): void;
|
|
57
|
+
/** Schedules an earlier retry when storage receives a new offline batch. */
|
|
58
|
+
nudge(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Stores a batch that failed outside the drain loop, under the same rules as the drain.
|
|
61
|
+
* A refused batch is never stored whole, because that would cause another request with a
|
|
62
|
+
* payload the server already refused.
|
|
63
|
+
* @param batch Rejected batch, with its attempt already counted.
|
|
64
|
+
* @param error Failure thrown by the transport.
|
|
65
|
+
* @returns What became of the batch, and the records in storage. A storage call that throws
|
|
66
|
+
* or runs past its deadline rejects instead, and the caller reports it.
|
|
67
|
+
*/
|
|
68
|
+
storeFailed(batch: LogBatch, error: unknown): Promise<StoreReport>;
|
|
69
|
+
/** Stops the engine. Removes the listener and clears the pending timer. */
|
|
70
|
+
stop(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Tries one delivery pass over the stored batches before a context change. The caller sets
|
|
73
|
+
* the deadline.
|
|
74
|
+
* @returns Promise that resolves when this pass stops.
|
|
75
|
+
*/
|
|
76
|
+
flush(): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Clears the pending timer, then schedules a drain after the delay.
|
|
79
|
+
* @param delayMs Delay duration in milliseconds.
|
|
80
|
+
*/
|
|
81
|
+
private schedule;
|
|
82
|
+
/**
|
|
83
|
+
* Puts a deadline on a storage call. A call that never settles would keep
|
|
84
|
+
* `draining` true, and this window would run no more drains.
|
|
85
|
+
* @param work Storage promise to bound.
|
|
86
|
+
* @returns The promise's value, or a rejection after the deadline.
|
|
87
|
+
*/
|
|
88
|
+
private bounded;
|
|
89
|
+
/** Clears the pending timer if there is one. */
|
|
90
|
+
private clearTimer;
|
|
91
|
+
/**
|
|
92
|
+
* Calculates the exponential backoff delay from consecutive failures. Uses full jitter
|
|
93
|
+
* instead of a fixed offset, because with a fixed offset tabs that reconnect together send
|
|
94
|
+
* their requests at the same time.
|
|
95
|
+
* @returns Backoff duration in milliseconds.
|
|
96
|
+
*/
|
|
97
|
+
private backoffMs;
|
|
98
|
+
/** Runs a drain under the origin-wide Web Lock. */
|
|
99
|
+
private drain;
|
|
100
|
+
/**
|
|
101
|
+
* Processes batches while holding the Web Lock, and schedules the next tick.
|
|
102
|
+
* It always resolves, because a throw would leave the engine idle with no armed timer.
|
|
103
|
+
* @returns Promise that resolves to true on completion.
|
|
104
|
+
*/
|
|
105
|
+
private drainLocked;
|
|
106
|
+
/**
|
|
107
|
+
* Tries to deliver one batch. Removes it on success, and on failure applies the rule for
|
|
108
|
+
* the failure kind.
|
|
109
|
+
* @param batch Log batch to deliver.
|
|
110
|
+
* @returns "next" to continue with the next batch, "stop" to stop the current drain, or a
|
|
111
|
+
* delay in milliseconds that blocks the batch's kind until the next drain.
|
|
112
|
+
*/
|
|
113
|
+
private deliver;
|
|
114
|
+
/**
|
|
115
|
+
* Replaces a stored batch with whatever survives its failure. That is the split halves,
|
|
116
|
+
* or nothing after a permanent refusal.
|
|
117
|
+
* @param batch Rejected log batch, already held in storage.
|
|
118
|
+
* @param error Failure thrown by the transport.
|
|
119
|
+
*/
|
|
120
|
+
private replaceStored;
|
|
121
|
+
/**
|
|
122
|
+
* Picks the batches to keep after a failure. A 413 response splits the batch in two, a
|
|
123
|
+
* permanent refusal keeps nothing, and any other failure keeps the batch whole.
|
|
124
|
+
* @param batch Rejected log batch.
|
|
125
|
+
* @param error Failure thrown by the transport.
|
|
126
|
+
* @returns Batches to persist. The array is empty when the engine drops the records.
|
|
127
|
+
*/
|
|
128
|
+
private toStorable;
|
|
129
|
+
}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
-
import type { Diagnostics } from "../core/diagnostics";
|
|
2
|
-
import { type LogBatch } from "../models/batch";
|
|
3
|
-
import type { ResolvedConfig } from "../models/config";
|
|
4
|
-
import type { LossReporter } from "../models/drop";
|
|
5
|
-
import { type StorageAdapter } from "../models/storage";
|
|
6
|
-
import type { BatchTransport } from "./status-transport";
|
|
1
|
+
import type { Diagnostics } from "../core/diagnostics.js";
|
|
2
|
+
import { type LogBatch } from "../models/batch.js";
|
|
3
|
+
import type { ResolvedConfig } from "../models/config.js";
|
|
4
|
+
import type { LossReporter } from "../models/drop.js";
|
|
5
|
+
import { type StorageAdapter } from "../models/storage.js";
|
|
6
|
+
import type { BatchTransport } from "./status-transport.js";
|
|
7
|
+
/**
|
|
8
|
+
* What became of a batch whose live send failed. The pipeline picks its report from this, so
|
|
9
|
+
* the report never promises a resend that can't happen.
|
|
10
|
+
* - "stored": storage holds the whole batch, and the drain sends it again.
|
|
11
|
+
* - "split": the server said the batch is too large, and storage holds its two halves.
|
|
12
|
+
* - "rejected": no later send can succeed, so the engine dropped the batch.
|
|
13
|
+
* - "not_stored": storage didn't keep the batch, or kept only one half of a split.
|
|
14
|
+
*/
|
|
15
|
+
export type StoreOutcome = "stored" | "split" | "rejected" | "not_stored";
|
|
16
|
+
/** What storeFailed() did with a batch, and how many of its records storage holds now. */
|
|
17
|
+
export interface StoreReport {
|
|
18
|
+
/** What became of the batch. */
|
|
19
|
+
outcome: StoreOutcome;
|
|
20
|
+
/** Records that storage holds after the call. Only one half of a split can be in storage. */
|
|
21
|
+
stored: number;
|
|
22
|
+
}
|
|
7
23
|
/**
|
|
8
24
|
* Resends persisted offline batches on a timer, with backoff, a cross-tab drain lock and
|
|
9
25
|
* batch splitting.
|
|
@@ -13,7 +29,7 @@ export declare class RetryEngine {
|
|
|
13
29
|
private readonly transport;
|
|
14
30
|
private readonly diagnostics;
|
|
15
31
|
private readonly config;
|
|
16
|
-
private readonly batchesPerDrain
|
|
32
|
+
private readonly batchesPerDrain;
|
|
17
33
|
private readonly onLoss;
|
|
18
34
|
/** The active retry timer handle, or null when no timer is running. */
|
|
19
35
|
private timer;
|
|
@@ -35,7 +51,7 @@ export declare class RetryEngine {
|
|
|
35
51
|
* @param batchesPerDrain Maximum batches processed per drain tick.
|
|
36
52
|
* @param onLoss Receives the records of every batch that the engine drops.
|
|
37
53
|
*/
|
|
38
|
-
constructor(storage: StorageAdapter, transport: BatchTransport, diagnostics: Diagnostics, config: ResolvedConfig, batchesPerDrain?: number
|
|
54
|
+
constructor(storage: StorageAdapter, transport: BatchTransport, diagnostics: Diagnostics, config: ResolvedConfig, batchesPerDrain?: number, onLoss?: LossReporter);
|
|
39
55
|
/** Starts the engine. Listens for online events and arms the first timer. */
|
|
40
56
|
start(): void;
|
|
41
57
|
/** Schedules an earlier retry when storage receives a new offline batch. */
|
|
@@ -46,8 +62,10 @@ export declare class RetryEngine {
|
|
|
46
62
|
* payload the server already refused.
|
|
47
63
|
* @param batch Rejected batch, with its attempt already counted.
|
|
48
64
|
* @param error Failure thrown by the transport.
|
|
65
|
+
* @returns What became of the batch, and the records in storage. A storage call that throws
|
|
66
|
+
* or runs past its deadline rejects instead, and the caller reports it.
|
|
49
67
|
*/
|
|
50
|
-
storeFailed(batch: LogBatch, error: unknown): Promise<
|
|
68
|
+
storeFailed(batch: LogBatch, error: unknown): Promise<StoreReport>;
|
|
51
69
|
/** Stops the engine. Removes the listener and clears the pending timer. */
|
|
52
70
|
stop(): void;
|
|
53
71
|
/**
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { LogRecord } from "../../models/log-record.cjs";
|
|
2
|
+
import type { LogSerializer } from "../../models/serializer.cjs";
|
|
3
|
+
/** An OTLP AnyValue with typed value wrappers. */
|
|
4
|
+
type AnyValue = Record<string, unknown>;
|
|
5
|
+
/** An OTLP KeyValue pair. */
|
|
6
|
+
export interface KeyValue {
|
|
7
|
+
/** The attribute key. */
|
|
8
|
+
key: string;
|
|
9
|
+
/** The typed AnyValue. */
|
|
10
|
+
value: AnyValue;
|
|
11
|
+
}
|
|
12
|
+
/** Records that share the same resource attributes. */
|
|
13
|
+
export interface ResourceGroup {
|
|
14
|
+
/** The resource attribute map. */
|
|
15
|
+
resource: Record<string, unknown>;
|
|
16
|
+
/** The resource's log records. */
|
|
17
|
+
records: LogRecord[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Converts a plain object to an array of OTLP KeyValue pairs.
|
|
21
|
+
* @param source Key-value attribute object.
|
|
22
|
+
* @returns Array of valid KeyValue pairs.
|
|
23
|
+
*/
|
|
24
|
+
export declare function toKeyValues(source: Record<string, unknown>): KeyValue[];
|
|
25
|
+
/**
|
|
26
|
+
* Groups records by their resource attributes, keeping the record order within each group.
|
|
27
|
+
* @param records Records to group.
|
|
28
|
+
* @returns One group per resource.
|
|
29
|
+
*/
|
|
30
|
+
export declare function groupByResource(records: LogRecord[]): ResourceGroup[];
|
|
31
|
+
/** The records of one instrumentation scope. */
|
|
32
|
+
export interface ScopeGroup {
|
|
33
|
+
/** The scope name, which is the logger namespace. */
|
|
34
|
+
name: string;
|
|
35
|
+
/** The scope's records. */
|
|
36
|
+
records: LogRecord[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Groups records by their logger namespace, keeping the record order within each group.
|
|
40
|
+
* A record without a namespace goes to the library's own scope.
|
|
41
|
+
* @param records Records of one resource.
|
|
42
|
+
* @returns One group per namespace.
|
|
43
|
+
*/
|
|
44
|
+
export declare function groupByScope(records: LogRecord[]): ScopeGroup[];
|
|
45
|
+
/** Writes log records as OTLP/JSON payloads. */
|
|
46
|
+
export declare const otlpSerializer: LogSerializer;
|
|
47
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LogRecord } from "../../models/log-record";
|
|
2
|
-
import type { LogSerializer } from "../../models/serializer";
|
|
1
|
+
import type { LogRecord } from "../../models/log-record.js";
|
|
2
|
+
import type { LogSerializer } from "../../models/serializer.js";
|
|
3
3
|
/** An OTLP AnyValue with typed value wrappers. */
|
|
4
4
|
type AnyValue = Record<string, unknown>;
|
|
5
5
|
/** An OTLP KeyValue pair. */
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Diagnostics } from "../../core/diagnostics.cjs";
|
|
2
|
+
import { type LogBatch } from "../../models/batch.cjs";
|
|
3
|
+
import type { BatchKind, ResolvedConfig, SerializerChoice } from "../../models/config.cjs";
|
|
4
|
+
import type { LogSerializer, SerializedBatch } from "../../models/serializer.cjs";
|
|
5
|
+
/**
|
|
6
|
+
* Returns the implementation for a resolved serializer option.
|
|
7
|
+
* @param choice Serializer name, or a custom implementation.
|
|
8
|
+
* @returns Serializer implementation.
|
|
9
|
+
*/
|
|
10
|
+
export declare function serializerFor(choice: SerializerChoice): LogSerializer;
|
|
11
|
+
/**
|
|
12
|
+
* Returns the kind of a batch. Only a batch of metric records goes to metricsEndpoint. A batch
|
|
13
|
+
* of span records is always "traces" and must not go to endpoint as log records. A stored
|
|
14
|
+
* record can be corrupt, and then it is neither a metric nor a span.
|
|
15
|
+
* @param batch Batch to test.
|
|
16
|
+
* @param config Active configuration.
|
|
17
|
+
* @returns "metrics" with metricsEndpoint set and only metric records, "traces" for only span
|
|
18
|
+
* records, else "logs".
|
|
19
|
+
*/
|
|
20
|
+
export declare function batchKind(batch: LogBatch, config: ResolvedConfig): BatchKind;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the endpoint for a batch kind.
|
|
23
|
+
* @param kind Kind of the batch.
|
|
24
|
+
* @param config Active configuration.
|
|
25
|
+
* @returns metricsEndpoint for a metrics batch, tracesEndpoint for a traces batch, else
|
|
26
|
+
* endpoint. null or "" means the batch has no destination.
|
|
27
|
+
*/
|
|
28
|
+
export declare function endpointFor(kind: BatchKind, config: ResolvedConfig): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Serializes a batch. Reports a serializer that throws, and the caller then drops the batch.
|
|
31
|
+
* A metrics batch gets the OTLP metrics format, and a traces batch the OTLP traces format.
|
|
32
|
+
* @param config Active configuration.
|
|
33
|
+
* @param batch Batch to serialize.
|
|
34
|
+
* @param diagnostics Diagnostics reporter.
|
|
35
|
+
* @param message ASD-STE100 sentence for the report.
|
|
36
|
+
* @returns The serialized batch, or undefined if the serializer threw.
|
|
37
|
+
*/
|
|
38
|
+
export declare function serializeBatch(config: ResolvedConfig, batch: LogBatch, diagnostics: Diagnostics, message: string): SerializedBatch | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Diagnostics } from "../../core/diagnostics";
|
|
2
|
-
import { type LogBatch } from "../../models/batch";
|
|
3
|
-
import type { BatchKind, ResolvedConfig, SerializerChoice } from "../../models/config";
|
|
4
|
-
import type { LogSerializer, SerializedBatch } from "../../models/serializer";
|
|
1
|
+
import type { Diagnostics } from "../../core/diagnostics.js";
|
|
2
|
+
import { type LogBatch } from "../../models/batch.js";
|
|
3
|
+
import type { BatchKind, ResolvedConfig, SerializerChoice } from "../../models/config.js";
|
|
4
|
+
import type { LogSerializer, SerializedBatch } from "../../models/serializer.js";
|
|
5
5
|
/**
|
|
6
6
|
* Returns the implementation for a resolved serializer option.
|
|
7
7
|
* @param choice Serializer name, or a custom implementation.
|
|
@@ -23,7 +23,7 @@ export declare function batchKind(batch: LogBatch, config: ResolvedConfig): Batc
|
|
|
23
23
|
* @param kind Kind of the batch.
|
|
24
24
|
* @param config Active configuration.
|
|
25
25
|
* @returns metricsEndpoint for a metrics batch, tracesEndpoint for a traces batch, else
|
|
26
|
-
* endpoint. "" means the batch has no destination.
|
|
26
|
+
* endpoint. null or "" means the batch has no destination.
|
|
27
27
|
*/
|
|
28
28
|
export declare function endpointFor(kind: BatchKind, config: ResolvedConfig): string | null;
|
|
29
29
|
/**
|