@utk09/ui-observability 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -1
- package/README.md +323 -113
- package/bin/uiobs.mjs +1 -1
- package/dist/{batch-BMdT9mKm.js → batch-BjQUwjA6.js} +5 -6
- package/dist/batch-BjQUwjA6.js.map +1 -0
- package/dist/{batch-BHXypM1j.cjs → batch-D5LlU4Q9.cjs} +2 -2
- package/dist/batch-D5LlU4Q9.cjs.map +1 -0
- package/dist/bus/bus.d.ts +48 -47
- package/dist/bus/links.d.ts +4 -4
- package/dist/bus/validation.d.ts +1 -1
- package/dist/bus-D_7pd7RN.cjs +2 -0
- package/dist/bus-D_7pd7RN.cjs.map +1 -0
- package/dist/{bus-DKfBaica.js → bus-ecxUNTja.js} +105 -109
- package/dist/bus-ecxUNTja.js.map +1 -0
- package/dist/capture/console.d.ts +10 -10
- package/dist/capture/errors.d.ts +6 -6
- package/dist/capture/interactions.d.ts +14 -14
- package/dist/capture/lifecycle.d.ts +3 -3
- package/dist/capture/long-frames.d.ts +6 -6
- package/dist/capture/network.d.ts +17 -17
- package/dist/capture/profiler-frames.d.ts +44 -0
- package/dist/capture/replay-buffer.d.ts +46 -0
- package/dist/capture/replay-upload.d.ts +74 -0
- package/dist/capture/replay.d.ts +114 -0
- package/dist/capture/reports.d.ts +2 -2
- package/dist/capture/resource-timing.d.ts +1 -1
- package/dist/capture/server-timing.d.ts +3 -3
- package/dist/capture/storm.d.ts +3 -3
- package/dist/capture/types.d.ts +45 -33
- package/dist/capture/unclean-exit.d.ts +8 -8
- package/dist/capture/user-timing.d.ts +3 -3
- package/dist/capture/web-socket.d.ts +11 -11
- package/dist/capture/web-vitals.d.ts +20 -7
- package/dist/compression-AJJCMBOa.js +11 -0
- package/dist/compression-AJJCMBOa.js.map +1 -0
- package/dist/compression-lD9abCcO.cjs +2 -0
- package/dist/compression-lD9abCcO.cjs.map +1 -0
- package/dist/console-CLz_PvFn.cjs +2 -0
- package/dist/console-CLz_PvFn.cjs.map +1 -0
- package/dist/{console-BX_0UCV7.js → console-cwgHKXvM.js} +14 -15
- package/dist/console-cwgHKXvM.js.map +1 -0
- package/dist/constants-Bwl_YtQi.js +349 -0
- package/dist/constants-Bwl_YtQi.js.map +1 -0
- package/dist/constants-DakMxVB2.cjs +2 -0
- package/dist/constants-DakMxVB2.cjs.map +1 -0
- package/dist/constants.d.ts +150 -103
- package/dist/context-storage-BjzeBSxH.cjs.map +1 -1
- package/dist/{context-storage-DxZf4Gfh.js → context-storage-BzkoHzkQ.js} +2 -3
- package/dist/context-storage-BzkoHzkQ.js.map +1 -0
- package/dist/core/breadcrumbs.d.ts +16 -15
- package/dist/core/config.d.ts +3 -3
- package/dist/core/context.d.ts +7 -7
- package/dist/core/debug-buffer.d.ts +10 -10
- package/dist/core/debug-bundle.d.ts +3 -3
- package/dist/core/deferred.d.ts +2 -2
- package/dist/core/diagnostics.d.ts +24 -21
- package/dist/core/drops.d.ts +7 -7
- package/dist/core/hold-buffer.d.ts +1 -1
- package/dist/core/journey.d.ts +22 -23
- package/dist/core/logger.d.ts +22 -21
- package/dist/core/measure.d.ts +7 -7
- package/dist/core/meter.d.ts +25 -21
- package/dist/core/pipeline.d.ts +42 -41
- package/dist/core/profile-buckets.d.ts +31 -0
- package/dist/core/profiler.d.ts +218 -0
- package/dist/core/record.d.ts +23 -23
- package/dist/core/remote-rules.d.ts +4 -4
- package/dist/core/remote-sampling.d.ts +21 -20
- package/dist/core/runtime.d.ts +206 -137
- package/dist/core/sampling.d.ts +18 -18
- package/dist/core/sender.d.ts +22 -20
- package/dist/core/spans.d.ts +5 -5
- package/dist/{deadline-5_PecIl5.js → deadline-C4ccAuk5.js} +4 -9
- 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-CZZ6SQQh.js → debug-bundle-BOdYmCeV.js} +12 -6
- package/dist/debug-bundle-BOdYmCeV.js.map +1 -0
- package/dist/debug-bundle-Ex4L_LSP.cjs +2 -0
- package/dist/debug-bundle-Ex4L_LSP.cjs.map +1 -0
- package/dist/doctor.cjs +1 -1
- package/dist/doctor.cjs.map +1 -1
- package/dist/doctor.d.ts +16 -6
- package/dist/doctor.js +148 -54
- package/dist/doctor.js.map +1 -1
- package/dist/{emergency-queue-Cs8-i2xw.js → emergency-queue-B9WZxanZ.js} +15 -17
- package/dist/emergency-queue-B9WZxanZ.js.map +1 -0
- package/dist/{emergency-queue-CQ-9acZf.cjs → emergency-queue-HBpL5r3V.cjs} +2 -2
- package/dist/emergency-queue-HBpL5r3V.cjs.map +1 -0
- package/dist/{error-like-Ywo5uRHo.js → error-like-B11pB4aL.js} +2 -3
- package/dist/error-like-B11pB4aL.js.map +1 -0
- package/dist/error-like-gGRx2s36.cjs.map +1 -1
- package/dist/{errors-oyxrpHjY.js → errors-D6bwgJtO.js} +5 -6
- package/dist/errors-D6bwgJtO.js.map +1 -0
- package/dist/{errors-CigX45pL.cjs → errors-DCOCRdSi.cjs} +2 -2
- package/dist/errors-DCOCRdSi.cjs.map +1 -0
- package/dist/{factory-BkjNzPYL.cjs → factory-DLFDjdLv.cjs} +2 -2
- package/dist/factory-DLFDjdLv.cjs.map +1 -0
- package/dist/{factory-Bgsky_e0.js → factory-e9Qo3K0z.js} +18 -22
- package/dist/factory-e9Qo3K0z.js.map +1 -0
- package/dist/fixed-window-CvESpFYV.cjs.map +1 -1
- package/dist/{fixed-window-CtaFHanJ.js → fixed-window-Dq3MLUUv.js} +2 -3
- package/dist/fixed-window-Dq3MLUUv.js.map +1 -0
- package/dist/global-scope-BN-Io_yv.cjs.map +1 -1
- package/dist/{global-scope-dp2jADRl.js → global-scope-D9I8s-oN.js} +2 -3
- package/dist/global-scope-D9I8s-oN.js.map +1 -0
- package/dist/{guards-CpvOpJL6.js → guards-Cidk71ME.js} +2 -3
- package/dist/guards-Cidk71ME.js.map +1 -0
- package/dist/guards-nJ70syPt.cjs.map +1 -1
- package/dist/{identity-BMlKGHUM.cjs → identity-BlvlgjrU.cjs} +2 -2
- package/dist/identity-BlvlgjrU.cjs.map +1 -0
- package/dist/{identity-DOaHdfhT.js → identity-BrQp_5J5.js} +20 -21
- package/dist/identity-BrQp_5J5.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +112 -79
- package/dist/index.js +797 -659
- package/dist/index.js.map +1 -1
- package/dist/{indexeddb-storage-CaXGJqDD.cjs → indexeddb-storage-CtLvZH1r.cjs} +2 -2
- package/dist/indexeddb-storage-CtLvZH1r.cjs.map +1 -0
- package/dist/{indexeddb-storage-D-lUW_5P.js → indexeddb-storage-DLXQzAGh.js} +5 -6
- package/dist/indexeddb-storage-DLXQzAGh.js.map +1 -0
- package/dist/{interactions-CqDNrtIR.js → interactions-B6z2I4tU.js} +10 -11
- package/dist/interactions-B6z2I4tU.js.map +1 -0
- package/dist/{interactions-8DgxtmgO.cjs → interactions-P6pz08Jn.cjs} +2 -2
- package/dist/interactions-P6pz08Jn.cjs.map +1 -0
- package/dist/{journey-DgIjhrIc.js → journey-35yCMNFo.js} +21 -21
- package/dist/journey-35yCMNFo.js.map +1 -0
- package/dist/journey-DAGh5h9k.cjs +2 -0
- package/dist/journey-DAGh5h9k.cjs.map +1 -0
- package/dist/keys-BHhw_0Wh.cjs.map +1 -1
- package/dist/{keys-D5r_GH9q.js → keys-BU9j5YqW.js} +2 -3
- package/dist/keys-BU9j5YqW.js.map +1 -0
- package/dist/{library-console-g_VU-wzP.cjs → library-console-BFWEuQsl.cjs} +2 -2
- package/dist/library-console-BFWEuQsl.cjs.map +1 -0
- package/dist/library-console-Dl_Ly6DQ.js +13 -0
- package/dist/library-console-Dl_Ly6DQ.js.map +1 -0
- package/dist/{library-request-FQaiWjCP.cjs → library-request-Da-CHKzT.cjs} +2 -2
- package/dist/library-request-Da-CHKzT.cjs.map +1 -0
- package/dist/{library-request-CyC-9IOk.js → library-request-nI6pvI6I.js} +4 -5
- package/dist/library-request-nI6pvI6I.js.map +1 -0
- package/dist/{lifecycle-C2z_d8OX.cjs → lifecycle-BGGOcN4N.cjs} +2 -2
- package/dist/lifecycle-BGGOcN4N.cjs.map +1 -0
- package/dist/{lifecycle-BLC4VU7c.js → lifecycle-CZ6RRXc6.js} +3 -4
- package/dist/lifecycle-CZ6RRXc6.js.map +1 -0
- package/dist/{log-record-DKvo-B-d.cjs → log-record-D7bA1RPb.cjs} +2 -2
- package/dist/log-record-D7bA1RPb.cjs.map +1 -0
- package/dist/{log-record-CndanC-p.js → log-record-DIA6McNr.js} +3 -4
- package/dist/log-record-DIA6McNr.js.map +1 -0
- package/dist/{long-frames-BQef9rXR.js → long-frames-430_85Da.js} +9 -8
- package/dist/long-frames-430_85Da.js.map +1 -0
- package/dist/long-frames-Dd8tsi2U.cjs +2 -0
- package/dist/long-frames-Dd8tsi2U.cjs.map +1 -0
- package/dist/models/batch.d.ts +14 -15
- package/dist/models/bus.d.ts +24 -24
- package/dist/models/config.d.ts +402 -216
- package/dist/models/drop.d.ts +13 -11
- package/dist/models/health.d.ts +13 -13
- package/dist/models/log-record.d.ts +13 -14
- package/dist/models/metric.d.ts +82 -17
- package/dist/models/plugin.d.ts +13 -13
- package/dist/models/replay.d.ts +60 -0
- package/dist/models/serializer.d.ts +2 -3
- package/dist/models/stats.d.ts +2 -2
- package/dist/models/storage.d.ts +12 -11
- package/dist/{network-CvkvYzRU.js → network-C7SkLf4v.js} +30 -32
- package/dist/network-C7SkLf4v.js.map +1 -0
- package/dist/{network-CqnQOqon.cjs → network-pEX3PAJv.cjs} +2 -2
- package/dist/network-pEX3PAJv.cjs.map +1 -0
- package/dist/openfin-Bxelt0yg.js +7 -0
- package/dist/openfin-Bxelt0yg.js.map +1 -0
- package/dist/openfin-DtH2f7zX.cjs.map +1 -1
- package/dist/otlp-2MCrC3kd.cjs +2 -0
- package/dist/otlp-2MCrC3kd.cjs.map +1 -0
- package/dist/{otlp-CYIL7MOE.js → otlp-COq033e3.js} +26 -35
- package/dist/otlp-COq033e3.js.map +1 -0
- package/dist/patch-BX8KrPCT.cjs.map +1 -1
- package/dist/{patch-CCWfuEY7.js → patch-UdPz1ea8.js} +2 -3
- package/dist/patch-UdPz1ea8.js.map +1 -0
- package/dist/{platform-KMWkoI-v.cjs → platform-12uR7kBQ.cjs} +2 -2
- package/dist/platform-12uR7kBQ.cjs.map +1 -0
- package/dist/{platform-wcAkkv9F.js → platform-CVewe4wQ.js} +9 -10
- package/dist/platform-CVewe4wQ.js.map +1 -0
- package/dist/profiler-BVWIOgnq.js +310 -0
- package/dist/profiler-BVWIOgnq.js.map +1 -0
- package/dist/profiler-eVCknCzS.cjs +2 -0
- package/dist/profiler-eVCknCzS.cjs.map +1 -0
- package/dist/profiler-frames-CLXlT_xL.js +86 -0
- package/dist/profiler-frames-CLXlT_xL.js.map +1 -0
- package/dist/profiler-frames-Dg2OebB2.cjs +2 -0
- package/dist/profiler-frames-Dg2OebB2.cjs.map +1 -0
- package/dist/{remote-rules-CH_7PphT.js → remote-rules-BJGDJGwA.js} +29 -30
- package/dist/remote-rules-BJGDJGwA.js.map +1 -0
- package/dist/{remote-rules-BL8km4xk.cjs → remote-rules-CJD3ToVk.cjs} +2 -2
- package/dist/remote-rules-CJD3ToVk.cjs.map +1 -0
- package/dist/replay-0zAJv9T3.js +338 -0
- package/dist/replay-0zAJv9T3.js.map +1 -0
- package/dist/replay-DomJpXqW.cjs +2 -0
- package/dist/replay-DomJpXqW.cjs.map +1 -0
- package/dist/{reports-Bh_-KpZ2.cjs → reports-BsbqmP8h.cjs} +2 -2
- package/dist/reports-BsbqmP8h.cjs.map +1 -0
- package/dist/{reports-BOKyY3_A.js → reports-BuXekPOS.js} +4 -5
- package/dist/reports-BuXekPOS.js.map +1 -0
- package/dist/{resource-timing-BROnEJ0E.js → resource-timing-CXGHwFRD.js} +6 -7
- package/dist/resource-timing-CXGHwFRD.js.map +1 -0
- package/dist/{resource-timing-CbgwNpog.cjs → resource-timing-DkycFGDa.cjs} +2 -2
- package/dist/resource-timing-DkycFGDa.cjs.map +1 -0
- package/dist/{sampling-ECGVYiDD.cjs → sampling-Dd0wllyq.cjs} +2 -2
- package/dist/sampling-Dd0wllyq.cjs.map +1 -0
- package/dist/{sampling-BLO_pcV4.js → sampling-UUDbi3K0.js} +11 -12
- package/dist/sampling-UUDbi3K0.js.map +1 -0
- package/dist/{sanitize-DS0G4_ea.js → sanitize-CNmsD9r3.js} +4 -5
- package/dist/sanitize-CNmsD9r3.js.map +1 -0
- package/dist/{sanitize-Bsn8HQWC.cjs → sanitize-ChLn97Ch.cjs} +2 -2
- package/dist/sanitize-ChLn97Ch.cjs.map +1 -0
- package/dist/{select-DWO0-w8_.cjs → select-CTk-K5mG.cjs} +3 -3
- package/dist/select-CTk-K5mG.cjs.map +1 -0
- package/dist/{select-wqt9Wxio.js → select-DPv_j6wq.js} +64 -67
- package/dist/select-DPv_j6wq.js.map +1 -0
- package/dist/{sender-BkAVt-Rq.js → sender-15zEsZpr.js} +98 -101
- package/dist/sender-15zEsZpr.js.map +1 -0
- package/dist/sender-Bfpv9tad.cjs +2 -0
- package/dist/sender-Bfpv9tad.cjs.map +1 -0
- package/dist/storage/context-storage.d.ts +34 -33
- package/dist/storage/emergency-queue.d.ts +9 -9
- package/dist/storage/eviction.d.ts +12 -12
- package/dist/storage/factory.d.ts +8 -7
- package/dist/storage/gap.d.ts +6 -6
- package/dist/storage/idb-driver.d.ts +31 -32
- package/dist/storage/indexeddb-storage.d.ts +26 -27
- package/dist/storage/keys.d.ts +7 -7
- package/dist/storage/local-storage.d.ts +38 -38
- package/dist/storage/memory-storage.d.ts +21 -22
- package/dist/storage/persistence.d.ts +1 -1
- package/dist/storage-BA9RqRO-.cjs.map +1 -1
- package/dist/{storage-w7Tslvlq.js → storage-DZwed89z.js} +2 -3
- package/dist/storage-DZwed89z.js.map +1 -0
- package/dist/{storm-DD4cUkoL.js → storm-BTSNTIWI.js} +4 -5
- package/dist/storm-BTSNTIWI.js.map +1 -0
- package/dist/{storm-DCEsqViG.cjs → storm-D0_qZOEg.cjs} +2 -2
- package/dist/storm-D0_qZOEg.cjs.map +1 -0
- package/dist/transport/compression.d.ts +2 -2
- package/dist/transport/errors.d.ts +7 -7
- package/dist/transport/exit-flush.d.ts +39 -39
- package/dist/transport/headers.d.ts +2 -2
- package/dist/transport/http-transport.d.ts +28 -27
- package/dist/transport/memory-transport.d.ts +6 -6
- package/dist/transport/retry-engine.d.ts +35 -34
- package/dist/transport/serializers/ecs.d.ts +1 -1
- package/dist/transport/serializers/otlp-metrics.d.ts +1 -1
- package/dist/transport/serializers/otlp-traces.d.ts +1 -1
- package/dist/transport/serializers/otlp.d.ts +16 -16
- package/dist/transport/serializers/select.d.ts +7 -7
- package/dist/transport/status-transport.d.ts +20 -20
- package/dist/transport/worker-protocol.d.ts +3 -3
- package/dist/{types-BR9t_w28.js → types-BAerHgCq.js} +2 -3
- package/dist/types-BAerHgCq.js.map +1 -0
- package/dist/types-C7WNpnG1.cjs.map +1 -1
- package/dist/{unclean-exit-CwdpbUDg.cjs → unclean-exit-ClGzrc2A.cjs} +2 -2
- package/dist/unclean-exit-ClGzrc2A.cjs.map +1 -0
- package/dist/{unclean-exit-BYZ5yaSI.js → unclean-exit-Cob_jyTv.js} +3 -4
- package/dist/unclean-exit-Cob_jyTv.js.map +1 -0
- package/dist/unref-CU9Nyz_9.cjs +2 -0
- package/dist/unref-CU9Nyz_9.cjs.map +1 -0
- package/dist/unref-DgHPQeWv.js +7 -0
- package/dist/unref-DgHPQeWv.js.map +1 -0
- package/dist/user-timing-CdYqx3PF.cjs +2 -0
- package/dist/user-timing-CdYqx3PF.cjs.map +1 -0
- package/dist/{user-timing-Di2ra5DB.js → user-timing-DgHubxCI.js} +7 -6
- package/dist/user-timing-DgHubxCI.js.map +1 -0
- package/dist/utils/console.d.ts +2 -2
- package/dist/utils/deadline.d.ts +4 -4
- package/dist/utils/error-like.d.ts +7 -7
- package/dist/utils/fixed-window.d.ts +9 -8
- package/dist/utils/global-scope.d.ts +8 -8
- package/dist/utils/guards.d.ts +2 -2
- package/dist/utils/identity.d.ts +17 -17
- package/dist/utils/library-console.d.ts +4 -4
- package/dist/utils/library-request.d.ts +10 -10
- package/dist/utils/lock.d.ts +10 -9
- package/dist/utils/openfin.d.ts +5 -5
- package/dist/utils/patch.d.ts +6 -6
- package/dist/utils/platform.d.ts +13 -11
- package/dist/utils/sanitize.d.ts +4 -4
- package/dist/utils/timer.d.ts +1 -1
- package/dist/utils/tracing.d.ts +38 -38
- package/dist/utils/unref.d.ts +3 -3
- package/dist/{web-socket-DwBNhgre.cjs → web-socket-BTuvYoJI.cjs} +2 -2
- package/dist/web-socket-BTuvYoJI.cjs.map +1 -0
- package/dist/{web-socket-B-5qqPy7.js → web-socket-DthJuSAg.js} +14 -15
- package/dist/web-socket-DthJuSAg.js.map +1 -0
- package/dist/web-vitals-Ch5BpDmo.cjs +2 -0
- package/dist/web-vitals-Ch5BpDmo.cjs.map +1 -0
- package/dist/web-vitals-CsGCWnUr.js +77 -0
- package/dist/web-vitals-CsGCWnUr.js.map +1 -0
- package/dist/{worker-protocol-0HMf4-kY.js → worker-protocol-B0_8rWy5.js} +6 -7
- package/dist/worker-protocol-B0_8rWy5.js.map +1 -0
- package/dist/{worker-protocol-DXekoADQ.cjs → worker-protocol-BjzFORfq.cjs} +2 -2
- package/dist/worker-protocol-BjzFORfq.cjs.map +1 -0
- package/dist/worker-server-4en-Lt-3.cjs +2 -0
- package/dist/worker-server-4en-Lt-3.cjs.map +1 -0
- package/dist/{worker-server-CKcmX5m5.js → worker-server-Cne9MX9I.js} +25 -26
- package/dist/{worker-server-CKcmX5m5.js.map → worker-server-Cne9MX9I.js.map} +1 -1
- package/dist/worker-transport-B-GF4Aqn.cjs +2 -0
- package/dist/worker-transport-B-GF4Aqn.cjs.map +1 -0
- package/dist/{worker-transport-2220ghFZ.js → worker-transport-C3SjJAEC.js} +64 -65
- package/dist/worker-transport-C3SjJAEC.js.map +1 -0
- package/package.json +33 -41
- package/dist/batch-BHXypM1j.cjs.map +0 -1
- package/dist/batch-BMdT9mKm.js.map +0 -1
- package/dist/bus-DKfBaica.js.map +0 -1
- package/dist/bus-Dea9rVhy.cjs +0 -2
- package/dist/bus-Dea9rVhy.cjs.map +0 -1
- package/dist/console-BX_0UCV7.js.map +0 -1
- package/dist/console-DZEcs7FL.cjs +0 -2
- package/dist/console-DZEcs7FL.cjs.map +0 -1
- package/dist/constants-CL0ZdI2f.cjs +0 -2
- package/dist/constants-CL0ZdI2f.cjs.map +0 -1
- package/dist/constants-CU60FG4w.js +0 -305
- package/dist/constants-CU60FG4w.js.map +0 -1
- package/dist/context-storage-DxZf4Gfh.js.map +0 -1
- package/dist/deadline-5_PecIl5.js.map +0 -1
- package/dist/deadline-XSnm95pg.cjs +0 -2
- package/dist/deadline-XSnm95pg.cjs.map +0 -1
- package/dist/debug-bundle-CZZ6SQQh.js.map +0 -1
- package/dist/debug-bundle-yRkrU1ny.cjs +0 -2
- package/dist/debug-bundle-yRkrU1ny.cjs.map +0 -1
- package/dist/emergency-queue-CQ-9acZf.cjs.map +0 -1
- package/dist/emergency-queue-Cs8-i2xw.js.map +0 -1
- package/dist/error-like-Ywo5uRHo.js.map +0 -1
- package/dist/errors-CigX45pL.cjs.map +0 -1
- package/dist/errors-oyxrpHjY.js.map +0 -1
- package/dist/factory-Bgsky_e0.js.map +0 -1
- package/dist/factory-BkjNzPYL.cjs.map +0 -1
- package/dist/fixed-window-CtaFHanJ.js.map +0 -1
- package/dist/global-scope-dp2jADRl.js.map +0 -1
- package/dist/guards-CpvOpJL6.js.map +0 -1
- package/dist/identity-BMlKGHUM.cjs.map +0 -1
- package/dist/identity-DOaHdfhT.js.map +0 -1
- package/dist/indexeddb-storage-CaXGJqDD.cjs.map +0 -1
- package/dist/indexeddb-storage-D-lUW_5P.js.map +0 -1
- package/dist/interactions-8DgxtmgO.cjs.map +0 -1
- package/dist/interactions-CqDNrtIR.js.map +0 -1
- package/dist/journey-5tcxEbnG.cjs +0 -2
- package/dist/journey-5tcxEbnG.cjs.map +0 -1
- package/dist/journey-DgIjhrIc.js.map +0 -1
- package/dist/keys-D5r_GH9q.js.map +0 -1
- package/dist/library-console-CabK2j2-.js +0 -14
- package/dist/library-console-CabK2j2-.js.map +0 -1
- package/dist/library-console-g_VU-wzP.cjs.map +0 -1
- package/dist/library-request-CyC-9IOk.js.map +0 -1
- package/dist/library-request-FQaiWjCP.cjs.map +0 -1
- package/dist/lifecycle-BLC4VU7c.js.map +0 -1
- package/dist/lifecycle-C2z_d8OX.cjs.map +0 -1
- package/dist/log-record-CndanC-p.js.map +0 -1
- package/dist/log-record-DKvo-B-d.cjs.map +0 -1
- package/dist/long-frames-BQef9rXR.js.map +0 -1
- package/dist/long-frames-CV5ZG2cx.cjs +0 -2
- package/dist/long-frames-CV5ZG2cx.cjs.map +0 -1
- package/dist/network-CqnQOqon.cjs.map +0 -1
- package/dist/network-CvkvYzRU.js.map +0 -1
- package/dist/openfin-BwEN0uj4.js +0 -8
- package/dist/openfin-BwEN0uj4.js.map +0 -1
- package/dist/otlp-CYIL7MOE.js.map +0 -1
- package/dist/otlp-RVbkNQRh.cjs +0 -2
- package/dist/otlp-RVbkNQRh.cjs.map +0 -1
- package/dist/patch-CCWfuEY7.js.map +0 -1
- package/dist/platform-KMWkoI-v.cjs.map +0 -1
- package/dist/platform-wcAkkv9F.js.map +0 -1
- package/dist/remote-rules-BL8km4xk.cjs.map +0 -1
- package/dist/remote-rules-CH_7PphT.js.map +0 -1
- package/dist/reports-BOKyY3_A.js.map +0 -1
- package/dist/reports-Bh_-KpZ2.cjs.map +0 -1
- package/dist/resource-timing-BROnEJ0E.js.map +0 -1
- package/dist/resource-timing-CbgwNpog.cjs.map +0 -1
- package/dist/sampling-BLO_pcV4.js.map +0 -1
- package/dist/sampling-ECGVYiDD.cjs.map +0 -1
- package/dist/sanitize-Bsn8HQWC.cjs.map +0 -1
- package/dist/sanitize-DS0G4_ea.js.map +0 -1
- package/dist/select-DWO0-w8_.cjs.map +0 -1
- package/dist/select-wqt9Wxio.js.map +0 -1
- package/dist/sender-BkAVt-Rq.js.map +0 -1
- package/dist/sender-D82PxlCY.cjs +0 -2
- package/dist/sender-D82PxlCY.cjs.map +0 -1
- package/dist/storage-w7Tslvlq.js.map +0 -1
- package/dist/storm-DCEsqViG.cjs.map +0 -1
- package/dist/storm-DD4cUkoL.js.map +0 -1
- package/dist/types-BR9t_w28.js.map +0 -1
- package/dist/unclean-exit-BYZ5yaSI.js.map +0 -1
- package/dist/unclean-exit-CwdpbUDg.cjs.map +0 -1
- package/dist/user-timing-C1kB3JEg.cjs +0 -2
- package/dist/user-timing-C1kB3JEg.cjs.map +0 -1
- package/dist/user-timing-Di2ra5DB.js.map +0 -1
- package/dist/web-socket-B-5qqPy7.js.map +0 -1
- package/dist/web-socket-DwBNhgre.cjs.map +0 -1
- package/dist/web-vitals-Bflr5jSA.js +0 -53
- package/dist/web-vitals-Bflr5jSA.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-0HMf4-kY.js.map +0 -1
- package/dist/worker-protocol-DXekoADQ.cjs.map +0 -1
- package/dist/worker-server-BQK5z2yl.cjs +0 -2
- package/dist/worker-server-BQK5z2yl.cjs.map +0 -1
- package/dist/worker-transport-2220ghFZ.js.map +0 -1
- package/dist/worker-transport-Dj2yCQN5.cjs +0 -2
- package/dist/worker-transport-Dj2yCQN5.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Compresses a string to gzip bytes with CompressionStream. The result is a
|
|
3
|
-
* Uint8Array on a non-shared ArrayBuffer
|
|
3
|
+
* Uint8Array on a non-shared ArrayBuffer, which fetch accepts as BodyInit.
|
|
4
4
|
* @param text Raw serialized payload to compress.
|
|
5
|
-
* @returns Promise that resolves to the gzip bytes, or null
|
|
5
|
+
* @returns Promise that resolves to the gzip bytes, or null when there is no CompressionStream.
|
|
6
6
|
*/
|
|
7
7
|
export declare function gzip(text: string): Promise<Uint8Array<ArrayBuffer> | null>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The failure kind
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* never
|
|
2
|
+
* The failure kind decides whether the engine retries, backs off or drops. Transient, offline
|
|
3
|
+
* and timeout failures are retried with backoff. A throttled failure waits for the server's
|
|
4
|
+
* delay, and a too_large failure splits the batch. A permanent failure is dropped, because the
|
|
5
|
+
* server will never accept that batch.
|
|
6
6
|
*/
|
|
7
7
|
export type TransportFailureKind = "transient" | "throttled" | "too_large" | "permanent" | "timeout" | "offline";
|
|
8
|
-
/**
|
|
8
|
+
/** A failed transport attempt, with its failure kind and metadata. */
|
|
9
9
|
export declare class TransportError extends Error {
|
|
10
10
|
readonly kind: TransportFailureKind;
|
|
11
11
|
readonly status?: number | undefined;
|
|
@@ -23,8 +23,8 @@ export declare class TransportError extends Error {
|
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Parses an HTTP Retry-After value into a delay in milliseconds. The value
|
|
26
|
-
* can be a number of seconds or an HTTP date.
|
|
27
|
-
*
|
|
26
|
+
* can be a number of seconds or an HTTP date. A date in the past gives a negative delay,
|
|
27
|
+
* which is clamped to zero.
|
|
28
28
|
* @param header Raw Retry-After header string or null.
|
|
29
29
|
* @returns Non-negative delay in milliseconds, or undefined if invalid or missing.
|
|
30
30
|
*/
|
|
@@ -2,61 +2,61 @@ import type { Diagnostics } from "../core/diagnostics";
|
|
|
2
2
|
import type { LogBatch } from "../models/batch";
|
|
3
3
|
import type { ResolvedConfig } from "../models/config";
|
|
4
4
|
import type { LossReporter } from "../models/drop";
|
|
5
|
-
/**
|
|
5
|
+
/** The lifecycle event or manual action that starts an exit flush. */
|
|
6
6
|
export type ExitReason = "hidden" | "pagehide" | "freeze" | "openfin-close" | "shutdown";
|
|
7
|
-
/**
|
|
7
|
+
/** Dependencies of ExitFlush. */
|
|
8
8
|
export interface ExitFlushDeps {
|
|
9
|
-
/**
|
|
9
|
+
/** The active configuration. */
|
|
10
10
|
config: ResolvedConfig;
|
|
11
|
-
/**
|
|
11
|
+
/** Diagnostics reporter. */
|
|
12
12
|
diagnostics: Diagnostics;
|
|
13
|
-
/**
|
|
13
|
+
/** Drains all buffered and unconfirmed records into one batch per kind. */
|
|
14
14
|
drainForExit: () => LogBatch[];
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* It
|
|
16
|
+
* Runs a normal flush with headers, gzip and retry. Used for a hidden document.
|
|
17
|
+
* It doesn't touch an in-flight batch.
|
|
18
18
|
*/
|
|
19
19
|
flushAlive: () => void | Promise<void>;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
21
|
+
* Returns the headers that the HTTP transport sent last, or undefined. sendBeacon can't set
|
|
22
|
+
* a header, so when there are headers the exit flush uses a keepalive fetch.
|
|
23
23
|
*/
|
|
24
24
|
exitHeaders: () => Record<string, string> | undefined;
|
|
25
|
-
/**
|
|
25
|
+
/** Receives the records that the exit flush loses. */
|
|
26
26
|
onLoss?: LossReporter;
|
|
27
|
-
/**
|
|
27
|
+
/** Pushes the open metric interval's points into the buffers. */
|
|
28
28
|
beforeExit?: () => void;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* Flushes pending telemetry on document unload, with sendBeacon, a keepalive fetch or
|
|
32
|
+
* emergency storage.
|
|
33
33
|
*/
|
|
34
34
|
export declare class ExitFlush {
|
|
35
35
|
private readonly deps;
|
|
36
|
-
/**
|
|
36
|
+
/** True while we are listening for the unload events. */
|
|
37
37
|
private installed;
|
|
38
|
-
/** Bytes
|
|
38
|
+
/** Bytes used by the current exit flush's keepalive fetches. All batches share one budget. */
|
|
39
39
|
private keepaliveBytes;
|
|
40
|
-
/**
|
|
40
|
+
/** Flushes on visibilitychange when the document becomes hidden. */
|
|
41
41
|
private readonly onVisibility;
|
|
42
|
-
/**
|
|
42
|
+
/** Flushes on the window's pagehide event. */
|
|
43
43
|
private readonly onPageHide;
|
|
44
|
-
/**
|
|
44
|
+
/** Flushes on the document's freeze event. */
|
|
45
45
|
private readonly onFreeze;
|
|
46
|
-
/**
|
|
46
|
+
/** Flushes on the OpenFin close-requested event. */
|
|
47
47
|
private readonly onOpenFinClose;
|
|
48
48
|
/**
|
|
49
49
|
* @param deps Injected configuration, diagnostics, and drain callback.
|
|
50
50
|
*/
|
|
51
51
|
constructor(deps: ExitFlushDeps);
|
|
52
|
-
/**
|
|
52
|
+
/** Attaches the unload listeners to the document, the window and OpenFin. */
|
|
53
53
|
install(): void;
|
|
54
|
-
/**
|
|
54
|
+
/** Removes all unload listeners and subscriptions. */
|
|
55
55
|
uninstall(): void;
|
|
56
56
|
/**
|
|
57
|
-
* Drains pending records synchronously
|
|
58
|
-
*
|
|
59
|
-
*
|
|
57
|
+
* Drains pending records synchronously and sends them with a beacon, a keepalive fetch or
|
|
58
|
+
* emergency storage. A hidden document gets a normal flush. Never awaits and never throws,
|
|
59
|
+
* because the caller is an unload listener.
|
|
60
60
|
* @param reason Reason code of the flush.
|
|
61
61
|
*/
|
|
62
62
|
flush(reason: ExitReason): void;
|
|
@@ -67,24 +67,24 @@ export declare class ExitFlush {
|
|
|
67
67
|
* @param url Endpoint of the batch.
|
|
68
68
|
*/
|
|
69
69
|
private flushBatch;
|
|
70
|
-
/** Runs
|
|
70
|
+
/** Runs a hidden document's normal flush, and reports it if it throws or rejects. */
|
|
71
71
|
private flushAlive;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
74
|
-
* wait for the async transport. Without a hook, or when the hook refuses the batch, the
|
|
75
|
-
* goes to the emergency queue
|
|
73
|
+
* Hands the pending records to a custom transport's exit hook, because a closing page can't
|
|
74
|
+
* wait for the async transport. Without a hook, or when the hook refuses the batch, the
|
|
75
|
+
* batch goes to the emergency queue and the next page load sends it.
|
|
76
76
|
* @param reason Reason code of the flush.
|
|
77
|
-
* @param onExit
|
|
77
|
+
* @param onExit The custom transport's synchronous exit hook.
|
|
78
78
|
*/
|
|
79
79
|
private flushCustom;
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
82
|
-
* "memory" or "none"
|
|
83
|
-
* @param batch Batch that the exit flush
|
|
81
|
+
* Parks a batch in the localStorage emergency queue for the next page load. With storage
|
|
82
|
+
* "memory" or "none" the app wants nothing kept on the device, so the batch is lost.
|
|
83
|
+
* @param batch Batch that the exit flush can't send.
|
|
84
84
|
*/
|
|
85
85
|
private park;
|
|
86
86
|
/**
|
|
87
|
-
* Serializes the exit batch
|
|
87
|
+
* Serializes the exit batch, and reports a serializer that throws.
|
|
88
88
|
* @param batch Batch to serialize.
|
|
89
89
|
* @param reason Reason code of the flush.
|
|
90
90
|
* @returns The serialized batch, or undefined if the serializer threw.
|
|
@@ -99,19 +99,19 @@ export declare class ExitFlush {
|
|
|
99
99
|
* Sends the payload as text/plain with navigator.sendBeacon.
|
|
100
100
|
* @param url Target endpoint URL with query parameters.
|
|
101
101
|
* @param body Serialized payload string.
|
|
102
|
-
* @returns The answer
|
|
102
|
+
* @returns The browser's answer.
|
|
103
103
|
*/
|
|
104
104
|
private beacon;
|
|
105
105
|
/**
|
|
106
|
-
* Sends a fallback POST with fetch and `keepalive: true`. A keepalive request
|
|
107
|
-
*
|
|
108
|
-
* A failed fetch parks the batch in the emergency queue
|
|
109
|
-
* its batch id.
|
|
106
|
+
* Sends a fallback POST with fetch and `keepalive: true`. A keepalive request continues
|
|
107
|
+
* after the document closes, whereas the browser cancels a plain fetch at page close.
|
|
108
|
+
* A failed fetch parks the batch in the emergency queue, and the server drops a second copy
|
|
109
|
+
* by its batch id.
|
|
110
110
|
* @param url Target endpoint URL.
|
|
111
111
|
* @param batch Batch in the payload.
|
|
112
112
|
* @param body Serialized payload string.
|
|
113
113
|
* @param reason Reason code of the flush.
|
|
114
|
-
* @param headers Builds the request headers. Without custom headers
|
|
114
|
+
* @param headers Builds the request headers. Without custom headers that is only a text/plain
|
|
115
115
|
* content type. A header value outside ISO-8859-1 makes the Headers constructor throw.
|
|
116
116
|
*/
|
|
117
117
|
private keepaliveFetch;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Diagnostics } from "../core/diagnostics";
|
|
2
2
|
import type { ResolvedConfig } from "../models/config";
|
|
3
|
-
/**
|
|
3
|
+
/** Returns the last headers, but only while their source and all destinations are unchanged. */
|
|
4
4
|
export declare function lastHeaders(owner: object, config: ResolvedConfig): Record<string, string> | undefined;
|
|
5
5
|
/** Resolves a headers function on the main thread and keeps its result for the exit flush. */
|
|
6
6
|
export declare function resolveHeaders(owner: object, config: ResolvedConfig, diagnostics: Diagnostics): Promise<Record<string, string>>;
|
|
7
|
-
/**
|
|
7
|
+
/** Forgets rejected credentials before the headers function is called again. */
|
|
8
8
|
export declare function resetHeaders(owner: object): void;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import type { LogBatch } from "../models/batch";
|
|
2
2
|
import { StatusTransport } from "./status-transport";
|
|
3
|
-
/** Advice for a 401 or a 403
|
|
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
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Sends serialized log batches over HTTP. Resolves headers, applies gzip compression and
|
|
7
|
+
* classifies errors.
|
|
8
8
|
*/
|
|
9
9
|
export declare class HttpTransport extends StatusTransport {
|
|
10
10
|
/**
|
|
11
|
-
* Sends one log batch over HTTP. A metrics batch goes to metricsEndpoint
|
|
12
|
-
* tracesEndpoint. A batch without an endpoint goes nowhere.
|
|
11
|
+
* Sends one log batch over HTTP. A metrics batch goes to metricsEndpoint and a traces batch
|
|
12
|
+
* to tracesEndpoint. A batch without an endpoint goes nowhere.
|
|
13
13
|
* @param batch Batch to send.
|
|
14
|
-
* @param onKeepalive Runs when
|
|
14
|
+
* @param onKeepalive Runs when one of the batch's requests starts with keepalive.
|
|
15
15
|
* @throws TransportError on transient, throttled, 413, or permanent network failures.
|
|
16
16
|
*/
|
|
17
17
|
send(batch: LogBatch, onKeepalive?: () => void): Promise<void>;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @returns The static headers, the
|
|
19
|
+
* Returns the headers for the exit flush, because a closing document can't await headers().
|
|
20
|
+
* @returns The static headers, the last result of the current headers function, or undefined.
|
|
21
21
|
*/
|
|
22
22
|
lastHeaders(): Record<string, string> | undefined;
|
|
23
23
|
/**
|
|
24
|
-
* Serializes, encodes and sends a batch.
|
|
24
|
+
* Serializes, encodes and sends a batch. Throws a classified TransportError
|
|
25
25
|
* on failure.
|
|
26
26
|
* @param batch Batch to deliver.
|
|
27
|
-
* @param kind Kind of the batch. The caller reads it with the endpoint.
|
|
28
|
-
* @param endpoint Ingest URL. The caller reads it
|
|
29
|
-
*
|
|
30
|
-
* @param onKeepalive Runs when
|
|
27
|
+
* @param kind Kind of the batch. The caller reads it together with the endpoint.
|
|
28
|
+
* @param endpoint Ingest URL. The caller reads it once, so a reconfigure during the send
|
|
29
|
+
* can't change it.
|
|
30
|
+
* @param onKeepalive Runs when one of the batch's requests starts with keepalive.
|
|
31
31
|
*/
|
|
32
32
|
private post;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Checks whether a status rejects the credentials.
|
|
35
35
|
* @param status HTTP status code.
|
|
36
36
|
* @returns True for 401 and 403.
|
|
37
37
|
*/
|
|
38
38
|
private rejectsCredentials;
|
|
39
39
|
/**
|
|
40
|
-
* Resolves the headers, encodes the body and sends one request. One deadline covers
|
|
41
|
-
* three steps
|
|
40
|
+
* Resolves the headers, encodes the body and sends one request. One deadline covers all
|
|
41
|
+
* three steps, otherwise a headers() that never settles holds a dispatch slot forever.
|
|
42
42
|
* @param batch Batch to deliver.
|
|
43
43
|
* @param endpoint Ingest URL.
|
|
44
44
|
* @param serialized Serialized batch.
|
|
@@ -49,10 +49,10 @@ export declare class HttpTransport extends StatusTransport {
|
|
|
49
49
|
private attempt;
|
|
50
50
|
/**
|
|
51
51
|
* Waits for a step until the deadline.
|
|
52
|
-
* @param work Step to wait for. It
|
|
52
|
+
* @param work Step to wait for. It never rejects, so only the deadline rejects here.
|
|
53
53
|
* @param deadline Epoch time in milliseconds at which the request times out.
|
|
54
54
|
* @param endpoint Ingest URL of the request, for the timeout report.
|
|
55
|
-
* @returns Promise that resolves to the value
|
|
55
|
+
* @returns Promise that resolves to the step's value.
|
|
56
56
|
* @throws TransportError of kind "timeout" at the deadline.
|
|
57
57
|
*/
|
|
58
58
|
private before;
|
|
@@ -63,14 +63,14 @@ export declare class HttpTransport extends StatusTransport {
|
|
|
63
63
|
*/
|
|
64
64
|
private timeout;
|
|
65
65
|
/**
|
|
66
|
-
* Compresses the serialized payload when the config sets gzip
|
|
67
|
-
*
|
|
66
|
+
* Compresses the serialized payload when the config sets gzip and the payload is at or
|
|
67
|
+
* above the threshold.
|
|
68
68
|
* @param text Serialized payload string.
|
|
69
|
-
* @returns Promise that resolves to original string or compressed byte array.
|
|
69
|
+
* @returns Promise that resolves to the original string or the compressed byte array.
|
|
70
70
|
*/
|
|
71
71
|
private encodeBody;
|
|
72
72
|
/**
|
|
73
|
-
* Sends the HTTP POST request with a timeout
|
|
73
|
+
* Sends the HTTP POST request with a timeout, and maps network errors to
|
|
74
74
|
* TransportError.
|
|
75
75
|
* @param endpoint Ingest URL.
|
|
76
76
|
* @param headers HTTP request headers.
|
|
@@ -82,8 +82,9 @@ export declare class HttpTransport extends StatusTransport {
|
|
|
82
82
|
*/
|
|
83
83
|
private dispatch;
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
85
|
+
* Checks whether a send uses keepalive. A mobile OS can stop a hidden page without a
|
|
86
|
+
* pagehide, and a keepalive request continues after that. The browser limits the keepalive
|
|
87
|
+
* bodies in flight.
|
|
87
88
|
* @param body Request body string or byte array.
|
|
88
89
|
* @returns True for a hidden document and a body of BEACON_LIMIT_BYTES or less.
|
|
89
90
|
*/
|
|
@@ -95,9 +96,9 @@ export declare class HttpTransport extends StatusTransport {
|
|
|
95
96
|
*/
|
|
96
97
|
private readMaxBytes;
|
|
97
98
|
/**
|
|
98
|
-
* Resolves the configured static or dynamic request headers
|
|
99
|
-
*
|
|
100
|
-
* @returns Promise that resolves to
|
|
99
|
+
* Resolves the configured static or dynamic request headers, and keeps what headers()
|
|
100
|
+
* returned for the exit flush.
|
|
101
|
+
* @returns Promise that resolves to the header map.
|
|
101
102
|
*/
|
|
102
103
|
private resolveHeaders;
|
|
103
104
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import type { Transport, TransportRequest } from "../models/config";
|
|
2
2
|
import type { LogRecord } from "../models/log-record";
|
|
3
|
-
/** A transport that keeps
|
|
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()`. */
|
|
6
6
|
transport: Transport;
|
|
7
7
|
/**
|
|
8
|
-
* Returns the records of
|
|
8
|
+
* Returns the records of every accepted batch, in send order.
|
|
9
9
|
* @returns The accepted records.
|
|
10
10
|
*/
|
|
11
11
|
records(): LogRecord[];
|
|
12
12
|
/**
|
|
13
|
-
* Returns
|
|
13
|
+
* Returns every request, accepted or refused, in send order.
|
|
14
14
|
* @returns The requests.
|
|
15
15
|
*/
|
|
16
16
|
batches(): TransportRequest[];
|
|
17
|
-
/** Forgets
|
|
17
|
+
/** Forgets every batch. The answer set with respondWith stays. */
|
|
18
18
|
clear(): void;
|
|
19
19
|
/**
|
|
20
|
-
* Sets the answer for
|
|
20
|
+
* Sets the answer for all later batches. The default answer is 200.
|
|
21
21
|
* @param status Status code to answer with, for example 413, 429 or 500.
|
|
22
22
|
* @param retryAfterMs Delay to answer with, for 429 and 503.
|
|
23
23
|
*/
|
|
24
24
|
respondWith(status: number, retryAfterMs?: number): void;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
-
* Creates a transport that keeps
|
|
27
|
+
* Creates a transport that keeps every batch in memory. Use it in tests, with `configure()`.
|
|
28
28
|
* @returns The memory transport.
|
|
29
29
|
*/
|
|
30
30
|
export declare function createMemoryTransport(): MemoryTransport;
|
|
@@ -5,8 +5,8 @@ import type { LossReporter } from "../models/drop";
|
|
|
5
5
|
import { type StorageAdapter } from "../models/storage";
|
|
6
6
|
import type { BatchTransport } from "./status-transport";
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Resends persisted offline batches on a timer, with backoff, a cross-tab drain lock and
|
|
9
|
+
* batch splitting.
|
|
10
10
|
*/
|
|
11
11
|
export declare class RetryEngine {
|
|
12
12
|
private readonly storage;
|
|
@@ -15,17 +15,17 @@ export declare class RetryEngine {
|
|
|
15
15
|
private readonly config;
|
|
16
16
|
private readonly batchesPerDrain?;
|
|
17
17
|
private readonly onLoss;
|
|
18
|
-
/**
|
|
18
|
+
/** The active retry timer handle, or null when no timer is running. */
|
|
19
19
|
private timer;
|
|
20
|
-
/**
|
|
20
|
+
/** Consecutive failed deliveries. Feeds the backoff calculation. */
|
|
21
21
|
private attempt;
|
|
22
|
-
/**
|
|
22
|
+
/** True while a storage drain is running. */
|
|
23
23
|
private draining;
|
|
24
|
-
/**
|
|
24
|
+
/** True after stop(). */
|
|
25
25
|
private stopped;
|
|
26
|
-
/** Attempt limit
|
|
26
|
+
/** Attempt limit for a stored batch. Retention can't change after the delivery stack loads. */
|
|
27
27
|
private readonly maxAttempts;
|
|
28
|
-
/**
|
|
28
|
+
/** Runs on the online event. Resets the attempt count and starts a drain. */
|
|
29
29
|
private readonly onOnline;
|
|
30
30
|
/**
|
|
31
31
|
* @param storage Storage adapter holding undelivered batches.
|
|
@@ -33,75 +33,76 @@ export declare class RetryEngine {
|
|
|
33
33
|
* @param diagnostics Diagnostics reporter.
|
|
34
34
|
* @param config Active configuration instance.
|
|
35
35
|
* @param batchesPerDrain Maximum batches processed per drain tick.
|
|
36
|
-
* @param onLoss Receives the records of
|
|
36
|
+
* @param onLoss Receives the records of every batch that the engine drops.
|
|
37
37
|
*/
|
|
38
38
|
constructor(storage: StorageAdapter, transport: BatchTransport, diagnostics: Diagnostics, config: ResolvedConfig, batchesPerDrain?: number | undefined, onLoss?: LossReporter);
|
|
39
|
-
/**
|
|
39
|
+
/** Starts the engine. Listens for online events and arms the first timer. */
|
|
40
40
|
start(): void;
|
|
41
|
-
/**
|
|
41
|
+
/** Schedules an earlier retry when storage receives a new offline batch. */
|
|
42
42
|
nudge(): void;
|
|
43
43
|
/**
|
|
44
|
-
* Stores a batch that failed outside the drain loop
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* Stores a batch that failed outside the drain loop, under the same rules as the drain.
|
|
45
|
+
* A refused batch is never stored whole, because that would cause another request with a
|
|
46
|
+
* payload the server already refused.
|
|
47
47
|
* @param batch Rejected batch, with its attempt already counted.
|
|
48
48
|
* @param error Failure thrown by the transport.
|
|
49
49
|
*/
|
|
50
50
|
storeFailed(batch: LogBatch, error: unknown): Promise<void>;
|
|
51
|
-
/**
|
|
51
|
+
/** Stops the engine. Removes the listener and clears the pending timer. */
|
|
52
52
|
stop(): void;
|
|
53
53
|
/**
|
|
54
|
-
* Tries one delivery pass
|
|
54
|
+
* Tries one delivery pass over the stored batches before a context change. The caller sets
|
|
55
|
+
* the deadline.
|
|
55
56
|
* @returns Promise that resolves when this pass stops.
|
|
56
57
|
*/
|
|
57
58
|
flush(): Promise<void>;
|
|
58
59
|
/**
|
|
59
|
-
* Clears the pending timer
|
|
60
|
+
* Clears the pending timer, then schedules a drain after the delay.
|
|
60
61
|
* @param delayMs Delay duration in milliseconds.
|
|
61
62
|
*/
|
|
62
63
|
private schedule;
|
|
63
64
|
/**
|
|
64
|
-
*
|
|
65
|
-
* `draining` true
|
|
65
|
+
* Puts a deadline on a storage call. A call that never settles would keep
|
|
66
|
+
* `draining` true, and this window would run no more drains.
|
|
66
67
|
* @param work Storage promise to bound.
|
|
67
|
-
* @returns The value
|
|
68
|
+
* @returns The promise's value, or a rejection after the deadline.
|
|
68
69
|
*/
|
|
69
70
|
private bounded;
|
|
70
|
-
/**
|
|
71
|
+
/** Clears the pending timer if there is one. */
|
|
71
72
|
private clearTimer;
|
|
72
73
|
/**
|
|
73
|
-
* Calculates the exponential backoff delay from consecutive failures.
|
|
74
|
-
*
|
|
74
|
+
* Calculates the exponential backoff delay from consecutive failures. Uses full jitter
|
|
75
|
+
* instead of a fixed offset, because with a fixed offset tabs that reconnect together send
|
|
75
76
|
* their requests at the same time.
|
|
76
77
|
* @returns Backoff duration in milliseconds.
|
|
77
78
|
*/
|
|
78
79
|
private backoffMs;
|
|
79
|
-
/**
|
|
80
|
+
/** Runs a drain under the origin-wide Web Lock. */
|
|
80
81
|
private drain;
|
|
81
82
|
/**
|
|
82
|
-
* Processes batches while
|
|
83
|
-
* It always resolves
|
|
83
|
+
* Processes batches while holding the Web Lock, and schedules the next tick.
|
|
84
|
+
* It always resolves, because a throw would leave the engine idle with no armed timer.
|
|
84
85
|
* @returns Promise that resolves to true on completion.
|
|
85
86
|
*/
|
|
86
87
|
private drainLocked;
|
|
87
88
|
/**
|
|
88
|
-
* Tries to deliver one batch.
|
|
89
|
-
*
|
|
89
|
+
* Tries to deliver one batch. Removes it on success, and on failure applies the rule for
|
|
90
|
+
* the failure kind.
|
|
90
91
|
* @param batch Log batch to deliver.
|
|
91
|
-
* @returns "next" to continue with the next batch
|
|
92
|
-
* in milliseconds blocks the kind
|
|
92
|
+
* @returns "next" to continue with the next batch, "stop" to stop the current drain, or a
|
|
93
|
+
* delay in milliseconds that blocks the batch's kind until the next drain.
|
|
93
94
|
*/
|
|
94
95
|
private deliver;
|
|
95
96
|
/**
|
|
96
|
-
* Replaces a stored batch with
|
|
97
|
-
*
|
|
97
|
+
* Replaces a stored batch with whatever survives its failure. That is the split halves,
|
|
98
|
+
* or nothing after a permanent refusal.
|
|
98
99
|
* @param batch Rejected log batch, already held in storage.
|
|
99
100
|
* @param error Failure thrown by the transport.
|
|
100
101
|
*/
|
|
101
102
|
private replaceStored;
|
|
102
103
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
104
|
+
* Picks the batches to keep after a failure. A 413 response splits the batch in two, a
|
|
105
|
+
* permanent refusal keeps nothing, and any other failure keeps the batch whole.
|
|
105
106
|
* @param batch Rejected log batch.
|
|
106
107
|
* @param error Failure thrown by the transport.
|
|
107
108
|
* @returns Batches to persist. The array is empty when the engine drops the records.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogSerializer } from "../../models/serializer";
|
|
2
|
-
/**
|
|
2
|
+
/** Writes log records as Elastic Common Schema (ECS) NDJSON documents. */
|
|
3
3
|
export declare const ecsSerializer: LogSerializer;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogSerializer } from "../../models/serializer";
|
|
2
|
-
/**
|
|
2
|
+
/** Writes metric records as an OTLP/JSON ExportMetricsServiceRequest. */
|
|
3
3
|
export declare const otlpMetricsSerializer: LogSerializer;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogSerializer } from "../../models/serializer";
|
|
2
|
-
/**
|
|
2
|
+
/** Writes span records as an OTLP/JSON ExportTraceServiceRequest. */
|
|
3
3
|
export declare const otlpTracesSerializer: LogSerializer;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { LogRecord } from "../../models/log-record";
|
|
2
2
|
import type { LogSerializer } from "../../models/serializer";
|
|
3
|
-
/**
|
|
3
|
+
/** An OTLP AnyValue with typed value wrappers. */
|
|
4
4
|
type AnyValue = Record<string, unknown>;
|
|
5
|
-
/**
|
|
5
|
+
/** An OTLP KeyValue pair. */
|
|
6
6
|
export interface KeyValue {
|
|
7
|
-
/**
|
|
7
|
+
/** The attribute key. */
|
|
8
8
|
key: string;
|
|
9
|
-
/**
|
|
9
|
+
/** The typed AnyValue. */
|
|
10
10
|
value: AnyValue;
|
|
11
11
|
}
|
|
12
|
-
/**
|
|
12
|
+
/** Records that share the same resource attributes. */
|
|
13
13
|
export interface ResourceGroup {
|
|
14
|
-
/**
|
|
14
|
+
/** The resource attribute map. */
|
|
15
15
|
resource: Record<string, unknown>;
|
|
16
|
-
/**
|
|
16
|
+
/** The resource's log records. */
|
|
17
17
|
records: LogRecord[];
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
@@ -23,25 +23,25 @@ export interface ResourceGroup {
|
|
|
23
23
|
*/
|
|
24
24
|
export declare function toKeyValues(source: Record<string, unknown>): KeyValue[];
|
|
25
25
|
/**
|
|
26
|
-
* Groups records by their resource attributes
|
|
26
|
+
* Groups records by their resource attributes, keeping the record order within each group.
|
|
27
27
|
* @param records Records to group.
|
|
28
|
-
* @returns One group
|
|
28
|
+
* @returns One group per resource.
|
|
29
29
|
*/
|
|
30
30
|
export declare function groupByResource(records: LogRecord[]): ResourceGroup[];
|
|
31
|
-
/**
|
|
31
|
+
/** The records of one instrumentation scope. */
|
|
32
32
|
export interface ScopeGroup {
|
|
33
|
-
/**
|
|
33
|
+
/** The scope name, which is the logger namespace. */
|
|
34
34
|
name: string;
|
|
35
|
-
/**
|
|
35
|
+
/** The scope's records. */
|
|
36
36
|
records: LogRecord[];
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
|
-
* Groups records by their logger namespace
|
|
40
|
-
* A record without a namespace goes to the
|
|
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
41
|
* @param records Records of one resource.
|
|
42
|
-
* @returns One group
|
|
42
|
+
* @returns One group per namespace.
|
|
43
43
|
*/
|
|
44
44
|
export declare function groupByScope(records: LogRecord[]): ScopeGroup[];
|
|
45
|
-
/**
|
|
45
|
+
/** Writes log records as OTLP/JSON payloads. */
|
|
46
46
|
export declare const otlpSerializer: LogSerializer;
|
|
47
47
|
export {};
|
|
@@ -9,9 +9,9 @@ import type { LogSerializer, SerializedBatch } from "../../models/serializer";
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function serializerFor(choice: SerializerChoice): LogSerializer;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
* span records is always "traces"
|
|
14
|
-
* can be corrupt
|
|
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
15
|
* @param batch Batch to test.
|
|
16
16
|
* @param config Active configuration.
|
|
17
17
|
* @returns "metrics" with metricsEndpoint set and only metric records, "traces" for only span
|
|
@@ -19,16 +19,16 @@ export declare function serializerFor(choice: SerializerChoice): LogSerializer;
|
|
|
19
19
|
*/
|
|
20
20
|
export declare function batchKind(batch: LogBatch, config: ResolvedConfig): BatchKind;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Returns the endpoint for a batch kind.
|
|
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
|
|
26
|
+
* endpoint. "" means the batch has no destination.
|
|
27
27
|
*/
|
|
28
28
|
export declare function endpointFor(kind: BatchKind, config: ResolvedConfig): string | null;
|
|
29
29
|
/**
|
|
30
|
-
* Serializes a batch.
|
|
31
|
-
* A metrics batch gets the OTLP metrics format
|
|
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
32
|
* @param config Active configuration.
|
|
33
33
|
* @param batch Batch to serialize.
|
|
34
34
|
* @param diagnostics Diagnostics reporter.
|