@utk09/ui-observability 0.12.0 → 1.1.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 +280 -10
- package/README.md +70 -839
- package/dist/{batch-BjQUwjA6.js → batch-D3NHhF9L.js} +4 -4
- package/dist/{batch-BjQUwjA6.js.map → batch-D3NHhF9L.js.map} +1 -1
- package/dist/{batch-D5LlU4Q9.cjs → batch-DnYRJqhU.cjs} +2 -2
- package/dist/{batch-D5LlU4Q9.cjs.map → batch-DnYRJqhU.cjs.map} +1 -1
- package/dist/bus/bus.d.cts +355 -0
- package/dist/bus/bus.d.ts +86 -12
- 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-B__467mL.cjs +2 -0
- package/dist/bus-B__467mL.cjs.map +1 -0
- package/dist/bus-dw7T92sO.js +788 -0
- package/dist/bus-dw7T92sO.js.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 +80 -0
- package/dist/capture/interactions.d.ts +36 -4
- 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/observed-windows.d.cts +51 -0
- package/dist/capture/observed-windows.d.ts +51 -0
- 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-C0hUHKR-.cjs} +2 -2
- package/dist/{compression-lD9abCcO.cjs.map → compression-C0hUHKR-.cjs.map} +1 -1
- package/dist/{compression-AJJCMBOa.js → compression-SHPAvS4U.js} +2 -2
- package/dist/{compression-AJJCMBOa.js.map → compression-SHPAvS4U.js.map} +1 -1
- package/dist/config-CSNcS7OZ.js +558 -0
- package/dist/config-CSNcS7OZ.js.map +1 -0
- package/dist/config-CybPP5VM.cjs +2 -0
- package/dist/config-CybPP5VM.cjs.map +1 -0
- package/dist/console-BsM-fSCQ.js +81 -0
- package/dist/console-BsM-fSCQ.js.map +1 -0
- package/dist/console-Dkxs6IVQ.cjs +2 -0
- package/dist/console-Dkxs6IVQ.cjs.map +1 -0
- package/dist/constants-BwJDXzj6.js +357 -0
- package/dist/constants-BwJDXzj6.js.map +1 -0
- package/dist/constants-CtF52hIV.cjs +2 -0
- package/dist/constants-CtF52hIV.cjs.map +1 -0
- package/dist/constants.d.cts +763 -0
- package/dist/constants.d.ts +100 -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 +99 -0
- package/dist/core/rotation.d.ts +99 -0
- package/dist/core/runtime.d.cts +774 -0
- package/dist/core/runtime.d.ts +254 -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-B2v6Cym-.cjs +2 -0
- package/dist/debug-bundle-B2v6Cym-.cjs.map +1 -0
- package/dist/debug-bundle-Cs_YWzTa.js +35 -0
- package/dist/debug-bundle-Cs_YWzTa.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 +119 -87
- package/dist/doctor.js.map +1 -1
- package/dist/errors-DP2RUm4V.cjs +3 -0
- package/dist/errors-DP2RUm4V.cjs.map +1 -0
- package/dist/errors-Q3Ng1ciC.js +86 -0
- package/dist/errors-Q3Ng1ciC.js.map +1 -0
- package/dist/factory-DV17sm2p.js +404 -0
- package/dist/factory-DV17sm2p.js.map +1 -0
- package/dist/factory-K8O6gpux.cjs +2 -0
- package/dist/factory-K8O6gpux.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-BgtHyY4u.js} +33 -26
- package/dist/identity-BgtHyY4u.js.map +1 -0
- package/dist/identity-CvuyqZk7.cjs +2 -0
- package/dist/identity-CvuyqZk7.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +301 -0
- package/dist/index.d.ts +90 -98
- package/dist/index.js +1253 -1555
- package/dist/index.js.map +1 -1
- package/dist/indexeddb-storage-D4KVcqdD.cjs +2 -0
- package/dist/indexeddb-storage-D4KVcqdD.cjs.map +1 -0
- package/dist/{indexeddb-storage-DLXQzAGh.js → indexeddb-storage-e-13ZLWm.js} +61 -57
- package/dist/indexeddb-storage-e-13ZLWm.js.map +1 -0
- package/dist/interactions-Byxf1C82.js +207 -0
- package/dist/interactions-Byxf1C82.js.map +1 -0
- package/dist/interactions-OK85T-Dk.cjs +2 -0
- package/dist/interactions-OK85T-Dk.cjs.map +1 -0
- package/dist/{journey-35yCMNFo.js → journey-C93FTYcs.js} +46 -49
- package/dist/journey-C93FTYcs.js.map +1 -0
- package/dist/journey-nMbob3OB.cjs +2 -0
- package/dist/journey-nMbob3OB.cjs.map +1 -0
- package/dist/{library-console-BFWEuQsl.cjs → library-console-DJUQzcgM.cjs} +2 -2
- package/dist/{library-console-BFWEuQsl.cjs.map → library-console-DJUQzcgM.cjs.map} +1 -1
- package/dist/{library-console-Dl_Ly6DQ.js → library-console-DklSmucS.js} +2 -2
- package/dist/{library-console-Dl_Ly6DQ.js.map → library-console-DklSmucS.js.map} +1 -1
- package/dist/{library-request-nI6pvI6I.js → library-request-UGEwOHpf.js} +2 -2
- package/dist/{library-request-nI6pvI6I.js.map → library-request-UGEwOHpf.js.map} +1 -1
- package/dist/{library-request-Da-CHKzT.cjs → library-request-kY9iTpIF.cjs} +2 -2
- package/dist/{library-request-Da-CHKzT.cjs.map → library-request-kY9iTpIF.cjs.map} +1 -1
- package/dist/{lifecycle-CZ6RRXc6.js → lifecycle-B2PlIuQu.js} +21 -29
- package/dist/lifecycle-B2PlIuQu.js.map +1 -0
- package/dist/lifecycle-DaMdH_X7.cjs +2 -0
- package/dist/lifecycle-DaMdH_X7.cjs.map +1 -0
- package/dist/log-record-Bmx6etMh.cjs +2 -0
- package/dist/log-record-Bmx6etMh.cjs.map +1 -0
- package/dist/{log-record-DIA6McNr.js → log-record-DSt2P-Sr.js} +8 -7
- package/dist/log-record-DSt2P-Sr.js.map +1 -0
- package/dist/{long-frames-430_85Da.js → long-frames-Bamjs1WV.js} +18 -22
- package/dist/long-frames-Bamjs1WV.js.map +1 -0
- package/dist/long-frames-lhtONgGt.cjs +2 -0
- package/dist/long-frames-lhtONgGt.cjs.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 +163 -0
- package/dist/models/bus.d.ts +28 -3
- package/dist/models/config.d.cts +1555 -0
- package/dist/models/config.d.ts +377 -261
- 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 +25 -0
- package/dist/models/serializer.d.ts +4 -2
- package/dist/models/storage.d.cts +95 -0
- package/dist/models/storage.d.ts +7 -5
- package/dist/network-BCn8Gn47.cjs +2 -0
- package/dist/network-BCn8Gn47.cjs.map +1 -0
- package/dist/{network-C7SkLf4v.js → network-Cg1L2w2r.js} +57 -57
- package/dist/network-Cg1L2w2r.js.map +1 -0
- package/dist/observed-windows-B3gJkdql.cjs +2 -0
- package/dist/observed-windows-B3gJkdql.cjs.map +1 -0
- package/dist/observed-windows-BrwaJNlj.js +64 -0
- package/dist/observed-windows-BrwaJNlj.js.map +1 -0
- package/dist/{otlp-2MCrC3kd.cjs → otlp-CrAWkQdO.cjs} +2 -2
- package/dist/{otlp-2MCrC3kd.cjs.map → otlp-CrAWkQdO.cjs.map} +1 -1
- package/dist/{otlp-COq033e3.js → otlp-D6dRZyB8.js} +9 -9
- package/dist/{otlp-COq033e3.js.map → otlp-D6dRZyB8.js.map} +1 -1
- package/dist/{platform-CVewe4wQ.js → platform-8DLhjddo.js} +9 -9
- package/dist/{platform-CVewe4wQ.js.map → platform-8DLhjddo.js.map} +1 -1
- package/dist/{platform-12uR7kBQ.cjs → platform-BqRc-7RO.cjs} +2 -2
- package/dist/{platform-12uR7kBQ.cjs.map → platform-BqRc-7RO.cjs.map} +1 -1
- package/dist/{profiler-BVWIOgnq.js → profiler-BaXSqCfz.js} +78 -96
- package/dist/profiler-BaXSqCfz.js.map +1 -0
- package/dist/profiler-BvWW2kNM.cjs +2 -0
- package/dist/profiler-BvWW2kNM.cjs.map +1 -0
- package/dist/{profiler-frames-CLXlT_xL.js → profiler-frames-C4ySHN0X.js} +21 -29
- package/dist/profiler-frames-C4ySHN0X.js.map +1 -0
- package/dist/profiler-frames-DeaBiB-5.cjs +2 -0
- package/dist/profiler-frames-DeaBiB-5.cjs.map +1 -0
- package/dist/remote-rules-D7L6D_D2.cjs +2 -0
- package/dist/remote-rules-D7L6D_D2.cjs.map +1 -0
- package/dist/remote-rules-Dq9xe7Qn.js +95 -0
- package/dist/remote-rules-Dq9xe7Qn.js.map +1 -0
- package/dist/replay-B0M8kWz_.js +310 -0
- package/dist/replay-B0M8kWz_.js.map +1 -0
- package/dist/replay-QOFBpAXh.cjs +2 -0
- package/dist/replay-QOFBpAXh.cjs.map +1 -0
- package/dist/{reports-BuXekPOS.js → reports--8APRLa-.js} +25 -30
- package/dist/reports--8APRLa-.js.map +1 -0
- package/dist/reports-ojuMKGO7.cjs +2 -0
- package/dist/reports-ojuMKGO7.cjs.map +1 -0
- package/dist/{resource-timing-CXGHwFRD.js → resource-timing-BzR05rE-.js} +20 -23
- package/dist/resource-timing-BzR05rE-.js.map +1 -0
- package/dist/resource-timing-pAG3ZhB5.cjs +2 -0
- package/dist/resource-timing-pAG3ZhB5.cjs.map +1 -0
- package/dist/response-body-BWvwKQ2p.js +331 -0
- package/dist/response-body-BWvwKQ2p.js.map +1 -0
- package/dist/response-body-CKEJ5itk.cjs +3 -0
- package/dist/response-body-CKEJ5itk.cjs.map +1 -0
- package/dist/rotation-BylN1B9e.js +93 -0
- package/dist/rotation-BylN1B9e.js.map +1 -0
- package/dist/rotation-E2eKClIs.cjs +2 -0
- package/dist/rotation-E2eKClIs.cjs.map +1 -0
- package/dist/sampling-B46LW0cy.cjs +2 -0
- package/dist/sampling-B46LW0cy.cjs.map +1 -0
- package/dist/sampling-zXA6r-Nw.js +63 -0
- package/dist/sampling-zXA6r-Nw.js.map +1 -0
- package/dist/{sanitize-CNmsD9r3.js → sanitize-DjnR6RXR.js} +2 -2
- package/dist/sanitize-DjnR6RXR.js.map +1 -0
- package/dist/{sanitize-ChLn97Ch.cjs → sanitize-Qj6LuZqp.cjs} +2 -2
- package/dist/sanitize-Qj6LuZqp.cjs.map +1 -0
- package/dist/sender-Bdp-TAS4.js +979 -0
- package/dist/sender-Bdp-TAS4.js.map +1 -0
- package/dist/sender-DR7ZycZY.cjs +2 -0
- package/dist/sender-DR7ZycZY.cjs.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-BOu54M8Y.cjs +2 -0
- package/dist/stored-context-BOu54M8Y.cjs.map +1 -0
- package/dist/stored-context-CSttrAsw.js +51 -0
- package/dist/stored-context-CSttrAsw.js.map +1 -0
- package/dist/storm-BHgI12iS.cjs +2 -0
- package/dist/storm-BHgI12iS.cjs.map +1 -0
- package/dist/storm-DKlpv0FL.js +9 -0
- package/dist/storm-DKlpv0FL.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-BYPYYkQ5.cjs +2 -0
- package/dist/unclean-exit-BYPYYkQ5.cjs.map +1 -0
- package/dist/{unclean-exit-Cob_jyTv.js → unclean-exit-BcOB8A2e.js} +23 -30
- package/dist/unclean-exit-BcOB8A2e.js.map +1 -0
- package/dist/{user-timing-DgHubxCI.js → user-timing-4KIJ74Vi.js} +15 -17
- package/dist/user-timing-4KIJ74Vi.js.map +1 -0
- package/dist/user-timing-BsU2wQKE.cjs +2 -0
- package/dist/user-timing-BsU2wQKE.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 +114 -0
- package/dist/utils/identity.d.ts +8 -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-Cs1ZbmmN.cjs +2 -0
- package/dist/{web-socket-DthJuSAg.js.map → web-socket-Cs1ZbmmN.cjs.map} +1 -1
- package/dist/{web-socket-DthJuSAg.js → web-socket-Zg0hj1LB.js} +23 -28
- package/dist/web-socket-Zg0hj1LB.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-B0_8rWy5.js → worker-protocol-CYpAbrVl.js} +14 -11
- package/dist/worker-protocol-CYpAbrVl.js.map +1 -0
- package/dist/worker-protocol-DFYXIFus.cjs +2 -0
- package/dist/worker-protocol-DFYXIFus.cjs.map +1 -0
- package/dist/worker-server--yGTadTA.cjs +2 -0
- package/dist/worker-server--yGTadTA.cjs.map +1 -0
- package/dist/worker-server-BokySIII.js +94 -0
- package/dist/worker-server-BokySIII.js.map +1 -0
- package/dist/worker-transport-BdEvh_-a.cjs +2 -0
- package/dist/worker-transport-BdEvh_-a.cjs.map +1 -0
- package/dist/worker-transport-JK-Fby9J.js +194 -0
- package/dist/worker-transport-JK-Fby9J.js.map +1 -0
- package/llms.txt +400 -0
- package/package.json +65 -49
- package/dist/bus-D_7pd7RN.cjs +0 -2
- package/dist/bus-D_7pd7RN.cjs.map +0 -1
- package/dist/bus-ecxUNTja.js +0 -660
- 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 +0 -119
- 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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { LogRecord } from "./log-record.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Why records were lost.
|
|
4
|
+
* - "security_context": the delivery identity changed. The old identity's undelivered records
|
|
5
|
+
* are removed unless the rotation keeps them, and so are records forwarded during the change.
|
|
6
|
+
* - "buffer_full": a hold buffer filled up before startup or before the sender loaded.
|
|
7
|
+
* - "expired", "over_capacity", "quota": storage removed stored batches because of
|
|
8
|
+
* `retention.maxAgeMs`, `retention.maxBatches` or the browser's storage quota.
|
|
9
|
+
* - "max_attempts": a stored batch reached `retention.maxAttempts`.
|
|
10
|
+
* - "rejected": the server refused the batch permanently, or one record is too large for it.
|
|
11
|
+
* - "partially_rejected": an OTLP server accepted the batch but rejected some records in it. The
|
|
12
|
+
* server gives only a count, so `journeyIds` and `actions` stay empty.
|
|
13
|
+
* - "unserializable": the serializer threw on the batch.
|
|
14
|
+
* - "exit_queue_full": the exit queue in localStorage is full, so it drops its oldest batch.
|
|
15
|
+
* - "load_failed": the delivery code failed to load, or shutdown() came first. The held records
|
|
16
|
+
* are lost.
|
|
17
|
+
* - "not_stored": storage did not keep a batch after a failed send, because of a write error or
|
|
18
|
+
* `storage: "none"`.
|
|
19
|
+
* - "disabled": `enabled` is false, so nothing sends these records. They are a record that a
|
|
20
|
+
* child context forwards to a paused sender or a paused forwarder, and a record that a log
|
|
21
|
+
* call held before the first `configure()` call when that call sets `enabled: false` and its
|
|
22
|
+
* levels and sampling keep the record. At a pagehide or a `shutdown()` during a pause, they
|
|
23
|
+
* are also the records that wait for the sender, and the ones in its buffers, its queue and
|
|
24
|
+
* its requests. Each record is reported once, whatever comes later.
|
|
25
|
+
* - "discarded": `shutdown()` with `pending: "discard"` or `clearStorage` dropped the records in
|
|
26
|
+
* memory without a send. A record in a request that is in flight isn't counted, because the
|
|
27
|
+
* request can still reach the server.
|
|
28
|
+
*/
|
|
29
|
+
export type LossReason = "security_context" | "buffer_full" | "expired" | "over_capacity" | "quota" | "max_attempts" | "rejected" | "partially_rejected" | "unserializable" | "exit_queue_full" | "load_failed" | "not_stored" | "disabled" | "discarded";
|
|
30
|
+
/**
|
|
31
|
+
* One report of lost records. Losses with the same reason in the same task are merged into one
|
|
32
|
+
* report. Each list holds at most 20 distinct values.
|
|
33
|
+
*/
|
|
34
|
+
export interface DropSummary {
|
|
35
|
+
/** Cause of the loss. */
|
|
36
|
+
reason: LossReason;
|
|
37
|
+
/** Number of lost records. */
|
|
38
|
+
records: number;
|
|
39
|
+
/** Ids of the lost batches. Empty for a hold buffer, which loses records, not batches. */
|
|
40
|
+
batchIds: string[];
|
|
41
|
+
/** Journey ids of the lost records. */
|
|
42
|
+
journeyIds: string[];
|
|
43
|
+
/** Names of the lost action records. An action is an audit fact. */
|
|
44
|
+
actions: string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Receives lost records. The runtime adds them to the onDrop report.
|
|
48
|
+
* @param reason Cause of the loss.
|
|
49
|
+
* @param records Lost records.
|
|
50
|
+
* @param batchIds Ids of the lost batches.
|
|
51
|
+
* @param count Number of lost records when the caller can't name them. Defaults to the length
|
|
52
|
+
* of `records`.
|
|
53
|
+
*/
|
|
54
|
+
export type LossReporter = (reason: LossReason, records: readonly LogRecord[], batchIds?: readonly string[], count?: number) => void;
|
package/dist/models/drop.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LogRecord } from "./log-record";
|
|
1
|
+
import type { LogRecord } from "./log-record.js";
|
|
2
2
|
/**
|
|
3
3
|
* Why records were lost.
|
|
4
4
|
* - "security_context": the delivery identity changed. The old identity's undelivered records
|
|
@@ -8,14 +8,25 @@ import type { LogRecord } from "./log-record";
|
|
|
8
8
|
* `retention.maxAgeMs`, `retention.maxBatches` or the browser's storage quota.
|
|
9
9
|
* - "max_attempts": a stored batch reached `retention.maxAttempts`.
|
|
10
10
|
* - "rejected": the server refused the batch permanently, or one record is too large for it.
|
|
11
|
+
* - "partially_rejected": an OTLP server accepted the batch but rejected some records in it. The
|
|
12
|
+
* server gives only a count, so `journeyIds` and `actions` stay empty.
|
|
11
13
|
* - "unserializable": the serializer threw on the batch.
|
|
12
14
|
* - "exit_queue_full": the exit queue in localStorage is full, so it drops its oldest batch.
|
|
13
15
|
* - "load_failed": the delivery code failed to load, or shutdown() came first. The held records
|
|
14
16
|
* are lost.
|
|
15
17
|
* - "not_stored": storage did not keep a batch after a failed send, because of a write error or
|
|
16
18
|
* `storage: "none"`.
|
|
19
|
+
* - "disabled": `enabled` is false, so nothing sends these records. They are a record that a
|
|
20
|
+
* child context forwards to a paused sender or a paused forwarder, and a record that a log
|
|
21
|
+
* call held before the first `configure()` call when that call sets `enabled: false` and its
|
|
22
|
+
* levels and sampling keep the record. At a pagehide or a `shutdown()` during a pause, they
|
|
23
|
+
* are also the records that wait for the sender, and the ones in its buffers, its queue and
|
|
24
|
+
* its requests. Each record is reported once, whatever comes later.
|
|
25
|
+
* - "discarded": `shutdown()` with `pending: "discard"` or `clearStorage` dropped the records in
|
|
26
|
+
* memory without a send. A record in a request that is in flight isn't counted, because the
|
|
27
|
+
* request can still reach the server.
|
|
17
28
|
*/
|
|
18
|
-
export type LossReason = "security_context" | "buffer_full" | "expired" | "over_capacity" | "quota" | "max_attempts" | "rejected" | "unserializable" | "exit_queue_full" | "load_failed" | "not_stored";
|
|
29
|
+
export type LossReason = "security_context" | "buffer_full" | "expired" | "over_capacity" | "quota" | "max_attempts" | "rejected" | "partially_rejected" | "unserializable" | "exit_queue_full" | "load_failed" | "not_stored" | "disabled" | "discarded";
|
|
19
30
|
/**
|
|
20
31
|
* One report of lost records. Losses with the same reason in the same task are merged into one
|
|
21
32
|
* report. Each list holds at most 20 distinct values.
|
|
@@ -37,5 +48,7 @@ export interface DropSummary {
|
|
|
37
48
|
* @param reason Cause of the loss.
|
|
38
49
|
* @param records Lost records.
|
|
39
50
|
* @param batchIds Ids of the lost batches.
|
|
51
|
+
* @param count Number of lost records when the caller can't name them. Defaults to the length
|
|
52
|
+
* of `records`.
|
|
40
53
|
*/
|
|
41
|
-
export type LossReporter = (reason: LossReason, records: readonly LogRecord[], batchIds?: readonly string[]) => void;
|
|
54
|
+
export type LossReporter = (reason: LossReason, records: readonly LogRecord[], batchIds?: readonly string[], count?: number) => void;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { BusOptions, LoggerCacheOptions, SecurityContextOptions } from "./config.cjs";
|
|
2
|
+
import type { LossReason } from "./drop.cjs";
|
|
3
|
+
import type { LogRecord } from "./log-record.cjs";
|
|
4
|
+
import type { StoragePersistence } from "./storage.cjs";
|
|
5
|
+
/**
|
|
6
|
+
* Delivery state of this context. It holds numbers and times only, never a response text, a
|
|
7
|
+
* header or a URL. A forwarder reports only its own buffers.
|
|
8
|
+
*/
|
|
9
|
+
export interface DeliveryHealth {
|
|
10
|
+
/** Records in one of the library's buffers, not yet in any request. */
|
|
11
|
+
pending: number;
|
|
12
|
+
/** Records in requests that have not completed. */
|
|
13
|
+
inFlight: number;
|
|
14
|
+
/** Batches in storage waiting for a retry. A forwarder stores nothing and reports 0. */
|
|
15
|
+
stored: number;
|
|
16
|
+
/**
|
|
17
|
+
* Epoch time in milliseconds when the server last accepted a batch, or null. A security
|
|
18
|
+
* context rotation keeps it.
|
|
19
|
+
*/
|
|
20
|
+
lastSendAt: number | null;
|
|
21
|
+
/**
|
|
22
|
+
* Epoch time in milliseconds of the last failed send, or null. A security context rotation
|
|
23
|
+
* resets it.
|
|
24
|
+
*/
|
|
25
|
+
lastFailureAt: number | null;
|
|
26
|
+
/**
|
|
27
|
+
* Failed sends since the server last accepted a batch. A batch that makes no request leaves it
|
|
28
|
+
* as it is. A security context rotation resets it to 0. The exit flush can't learn its result,
|
|
29
|
+
* so it doesn't count.
|
|
30
|
+
*/
|
|
31
|
+
consecutiveFailures: number;
|
|
32
|
+
/**
|
|
33
|
+
* Epoch time in milliseconds when the latest server throttle ends, over all endpoints. Null
|
|
34
|
+
* when no endpoint is throttled. A security context rotation resets it.
|
|
35
|
+
*/
|
|
36
|
+
throttledUntil: number | null;
|
|
37
|
+
/**
|
|
38
|
+
* Lost records since the runtime started, for each reason. A reason with no loss has no key.
|
|
39
|
+
* The counts include the losses that `onDrop` reports, also without an `onDrop` hook. A
|
|
40
|
+
* security context rotation keeps them.
|
|
41
|
+
*/
|
|
42
|
+
dropped: Partial<Record<LossReason, number>>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* How a `flush()` call ended.
|
|
46
|
+
* - "complete": every record of the call's snapshot has a final state. `pending` is 0.
|
|
47
|
+
* - "timeout": `pending` is above 0. The time limit passed, a storage write passed its own
|
|
48
|
+
* time limit, or a pause, a shutdown or a rotation ended the flush. A forwarder whose sender
|
|
49
|
+
* didn't answer in time also gets it.
|
|
50
|
+
* - "inactive": the runtime sends nothing now. That is before the first `configure()` call that
|
|
51
|
+
* works, after a failed first call, while `enabled` is false and after `shutdown()`. The call
|
|
52
|
+
* sends nothing and waits for nothing. A pause or a shutdown while the call waits for startup
|
|
53
|
+
* or for the delivery stack also gives "inactive".
|
|
54
|
+
*/
|
|
55
|
+
export type FlushStatus = "complete" | "timeout" | "inactive";
|
|
56
|
+
/**
|
|
57
|
+
* What a `flush()` call did with the records in memory when it started. Each count is a number
|
|
58
|
+
* of records, not batches. The counts hold their values at the end of the wait. Work that
|
|
59
|
+
* continues after it doesn't change them.
|
|
60
|
+
*/
|
|
61
|
+
export interface FlushResult {
|
|
62
|
+
/** How the call ended. */
|
|
63
|
+
status: FlushStatus;
|
|
64
|
+
/**
|
|
65
|
+
* Records that the transport confirmed. HTTP: a `2xx` answer. Custom transport: a `2xx`
|
|
66
|
+
* status. Transport worker: the worker confirmed the send. A forwarder gets it from its
|
|
67
|
+
* sender, and it covers the whole snapshot of the sender.
|
|
68
|
+
*/
|
|
69
|
+
accepted: number;
|
|
70
|
+
/** Records that storage holds after a failed or throttled send. The retry engine sends them. */
|
|
71
|
+
stored: number;
|
|
72
|
+
/**
|
|
73
|
+
* Records that the library lost during the call. `onDrop` reports each one, except a record
|
|
74
|
+
* with no destination, which only counts `record.dropped_no_destination`.
|
|
75
|
+
*/
|
|
76
|
+
dropped: number;
|
|
77
|
+
/**
|
|
78
|
+
* Records that this forwarder handed to its sender in this call. 0 in a sender. The other
|
|
79
|
+
* counts of a forwarder come from the sender's answer.
|
|
80
|
+
*/
|
|
81
|
+
forwarded: number;
|
|
82
|
+
/**
|
|
83
|
+
* Records with no final state at the end of the wait. A storage write whose result is
|
|
84
|
+
* unknown counts here. With "inactive", it is the records that wait in memory.
|
|
85
|
+
*/
|
|
86
|
+
pending: number;
|
|
87
|
+
}
|
|
88
|
+
/** State of this SDK copy. A configured console-only runtime can report the status "ready". */
|
|
89
|
+
export interface ObservabilityHealth {
|
|
90
|
+
/** Delivery counts, times and losses of this context. */
|
|
91
|
+
delivery: DeliveryHealth;
|
|
92
|
+
/** Version of this SDK copy. */
|
|
93
|
+
sdkVersion: string;
|
|
94
|
+
/** Version of a different SDK copy that owns the page runtime, or null. */
|
|
95
|
+
owningSdkVersion: string | null;
|
|
96
|
+
/**
|
|
97
|
+
* Current runtime state.
|
|
98
|
+
* - "unconfigured": no `configure()` call has worked yet. The runtime holds records in memory
|
|
99
|
+
* and sends nothing. A failed first call also leaves this state, with the issue
|
|
100
|
+
* "records.refused".
|
|
101
|
+
* - "disabled": `enabled` is false. Captures and delivery are paused.
|
|
102
|
+
* - "starting": the bus role and the delivery stack are loading.
|
|
103
|
+
* - "ready": the runtime runs. A configured console-only runtime can be ready.
|
|
104
|
+
* - "rotating": a security-context rotation is in progress.
|
|
105
|
+
* - "degraded": an entry in `issues` names a fault.
|
|
106
|
+
* - "stopped": `shutdown()` stopped the runtime.
|
|
107
|
+
*/
|
|
108
|
+
status: "unconfigured" | "disabled" | "starting" | "ready" | "rotating" | "degraded" | "stopped";
|
|
109
|
+
/** Delivery role of this context. */
|
|
110
|
+
mode: "sender" | "forwarder" | "console-only";
|
|
111
|
+
/** True if the local sender is ready, `enabled` is true and the runtime has not stopped. */
|
|
112
|
+
senderReady: boolean;
|
|
113
|
+
/** True if configure() cannot change the current settings. */
|
|
114
|
+
configurationLocked: boolean;
|
|
115
|
+
/** Codes for the current runtime or context failures. */
|
|
116
|
+
issues: ("runtime.version_mismatch" | "sender.unavailable" | "security.context_mismatch" | "security.rotation_failed" | "records.refused")[];
|
|
117
|
+
/** Logger cache capacity and the number of cached loggers. */
|
|
118
|
+
loggerCache: LoggerCacheOptions & {
|
|
119
|
+
size: number;
|
|
120
|
+
};
|
|
121
|
+
/** Active delivery context id and isolation rule. */
|
|
122
|
+
securityContext: SecurityContextOptions;
|
|
123
|
+
/** State of the `storage.requestPersistent` request. */
|
|
124
|
+
storagePersistence: StoragePersistence;
|
|
125
|
+
/** The bus's source and capacity rules. */
|
|
126
|
+
bus: Pick<BusOptions, "sourcePolicy" | "maxMessageBytes" | "maxRecordsPerMessage" | "maxMessagesPerSecond">;
|
|
127
|
+
}
|
|
128
|
+
/** Library state for a support ticket. Every field is JSON-safe. */
|
|
129
|
+
export interface DebugBundle {
|
|
130
|
+
/** When the bundle was created, as an ISO 8601 string. */
|
|
131
|
+
createdAt: string;
|
|
132
|
+
/** Version of this SDK copy. */
|
|
133
|
+
sdkVersion: string;
|
|
134
|
+
/** Health snapshot, as returned by getHealth(). */
|
|
135
|
+
health: ObservabilityHealth;
|
|
136
|
+
/** How many times each diagnostic code was reported since startup. */
|
|
137
|
+
diagnostics: Record<string, number>;
|
|
138
|
+
/** This context's resource attributes, for example service.name and session.id. */
|
|
139
|
+
resource: Record<string, unknown>;
|
|
140
|
+
/** Page URL, under the same rules as the page.url attribute. */
|
|
141
|
+
pageUrl: string;
|
|
142
|
+
/** Recent breadcrumbs, after the processors and redact have run on them. */
|
|
143
|
+
breadcrumbs: unknown[];
|
|
144
|
+
/** Records currently in the debug buffer. */
|
|
145
|
+
debugBuffer: LogRecord[];
|
|
146
|
+
/** Resolved config without headers. Endpoints lose their query. Functions show only a name. */
|
|
147
|
+
config: Record<string, unknown>;
|
|
148
|
+
}
|
package/dist/models/health.d.ts
CHANGED
|
@@ -1,33 +1,129 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { LogRecord } from "./log-record";
|
|
4
|
-
import type { StoragePersistence } from "./storage";
|
|
1
|
+
import type { BusOptions, LoggerCacheOptions, SecurityContextOptions } from "./config.js";
|
|
2
|
+
import type { LossReason } from "./drop.js";
|
|
3
|
+
import type { LogRecord } from "./log-record.js";
|
|
4
|
+
import type { StoragePersistence } from "./storage.js";
|
|
5
|
+
/**
|
|
6
|
+
* Delivery state of this context. It holds numbers and times only, never a response text, a
|
|
7
|
+
* header or a URL. A forwarder reports only its own buffers.
|
|
8
|
+
*/
|
|
9
|
+
export interface DeliveryHealth {
|
|
10
|
+
/** Records in one of the library's buffers, not yet in any request. */
|
|
11
|
+
pending: number;
|
|
12
|
+
/** Records in requests that have not completed. */
|
|
13
|
+
inFlight: number;
|
|
14
|
+
/** Batches in storage waiting for a retry. A forwarder stores nothing and reports 0. */
|
|
15
|
+
stored: number;
|
|
16
|
+
/**
|
|
17
|
+
* Epoch time in milliseconds when the server last accepted a batch, or null. A security
|
|
18
|
+
* context rotation keeps it.
|
|
19
|
+
*/
|
|
20
|
+
lastSendAt: number | null;
|
|
21
|
+
/**
|
|
22
|
+
* Epoch time in milliseconds of the last failed send, or null. A security context rotation
|
|
23
|
+
* resets it.
|
|
24
|
+
*/
|
|
25
|
+
lastFailureAt: number | null;
|
|
26
|
+
/**
|
|
27
|
+
* Failed sends since the server last accepted a batch. A batch that makes no request leaves it
|
|
28
|
+
* as it is. A security context rotation resets it to 0. The exit flush can't learn its result,
|
|
29
|
+
* so it doesn't count.
|
|
30
|
+
*/
|
|
31
|
+
consecutiveFailures: number;
|
|
32
|
+
/**
|
|
33
|
+
* Epoch time in milliseconds when the latest server throttle ends, over all endpoints. Null
|
|
34
|
+
* when no endpoint is throttled. A security context rotation resets it.
|
|
35
|
+
*/
|
|
36
|
+
throttledUntil: number | null;
|
|
37
|
+
/**
|
|
38
|
+
* Lost records since the runtime started, for each reason. A reason with no loss has no key.
|
|
39
|
+
* The counts include the losses that `onDrop` reports, also without an `onDrop` hook. A
|
|
40
|
+
* security context rotation keeps them.
|
|
41
|
+
*/
|
|
42
|
+
dropped: Partial<Record<LossReason, number>>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* How a `flush()` call ended.
|
|
46
|
+
* - "complete": every record of the call's snapshot has a final state. `pending` is 0.
|
|
47
|
+
* - "timeout": `pending` is above 0. The time limit passed, a storage write passed its own
|
|
48
|
+
* time limit, or a pause, a shutdown or a rotation ended the flush. A forwarder whose sender
|
|
49
|
+
* didn't answer in time also gets it.
|
|
50
|
+
* - "inactive": the runtime sends nothing now. That is before the first `configure()` call that
|
|
51
|
+
* works, after a failed first call, while `enabled` is false and after `shutdown()`. The call
|
|
52
|
+
* sends nothing and waits for nothing. A pause or a shutdown while the call waits for startup
|
|
53
|
+
* or for the delivery stack also gives "inactive".
|
|
54
|
+
*/
|
|
55
|
+
export type FlushStatus = "complete" | "timeout" | "inactive";
|
|
56
|
+
/**
|
|
57
|
+
* What a `flush()` call did with the records in memory when it started. Each count is a number
|
|
58
|
+
* of records, not batches. The counts hold their values at the end of the wait. Work that
|
|
59
|
+
* continues after it doesn't change them.
|
|
60
|
+
*/
|
|
61
|
+
export interface FlushResult {
|
|
62
|
+
/** How the call ended. */
|
|
63
|
+
status: FlushStatus;
|
|
64
|
+
/**
|
|
65
|
+
* Records that the transport confirmed. HTTP: a `2xx` answer. Custom transport: a `2xx`
|
|
66
|
+
* status. Transport worker: the worker confirmed the send. A forwarder gets it from its
|
|
67
|
+
* sender, and it covers the whole snapshot of the sender.
|
|
68
|
+
*/
|
|
69
|
+
accepted: number;
|
|
70
|
+
/** Records that storage holds after a failed or throttled send. The retry engine sends them. */
|
|
71
|
+
stored: number;
|
|
72
|
+
/**
|
|
73
|
+
* Records that the library lost during the call. `onDrop` reports each one, except a record
|
|
74
|
+
* with no destination, which only counts `record.dropped_no_destination`.
|
|
75
|
+
*/
|
|
76
|
+
dropped: number;
|
|
77
|
+
/**
|
|
78
|
+
* Records that this forwarder handed to its sender in this call. 0 in a sender. The other
|
|
79
|
+
* counts of a forwarder come from the sender's answer.
|
|
80
|
+
*/
|
|
81
|
+
forwarded: number;
|
|
82
|
+
/**
|
|
83
|
+
* Records with no final state at the end of the wait. A storage write whose result is
|
|
84
|
+
* unknown counts here. With "inactive", it is the records that wait in memory.
|
|
85
|
+
*/
|
|
86
|
+
pending: number;
|
|
87
|
+
}
|
|
5
88
|
/** State of this SDK copy. A configured console-only runtime can report the status "ready". */
|
|
6
|
-
export interface ObservabilityHealth
|
|
89
|
+
export interface ObservabilityHealth {
|
|
90
|
+
/** Delivery counts, times and losses of this context. */
|
|
91
|
+
delivery: DeliveryHealth;
|
|
7
92
|
/** Version of this SDK copy. */
|
|
8
93
|
sdkVersion: string;
|
|
9
94
|
/** Version of a different SDK copy that owns the page runtime, or null. */
|
|
10
95
|
owningSdkVersion: string | null;
|
|
11
|
-
/**
|
|
12
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Current runtime state.
|
|
98
|
+
* - "unconfigured": no `configure()` call has worked yet. The runtime holds records in memory
|
|
99
|
+
* and sends nothing. A failed first call also leaves this state, with the issue
|
|
100
|
+
* "records.refused".
|
|
101
|
+
* - "disabled": `enabled` is false. Captures and delivery are paused.
|
|
102
|
+
* - "starting": the bus role and the delivery stack are loading.
|
|
103
|
+
* - "ready": the runtime runs. A configured console-only runtime can be ready.
|
|
104
|
+
* - "rotating": a security-context rotation is in progress.
|
|
105
|
+
* - "degraded": an entry in `issues` names a fault.
|
|
106
|
+
* - "stopped": `shutdown()` stopped the runtime.
|
|
107
|
+
*/
|
|
108
|
+
status: "unconfigured" | "disabled" | "starting" | "ready" | "rotating" | "degraded" | "stopped";
|
|
13
109
|
/** Delivery role of this context. */
|
|
14
110
|
mode: "sender" | "forwarder" | "console-only";
|
|
15
|
-
/** True if the local sender is ready and the runtime has not stopped. */
|
|
111
|
+
/** True if the local sender is ready, `enabled` is true and the runtime has not stopped. */
|
|
16
112
|
senderReady: boolean;
|
|
17
113
|
/** True if configure() cannot change the current settings. */
|
|
18
114
|
configurationLocked: boolean;
|
|
19
115
|
/** Codes for the current runtime or context failures. */
|
|
20
|
-
issues: ("runtime.version_mismatch" | "sender.unavailable" | "security.context_mismatch")[];
|
|
116
|
+
issues: ("runtime.version_mismatch" | "sender.unavailable" | "security.context_mismatch" | "security.rotation_failed" | "records.refused")[];
|
|
21
117
|
/** Logger cache capacity and the number of cached loggers. */
|
|
22
118
|
loggerCache: LoggerCacheOptions & {
|
|
23
119
|
size: number;
|
|
24
120
|
};
|
|
25
121
|
/** Active delivery context id and isolation rule. */
|
|
26
122
|
securityContext: SecurityContextOptions;
|
|
27
|
-
/** State of the `
|
|
123
|
+
/** State of the `storage.requestPersistent` request. */
|
|
28
124
|
storagePersistence: StoragePersistence;
|
|
29
|
-
/** The bus's source
|
|
30
|
-
bus: Pick<BusOptions, "sourcePolicy" | "
|
|
125
|
+
/** The bus's source and capacity rules. */
|
|
126
|
+
bus: Pick<BusOptions, "sourcePolicy" | "maxMessageBytes" | "maxRecordsPerMessage" | "maxMessagesPerSecond">;
|
|
31
127
|
}
|
|
32
128
|
/** Library state for a support ticket. Every field is JSON-safe. */
|
|
33
129
|
export interface DebugBundle {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** OpenTelemetry severity levels, in ascending order. */
|
|
2
|
+
export type LogLevel = "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR" | "FATAL";
|
|
3
|
+
/**
|
|
4
|
+
* What a record is about. `action` is something a person did, `event` is something the
|
|
5
|
+
* application did, and `metric` is a measurement. `log` is an application log call,
|
|
6
|
+
* `system` is this library's own output and `span` is one span of a trace.
|
|
7
|
+
*/
|
|
8
|
+
export type LogType = "action" | "event" | "metric" | "log" | "system" | "span";
|
|
9
|
+
/** Metric value type: level, running total, or distribution. */
|
|
10
|
+
export type MetricType = "gauge" | "counter" | "histogram";
|
|
11
|
+
/** Internal record shape. A serializer converts it to the payload format. */
|
|
12
|
+
export interface LogRecord {
|
|
13
|
+
/**
|
|
14
|
+
* Event time, nanoseconds since epoch, as a decimal string.
|
|
15
|
+
* @see {@link nowUnixNano}
|
|
16
|
+
*/
|
|
17
|
+
timeUnixNano: string;
|
|
18
|
+
/**
|
|
19
|
+
* When this library received the event, if that differs from `timeUnixNano`. A forwarded
|
|
20
|
+
* record, for example, can have a different time.
|
|
21
|
+
*/
|
|
22
|
+
observedTimeUnixNano?: string;
|
|
23
|
+
/** Distributed trace id. */
|
|
24
|
+
traceId: string;
|
|
25
|
+
/** Span id within the trace. */
|
|
26
|
+
spanId: string;
|
|
27
|
+
/** OpenTelemetry trace flags. The library uses only the sampled bit. */
|
|
28
|
+
traceFlags: number;
|
|
29
|
+
/** OpenTelemetry severity number for `severityText`. */
|
|
30
|
+
severityNumber: number;
|
|
31
|
+
/** Log level. */
|
|
32
|
+
severityText: LogLevel;
|
|
33
|
+
/** Log message. */
|
|
34
|
+
body: string;
|
|
35
|
+
/** Structured attributes, sanitized and size-capped. */
|
|
36
|
+
attributes: Record<string, unknown>;
|
|
37
|
+
/** Resource attributes, shared by every record from one context. */
|
|
38
|
+
resource: Record<string, unknown>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Returns the current time as a Unix nanosecond timestamp. Appends zeros instead of
|
|
42
|
+
* multiplying, because `Date.now() * 1e6` exceeds `Number.MAX_SAFE_INTEGER` and corrupts
|
|
43
|
+
* digits without an error. The trailing zeros mean unknown precision, not measured digits.
|
|
44
|
+
* @returns Epoch timestamp in nanoseconds, as a decimal string.
|
|
45
|
+
*/
|
|
46
|
+
export declare function nowUnixNano(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Checks whether a value is a known log level. The own-key check rejects "toString".
|
|
49
|
+
* @param value The value to check.
|
|
50
|
+
* @returns True if `value` is a key of the severity table.
|
|
51
|
+
*/
|
|
52
|
+
export declare function isLogLevel(value: unknown): value is LogLevel;
|
|
53
|
+
/**
|
|
54
|
+
* Checks whether a value has the shape `LogRecord` requires. Use it to validate records from
|
|
55
|
+
* another realm, because a malformed record throws during serialization. Any string is
|
|
56
|
+
* accepted as `severityText`, not only a known level, so an unknown level from a newer
|
|
57
|
+
* version still passes.
|
|
58
|
+
* @param value The value to check.
|
|
59
|
+
* @returns True if `value` has the shape `LogRecord` requires.
|
|
60
|
+
*/
|
|
61
|
+
export declare function isLogRecord(value: unknown): value is LogRecord;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/** Attribute set of a metric point. Keep it small, because every set is a series in the backend. */
|
|
2
|
+
export type MetricAttributes = Record<string, string | number | boolean>;
|
|
3
|
+
/** Instrument options. */
|
|
4
|
+
export interface InstrumentOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Unit of the values, for example "ms" or "By".
|
|
7
|
+
* @default "count"
|
|
8
|
+
*/
|
|
9
|
+
unit?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Histogram options. */
|
|
12
|
+
export interface HistogramOptions extends InstrumentOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Ascending bucket boundaries, at most 50. A value goes into the first bucket whose boundary
|
|
15
|
+
* is greater than or equal to it.
|
|
16
|
+
* @default [0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000]
|
|
17
|
+
*/
|
|
18
|
+
boundaries?: readonly number[];
|
|
19
|
+
}
|
|
20
|
+
/** Counter that sums its values in memory. The library sends one point every interval. */
|
|
21
|
+
export interface Counter {
|
|
22
|
+
/**
|
|
23
|
+
* Adds a value to an attribute set's sum.
|
|
24
|
+
* @param value Finite number, 0 or larger.
|
|
25
|
+
* @param attributes The point's attribute set.
|
|
26
|
+
*/
|
|
27
|
+
add(value: number, attributes?: MetricAttributes): void;
|
|
28
|
+
}
|
|
29
|
+
/** Gauge that keeps the last value for each attribute set. The library sends it every interval. */
|
|
30
|
+
export interface Gauge {
|
|
31
|
+
/**
|
|
32
|
+
* Sets the value of an attribute set. The last value in an interval goes out.
|
|
33
|
+
* @param value Finite number.
|
|
34
|
+
* @param attributes The point's attribute set.
|
|
35
|
+
*/
|
|
36
|
+
set(value: number, attributes?: MetricAttributes): void;
|
|
37
|
+
}
|
|
38
|
+
/** Histogram that counts its values into buckets in memory. Sends one point every interval. */
|
|
39
|
+
export interface Histogram {
|
|
40
|
+
/**
|
|
41
|
+
* Adds a value to an attribute set's buckets.
|
|
42
|
+
* @param value Finite number.
|
|
43
|
+
* @param attributes The point's attribute set.
|
|
44
|
+
*/
|
|
45
|
+
record(value: number, attributes?: MetricAttributes): void;
|
|
46
|
+
}
|
|
47
|
+
/** Handle for one timed operation. */
|
|
48
|
+
export interface Measure {
|
|
49
|
+
/**
|
|
50
|
+
* Closes the open phase and starts the next one. Does nothing after `end()`.
|
|
51
|
+
* @param name Phase name. Every name creates its own series.
|
|
52
|
+
*/
|
|
53
|
+
phase(name: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Closes the open phase and records the total. A second call does nothing.
|
|
56
|
+
* @param outcome Result of the operation. `"error"` marks its span as failed. @default "ok"
|
|
57
|
+
*/
|
|
58
|
+
end(outcome?: string): void;
|
|
59
|
+
}
|
|
60
|
+
/** Probe options. */
|
|
61
|
+
export interface ProbeOptions {
|
|
62
|
+
/**
|
|
63
|
+
* Record one span out of every `sampleEvery`. An integer from 1 to 2147483647.
|
|
64
|
+
* @default 1
|
|
65
|
+
*/
|
|
66
|
+
sampleEvery?: number;
|
|
67
|
+
/**
|
|
68
|
+
* A span that runs longer than this many milliseconds leaves a breadcrumb. Must be a finite
|
|
69
|
+
* number, 0 or more. Unset by default, which means no breadcrumbs.
|
|
70
|
+
*/
|
|
71
|
+
slowMs?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Set to true when an `await` splits the probe's spans. Those spans report total time only:
|
|
74
|
+
* they have no self time, and they don't eat into the self time of other spans.
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
async?: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Times one span of app code. Every member is a function property rather than a method, so you
|
|
81
|
+
* can destructure them and unbound-method lint rules stay quiet.
|
|
82
|
+
*/
|
|
83
|
+
export interface Probe {
|
|
84
|
+
/**
|
|
85
|
+
* Starts a span.
|
|
86
|
+
* @returns A token to pass to `end()`, or -1 if the profiler isn't measuring this span.
|
|
87
|
+
*/
|
|
88
|
+
begin: () => number;
|
|
89
|
+
/**
|
|
90
|
+
* Ends a span.
|
|
91
|
+
* @param token The token `begin()` returned.
|
|
92
|
+
*/
|
|
93
|
+
end: (token: number) => void;
|
|
94
|
+
/**
|
|
95
|
+
* Ends a span after the page's next paint, so the duration includes style, layout and paint.
|
|
96
|
+
* Where there is no frame callback, or the page is hidden, the span ends right away.
|
|
97
|
+
* @param token The token `begin()` returned.
|
|
98
|
+
*/
|
|
99
|
+
endAfterPaint: (token: number) => void;
|
|
100
|
+
/**
|
|
101
|
+
* Adds a duration you measured some other way.
|
|
102
|
+
* @param durationMs Duration in milliseconds. A finite number, 0 or larger.
|
|
103
|
+
*/
|
|
104
|
+
record: (durationMs: number) => void;
|
|
105
|
+
}
|
|
106
|
+
/** Creates the app's probes. `probe` is a function property, so destructuring it works. */
|
|
107
|
+
export interface Profiler {
|
|
108
|
+
/**
|
|
109
|
+
* Returns the probe for a name. The same name always gives the same probe, and only the
|
|
110
|
+
* options from the first call count.
|
|
111
|
+
* @param name Probe name. A non-empty string.
|
|
112
|
+
* @param options Probe options.
|
|
113
|
+
* @returns The probe.
|
|
114
|
+
*/
|
|
115
|
+
probe: (name: string, options?: ProbeOptions) => Probe;
|
|
116
|
+
/**
|
|
117
|
+
* Calls a function and times it with the named probe. If the result has a `then` function,
|
|
118
|
+
* the span ends when it settles. Errors from the function go to the caller.
|
|
119
|
+
* @param name Probe name. A non-empty string.
|
|
120
|
+
* @param fn The function to call.
|
|
121
|
+
* @returns Whatever `fn` returned, or the result of its `then` call.
|
|
122
|
+
*/
|
|
123
|
+
time: <T>(name: string, fn: () => T) => T;
|
|
124
|
+
}
|
|
125
|
+
/** Instrument kind. */
|
|
126
|
+
export type InstrumentKind = "counter" | "gauge" | "histogram";
|
|
127
|
+
/** Instrument definition. A handle passes it to the meter on every call. */
|
|
128
|
+
export interface InstrumentDef {
|
|
129
|
+
/** Metric name. */
|
|
130
|
+
name: string;
|
|
131
|
+
/** Instrument kind. */
|
|
132
|
+
kind: InstrumentKind;
|
|
133
|
+
/** Unit of the values. */
|
|
134
|
+
unit: string;
|
|
135
|
+
/** A histogram's bucket boundaries. A counter and a gauge have none. */
|
|
136
|
+
boundaries: readonly number[];
|
|
137
|
+
/** True when the app gave the boundaries. Only those count against maxHistogramBoundaries. */
|
|
138
|
+
fromApp?: boolean;
|
|
139
|
+
}
|
package/dist/models/metric.d.ts
CHANGED
|
@@ -26,6 +26,15 @@ export interface Counter {
|
|
|
26
26
|
*/
|
|
27
27
|
add(value: number, attributes?: MetricAttributes): void;
|
|
28
28
|
}
|
|
29
|
+
/** Gauge that keeps the last value for each attribute set. The library sends it every interval. */
|
|
30
|
+
export interface Gauge {
|
|
31
|
+
/**
|
|
32
|
+
* Sets the value of an attribute set. The last value in an interval goes out.
|
|
33
|
+
* @param value Finite number.
|
|
34
|
+
* @param attributes The point's attribute set.
|
|
35
|
+
*/
|
|
36
|
+
set(value: number, attributes?: MetricAttributes): void;
|
|
37
|
+
}
|
|
29
38
|
/** Histogram that counts its values into buckets in memory. Sends one point every interval. */
|
|
30
39
|
export interface Histogram {
|
|
31
40
|
/**
|
|
@@ -114,7 +123,7 @@ export interface Profiler {
|
|
|
114
123
|
time: <T>(name: string, fn: () => T) => T;
|
|
115
124
|
}
|
|
116
125
|
/** Instrument kind. */
|
|
117
|
-
export type InstrumentKind = "counter" | "histogram";
|
|
126
|
+
export type InstrumentKind = "counter" | "gauge" | "histogram";
|
|
118
127
|
/** Instrument definition. A handle passes it to the meter on every call. */
|
|
119
128
|
export interface InstrumentDef {
|
|
120
129
|
/** Metric name. */
|
|
@@ -123,6 +132,8 @@ export interface InstrumentDef {
|
|
|
123
132
|
kind: InstrumentKind;
|
|
124
133
|
/** Unit of the values. */
|
|
125
134
|
unit: string;
|
|
126
|
-
/** A histogram's bucket boundaries. A counter
|
|
135
|
+
/** A histogram's bucket boundaries. A counter and a gauge have none. */
|
|
127
136
|
boundaries: readonly number[];
|
|
137
|
+
/** True when the app gave the boundaries. Only those count against maxHistogramBoundaries. */
|
|
138
|
+
fromApp?: boolean;
|
|
128
139
|
}
|