@utk09/ui-observability 1.1.0 → 1.2.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 +42 -0
- package/dist/{batch-D3NHhF9L.js → batch-120Kc9jr.js} +3 -3
- package/dist/{batch-D3NHhF9L.js.map → batch-120Kc9jr.js.map} +1 -1
- package/dist/{batch-DnYRJqhU.cjs → batch-C3uNp5kU.cjs} +2 -2
- package/dist/{batch-DnYRJqhU.cjs.map → batch-C3uNp5kU.cjs.map} +1 -1
- package/dist/bus/bus.d.cts +5 -0
- package/dist/bus/bus.d.ts +5 -0
- package/dist/bus-Dj8IEVcC.cjs +2 -0
- package/dist/bus-Dj8IEVcC.cjs.map +1 -0
- package/dist/{bus-dw7T92sO.js → bus-DyNafxZN.js} +104 -94
- package/dist/bus-DyNafxZN.js.map +1 -0
- package/dist/capture/errors.d.cts +10 -0
- package/dist/capture/errors.d.ts +10 -0
- package/dist/capture/replay.d.cts +1 -1
- package/dist/capture/replay.d.ts +1 -1
- package/dist/capture/types.d.cts +5 -0
- package/dist/capture/types.d.ts +5 -0
- package/dist/capture/web-vitals.d.cts +1 -0
- package/dist/capture/web-vitals.d.ts +1 -0
- package/dist/{compression-SHPAvS4U.js → compression-BWkDWY3v.js} +2 -2
- package/dist/{compression-SHPAvS4U.js.map → compression-BWkDWY3v.js.map} +1 -1
- package/dist/{compression-C0hUHKR-.cjs → compression-CEVe7NPX.cjs} +2 -2
- package/dist/{compression-C0hUHKR-.cjs.map → compression-CEVe7NPX.cjs.map} +1 -1
- package/dist/config-C0PtemvC.cjs +2 -0
- package/dist/config-C0PtemvC.cjs.map +1 -0
- package/dist/{config-CSNcS7OZ.js → config-DK1Zf7jn.js} +83 -85
- package/dist/config-DK1Zf7jn.js.map +1 -0
- package/dist/{console-BsM-fSCQ.js → console-CAyCQOpm.js} +5 -5
- package/dist/{console-BsM-fSCQ.js.map → console-CAyCQOpm.js.map} +1 -1
- package/dist/{console-Dkxs6IVQ.cjs → console-Dk6GH4yj.cjs} +2 -2
- package/dist/{console-Dkxs6IVQ.cjs.map → console-Dk6GH4yj.cjs.map} +1 -1
- package/dist/{constants-BwJDXzj6.js → constants-CEHN6KuY.js} +42 -21
- package/dist/constants-CEHN6KuY.js.map +1 -0
- package/dist/constants-NtiQDWL_.cjs +2 -0
- package/dist/constants-NtiQDWL_.cjs.map +1 -0
- package/dist/constants.d.cts +11 -0
- package/dist/constants.d.ts +11 -0
- package/dist/core/config.d.cts +9 -3
- package/dist/core/config.d.ts +9 -3
- package/dist/core/diagnostics.d.cts +1 -1
- package/dist/core/diagnostics.d.ts +1 -1
- package/dist/core/pipeline.d.cts +11 -0
- package/dist/core/pipeline.d.ts +11 -0
- package/dist/core/record.d.cts +2 -2
- package/dist/core/record.d.ts +2 -2
- package/dist/core/sender.d.cts +3 -2
- package/dist/core/sender.d.ts +3 -2
- package/dist/{debug-bundle-B2v6Cym-.cjs → debug-bundle-DMzUfiQc.cjs} +2 -2
- package/dist/{debug-bundle-B2v6Cym-.cjs.map → debug-bundle-DMzUfiQc.cjs.map} +1 -1
- package/dist/{debug-bundle-Cs_YWzTa.js → debug-bundle-w78W46zr.js} +4 -4
- package/dist/{debug-bundle-Cs_YWzTa.js.map → debug-bundle-w78W46zr.js.map} +1 -1
- package/dist/doctor.cjs +1 -1
- package/dist/doctor.js +22 -22
- package/dist/doctor.js.map +1 -1
- package/dist/errors-07pmZ7VY.cjs +3 -0
- package/dist/errors-07pmZ7VY.cjs.map +1 -0
- package/dist/{errors-Q3Ng1ciC.js → errors-C-LYbqyB.js} +27 -24
- package/dist/errors-C-LYbqyB.js.map +1 -0
- package/dist/{factory-DV17sm2p.js → factory-BHYrcSaU.js} +42 -31
- package/dist/factory-BHYrcSaU.js.map +1 -0
- package/dist/factory-DsaNdcXp.cjs +2 -0
- package/dist/factory-DsaNdcXp.cjs.map +1 -0
- package/dist/{identity-BgtHyY4u.js → identity-Byh3gCdT.js} +11 -11
- package/dist/{identity-BgtHyY4u.js.map → identity-Byh3gCdT.js.map} +1 -1
- package/dist/{identity-CvuyqZk7.cjs → identity-BzAzdQyv.cjs} +2 -2
- package/dist/{identity-CvuyqZk7.cjs.map → identity-BzAzdQyv.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +539 -534
- package/dist/index.js.map +1 -1
- package/dist/{indexeddb-storage-e-13ZLWm.js → indexeddb-storage-BYywz-v6.js} +4 -4
- package/dist/{indexeddb-storage-e-13ZLWm.js.map → indexeddb-storage-BYywz-v6.js.map} +1 -1
- package/dist/{indexeddb-storage-D4KVcqdD.cjs → indexeddb-storage-BfqGkLFe.cjs} +2 -2
- package/dist/{indexeddb-storage-D4KVcqdD.cjs.map → indexeddb-storage-BfqGkLFe.cjs.map} +1 -1
- package/dist/{interactions-OK85T-Dk.cjs → interactions-BXzEel4F.cjs} +2 -2
- package/dist/interactions-BXzEel4F.cjs.map +1 -0
- package/dist/{interactions-Byxf1C82.js → interactions-DdKPMWIN.js} +12 -12
- package/dist/interactions-DdKPMWIN.js.map +1 -0
- package/dist/{journey-nMbob3OB.cjs → journey-BUmsrgaw.cjs} +2 -2
- package/dist/{journey-nMbob3OB.cjs.map → journey-BUmsrgaw.cjs.map} +1 -1
- package/dist/{journey-C93FTYcs.js → journey-Nu655gEO.js} +3 -3
- package/dist/{journey-C93FTYcs.js.map → journey-Nu655gEO.js.map} +1 -1
- package/dist/{library-console-DJUQzcgM.cjs → library-console-DdIlzzph.cjs} +2 -2
- package/dist/{library-console-DJUQzcgM.cjs.map → library-console-DdIlzzph.cjs.map} +1 -1
- package/dist/{library-console-DklSmucS.js → library-console-amePMnP8.js} +2 -2
- package/dist/{library-console-DklSmucS.js.map → library-console-amePMnP8.js.map} +1 -1
- package/dist/{library-request-UGEwOHpf.js → library-request-Cv7C05jf.js} +2 -2
- package/dist/{library-request-UGEwOHpf.js.map → library-request-Cv7C05jf.js.map} +1 -1
- package/dist/{library-request-kY9iTpIF.cjs → library-request-DO3Ec7KE.cjs} +2 -2
- package/dist/{library-request-kY9iTpIF.cjs.map → library-request-DO3Ec7KE.cjs.map} +1 -1
- package/dist/{lifecycle-DaMdH_X7.cjs → lifecycle-B5yfH5is.cjs} +2 -2
- package/dist/{lifecycle-DaMdH_X7.cjs.map → lifecycle-B5yfH5is.cjs.map} +1 -1
- package/dist/{lifecycle-B2PlIuQu.js → lifecycle-CMHz2Zbs.js} +2 -2
- package/dist/{lifecycle-B2PlIuQu.js.map → lifecycle-CMHz2Zbs.js.map} +1 -1
- package/dist/{log-record-DSt2P-Sr.js → log-record-B_nSqxoe.js} +2 -2
- package/dist/{log-record-DSt2P-Sr.js.map → log-record-B_nSqxoe.js.map} +1 -1
- package/dist/{log-record-Bmx6etMh.cjs → log-record-Bdywwg0k.cjs} +2 -2
- package/dist/{log-record-Bmx6etMh.cjs.map → log-record-Bdywwg0k.cjs.map} +1 -1
- package/dist/{long-frames-Bamjs1WV.js → long-frames-6NGl1-uN.js} +3 -3
- package/dist/{long-frames-Bamjs1WV.js.map → long-frames-6NGl1-uN.js.map} +1 -1
- package/dist/{long-frames-lhtONgGt.cjs → long-frames-D9DfSWqv.cjs} +2 -2
- package/dist/{long-frames-lhtONgGt.cjs.map → long-frames-D9DfSWqv.cjs.map} +1 -1
- package/dist/models/config.d.cts +4 -3
- package/dist/models/config.d.ts +4 -3
- package/dist/{network-BCn8Gn47.cjs → network-BNHBI0Fc.cjs} +2 -2
- package/dist/{network-BCn8Gn47.cjs.map → network-BNHBI0Fc.cjs.map} +1 -1
- package/dist/{network-Cg1L2w2r.js → network-Cc3tSB7e.js} +13 -13
- package/dist/{network-Cg1L2w2r.js.map → network-Cc3tSB7e.js.map} +1 -1
- package/dist/{observed-windows-BrwaJNlj.js → observed-windows-8JtCsIr1.js} +3 -3
- package/dist/{observed-windows-BrwaJNlj.js.map → observed-windows-8JtCsIr1.js.map} +1 -1
- package/dist/{observed-windows-B3gJkdql.cjs → observed-windows-BlE25nrn.cjs} +2 -2
- package/dist/{observed-windows-B3gJkdql.cjs.map → observed-windows-BlE25nrn.cjs.map} +1 -1
- package/dist/openfin-Bxelt0yg.js.map +1 -1
- package/dist/openfin-DtH2f7zX.cjs.map +1 -1
- package/dist/{otlp-D6dRZyB8.js → otlp-Btix3EBa.js} +7 -7
- package/dist/{otlp-D6dRZyB8.js.map → otlp-Btix3EBa.js.map} +1 -1
- package/dist/{otlp-CrAWkQdO.cjs → otlp-CFSW-Dno.cjs} +2 -2
- package/dist/{otlp-CrAWkQdO.cjs.map → otlp-CFSW-Dno.cjs.map} +1 -1
- package/dist/patch-DlcKzIi-.cjs +2 -0
- package/dist/patch-DlcKzIi-.cjs.map +1 -0
- package/dist/patch-Sr1wKg7W.js +9 -0
- package/dist/patch-Sr1wKg7W.js.map +1 -0
- package/dist/platform-BZjp9wp1.cjs +2 -0
- package/dist/platform-BZjp9wp1.cjs.map +1 -0
- package/dist/{platform-8DLhjddo.js → platform-Dba6R3Hp.js} +22 -9
- package/dist/platform-Dba6R3Hp.js.map +1 -0
- package/dist/{profiler-BaXSqCfz.js → profiler-DNKcqu09.js} +19 -19
- package/dist/{profiler-BaXSqCfz.js.map → profiler-DNKcqu09.js.map} +1 -1
- package/dist/{profiler-BvWW2kNM.cjs → profiler-DpoPi1hH.cjs} +2 -2
- package/dist/{profiler-BvWW2kNM.cjs.map → profiler-DpoPi1hH.cjs.map} +1 -1
- package/dist/{profiler-frames-DeaBiB-5.cjs → profiler-frames-C9zJNd8_.cjs} +2 -2
- package/dist/{profiler-frames-DeaBiB-5.cjs.map → profiler-frames-C9zJNd8_.cjs.map} +1 -1
- package/dist/{profiler-frames-C4ySHN0X.js → profiler-frames-CGXZeZ_3.js} +4 -4
- package/dist/{profiler-frames-C4ySHN0X.js.map → profiler-frames-CGXZeZ_3.js.map} +1 -1
- package/dist/{remote-rules-Dq9xe7Qn.js → remote-rules-DNK96vLa.js} +15 -15
- package/dist/{remote-rules-Dq9xe7Qn.js.map → remote-rules-DNK96vLa.js.map} +1 -1
- package/dist/{remote-rules-D7L6D_D2.cjs → remote-rules-DuMFRlit.cjs} +2 -2
- package/dist/{remote-rules-D7L6D_D2.cjs.map → remote-rules-DuMFRlit.cjs.map} +1 -1
- package/dist/replay-Cab-lSit.cjs +2 -0
- package/dist/replay-Cab-lSit.cjs.map +1 -0
- package/dist/{replay-B0M8kWz_.js → replay-Dy6OiaOZ.js} +89 -62
- package/dist/replay-Dy6OiaOZ.js.map +1 -0
- package/dist/{reports-ojuMKGO7.cjs → reports-CGK9YQch.cjs} +2 -2
- package/dist/{reports-ojuMKGO7.cjs.map → reports-CGK9YQch.cjs.map} +1 -1
- package/dist/{reports--8APRLa-.js → reports-CX57-S9s.js} +3 -3
- package/dist/{reports--8APRLa-.js.map → reports-CX57-S9s.js.map} +1 -1
- package/dist/{resource-timing-BzR05rE-.js → resource-timing-CWVDCbrY.js} +4 -4
- package/dist/{resource-timing-BzR05rE-.js.map → resource-timing-CWVDCbrY.js.map} +1 -1
- package/dist/{resource-timing-pAG3ZhB5.cjs → resource-timing-DalulXiR.cjs} +2 -2
- package/dist/{resource-timing-pAG3ZhB5.cjs.map → resource-timing-DalulXiR.cjs.map} +1 -1
- package/dist/response-body-Cpz5__4g.cjs +3 -0
- package/dist/response-body-Cpz5__4g.cjs.map +1 -0
- package/dist/{response-body-BWvwKQ2p.js → response-body-yi92Rpvo.js} +100 -100
- package/dist/response-body-yi92Rpvo.js.map +1 -0
- package/dist/{rotation-BylN1B9e.js → rotation-ChBbNDE2.js} +24 -24
- package/dist/rotation-ChBbNDE2.js.map +1 -0
- package/dist/rotation-fTnNJcfH.cjs +2 -0
- package/dist/rotation-fTnNJcfH.cjs.map +1 -0
- package/dist/{sampling-zXA6r-Nw.js → sampling-DZTOD28D.js} +6 -6
- package/dist/{sampling-zXA6r-Nw.js.map → sampling-DZTOD28D.js.map} +1 -1
- package/dist/{sampling-B46LW0cy.cjs → sampling-wAVJIZXp.cjs} +2 -2
- package/dist/{sampling-B46LW0cy.cjs.map → sampling-wAVJIZXp.cjs.map} +1 -1
- package/dist/{sanitize-DjnR6RXR.js → sanitize-B2GKlSFp.js} +2 -2
- package/dist/{sanitize-DjnR6RXR.js.map → sanitize-B2GKlSFp.js.map} +1 -1
- package/dist/{sanitize-Qj6LuZqp.cjs → sanitize-BZdhoghq.cjs} +2 -2
- package/dist/{sanitize-Qj6LuZqp.cjs.map → sanitize-BZdhoghq.cjs.map} +1 -1
- package/dist/{sender-Bdp-TAS4.js → sender-BRSpc7R8.js} +175 -161
- package/dist/sender-BRSpc7R8.js.map +1 -0
- package/dist/sender-CFu98DAB.cjs +2 -0
- package/dist/sender-CFu98DAB.cjs.map +1 -0
- package/dist/storage/emergency-queue.d.cts +3 -1
- package/dist/storage/emergency-queue.d.ts +3 -1
- package/dist/storage/stored-context.d.cts +3 -2
- package/dist/storage/stored-context.d.ts +3 -2
- package/dist/stored-context-CPLlzgpm.cjs +2 -0
- package/dist/stored-context-CPLlzgpm.cjs.map +1 -0
- package/dist/{stored-context-CSttrAsw.js → stored-context-df1dEnht.js} +10 -8
- package/dist/stored-context-df1dEnht.js.map +1 -0
- package/dist/{storm-DKlpv0FL.js → storm-U3_ek1nA.js} +2 -2
- package/dist/{storm-DKlpv0FL.js.map → storm-U3_ek1nA.js.map} +1 -1
- package/dist/{storm-BHgI12iS.cjs → storm-qiE_AMC7.cjs} +2 -2
- package/dist/{storm-BHgI12iS.cjs.map → storm-qiE_AMC7.cjs.map} +1 -1
- package/dist/transport/exit-flush.d.cts +23 -0
- package/dist/transport/exit-flush.d.ts +23 -0
- package/dist/transport/http-transport.d.cts +3 -2
- package/dist/transport/http-transport.d.ts +3 -2
- package/dist/transport/retry-engine.d.cts +11 -3
- package/dist/transport/retry-engine.d.ts +11 -3
- package/dist/types-BAerHgCq.js.map +1 -1
- package/dist/types-C7WNpnG1.cjs.map +1 -1
- package/dist/{unclean-exit-BcOB8A2e.js → unclean-exit-Bj6gYHeL.js} +2 -2
- package/dist/{unclean-exit-BcOB8A2e.js.map → unclean-exit-Bj6gYHeL.js.map} +1 -1
- package/dist/{unclean-exit-BYPYYkQ5.cjs → unclean-exit-CuBh-ee5.cjs} +2 -2
- package/dist/{unclean-exit-BYPYYkQ5.cjs.map → unclean-exit-CuBh-ee5.cjs.map} +1 -1
- package/dist/{user-timing-BsU2wQKE.cjs → user-timing-BWqzYF2Q.cjs} +2 -2
- package/dist/{user-timing-BsU2wQKE.cjs.map → user-timing-BWqzYF2Q.cjs.map} +1 -1
- package/dist/{user-timing-4KIJ74Vi.js → user-timing-Duz0d-OA.js} +2 -2
- package/dist/{user-timing-4KIJ74Vi.js.map → user-timing-Duz0d-OA.js.map} +1 -1
- package/dist/utils/lock.d.cts +3 -2
- package/dist/utils/lock.d.ts +3 -2
- package/dist/utils/openfin.d.cts +18 -6
- package/dist/utils/openfin.d.ts +18 -6
- package/dist/utils/patch.d.cts +1 -1
- package/dist/utils/patch.d.ts +1 -1
- package/dist/utils/platform.d.cts +6 -0
- package/dist/utils/platform.d.ts +6 -0
- package/dist/{web-socket-Zg0hj1LB.js → web-socket-CE_9Q22z.js} +5 -5
- package/dist/{web-socket-Zg0hj1LB.js.map → web-socket-CE_9Q22z.js.map} +1 -1
- package/dist/{web-socket-Cs1ZbmmN.cjs → web-socket-sm3rD-A_.cjs} +2 -2
- package/dist/{web-socket-Cs1ZbmmN.cjs.map → web-socket-sm3rD-A_.cjs.map} +1 -1
- package/dist/{web-vitals-4pWACwaR.js → web-vitals-CGwXGF-M.js} +4 -4
- package/dist/web-vitals-CGwXGF-M.js.map +1 -0
- package/dist/web-vitals-Df4Wsfx9.cjs +2 -0
- package/dist/web-vitals-Df4Wsfx9.cjs.map +1 -0
- package/dist/{worker-protocol-DFYXIFus.cjs → worker-protocol-D5VnCdWY.cjs} +2 -2
- package/dist/{worker-protocol-DFYXIFus.cjs.map → worker-protocol-D5VnCdWY.cjs.map} +1 -1
- package/dist/{worker-protocol-CYpAbrVl.js → worker-protocol-h4-tRWqy.js} +6 -6
- package/dist/{worker-protocol-CYpAbrVl.js.map → worker-protocol-h4-tRWqy.js.map} +1 -1
- package/dist/{worker-server--yGTadTA.cjs → worker-server-CF1yatXq.cjs} +2 -2
- package/dist/{worker-server--yGTadTA.cjs.map → worker-server-CF1yatXq.cjs.map} +1 -1
- package/dist/worker-server-FYfKHQhJ.js +94 -0
- package/dist/{worker-server-BokySIII.js.map → worker-server-FYfKHQhJ.js.map} +1 -1
- package/dist/{worker-transport-BdEvh_-a.cjs → worker-transport-COgY4RX8.cjs} +2 -2
- package/dist/{worker-transport-BdEvh_-a.cjs.map → worker-transport-COgY4RX8.cjs.map} +1 -1
- package/dist/{worker-transport-JK-Fby9J.js → worker-transport-jzX1IusG.js} +34 -34
- package/dist/{worker-transport-JK-Fby9J.js.map → worker-transport-jzX1IusG.js.map} +1 -1
- package/llms.txt +1 -2
- package/package.json +1 -1
- package/dist/bus-B__467mL.cjs +0 -2
- package/dist/bus-B__467mL.cjs.map +0 -1
- package/dist/bus-dw7T92sO.js.map +0 -1
- package/dist/config-CSNcS7OZ.js.map +0 -1
- package/dist/config-CybPP5VM.cjs +0 -2
- package/dist/config-CybPP5VM.cjs.map +0 -1
- package/dist/constants-BwJDXzj6.js.map +0 -1
- package/dist/constants-CtF52hIV.cjs +0 -2
- package/dist/constants-CtF52hIV.cjs.map +0 -1
- package/dist/errors-DP2RUm4V.cjs +0 -3
- package/dist/errors-DP2RUm4V.cjs.map +0 -1
- package/dist/errors-Q3Ng1ciC.js.map +0 -1
- package/dist/factory-DV17sm2p.js.map +0 -1
- package/dist/factory-K8O6gpux.cjs +0 -2
- package/dist/factory-K8O6gpux.cjs.map +0 -1
- package/dist/interactions-Byxf1C82.js.map +0 -1
- package/dist/interactions-OK85T-Dk.cjs.map +0 -1
- package/dist/patch-BX8KrPCT.cjs +0 -2
- package/dist/patch-BX8KrPCT.cjs.map +0 -1
- package/dist/patch-UdPz1ea8.js +0 -8
- package/dist/patch-UdPz1ea8.js.map +0 -1
- package/dist/platform-8DLhjddo.js.map +0 -1
- package/dist/platform-BqRc-7RO.cjs +0 -2
- package/dist/platform-BqRc-7RO.cjs.map +0 -1
- package/dist/replay-B0M8kWz_.js.map +0 -1
- package/dist/replay-QOFBpAXh.cjs +0 -2
- package/dist/replay-QOFBpAXh.cjs.map +0 -1
- package/dist/response-body-BWvwKQ2p.js.map +0 -1
- package/dist/response-body-CKEJ5itk.cjs +0 -3
- package/dist/response-body-CKEJ5itk.cjs.map +0 -1
- package/dist/rotation-BylN1B9e.js.map +0 -1
- package/dist/rotation-E2eKClIs.cjs +0 -2
- package/dist/rotation-E2eKClIs.cjs.map +0 -1
- package/dist/sender-Bdp-TAS4.js.map +0 -1
- package/dist/sender-DR7ZycZY.cjs +0 -2
- package/dist/sender-DR7ZycZY.cjs.map +0 -1
- package/dist/stored-context-BOu54M8Y.cjs +0 -2
- package/dist/stored-context-BOu54M8Y.cjs.map +0 -1
- package/dist/stored-context-CSttrAsw.js.map +0 -1
- package/dist/web-vitals-4pWACwaR.js.map +0 -1
- package/dist/web-vitals-__X7t4pj.cjs +0 -2
- package/dist/web-vitals-__X7t4pj.cjs.map +0 -1
- package/dist/worker-server-BokySIII.js +0 -94
package/dist/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { An as e, At as t, Bt as n, Cn as r,
|
|
2
|
-
import { n as
|
|
3
|
-
import { n as
|
|
4
|
-
import { n as
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import { a as
|
|
9
|
-
import { t as
|
|
10
|
-
import { n as
|
|
11
|
-
import { i as
|
|
12
|
-
import { r as
|
|
13
|
-
import { n as
|
|
14
|
-
import { r as
|
|
15
|
-
import { n as
|
|
16
|
-
import { a as
|
|
17
|
-
import { r as
|
|
1
|
+
import { An as e, At as t, Bt as n, Cn as r, En as i, Gn as a, In as o, J as s, K as c, Kn as l, Ln as u, M as d, Mt as f, On as p, P as m, Pn as h, Rt as g, Sn as _, St as v, Tn as y, Vt as ee, X as te, Y as ne, Yn as re, _ as ie, a as b, ar as ae, bn as oe, c as x, d as se, dn as ce, dr as le, f as S, g as C, h as w, ir as T, it as ue, j as de, jn as fe, kn as pe, kt as me, m as he, nr as ge, o as _e, or as ve, ot as ye, p as be, q as xe, rr as Se, s as Ce, sr as we, u as Te, un as Ee, ur as De, v as E, vn as Oe, wn as ke, xn as Ae, y as je, yn as Me } from "./constants-CEHN6KuY.js";
|
|
2
|
+
import { n as Ne, r as Pe, t as Fe } from "./log-record-B_nSqxoe.js";
|
|
3
|
+
import { n as Ie, r as Le, t as Re } from "./error-like-B11pB4aL.js";
|
|
4
|
+
import { n as D, t as ze } from "./guards-BlYGRK4l.js";
|
|
5
|
+
import { t as O } from "./unref-DgHPQeWv.js";
|
|
6
|
+
import { a as Be, n as Ve, t as He } from "./platform-Dba6R3Hp.js";
|
|
7
|
+
import { t as k } from "./defineProperty-s2S8BXUc.js";
|
|
8
|
+
import { a as Ue, i as A, n as We, o as Ge, r as Ke, s as qe, t as Je } from "./identity-Byh3gCdT.js";
|
|
9
|
+
import { t as j } from "./profiler-DNKcqu09.js";
|
|
10
|
+
import { n as M, t as Ye } from "./library-console-amePMnP8.js";
|
|
11
|
+
import { i as Xe, n as Ze, r as N } from "./sanitize-B2GKlSFp.js";
|
|
12
|
+
import { r as Qe } from "./library-request-Cv7C05jf.js";
|
|
13
|
+
import { n as $e, r as P, t as F } from "./config-DK1Zf7jn.js";
|
|
14
|
+
import { r as et, t as tt } from "./batch-120Kc9jr.js";
|
|
15
|
+
import { n as nt, t as rt } from "./journey-Nu655gEO.js";
|
|
16
|
+
import { a as it, i as at, n as ot, o as st } from "./sampling-DZTOD28D.js";
|
|
17
|
+
import { r as ct } from "./observed-windows-8JtCsIr1.js";
|
|
18
18
|
// src/core/deferred.ts
|
|
19
|
-
var
|
|
20
|
-
function
|
|
19
|
+
var I = /* @__PURE__ */ new WeakMap();
|
|
20
|
+
function lt(e) {
|
|
21
21
|
let t = e.idle;
|
|
22
22
|
t !== void 0 && (e.diagnostics.guard("pipeline.crashed", "The idle callback could not be cancelled.", () => {
|
|
23
23
|
cancelIdleCallback(t);
|
|
24
24
|
}), e.idle = void 0), clearTimeout(e.timer), e.timer = void 0;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function ut(e, t) {
|
|
27
27
|
typeof requestIdleCallback == "function" && typeof cancelIdleCallback == "function" && (t.idle = t.diagnostics.guard("pipeline.crashed", "The idle callback could not be scheduled.", () => requestIdleCallback((n) => {
|
|
28
|
-
|
|
29
|
-
}, { timeout:
|
|
30
|
-
|
|
31
|
-
}, 0),
|
|
32
|
-
}
|
|
33
|
-
function
|
|
34
|
-
if (
|
|
35
|
-
|
|
28
|
+
L(e, t, n);
|
|
29
|
+
}, { timeout: xe })), t.idle !== void 0) || (t.timer = setTimeout(() => {
|
|
30
|
+
L(e, t);
|
|
31
|
+
}, 0), O(t.timer));
|
|
32
|
+
}
|
|
33
|
+
function L(e, t, n) {
|
|
34
|
+
if (I.get(e) !== t || t.draining) return;
|
|
35
|
+
lt(t), t.draining = !0;
|
|
36
36
|
let r = t.work;
|
|
37
37
|
t.work = [];
|
|
38
38
|
let i = 0;
|
|
39
|
-
for (; i < r.length && (!n || n.didTimeout && i === 0 || n.timeRemaining() > 0);) if (t.diagnostics.guard("pipeline.crashed", "The library could not build a deferred record.", r[i]), i++,
|
|
40
|
-
t.work = [...r.slice(i), ...t.work], t.draining = !1, t.work.length > 0 ?
|
|
39
|
+
for (; i < r.length && (!n || n.didTimeout && i === 0 || n.timeRemaining() > 0);) if (t.diagnostics.guard("pipeline.crashed", "The library could not build a deferred record.", r[i]), i++, I.get(e) !== t) return;
|
|
40
|
+
t.work = [...r.slice(i), ...t.work], t.draining = !1, t.work.length > 0 ? ut(e, t) : I.delete(e);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
let i =
|
|
44
|
-
if (i && i.work.length >= a && !i.draining && (
|
|
42
|
+
function dt(e, t, n, r) {
|
|
43
|
+
let i = I.get(e), a = r === null ? s : Math.min(r, s);
|
|
44
|
+
if (i && i.work.length >= a && !i.draining && (L(e, i), i = I.get(e)), i) {
|
|
45
45
|
if (i.work.length >= a) {
|
|
46
46
|
n.count("record.dropped_by_ceiling");
|
|
47
47
|
return;
|
|
@@ -51,29 +51,29 @@ function pt(e, t, n, r) {
|
|
|
51
51
|
work: [t],
|
|
52
52
|
diagnostics: n,
|
|
53
53
|
draining: !1
|
|
54
|
-
},
|
|
54
|
+
}, I.set(e, i), ut(e, i);
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
let t =
|
|
58
|
-
t &&
|
|
56
|
+
function R(e) {
|
|
57
|
+
let t = I.get(e);
|
|
58
|
+
t && L(e, t);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
let t =
|
|
60
|
+
function ft(e) {
|
|
61
|
+
let t = I.get(e);
|
|
62
62
|
if (t) {
|
|
63
|
-
|
|
63
|
+
lt(t), I.delete(e);
|
|
64
64
|
for (let e of t.work) t.diagnostics.count("record.dropped_by_ceiling");
|
|
65
65
|
t.work = [];
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
// src/core/logger.ts
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
var pt = [
|
|
70
|
+
m,
|
|
71
|
+
re,
|
|
72
|
+
ne
|
|
73
73
|
];
|
|
74
|
-
function
|
|
74
|
+
function mt(e, t) {
|
|
75
75
|
let n = t.guard("record.sanitize_failed", "The library could not read the error reason.", () => {
|
|
76
|
-
if (!(e instanceof Error) && !
|
|
76
|
+
if (!(e instanceof Error) && !Le(e)) return;
|
|
77
77
|
let t = Error(e.message);
|
|
78
78
|
return t.name = e.name, t.stack = e.stack, t;
|
|
79
79
|
});
|
|
@@ -81,50 +81,50 @@ function gt(e, t) {
|
|
|
81
81
|
let r = t.guard("record.sanitize_failed", "The library could not convert the error reason to text.", () => String(e));
|
|
82
82
|
return Error(r ?? typeof e);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function ht(e, t, n) {
|
|
85
85
|
return n.guard("record.sanitize_failed", "The library could not read the error reason.", () => e instanceof Error ? e : t) ?? t;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function gt(e, t) {
|
|
88
88
|
if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" || typeof e == "symbol") return e;
|
|
89
89
|
if (typeof e == "object" && e) return t.guard("record.sanitize_failed", "The library could not read the properties of the error reason.", () => {
|
|
90
|
-
let t = e, n =
|
|
90
|
+
let t = e, n = Le(e), r = {}, i = 0;
|
|
91
91
|
for (let e of Object.keys(t)) {
|
|
92
92
|
let a = t[e];
|
|
93
|
-
n &&
|
|
93
|
+
n && Re.has(e) || !Ie(a) || (r[e] = a, i++);
|
|
94
94
|
}
|
|
95
95
|
return i === 0 ? void 0 : r;
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
if (!
|
|
98
|
+
function _t(e) {
|
|
99
|
+
if (!D(e) || e instanceof Error) return !1;
|
|
100
100
|
let t = Object.getPrototypeOf(e);
|
|
101
101
|
return t === null || Object.getPrototypeOf(t) === null;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
return
|
|
103
|
+
function vt(e) {
|
|
104
|
+
return pt.some((t) => e === t || e.startsWith(`${t}.`)) ? "system" : "log";
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function z(e, t) {
|
|
107
107
|
return e === void 0 ? {} : t.guard("record.sanitize_failed", "The library could not read the payload.", () => ({ ...e })) ?? { "uiobs.sanitize_failed": !0 };
|
|
108
108
|
}
|
|
109
|
-
var
|
|
109
|
+
var B = class e {
|
|
110
110
|
constructor(e, t, n = {}) {
|
|
111
|
-
|
|
111
|
+
k(this, "bind", void 0), k(this, "namespace", void 0), k(this, "options", void 0), k(this, "levelType", void 0), k(this, "trace", (e, t) => {
|
|
112
112
|
this.write("TRACE", this.levelType, e, t);
|
|
113
|
-
}),
|
|
113
|
+
}), k(this, "debug", (e, t) => {
|
|
114
114
|
this.write("DEBUG", this.levelType, e, t);
|
|
115
|
-
}),
|
|
115
|
+
}), k(this, "info", (e, t) => {
|
|
116
116
|
this.write("INFO", this.levelType, e, t);
|
|
117
|
-
}),
|
|
117
|
+
}), k(this, "warn", (e, t) => {
|
|
118
118
|
this.write("WARN", this.levelType, e, t);
|
|
119
|
-
}),
|
|
119
|
+
}), k(this, "error", (e, t, n) => {
|
|
120
120
|
this.writeError("ERROR", e, t, n);
|
|
121
|
-
}),
|
|
121
|
+
}), k(this, "fatal", (e, t, n) => {
|
|
122
122
|
this.writeError("FATAL", e, t, n);
|
|
123
|
-
}),
|
|
123
|
+
}), k(this, "logAction", (e, t) => {
|
|
124
124
|
this.write("INFO", "action", e, t);
|
|
125
|
-
}),
|
|
125
|
+
}), k(this, "logEvent", (e, t) => {
|
|
126
126
|
this.write("INFO", "event", e, t);
|
|
127
|
-
}), this.bind = e, this.namespace = t, this.options = n, this.levelType =
|
|
127
|
+
}), this.bind = e, this.namespace = t, this.options = n, this.levelType = vt(t);
|
|
128
128
|
}
|
|
129
129
|
child(t, n = {}) {
|
|
130
130
|
return new e(this.bind, `${this.namespace}.${t}`, { scopedContext: {
|
|
@@ -144,13 +144,13 @@ var R = class e {
|
|
|
144
144
|
else if (e.config.payloadMode === "defer" && e.config.enabled && !e.config.debugBuffer.enabled && this.namespace !== "uiobs.diagnostics") {
|
|
145
145
|
if (!e.builder.isEnabled(t, this.namespace, n) && !this.mirrors(e, t)) return;
|
|
146
146
|
let i = e.journey.current(), a = {
|
|
147
|
-
timeUnixNano:
|
|
147
|
+
timeUnixNano: Pe(),
|
|
148
148
|
trace: e.tracing.resolve(),
|
|
149
149
|
journey: i ? { ...i } : null,
|
|
150
150
|
context: e.context.getAll(),
|
|
151
|
-
url:
|
|
151
|
+
url: He(e.diagnostics)
|
|
152
152
|
};
|
|
153
|
-
|
|
153
|
+
dt(e, () => {
|
|
154
154
|
r(a);
|
|
155
155
|
}, e.diagnostics, e.config.buffering.maxPendingRecords);
|
|
156
156
|
} else r();
|
|
@@ -168,7 +168,7 @@ var R = class e {
|
|
|
168
168
|
body: r,
|
|
169
169
|
namespace: this.namespace,
|
|
170
170
|
scoped: this.options.scopedContext,
|
|
171
|
-
payload: a ? i :
|
|
171
|
+
payload: a ? i : z(i, e.diagnostics)
|
|
172
172
|
}, { record: c, dropped: l } = e.builder.build(s), u = !!e.config.redact || e.config.processors.length > 0, d = n !== "metric" && e.config.captureLimits.breadcrumbs > 0, f = l === "sampling" && u && d ? e.builder.build(s, !0) : void 0, p = c ?? f?.record ?? null, m = p ? p.body : l === "sampling" && !u ? r : void 0;
|
|
173
173
|
d && m !== void 0 && e.breadcrumbs.push({
|
|
174
174
|
t: o ? Number(o.timeUnixNano.slice(0, -6)) : Date.now(),
|
|
@@ -185,12 +185,12 @@ var R = class e {
|
|
|
185
185
|
writeErrorNow(e, t, n, r, i, a) {
|
|
186
186
|
let o = e.builder.isEnabled(t, this.namespace);
|
|
187
187
|
if (!o && !this.mirrors(e, t)) return;
|
|
188
|
-
let s = i === void 0 && (e.diagnostics.guard("record.sanitize_failed", "The library could not read the error slot.", () =>
|
|
188
|
+
let s = i === void 0 && (e.diagnostics.guard("record.sanitize_failed", "The library could not read the error slot.", () => _t(r)) ?? !1), c = s ? r : i, l = s ? void 0 : r, u = l === void 0 ? void 0 : mt(l, e.diagnostics), d = u === void 0 ? void 0 : ht(l, u, e.diagnostics);
|
|
189
189
|
if (!o) {
|
|
190
190
|
this.print(e, t, n, c, d, null, void 0, a);
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
let f = u ?
|
|
193
|
+
let f = u ? gt(l, e.diagnostics) : void 0, { record: p, dropped: m } = e.builder.build({
|
|
194
194
|
snapshot: a,
|
|
195
195
|
level: t,
|
|
196
196
|
type: this.levelType,
|
|
@@ -198,14 +198,14 @@ var R = class e {
|
|
|
198
198
|
namespace: this.namespace,
|
|
199
199
|
scoped: this.options.scopedContext,
|
|
200
200
|
payload: {
|
|
201
|
-
...
|
|
201
|
+
...z(c, e.diagnostics),
|
|
202
202
|
...u ? {
|
|
203
203
|
"error.type": u.name,
|
|
204
204
|
"error.message": u.message,
|
|
205
205
|
"error.stack_trace": u.stack
|
|
206
206
|
} : {},
|
|
207
|
-
...f === void 0 ? {} : { [
|
|
208
|
-
[
|
|
207
|
+
...f === void 0 ? {} : { [se]: f },
|
|
208
|
+
[x]: e.breadcrumbs.snapshot()
|
|
209
209
|
}
|
|
210
210
|
});
|
|
211
211
|
this.print(e, t, n, c, d, p, m, a), e.emit(p);
|
|
@@ -228,7 +228,7 @@ var R = class e {
|
|
|
228
228
|
namespace: this.namespace,
|
|
229
229
|
scoped: this.options.scopedContext,
|
|
230
230
|
payload: {
|
|
231
|
-
...
|
|
231
|
+
...z(r, e.diagnostics),
|
|
232
232
|
...i ? {
|
|
233
233
|
"error.type": i.name,
|
|
234
234
|
"error.message": i.message,
|
|
@@ -241,17 +241,17 @@ var R = class e {
|
|
|
241
241
|
mirrors(e, t) {
|
|
242
242
|
return e.config.enabled && e.console.accepts(t);
|
|
243
243
|
}
|
|
244
|
-
},
|
|
244
|
+
}, yt = class extends B {
|
|
245
245
|
constructor(...e) {
|
|
246
|
-
super(...e),
|
|
246
|
+
super(...e), k(this, "logMetric", (e, t, r = c, i = "gauge", a, o) => {
|
|
247
247
|
if (!Number.isFinite(t)) {
|
|
248
248
|
this.bind().diagnostics.report("record.dropped_malformed", "The metric value is not a finite number. The library dropped the metric.", { "metric.name": e });
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
251
|
let s = this.bind();
|
|
252
252
|
this.submit(s, "INFO", "metric", (c) => {
|
|
253
|
-
let l =
|
|
254
|
-
...
|
|
253
|
+
let l = z(a, s.diagnostics), u = {
|
|
254
|
+
...z(o, s.diagnostics),
|
|
255
255
|
...l,
|
|
256
256
|
"metric.name": e,
|
|
257
257
|
"metric.value": t,
|
|
@@ -263,39 +263,39 @@ var R = class e {
|
|
|
263
263
|
});
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
|
-
},
|
|
267
|
-
function
|
|
268
|
-
return
|
|
266
|
+
}, bt = /^[0-9a-f]{32}$/, xt = /^[0-9a-f]{16}$/, St = /[1-9a-f]/;
|
|
267
|
+
function Ct(e) {
|
|
268
|
+
return bt.test(e.traceId) && St.test(e.traceId) && xt.test(e.spanId) && St.test(e.spanId);
|
|
269
269
|
}
|
|
270
|
-
function
|
|
271
|
-
return
|
|
270
|
+
function wt() {
|
|
271
|
+
return Ge(16);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
return
|
|
273
|
+
function Tt() {
|
|
274
|
+
return Ge(8);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function Et(e) {
|
|
277
277
|
return {
|
|
278
|
-
traceId:
|
|
279
|
-
spanId:
|
|
278
|
+
traceId: wt(),
|
|
279
|
+
spanId: Tt(),
|
|
280
280
|
traceFlags: 1,
|
|
281
281
|
startedAt: Date.now(),
|
|
282
282
|
reason: e,
|
|
283
283
|
ended: !1
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function Dt(e, t, n) {
|
|
287
287
|
return `00-${e}-${t}-${(n & 255).toString(16).padStart(2, "0")}`;
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function Ot(e) {
|
|
290
290
|
return {
|
|
291
291
|
traceId: e.traceId,
|
|
292
292
|
spanId: e.spanId,
|
|
293
293
|
traceFlags: e.traceFlags
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
|
-
var
|
|
297
|
-
constructor(e, t =
|
|
298
|
-
|
|
296
|
+
var kt = class {
|
|
297
|
+
constructor(e, t = ve, n, r) {
|
|
298
|
+
k(this, "diagnostics", void 0), k(this, "maxAgeMs", void 0), k(this, "load", void 0), k(this, "spans", void 0), k(this, "ambient", Et("start")), k(this, "otel", void 0), this.diagnostics = e, this.maxAgeMs = t, this.load = n, this.spans = r;
|
|
299
299
|
}
|
|
300
300
|
setup(e, t) {
|
|
301
301
|
this.maxAgeMs = e, this.load = t;
|
|
@@ -311,7 +311,7 @@ var jt = class {
|
|
|
311
311
|
return this.activeSpanContext() ?? this.ambientContext();
|
|
312
312
|
}
|
|
313
313
|
ambientContext() {
|
|
314
|
-
return Date.now() - this.ambient.startedAt > this.maxAgeMs && this.rotate("maxAge"),
|
|
314
|
+
return Date.now() - this.ambient.startedAt > this.maxAgeMs && this.rotate("maxAge"), Ot(this.ambient);
|
|
315
315
|
}
|
|
316
316
|
activeSpanContext() {
|
|
317
317
|
let e = this.otel;
|
|
@@ -319,7 +319,7 @@ var jt = class {
|
|
|
319
319
|
let t = e.trace.getActiveSpan();
|
|
320
320
|
if (t === void 0) return;
|
|
321
321
|
let n = t.spanContext();
|
|
322
|
-
if (
|
|
322
|
+
if (Ct(n)) return {
|
|
323
323
|
traceId: n.traceId,
|
|
324
324
|
spanId: n.spanId,
|
|
325
325
|
traceFlags: n.traceFlags
|
|
@@ -328,8 +328,8 @@ var jt = class {
|
|
|
328
328
|
}
|
|
329
329
|
rotate(e) {
|
|
330
330
|
let t = this.ambient;
|
|
331
|
-
this.ambient =
|
|
332
|
-
let n =
|
|
331
|
+
this.ambient = Et(e);
|
|
332
|
+
let n = Ot(this.ambient);
|
|
333
333
|
return this.finish(t), n;
|
|
334
334
|
}
|
|
335
335
|
end() {
|
|
@@ -356,9 +356,9 @@ var jt = class {
|
|
|
356
356
|
n.propagation.inject(n.context.active(), t);
|
|
357
357
|
}), t.traceparent) return { headers: t };
|
|
358
358
|
let r = this.activeSpanContext(), i = r ?? this.ambientContext(), a = r ? void 0 : this.spans;
|
|
359
|
-
if (!a?.enabled()) return t[
|
|
360
|
-
let o = a.keeps(i.traceId), s = o ? i.traceFlags : i.traceFlags & -2, c = e ?
|
|
361
|
-
return t[
|
|
359
|
+
if (!a?.enabled()) return t[ae] = Dt(i.traceId, i.spanId, i.traceFlags), { headers: t };
|
|
360
|
+
let o = a.keeps(i.traceId), s = o ? i.traceFlags : i.traceFlags & -2, c = e ? Tt() : i.spanId;
|
|
361
|
+
return t[ae] = Dt(i.traceId, c, s), !e || !o ? { headers: t } : {
|
|
362
362
|
headers: t,
|
|
363
363
|
span: {
|
|
364
364
|
traceId: i.traceId,
|
|
@@ -367,20 +367,20 @@ var jt = class {
|
|
|
367
367
|
}
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
|
-
},
|
|
370
|
+
}, At = {
|
|
371
371
|
name: "ui.measure.duration",
|
|
372
372
|
kind: "histogram",
|
|
373
373
|
unit: "ms",
|
|
374
374
|
boundaries: g
|
|
375
|
-
},
|
|
375
|
+
}, jt = {
|
|
376
376
|
name: "ui.measure.phase.duration",
|
|
377
377
|
kind: "histogram",
|
|
378
378
|
unit: "ms",
|
|
379
379
|
boundaries: g
|
|
380
380
|
};
|
|
381
|
-
function
|
|
381
|
+
function Mt(e, t, n, r) {
|
|
382
382
|
let i = String(e), a = Date.now(), o = performance.now(), s, c = !1, l = (e) => a + e - o, u = (e, a) => {
|
|
383
|
-
s &&= (r.metric(
|
|
383
|
+
s &&= (r.metric(jt, e - s.at, {
|
|
384
384
|
...t,
|
|
385
385
|
"measure.name": i,
|
|
386
386
|
"measure.phase": s.name
|
|
@@ -388,7 +388,7 @@ function Pt(e, t, n, r) {
|
|
|
388
388
|
name: s.name,
|
|
389
389
|
kind: "internal",
|
|
390
390
|
traceId: n.traceId,
|
|
391
|
-
spanId:
|
|
391
|
+
spanId: Tt(),
|
|
392
392
|
parentSpanId: n.spanId,
|
|
393
393
|
startMs: l(s.at),
|
|
394
394
|
endMs: l(e),
|
|
@@ -414,7 +414,7 @@ function Pt(e, t, n, r) {
|
|
|
414
414
|
...t,
|
|
415
415
|
"measure.outcome": e
|
|
416
416
|
};
|
|
417
|
-
r.metric(
|
|
417
|
+
r.metric(At, s - o, {
|
|
418
418
|
...f,
|
|
419
419
|
"measure.name": i
|
|
420
420
|
}), n && r.span({
|
|
@@ -429,7 +429,7 @@ function Pt(e, t, n, r) {
|
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function Nt(e, t, n) {
|
|
433
433
|
let r = "error";
|
|
434
434
|
try {
|
|
435
435
|
let i = t(), a = n.guard("record.sanitize_failed", "The library could not read what the function of the measure returned. The measure ends now.", () => i?.then);
|
|
@@ -443,33 +443,33 @@ function Ft(e, t, n) {
|
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
// src/core/meter.ts
|
|
446
|
-
var
|
|
447
|
-
|
|
448
|
-
S,
|
|
449
|
-
v,
|
|
446
|
+
var Pt = "overflow", Ft = /* @__PURE__ */ new Set([
|
|
447
|
+
C,
|
|
450
448
|
w,
|
|
451
449
|
b,
|
|
452
|
-
|
|
453
|
-
|
|
450
|
+
E,
|
|
451
|
+
S,
|
|
452
|
+
be,
|
|
453
|
+
he
|
|
454
454
|
]);
|
|
455
|
-
function
|
|
455
|
+
function It(e = {}) {
|
|
456
456
|
let t = {};
|
|
457
457
|
for (let n of Object.keys(e).sort()) {
|
|
458
|
-
if (n.startsWith("metric.") ||
|
|
458
|
+
if (n.startsWith("metric.") || Ft.has(n)) continue;
|
|
459
459
|
let r = e[n];
|
|
460
460
|
(typeof r == "string" || typeof r == "boolean" || typeof r == "number" && Number.isFinite(r)) && (t[n] = r);
|
|
461
461
|
}
|
|
462
462
|
return t;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function Lt(e, t) {
|
|
465
465
|
if (!Array.isArray(e)) return null;
|
|
466
466
|
let n = t === null ? e.length : Math.min(e.length, t + 1);
|
|
467
467
|
return Array.from({ length: n }, (t, n) => e[n]);
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function Rt(e, t) {
|
|
470
470
|
return Array.isArray(e) && (t === null || e.length <= t) && e.every((t, n) => typeof t == "number" && Number.isFinite(t) && (n === 0 || t > e[n - 1]));
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function zt(e, t, r) {
|
|
473
473
|
let i = {
|
|
474
474
|
"metric.name": e.name,
|
|
475
475
|
"metric.unit": e.unit,
|
|
@@ -487,7 +487,7 @@ function Vt(e, t, r) {
|
|
|
487
487
|
[n.buckets]: t.buckets
|
|
488
488
|
} : (i["metric.value"] = e.kind === "gauge" ? t.last : t.sum, i);
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function Bt(e, t) {
|
|
491
491
|
try {
|
|
492
492
|
return {
|
|
493
493
|
unit: e.unit,
|
|
@@ -500,28 +500,28 @@ function Ht(e, t) {
|
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function Vt(e, t, n, r) {
|
|
504
504
|
return {
|
|
505
505
|
name: e,
|
|
506
506
|
kind: t,
|
|
507
|
-
unit:
|
|
507
|
+
unit: Bt(n, r).unit ?? "count",
|
|
508
508
|
boundaries: []
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
|
-
function
|
|
512
|
-
let i =
|
|
511
|
+
function Ht(e, t, n, r) {
|
|
512
|
+
let i = Vt(e, "counter", t, r);
|
|
513
513
|
return { add: (e, t) => {
|
|
514
514
|
n(i, e, t);
|
|
515
515
|
} };
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
let i =
|
|
517
|
+
function Ut(e, t, n, r) {
|
|
518
|
+
let i = Vt(e, "gauge", t, r);
|
|
519
519
|
return { set: (e, t) => {
|
|
520
520
|
n(i, e, t);
|
|
521
521
|
} };
|
|
522
522
|
}
|
|
523
|
-
function
|
|
524
|
-
let { unit: i, boundaries: a } =
|
|
523
|
+
function Wt(e, t, n, r) {
|
|
524
|
+
let { unit: i, boundaries: a } = Bt(t, r), o = {
|
|
525
525
|
name: e,
|
|
526
526
|
kind: "histogram",
|
|
527
527
|
unit: i ?? "count",
|
|
@@ -532,32 +532,32 @@ function Kt(e, t, n, r) {
|
|
|
532
532
|
n(o, e, t);
|
|
533
533
|
} };
|
|
534
534
|
}
|
|
535
|
-
var
|
|
535
|
+
var Gt = class {
|
|
536
536
|
constructor(e, t, n, r = {
|
|
537
537
|
maxSeries: 100,
|
|
538
538
|
maxInstruments: 1e3,
|
|
539
539
|
maxHistogramBoundaries: 50
|
|
540
540
|
}) {
|
|
541
|
-
|
|
541
|
+
k(this, "intervalMs", void 0), k(this, "emit", void 0), k(this, "diagnostics", void 0), k(this, "policy", void 0), k(this, "instruments", /* @__PURE__ */ new Map()), k(this, "timer", null), k(this, "startedAt", 0), this.intervalMs = e, this.emit = t, this.diagnostics = n, this.policy = r;
|
|
542
542
|
}
|
|
543
543
|
record(e, t, n) {
|
|
544
544
|
!Number.isFinite(t) || e.kind === "counter" && t < 0 ? this.diagnostics.report("record.dropped_malformed", `The value of the metric ${e.name} is not valid. The library dropped it.`, { "metric.name": e.name }) : this.diagnostics.guard("record.sanitize_failed", `The library could not read the attributes of the metric ${e.name}.`, () => {
|
|
545
545
|
let r = this.instrumentOf(e);
|
|
546
|
-
r && (this.add(r, t,
|
|
546
|
+
r && (this.add(r, t, It(n)), this.arm());
|
|
547
547
|
});
|
|
548
548
|
}
|
|
549
549
|
collect() {
|
|
550
550
|
this.timer !== null && (clearTimeout(this.timer), this.timer = null);
|
|
551
551
|
let e = `${String(this.startedAt)}000000`, t = [...this.instruments.values()];
|
|
552
552
|
this.instruments.clear();
|
|
553
|
-
for (let { def: n, series: r } of t) for (let t of r.values()) this.emit(n.name, t.attributes,
|
|
553
|
+
for (let { def: n, series: r } of t) for (let t of r.values()) this.emit(n.name, t.attributes, zt(n, t, e));
|
|
554
554
|
}
|
|
555
555
|
instrumentOf(e) {
|
|
556
556
|
let t = this.instruments.get(e.name);
|
|
557
557
|
if (t) return t.def.kind === e.kind ? t : (this.diagnostics.report("record.dropped_malformed", `The metric ${e.name} is a ${t.def.kind} and a ${e.kind}. The library dropped the value.`, { "metric.name": e.name }), null);
|
|
558
558
|
let { maxInstruments: n } = this.policy;
|
|
559
559
|
if (n !== null && this.instruments.size >= n) return this.diagnostics.count("record.dropped_by_ceiling"), null;
|
|
560
|
-
let r = e.fromApp === !0 ? this.policy.maxHistogramBoundaries : null, i =
|
|
560
|
+
let r = e.fromApp === !0 ? this.policy.maxHistogramBoundaries : null, i = Lt(e.boundaries, r), a = Rt(i, r);
|
|
561
561
|
e.kind === "histogram" && !a && this.diagnostics.report("config.invalid", `The boundaries of the metric ${e.name} must meet metrics.maxHistogramBoundaries and contain finite numbers in ascending order. The library uses the default boundaries.`);
|
|
562
562
|
let o = {
|
|
563
563
|
def: {
|
|
@@ -570,7 +570,7 @@ var qt = class {
|
|
|
570
570
|
}
|
|
571
571
|
add(e, t, n) {
|
|
572
572
|
let r = JSON.stringify(n), i = e.series.get(r), a = n, { maxSeries: o } = this.policy;
|
|
573
|
-
if (!i && o !== null && e.series.size >= o && (r =
|
|
573
|
+
if (!i && o !== null && e.series.size >= o && (r = Pt, i = e.series.get(r), a = { [ie]: !0 }), !i) {
|
|
574
574
|
let n = e.def.kind === "histogram" ? e.def.boundaries.length + 1 : 0, o = Array(n).fill(0);
|
|
575
575
|
i = {
|
|
576
576
|
attributes: a,
|
|
@@ -590,45 +590,45 @@ var qt = class {
|
|
|
590
590
|
arm() {
|
|
591
591
|
this.timer === null && (this.startedAt = Date.now(), this.timer = setTimeout(() => {
|
|
592
592
|
this.collect();
|
|
593
|
-
}, this.intervalMs()),
|
|
593
|
+
}, this.intervalMs()), O(this.timer));
|
|
594
594
|
}
|
|
595
|
-
},
|
|
595
|
+
}, Kt = {
|
|
596
596
|
TRACE: "debug",
|
|
597
597
|
DEBUG: "debug",
|
|
598
598
|
INFO: "info",
|
|
599
599
|
WARN: "warn",
|
|
600
600
|
ERROR: "error",
|
|
601
601
|
FATAL: "error"
|
|
602
|
-
},
|
|
603
|
-
constructor(e, t, n =
|
|
604
|
-
|
|
602
|
+
}, qt = class {
|
|
603
|
+
constructor(e, t, n = Ee) {
|
|
604
|
+
k(this, "settings", void 0), k(this, "diagnostics", void 0), k(this, "limits", void 0), this.settings = e, this.diagnostics = t, this.limits = n;
|
|
605
605
|
}
|
|
606
606
|
update(e) {
|
|
607
607
|
this.settings = e;
|
|
608
608
|
}
|
|
609
609
|
accepts(e) {
|
|
610
|
-
return this.settings.level === null || !
|
|
610
|
+
return this.settings.level === null || !ze(t, this.settings.level) ? !1 : t[e] >= t[this.settings.level];
|
|
611
611
|
}
|
|
612
612
|
write(e, t, n, r, i) {
|
|
613
|
-
if (!this.accepts(t) || typeof console > "u" ||
|
|
614
|
-
let a = `%c[%s]%c[${t}]%c`, { styles: o } = this.settings, s =
|
|
613
|
+
if (!this.accepts(t) || typeof console > "u" || Ye()) return;
|
|
614
|
+
let a = `%c[%s]%c[${t}]%c`, { styles: o } = this.settings, s = Kt[t];
|
|
615
615
|
this.diagnostics.guard("handler.threw", `The library could not print to console.${s}.`, () => {
|
|
616
616
|
let c = [];
|
|
617
|
-
i !== void 0 && c.push(i), r !== void 0 && c.push(
|
|
617
|
+
i !== void 0 && c.push(i), r !== void 0 && c.push(Ze(r, this.limits, this.diagnostics)), M(() => {
|
|
618
618
|
console[s](a, o.namespace, e, o[t], "", n, ...c);
|
|
619
619
|
});
|
|
620
620
|
});
|
|
621
621
|
}
|
|
622
|
-
},
|
|
622
|
+
}, Jt = class {
|
|
623
623
|
constructor() {
|
|
624
|
-
|
|
624
|
+
k(this, "value", 0);
|
|
625
625
|
}
|
|
626
626
|
next() {
|
|
627
627
|
return ++this.value;
|
|
628
628
|
}
|
|
629
|
-
},
|
|
629
|
+
}, Yt = class {
|
|
630
630
|
constructor(e) {
|
|
631
|
-
|
|
631
|
+
k(this, "buffer", void 0), k(this, "pointer", 0), k(this, "filled", !1), k(this, "capacity", void 0), this.capacity = e === 0 ? 0 : Math.max(e, 1), this.buffer = Array(this.capacity);
|
|
632
632
|
}
|
|
633
633
|
resize(e) {
|
|
634
634
|
let t = this.snapshot().slice(-e);
|
|
@@ -648,9 +648,9 @@ var qt = class {
|
|
|
648
648
|
snapshot() {
|
|
649
649
|
return (this.filled ? [...this.buffer.slice(this.pointer), ...this.buffer.slice(0, this.pointer)] : this.buffer.slice(0, this.pointer)).filter((e) => e !== void 0);
|
|
650
650
|
}
|
|
651
|
-
},
|
|
651
|
+
}, Xt = class {
|
|
652
652
|
constructor() {
|
|
653
|
-
|
|
653
|
+
k(this, "map", /* @__PURE__ */ new Map());
|
|
654
654
|
}
|
|
655
655
|
merge(e) {
|
|
656
656
|
for (let [t, n] of Object.entries(e)) n === null ? this.map.delete(t) : n !== void 0 && this.map.set(t, n);
|
|
@@ -664,9 +664,9 @@ var qt = class {
|
|
|
664
664
|
getAll() {
|
|
665
665
|
return Object.fromEntries(this.map);
|
|
666
666
|
}
|
|
667
|
-
},
|
|
667
|
+
}, Zt = class {
|
|
668
668
|
constructor(e) {
|
|
669
|
-
|
|
669
|
+
k(this, "policy", void 0), k(this, "kept", []), this.policy = e;
|
|
670
670
|
}
|
|
671
671
|
push(e) {
|
|
672
672
|
let { enabled: t, maxRecords: n } = this.policy();
|
|
@@ -681,7 +681,7 @@ var qt = class {
|
|
|
681
681
|
...e,
|
|
682
682
|
attributes: {
|
|
683
683
|
...e.attributes,
|
|
684
|
-
[
|
|
684
|
+
[Te]: !0
|
|
685
685
|
}
|
|
686
686
|
}));
|
|
687
687
|
}
|
|
@@ -697,9 +697,9 @@ var qt = class {
|
|
|
697
697
|
clear() {
|
|
698
698
|
this.kept = [];
|
|
699
699
|
}
|
|
700
|
-
},
|
|
701
|
-
constructor(e, t =
|
|
702
|
-
|
|
700
|
+
}, V = class {
|
|
701
|
+
constructor(e, t = te, n = !1) {
|
|
702
|
+
k(this, "handler", void 0), k(this, "throttleMs", void 0), k(this, "consoleFallback", void 0), k(this, "counters", /* @__PURE__ */ new Map()), k(this, "lastEmitted", /* @__PURE__ */ new Map()), this.handler = e, this.throttleMs = t, this.consoleFallback = n;
|
|
703
703
|
}
|
|
704
704
|
setPolicy(e, t) {
|
|
705
705
|
this.throttleMs = e, this.consoleFallback = t;
|
|
@@ -725,11 +725,11 @@ var qt = class {
|
|
|
725
725
|
}, { handler: s } = this;
|
|
726
726
|
if (!s) return !0;
|
|
727
727
|
try {
|
|
728
|
-
|
|
728
|
+
M(() => {
|
|
729
729
|
s(o);
|
|
730
730
|
});
|
|
731
731
|
} catch {
|
|
732
|
-
this.count("handler.threw"), this.consoleFallback && typeof console < "u" &&
|
|
732
|
+
this.count("handler.threw"), this.consoleFallback && typeof console < "u" && M(() => {
|
|
733
733
|
console.warn(`${f} The onDiagnostic handler threw an error.`);
|
|
734
734
|
});
|
|
735
735
|
}
|
|
@@ -756,12 +756,12 @@ var qt = class {
|
|
|
756
756
|
}
|
|
757
757
|
};
|
|
758
758
|
// src/core/drops.ts
|
|
759
|
-
function
|
|
759
|
+
function Qt(e, t) {
|
|
760
760
|
e.length < 20 && !e.includes(t) && e.push(t);
|
|
761
761
|
}
|
|
762
|
-
var
|
|
762
|
+
var $t = class {
|
|
763
763
|
constructor(e, t) {
|
|
764
|
-
|
|
764
|
+
k(this, "config", void 0), k(this, "diagnostics", void 0), k(this, "pending", /* @__PURE__ */ new Map()), k(this, "scheduled", !1), k(this, "reporting", !1), k(this, "lost", {}), this.config = e, this.diagnostics = t;
|
|
765
765
|
}
|
|
766
766
|
add(e, t, n = [], r = t.length) {
|
|
767
767
|
if (r > 0 && (this.lost[e] = (this.lost[e] ?? 0) + r), !this.config.onDrop || this.reporting || t.length === 0 && n.length === 0) return;
|
|
@@ -773,12 +773,12 @@ var tn = class {
|
|
|
773
773
|
journeyIds: [],
|
|
774
774
|
actions: []
|
|
775
775
|
}, this.pending.set(e, i)), i.records += r;
|
|
776
|
-
for (let e of n)
|
|
776
|
+
for (let e of n) Qt(i.batchIds, e);
|
|
777
777
|
for (let e of t) {
|
|
778
|
-
let t =
|
|
779
|
-
typeof t == "string" &&
|
|
780
|
-
let n =
|
|
781
|
-
typeof n == "string" &&
|
|
778
|
+
let t = tt(e, S);
|
|
779
|
+
typeof t == "string" && Qt(i.journeyIds, t);
|
|
780
|
+
let n = et(e) ? e.body : void 0;
|
|
781
|
+
typeof n == "string" && Qt(i.actions, n);
|
|
782
782
|
}
|
|
783
783
|
this.scheduled || (this.scheduled = !0, queueMicrotask(() => {
|
|
784
784
|
this.flush();
|
|
@@ -795,8 +795,8 @@ var tn = class {
|
|
|
795
795
|
if (t) {
|
|
796
796
|
this.reporting = !0;
|
|
797
797
|
for (let n of e) this.diagnostics.guard("handler.threw", "The onDrop hook threw an error.", () => {
|
|
798
|
-
|
|
799
|
-
|
|
798
|
+
Qe(() => {
|
|
799
|
+
M(() => {
|
|
800
800
|
t(n);
|
|
801
801
|
});
|
|
802
802
|
});
|
|
@@ -804,15 +804,15 @@ var tn = class {
|
|
|
804
804
|
this.reporting = !1;
|
|
805
805
|
}
|
|
806
806
|
}
|
|
807
|
-
},
|
|
807
|
+
}, en = class {
|
|
808
808
|
constructor(e) {
|
|
809
|
-
|
|
809
|
+
k(this, "onDrop", void 0), k(this, "actions", {
|
|
810
810
|
head: [],
|
|
811
811
|
tail: []
|
|
812
|
-
}),
|
|
812
|
+
}), k(this, "others", {
|
|
813
813
|
head: [],
|
|
814
814
|
tail: []
|
|
815
|
-
}),
|
|
815
|
+
}), k(this, "arrivals", 0), this.onDrop = e;
|
|
816
816
|
}
|
|
817
817
|
get records() {
|
|
818
818
|
return this.inOrder();
|
|
@@ -822,7 +822,7 @@ var tn = class {
|
|
|
822
822
|
return e.head.length + e.tail.length + t.head.length + t.tail.length;
|
|
823
823
|
}
|
|
824
824
|
push(e, t) {
|
|
825
|
-
let n =
|
|
825
|
+
let n = et(e), r = n ? this.actions : this.others, i = n ? de : t, a = {
|
|
826
826
|
record: e,
|
|
827
827
|
arrival: this.arrivals
|
|
828
828
|
};
|
|
@@ -851,11 +851,11 @@ var tn = class {
|
|
|
851
851
|
...t.tail
|
|
852
852
|
].sort((e, t) => e.arrival - t.arrival).map((e) => e.record);
|
|
853
853
|
}
|
|
854
|
-
},
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
],
|
|
854
|
+
}, tn = "error.", nn = [
|
|
855
|
+
E,
|
|
856
|
+
S,
|
|
857
|
+
be
|
|
858
|
+
], rn = {
|
|
859
859
|
processor: {
|
|
860
860
|
label: "A processor",
|
|
861
861
|
code: "record.dropped_by_processor",
|
|
@@ -866,47 +866,47 @@ var tn = class {
|
|
|
866
866
|
code: "record.dropped_by_redact",
|
|
867
867
|
refused: "redact is not a function. The library drops each record until redact is a function or null."
|
|
868
868
|
}
|
|
869
|
-
},
|
|
870
|
-
"metric.type":
|
|
871
|
-
"metric.value":
|
|
872
|
-
[n.start]:
|
|
869
|
+
}, H = (e) => typeof e == "number" && Number.isFinite(e), an = (e) => Array.isArray(e) && e.every(H), U = (e) => typeof e == "string" && /^\d{1,20}$/.test(e), on = (e) => typeof e == "string" && /^[0-9a-f]{32}$/.test(e), sn = (e) => typeof e == "string" && /^[0-9a-f]{16}$/.test(e), cn = (e) => e === "" || sn(e), ln = (e) => e === "counter", un = (e) => e === "histogram", dn = (e) => e === "client" || e === "internal", fn = (e) => e === "error" || e === "unset", pn = {
|
|
870
|
+
"metric.type": ln,
|
|
871
|
+
"metric.value": H,
|
|
872
|
+
[n.start]: U
|
|
873
|
+
}, mn = {
|
|
874
|
+
"metric.type": un,
|
|
875
|
+
[n.start]: U,
|
|
876
|
+
[n.count]: H,
|
|
877
|
+
[n.sum]: H,
|
|
878
|
+
[n.min]: H,
|
|
879
|
+
[n.max]: H,
|
|
880
|
+
[n.bounds]: an,
|
|
881
|
+
[n.buckets]: an
|
|
882
|
+
}, hn = {
|
|
883
|
+
[l.kind]: dn,
|
|
884
|
+
[l.parentId]: cn,
|
|
885
|
+
[l.start]: U,
|
|
886
|
+
[l.end]: U,
|
|
887
|
+
[l.status]: fn
|
|
873
888
|
}, gn = {
|
|
874
|
-
|
|
875
|
-
[
|
|
876
|
-
[n.count]: B,
|
|
877
|
-
[n.sum]: B,
|
|
878
|
-
[n.min]: B,
|
|
879
|
-
[n.max]: B,
|
|
880
|
-
[n.bounds]: sn,
|
|
881
|
-
[n.buckets]: sn
|
|
882
|
-
}, _n = {
|
|
883
|
-
[o.kind]: pn,
|
|
884
|
-
[o.parentId]: un,
|
|
885
|
-
[o.start]: V,
|
|
886
|
-
[o.end]: V,
|
|
887
|
-
[o.status]: mn
|
|
888
|
-
}, vn = {
|
|
889
|
-
[o.linkTraceId]: cn,
|
|
890
|
-
[o.linkSpanId]: ln
|
|
889
|
+
[l.linkTraceId]: on,
|
|
890
|
+
[l.linkSpanId]: sn
|
|
891
891
|
};
|
|
892
|
-
function
|
|
893
|
-
let t = e[
|
|
894
|
-
return t === "span" && n === "uiobs.traces" ? [
|
|
892
|
+
function _n(e) {
|
|
893
|
+
let t = e[C], n = e[b];
|
|
894
|
+
return t === "span" && n === "uiobs.traces" ? [hn, gn] : t !== "metric" || n !== "uiobs.metrics" ? [] : e["metric.type"] === "histogram" ? [mn] : [pn];
|
|
895
895
|
}
|
|
896
|
-
function
|
|
896
|
+
function vn(e) {
|
|
897
897
|
let t = {};
|
|
898
|
-
for (let n of
|
|
898
|
+
for (let n of _n(e)) {
|
|
899
899
|
let r = Object.keys(n);
|
|
900
900
|
if (r.every((t) => n[t](e[t]))) for (let n of r) t[n] = e[n];
|
|
901
901
|
}
|
|
902
902
|
return t;
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function W(e) {
|
|
905
905
|
return e;
|
|
906
906
|
}
|
|
907
|
-
var
|
|
907
|
+
var yn = class {
|
|
908
908
|
constructor(e) {
|
|
909
|
-
|
|
909
|
+
k(this, "deps", void 0), k(this, "resourceCache", null), this.deps = e;
|
|
910
910
|
}
|
|
911
911
|
invalidateResource() {
|
|
912
912
|
this.resourceCache = null;
|
|
@@ -916,8 +916,8 @@ var xn = class {
|
|
|
916
916
|
}
|
|
917
917
|
passesLevel(e, n, r) {
|
|
918
918
|
let { config: i } = this.deps;
|
|
919
|
-
if (r !== void 0 &&
|
|
920
|
-
let a = this.deps.remote.sampling?.minLevelFor(n) ??
|
|
919
|
+
if (r !== void 0 && me.includes(r)) return !0;
|
|
920
|
+
let a = this.deps.remote.sampling?.minLevelFor(n) ?? ot(n, i);
|
|
921
921
|
return t[e] >= t[a];
|
|
922
922
|
}
|
|
923
923
|
keepForDebug(e) {
|
|
@@ -927,79 +927,83 @@ var xn = class {
|
|
|
927
927
|
r && n.push(r);
|
|
928
928
|
}
|
|
929
929
|
build(e, t = !1) {
|
|
930
|
-
let { config: n, diagnostics: r, tracing: i, journey:
|
|
930
|
+
let { config: n, diagnostics: r, tracing: i, journey: o, sequence: s, limits: c, remote: l } = this.deps;
|
|
931
931
|
if (!t && !this.isEnabled(e.level, e.namespace, e.type)) return r.count("record.dropped_by_level"), this.keepForDebug(e), {
|
|
932
932
|
record: null,
|
|
933
933
|
dropped: "level"
|
|
934
934
|
};
|
|
935
|
-
let
|
|
935
|
+
let u = e.trace ?? e.snapshot?.trace ?? i.resolve(), d = e.snapshot ? e.snapshot.journey : o.current(), f = st({
|
|
936
936
|
level: e.level,
|
|
937
937
|
type: e.type,
|
|
938
938
|
namespace: e.namespace,
|
|
939
|
-
journeyId:
|
|
940
|
-
traceId:
|
|
939
|
+
journeyId: d?.id ?? "",
|
|
940
|
+
traceId: u.traceId,
|
|
941
941
|
aggregated: e.aggregated
|
|
942
|
-
}, n,
|
|
943
|
-
if (!t && !
|
|
942
|
+
}, n, l.sampling?.current() ?? null);
|
|
943
|
+
if (!t && !f) return r.count("record.dropped_by_sampling"), this.keepForDebug(e), {
|
|
944
944
|
record: null,
|
|
945
945
|
dropped: "sampling"
|
|
946
946
|
};
|
|
947
|
-
let
|
|
947
|
+
let p = s.next(), m = e.snapshot?.url ?? He(r), h = n.metadata.pageUrl ? Be(m, n.capture.fullUrls, n.capture.urlTransform, r) : "", g, _ = 0;
|
|
948
948
|
try {
|
|
949
|
-
let t =
|
|
950
|
-
|
|
951
|
-
...
|
|
952
|
-
...
|
|
953
|
-
...
|
|
954
|
-
...
|
|
949
|
+
let t = N(e.snapshot?.context ?? this.deps.context.getAll(), c, r), n = N(this.provided(), c, r), i = N(e.scoped ?? {}, c, r), a = N(e.payload ?? {}, c, r);
|
|
950
|
+
_ = t.bytes + n.bytes + i.bytes + a.bytes, g = {
|
|
951
|
+
...W(t.value),
|
|
952
|
+
...W(n.value),
|
|
953
|
+
...W(i.value),
|
|
954
|
+
...W(a.value)
|
|
955
955
|
};
|
|
956
956
|
} catch (e) {
|
|
957
|
-
r.report("record.sanitize_failed", "The library could not sanitize the attributes.", void 0, e),
|
|
957
|
+
r.report("record.sanitize_failed", "The library could not sanitize the attributes.", void 0, e), g = { [je]: !0 };
|
|
958
958
|
}
|
|
959
|
-
Object.assign(
|
|
960
|
-
let
|
|
961
|
-
|
|
962
|
-
let
|
|
963
|
-
timeUnixNano: e.snapshot?.timeUnixNano ??
|
|
964
|
-
traceId:
|
|
965
|
-
spanId:
|
|
966
|
-
traceFlags:
|
|
967
|
-
severityNumber:
|
|
959
|
+
Object.assign(g, e.fixed), g[C] = e.type, g[w] = p, g[b] = e.namespace, g[E] = h, d && (g[S] = d.id, g[be] = d.name, d.parentId !== void 0 && (g[he] = d.parentId));
|
|
960
|
+
let v = Xe(e.body, c.maxBodyChars);
|
|
961
|
+
v !== e.body && r.count("record.truncated");
|
|
962
|
+
let y = {
|
|
963
|
+
timeUnixNano: e.snapshot?.timeUnixNano ?? Pe(),
|
|
964
|
+
traceId: u.traceId,
|
|
965
|
+
spanId: u.spanId,
|
|
966
|
+
traceFlags: u.traceFlags,
|
|
967
|
+
severityNumber: a[e.level],
|
|
968
968
|
severityText: e.level,
|
|
969
|
-
body:
|
|
970
|
-
attributes:
|
|
969
|
+
body: v,
|
|
970
|
+
attributes: g,
|
|
971
971
|
resource: this.resource()
|
|
972
|
-
},
|
|
973
|
-
if (
|
|
974
|
-
let t = this.applyHooks(
|
|
972
|
+
}, ee = this.hookStages();
|
|
973
|
+
if (ee.length > 0) {
|
|
974
|
+
let t = this.applyHooks(y, ee, e.fixed);
|
|
975
975
|
if (typeof t == "string") return {
|
|
976
976
|
record: null,
|
|
977
977
|
dropped: t
|
|
978
978
|
};
|
|
979
|
-
({record:
|
|
979
|
+
({record: y, bytes: _} = t);
|
|
980
980
|
}
|
|
981
|
-
let
|
|
982
|
-
[
|
|
983
|
-
[
|
|
984
|
-
[
|
|
981
|
+
let te = {
|
|
982
|
+
[C]: e.type,
|
|
983
|
+
[w]: p,
|
|
984
|
+
[b]: e.namespace
|
|
985
985
|
};
|
|
986
|
-
return { record: this.fit(
|
|
986
|
+
return { record: this.fit(y, _, te, e.fixed) };
|
|
987
987
|
}
|
|
988
988
|
redactForwarded(e) {
|
|
989
|
-
let {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
989
|
+
let { config: t, diagnostics: n, limits: r } = this.deps, i = vn(e.attributes), a = Math.max(r.maxAttributeCount, 128), o = {
|
|
990
|
+
...r,
|
|
991
|
+
maxAttributeCount: a
|
|
992
|
+
}, s = W(N(e.resource, o, n).value), c = t.redact ? [[t.redact, "redact"]] : [], l = this.applyHooks({
|
|
993
|
+
...e,
|
|
994
|
+
resource: s
|
|
995
|
+
}, c, i);
|
|
996
|
+
return typeof l == "string" ? null : l.record;
|
|
993
997
|
}
|
|
994
998
|
rehook(e) {
|
|
995
|
-
let { config: t, diagnostics: n, limits: r, remote: i, debug: a } = this.deps, { attributes: o } = e, s = String(o[
|
|
999
|
+
let { config: t, diagnostics: n, limits: r, remote: i, debug: a } = this.deps, { attributes: o } = e, s = String(o[b]), c = this.passesLevel(e.severityText, s, o[C]), l = c && it(e, t, i.sampling?.current() ?? null), u = t.metadata.pageUrl ? Be(String(o[E]), t.capture.fullUrls, t.capture.urlTransform, n) : "", d = Xe(e.body, r.maxBodyChars);
|
|
996
1000
|
d !== e.body && n.count("record.truncated");
|
|
997
|
-
let f =
|
|
1001
|
+
let f = vn(o), p = {
|
|
998
1002
|
...e,
|
|
999
1003
|
body: d,
|
|
1000
1004
|
attributes: {
|
|
1001
1005
|
...o,
|
|
1002
|
-
[
|
|
1006
|
+
[E]: u
|
|
1003
1007
|
},
|
|
1004
1008
|
resource: this.resource()
|
|
1005
1009
|
}, m = this.applyHooks(p, this.hookStages(), f), h = typeof m == "string" ? null : this.fit(m.record, m.bytes, o, f);
|
|
@@ -1013,20 +1017,20 @@ var xn = class {
|
|
|
1013
1017
|
body: e.body
|
|
1014
1018
|
});
|
|
1015
1019
|
let o = {
|
|
1016
|
-
[
|
|
1017
|
-
[
|
|
1018
|
-
[
|
|
1019
|
-
[
|
|
1020
|
-
[
|
|
1020
|
+
[C]: n[C],
|
|
1021
|
+
[w]: n[w],
|
|
1022
|
+
[b]: n[b],
|
|
1023
|
+
[Ce]: !0,
|
|
1024
|
+
[_e]: t
|
|
1021
1025
|
};
|
|
1022
|
-
for (let t of
|
|
1023
|
-
for (let [t, n] of Object.entries(e.attributes)) t.startsWith(
|
|
1024
|
-
let s =
|
|
1025
|
-
s > a.maxRecordBytes && "error.data" in o && (Reflect.deleteProperty(o,
|
|
1026
|
-
let c = e.attributes[
|
|
1026
|
+
for (let t of nn) t in e.attributes && (o[t] = e.attributes[t]);
|
|
1027
|
+
for (let [t, n] of Object.entries(e.attributes)) t.startsWith(tn) && (o[t] = n);
|
|
1028
|
+
let s = N(o, a, i).bytes;
|
|
1029
|
+
s > a.maxRecordBytes && "error.data" in o && (Reflect.deleteProperty(o, se), s = N(o, a, i).bytes);
|
|
1030
|
+
let c = e.attributes[x];
|
|
1027
1031
|
if (c !== void 0) {
|
|
1028
|
-
let e =
|
|
1029
|
-
s + e <= a.maxRecordBytes && (o[
|
|
1032
|
+
let e = N(c, a, i).bytes;
|
|
1033
|
+
s + e <= a.maxRecordBytes && (o[x] = c);
|
|
1030
1034
|
}
|
|
1031
1035
|
return Object.assign(o, r), e.attributes = o, e;
|
|
1032
1036
|
}
|
|
@@ -1041,7 +1045,7 @@ var xn = class {
|
|
|
1041
1045
|
if (typeof t == "string") return t;
|
|
1042
1046
|
r = t;
|
|
1043
1047
|
}
|
|
1044
|
-
let { diagnostics: i, limits: a } = this.deps, o =
|
|
1048
|
+
let { diagnostics: i, limits: a } = this.deps, o = N(r.attributes, a, i), s = W(o.value);
|
|
1045
1049
|
return Object.assign(s, n), {
|
|
1046
1050
|
record: {
|
|
1047
1051
|
...r,
|
|
@@ -1051,25 +1055,25 @@ var xn = class {
|
|
|
1051
1055
|
};
|
|
1052
1056
|
}
|
|
1053
1057
|
runHook(e, t, n) {
|
|
1054
|
-
let { diagnostics: r } = this.deps, { label: i, code:
|
|
1058
|
+
let { diagnostics: r } = this.deps, { label: i, code: o, refused: s } = rn[t], c;
|
|
1055
1059
|
try {
|
|
1056
|
-
|
|
1060
|
+
c = e(n);
|
|
1057
1061
|
} catch (e) {
|
|
1058
|
-
return r.report(
|
|
1062
|
+
return r.report(o, `${i} threw an error. The library dropped the record.`, void 0, e), t;
|
|
1059
1063
|
}
|
|
1060
|
-
if (
|
|
1061
|
-
let
|
|
1062
|
-
return
|
|
1063
|
-
...
|
|
1064
|
-
severityNumber:
|
|
1065
|
-
} : (r.report("record.dropped_malformed", `${i} set a severityText that is not a log level. The library dropped the record.`), "malformed") :
|
|
1064
|
+
if (c === null) return e === F ? r.report(o, s) : r.count(o), t;
|
|
1065
|
+
let l = c ?? n;
|
|
1066
|
+
return Ne(l) ? Fe(l.severityText) ? {
|
|
1067
|
+
...l,
|
|
1068
|
+
severityNumber: a[l.severityText]
|
|
1069
|
+
} : (r.report("record.dropped_malformed", `${i} set a severityText that is not a log level. The library dropped the record.`), "malformed") : l === n ? (r.report("record.dropped_malformed", `${i} changed the record to a shape that is not a record. The library dropped it.`), "malformed") : (r.report(o, `${i} returned a value that is not a record. The library dropped the record.`), t);
|
|
1066
1070
|
}
|
|
1067
1071
|
provided() {
|
|
1068
1072
|
let e = this.deps.config.contextProvider;
|
|
1069
1073
|
if (!e) return {};
|
|
1070
1074
|
let { diagnostics: t } = this.deps, n = t.guard("handler.threw", "The contextProvider threw an error. The record has no attributes from it.", () => {
|
|
1071
1075
|
let t = e();
|
|
1072
|
-
return t === void 0 ? {} :
|
|
1076
|
+
return t === void 0 ? {} : D(t) && typeof t.then != "function" ? t : null;
|
|
1073
1077
|
});
|
|
1074
1078
|
return n === null && t.report("config.invalid", "contextProvider must return an object of attributes. The library ignores the value."), n ?? {};
|
|
1075
1079
|
}
|
|
@@ -1077,34 +1081,34 @@ var xn = class {
|
|
|
1077
1081
|
if (this.resourceCache) return this.resourceCache;
|
|
1078
1082
|
let { config: t, identity: n, platform: a } = this.deps;
|
|
1079
1083
|
return this.resourceCache = {
|
|
1080
|
-
[
|
|
1081
|
-
[
|
|
1082
|
-
[
|
|
1083
|
-
[
|
|
1084
|
-
[
|
|
1085
|
-
[
|
|
1086
|
-
[
|
|
1087
|
-
[
|
|
1088
|
-
[
|
|
1089
|
-
[
|
|
1090
|
-
...t.metadata.userAgent ? { [
|
|
1091
|
-
...!t.metadata.openfin || a.openfinUuid === void 0 ? {} : { [
|
|
1092
|
-
...!t.metadata.openfin || a.openfinName === void 0 ? {} : { [
|
|
1084
|
+
[ke]: t.serviceName,
|
|
1085
|
+
[y]: t.serviceVersion,
|
|
1086
|
+
[oe]: t.environment,
|
|
1087
|
+
[e]: Se,
|
|
1088
|
+
[fe]: T,
|
|
1089
|
+
[pe]: ge,
|
|
1090
|
+
[Ae]: a.platform,
|
|
1091
|
+
[i]: n.sessionId,
|
|
1092
|
+
[p]: n.tabId,
|
|
1093
|
+
[Me]: n.contextId,
|
|
1094
|
+
...t.metadata.userAgent ? { [Oe]: a.userAgent } : {},
|
|
1095
|
+
...!t.metadata.openfin || a.openfinUuid === void 0 ? {} : { [r]: a.openfinUuid },
|
|
1096
|
+
...!t.metadata.openfin || a.openfinName === void 0 ? {} : { [_]: a.openfinName }
|
|
1093
1097
|
}, this.resourceCache;
|
|
1094
1098
|
}
|
|
1095
|
-
},
|
|
1099
|
+
}, bn = 1e3, xn = {
|
|
1096
1100
|
start: "ui.start",
|
|
1097
1101
|
interaction: "ui.interaction",
|
|
1098
1102
|
navigation: "ui.navigation",
|
|
1099
1103
|
explicit: "ui.trace",
|
|
1100
1104
|
maxAge: "ui.trace"
|
|
1101
1105
|
};
|
|
1102
|
-
function
|
|
1103
|
-
return `${String(Math.round(e *
|
|
1106
|
+
function Sn(e) {
|
|
1107
|
+
return `${String(Math.round(e * bn))}000`;
|
|
1104
1108
|
}
|
|
1105
|
-
function
|
|
1109
|
+
function Cn(e) {
|
|
1106
1110
|
return {
|
|
1107
|
-
name:
|
|
1111
|
+
name: xn[e.reason],
|
|
1108
1112
|
kind: "internal",
|
|
1109
1113
|
traceId: e.traceId,
|
|
1110
1114
|
spanId: e.spanId,
|
|
@@ -1115,72 +1119,73 @@ function Tn(e) {
|
|
|
1115
1119
|
attributes: {}
|
|
1116
1120
|
};
|
|
1117
1121
|
}
|
|
1118
|
-
function
|
|
1122
|
+
function wn(e) {
|
|
1119
1123
|
return {
|
|
1120
|
-
[
|
|
1121
|
-
[
|
|
1122
|
-
[
|
|
1123
|
-
[
|
|
1124
|
-
[
|
|
1124
|
+
[l.kind]: e.kind,
|
|
1125
|
+
[l.parentId]: e.parentSpanId,
|
|
1126
|
+
[l.start]: Sn(e.startMs),
|
|
1127
|
+
[l.end]: Sn(e.endMs),
|
|
1128
|
+
[l.status]: e.error ? "error" : "unset",
|
|
1125
1129
|
...e.link ? {
|
|
1126
|
-
[
|
|
1127
|
-
[
|
|
1130
|
+
[l.linkTraceId]: e.link.traceId,
|
|
1131
|
+
[l.linkSpanId]: e.link.spanId
|
|
1128
1132
|
} : {}
|
|
1129
1133
|
};
|
|
1130
1134
|
}
|
|
1131
1135
|
// src/core/runtime.ts
|
|
1132
|
-
var
|
|
1133
|
-
errors: async () => (await import("./errors-
|
|
1134
|
-
network: async () => (await import("./network-
|
|
1135
|
-
interactions: async () => (await import("./interactions-
|
|
1136
|
-
webVitals: async () => (await import("./web-vitals-
|
|
1137
|
-
longFrames: async () => (await import("./long-frames-
|
|
1138
|
-
console: async () => (await import("./console-
|
|
1139
|
-
uncleanExit: async () => (await import("./unclean-exit-
|
|
1140
|
-
userTiming: async () => (await import("./user-timing-
|
|
1141
|
-
reports: async () => (await import("./reports
|
|
1142
|
-
resourceTiming: async () => (await import("./resource-timing-
|
|
1143
|
-
lifecycle: async () => (await import("./lifecycle-
|
|
1144
|
-
framePhases: async () => (await import("./profiler-frames-
|
|
1145
|
-
framePacing: async () => (await import("./profiler-frames-
|
|
1146
|
-
replay: async () => (await import("./replay-
|
|
1147
|
-
},
|
|
1148
|
-
function
|
|
1149
|
-
let t =
|
|
1150
|
-
return t === void 0 && (t = ++
|
|
1151
|
-
}
|
|
1152
|
-
var
|
|
1136
|
+
var Tn = {
|
|
1137
|
+
errors: async () => (await import("./errors-C-LYbqyB.js")).ErrorCapture,
|
|
1138
|
+
network: async () => (await import("./network-Cc3tSB7e.js")).NetworkCapture,
|
|
1139
|
+
interactions: async () => (await import("./interactions-DdKPMWIN.js")).InteractionCapture,
|
|
1140
|
+
webVitals: async () => (await import("./web-vitals-CGwXGF-M.js")).WebVitalsCapture,
|
|
1141
|
+
longFrames: async () => (await import("./long-frames-6NGl1-uN.js")).LongFrameCapture,
|
|
1142
|
+
console: async () => (await import("./console-CAyCQOpm.js")).ConsoleCapture,
|
|
1143
|
+
uncleanExit: async () => (await import("./unclean-exit-Bj6gYHeL.js")).UncleanExitCapture,
|
|
1144
|
+
userTiming: async () => (await import("./user-timing-Duz0d-OA.js")).UserTimingCapture,
|
|
1145
|
+
reports: async () => (await import("./reports-CX57-S9s.js")).ReportCapture,
|
|
1146
|
+
resourceTiming: async () => (await import("./resource-timing-CWVDCbrY.js")).ResourceTimingCapture,
|
|
1147
|
+
lifecycle: async () => (await import("./lifecycle-CMHz2Zbs.js")).LifecycleCapture,
|
|
1148
|
+
framePhases: async () => (await import("./profiler-frames-CGXZeZ_3.js")).FramePhasesCapture,
|
|
1149
|
+
framePacing: async () => (await import("./profiler-frames-CGXZeZ_3.js")).FramePacingCapture,
|
|
1150
|
+
replay: async () => (await import("./replay-Dy6OiaOZ.js")).ReplayCapture
|
|
1151
|
+
}, En = /* @__PURE__ */ new WeakMap(), Dn = 0;
|
|
1152
|
+
function G(e) {
|
|
1153
|
+
let t = En.get(e);
|
|
1154
|
+
return t === void 0 && (t = ++Dn, En.set(e, t)), t;
|
|
1155
|
+
}
|
|
1156
|
+
var On = Symbol.for(o), kn = Symbol.for(u), An = ["batching", "retention"], jn = [
|
|
1153
1157
|
"log",
|
|
1154
1158
|
"event",
|
|
1155
1159
|
"action"
|
|
1156
|
-
],
|
|
1160
|
+
], Mn = "configure() could not read its options. The library drops each record and installs no capture until a configure() call sets redact to a function or null.", Nn = "shutdown() got invalid options. The library discards the records in memory. An invalid clearStorage removes the \"context\" scope.", Pn = "flush() got invalid options. The library waits the default 5000 ms.", Fn = /* @__PURE__ */ new Set([
|
|
1157
1161
|
"bus.role_resolved",
|
|
1162
|
+
"bus.tab_id_changed",
|
|
1158
1163
|
"config.reconfigured",
|
|
1159
1164
|
"security.rotated",
|
|
1160
1165
|
"journey.adopted",
|
|
1161
1166
|
"journey.expired"
|
|
1162
1167
|
]);
|
|
1163
|
-
function
|
|
1168
|
+
function In(e) {
|
|
1164
1169
|
return JSON.stringify({
|
|
1165
1170
|
...e,
|
|
1166
|
-
urlTransform: e.urlTransform ?
|
|
1171
|
+
urlTransform: e.urlTransform ? G(e.urlTransform) : void 0,
|
|
1167
1172
|
webVitals: typeof e.webVitals == "object" ? { loader: e.webVitals.loader !== void 0 } : e.webVitals,
|
|
1168
1173
|
ignoreUrls: e.ignoreUrls.map(String),
|
|
1169
1174
|
propagateTraceHeaderTo: e.propagateTraceHeaderTo.map(String),
|
|
1170
1175
|
userTiming: typeof e.userTiming == "object" ? { include: e.userTiming.include?.map(String) } : e.userTiming,
|
|
1171
|
-
plugins: e.plugins.map(
|
|
1176
|
+
plugins: e.plugins.map(G)
|
|
1172
1177
|
});
|
|
1173
1178
|
}
|
|
1174
|
-
function
|
|
1175
|
-
if (!
|
|
1179
|
+
function Ln(e) {
|
|
1180
|
+
if (!D(e)) return e;
|
|
1176
1181
|
let t = { ...e };
|
|
1177
1182
|
for (let e of ["url", "endpoint"]) {
|
|
1178
1183
|
let n = t[e];
|
|
1179
|
-
typeof n == "string" && (t[e] =
|
|
1184
|
+
typeof n == "string" && (t[e] = Be(n, !1));
|
|
1180
1185
|
}
|
|
1181
1186
|
return t;
|
|
1182
1187
|
}
|
|
1183
|
-
function
|
|
1188
|
+
function Rn(e) {
|
|
1184
1189
|
return {
|
|
1185
1190
|
...e,
|
|
1186
1191
|
endpoint: null,
|
|
@@ -1195,10 +1200,10 @@ function Bn(e) {
|
|
|
1195
1200
|
}
|
|
1196
1201
|
};
|
|
1197
1202
|
}
|
|
1198
|
-
function
|
|
1203
|
+
function zn(e) {
|
|
1199
1204
|
return !!e.endpoint || !!e.metricsEndpoint || !!e.tracesEndpoint || !!e.transport || !!e.transportWorker;
|
|
1200
1205
|
}
|
|
1201
|
-
function
|
|
1206
|
+
function Bn(e, t) {
|
|
1202
1207
|
return {
|
|
1203
1208
|
status: e,
|
|
1204
1209
|
accepted: 0,
|
|
@@ -1209,13 +1214,13 @@ function Hn(e, t) {
|
|
|
1209
1214
|
...t
|
|
1210
1215
|
};
|
|
1211
1216
|
}
|
|
1212
|
-
function
|
|
1213
|
-
return
|
|
1217
|
+
function K(e) {
|
|
1218
|
+
return Bn(e.pending > 0 ? "timeout" : "complete", e);
|
|
1214
1219
|
}
|
|
1215
|
-
function
|
|
1216
|
-
return e.sdkVersion ===
|
|
1220
|
+
function Vn(e) {
|
|
1221
|
+
return e.sdkVersion === T;
|
|
1217
1222
|
}
|
|
1218
|
-
var
|
|
1223
|
+
var q = class e {
|
|
1219
1224
|
isRotating() {
|
|
1220
1225
|
return this.rotating;
|
|
1221
1226
|
}
|
|
@@ -1223,59 +1228,59 @@ var K = class e {
|
|
|
1223
1228
|
typeof e == "boolean" && (this.config.lockConfiguration = e);
|
|
1224
1229
|
}
|
|
1225
1230
|
constructor(e, t) {
|
|
1226
|
-
|
|
1231
|
+
k(this, "rotating", !1), k(this, "rotationSeq", 0), k(this, "profilerOn", !1), k(this, "closingContext", !1), k(this, "mismatchVersion", null), k(this, "contextMismatch", !1), k(this, "rotation", void 0), k(this, "memoryStorage", void 0), k(this, "storagePersistence", "off"), k(this, "recordingDiagnostic", !1), k(this, "holdingRecords", !1), k(this, "heldDiagnostics", []), k(this, "diagnosticLogger", new B(() => this, ne)), k(this, "debugBuffer", new Zt(() => this.config.debugBuffer)), k(this, "explicitSecurityContext", void 0), k(this, "ownerAdopted", !1), k(this, "sdkVersion", T), k(this, "protocol", d), k(this, "diagnostics", void 0), k(this, "config", void 0), k(this, "platform", void 0), k(this, "identity", void 0), k(this, "backing", Ke()), k(this, "stores", {
|
|
1227
1232
|
local: () => this.backing.local(),
|
|
1228
1233
|
session: () => this.backing.session(),
|
|
1229
1234
|
opener: () => this.backing.opener?.() ?? null
|
|
1230
|
-
}),
|
|
1235
|
+
}), k(this, "identityBuiltAs", void 0), k(this, "sessionTouch", void 0), k(this, "context", new Xt()), k(this, "breadcrumbs", void 0), k(this, "tracing", void 0), k(this, "sequence", new Jt()), k(this, "journey", void 0), k(this, "builder", void 0), k(this, "remote", {
|
|
1231
1236
|
sampling: null,
|
|
1232
1237
|
changed: () => {
|
|
1233
1238
|
this.refreshCaptures();
|
|
1234
1239
|
}
|
|
1235
|
-
}),
|
|
1240
|
+
}), k(this, "identityEpoch", 0), k(this, "errorHook", void 0), k(this, "replayConsent", void 0), k(this, "replay", void 0), k(this, "remoteCaptureTimer", void 0), k(this, "installedCaptureKey", ""), k(this, "replayBuiltKey", ""), k(this, "console", void 0), k(this, "drops", void 0), k(this, "meter", void 0), k(this, "bus", null), k(this, "busBuilt", void 0), k(this, "busLoad", void 0), k(this, "sender", void 0), k(this, "senderLoad", void 0), k(this, "pendingRecords", new en((e) => {
|
|
1236
1241
|
this.dropHeld(e);
|
|
1237
|
-
})),
|
|
1242
|
+
})), k(this, "pausedLoss", /* @__PURE__ */ new WeakSet()), k(this, "carried", []), k(this, "sessionPicked", !1), k(this, "deliveryClosed", !1), k(this, "parkedSender", void 0), k(this, "retiring", void 0), k(this, "startFailed", !1), k(this, "running", !1), k(this, "openGate", void 0), k(this, "startGate", new Promise((e) => {
|
|
1238
1243
|
this.openGate = e;
|
|
1239
|
-
})),
|
|
1244
|
+
})), k(this, "captures", []), k(this, "captureGeneration", 0), k(this, "captureOnce", {
|
|
1240
1245
|
webVitals: !1,
|
|
1241
1246
|
navigationTiming: !1,
|
|
1242
1247
|
longFrames: !1,
|
|
1243
1248
|
uncleanExit: !1,
|
|
1244
1249
|
userTiming: !1
|
|
1245
|
-
}),
|
|
1250
|
+
}), k(this, "bootBuffer", new en((e) => {
|
|
1246
1251
|
this.dropHeld(e);
|
|
1247
|
-
})),
|
|
1248
|
-
|
|
1249
|
-
}),
|
|
1252
|
+
})), k(this, "forwardBuffer", []), k(this, "forwardScheduled", !1), k(this, "roleResolved", !1), k(this, "started", Promise.resolve()), k(this, "ready", !1), k(this, "destroyed", !1), k(this, "stopping", void 0), k(this, "lastSendAt", null), k(this, "lastGapAt", 0), k(this, "limits", void 0), k(this, "journeyOptions", void 0), k(this, "tunablesLocked", !1), k(this, "degraded", void 0), k(this, "serverReported", !1), k(this, "onPageHide", () => {
|
|
1253
|
+
R(this), this.dropPaused(), this.role() === "forwarder" && (this.tracing.end(), this.sendForwarded());
|
|
1254
|
+
}), k(this, "busCanAccept", (e, t) => this.bus?.isRegistered(e, t) ?? !1), k(this, "busAccept", (e, t, n) => {
|
|
1250
1255
|
this.destroyed || this.ensureBus().then((r) => {
|
|
1251
1256
|
r && !this.destroyed && this.diagnostics.guard("bus.send_failed", "The bus could not accept a direct message from a child frame.", () => {
|
|
1252
1257
|
r.acceptDirect(e, t, n);
|
|
1253
1258
|
});
|
|
1254
1259
|
});
|
|
1255
|
-
}),
|
|
1260
|
+
}), k(this, "reportLoss", (e, t, n, r) => {
|
|
1256
1261
|
this.drops.add(e, t, n, r);
|
|
1257
|
-
}),
|
|
1262
|
+
}), k(this, "reportGap", (e, t) => {
|
|
1258
1263
|
this.drops.add(e.reason, t.flatMap((e) => e.records), t.map((e) => e.id));
|
|
1259
1264
|
let n = Date.now();
|
|
1260
|
-
n - this.lastGapAt < 6e4 || (this.lastGapAt = n, new
|
|
1265
|
+
n - this.lastGapAt < 6e4 || (this.lastGapAt = n, new B(() => this, re).warn("stored records were dropped before delivery", {
|
|
1261
1266
|
"gap.batches": e.batches,
|
|
1262
1267
|
"gap.records": e.records,
|
|
1263
1268
|
"gap.reason": e.reason
|
|
1264
1269
|
}));
|
|
1265
|
-
}), this.diagnostics = new
|
|
1266
|
-
let n = (e) =>
|
|
1267
|
-
this.tracing = new
|
|
1270
|
+
}), this.diagnostics = new V(typeof e.onDiagnostic == "function" ? e.onDiagnostic : void 0), this.platform = Ve(this.diagnostics), this.degraded = t || this.onServer(), this.config = P(this.allowed(e), this.diagnostics), this.explicitSecurityContext = !!e.securityContext?.id, this.config.securityContext.id ||= A(this.diagnostics), this.diagnostics.setPolicy(this.config.diagnostics.throttleMs, this.config.diagnostics.consoleFallback), this.identityBuiltAs = this.config.identity, this.identity = qe(this.diagnostics, this.stores, this.config.correlation.sessionIdleMs), this.sessionTouch = new We(this.diagnostics, this.stores, this.config.correlation.sessionIdleMs), this.breadcrumbs = new Yt(this.config.captureLimits.breadcrumbs);
|
|
1271
|
+
let n = (e) => at(e, this.config.sampling.defaultRate);
|
|
1272
|
+
this.tracing = new kt(this.diagnostics, this.config.correlation.traceMaxAgeMs ?? Infinity, this.config.otelLoader, {
|
|
1268
1273
|
enabled: () => this.config.tracesEndpoint !== null,
|
|
1269
1274
|
keeps: n,
|
|
1270
1275
|
onEnd: (e) => {
|
|
1271
|
-
n(e.traceId) && this.recordSpan(
|
|
1276
|
+
n(e.traceId) && this.recordSpan(Cn(e));
|
|
1272
1277
|
}
|
|
1273
|
-
}), this.limits = { ...this.config.limits }, this.console = new
|
|
1274
|
-
...
|
|
1278
|
+
}), this.limits = { ...this.config.limits }, this.console = new qt(this.config.consoleOutput, this.diagnostics, this.limits), this.drops = new $t(this.config, this.diagnostics), this.journeyOptions = {
|
|
1279
|
+
...rt,
|
|
1275
1280
|
maxAgeMs: this.config.journey.maxAgeMs
|
|
1276
|
-
}, this.journey = new
|
|
1281
|
+
}, this.journey = new nt(this.journeyOptions, this.diagnostics, this.identity.contextId, (e) => {
|
|
1277
1282
|
this.bus?.broadcastJourney(e);
|
|
1278
|
-
}, this.stores), this.builder = new
|
|
1283
|
+
}, this.stores), this.builder = new yn({
|
|
1279
1284
|
remote: this.remote,
|
|
1280
1285
|
config: this.config,
|
|
1281
1286
|
limits: this.limits,
|
|
@@ -1287,7 +1292,7 @@ var K = class e {
|
|
|
1287
1292
|
identity: this.identity,
|
|
1288
1293
|
platform: this.platform,
|
|
1289
1294
|
debug: this.debugBuffer
|
|
1290
|
-
}), this.meter = new
|
|
1295
|
+
}), this.meter = new Gt(() => this.config.metrics.intervalMs, (e, t, n) => {
|
|
1291
1296
|
this.emitPoint(e, t, n);
|
|
1292
1297
|
}, this.diagnostics, this.config.metrics), this.diagnostics.setHandler(this.diagnosticHandler()), this.syncProfiler();
|
|
1293
1298
|
}
|
|
@@ -1303,10 +1308,10 @@ var K = class e {
|
|
|
1303
1308
|
else {
|
|
1304
1309
|
this.recordingDiagnostic = !0;
|
|
1305
1310
|
try {
|
|
1306
|
-
(
|
|
1311
|
+
(Fn.has(e.code) ? this.diagnosticLogger.info : this.diagnosticLogger.warn)(e.message, {
|
|
1307
1312
|
"diagnostic.code": e.code,
|
|
1308
1313
|
"diagnostic.count": e.count,
|
|
1309
|
-
"diagnostic.detail":
|
|
1314
|
+
"diagnostic.detail": Ln(e.detail)
|
|
1310
1315
|
});
|
|
1311
1316
|
} finally {
|
|
1312
1317
|
this.recordingDiagnostic = !1;
|
|
@@ -1323,11 +1328,11 @@ var K = class e {
|
|
|
1323
1328
|
let n = {
|
|
1324
1329
|
t: Date.now(),
|
|
1325
1330
|
category: "custom",
|
|
1326
|
-
message:
|
|
1331
|
+
message: Xe(String(e), this.limits.maxBodyChars)
|
|
1327
1332
|
};
|
|
1328
1333
|
if (t !== void 0) {
|
|
1329
|
-
let e =
|
|
1330
|
-
n.data =
|
|
1334
|
+
let e = Ze(t, this.limits, this.diagnostics);
|
|
1335
|
+
n.data = D(e) ? e : { value: e };
|
|
1331
1336
|
}
|
|
1332
1337
|
this.breadcrumbs.push(n);
|
|
1333
1338
|
});
|
|
@@ -1337,7 +1342,7 @@ var K = class e {
|
|
|
1337
1342
|
}
|
|
1338
1343
|
startMeasure(e, t) {
|
|
1339
1344
|
let n = this.identityEpoch, r = () => !this.destroyed && !this.rotating && (!this.config.securityContext.isolation || this.identityEpoch === n), i = this.diagnostics.guard("record.sanitize_failed", "The library could not read the attributes of the measure.", () => ({ ...t }));
|
|
1340
|
-
return
|
|
1345
|
+
return Mt(this.diagnostics.guard("record.sanitize_failed", "The library could not read the name of the measure.", () => `${e}`) ?? "", i ?? {}, this.tracing.request().span, {
|
|
1341
1346
|
metric: (e, t, n) => {
|
|
1342
1347
|
r() && this.recordMetric(e, t, n);
|
|
1343
1348
|
},
|
|
@@ -1352,9 +1357,9 @@ var K = class e {
|
|
|
1352
1357
|
level: "INFO",
|
|
1353
1358
|
type: "span",
|
|
1354
1359
|
body: e.name,
|
|
1355
|
-
namespace:
|
|
1360
|
+
namespace: we,
|
|
1356
1361
|
payload: e.attributes,
|
|
1357
|
-
fixed:
|
|
1362
|
+
fixed: wn(e),
|
|
1358
1363
|
trace: {
|
|
1359
1364
|
traceId: e.traceId,
|
|
1360
1365
|
spanId: e.spanId,
|
|
@@ -1369,7 +1374,7 @@ var K = class e {
|
|
|
1369
1374
|
level: "INFO",
|
|
1370
1375
|
type: "metric",
|
|
1371
1376
|
body: e,
|
|
1372
|
-
namespace:
|
|
1377
|
+
namespace: ee,
|
|
1373
1378
|
payload: t,
|
|
1374
1379
|
fixed: n,
|
|
1375
1380
|
aggregated: !0
|
|
@@ -1380,7 +1385,7 @@ var K = class e {
|
|
|
1380
1385
|
let e = this.config.profiler.enabled && this.config.enabled;
|
|
1381
1386
|
if (e === this.profilerOn) return;
|
|
1382
1387
|
this.profilerOn = e;
|
|
1383
|
-
let t =
|
|
1388
|
+
let t = j();
|
|
1384
1389
|
if (!e) {
|
|
1385
1390
|
t.collect(!1), t.detach();
|
|
1386
1391
|
return;
|
|
@@ -1407,25 +1412,25 @@ var K = class e {
|
|
|
1407
1412
|
this.replayConsent = e, e ? this.replay?.start() : this.replay?.stop();
|
|
1408
1413
|
}
|
|
1409
1414
|
collectPoints() {
|
|
1410
|
-
this.meter.collect(), this.profilerOn &&
|
|
1415
|
+
this.meter.collect(), this.profilerOn && j().collect(!1);
|
|
1411
1416
|
}
|
|
1412
1417
|
advanceIdentity() {
|
|
1413
|
-
this.identityEpoch++, this.profilerOn && this.config.securityContext.isolation &&
|
|
1418
|
+
this.identityEpoch++, this.profilerOn && this.config.securityContext.isolation && j().reset(), this.remote.sampling = null, this.refreshCaptures();
|
|
1414
1419
|
}
|
|
1415
1420
|
static pinned() {
|
|
1416
|
-
return globalThis[
|
|
1421
|
+
return globalThis[On] ?? null;
|
|
1417
1422
|
}
|
|
1418
1423
|
static current() {
|
|
1419
1424
|
let t = e.local;
|
|
1420
1425
|
if (t) return t.destroyed ? null : t;
|
|
1421
1426
|
let n = e.pinned();
|
|
1422
|
-
return n &&
|
|
1427
|
+
return n && Vn(n) ? n : null;
|
|
1423
1428
|
}
|
|
1424
1429
|
static stopped() {
|
|
1425
1430
|
let t = e.local;
|
|
1426
1431
|
if (t?.destroyed) return t;
|
|
1427
|
-
let n = globalThis[
|
|
1428
|
-
return n &&
|
|
1432
|
+
let n = globalThis[kn];
|
|
1433
|
+
return n && Vn(n) ? n : null;
|
|
1429
1434
|
}
|
|
1430
1435
|
isDestroyed() {
|
|
1431
1436
|
return this.destroyed;
|
|
@@ -1442,10 +1447,10 @@ var K = class e {
|
|
|
1442
1447
|
}
|
|
1443
1448
|
refuse(e) {
|
|
1444
1449
|
this.startFailed = !0;
|
|
1445
|
-
let t =
|
|
1446
|
-
|
|
1447
|
-
console.warn(`${f} ${
|
|
1448
|
-
}), this.diagnostics.report("config.invalid",
|
|
1450
|
+
let t = P({ redact: F }, new V(), this.config);
|
|
1451
|
+
$e(this.config, t), M(() => {
|
|
1452
|
+
console.warn(`${f} ${Mn}`);
|
|
1453
|
+
}), this.diagnostics.report("config.invalid", Mn, void 0, e), this.rehookHeld();
|
|
1449
1454
|
}
|
|
1450
1455
|
static startOrUpdate(t, n) {
|
|
1451
1456
|
let r = e.local;
|
|
@@ -1453,19 +1458,19 @@ var K = class e {
|
|
|
1453
1458
|
e.local = null;
|
|
1454
1459
|
let i = e.pinned();
|
|
1455
1460
|
if (i) {
|
|
1456
|
-
if (!
|
|
1461
|
+
if (!Vn(i)) return e.startDegraded(t, i.sdkVersion, n);
|
|
1457
1462
|
if (!i.destroyed) return i.reconfigure(t), i;
|
|
1458
1463
|
}
|
|
1459
1464
|
let a = new e(t, !1);
|
|
1460
|
-
return globalThis[
|
|
1465
|
+
return globalThis[On] = a, Reflect.deleteProperty(globalThis, kn), n || a.launch(), a;
|
|
1461
1466
|
}
|
|
1462
1467
|
static startDegraded(t, n, r) {
|
|
1463
1468
|
let i = new e(t, !0);
|
|
1464
1469
|
e.local = i;
|
|
1465
1470
|
let a = typeof n == "string" ? n : "before 0.9.0";
|
|
1466
|
-
return i.mismatchVersion = a, i.diagnostics.report("runtime.version_mismatch", `Another copy of the library, version ${a}, owns the page runtime. This copy, version ${
|
|
1471
|
+
return i.mismatchVersion = a, i.diagnostics.report("runtime.version_mismatch", `Another copy of the library, version ${a}, owns the page runtime. This copy, version ${T}, runs in console-only mode and installs no capture. Load one version of the library on the page.`, {
|
|
1467
1472
|
found: a,
|
|
1468
|
-
own:
|
|
1473
|
+
own: T
|
|
1469
1474
|
}), r || i.launch(), i;
|
|
1470
1475
|
}
|
|
1471
1476
|
reconfigure(e) {
|
|
@@ -1474,31 +1479,31 @@ var K = class e {
|
|
|
1474
1479
|
return;
|
|
1475
1480
|
}
|
|
1476
1481
|
if (this.config.lockConfiguration) {
|
|
1477
|
-
let t =
|
|
1478
|
-
|
|
1482
|
+
let t = P(e, this.diagnostics, this.config);
|
|
1483
|
+
J(this.config, t) || this.diagnostics.report("config.locked", "Runtime configuration is locked. Use setConfigurationLocked(false) to unlock it explicitly.");
|
|
1479
1484
|
return;
|
|
1480
1485
|
}
|
|
1481
|
-
|
|
1486
|
+
R(this);
|
|
1482
1487
|
let t = this.keepDestination(this.keepRouting(this.allowed(e)));
|
|
1483
1488
|
!this.tunablesLocked && t.securityContext?.id && (this.explicitSecurityContext = !0);
|
|
1484
|
-
let n =
|
|
1485
|
-
for (let e of r)
|
|
1489
|
+
let n = P(t, this.diagnostics, this.config), r = this.tunablesLocked ? ["correlation", "storage"] : [];
|
|
1490
|
+
for (let e of r) J(n[e], this.config[e]) || (this.diagnostics.report("config.invalid", `${e} cannot change after startup. The library keeps the current settings.`), Object.assign(n, { [e]: this.config[e] }));
|
|
1486
1491
|
this.keepStartupTunables(n);
|
|
1487
1492
|
let { redact: i, processors: a, enabled: o } = this.config;
|
|
1488
|
-
o && !n.enabled && this.collectPoints(),
|
|
1493
|
+
o && !n.enabled && this.collectPoints(), $e(this.config, n), this.config.redact !== F && (this.startFailed = !1), (this.config.redact !== i || this.config.processors !== a) && this.debugBuffer.clear(), this.breadcrumbs.resize(this.config.captureLimits.breadcrumbs), this.diagnostics.setHandler(this.diagnosticHandler()), this.diagnostics.setPolicy(this.config.diagnostics.throttleMs, this.config.diagnostics.consoleFallback), this.builder.invalidateResource(), this.console.update(this.config.consoleOutput), this.keepBuiltIdentity(), this.syncProfiler(), this.launch(), this.running && o !== this.config.enabled && this.sender?.hold(!this.config.enabled), this.refreshCaptures(), this.roleResolved && this.syncSender(), this.diagnostics.report("config.reconfigured", "A later configure() call updated the runtime.");
|
|
1489
1494
|
}
|
|
1490
1495
|
onServer() {
|
|
1491
1496
|
return this.platform.platform === "node";
|
|
1492
1497
|
}
|
|
1493
1498
|
allowed(e) {
|
|
1494
|
-
return this.degraded ? (this.onServer() && !this.serverReported &&
|
|
1499
|
+
return this.degraded ? (this.onServer() && !this.serverReported && zn(e) && (this.serverReported = !0, this.diagnostics.report("config.invalid", "The library runs console-only on Node. It sends no record and installs no capture. It ignores endpoint, metricsEndpoint, tracesEndpoint, transport and transportWorker.")), Rn(e)) : e;
|
|
1495
1500
|
}
|
|
1496
1501
|
keepRouting(e) {
|
|
1497
1502
|
if (!this.tunablesLocked || this.degraded || !this.config.securityContext.isolation) return e;
|
|
1498
|
-
let t =
|
|
1503
|
+
let t = P(e, new V(), this.config), n = h.filter((e) => !J(t[e], this.config[e]));
|
|
1499
1504
|
if (t.securityContext.id !== this.config.securityContext.id && n.push("securityContext.id"), n.length === 0) return e;
|
|
1500
1505
|
let r = { ...e };
|
|
1501
|
-
for (let e of
|
|
1506
|
+
for (let e of h) n.includes(e) && Reflect.deleteProperty(r, e);
|
|
1502
1507
|
if (n.includes("securityContext.id")) {
|
|
1503
1508
|
let t = { ...e.securityContext };
|
|
1504
1509
|
Reflect.deleteProperty(t, "id"), r.securityContext = t;
|
|
@@ -1506,7 +1511,7 @@ var K = class e {
|
|
|
1506
1511
|
return this.diagnostics.report("config.invalid", `Isolation refuses changes to ${n.join(", ")}. Use rotateSecurityContext() for these changes. To permit them, set securityContext.isolation: false in a separate configure() call. The other settings apply.`), r;
|
|
1507
1512
|
}
|
|
1508
1513
|
keepStartupTunables(e) {
|
|
1509
|
-
if (this.senderLoad !== void 0 && this.keepSections(e,
|
|
1514
|
+
if (this.senderLoad !== void 0 && this.keepSections(e, An), !this.tunablesLocked) {
|
|
1510
1515
|
Object.assign(this.limits, e.limits), this.journeyOptions.maxAgeMs = e.journey.maxAgeMs;
|
|
1511
1516
|
return;
|
|
1512
1517
|
}
|
|
@@ -1515,10 +1520,10 @@ var K = class e {
|
|
|
1515
1520
|
let { maxAgeMs: t } = this.config.journey;
|
|
1516
1521
|
e.journey.maxAgeMs !== t && (this.diagnostics.report("config.invalid", `journey.maxAgeMs cannot change after startup. It stays ${String(t)}.`, { requested: e.journey.maxAgeMs }), e.journey.maxAgeMs = t);
|
|
1517
1522
|
let { maxProbes: n } = this.config.profiler;
|
|
1518
|
-
e.profiler.maxProbes !== n && (this.diagnostics.report("config.invalid", `profiler.maxProbes cannot change after startup. It stays ${String(n)}.`, { requested: e.profiler.maxProbes }), e.profiler.maxProbes = n);
|
|
1523
|
+
e.profiler.maxProbes !== n && (this.diagnostics.report("config.invalid", `profiler.maxProbes cannot change after startup. It stays ${String(n)}.`, { requested: e.profiler.maxProbes }), e.profiler.maxProbes = n), e.otelLoader !== this.config.otelLoader && (this.diagnostics.report("config.invalid", "otelLoader cannot change after startup. The library keeps the current loader."), e.otelLoader = this.config.otelLoader);
|
|
1519
1524
|
}
|
|
1520
1525
|
keepSections(e, t) {
|
|
1521
|
-
for (let n of t)
|
|
1526
|
+
for (let n of t) J(e[n], this.config[n]) || (this.diagnostics.report("config.invalid", `${n} cannot change after startup. The current values stay.`, { requested: e[n] }), Object.assign(e, { [n]: this.config[n] }));
|
|
1522
1527
|
}
|
|
1523
1528
|
keepDestination(e) {
|
|
1524
1529
|
if (this.senderLoad === void 0) return e;
|
|
@@ -1544,9 +1549,9 @@ var K = class e {
|
|
|
1544
1549
|
this.startFailed || (this.tunablesLocked || (this.tunablesLocked = !0, this.config.enabled || this.drops.add("disabled", this.rehookHeld())), !this.running && this.config.enabled && this.start());
|
|
1545
1550
|
}
|
|
1546
1551
|
start() {
|
|
1547
|
-
this.running = !0, this.identityBuiltAs === "storage" && !this.onServer() && (this.backing =
|
|
1548
|
-
let { sessionIdleMs: e, traceMaxAgeMs: t } = this.config.correlation, { sessionId: n, tabId: r } =
|
|
1549
|
-
this.sessionTouch = new
|
|
1552
|
+
this.running = !0, this.identityBuiltAs === "storage" && !this.onServer() && (this.backing = Je);
|
|
1553
|
+
let { sessionIdleMs: e, traceMaxAgeMs: t } = this.config.correlation, { sessionId: n, tabId: r } = qe(this.diagnostics, this.stores, e);
|
|
1554
|
+
this.sessionTouch = new We(this.diagnostics, this.stores, e), this.sessionPicked ? this.sessionTouch.restart(this.identity.sessionId) : this.identity.sessionId = n, this.identity.tabId = r, this.builder.invalidateResource(), this.breadcrumbs.retain((e) => !jn.includes(e.category)), this.tracing.setup(t ?? Infinity, this.config.otelLoader), this.tracing.loadOtel();
|
|
1550
1555
|
for (let e of this.rehookHeld()) this.bootBuffer.push(e, this.config.buffering.maxHeldRecords);
|
|
1551
1556
|
this.openGate(), this.init();
|
|
1552
1557
|
}
|
|
@@ -1586,22 +1591,22 @@ var K = class e {
|
|
|
1586
1591
|
async buildBus() {
|
|
1587
1592
|
try {
|
|
1588
1593
|
await this.startGate;
|
|
1589
|
-
let { Bus: e } = await import("./bus-
|
|
1594
|
+
let { Bus: e } = await import("./bus-DyNafxZN.js");
|
|
1590
1595
|
if (this.destroyed) return null;
|
|
1591
1596
|
let t = new e(this.config, this.diagnostics, this.platform, this.identity.contextId, this.identity.tabId, {
|
|
1592
1597
|
onSecurityContext: (e) => {
|
|
1593
1598
|
if (this.explicitSecurityContext && this.config.securityContext.id !== e) return this.contextMismatch = !0, this.diagnostics.report("security.context_mismatch", "The configured security context differs from the upstream owner."), !1;
|
|
1594
1599
|
if (this.contextMismatch = !1, this.config.securityContext.id !== e) {
|
|
1595
1600
|
if (this.ownerAdopted) {
|
|
1596
|
-
|
|
1601
|
+
R(this), this.drops.add("security_context", [
|
|
1597
1602
|
...this.bootBuffer.take(),
|
|
1598
1603
|
...this.pendingRecords.take(),
|
|
1599
1604
|
...this.forwardBuffer
|
|
1600
1605
|
]), this.forwardBuffer = [], this.context.clear(), this.breadcrumbs.clear();
|
|
1601
1606
|
let e = this.rotating;
|
|
1602
|
-
this.rotating = !0, this.collectPoints(), this.profilerOn &&
|
|
1607
|
+
this.rotating = !0, this.collectPoints(), this.profilerOn && j().reset();
|
|
1603
1608
|
let t = this.sessionTouch.stored();
|
|
1604
|
-
this.resetSession(t !== void 0 && t !== this.identity.sessionId ? t :
|
|
1609
|
+
this.resetSession(t !== void 0 && t !== this.identity.sessionId ? t : A(this.diagnostics)), this.rotating = e, this.advanceIdentity();
|
|
1605
1610
|
}
|
|
1606
1611
|
this.config.securityContext.id = e;
|
|
1607
1612
|
}
|
|
@@ -1640,7 +1645,7 @@ var K = class e {
|
|
|
1640
1645
|
}
|
|
1641
1646
|
async buildSender() {
|
|
1642
1647
|
try {
|
|
1643
|
-
let { Sender: e } = await import("./sender-
|
|
1648
|
+
let { Sender: e } = await import("./sender-BRSpc7R8.js"), t = this.destroyed ? null : await e.create({
|
|
1644
1649
|
storage: this.memoryStorage,
|
|
1645
1650
|
onStorage: (e) => {
|
|
1646
1651
|
e.name === "memory" && (this.memoryStorage = e);
|
|
@@ -1654,7 +1659,7 @@ var K = class e {
|
|
|
1654
1659
|
onLoss: this.reportLoss,
|
|
1655
1660
|
remote: this.remote,
|
|
1656
1661
|
beforeExit: () => {
|
|
1657
|
-
|
|
1662
|
+
R(this), this.collectPoints(), this.tracing.end();
|
|
1658
1663
|
},
|
|
1659
1664
|
onSent: (e) => {
|
|
1660
1665
|
this.lastSendAt = e;
|
|
@@ -1686,18 +1691,18 @@ var K = class e {
|
|
|
1686
1691
|
let e = this.remote.sampling?.wire();
|
|
1687
1692
|
e && (this.remoteCaptureTimer = setTimeout(() => {
|
|
1688
1693
|
this.refreshCaptures();
|
|
1689
|
-
}, e.ttlMs),
|
|
1694
|
+
}, e.ttlMs), O(this.remoteCaptureTimer)), this.captureState(this.effectiveCapture()) !== this.installedCaptureKey && this.installCaptures();
|
|
1690
1695
|
}
|
|
1691
1696
|
captureState(e) {
|
|
1692
1697
|
let { enabled: t, framePhases: n, framePacing: r } = this.config.profiler;
|
|
1693
|
-
return `${String(this.config.enabled)}${
|
|
1698
|
+
return `${String(this.config.enabled)}${In(e)}${String(t && n)}${String(t && r)}${this.replayState(e)}`;
|
|
1694
1699
|
}
|
|
1695
1700
|
replayState(e) {
|
|
1696
1701
|
let { replay: t } = this.config;
|
|
1697
1702
|
return t.enabled ? JSON.stringify([
|
|
1698
|
-
t.loader &&
|
|
1699
|
-
t.onSegment &&
|
|
1700
|
-
|
|
1703
|
+
t.loader && G(t.loader),
|
|
1704
|
+
t.onSegment && G(t.onSegment),
|
|
1705
|
+
G(t.recordOptions),
|
|
1701
1706
|
t.endpoint,
|
|
1702
1707
|
t.requireConsent,
|
|
1703
1708
|
t.mode,
|
|
@@ -1707,14 +1712,14 @@ var K = class e {
|
|
|
1707
1712
|
t.blockSelectors,
|
|
1708
1713
|
t.recordCanvas,
|
|
1709
1714
|
t.bufferMs,
|
|
1710
|
-
t.plugins.map(
|
|
1715
|
+
t.plugins.map(G),
|
|
1711
1716
|
e.fullUrls,
|
|
1712
1717
|
e.ignoreUrls.map(String)
|
|
1713
1718
|
]) : "";
|
|
1714
1719
|
}
|
|
1715
1720
|
effectiveCapture() {
|
|
1716
1721
|
let e = { ...this.config.capture }, t = this.remote.sampling?.current()?.capture;
|
|
1717
|
-
for (let n of
|
|
1722
|
+
for (let n of ce) {
|
|
1718
1723
|
let r = t?.[n];
|
|
1719
1724
|
if (e.remoteToggles.includes(n) && r !== void 0) {
|
|
1720
1725
|
if (r && typeof e[n] == "object") continue;
|
|
@@ -1743,7 +1748,7 @@ var K = class e {
|
|
|
1743
1748
|
diagnostics: this.diagnostics,
|
|
1744
1749
|
breadcrumbs: this.breadcrumbs,
|
|
1745
1750
|
tracing: this.tracing,
|
|
1746
|
-
logger: new
|
|
1751
|
+
logger: new yt(() => this, m),
|
|
1747
1752
|
once: this.captureOnce,
|
|
1748
1753
|
recordMetric: (e, t, n) => {
|
|
1749
1754
|
this.recordMetric(e, t, n);
|
|
@@ -1779,21 +1784,21 @@ var K = class e {
|
|
|
1779
1784
|
this.captures.length = 0, this.replay = e, e && this.captures.push(e);
|
|
1780
1785
|
}
|
|
1781
1786
|
loadWebSocket() {
|
|
1782
|
-
return this.diagnostics.guardAsync("capture.install_failed", "The library could not load the webSocket capture.", async () => (await import("./web-socket-
|
|
1787
|
+
return this.diagnostics.guardAsync("capture.install_failed", "The library could not load the webSocket capture.", async () => (await import("./web-socket-CE_9Q22z.js")).WebSocketCapture);
|
|
1783
1788
|
}
|
|
1784
1789
|
pluginCapture(e) {
|
|
1785
1790
|
let { name: t } = e, n = (e, t, n) => {
|
|
1786
1791
|
this.recordMetric(e, t, n);
|
|
1787
1792
|
}, r = (e) => {
|
|
1788
|
-
this.diagnostics.report("config.invalid",
|
|
1793
|
+
this.diagnostics.report("config.invalid", v, void 0, e);
|
|
1789
1794
|
}, i = {
|
|
1790
|
-
logger: new
|
|
1791
|
-
counter: (e, t = {}) =>
|
|
1792
|
-
histogram: (e, t = {}) =>
|
|
1795
|
+
logger: new B(() => this, `${m}.${t}`),
|
|
1796
|
+
counter: (e, t = {}) => Ht(e, t, n, r),
|
|
1797
|
+
histogram: (e, t = {}) => Wt(e, t, n, r),
|
|
1793
1798
|
addBreadcrumb: (e, t) => {
|
|
1794
1799
|
this.addBreadcrumb(e, t);
|
|
1795
1800
|
},
|
|
1796
|
-
ownRequest:
|
|
1801
|
+
ownRequest: Qe
|
|
1797
1802
|
};
|
|
1798
1803
|
return {
|
|
1799
1804
|
name: t,
|
|
@@ -1806,7 +1811,7 @@ var K = class e {
|
|
|
1806
1811
|
};
|
|
1807
1812
|
}
|
|
1808
1813
|
loadCapture(e) {
|
|
1809
|
-
return this.diagnostics.guardAsync("capture.install_failed", `The library could not load the ${e} capture.`,
|
|
1814
|
+
return this.diagnostics.guardAsync("capture.install_failed", `The library could not load the ${e} capture.`, Tn[e]);
|
|
1810
1815
|
}
|
|
1811
1816
|
registerWorker(e, t = {}) {
|
|
1812
1817
|
let n = !1, r;
|
|
@@ -1831,21 +1836,21 @@ var K = class e {
|
|
|
1831
1836
|
this.stopping ??= this.stop(t), await this.stopping, n !== void 0 && await this.clearStorage(n);
|
|
1832
1837
|
}
|
|
1833
1838
|
async stop(t) {
|
|
1834
|
-
t || (
|
|
1839
|
+
t || (R(this), this.collectPoints(), this.tracing.end()), this.profilerOn && (this.profilerOn = !1, j().detach()), this.destroyed = !0, this.backing = Ke(), ft(this), this.collectPoints(), clearTimeout(this.remoteCaptureTimer), this.remoteCaptureTimer = void 0, this.degraded || removeEventListener("pagehide", this.onPageHide), this.uninstallCaptures();
|
|
1835
1840
|
let n = t ? this.discardHeld() : this.flushHeld();
|
|
1836
1841
|
this.journey.destroy(), this.bus?.destroy(), await n, await this.senderLoad, await this.rotation?.catch(() => void 0);
|
|
1837
1842
|
let r = this.parkedSender;
|
|
1838
1843
|
this.parkedSender = void 0, await this.diagnostics.guardAsync("pipeline.crashed", "The delivery stack of the old context did not stop at shutdown. The library leaves its stored batches in storage.", async () => {
|
|
1839
1844
|
await (t ? r?.discard() : r?.retire("retain", 0, this.config.securityContext.id));
|
|
1840
|
-
}), await this.memoryStorage?.close(), e.pinned() === this && (Reflect.deleteProperty(globalThis,
|
|
1845
|
+
}), await this.memoryStorage?.close(), e.pinned() === this && (Reflect.deleteProperty(globalThis, On), globalThis[kn] = this);
|
|
1841
1846
|
}
|
|
1842
1847
|
shutdownRule(e) {
|
|
1843
|
-
let t = this.readOptions(e,
|
|
1848
|
+
let t = this.readOptions(e, Nn);
|
|
1844
1849
|
if (t === void 0) return { discard: !0 };
|
|
1845
1850
|
let { pending: n, clearStorage: r } = t, i = r == null, a = i || r === "context" || r === "namespace", o;
|
|
1846
1851
|
i || (o = r === "namespace" ? "namespace" : "context");
|
|
1847
1852
|
let s = n === void 0 || n === "flush";
|
|
1848
|
-
return (!a || !(s || n === "discard") || n === "flush" && o) && this.diagnostics.report("config.invalid",
|
|
1853
|
+
return (!a || !(s || n === "discard") || n === "flush" && o) && this.diagnostics.report("config.invalid", Nn), {
|
|
1849
1854
|
discard: !s || o !== void 0,
|
|
1850
1855
|
scope: o
|
|
1851
1856
|
};
|
|
@@ -1869,7 +1874,7 @@ var K = class e {
|
|
|
1869
1874
|
}
|
|
1870
1875
|
async clearStorage(e) {
|
|
1871
1876
|
this.tunablesLocked && await this.diagnostics.guardAsync("storage.degraded", "The library could not remove the stored batches at shutdown.", async () => {
|
|
1872
|
-
let { clearStored: t } = await import("./stored-context-
|
|
1877
|
+
let { clearStored: t } = await import("./stored-context-df1dEnht.js"), n = this.carried.map((e) => e.id);
|
|
1873
1878
|
this.carried = [], await t(this.storeAccess(), e, n, this.identityBuiltAs === "storage" && !this.onServer());
|
|
1874
1879
|
});
|
|
1875
1880
|
}
|
|
@@ -1930,11 +1935,11 @@ var K = class e {
|
|
|
1930
1935
|
}
|
|
1931
1936
|
let t = [];
|
|
1932
1937
|
for (let n of e) {
|
|
1933
|
-
if (!
|
|
1938
|
+
if (!Ne(n)) {
|
|
1934
1939
|
this.diagnostics.count("record.dropped_malformed");
|
|
1935
1940
|
continue;
|
|
1936
1941
|
}
|
|
1937
|
-
if (n.attributes["uiobs.debug_buffer"] !== !0 && !
|
|
1942
|
+
if (n.attributes["uiobs.debug_buffer"] !== !0 && !it(n, this.config, this.remote.sampling?.current() ?? null)) {
|
|
1938
1943
|
this.diagnostics.count("record.dropped_by_sampling");
|
|
1939
1944
|
continue;
|
|
1940
1945
|
}
|
|
@@ -1950,14 +1955,14 @@ var K = class e {
|
|
|
1950
1955
|
for (let t of e) r && !t.attributes["journey.id"] && (t.attributes["journey.id"] = r.id, t.attributes["journey.name"] = r.name), this.route(t);
|
|
1951
1956
|
}
|
|
1952
1957
|
regenerateTabId() {
|
|
1953
|
-
let e =
|
|
1954
|
-
this.diagnostics.report("bus.
|
|
1958
|
+
let e = A(this.diagnostics);
|
|
1959
|
+
this.diagnostics.report("bus.tab_id_changed", "Another context uses this tab id. A duplicated tab is the usual cause. The library makes a new tab id.", {
|
|
1955
1960
|
was: this.identity.tabId,
|
|
1956
1961
|
now: e
|
|
1957
|
-
}), this.identity.tabId = e,
|
|
1962
|
+
}), this.identity.tabId = e, Ue(e, this.diagnostics, this.stores), this.builder.invalidateResource(), this.bus?.setTabId(e);
|
|
1958
1963
|
}
|
|
1959
1964
|
newSession() {
|
|
1960
|
-
this.destroyed || (
|
|
1965
|
+
this.destroyed || (R(this), this.resetSession(A(this.diagnostics)));
|
|
1961
1966
|
}
|
|
1962
1967
|
resetSession(e) {
|
|
1963
1968
|
this.sessionPicked = !0, this.collectPoints(), this.tracing.rotate("explicit"), this.journey.end(), this.breadcrumbs.clear(), this.debugBuffer.clear(), this.replay?.reset(), this.identity.sessionId = e, this.sessionTouch.restart(e), this.builder.invalidateResource();
|
|
@@ -1965,7 +1970,7 @@ var K = class e {
|
|
|
1965
1970
|
rotateSecurityContext(e, t = {}) {
|
|
1966
1971
|
if (this.destroyed) return Promise.reject(/* @__PURE__ */ Error("The runtime has stopped."));
|
|
1967
1972
|
if (!this.tunablesLocked) return Promise.reject(/* @__PURE__ */ Error("The runtime is not configured. Call configure() before rotateSecurityContext()."));
|
|
1968
|
-
|
|
1973
|
+
R(this), this.rotating = !0;
|
|
1969
1974
|
let n = ++this.rotationSeq, r = (this.rotation ?? Promise.resolve()).catch(() => void 0).then(() => this.runRotation(e, t, n));
|
|
1970
1975
|
this.rotation = r;
|
|
1971
1976
|
let i = () => {
|
|
@@ -1978,7 +1983,7 @@ var K = class e {
|
|
|
1978
1983
|
if (await this.started, this.role() === "forwarder") throw Error("Rotate the security context on the upstream owner, or use bus.mode: sender for an independent identity.");
|
|
1979
1984
|
let r;
|
|
1980
1985
|
try {
|
|
1981
|
-
r = (await import("./rotation-
|
|
1986
|
+
r = (await import("./rotation-ChBbNDE2.js")).rotateContext;
|
|
1982
1987
|
} catch (e) {
|
|
1983
1988
|
throw this.diagnostics.report("pipeline.crashed", "The library could not load the security-context rotation.", void 0, e), await this.closeDelivery(), e;
|
|
1984
1989
|
}
|
|
@@ -1992,7 +1997,7 @@ var K = class e {
|
|
|
1992
1997
|
rotationHost() {
|
|
1993
1998
|
return {
|
|
1994
1999
|
runtime: this,
|
|
1995
|
-
quiet: new
|
|
2000
|
+
quiet: new V(),
|
|
1996
2001
|
senderLoaded: async () => {
|
|
1997
2002
|
await this.senderLoad;
|
|
1998
2003
|
},
|
|
@@ -2065,13 +2070,13 @@ var K = class e {
|
|
|
2065
2070
|
this.parkedSender = e, await this.diagnostics.guardAsync("pipeline.crashed", "The delivery stack of the old context did not stop. The next rotation that succeeds retires it.", () => e.pause(this.config.securityContext.id));
|
|
2066
2071
|
}
|
|
2067
2072
|
async debugBundle(e) {
|
|
2068
|
-
let { configSummary: t } = await import("./debug-bundle-
|
|
2073
|
+
let { configSummary: t } = await import("./debug-bundle-w78W46zr.js"), { record: n } = this.builder.build({
|
|
2069
2074
|
level: "INFO",
|
|
2070
2075
|
type: "system",
|
|
2071
2076
|
body: "debug bundle",
|
|
2072
|
-
namespace:
|
|
2073
|
-
payload: { [
|
|
2074
|
-
}, !0), r = n?.attributes ?? {}, i = r[
|
|
2077
|
+
namespace: ne,
|
|
2078
|
+
payload: { [x]: this.breadcrumbs.snapshot() }
|
|
2079
|
+
}, !0), r = n?.attributes ?? {}, i = r[x], a = r[E];
|
|
2075
2080
|
return {
|
|
2076
2081
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2077
2082
|
sdkVersion: this.sdkVersion,
|
|
@@ -2088,7 +2093,7 @@ var K = class e {
|
|
|
2088
2093
|
let e = this.sender?.stats(), t = [];
|
|
2089
2094
|
this.mismatchVersion && t.push("runtime.version_mismatch"), this.contextMismatch && t.push("security.context_mismatch");
|
|
2090
2095
|
let { redact: n, processors: r } = this.config;
|
|
2091
|
-
(n ===
|
|
2096
|
+
(n === F || r.includes(F)) && t.push("records.refused"), this.deliveryClosed ? t.push("security.rotation_failed") : this.ready && this.config.enabled && this.hasDestination() && this.role() === "sender" && !this.sender && t.push("sender.unavailable");
|
|
2092
2097
|
let { sourcePolicy: i, maxMessageBytes: a, maxRecordsPerMessage: o, maxMessagesPerSecond: s } = this.config.bus;
|
|
2093
2098
|
return {
|
|
2094
2099
|
delivery: {
|
|
@@ -2132,12 +2137,12 @@ var K = class e {
|
|
|
2132
2137
|
return this.flushFor(this.flushTimeout(e), !0);
|
|
2133
2138
|
}
|
|
2134
2139
|
async flushFor(e, t) {
|
|
2135
|
-
|
|
2140
|
+
R(this), t && this.collectPoints();
|
|
2136
2141
|
let n = this.idle();
|
|
2137
2142
|
if (n) return n;
|
|
2138
2143
|
let r = Date.now() + e, i, a = new Promise((t) => {
|
|
2139
2144
|
let n = setTimeout(t, e);
|
|
2140
|
-
|
|
2145
|
+
O(n), i = () => {
|
|
2141
2146
|
clearTimeout(n);
|
|
2142
2147
|
};
|
|
2143
2148
|
});
|
|
@@ -2149,26 +2154,26 @@ var K = class e {
|
|
|
2149
2154
|
}
|
|
2150
2155
|
async flushBefore(e, t) {
|
|
2151
2156
|
let n = this.heldRecords(), r = this.ready ? this.senderLoad : this.started;
|
|
2152
|
-
if (r && (!this.ready || !this.sender) && !await Promise.race([r.then(() => !0), t.then(() => !1)])) return
|
|
2157
|
+
if (r && (!this.ready || !this.sender) && !await Promise.race([r.then(() => !0), t.then(() => !1)])) return K({ pending: this.waiting() });
|
|
2153
2158
|
let { bus: i } = this, a = i?.getRole() === "forwarder", o = this.idle();
|
|
2154
2159
|
if (o) return o;
|
|
2155
2160
|
if (a) {
|
|
2156
|
-
let n = this.forwardBuffer.length, r = this.sendForwarded(), a = n - r, o = Math.floor(Math.max(0, e - Date.now()) *
|
|
2161
|
+
let n = this.forwardBuffer.length, r = this.sendForwarded(), a = n - r, o = Math.floor(Math.max(0, e - Date.now()) * ue), s = await i.requestFlush(o, t);
|
|
2157
2162
|
return s ? {
|
|
2158
2163
|
...s,
|
|
2159
2164
|
forwarded: r,
|
|
2160
2165
|
dropped: s.dropped + a
|
|
2161
|
-
} :
|
|
2166
|
+
} : K({
|
|
2162
2167
|
forwarded: r,
|
|
2163
2168
|
pending: r,
|
|
2164
2169
|
dropped: a
|
|
2165
2170
|
});
|
|
2166
2171
|
}
|
|
2167
2172
|
let { sender: s } = this;
|
|
2168
|
-
return s ?
|
|
2173
|
+
return s ? K(await s.flushUntil(t)) : this.rotating ? K({ pending: n + this.waiting() }) : Bn("complete", { dropped: n });
|
|
2169
2174
|
}
|
|
2170
2175
|
idle() {
|
|
2171
|
-
return this.tunablesLocked && this.config.enabled && !this.destroyed ? null :
|
|
2176
|
+
return this.tunablesLocked && this.config.enabled && !this.destroyed ? null : Bn("inactive", { pending: this.destroyed ? 0 : this.waiting() });
|
|
2172
2177
|
}
|
|
2173
2178
|
heldRecords() {
|
|
2174
2179
|
return this.bootBuffer.length + this.pendingRecords.length + this.forwardBuffer.length;
|
|
@@ -2186,52 +2191,52 @@ var K = class e {
|
|
|
2186
2191
|
else return this.diagnostics.guard("config.invalid", t, () => ({ ...e }));
|
|
2187
2192
|
}
|
|
2188
2193
|
flushTimeout(e) {
|
|
2189
|
-
let t = this.readOptions(e,
|
|
2190
|
-
if (!t) return
|
|
2194
|
+
let t = this.readOptions(e, Pn);
|
|
2195
|
+
if (!t) return ye;
|
|
2191
2196
|
let n = t.timeoutMs ?? 5e3;
|
|
2192
|
-
return typeof n == "number" && n >= 0 && n <= 6e5 ? n : (this.diagnostics.report("config.invalid",
|
|
2197
|
+
return typeof n == "number" && n >= 0 && n <= 6e5 ? n : (this.diagnostics.report("config.invalid", Pn), ye);
|
|
2193
2198
|
}
|
|
2194
2199
|
};
|
|
2195
|
-
|
|
2196
|
-
function
|
|
2200
|
+
k(q, "local", null);
|
|
2201
|
+
function J(e, t, n = /* @__PURE__ */ new WeakMap()) {
|
|
2197
2202
|
if (Object.is(e, t)) return !0;
|
|
2198
2203
|
if (e instanceof RegExp && t instanceof RegExp) return String(e) === String(t);
|
|
2199
2204
|
if (typeof e != "object" || !e || typeof t != "object" || !t) return !1;
|
|
2200
2205
|
if (n.has(e)) return n.get(e) === t;
|
|
2201
2206
|
n.set(e, t);
|
|
2202
2207
|
let r = Object.keys(e), i = Object.keys(t);
|
|
2203
|
-
return r.length === i.length && r.every((r) =>
|
|
2208
|
+
return r.length === i.length && r.every((r) => ze(t, r) && J(Reflect.get(e, r), Reflect.get(t, r), n));
|
|
2204
2209
|
}
|
|
2205
2210
|
// src/transport/worker-entry.ts
|
|
2206
|
-
var
|
|
2207
|
-
function
|
|
2208
|
-
if (
|
|
2209
|
-
let t = new
|
|
2211
|
+
var Y;
|
|
2212
|
+
function Hn(e = {}) {
|
|
2213
|
+
if (Y) return Y;
|
|
2214
|
+
let t = new V(e.onDiagnostic);
|
|
2210
2215
|
if (typeof document < "u" || typeof addEventListener != "function") return t.report("config.invalid", "Call serveTransportWorker() in a dedicated worker."), () => void 0;
|
|
2211
2216
|
let n = !1, r, i, a = (e) => {
|
|
2212
2217
|
t.guard("transport.http_error", "The transport worker could not read its connection.", () => {
|
|
2213
2218
|
let a = e.data;
|
|
2214
|
-
if (!
|
|
2219
|
+
if (!D(a) || a.p !== "ui-observability.transport/1" || a.t !== le.connect || e.ports.length === 0) return;
|
|
2215
2220
|
let o = e.ports[0];
|
|
2216
|
-
r || a.v !== "1.
|
|
2221
|
+
r || a.v !== "1.2.0" ? (o.postMessage(De), o.close()) : (r = o, import("./worker-server-FYfKHQhJ.js").then((e) => {
|
|
2217
2222
|
n || (i = e.serveWorkerPort(o, t));
|
|
2218
2223
|
}).catch((e) => {
|
|
2219
2224
|
t.report("transport.http_error", "The transport worker delivery module could not load.", void 0, e), t.guard("transport.http_error", "The failed transport port could not be closed.", () => {
|
|
2220
|
-
o.postMessage(
|
|
2225
|
+
o.postMessage(De), o.close();
|
|
2221
2226
|
});
|
|
2222
2227
|
}));
|
|
2223
2228
|
});
|
|
2224
2229
|
}, o = () => {
|
|
2225
|
-
n || (n = !0,
|
|
2226
|
-
r?.postMessage(
|
|
2230
|
+
n || (n = !0, Y = void 0, removeEventListener("message", a), i?.(), t.guard("transport.http_error", "The transport service could not close its port.", () => {
|
|
2231
|
+
r?.postMessage(De);
|
|
2227
2232
|
}), t.guard("transport.http_error", "The transport port could not close.", () => {
|
|
2228
2233
|
r?.close();
|
|
2229
2234
|
}));
|
|
2230
2235
|
};
|
|
2231
|
-
return addEventListener("message", a),
|
|
2236
|
+
return addEventListener("message", a), Y = o, o;
|
|
2232
2237
|
}
|
|
2233
2238
|
// src/transport/memory-transport.ts
|
|
2234
|
-
function
|
|
2239
|
+
function Un() {
|
|
2235
2240
|
let e = [], t = [], n = { status: 200 };
|
|
2236
2241
|
return {
|
|
2237
2242
|
transport: (r) => (e.push(r), n.status >= 200 && n.status < 300 && t.push(r), Promise.resolve({ ...n })),
|
|
@@ -2249,160 +2254,160 @@ function Wn() {
|
|
|
2249
2254
|
};
|
|
2250
2255
|
}
|
|
2251
2256
|
// src/index.ts
|
|
2252
|
-
var
|
|
2253
|
-
function
|
|
2254
|
-
return (
|
|
2257
|
+
var X = /* @__PURE__ */ new Map();
|
|
2258
|
+
function Z() {
|
|
2259
|
+
return (q.current() ?? q.stopped()) || q.configure({}, !0);
|
|
2255
2260
|
}
|
|
2256
|
-
function
|
|
2257
|
-
|
|
2261
|
+
function Wn(e) {
|
|
2262
|
+
q.configure(e), Q();
|
|
2258
2263
|
}
|
|
2259
|
-
function
|
|
2260
|
-
|
|
2264
|
+
function Gn(e) {
|
|
2265
|
+
Z().setConfigurationLocked(e);
|
|
2261
2266
|
}
|
|
2262
|
-
function
|
|
2263
|
-
return
|
|
2267
|
+
function Kn(e, t) {
|
|
2268
|
+
return Z().rotateSecurityContext(e, t);
|
|
2264
2269
|
}
|
|
2265
|
-
async function
|
|
2266
|
-
let e =
|
|
2267
|
-
return
|
|
2270
|
+
async function qn() {
|
|
2271
|
+
let e = Z();
|
|
2272
|
+
return Q(), {
|
|
2268
2273
|
...await e.health(),
|
|
2269
2274
|
loggerCache: {
|
|
2270
2275
|
...e.config.loggerCache,
|
|
2271
|
-
size:
|
|
2276
|
+
size: X.size
|
|
2272
2277
|
}
|
|
2273
2278
|
};
|
|
2274
2279
|
}
|
|
2275
|
-
async function
|
|
2276
|
-
let e = await
|
|
2277
|
-
return
|
|
2280
|
+
async function Jn() {
|
|
2281
|
+
let e = await qn();
|
|
2282
|
+
return Z().debugBundle(e);
|
|
2278
2283
|
}
|
|
2279
|
-
function
|
|
2280
|
-
let e = (
|
|
2281
|
-
if (t !== null) for (let e of
|
|
2282
|
-
if (
|
|
2283
|
-
|
|
2284
|
+
function Q() {
|
|
2285
|
+
let e = (q.current() ?? q.stopped())?.config.loggerCache.maxEntries, t = e === void 0 ? 256 : e;
|
|
2286
|
+
if (t !== null) for (let e of X.keys()) {
|
|
2287
|
+
if (X.size <= t) break;
|
|
2288
|
+
X.delete(e);
|
|
2284
2289
|
}
|
|
2285
2290
|
return t;
|
|
2286
2291
|
}
|
|
2287
|
-
function
|
|
2288
|
-
let n =
|
|
2289
|
-
if (t || n === 0) return new
|
|
2290
|
-
let r =
|
|
2291
|
-
return r ??= new
|
|
2292
|
+
function Yn(e, t) {
|
|
2293
|
+
let n = Q();
|
|
2294
|
+
if (t || n === 0) return new B(Z, e, t);
|
|
2295
|
+
let r = X.get(e);
|
|
2296
|
+
return r ??= new B(Z, e), X.delete(e), X.set(e, r), Q(), r;
|
|
2292
2297
|
}
|
|
2293
|
-
function
|
|
2294
|
-
return
|
|
2298
|
+
function $() {
|
|
2299
|
+
return Yn("app");
|
|
2300
|
+
}
|
|
2301
|
+
function Xn(e, t) {
|
|
2302
|
+
$().trace(e, t);
|
|
2295
2303
|
}
|
|
2296
2304
|
function Zn(e, t) {
|
|
2297
|
-
|
|
2305
|
+
$().debug(e, t);
|
|
2298
2306
|
}
|
|
2299
2307
|
function Qn(e, t) {
|
|
2300
|
-
|
|
2308
|
+
$().info(e, t);
|
|
2301
2309
|
}
|
|
2302
2310
|
function $n(e, t) {
|
|
2303
|
-
|
|
2311
|
+
$().warn(e, t);
|
|
2304
2312
|
}
|
|
2305
|
-
function er(e, t) {
|
|
2306
|
-
|
|
2313
|
+
function er(e, t, n) {
|
|
2314
|
+
$().error(e, t, n);
|
|
2307
2315
|
}
|
|
2308
2316
|
function tr(e, t, n) {
|
|
2309
|
-
|
|
2317
|
+
$().fatal(e, t, n);
|
|
2310
2318
|
}
|
|
2311
|
-
function nr(e, t
|
|
2312
|
-
|
|
2319
|
+
function nr(e, t) {
|
|
2320
|
+
$().logAction(e, t);
|
|
2313
2321
|
}
|
|
2314
2322
|
function rr(e, t) {
|
|
2315
|
-
|
|
2323
|
+
$().logEvent(e, t);
|
|
2316
2324
|
}
|
|
2317
|
-
function ir(e
|
|
2318
|
-
|
|
2319
|
-
}
|
|
2320
|
-
function $(e) {
|
|
2321
|
-
K.current()?.diagnostics.report("config.invalid", _, void 0, e);
|
|
2325
|
+
function ir(e) {
|
|
2326
|
+
q.current()?.diagnostics.report("config.invalid", v, void 0, e);
|
|
2322
2327
|
}
|
|
2323
2328
|
function ar(e, t = {}) {
|
|
2324
|
-
return
|
|
2325
|
-
|
|
2326
|
-
},
|
|
2329
|
+
return Ht(e, t, (e, t, n) => {
|
|
2330
|
+
Z().recordMetric(e, t, n);
|
|
2331
|
+
}, ir);
|
|
2327
2332
|
}
|
|
2328
2333
|
function or(e, t = {}) {
|
|
2329
|
-
return
|
|
2330
|
-
|
|
2331
|
-
},
|
|
2334
|
+
return Ut(e, t, (e, t, n) => {
|
|
2335
|
+
Z().recordMetric(e, t, n);
|
|
2336
|
+
}, ir);
|
|
2332
2337
|
}
|
|
2333
2338
|
function sr(e, t = {}) {
|
|
2334
|
-
return
|
|
2335
|
-
|
|
2336
|
-
},
|
|
2339
|
+
return Wt(e, t, (e, t, n) => {
|
|
2340
|
+
Z().recordMetric(e, t, n);
|
|
2341
|
+
}, ir);
|
|
2337
2342
|
}
|
|
2338
2343
|
function cr(e, t) {
|
|
2339
|
-
return
|
|
2344
|
+
return Z().startMeasure(e, t);
|
|
2340
2345
|
}
|
|
2341
2346
|
function lr(e, t, n) {
|
|
2342
|
-
let r =
|
|
2343
|
-
return
|
|
2347
|
+
let r = Z();
|
|
2348
|
+
return Nt(r.startMeasure(e, n), t, r.diagnostics);
|
|
2344
2349
|
}
|
|
2345
2350
|
function ur() {
|
|
2346
|
-
|
|
2351
|
+
Z().setReplay(!0);
|
|
2347
2352
|
}
|
|
2348
2353
|
function dr() {
|
|
2349
|
-
|
|
2354
|
+
Z().setReplay(!1);
|
|
2350
2355
|
}
|
|
2351
2356
|
var fr = {
|
|
2352
|
-
probe: (e, t) =>
|
|
2353
|
-
time: (e, t) =>
|
|
2357
|
+
probe: (e, t) => j().probe(e, t, q.current()?.diagnostics),
|
|
2358
|
+
time: (e, t) => j().time(e, t, q.current()?.diagnostics)
|
|
2354
2359
|
};
|
|
2355
2360
|
function pr(e, t) {
|
|
2356
|
-
|
|
2361
|
+
Z().addBreadcrumb(e, t);
|
|
2357
2362
|
}
|
|
2358
2363
|
function mr(e) {
|
|
2359
|
-
let t =
|
|
2360
|
-
|
|
2364
|
+
let t = Z();
|
|
2365
|
+
D(e) ? t.diagnostics.guard("record.sanitize_failed", "The library could not read the values of setContext().", () => {
|
|
2361
2366
|
t.context.merge(e);
|
|
2362
2367
|
}) : t.diagnostics.report("config.invalid", "setContext() takes an object. The library keeps the current context.");
|
|
2363
2368
|
}
|
|
2364
2369
|
function hr(e) {
|
|
2365
|
-
|
|
2370
|
+
Z().context.remove(e);
|
|
2366
2371
|
}
|
|
2367
2372
|
function gr(e, t) {
|
|
2368
|
-
return
|
|
2373
|
+
return Z().journey.start(e, t);
|
|
2369
2374
|
}
|
|
2370
2375
|
function _r() {
|
|
2371
|
-
|
|
2376
|
+
Z().journey.end();
|
|
2372
2377
|
}
|
|
2373
2378
|
function vr() {
|
|
2374
|
-
return
|
|
2379
|
+
return Z().journey.current();
|
|
2375
2380
|
}
|
|
2376
2381
|
function yr() {
|
|
2377
|
-
return
|
|
2382
|
+
return Z().journey.getToken();
|
|
2378
2383
|
}
|
|
2379
2384
|
function br(e) {
|
|
2380
|
-
return
|
|
2385
|
+
return Z().journey.adopt(e, "manual", !0);
|
|
2381
2386
|
}
|
|
2382
2387
|
function xr(e, t) {
|
|
2383
|
-
return
|
|
2388
|
+
return Z().registerWorker(e, t);
|
|
2384
2389
|
}
|
|
2385
2390
|
function Sr(e, t) {
|
|
2386
|
-
return
|
|
2391
|
+
return Z().registerFrame(e, t);
|
|
2387
2392
|
}
|
|
2388
2393
|
function Cr() {
|
|
2389
|
-
|
|
2394
|
+
Z().tracing.rotate("explicit");
|
|
2390
2395
|
}
|
|
2391
2396
|
function wr() {
|
|
2392
|
-
return
|
|
2397
|
+
return Z().tracing.headers();
|
|
2393
2398
|
}
|
|
2394
2399
|
function Tr(e) {
|
|
2395
|
-
return
|
|
2400
|
+
return Z().flush(e);
|
|
2396
2401
|
}
|
|
2397
2402
|
function Er() {
|
|
2398
|
-
|
|
2403
|
+
Z().newSession();
|
|
2399
2404
|
}
|
|
2400
2405
|
function Dr() {
|
|
2401
|
-
return
|
|
2406
|
+
return Z().diagnostics.snapshot();
|
|
2402
2407
|
}
|
|
2403
2408
|
async function Or(e) {
|
|
2404
|
-
await (
|
|
2409
|
+
await (q.current() ?? q.stopped())?.destroy(e);
|
|
2405
2410
|
}
|
|
2406
|
-
export { pr as addBreadcrumb, br as adoptJourney,
|
|
2411
|
+
export { pr as addBreadcrumb, br as adoptJourney, Jn as collectDebugBundle, Wn as configure, ar as counter, Un as createMemoryTransport, vr as currentJourney, Zn as debug, _r as endJourney, er as error, tr as fatal, Tr as flush, or as gauge, Dr as getDiagnosticCounters, qn as getHealth, yr as getJourneyToken, Yn as getLogger, wr as getTraceHeaders, sr as histogram, Qn as info, nr as logAction, rr as logEvent, lr as measure, Er as newSession, Cr as newTrace, ct as observeWindow, fr as profiler, Sr as registerFrame, xr as registerWorker, hr as removeContext, Kn as rotateSecurityContext, Hn as serveTransportWorker, Gn as setConfigurationLocked, mr as setContext, Or as shutdown, gr as startJourney, cr as startMeasure, ur as startReplay, dr as stopReplay, Xn as trace, $n as warn };
|
|
2407
2412
|
|
|
2408
2413
|
//# sourceMappingURL=index.js.map
|