@utk09/ui-observability 1.0.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 +111 -219
- package/README.md +24 -26
- package/dist/{batch-CXmPmTse.js → batch-120Kc9jr.js} +3 -3
- package/dist/{batch-CXmPmTse.js.map → batch-120Kc9jr.js.map} +1 -1
- package/dist/{batch-mmPigCpi.cjs → batch-C3uNp5kU.cjs} +2 -2
- package/dist/{batch-mmPigCpi.cjs.map → batch-C3uNp5kU.cjs.map} +1 -1
- package/dist/bus/bus.d.cts +31 -2
- package/dist/bus/bus.d.ts +31 -2
- package/dist/bus-Dj8IEVcC.cjs +2 -0
- package/dist/bus-Dj8IEVcC.cjs.map +1 -0
- package/dist/{bus-C39wspFV.js → bus-DyNafxZN.js} +127 -104
- 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/interactions.d.cts +35 -3
- package/dist/capture/interactions.d.ts +35 -3
- package/dist/capture/observed-windows.d.cts +51 -0
- package/dist/capture/observed-windows.d.ts +51 -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-tVtXwVjX.js → compression-BWkDWY3v.js} +2 -2
- package/dist/{compression-tVtXwVjX.js.map → compression-BWkDWY3v.js.map} +1 -1
- package/dist/{compression-CvED_Jel.cjs → compression-CEVe7NPX.cjs} +2 -2
- package/dist/{compression-CvED_Jel.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-DK1Zf7jn.js +556 -0
- package/dist/config-DK1Zf7jn.js.map +1 -0
- package/dist/{console-BGgGnjSi.js → console-CAyCQOpm.js} +5 -5
- package/dist/{console-BGgGnjSi.js.map → console-CAyCQOpm.js.map} +1 -1
- package/dist/{console-CSZ5_Vx5.cjs → console-Dk6GH4yj.cjs} +2 -2
- package/dist/{console-CSZ5_Vx5.cjs.map → console-Dk6GH4yj.cjs.map} +1 -1
- package/dist/{constants-CUyd9cTZ.js → constants-CEHN6KuY.js} +46 -25
- 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 +23 -0
- package/dist/constants.d.ts +23 -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/rotation.d.cts +26 -2
- package/dist/core/rotation.d.ts +26 -2
- package/dist/core/runtime.d.cts +9 -0
- package/dist/core/runtime.d.ts +9 -0
- package/dist/core/sender.d.cts +3 -2
- package/dist/core/sender.d.ts +3 -2
- package/dist/{debug-bundle-BXIlwDKM.cjs → debug-bundle-DMzUfiQc.cjs} +2 -2
- package/dist/{debug-bundle-BXIlwDKM.cjs.map → debug-bundle-DMzUfiQc.cjs.map} +1 -1
- package/dist/{debug-bundle-CRpYV_ui.js → debug-bundle-w78W46zr.js} +4 -4
- package/dist/{debug-bundle-CRpYV_ui.js.map → debug-bundle-w78W46zr.js.map} +1 -1
- package/dist/doctor.cjs +1 -1
- package/dist/doctor.js +36 -36
- 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-BE_EZV7Q.js → errors-C-LYbqyB.js} +27 -24
- package/dist/errors-C-LYbqyB.js.map +1 -0
- package/dist/{factory-CTi0Is3F.js → factory-BHYrcSaU.js} +39 -28
- 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-DdhKgrpk.js → identity-Byh3gCdT.js} +35 -24
- package/dist/identity-Byh3gCdT.js.map +1 -0
- package/dist/identity-BzAzdQyv.cjs +2 -0
- package/dist/identity-BzAzdQyv.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +453 -417
- package/dist/index.js.map +1 -1
- package/dist/{indexeddb-storage-GHdl0t8A.js → indexeddb-storage-BYywz-v6.js} +17 -17
- package/dist/{indexeddb-storage-GHdl0t8A.js.map → indexeddb-storage-BYywz-v6.js.map} +1 -1
- package/dist/{indexeddb-storage-CL9uqBCy.cjs → indexeddb-storage-BfqGkLFe.cjs} +2 -2
- package/dist/{indexeddb-storage-CL9uqBCy.cjs.map → indexeddb-storage-BfqGkLFe.cjs.map} +1 -1
- package/dist/interactions-BXzEel4F.cjs +2 -0
- package/dist/interactions-BXzEel4F.cjs.map +1 -0
- package/dist/interactions-DdKPMWIN.js +207 -0
- package/dist/interactions-DdKPMWIN.js.map +1 -0
- package/dist/{journey-B4Adltjm.cjs → journey-BUmsrgaw.cjs} +2 -2
- package/dist/{journey-B4Adltjm.cjs.map → journey-BUmsrgaw.cjs.map} +1 -1
- package/dist/{journey-D2_sia57.js → journey-Nu655gEO.js} +14 -14
- package/dist/{journey-D2_sia57.js.map → journey-Nu655gEO.js.map} +1 -1
- package/dist/{library-console-CPW6bvZH.cjs → library-console-DdIlzzph.cjs} +2 -2
- package/dist/{library-console-CPW6bvZH.cjs.map → library-console-DdIlzzph.cjs.map} +1 -1
- package/dist/{library-console-Btrzt814.js → library-console-amePMnP8.js} +2 -2
- package/dist/{library-console-Btrzt814.js.map → library-console-amePMnP8.js.map} +1 -1
- package/dist/{library-request-BJ9PLRaD.js → library-request-Cv7C05jf.js} +2 -2
- package/dist/{library-request-BJ9PLRaD.js.map → library-request-Cv7C05jf.js.map} +1 -1
- package/dist/{library-request-D7OvTxZV.cjs → library-request-DO3Ec7KE.cjs} +2 -2
- package/dist/{library-request-D7OvTxZV.cjs.map → library-request-DO3Ec7KE.cjs.map} +1 -1
- package/dist/{lifecycle-IaAm1mOC.cjs → lifecycle-B5yfH5is.cjs} +2 -2
- package/dist/{lifecycle-IaAm1mOC.cjs.map → lifecycle-B5yfH5is.cjs.map} +1 -1
- package/dist/{lifecycle-22CUCrc9.js → lifecycle-CMHz2Zbs.js} +2 -2
- package/dist/{lifecycle-22CUCrc9.js.map → lifecycle-CMHz2Zbs.js.map} +1 -1
- package/dist/{log-record-BNiLfqtL.js → log-record-B_nSqxoe.js} +2 -2
- package/dist/{log-record-BNiLfqtL.js.map → log-record-B_nSqxoe.js.map} +1 -1
- package/dist/{log-record-CkivuiEl.cjs → log-record-Bdywwg0k.cjs} +2 -2
- package/dist/{log-record-CkivuiEl.cjs.map → log-record-Bdywwg0k.cjs.map} +1 -1
- package/dist/{long-frames-DNFaRnC3.js → long-frames-6NGl1-uN.js} +3 -3
- package/dist/{long-frames-DNFaRnC3.js.map → long-frames-6NGl1-uN.js.map} +1 -1
- package/dist/{long-frames-BUUbXd-B.cjs → long-frames-D9DfSWqv.cjs} +2 -2
- package/dist/{long-frames-BUUbXd-B.cjs.map → long-frames-D9DfSWqv.cjs.map} +1 -1
- package/dist/models/bus.d.cts +6 -1
- package/dist/models/bus.d.ts +6 -1
- package/dist/models/config.d.cts +27 -11
- package/dist/models/config.d.ts +27 -11
- package/dist/models/serializer.d.cts +3 -1
- package/dist/models/serializer.d.ts +3 -1
- package/dist/{network-CGMLQ-mA.cjs → network-BNHBI0Fc.cjs} +2 -2
- package/dist/{network-CGMLQ-mA.cjs.map → network-BNHBI0Fc.cjs.map} +1 -1
- package/dist/{network-on2zZT6H.js → network-Cc3tSB7e.js} +5 -5
- package/dist/{network-on2zZT6H.js.map → network-Cc3tSB7e.js.map} +1 -1
- package/dist/observed-windows-8JtCsIr1.js +64 -0
- package/dist/observed-windows-8JtCsIr1.js.map +1 -0
- package/dist/observed-windows-BlE25nrn.cjs +2 -0
- package/dist/observed-windows-BlE25nrn.cjs.map +1 -0
- package/dist/openfin-Bxelt0yg.js.map +1 -1
- package/dist/openfin-DtH2f7zX.cjs.map +1 -1
- package/dist/{otlp-DimfrRor.js → otlp-Btix3EBa.js} +7 -7
- package/dist/{otlp-DimfrRor.js.map → otlp-Btix3EBa.js.map} +1 -1
- package/dist/{otlp-BENHf3g9.cjs → otlp-CFSW-Dno.cjs} +2 -2
- package/dist/{otlp-BENHf3g9.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-Dba6R3Hp.js +75 -0
- package/dist/platform-Dba6R3Hp.js.map +1 -0
- package/dist/{profiler-BAZoh7A4.js → profiler-DNKcqu09.js} +60 -60
- package/dist/{profiler-BAZoh7A4.js.map → profiler-DNKcqu09.js.map} +1 -1
- package/dist/{profiler-D4tJpDRc.cjs → profiler-DpoPi1hH.cjs} +2 -2
- package/dist/{profiler-D4tJpDRc.cjs.map → profiler-DpoPi1hH.cjs.map} +1 -1
- package/dist/{profiler-frames-C4xr7KfH.cjs → profiler-frames-C9zJNd8_.cjs} +2 -2
- package/dist/{profiler-frames-C4xr7KfH.cjs.map → profiler-frames-C9zJNd8_.cjs.map} +1 -1
- package/dist/{profiler-frames-cJMx9wNM.js → profiler-frames-CGXZeZ_3.js} +16 -16
- package/dist/{profiler-frames-cJMx9wNM.js.map → profiler-frames-CGXZeZ_3.js.map} +1 -1
- package/dist/{remote-rules-Dz9MRAsB.js → remote-rules-DNK96vLa.js} +25 -25
- package/dist/{remote-rules-Dz9MRAsB.js.map → remote-rules-DNK96vLa.js.map} +1 -1
- package/dist/{remote-rules-_tY0zj5o.cjs → remote-rules-DuMFRlit.cjs} +2 -2
- package/dist/{remote-rules-_tY0zj5o.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-Ds-ANH34.js → replay-Dy6OiaOZ.js} +104 -77
- package/dist/replay-Dy6OiaOZ.js.map +1 -0
- package/dist/{reports-BDSe4dFH.cjs → reports-CGK9YQch.cjs} +2 -2
- package/dist/{reports-BDSe4dFH.cjs.map → reports-CGK9YQch.cjs.map} +1 -1
- package/dist/{reports-C-thq-bk.js → reports-CX57-S9s.js} +3 -3
- package/dist/{reports-C-thq-bk.js.map → reports-CX57-S9s.js.map} +1 -1
- package/dist/{resource-timing-eUl2dNgC.js → resource-timing-CWVDCbrY.js} +4 -4
- package/dist/{resource-timing-eUl2dNgC.js.map → resource-timing-CWVDCbrY.js.map} +1 -1
- package/dist/{resource-timing-C576gFIQ.cjs → resource-timing-DalulXiR.cjs} +2 -2
- package/dist/{resource-timing-C576gFIQ.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-eoSQpLiH.js → response-body-yi92Rpvo.js} +109 -109
- package/dist/response-body-yi92Rpvo.js.map +1 -0
- package/dist/{rotation-Cwct4ckk.js → rotation-ChBbNDE2.js} +27 -28
- 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-BlrI8jor.js → sampling-DZTOD28D.js} +16 -16
- package/dist/{sampling-BlrI8jor.js.map → sampling-DZTOD28D.js.map} +1 -1
- package/dist/{sampling-mXt4dstx.cjs → sampling-wAVJIZXp.cjs} +2 -2
- package/dist/{sampling-mXt4dstx.cjs.map → sampling-wAVJIZXp.cjs.map} +1 -1
- package/dist/{sanitize-Ba0KqU06.js → sanitize-B2GKlSFp.js} +2 -2
- package/dist/{sanitize-Ba0KqU06.js.map → sanitize-B2GKlSFp.js.map} +1 -1
- package/dist/{sanitize-DQyiI_KY.cjs → sanitize-BZdhoghq.cjs} +2 -2
- package/dist/{sanitize-DQyiI_KY.cjs.map → sanitize-BZdhoghq.cjs.map} +1 -1
- package/dist/{sender-Dv8rAmpV.js → sender-BRSpc7R8.js} +192 -178
- 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-B2EzVuYm.js → stored-context-df1dEnht.js} +12 -10
- package/dist/stored-context-df1dEnht.js.map +1 -0
- package/dist/{storm-DjKetLKZ.js → storm-U3_ek1nA.js} +2 -2
- package/dist/{storm-DjKetLKZ.js.map → storm-U3_ek1nA.js.map} +1 -1
- package/dist/{storm-C-zYSdDX.cjs → storm-qiE_AMC7.cjs} +2 -2
- package/dist/{storm-C-zYSdDX.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-DQD1cT7c.js → unclean-exit-Bj6gYHeL.js} +2 -2
- package/dist/{unclean-exit-DQD1cT7c.js.map → unclean-exit-Bj6gYHeL.js.map} +1 -1
- package/dist/{unclean-exit-py99ApzT.cjs → unclean-exit-CuBh-ee5.cjs} +2 -2
- package/dist/{unclean-exit-py99ApzT.cjs.map → unclean-exit-CuBh-ee5.cjs.map} +1 -1
- package/dist/{user-timing-D6XTmpuM.cjs → user-timing-BWqzYF2Q.cjs} +2 -2
- package/dist/{user-timing-D6XTmpuM.cjs.map → user-timing-BWqzYF2Q.cjs.map} +1 -1
- package/dist/{user-timing-BePqb1uN.js → user-timing-Duz0d-OA.js} +2 -2
- package/dist/{user-timing-BePqb1uN.js.map → user-timing-Duz0d-OA.js.map} +1 -1
- package/dist/utils/identity.d.cts +5 -0
- package/dist/utils/identity.d.ts +5 -0
- 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-DSHgDiZ6.js → web-socket-CE_9Q22z.js} +5 -5
- package/dist/{web-socket-DSHgDiZ6.js.map → web-socket-CE_9Q22z.js.map} +1 -1
- package/dist/{web-socket-CoIUBM3C.cjs → web-socket-sm3rD-A_.cjs} +2 -2
- package/dist/{web-socket-CoIUBM3C.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-QbvqNazn.cjs → worker-protocol-D5VnCdWY.cjs} +2 -2
- package/dist/{worker-protocol-QbvqNazn.cjs.map → worker-protocol-D5VnCdWY.cjs.map} +1 -1
- package/dist/{worker-protocol-x074Rpet.js → worker-protocol-h4-tRWqy.js} +6 -6
- package/dist/{worker-protocol-x074Rpet.js.map → worker-protocol-h4-tRWqy.js.map} +1 -1
- package/dist/{worker-server-CFe4nvos.cjs → worker-server-CF1yatXq.cjs} +2 -2
- package/dist/{worker-server-CFe4nvos.cjs.map → worker-server-CF1yatXq.cjs.map} +1 -1
- package/dist/worker-server-FYfKHQhJ.js +94 -0
- package/dist/{worker-server-iUVSjH8L.js.map → worker-server-FYfKHQhJ.js.map} +1 -1
- package/dist/worker-transport-COgY4RX8.cjs +2 -0
- package/dist/worker-transport-COgY4RX8.cjs.map +1 -0
- package/dist/{worker-transport-Dy1KMA7t.js → worker-transport-jzX1IusG.js} +49 -45
- package/dist/worker-transport-jzX1IusG.js.map +1 -0
- package/llms.txt +14 -12
- package/package.json +13 -5
- package/dist/bus-C39wspFV.js.map +0 -1
- package/dist/bus-_EaOVPGq.cjs +0 -2
- package/dist/bus-_EaOVPGq.cjs.map +0 -1
- package/dist/config-DUs7uHHt.cjs +0 -2
- package/dist/config-DUs7uHHt.cjs.map +0 -1
- package/dist/config-SgQcCP1_.js +0 -560
- package/dist/config-SgQcCP1_.js.map +0 -1
- package/dist/constants-CUyd9cTZ.js.map +0 -1
- package/dist/constants-CqdJhTxH.cjs +0 -2
- package/dist/constants-CqdJhTxH.cjs.map +0 -1
- package/dist/errors-BE_EZV7Q.js.map +0 -1
- package/dist/errors-CNPbesMs.cjs +0 -3
- package/dist/errors-CNPbesMs.cjs.map +0 -1
- package/dist/factory-CTi0Is3F.js.map +0 -1
- package/dist/factory-hRrH32v5.cjs +0 -2
- package/dist/factory-hRrH32v5.cjs.map +0 -1
- package/dist/identity-DdhKgrpk.js.map +0 -1
- package/dist/identity-DlWRIuwy.cjs +0 -2
- package/dist/identity-DlWRIuwy.cjs.map +0 -1
- package/dist/interactions-CUkzK8sR.cjs +0 -2
- package/dist/interactions-CUkzK8sR.cjs.map +0 -1
- package/dist/interactions-DiFvCosX.js +0 -111
- package/dist/interactions-DiFvCosX.js.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-BaaFIPCU.js +0 -62
- package/dist/platform-BaaFIPCU.js.map +0 -1
- package/dist/platform-CfA3-7sJ.cjs +0 -2
- package/dist/platform-CfA3-7sJ.cjs.map +0 -1
- package/dist/replay-B3gFXIZd.cjs +0 -2
- package/dist/replay-B3gFXIZd.cjs.map +0 -1
- package/dist/replay-Ds-ANH34.js.map +0 -1
- package/dist/response-body-YdNl-HkR.cjs +0 -3
- package/dist/response-body-YdNl-HkR.cjs.map +0 -1
- package/dist/response-body-eoSQpLiH.js.map +0 -1
- package/dist/rotation-Cwct4ckk.js.map +0 -1
- package/dist/rotation-D4qUAHAu.cjs +0 -2
- package/dist/rotation-D4qUAHAu.cjs.map +0 -1
- package/dist/sender-BdRuNVhF.cjs +0 -2
- package/dist/sender-BdRuNVhF.cjs.map +0 -1
- package/dist/sender-Dv8rAmpV.js.map +0 -1
- package/dist/stored-context-B2EzVuYm.js.map +0 -1
- package/dist/stored-context-CXt7eHZL.cjs +0 -2
- package/dist/stored-context-CXt7eHZL.cjs.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-iUVSjH8L.js +0 -94
- package/dist/worker-transport-CRAX-09c.cjs +0 -2
- package/dist/worker-transport-CRAX-09c.cjs.map +0 -1
- package/dist/worker-transport-Dy1KMA7t.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as Ne, r as Pe, t as Fe } from "./log-record-
|
|
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
3
|
import { n as Ie, r as Le, t as Re } from "./error-like-B11pB4aL.js";
|
|
4
4
|
import { n as D, t as ze } from "./guards-BlYGRK4l.js";
|
|
5
5
|
import { t as O } from "./unref-DgHPQeWv.js";
|
|
6
|
-
import {
|
|
6
|
+
import { a as Be, n as Ve, t as He } from "./platform-Dba6R3Hp.js";
|
|
7
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-
|
|
9
|
-
import { t as j } from "./profiler-
|
|
10
|
-
import { n as M, t as Ye } from "./library-console-
|
|
11
|
-
import { i as Xe, n as Ze, r as N } from "./sanitize-
|
|
12
|
-
import { r as Qe } from "./library-request-
|
|
13
|
-
import { n as $e, r as P, t as F } from "./config-
|
|
14
|
-
import { r as et, t as tt } from "./batch-
|
|
15
|
-
import { n as nt, t as rt } from "./journey-
|
|
16
|
-
import { a as it, i as at, n as ot, o as st } from "./sampling-
|
|
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";
|
|
17
18
|
// src/core/deferred.ts
|
|
18
19
|
var I = /* @__PURE__ */ new WeakMap();
|
|
19
|
-
function
|
|
20
|
+
function lt(e) {
|
|
20
21
|
let t = e.idle;
|
|
21
22
|
t !== void 0 && (e.diagnostics.guard("pipeline.crashed", "The idle callback could not be cancelled.", () => {
|
|
22
23
|
cancelIdleCallback(t);
|
|
23
24
|
}), e.idle = void 0), clearTimeout(e.timer), e.timer = void 0;
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function ut(e, t) {
|
|
26
27
|
typeof requestIdleCallback == "function" && typeof cancelIdleCallback == "function" && (t.idle = t.diagnostics.guard("pipeline.crashed", "The idle callback could not be scheduled.", () => requestIdleCallback((n) => {
|
|
27
28
|
L(e, t, n);
|
|
28
|
-
}, { timeout:
|
|
29
|
+
}, { timeout: xe })), t.idle !== void 0) || (t.timer = setTimeout(() => {
|
|
29
30
|
L(e, t);
|
|
30
31
|
}, 0), O(t.timer));
|
|
31
32
|
}
|
|
32
33
|
function L(e, t, n) {
|
|
33
34
|
if (I.get(e) !== t || t.draining) return;
|
|
34
|
-
|
|
35
|
+
lt(t), t.draining = !0;
|
|
35
36
|
let r = t.work;
|
|
36
37
|
t.work = [];
|
|
37
38
|
let i = 0;
|
|
38
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;
|
|
39
|
-
t.work = [...r.slice(i), ...t.work], t.draining = !1, t.work.length > 0 ?
|
|
40
|
+
t.work = [...r.slice(i), ...t.work], t.draining = !1, t.work.length > 0 ? ut(e, t) : I.delete(e);
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
let i = I.get(e), a = r === null ?
|
|
42
|
+
function dt(e, t, n, r) {
|
|
43
|
+
let i = I.get(e), a = r === null ? s : Math.min(r, s);
|
|
43
44
|
if (i && i.work.length >= a && !i.draining && (L(e, i), i = I.get(e)), i) {
|
|
44
45
|
if (i.work.length >= a) {
|
|
45
46
|
n.count("record.dropped_by_ceiling");
|
|
@@ -50,27 +51,27 @@ function ut(e, t, n, r) {
|
|
|
50
51
|
work: [t],
|
|
51
52
|
diagnostics: n,
|
|
52
53
|
draining: !1
|
|
53
|
-
}, I.set(e, i),
|
|
54
|
+
}, I.set(e, i), ut(e, i);
|
|
54
55
|
}
|
|
55
56
|
function R(e) {
|
|
56
57
|
let t = I.get(e);
|
|
57
58
|
t && L(e, t);
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function ft(e) {
|
|
60
61
|
let t = I.get(e);
|
|
61
62
|
if (t) {
|
|
62
|
-
|
|
63
|
+
lt(t), I.delete(e);
|
|
63
64
|
for (let e of t.work) t.diagnostics.count("record.dropped_by_ceiling");
|
|
64
65
|
t.work = [];
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
// src/core/logger.ts
|
|
68
|
-
var
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
var pt = [
|
|
70
|
+
m,
|
|
71
|
+
re,
|
|
72
|
+
ne
|
|
72
73
|
];
|
|
73
|
-
function
|
|
74
|
+
function mt(e, t) {
|
|
74
75
|
let n = t.guard("record.sanitize_failed", "The library could not read the error reason.", () => {
|
|
75
76
|
if (!(e instanceof Error) && !Le(e)) return;
|
|
76
77
|
let t = Error(e.message);
|
|
@@ -80,10 +81,10 @@ function pt(e, t) {
|
|
|
80
81
|
let r = t.guard("record.sanitize_failed", "The library could not convert the error reason to text.", () => String(e));
|
|
81
82
|
return Error(r ?? typeof e);
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
+
function ht(e, t, n) {
|
|
84
85
|
return n.guard("record.sanitize_failed", "The library could not read the error reason.", () => e instanceof Error ? e : t) ?? t;
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function gt(e, t) {
|
|
87
88
|
if (typeof e == "number" || typeof e == "boolean" || typeof e == "bigint" || typeof e == "symbol") return e;
|
|
88
89
|
if (typeof e == "object" && e) return t.guard("record.sanitize_failed", "The library could not read the properties of the error reason.", () => {
|
|
89
90
|
let t = e, n = Le(e), r = {}, i = 0;
|
|
@@ -94,13 +95,13 @@ function ht(e, t) {
|
|
|
94
95
|
return i === 0 ? void 0 : r;
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
+
function _t(e) {
|
|
98
99
|
if (!D(e) || e instanceof Error) return !1;
|
|
99
100
|
let t = Object.getPrototypeOf(e);
|
|
100
101
|
return t === null || Object.getPrototypeOf(t) === null;
|
|
101
102
|
}
|
|
102
|
-
function
|
|
103
|
-
return
|
|
103
|
+
function vt(e) {
|
|
104
|
+
return pt.some((t) => e === t || e.startsWith(`${t}.`)) ? "system" : "log";
|
|
104
105
|
}
|
|
105
106
|
function z(e, t) {
|
|
106
107
|
return e === void 0 ? {} : t.guard("record.sanitize_failed", "The library could not read the payload.", () => ({ ...e })) ?? { "uiobs.sanitize_failed": !0 };
|
|
@@ -123,7 +124,7 @@ var B = class e {
|
|
|
123
124
|
this.write("INFO", "action", e, t);
|
|
124
125
|
}), k(this, "logEvent", (e, t) => {
|
|
125
126
|
this.write("INFO", "event", e, t);
|
|
126
|
-
}), 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);
|
|
127
128
|
}
|
|
128
129
|
child(t, n = {}) {
|
|
129
130
|
return new e(this.bind, `${this.namespace}.${t}`, { scopedContext: {
|
|
@@ -149,7 +150,7 @@ var B = class e {
|
|
|
149
150
|
context: e.context.getAll(),
|
|
150
151
|
url: He(e.diagnostics)
|
|
151
152
|
};
|
|
152
|
-
|
|
153
|
+
dt(e, () => {
|
|
153
154
|
r(a);
|
|
154
155
|
}, e.diagnostics, e.config.buffering.maxPendingRecords);
|
|
155
156
|
} else r();
|
|
@@ -184,12 +185,12 @@ var B = class e {
|
|
|
184
185
|
writeErrorNow(e, t, n, r, i, a) {
|
|
185
186
|
let o = e.builder.isEnabled(t, this.namespace);
|
|
186
187
|
if (!o && !this.mirrors(e, t)) return;
|
|
187
|
-
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);
|
|
188
189
|
if (!o) {
|
|
189
190
|
this.print(e, t, n, c, d, null, void 0, a);
|
|
190
191
|
return;
|
|
191
192
|
}
|
|
192
|
-
let f = u ?
|
|
193
|
+
let f = u ? gt(l, e.diagnostics) : void 0, { record: p, dropped: m } = e.builder.build({
|
|
193
194
|
snapshot: a,
|
|
194
195
|
level: t,
|
|
195
196
|
type: this.levelType,
|
|
@@ -204,7 +205,7 @@ var B = class e {
|
|
|
204
205
|
"error.stack_trace": u.stack
|
|
205
206
|
} : {},
|
|
206
207
|
...f === void 0 ? {} : { [se]: f },
|
|
207
|
-
[
|
|
208
|
+
[x]: e.breadcrumbs.snapshot()
|
|
208
209
|
}
|
|
209
210
|
});
|
|
210
211
|
this.print(e, t, n, c, d, p, m, a), e.emit(p);
|
|
@@ -240,61 +241,61 @@ var B = class e {
|
|
|
240
241
|
mirrors(e, t) {
|
|
241
242
|
return e.config.enabled && e.console.accepts(t);
|
|
242
243
|
}
|
|
243
|
-
},
|
|
244
|
+
}, yt = class extends B {
|
|
244
245
|
constructor(...e) {
|
|
245
|
-
super(...e), k(this, "logMetric", (e, t,
|
|
246
|
+
super(...e), k(this, "logMetric", (e, t, r = c, i = "gauge", a, o) => {
|
|
246
247
|
if (!Number.isFinite(t)) {
|
|
247
248
|
this.bind().diagnostics.report("record.dropped_malformed", "The metric value is not a finite number. The library dropped the metric.", { "metric.name": e });
|
|
248
249
|
return;
|
|
249
250
|
}
|
|
250
251
|
let s = this.bind();
|
|
251
|
-
this.submit(s, "INFO", "metric", (
|
|
252
|
-
let
|
|
252
|
+
this.submit(s, "INFO", "metric", (c) => {
|
|
253
|
+
let l = z(a, s.diagnostics), u = {
|
|
253
254
|
...z(o, s.diagnostics),
|
|
254
|
-
...
|
|
255
|
+
...l,
|
|
255
256
|
"metric.name": e,
|
|
256
257
|
"metric.value": t,
|
|
257
|
-
"metric.unit":
|
|
258
|
-
"metric.type":
|
|
259
|
-
[
|
|
258
|
+
"metric.unit": r,
|
|
259
|
+
"metric.type": i,
|
|
260
|
+
[n.attributeKeys]: Object.keys(l)
|
|
260
261
|
};
|
|
261
|
-
this.writeNow(s, "INFO", "metric", e,
|
|
262
|
+
this.writeNow(s, "INFO", "metric", e, u, !0, c);
|
|
262
263
|
});
|
|
263
264
|
});
|
|
264
265
|
}
|
|
265
|
-
},
|
|
266
|
-
function
|
|
267
|
-
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);
|
|
268
269
|
}
|
|
269
|
-
function
|
|
270
|
+
function wt() {
|
|
270
271
|
return Ge(16);
|
|
271
272
|
}
|
|
272
|
-
function
|
|
273
|
+
function Tt() {
|
|
273
274
|
return Ge(8);
|
|
274
275
|
}
|
|
275
|
-
function
|
|
276
|
+
function Et(e) {
|
|
276
277
|
return {
|
|
277
|
-
traceId:
|
|
278
|
-
spanId:
|
|
278
|
+
traceId: wt(),
|
|
279
|
+
spanId: Tt(),
|
|
279
280
|
traceFlags: 1,
|
|
280
281
|
startedAt: Date.now(),
|
|
281
282
|
reason: e,
|
|
282
283
|
ended: !1
|
|
283
284
|
};
|
|
284
285
|
}
|
|
285
|
-
function
|
|
286
|
+
function Dt(e, t, n) {
|
|
286
287
|
return `00-${e}-${t}-${(n & 255).toString(16).padStart(2, "0")}`;
|
|
287
288
|
}
|
|
288
|
-
function
|
|
289
|
+
function Ot(e) {
|
|
289
290
|
return {
|
|
290
291
|
traceId: e.traceId,
|
|
291
292
|
spanId: e.spanId,
|
|
292
293
|
traceFlags: e.traceFlags
|
|
293
294
|
};
|
|
294
295
|
}
|
|
295
|
-
var
|
|
296
|
-
constructor(e, t =
|
|
297
|
-
k(this, "diagnostics", void 0), k(this, "maxAgeMs", void 0), k(this, "load", void 0), k(this, "spans", void 0), k(this, "ambient",
|
|
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;
|
|
298
299
|
}
|
|
299
300
|
setup(e, t) {
|
|
300
301
|
this.maxAgeMs = e, this.load = t;
|
|
@@ -310,7 +311,7 @@ var Ot = class {
|
|
|
310
311
|
return this.activeSpanContext() ?? this.ambientContext();
|
|
311
312
|
}
|
|
312
313
|
ambientContext() {
|
|
313
|
-
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);
|
|
314
315
|
}
|
|
315
316
|
activeSpanContext() {
|
|
316
317
|
let e = this.otel;
|
|
@@ -318,7 +319,7 @@ var Ot = class {
|
|
|
318
319
|
let t = e.trace.getActiveSpan();
|
|
319
320
|
if (t === void 0) return;
|
|
320
321
|
let n = t.spanContext();
|
|
321
|
-
if (
|
|
322
|
+
if (Ct(n)) return {
|
|
322
323
|
traceId: n.traceId,
|
|
323
324
|
spanId: n.spanId,
|
|
324
325
|
traceFlags: n.traceFlags
|
|
@@ -327,8 +328,8 @@ var Ot = class {
|
|
|
327
328
|
}
|
|
328
329
|
rotate(e) {
|
|
329
330
|
let t = this.ambient;
|
|
330
|
-
this.ambient =
|
|
331
|
-
let n =
|
|
331
|
+
this.ambient = Et(e);
|
|
332
|
+
let n = Ot(this.ambient);
|
|
332
333
|
return this.finish(t), n;
|
|
333
334
|
}
|
|
334
335
|
end() {
|
|
@@ -355,9 +356,9 @@ var Ot = class {
|
|
|
355
356
|
n.propagation.inject(n.context.active(), t);
|
|
356
357
|
}), t.traceparent) return { headers: t };
|
|
357
358
|
let r = this.activeSpanContext(), i = r ?? this.ambientContext(), a = r ? void 0 : this.spans;
|
|
358
|
-
if (!a?.enabled()) return t[
|
|
359
|
-
let o = a.keeps(i.traceId), s = o ? i.traceFlags : i.traceFlags & -2, c = e ?
|
|
360
|
-
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 } : {
|
|
361
362
|
headers: t,
|
|
362
363
|
span: {
|
|
363
364
|
traceId: i.traceId,
|
|
@@ -366,20 +367,20 @@ var Ot = class {
|
|
|
366
367
|
}
|
|
367
368
|
};
|
|
368
369
|
}
|
|
369
|
-
},
|
|
370
|
+
}, At = {
|
|
370
371
|
name: "ui.measure.duration",
|
|
371
372
|
kind: "histogram",
|
|
372
373
|
unit: "ms",
|
|
373
|
-
boundaries:
|
|
374
|
-
},
|
|
374
|
+
boundaries: g
|
|
375
|
+
}, jt = {
|
|
375
376
|
name: "ui.measure.phase.duration",
|
|
376
377
|
kind: "histogram",
|
|
377
378
|
unit: "ms",
|
|
378
|
-
boundaries:
|
|
379
|
+
boundaries: g
|
|
379
380
|
};
|
|
380
|
-
function
|
|
381
|
+
function Mt(e, t, n, r) {
|
|
381
382
|
let i = String(e), a = Date.now(), o = performance.now(), s, c = !1, l = (e) => a + e - o, u = (e, a) => {
|
|
382
|
-
s &&= (r.metric(
|
|
383
|
+
s &&= (r.metric(jt, e - s.at, {
|
|
383
384
|
...t,
|
|
384
385
|
"measure.name": i,
|
|
385
386
|
"measure.phase": s.name
|
|
@@ -387,7 +388,7 @@ function jt(e, t, n, r) {
|
|
|
387
388
|
name: s.name,
|
|
388
389
|
kind: "internal",
|
|
389
390
|
traceId: n.traceId,
|
|
390
|
-
spanId:
|
|
391
|
+
spanId: Tt(),
|
|
391
392
|
parentSpanId: n.spanId,
|
|
392
393
|
startMs: l(s.at),
|
|
393
394
|
endMs: l(e),
|
|
@@ -413,7 +414,7 @@ function jt(e, t, n, r) {
|
|
|
413
414
|
...t,
|
|
414
415
|
"measure.outcome": e
|
|
415
416
|
};
|
|
416
|
-
r.metric(
|
|
417
|
+
r.metric(At, s - o, {
|
|
417
418
|
...f,
|
|
418
419
|
"measure.name": i
|
|
419
420
|
}), n && r.span({
|
|
@@ -428,7 +429,7 @@ function jt(e, t, n, r) {
|
|
|
428
429
|
}
|
|
429
430
|
};
|
|
430
431
|
}
|
|
431
|
-
function
|
|
432
|
+
function Nt(e, t, n) {
|
|
432
433
|
let r = "error";
|
|
433
434
|
try {
|
|
434
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);
|
|
@@ -442,51 +443,51 @@ function Mt(e, t, n) {
|
|
|
442
443
|
}
|
|
443
444
|
}
|
|
444
445
|
// src/core/meter.ts
|
|
445
|
-
var
|
|
446
|
-
S,
|
|
446
|
+
var Pt = "overflow", Ft = /* @__PURE__ */ new Set([
|
|
447
447
|
C,
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
448
|
+
w,
|
|
449
|
+
b,
|
|
450
|
+
E,
|
|
451
|
+
S,
|
|
452
|
+
be,
|
|
453
|
+
he
|
|
453
454
|
]);
|
|
454
|
-
function
|
|
455
|
+
function It(e = {}) {
|
|
455
456
|
let t = {};
|
|
456
457
|
for (let n of Object.keys(e).sort()) {
|
|
457
|
-
if (n.startsWith("metric.") ||
|
|
458
|
+
if (n.startsWith("metric.") || Ft.has(n)) continue;
|
|
458
459
|
let r = e[n];
|
|
459
460
|
(typeof r == "string" || typeof r == "boolean" || typeof r == "number" && Number.isFinite(r)) && (t[n] = r);
|
|
460
461
|
}
|
|
461
462
|
return t;
|
|
462
463
|
}
|
|
463
|
-
function
|
|
464
|
+
function Lt(e, t) {
|
|
464
465
|
if (!Array.isArray(e)) return null;
|
|
465
466
|
let n = t === null ? e.length : Math.min(e.length, t + 1);
|
|
466
467
|
return Array.from({ length: n }, (t, n) => e[n]);
|
|
467
468
|
}
|
|
468
|
-
function
|
|
469
|
+
function Rt(e, t) {
|
|
469
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]));
|
|
470
471
|
}
|
|
471
|
-
function
|
|
472
|
-
let
|
|
472
|
+
function zt(e, t, r) {
|
|
473
|
+
let i = {
|
|
473
474
|
"metric.name": e.name,
|
|
474
475
|
"metric.unit": e.unit,
|
|
475
476
|
"metric.type": e.kind,
|
|
476
|
-
[
|
|
477
|
-
[
|
|
477
|
+
[n.start]: r,
|
|
478
|
+
[n.attributeKeys]: Object.keys(t.attributes)
|
|
478
479
|
};
|
|
479
480
|
return e.kind === "histogram" ? {
|
|
480
|
-
...
|
|
481
|
-
[
|
|
482
|
-
[
|
|
483
|
-
[
|
|
484
|
-
[
|
|
485
|
-
[
|
|
486
|
-
[
|
|
487
|
-
} : (
|
|
488
|
-
}
|
|
489
|
-
function
|
|
481
|
+
...i,
|
|
482
|
+
[n.count]: t.count,
|
|
483
|
+
[n.sum]: t.sum,
|
|
484
|
+
[n.min]: t.min,
|
|
485
|
+
[n.max]: t.max,
|
|
486
|
+
[n.bounds]: e.boundaries,
|
|
487
|
+
[n.buckets]: t.buckets
|
|
488
|
+
} : (i["metric.value"] = e.kind === "gauge" ? t.last : t.sum, i);
|
|
489
|
+
}
|
|
490
|
+
function Bt(e, t) {
|
|
490
491
|
try {
|
|
491
492
|
return {
|
|
492
493
|
unit: e.unit,
|
|
@@ -499,39 +500,39 @@ function zt(e, t) {
|
|
|
499
500
|
};
|
|
500
501
|
}
|
|
501
502
|
}
|
|
502
|
-
function
|
|
503
|
+
function Vt(e, t, n, r) {
|
|
503
504
|
return {
|
|
504
505
|
name: e,
|
|
505
506
|
kind: t,
|
|
506
|
-
unit:
|
|
507
|
+
unit: Bt(n, r).unit ?? "count",
|
|
507
508
|
boundaries: []
|
|
508
509
|
};
|
|
509
510
|
}
|
|
510
|
-
function
|
|
511
|
-
let i =
|
|
511
|
+
function Ht(e, t, n, r) {
|
|
512
|
+
let i = Vt(e, "counter", t, r);
|
|
512
513
|
return { add: (e, t) => {
|
|
513
514
|
n(i, e, t);
|
|
514
515
|
} };
|
|
515
516
|
}
|
|
516
|
-
function
|
|
517
|
-
let i =
|
|
517
|
+
function Ut(e, t, n, r) {
|
|
518
|
+
let i = Vt(e, "gauge", t, r);
|
|
518
519
|
return { set: (e, t) => {
|
|
519
520
|
n(i, e, t);
|
|
520
521
|
} };
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
-
let { unit: i, boundaries: a } =
|
|
523
|
+
function Wt(e, t, n, r) {
|
|
524
|
+
let { unit: i, boundaries: a } = Bt(t, r), o = {
|
|
524
525
|
name: e,
|
|
525
526
|
kind: "histogram",
|
|
526
527
|
unit: i ?? "count",
|
|
527
|
-
boundaries: a ??
|
|
528
|
+
boundaries: a ?? g,
|
|
528
529
|
fromApp: a !== void 0
|
|
529
530
|
};
|
|
530
531
|
return { record: (e, t) => {
|
|
531
532
|
n(o, e, t);
|
|
532
533
|
} };
|
|
533
534
|
}
|
|
534
|
-
var
|
|
535
|
+
var Gt = class {
|
|
535
536
|
constructor(e, t, n, r = {
|
|
536
537
|
maxSeries: 100,
|
|
537
538
|
maxInstruments: 1e3,
|
|
@@ -542,26 +543,26 @@ var Wt = class {
|
|
|
542
543
|
record(e, t, n) {
|
|
543
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}.`, () => {
|
|
544
545
|
let r = this.instrumentOf(e);
|
|
545
|
-
r && (this.add(r, t,
|
|
546
|
+
r && (this.add(r, t, It(n)), this.arm());
|
|
546
547
|
});
|
|
547
548
|
}
|
|
548
549
|
collect() {
|
|
549
550
|
this.timer !== null && (clearTimeout(this.timer), this.timer = null);
|
|
550
551
|
let e = `${String(this.startedAt)}000000`, t = [...this.instruments.values()];
|
|
551
552
|
this.instruments.clear();
|
|
552
|
-
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));
|
|
553
554
|
}
|
|
554
555
|
instrumentOf(e) {
|
|
555
556
|
let t = this.instruments.get(e.name);
|
|
556
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);
|
|
557
558
|
let { maxInstruments: n } = this.policy;
|
|
558
559
|
if (n !== null && this.instruments.size >= n) return this.diagnostics.count("record.dropped_by_ceiling"), null;
|
|
559
|
-
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);
|
|
560
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.`);
|
|
561
562
|
let o = {
|
|
562
563
|
def: {
|
|
563
564
|
...e,
|
|
564
|
-
boundaries: a ? i : [...
|
|
565
|
+
boundaries: a ? i : [...g]
|
|
565
566
|
},
|
|
566
567
|
series: /* @__PURE__ */ new Map()
|
|
567
568
|
};
|
|
@@ -569,7 +570,7 @@ var Wt = class {
|
|
|
569
570
|
}
|
|
570
571
|
add(e, t, n) {
|
|
571
572
|
let r = JSON.stringify(n), i = e.series.get(r), a = n, { maxSeries: o } = this.policy;
|
|
572
|
-
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) {
|
|
573
574
|
let n = e.def.kind === "histogram" ? e.def.boundaries.length + 1 : 0, o = Array(n).fill(0);
|
|
574
575
|
i = {
|
|
575
576
|
attributes: a,
|
|
@@ -591,26 +592,26 @@ var Wt = class {
|
|
|
591
592
|
this.collect();
|
|
592
593
|
}, this.intervalMs()), O(this.timer));
|
|
593
594
|
}
|
|
594
|
-
},
|
|
595
|
+
}, Kt = {
|
|
595
596
|
TRACE: "debug",
|
|
596
597
|
DEBUG: "debug",
|
|
597
598
|
INFO: "info",
|
|
598
599
|
WARN: "warn",
|
|
599
600
|
ERROR: "error",
|
|
600
601
|
FATAL: "error"
|
|
601
|
-
},
|
|
602
|
-
constructor(e, t, n =
|
|
602
|
+
}, qt = class {
|
|
603
|
+
constructor(e, t, n = Ee) {
|
|
603
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;
|
|
604
605
|
}
|
|
605
606
|
update(e) {
|
|
606
607
|
this.settings = e;
|
|
607
608
|
}
|
|
608
609
|
accepts(e) {
|
|
609
|
-
return this.settings.level === null || !ze(
|
|
610
|
+
return this.settings.level === null || !ze(t, this.settings.level) ? !1 : t[e] >= t[this.settings.level];
|
|
610
611
|
}
|
|
611
612
|
write(e, t, n, r, i) {
|
|
612
613
|
if (!this.accepts(t) || typeof console > "u" || Ye()) return;
|
|
613
|
-
let a = `%c[%s]%c[${t}]%c`, { styles: o } = this.settings, s =
|
|
614
|
+
let a = `%c[%s]%c[${t}]%c`, { styles: o } = this.settings, s = Kt[t];
|
|
614
615
|
this.diagnostics.guard("handler.threw", `The library could not print to console.${s}.`, () => {
|
|
615
616
|
let c = [];
|
|
616
617
|
i !== void 0 && c.push(i), r !== void 0 && c.push(Ze(r, this.limits, this.diagnostics)), M(() => {
|
|
@@ -618,14 +619,14 @@ var Wt = class {
|
|
|
618
619
|
});
|
|
619
620
|
});
|
|
620
621
|
}
|
|
621
|
-
},
|
|
622
|
+
}, Jt = class {
|
|
622
623
|
constructor() {
|
|
623
624
|
k(this, "value", 0);
|
|
624
625
|
}
|
|
625
626
|
next() {
|
|
626
627
|
return ++this.value;
|
|
627
628
|
}
|
|
628
|
-
},
|
|
629
|
+
}, Yt = class {
|
|
629
630
|
constructor(e) {
|
|
630
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);
|
|
631
632
|
}
|
|
@@ -647,7 +648,7 @@ var Wt = class {
|
|
|
647
648
|
snapshot() {
|
|
648
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);
|
|
649
650
|
}
|
|
650
|
-
},
|
|
651
|
+
}, Xt = class {
|
|
651
652
|
constructor() {
|
|
652
653
|
k(this, "map", /* @__PURE__ */ new Map());
|
|
653
654
|
}
|
|
@@ -663,7 +664,7 @@ var Wt = class {
|
|
|
663
664
|
getAll() {
|
|
664
665
|
return Object.fromEntries(this.map);
|
|
665
666
|
}
|
|
666
|
-
},
|
|
667
|
+
}, Zt = class {
|
|
667
668
|
constructor(e) {
|
|
668
669
|
k(this, "policy", void 0), k(this, "kept", []), this.policy = e;
|
|
669
670
|
}
|
|
@@ -680,7 +681,7 @@ var Wt = class {
|
|
|
680
681
|
...e,
|
|
681
682
|
attributes: {
|
|
682
683
|
...e.attributes,
|
|
683
|
-
[
|
|
684
|
+
[Te]: !0
|
|
684
685
|
}
|
|
685
686
|
}));
|
|
686
687
|
}
|
|
@@ -697,7 +698,7 @@ var Wt = class {
|
|
|
697
698
|
this.kept = [];
|
|
698
699
|
}
|
|
699
700
|
}, V = class {
|
|
700
|
-
constructor(e, t =
|
|
701
|
+
constructor(e, t = te, n = !1) {
|
|
701
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;
|
|
702
703
|
}
|
|
703
704
|
setPolicy(e, t) {
|
|
@@ -729,7 +730,7 @@ var Wt = class {
|
|
|
729
730
|
});
|
|
730
731
|
} catch {
|
|
731
732
|
this.count("handler.threw"), this.consoleFallback && typeof console < "u" && M(() => {
|
|
732
|
-
console.warn(`${
|
|
733
|
+
console.warn(`${f} The onDiagnostic handler threw an error.`);
|
|
733
734
|
});
|
|
734
735
|
}
|
|
735
736
|
return !0;
|
|
@@ -755,10 +756,10 @@ var Wt = class {
|
|
|
755
756
|
}
|
|
756
757
|
};
|
|
757
758
|
// src/core/drops.ts
|
|
758
|
-
function
|
|
759
|
+
function Qt(e, t) {
|
|
759
760
|
e.length < 20 && !e.includes(t) && e.push(t);
|
|
760
761
|
}
|
|
761
|
-
var
|
|
762
|
+
var $t = class {
|
|
762
763
|
constructor(e, t) {
|
|
763
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;
|
|
764
765
|
}
|
|
@@ -772,12 +773,12 @@ var Qt = class {
|
|
|
772
773
|
journeyIds: [],
|
|
773
774
|
actions: []
|
|
774
775
|
}, this.pending.set(e, i)), i.records += r;
|
|
775
|
-
for (let e of n)
|
|
776
|
+
for (let e of n) Qt(i.batchIds, e);
|
|
776
777
|
for (let e of t) {
|
|
777
|
-
let t = tt(e,
|
|
778
|
-
typeof t == "string" &&
|
|
778
|
+
let t = tt(e, S);
|
|
779
|
+
typeof t == "string" && Qt(i.journeyIds, t);
|
|
779
780
|
let n = et(e) ? e.body : void 0;
|
|
780
|
-
typeof n == "string" &&
|
|
781
|
+
typeof n == "string" && Qt(i.actions, n);
|
|
781
782
|
}
|
|
782
783
|
this.scheduled || (this.scheduled = !0, queueMicrotask(() => {
|
|
783
784
|
this.flush();
|
|
@@ -803,7 +804,7 @@ var Qt = class {
|
|
|
803
804
|
this.reporting = !1;
|
|
804
805
|
}
|
|
805
806
|
}
|
|
806
|
-
},
|
|
807
|
+
}, en = class {
|
|
807
808
|
constructor(e) {
|
|
808
809
|
k(this, "onDrop", void 0), k(this, "actions", {
|
|
809
810
|
head: [],
|
|
@@ -821,7 +822,7 @@ var Qt = class {
|
|
|
821
822
|
return e.head.length + e.tail.length + t.head.length + t.tail.length;
|
|
822
823
|
}
|
|
823
824
|
push(e, t) {
|
|
824
|
-
let n = et(e), r = n ? this.actions : this.others, i = n ?
|
|
825
|
+
let n = et(e), r = n ? this.actions : this.others, i = n ? de : t, a = {
|
|
825
826
|
record: e,
|
|
826
827
|
arrival: this.arrivals
|
|
827
828
|
};
|
|
@@ -850,11 +851,11 @@ var Qt = class {
|
|
|
850
851
|
...t.tail
|
|
851
852
|
].sort((e, t) => e.arrival - t.arrival).map((e) => e.record);
|
|
852
853
|
}
|
|
853
|
-
},
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
],
|
|
854
|
+
}, tn = "error.", nn = [
|
|
855
|
+
E,
|
|
856
|
+
S,
|
|
857
|
+
be
|
|
858
|
+
], rn = {
|
|
858
859
|
processor: {
|
|
859
860
|
label: "A processor",
|
|
860
861
|
code: "record.dropped_by_processor",
|
|
@@ -865,36 +866,36 @@ var Qt = class {
|
|
|
865
866
|
code: "record.dropped_by_redact",
|
|
866
867
|
refused: "redact is not a function. The library drops each record until redact is a function or null."
|
|
867
868
|
}
|
|
868
|
-
}, H = (e) => typeof e == "number" && Number.isFinite(e),
|
|
869
|
-
"metric.type": cn,
|
|
870
|
-
"metric.value": H,
|
|
871
|
-
[E.start]: U
|
|
872
|
-
}, pn = {
|
|
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 = {
|
|
873
870
|
"metric.type": ln,
|
|
874
|
-
|
|
875
|
-
[
|
|
876
|
-
[E.sum]: H,
|
|
877
|
-
[E.min]: H,
|
|
878
|
-
[E.max]: H,
|
|
879
|
-
[E.bounds]: rn,
|
|
880
|
-
[E.buckets]: rn
|
|
871
|
+
"metric.value": H,
|
|
872
|
+
[n.start]: U
|
|
881
873
|
}, mn = {
|
|
882
|
-
|
|
883
|
-
[
|
|
884
|
-
[
|
|
885
|
-
[
|
|
886
|
-
[
|
|
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
|
|
887
882
|
}, hn = {
|
|
888
|
-
[
|
|
889
|
-
[
|
|
883
|
+
[l.kind]: dn,
|
|
884
|
+
[l.parentId]: cn,
|
|
885
|
+
[l.start]: U,
|
|
886
|
+
[l.end]: U,
|
|
887
|
+
[l.status]: fn
|
|
888
|
+
}, gn = {
|
|
889
|
+
[l.linkTraceId]: on,
|
|
890
|
+
[l.linkSpanId]: sn
|
|
890
891
|
};
|
|
891
|
-
function gn(e) {
|
|
892
|
-
let t = e[S], n = e[v];
|
|
893
|
-
return t === "span" && n === "uiobs.traces" ? [mn, hn] : t !== "metric" || n !== "uiobs.metrics" ? [] : e["metric.type"] === "histogram" ? [pn] : [fn];
|
|
894
|
-
}
|
|
895
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
|
+
}
|
|
896
|
+
function vn(e) {
|
|
896
897
|
let t = {};
|
|
897
|
-
for (let n of
|
|
898
|
+
for (let n of _n(e)) {
|
|
898
899
|
let r = Object.keys(n);
|
|
899
900
|
if (r.every((t) => n[t](e[t]))) for (let n of r) t[n] = e[n];
|
|
900
901
|
}
|
|
@@ -903,7 +904,7 @@ function _n(e) {
|
|
|
903
904
|
function W(e) {
|
|
904
905
|
return e;
|
|
905
906
|
}
|
|
906
|
-
var
|
|
907
|
+
var yn = class {
|
|
907
908
|
constructor(e) {
|
|
908
909
|
k(this, "deps", void 0), k(this, "resourceCache", null), this.deps = e;
|
|
909
910
|
}
|
|
@@ -913,11 +914,11 @@ var vn = class {
|
|
|
913
914
|
isEnabled(e, t, n) {
|
|
914
915
|
return this.deps.config.enabled && this.passesLevel(e, t, n);
|
|
915
916
|
}
|
|
916
|
-
passesLevel(e,
|
|
917
|
-
let { config:
|
|
918
|
-
if (
|
|
919
|
-
let
|
|
920
|
-
return
|
|
917
|
+
passesLevel(e, n, r) {
|
|
918
|
+
let { config: i } = this.deps;
|
|
919
|
+
if (r !== void 0 && me.includes(r)) return !0;
|
|
920
|
+
let a = this.deps.remote.sampling?.minLevelFor(n) ?? ot(n, i);
|
|
921
|
+
return t[e] >= t[a];
|
|
921
922
|
}
|
|
922
923
|
keepForDebug(e) {
|
|
923
924
|
let { config: t, debug: n } = this.deps;
|
|
@@ -926,79 +927,83 @@ var vn = class {
|
|
|
926
927
|
r && n.push(r);
|
|
927
928
|
}
|
|
928
929
|
build(e, t = !1) {
|
|
929
|
-
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;
|
|
930
931
|
if (!t && !this.isEnabled(e.level, e.namespace, e.type)) return r.count("record.dropped_by_level"), this.keepForDebug(e), {
|
|
931
932
|
record: null,
|
|
932
933
|
dropped: "level"
|
|
933
934
|
};
|
|
934
|
-
let
|
|
935
|
+
let u = e.trace ?? e.snapshot?.trace ?? i.resolve(), d = e.snapshot ? e.snapshot.journey : o.current(), f = st({
|
|
935
936
|
level: e.level,
|
|
936
937
|
type: e.type,
|
|
937
938
|
namespace: e.namespace,
|
|
938
|
-
journeyId:
|
|
939
|
-
traceId:
|
|
939
|
+
journeyId: d?.id ?? "",
|
|
940
|
+
traceId: u.traceId,
|
|
940
941
|
aggregated: e.aggregated
|
|
941
|
-
}, n,
|
|
942
|
-
if (!t && !
|
|
942
|
+
}, n, l.sampling?.current() ?? null);
|
|
943
|
+
if (!t && !f) return r.count("record.dropped_by_sampling"), this.keepForDebug(e), {
|
|
943
944
|
record: null,
|
|
944
945
|
dropped: "sampling"
|
|
945
946
|
};
|
|
946
|
-
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;
|
|
947
948
|
try {
|
|
948
|
-
let t = N(e.snapshot?.context ?? this.deps.context.getAll(),
|
|
949
|
-
|
|
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 = {
|
|
950
951
|
...W(t.value),
|
|
951
952
|
...W(n.value),
|
|
952
953
|
...W(i.value),
|
|
953
954
|
...W(a.value)
|
|
954
955
|
};
|
|
955
956
|
} catch (e) {
|
|
956
|
-
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 };
|
|
957
958
|
}
|
|
958
|
-
Object.assign(
|
|
959
|
-
let
|
|
960
|
-
|
|
961
|
-
let
|
|
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 = {
|
|
962
963
|
timeUnixNano: e.snapshot?.timeUnixNano ?? Pe(),
|
|
963
|
-
traceId:
|
|
964
|
-
spanId:
|
|
965
|
-
traceFlags:
|
|
966
|
-
severityNumber:
|
|
964
|
+
traceId: u.traceId,
|
|
965
|
+
spanId: u.spanId,
|
|
966
|
+
traceFlags: u.traceFlags,
|
|
967
|
+
severityNumber: a[e.level],
|
|
967
968
|
severityText: e.level,
|
|
968
|
-
body:
|
|
969
|
-
attributes:
|
|
969
|
+
body: v,
|
|
970
|
+
attributes: g,
|
|
970
971
|
resource: this.resource()
|
|
971
|
-
},
|
|
972
|
-
if (
|
|
973
|
-
let t = this.applyHooks(
|
|
972
|
+
}, ee = this.hookStages();
|
|
973
|
+
if (ee.length > 0) {
|
|
974
|
+
let t = this.applyHooks(y, ee, e.fixed);
|
|
974
975
|
if (typeof t == "string") return {
|
|
975
976
|
record: null,
|
|
976
977
|
dropped: t
|
|
977
978
|
};
|
|
978
|
-
({record:
|
|
979
|
+
({record: y, bytes: _} = t);
|
|
979
980
|
}
|
|
980
|
-
let
|
|
981
|
-
[
|
|
982
|
-
[
|
|
983
|
-
[
|
|
981
|
+
let te = {
|
|
982
|
+
[C]: e.type,
|
|
983
|
+
[w]: p,
|
|
984
|
+
[b]: e.namespace
|
|
984
985
|
};
|
|
985
|
-
return { record: this.fit(
|
|
986
|
+
return { record: this.fit(y, _, te, e.fixed) };
|
|
986
987
|
}
|
|
987
988
|
redactForwarded(e) {
|
|
988
|
-
let {
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
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;
|
|
992
997
|
}
|
|
993
998
|
rehook(e) {
|
|
994
|
-
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);
|
|
995
1000
|
d !== e.body && n.count("record.truncated");
|
|
996
|
-
let f =
|
|
1001
|
+
let f = vn(o), p = {
|
|
997
1002
|
...e,
|
|
998
1003
|
body: d,
|
|
999
1004
|
attributes: {
|
|
1000
1005
|
...o,
|
|
1001
|
-
[
|
|
1006
|
+
[E]: u
|
|
1002
1007
|
},
|
|
1003
1008
|
resource: this.resource()
|
|
1004
1009
|
}, m = this.applyHooks(p, this.hookStages(), f), h = typeof m == "string" ? null : this.fit(m.record, m.bytes, o, f);
|
|
@@ -1012,20 +1017,20 @@ var vn = class {
|
|
|
1012
1017
|
body: e.body
|
|
1013
1018
|
});
|
|
1014
1019
|
let o = {
|
|
1015
|
-
[S]: n[S],
|
|
1016
1020
|
[C]: n[C],
|
|
1017
|
-
[
|
|
1018
|
-
[
|
|
1019
|
-
[
|
|
1021
|
+
[w]: n[w],
|
|
1022
|
+
[b]: n[b],
|
|
1023
|
+
[Ce]: !0,
|
|
1024
|
+
[_e]: t
|
|
1020
1025
|
};
|
|
1021
|
-
for (let t of
|
|
1022
|
-
for (let [t, n] of Object.entries(e.attributes)) t.startsWith(
|
|
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);
|
|
1023
1028
|
let s = N(o, a, i).bytes;
|
|
1024
1029
|
s > a.maxRecordBytes && "error.data" in o && (Reflect.deleteProperty(o, se), s = N(o, a, i).bytes);
|
|
1025
|
-
let c = e.attributes[
|
|
1030
|
+
let c = e.attributes[x];
|
|
1026
1031
|
if (c !== void 0) {
|
|
1027
1032
|
let e = N(c, a, i).bytes;
|
|
1028
|
-
s + e <= a.maxRecordBytes && (o[
|
|
1033
|
+
s + e <= a.maxRecordBytes && (o[x] = c);
|
|
1029
1034
|
}
|
|
1030
1035
|
return Object.assign(o, r), e.attributes = o, e;
|
|
1031
1036
|
}
|
|
@@ -1050,18 +1055,18 @@ var vn = class {
|
|
|
1050
1055
|
};
|
|
1051
1056
|
}
|
|
1052
1057
|
runHook(e, t, n) {
|
|
1053
|
-
let { diagnostics: r } = this.deps, { label: i, code:
|
|
1058
|
+
let { diagnostics: r } = this.deps, { label: i, code: o, refused: s } = rn[t], c;
|
|
1054
1059
|
try {
|
|
1055
|
-
|
|
1060
|
+
c = e(n);
|
|
1056
1061
|
} catch (e) {
|
|
1057
|
-
return r.report(
|
|
1062
|
+
return r.report(o, `${i} threw an error. The library dropped the record.`, void 0, e), t;
|
|
1058
1063
|
}
|
|
1059
|
-
if (
|
|
1060
|
-
let
|
|
1061
|
-
return Ne(
|
|
1062
|
-
...
|
|
1063
|
-
severityNumber:
|
|
1064
|
-
} : (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);
|
|
1065
1070
|
}
|
|
1066
1071
|
provided() {
|
|
1067
1072
|
let e = this.deps.config.contextProvider;
|
|
@@ -1076,34 +1081,34 @@ var vn = class {
|
|
|
1076
1081
|
if (this.resourceCache) return this.resourceCache;
|
|
1077
1082
|
let { config: t, identity: n, platform: a } = this.deps;
|
|
1078
1083
|
return this.resourceCache = {
|
|
1079
|
-
[
|
|
1080
|
-
[
|
|
1081
|
-
[
|
|
1082
|
-
[
|
|
1083
|
-
[
|
|
1084
|
-
[
|
|
1085
|
-
[
|
|
1086
|
-
[
|
|
1087
|
-
[
|
|
1088
|
-
[
|
|
1089
|
-
...t.metadata.userAgent ? { [
|
|
1090
|
-
...!t.metadata.openfin || a.openfinUuid === void 0 ? {} : { [
|
|
1091
|
-
...!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 }
|
|
1092
1097
|
}, this.resourceCache;
|
|
1093
1098
|
}
|
|
1094
|
-
},
|
|
1099
|
+
}, bn = 1e3, xn = {
|
|
1095
1100
|
start: "ui.start",
|
|
1096
1101
|
interaction: "ui.interaction",
|
|
1097
1102
|
navigation: "ui.navigation",
|
|
1098
1103
|
explicit: "ui.trace",
|
|
1099
1104
|
maxAge: "ui.trace"
|
|
1100
1105
|
};
|
|
1101
|
-
function xn(e) {
|
|
1102
|
-
return `${String(Math.round(e * yn))}000`;
|
|
1103
|
-
}
|
|
1104
1106
|
function Sn(e) {
|
|
1107
|
+
return `${String(Math.round(e * bn))}000`;
|
|
1108
|
+
}
|
|
1109
|
+
function Cn(e) {
|
|
1105
1110
|
return {
|
|
1106
|
-
name:
|
|
1111
|
+
name: xn[e.reason],
|
|
1107
1112
|
kind: "internal",
|
|
1108
1113
|
traceId: e.traceId,
|
|
1109
1114
|
spanId: e.spanId,
|
|
@@ -1114,52 +1119,53 @@ function Sn(e) {
|
|
|
1114
1119
|
attributes: {}
|
|
1115
1120
|
};
|
|
1116
1121
|
}
|
|
1117
|
-
function
|
|
1122
|
+
function wn(e) {
|
|
1118
1123
|
return {
|
|
1119
|
-
[
|
|
1120
|
-
[
|
|
1121
|
-
[
|
|
1122
|
-
[
|
|
1123
|
-
[
|
|
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",
|
|
1124
1129
|
...e.link ? {
|
|
1125
|
-
[
|
|
1126
|
-
[
|
|
1130
|
+
[l.linkTraceId]: e.link.traceId,
|
|
1131
|
+
[l.linkSpanId]: e.link.spanId
|
|
1127
1132
|
} : {}
|
|
1128
1133
|
};
|
|
1129
1134
|
}
|
|
1130
1135
|
// src/core/runtime.ts
|
|
1131
|
-
var
|
|
1132
|
-
errors: async () => (await import("./errors-
|
|
1133
|
-
network: async () => (await import("./network-
|
|
1134
|
-
interactions: async () => (await import("./interactions-
|
|
1135
|
-
webVitals: async () => (await import("./web-vitals-
|
|
1136
|
-
longFrames: async () => (await import("./long-frames-
|
|
1137
|
-
console: async () => (await import("./console-
|
|
1138
|
-
uncleanExit: async () => (await import("./unclean-exit-
|
|
1139
|
-
userTiming: async () => (await import("./user-timing-
|
|
1140
|
-
reports: async () => (await import("./reports-
|
|
1141
|
-
resourceTiming: async () => (await import("./resource-timing-
|
|
1142
|
-
lifecycle: async () => (await import("./lifecycle-
|
|
1143
|
-
framePhases: async () => (await import("./profiler-frames-
|
|
1144
|
-
framePacing: async () => (await import("./profiler-frames-
|
|
1145
|
-
replay: async () => (await import("./replay-
|
|
1146
|
-
},
|
|
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;
|
|
1147
1152
|
function G(e) {
|
|
1148
|
-
let t =
|
|
1149
|
-
return t === void 0 && (t = ++
|
|
1153
|
+
let t = En.get(e);
|
|
1154
|
+
return t === void 0 && (t = ++Dn, En.set(e, t)), t;
|
|
1150
1155
|
}
|
|
1151
|
-
var
|
|
1156
|
+
var On = Symbol.for(o), kn = Symbol.for(u), An = ["batching", "retention"], jn = [
|
|
1152
1157
|
"log",
|
|
1153
1158
|
"event",
|
|
1154
1159
|
"action"
|
|
1155
|
-
],
|
|
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([
|
|
1156
1161
|
"bus.role_resolved",
|
|
1162
|
+
"bus.tab_id_changed",
|
|
1157
1163
|
"config.reconfigured",
|
|
1158
1164
|
"security.rotated",
|
|
1159
1165
|
"journey.adopted",
|
|
1160
1166
|
"journey.expired"
|
|
1161
1167
|
]);
|
|
1162
|
-
function
|
|
1168
|
+
function In(e) {
|
|
1163
1169
|
return JSON.stringify({
|
|
1164
1170
|
...e,
|
|
1165
1171
|
urlTransform: e.urlTransform ? G(e.urlTransform) : void 0,
|
|
@@ -1170,7 +1176,7 @@ function Fn(e) {
|
|
|
1170
1176
|
plugins: e.plugins.map(G)
|
|
1171
1177
|
});
|
|
1172
1178
|
}
|
|
1173
|
-
function
|
|
1179
|
+
function Ln(e) {
|
|
1174
1180
|
if (!D(e)) return e;
|
|
1175
1181
|
let t = { ...e };
|
|
1176
1182
|
for (let e of ["url", "endpoint"]) {
|
|
@@ -1179,7 +1185,7 @@ function In(e) {
|
|
|
1179
1185
|
}
|
|
1180
1186
|
return t;
|
|
1181
1187
|
}
|
|
1182
|
-
function
|
|
1188
|
+
function Rn(e) {
|
|
1183
1189
|
return {
|
|
1184
1190
|
...e,
|
|
1185
1191
|
endpoint: null,
|
|
@@ -1194,10 +1200,10 @@ function Ln(e) {
|
|
|
1194
1200
|
}
|
|
1195
1201
|
};
|
|
1196
1202
|
}
|
|
1197
|
-
function
|
|
1203
|
+
function zn(e) {
|
|
1198
1204
|
return !!e.endpoint || !!e.metricsEndpoint || !!e.tracesEndpoint || !!e.transport || !!e.transportWorker;
|
|
1199
1205
|
}
|
|
1200
|
-
function
|
|
1206
|
+
function Bn(e, t) {
|
|
1201
1207
|
return {
|
|
1202
1208
|
status: e,
|
|
1203
1209
|
accepted: 0,
|
|
@@ -1209,10 +1215,10 @@ function zn(e, t) {
|
|
|
1209
1215
|
};
|
|
1210
1216
|
}
|
|
1211
1217
|
function K(e) {
|
|
1212
|
-
return
|
|
1218
|
+
return Bn(e.pending > 0 ? "timeout" : "complete", e);
|
|
1213
1219
|
}
|
|
1214
|
-
function
|
|
1215
|
-
return e.sdkVersion ===
|
|
1220
|
+
function Vn(e) {
|
|
1221
|
+
return e.sdkVersion === T;
|
|
1216
1222
|
}
|
|
1217
1223
|
var q = class e {
|
|
1218
1224
|
isRotating() {
|
|
@@ -1222,15 +1228,16 @@ var q = class e {
|
|
|
1222
1228
|
typeof e == "boolean" && (this.config.lockConfiguration = e);
|
|
1223
1229
|
}
|
|
1224
1230
|
constructor(e, t) {
|
|
1225
|
-
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, "diagnosticLogger", new B(() => this,
|
|
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", {
|
|
1226
1232
|
local: () => this.backing.local(),
|
|
1227
|
-
session: () => this.backing.session()
|
|
1228
|
-
|
|
1233
|
+
session: () => this.backing.session(),
|
|
1234
|
+
opener: () => this.backing.opener?.() ?? null
|
|
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", {
|
|
1229
1236
|
sampling: null,
|
|
1230
1237
|
changed: () => {
|
|
1231
1238
|
this.refreshCaptures();
|
|
1232
1239
|
}
|
|
1233
|
-
}), 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
|
|
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) => {
|
|
1234
1241
|
this.dropHeld(e);
|
|
1235
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) => {
|
|
1236
1243
|
this.openGate = e;
|
|
@@ -1240,7 +1247,7 @@ var q = class e {
|
|
|
1240
1247
|
longFrames: !1,
|
|
1241
1248
|
uncleanExit: !1,
|
|
1242
1249
|
userTiming: !1
|
|
1243
|
-
}), k(this, "bootBuffer", new
|
|
1250
|
+
}), k(this, "bootBuffer", new en((e) => {
|
|
1244
1251
|
this.dropHeld(e);
|
|
1245
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", () => {
|
|
1246
1253
|
R(this), this.dropPaused(), this.role() === "forwarder" && (this.tracing.end(), this.sendForwarded());
|
|
@@ -1255,25 +1262,25 @@ var q = class e {
|
|
|
1255
1262
|
}), k(this, "reportGap", (e, t) => {
|
|
1256
1263
|
this.drops.add(e.reason, t.flatMap((e) => e.records), t.map((e) => e.id));
|
|
1257
1264
|
let n = Date.now();
|
|
1258
|
-
n - this.lastGapAt < 6e4 || (this.lastGapAt = n, new B(() => this,
|
|
1265
|
+
n - this.lastGapAt < 6e4 || (this.lastGapAt = n, new B(() => this, re).warn("stored records were dropped before delivery", {
|
|
1259
1266
|
"gap.batches": e.batches,
|
|
1260
1267
|
"gap.records": e.records,
|
|
1261
1268
|
"gap.reason": e.reason
|
|
1262
1269
|
}));
|
|
1263
|
-
}), 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
|
|
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);
|
|
1264
1271
|
let n = (e) => at(e, this.config.sampling.defaultRate);
|
|
1265
|
-
this.tracing = new
|
|
1272
|
+
this.tracing = new kt(this.diagnostics, this.config.correlation.traceMaxAgeMs ?? Infinity, this.config.otelLoader, {
|
|
1266
1273
|
enabled: () => this.config.tracesEndpoint !== null,
|
|
1267
1274
|
keeps: n,
|
|
1268
1275
|
onEnd: (e) => {
|
|
1269
|
-
n(e.traceId) && this.recordSpan(
|
|
1276
|
+
n(e.traceId) && this.recordSpan(Cn(e));
|
|
1270
1277
|
}
|
|
1271
|
-
}), this.limits = { ...this.config.limits }, this.console = new
|
|
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 = {
|
|
1272
1279
|
...rt,
|
|
1273
1280
|
maxAgeMs: this.config.journey.maxAgeMs
|
|
1274
1281
|
}, this.journey = new nt(this.journeyOptions, this.diagnostics, this.identity.contextId, (e) => {
|
|
1275
1282
|
this.bus?.broadcastJourney(e);
|
|
1276
|
-
}, this.stores), this.builder = new
|
|
1283
|
+
}, this.stores), this.builder = new yn({
|
|
1277
1284
|
remote: this.remote,
|
|
1278
1285
|
config: this.config,
|
|
1279
1286
|
limits: this.limits,
|
|
@@ -1285,7 +1292,7 @@ var q = class e {
|
|
|
1285
1292
|
identity: this.identity,
|
|
1286
1293
|
platform: this.platform,
|
|
1287
1294
|
debug: this.debugBuffer
|
|
1288
|
-
}), this.meter = new
|
|
1295
|
+
}), this.meter = new Gt(() => this.config.metrics.intervalMs, (e, t, n) => {
|
|
1289
1296
|
this.emitPoint(e, t, n);
|
|
1290
1297
|
}, this.diagnostics, this.config.metrics), this.diagnostics.setHandler(this.diagnosticHandler()), this.syncProfiler();
|
|
1291
1298
|
}
|
|
@@ -1297,18 +1304,25 @@ var q = class e {
|
|
|
1297
1304
|
recordDiagnostic(e) {
|
|
1298
1305
|
let { records: t } = this.config.diagnostics;
|
|
1299
1306
|
if ((t === !0 || t !== !1 && t.includes(e.code)) && !this.recordingDiagnostic) {
|
|
1300
|
-
this.
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1307
|
+
if (this.holdingRecords) this.heldDiagnostics.push(e);
|
|
1308
|
+
else {
|
|
1309
|
+
this.recordingDiagnostic = !0;
|
|
1310
|
+
try {
|
|
1311
|
+
(Fn.has(e.code) ? this.diagnosticLogger.info : this.diagnosticLogger.warn)(e.message, {
|
|
1312
|
+
"diagnostic.code": e.code,
|
|
1313
|
+
"diagnostic.count": e.count,
|
|
1314
|
+
"diagnostic.detail": Ln(e.detail)
|
|
1315
|
+
});
|
|
1316
|
+
} finally {
|
|
1317
|
+
this.recordingDiagnostic = !1;
|
|
1318
|
+
}
|
|
1309
1319
|
}
|
|
1310
1320
|
}
|
|
1311
1321
|
}
|
|
1322
|
+
dropHeldRecords() {
|
|
1323
|
+
let e = this.heldDiagnostics.length;
|
|
1324
|
+
this.heldDiagnostics = [], e > 0 && this.diagnostics.count("record.dropped_during_rotation", e);
|
|
1325
|
+
}
|
|
1312
1326
|
addBreadcrumb(e, t) {
|
|
1313
1327
|
this.rotating || this.destroyed || this.diagnostics.guard("record.sanitize_failed", "The library could not add the breadcrumb.", () => {
|
|
1314
1328
|
let n = {
|
|
@@ -1328,7 +1342,7 @@ var q = class e {
|
|
|
1328
1342
|
}
|
|
1329
1343
|
startMeasure(e, t) {
|
|
1330
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 }));
|
|
1331
|
-
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, {
|
|
1332
1346
|
metric: (e, t, n) => {
|
|
1333
1347
|
r() && this.recordMetric(e, t, n);
|
|
1334
1348
|
},
|
|
@@ -1343,9 +1357,9 @@ var q = class e {
|
|
|
1343
1357
|
level: "INFO",
|
|
1344
1358
|
type: "span",
|
|
1345
1359
|
body: e.name,
|
|
1346
|
-
namespace:
|
|
1360
|
+
namespace: we,
|
|
1347
1361
|
payload: e.attributes,
|
|
1348
|
-
fixed:
|
|
1362
|
+
fixed: wn(e),
|
|
1349
1363
|
trace: {
|
|
1350
1364
|
traceId: e.traceId,
|
|
1351
1365
|
spanId: e.spanId,
|
|
@@ -1354,18 +1368,18 @@ var q = class e {
|
|
|
1354
1368
|
});
|
|
1355
1369
|
this.emit(t);
|
|
1356
1370
|
}
|
|
1357
|
-
emitPoint(e, t,
|
|
1371
|
+
emitPoint(e, t, n) {
|
|
1358
1372
|
if (this.destroyed) return;
|
|
1359
|
-
let { record:
|
|
1373
|
+
let { record: r } = this.builder.build({
|
|
1360
1374
|
level: "INFO",
|
|
1361
1375
|
type: "metric",
|
|
1362
1376
|
body: e,
|
|
1363
|
-
namespace:
|
|
1377
|
+
namespace: ee,
|
|
1364
1378
|
payload: t,
|
|
1365
|
-
fixed:
|
|
1379
|
+
fixed: n,
|
|
1366
1380
|
aggregated: !0
|
|
1367
1381
|
});
|
|
1368
|
-
this.emit(
|
|
1382
|
+
this.emit(r);
|
|
1369
1383
|
}
|
|
1370
1384
|
syncProfiler() {
|
|
1371
1385
|
let e = this.config.profiler.enabled && this.config.enabled;
|
|
@@ -1404,19 +1418,19 @@ var q = class e {
|
|
|
1404
1418
|
this.identityEpoch++, this.profilerOn && this.config.securityContext.isolation && j().reset(), this.remote.sampling = null, this.refreshCaptures();
|
|
1405
1419
|
}
|
|
1406
1420
|
static pinned() {
|
|
1407
|
-
return globalThis[
|
|
1421
|
+
return globalThis[On] ?? null;
|
|
1408
1422
|
}
|
|
1409
1423
|
static current() {
|
|
1410
1424
|
let t = e.local;
|
|
1411
1425
|
if (t) return t.destroyed ? null : t;
|
|
1412
1426
|
let n = e.pinned();
|
|
1413
|
-
return n &&
|
|
1427
|
+
return n && Vn(n) ? n : null;
|
|
1414
1428
|
}
|
|
1415
1429
|
static stopped() {
|
|
1416
1430
|
let t = e.local;
|
|
1417
1431
|
if (t?.destroyed) return t;
|
|
1418
|
-
let n = globalThis[
|
|
1419
|
-
return n &&
|
|
1432
|
+
let n = globalThis[kn];
|
|
1433
|
+
return n && Vn(n) ? n : null;
|
|
1420
1434
|
}
|
|
1421
1435
|
isDestroyed() {
|
|
1422
1436
|
return this.destroyed;
|
|
@@ -1435,8 +1449,8 @@ var q = class e {
|
|
|
1435
1449
|
this.startFailed = !0;
|
|
1436
1450
|
let t = P({ redact: F }, new V(), this.config);
|
|
1437
1451
|
$e(this.config, t), M(() => {
|
|
1438
|
-
console.warn(`${
|
|
1439
|
-
}), this.diagnostics.report("config.invalid",
|
|
1452
|
+
console.warn(`${f} ${Mn}`);
|
|
1453
|
+
}), this.diagnostics.report("config.invalid", Mn, void 0, e), this.rehookHeld();
|
|
1440
1454
|
}
|
|
1441
1455
|
static startOrUpdate(t, n) {
|
|
1442
1456
|
let r = e.local;
|
|
@@ -1444,19 +1458,19 @@ var q = class e {
|
|
|
1444
1458
|
e.local = null;
|
|
1445
1459
|
let i = e.pinned();
|
|
1446
1460
|
if (i) {
|
|
1447
|
-
if (!
|
|
1461
|
+
if (!Vn(i)) return e.startDegraded(t, i.sdkVersion, n);
|
|
1448
1462
|
if (!i.destroyed) return i.reconfigure(t), i;
|
|
1449
1463
|
}
|
|
1450
1464
|
let a = new e(t, !1);
|
|
1451
|
-
return globalThis[
|
|
1465
|
+
return globalThis[On] = a, Reflect.deleteProperty(globalThis, kn), n || a.launch(), a;
|
|
1452
1466
|
}
|
|
1453
1467
|
static startDegraded(t, n, r) {
|
|
1454
1468
|
let i = new e(t, !0);
|
|
1455
1469
|
e.local = i;
|
|
1456
1470
|
let a = typeof n == "string" ? n : "before 0.9.0";
|
|
1457
|
-
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.`, {
|
|
1458
1472
|
found: a,
|
|
1459
|
-
own:
|
|
1473
|
+
own: T
|
|
1460
1474
|
}), r || i.launch(), i;
|
|
1461
1475
|
}
|
|
1462
1476
|
reconfigure(e) {
|
|
@@ -1482,22 +1496,22 @@ var q = class e {
|
|
|
1482
1496
|
return this.platform.platform === "node";
|
|
1483
1497
|
}
|
|
1484
1498
|
allowed(e) {
|
|
1485
|
-
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;
|
|
1486
1500
|
}
|
|
1487
1501
|
keepRouting(e) {
|
|
1488
1502
|
if (!this.tunablesLocked || this.degraded || !this.config.securityContext.isolation) return e;
|
|
1489
|
-
let
|
|
1490
|
-
if (
|
|
1491
|
-
let
|
|
1492
|
-
for (let e of
|
|
1493
|
-
if (
|
|
1503
|
+
let t = P(e, new V(), this.config), n = h.filter((e) => !J(t[e], this.config[e]));
|
|
1504
|
+
if (t.securityContext.id !== this.config.securityContext.id && n.push("securityContext.id"), n.length === 0) return e;
|
|
1505
|
+
let r = { ...e };
|
|
1506
|
+
for (let e of h) n.includes(e) && Reflect.deleteProperty(r, e);
|
|
1507
|
+
if (n.includes("securityContext.id")) {
|
|
1494
1508
|
let t = { ...e.securityContext };
|
|
1495
|
-
Reflect.deleteProperty(t, "id"),
|
|
1509
|
+
Reflect.deleteProperty(t, "id"), r.securityContext = t;
|
|
1496
1510
|
}
|
|
1497
|
-
return this.diagnostics.report("config.invalid", `Isolation refuses changes to ${
|
|
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;
|
|
1498
1512
|
}
|
|
1499
1513
|
keepStartupTunables(e) {
|
|
1500
|
-
if (this.senderLoad !== void 0 && this.keepSections(e,
|
|
1514
|
+
if (this.senderLoad !== void 0 && this.keepSections(e, An), !this.tunablesLocked) {
|
|
1501
1515
|
Object.assign(this.limits, e.limits), this.journeyOptions.maxAgeMs = e.journey.maxAgeMs;
|
|
1502
1516
|
return;
|
|
1503
1517
|
}
|
|
@@ -1506,7 +1520,7 @@ var q = class e {
|
|
|
1506
1520
|
let { maxAgeMs: t } = this.config.journey;
|
|
1507
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);
|
|
1508
1522
|
let { maxProbes: n } = this.config.profiler;
|
|
1509
|
-
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);
|
|
1510
1524
|
}
|
|
1511
1525
|
keepSections(e, t) {
|
|
1512
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] }));
|
|
@@ -1537,7 +1551,7 @@ var q = class e {
|
|
|
1537
1551
|
start() {
|
|
1538
1552
|
this.running = !0, this.identityBuiltAs === "storage" && !this.onServer() && (this.backing = Je);
|
|
1539
1553
|
let { sessionIdleMs: e, traceMaxAgeMs: t } = this.config.correlation, { sessionId: n, tabId: r } = qe(this.diagnostics, this.stores, e);
|
|
1540
|
-
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) => !
|
|
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();
|
|
1541
1555
|
for (let e of this.rehookHeld()) this.bootBuffer.push(e, this.config.buffering.maxHeldRecords);
|
|
1542
1556
|
this.openGate(), this.init();
|
|
1543
1557
|
}
|
|
@@ -1577,7 +1591,7 @@ var q = class e {
|
|
|
1577
1591
|
async buildBus() {
|
|
1578
1592
|
try {
|
|
1579
1593
|
await this.startGate;
|
|
1580
|
-
let { Bus: e } = await import("./bus-
|
|
1594
|
+
let { Bus: e } = await import("./bus-DyNafxZN.js");
|
|
1581
1595
|
if (this.destroyed) return null;
|
|
1582
1596
|
let t = new e(this.config, this.diagnostics, this.platform, this.identity.contextId, this.identity.tabId, {
|
|
1583
1597
|
onSecurityContext: (e) => {
|
|
@@ -1631,7 +1645,7 @@ var q = class e {
|
|
|
1631
1645
|
}
|
|
1632
1646
|
async buildSender() {
|
|
1633
1647
|
try {
|
|
1634
|
-
let { Sender: e } = await import("./sender-
|
|
1648
|
+
let { Sender: e } = await import("./sender-BRSpc7R8.js"), t = this.destroyed ? null : await e.create({
|
|
1635
1649
|
storage: this.memoryStorage,
|
|
1636
1650
|
onStorage: (e) => {
|
|
1637
1651
|
e.name === "memory" && (this.memoryStorage = e);
|
|
@@ -1664,8 +1678,10 @@ var q = class e {
|
|
|
1664
1678
|
this.senderLoad = void 0, this.diagnostics.report("pipeline.crashed", "The delivery stack did not load. The library does not send records.", { held: this.pendingRecords.length }, e), this.drops.add("load_failed", this.pendingRecords.records);
|
|
1665
1679
|
}
|
|
1666
1680
|
for (let e of this.pendingRecords.take()) this.sender?.push(e);
|
|
1667
|
-
|
|
1668
|
-
|
|
1681
|
+
if (this.sender && this.carried.length > 0) {
|
|
1682
|
+
let e = this.carried;
|
|
1683
|
+
this.carried = [], await this.adoptStored(this.sender, e);
|
|
1684
|
+
}
|
|
1669
1685
|
}
|
|
1670
1686
|
async adoptStored(e, t) {
|
|
1671
1687
|
await this.diagnostics.guardAsync("storage.degraded", "The library could not store the carried batches under the new context.", () => e.adopt(t, this.config.securityContext.id));
|
|
@@ -1679,7 +1695,7 @@ var q = class e {
|
|
|
1679
1695
|
}
|
|
1680
1696
|
captureState(e) {
|
|
1681
1697
|
let { enabled: t, framePhases: n, framePacing: r } = this.config.profiler;
|
|
1682
|
-
return `${String(this.config.enabled)}${
|
|
1698
|
+
return `${String(this.config.enabled)}${In(e)}${String(t && n)}${String(t && r)}${this.replayState(e)}`;
|
|
1683
1699
|
}
|
|
1684
1700
|
replayState(e) {
|
|
1685
1701
|
let { replay: t } = this.config;
|
|
@@ -1703,7 +1719,7 @@ var q = class e {
|
|
|
1703
1719
|
}
|
|
1704
1720
|
effectiveCapture() {
|
|
1705
1721
|
let e = { ...this.config.capture }, t = this.remote.sampling?.current()?.capture;
|
|
1706
|
-
for (let n of
|
|
1722
|
+
for (let n of ce) {
|
|
1707
1723
|
let r = t?.[n];
|
|
1708
1724
|
if (e.remoteToggles.includes(n) && r !== void 0) {
|
|
1709
1725
|
if (r && typeof e[n] == "object") continue;
|
|
@@ -1732,7 +1748,7 @@ var q = class e {
|
|
|
1732
1748
|
diagnostics: this.diagnostics,
|
|
1733
1749
|
breadcrumbs: this.breadcrumbs,
|
|
1734
1750
|
tracing: this.tracing,
|
|
1735
|
-
logger: new
|
|
1751
|
+
logger: new yt(() => this, m),
|
|
1736
1752
|
once: this.captureOnce,
|
|
1737
1753
|
recordMetric: (e, t, n) => {
|
|
1738
1754
|
this.recordMetric(e, t, n);
|
|
@@ -1768,17 +1784,17 @@ var q = class e {
|
|
|
1768
1784
|
this.captures.length = 0, this.replay = e, e && this.captures.push(e);
|
|
1769
1785
|
}
|
|
1770
1786
|
loadWebSocket() {
|
|
1771
|
-
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);
|
|
1772
1788
|
}
|
|
1773
1789
|
pluginCapture(e) {
|
|
1774
1790
|
let { name: t } = e, n = (e, t, n) => {
|
|
1775
1791
|
this.recordMetric(e, t, n);
|
|
1776
1792
|
}, r = (e) => {
|
|
1777
|
-
this.diagnostics.report("config.invalid",
|
|
1793
|
+
this.diagnostics.report("config.invalid", v, void 0, e);
|
|
1778
1794
|
}, i = {
|
|
1779
|
-
logger: new B(() => this, `${
|
|
1780
|
-
counter: (e, t = {}) =>
|
|
1781
|
-
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),
|
|
1782
1798
|
addBreadcrumb: (e, t) => {
|
|
1783
1799
|
this.addBreadcrumb(e, t);
|
|
1784
1800
|
},
|
|
@@ -1795,7 +1811,7 @@ var q = class e {
|
|
|
1795
1811
|
};
|
|
1796
1812
|
}
|
|
1797
1813
|
loadCapture(e) {
|
|
1798
|
-
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]);
|
|
1799
1815
|
}
|
|
1800
1816
|
registerWorker(e, t = {}) {
|
|
1801
1817
|
let n = !1, r;
|
|
@@ -1820,29 +1836,31 @@ var q = class e {
|
|
|
1820
1836
|
this.stopping ??= this.stop(t), await this.stopping, n !== void 0 && await this.clearStorage(n);
|
|
1821
1837
|
}
|
|
1822
1838
|
async stop(t) {
|
|
1823
|
-
t || (R(this), this.collectPoints(), this.tracing.end()), this.profilerOn && (this.profilerOn = !1, j().detach()), this.destroyed = !0, this.backing = Ke(),
|
|
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();
|
|
1824
1840
|
let n = t ? this.discardHeld() : this.flushHeld();
|
|
1825
1841
|
this.journey.destroy(), this.bus?.destroy(), await n, await this.senderLoad, await this.rotation?.catch(() => void 0);
|
|
1826
1842
|
let r = this.parkedSender;
|
|
1827
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 () => {
|
|
1828
1844
|
await (t ? r?.discard() : r?.retire("retain", 0, this.config.securityContext.id));
|
|
1829
|
-
}), 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);
|
|
1830
1846
|
}
|
|
1831
1847
|
shutdownRule(e) {
|
|
1832
|
-
let t = this.readOptions(e,
|
|
1848
|
+
let t = this.readOptions(e, Nn);
|
|
1833
1849
|
if (t === void 0) return { discard: !0 };
|
|
1834
1850
|
let { pending: n, clearStorage: r } = t, i = r == null, a = i || r === "context" || r === "namespace", o;
|
|
1835
1851
|
i || (o = r === "namespace" ? "namespace" : "context");
|
|
1836
1852
|
let s = n === void 0 || n === "flush";
|
|
1837
|
-
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), {
|
|
1838
1854
|
discard: !s || o !== void 0,
|
|
1839
1855
|
scope: o
|
|
1840
1856
|
};
|
|
1841
1857
|
}
|
|
1842
1858
|
async flushHeld() {
|
|
1843
|
-
this.dropPaused();
|
|
1859
|
+
this.sender && this.releaseBootBuffer(), this.dropPaused();
|
|
1844
1860
|
let e = this.sender?.destroy();
|
|
1845
|
-
this.sendForwarded()
|
|
1861
|
+
this.sendForwarded();
|
|
1862
|
+
let t = [...this.bootBuffer.take(), ...this.pendingRecords.take()];
|
|
1863
|
+
this.drops.add("load_failed", this.unreported(t)), await e;
|
|
1846
1864
|
}
|
|
1847
1865
|
async discardHeld() {
|
|
1848
1866
|
let e = [
|
|
@@ -1856,7 +1874,7 @@ var q = class e {
|
|
|
1856
1874
|
}
|
|
1857
1875
|
async clearStorage(e) {
|
|
1858
1876
|
this.tunablesLocked && await this.diagnostics.guardAsync("storage.degraded", "The library could not remove the stored batches at shutdown.", async () => {
|
|
1859
|
-
let { clearStored: t } = await import("./stored-context-
|
|
1877
|
+
let { clearStored: t } = await import("./stored-context-df1dEnht.js"), n = this.carried.map((e) => e.id);
|
|
1860
1878
|
this.carried = [], await t(this.storeAccess(), e, n, this.identityBuiltAs === "storage" && !this.onServer());
|
|
1861
1879
|
});
|
|
1862
1880
|
}
|
|
@@ -1938,10 +1956,10 @@ var q = class e {
|
|
|
1938
1956
|
}
|
|
1939
1957
|
regenerateTabId() {
|
|
1940
1958
|
let e = A(this.diagnostics);
|
|
1941
|
-
this.diagnostics.report("bus.
|
|
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.", {
|
|
1942
1960
|
was: this.identity.tabId,
|
|
1943
1961
|
now: e
|
|
1944
|
-
}), this.identity.tabId = e, Ue(e, this.diagnostics, this.stores), this.builder.invalidateResource();
|
|
1962
|
+
}), this.identity.tabId = e, Ue(e, this.diagnostics, this.stores), this.builder.invalidateResource(), this.bus?.setTabId(e);
|
|
1945
1963
|
}
|
|
1946
1964
|
newSession() {
|
|
1947
1965
|
this.destroyed || (R(this), this.resetSession(A(this.diagnostics)));
|
|
@@ -1965,12 +1983,16 @@ var q = class e {
|
|
|
1965
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.");
|
|
1966
1984
|
let r;
|
|
1967
1985
|
try {
|
|
1968
|
-
r = (await import("./rotation-
|
|
1986
|
+
r = (await import("./rotation-ChBbNDE2.js")).rotateContext;
|
|
1969
1987
|
} catch (e) {
|
|
1970
1988
|
throw this.diagnostics.report("pipeline.crashed", "The library could not load the security-context rotation.", void 0, e), await this.closeDelivery(), e;
|
|
1971
1989
|
}
|
|
1972
1990
|
if (this.isDestroyed()) throw Error("The runtime has stopped.");
|
|
1973
|
-
|
|
1991
|
+
try {
|
|
1992
|
+
await r(this.rotationHost(), e, t, n);
|
|
1993
|
+
} finally {
|
|
1994
|
+
this.dropHeldRecords();
|
|
1995
|
+
}
|
|
1974
1996
|
}
|
|
1975
1997
|
rotationHost() {
|
|
1976
1998
|
return {
|
|
@@ -1979,6 +2001,14 @@ var q = class e {
|
|
|
1979
2001
|
senderLoaded: async () => {
|
|
1980
2002
|
await this.senderLoad;
|
|
1981
2003
|
},
|
|
2004
|
+
holdRecords: (e) => {
|
|
2005
|
+
this.holdingRecords = !0;
|
|
2006
|
+
try {
|
|
2007
|
+
return e();
|
|
2008
|
+
} finally {
|
|
2009
|
+
this.holdingRecords = !1;
|
|
2010
|
+
}
|
|
2011
|
+
},
|
|
1982
2012
|
allowed: (e) => this.allowed(e),
|
|
1983
2013
|
closeDelivery: () => this.closeDelivery(),
|
|
1984
2014
|
closeContext: () => {
|
|
@@ -2015,13 +2045,19 @@ var q = class e {
|
|
|
2015
2045
|
this.deliveryClosed = !1, await this.syncSender(), this.bus?.rotateContext();
|
|
2016
2046
|
},
|
|
2017
2047
|
endRotation: (e) => {
|
|
2018
|
-
this.rotating = e !== this.rotationSeq
|
|
2048
|
+
if (this.rotating = e !== this.rotationSeq, this.rotating) {
|
|
2049
|
+
this.dropHeldRecords();
|
|
2050
|
+
return;
|
|
2051
|
+
}
|
|
2052
|
+
let t = this.heldDiagnostics;
|
|
2053
|
+
this.heldDiagnostics = [];
|
|
2054
|
+
for (let e of t) this.recordDiagnostic(e);
|
|
2019
2055
|
},
|
|
2020
2056
|
route: (e) => {
|
|
2021
2057
|
this.route(e);
|
|
2022
2058
|
},
|
|
2023
2059
|
adopt: async (e) => {
|
|
2024
|
-
this.config.enabled ? await this.sender?.adopt(e, this.config.securityContext.id)
|
|
2060
|
+
!this.config.enabled || this.destroyed ? this.carried = [...e] : await this.sender?.adopt(e, this.config.securityContext.id);
|
|
2025
2061
|
}
|
|
2026
2062
|
};
|
|
2027
2063
|
}
|
|
@@ -2034,13 +2070,13 @@ var q = class e {
|
|
|
2034
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));
|
|
2035
2071
|
}
|
|
2036
2072
|
async debugBundle(e) {
|
|
2037
|
-
let { configSummary: t } = await import("./debug-bundle-
|
|
2073
|
+
let { configSummary: t } = await import("./debug-bundle-w78W46zr.js"), { record: n } = this.builder.build({
|
|
2038
2074
|
level: "INFO",
|
|
2039
2075
|
type: "system",
|
|
2040
2076
|
body: "debug bundle",
|
|
2041
|
-
namespace:
|
|
2042
|
-
payload: { [
|
|
2043
|
-
}, !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];
|
|
2044
2080
|
return {
|
|
2045
2081
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2046
2082
|
sdkVersion: this.sdkVersion,
|
|
@@ -2122,7 +2158,7 @@ var q = class e {
|
|
|
2122
2158
|
let { bus: i } = this, a = i?.getRole() === "forwarder", o = this.idle();
|
|
2123
2159
|
if (o) return o;
|
|
2124
2160
|
if (a) {
|
|
2125
|
-
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);
|
|
2126
2162
|
return s ? {
|
|
2127
2163
|
...s,
|
|
2128
2164
|
forwarded: r,
|
|
@@ -2134,10 +2170,10 @@ var q = class e {
|
|
|
2134
2170
|
});
|
|
2135
2171
|
}
|
|
2136
2172
|
let { sender: s } = this;
|
|
2137
|
-
return s ? K(await s.flushUntil(t)) : this.rotating ? K({ pending: n + this.waiting() }) :
|
|
2173
|
+
return s ? K(await s.flushUntil(t)) : this.rotating ? K({ pending: n + this.waiting() }) : Bn("complete", { dropped: n });
|
|
2138
2174
|
}
|
|
2139
2175
|
idle() {
|
|
2140
|
-
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() });
|
|
2141
2177
|
}
|
|
2142
2178
|
heldRecords() {
|
|
2143
2179
|
return this.bootBuffer.length + this.pendingRecords.length + this.forwardBuffer.length;
|
|
@@ -2155,10 +2191,10 @@ var q = class e {
|
|
|
2155
2191
|
else return this.diagnostics.guard("config.invalid", t, () => ({ ...e }));
|
|
2156
2192
|
}
|
|
2157
2193
|
flushTimeout(e) {
|
|
2158
|
-
let t = this.readOptions(e,
|
|
2159
|
-
if (!t) return
|
|
2194
|
+
let t = this.readOptions(e, Pn);
|
|
2195
|
+
if (!t) return ye;
|
|
2160
2196
|
let n = t.timeoutMs ?? 5e3;
|
|
2161
|
-
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);
|
|
2162
2198
|
}
|
|
2163
2199
|
};
|
|
2164
2200
|
k(q, "local", null);
|
|
@@ -2173,26 +2209,26 @@ function J(e, t, n = /* @__PURE__ */ new WeakMap()) {
|
|
|
2173
2209
|
}
|
|
2174
2210
|
// src/transport/worker-entry.ts
|
|
2175
2211
|
var Y;
|
|
2176
|
-
function
|
|
2212
|
+
function Hn(e = {}) {
|
|
2177
2213
|
if (Y) return Y;
|
|
2178
2214
|
let t = new V(e.onDiagnostic);
|
|
2179
2215
|
if (typeof document < "u" || typeof addEventListener != "function") return t.report("config.invalid", "Call serveTransportWorker() in a dedicated worker."), () => void 0;
|
|
2180
2216
|
let n = !1, r, i, a = (e) => {
|
|
2181
2217
|
t.guard("transport.http_error", "The transport worker could not read its connection.", () => {
|
|
2182
2218
|
let a = e.data;
|
|
2183
|
-
if (!D(a) || a.p !== "ui-observability.transport/1" || a.t !==
|
|
2219
|
+
if (!D(a) || a.p !== "ui-observability.transport/1" || a.t !== le.connect || e.ports.length === 0) return;
|
|
2184
2220
|
let o = e.ports[0];
|
|
2185
|
-
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) => {
|
|
2186
2222
|
n || (i = e.serveWorkerPort(o, t));
|
|
2187
2223
|
}).catch((e) => {
|
|
2188
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.", () => {
|
|
2189
|
-
o.postMessage(
|
|
2225
|
+
o.postMessage(De), o.close();
|
|
2190
2226
|
});
|
|
2191
2227
|
}));
|
|
2192
2228
|
});
|
|
2193
2229
|
}, o = () => {
|
|
2194
2230
|
n || (n = !0, Y = void 0, removeEventListener("message", a), i?.(), t.guard("transport.http_error", "The transport service could not close its port.", () => {
|
|
2195
|
-
r?.postMessage(
|
|
2231
|
+
r?.postMessage(De);
|
|
2196
2232
|
}), t.guard("transport.http_error", "The transport port could not close.", () => {
|
|
2197
2233
|
r?.close();
|
|
2198
2234
|
}));
|
|
@@ -2200,7 +2236,7 @@ function Vn(e = {}) {
|
|
|
2200
2236
|
return addEventListener("message", a), Y = o, o;
|
|
2201
2237
|
}
|
|
2202
2238
|
// src/transport/memory-transport.ts
|
|
2203
|
-
function
|
|
2239
|
+
function Un() {
|
|
2204
2240
|
let e = [], t = [], n = { status: 200 };
|
|
2205
2241
|
return {
|
|
2206
2242
|
transport: (r) => (e.push(r), n.status >= 200 && n.status < 300 && t.push(r), Promise.resolve({ ...n })),
|
|
@@ -2222,16 +2258,16 @@ var X = /* @__PURE__ */ new Map();
|
|
|
2222
2258
|
function Z() {
|
|
2223
2259
|
return (q.current() ?? q.stopped()) || q.configure({}, !0);
|
|
2224
2260
|
}
|
|
2225
|
-
function
|
|
2261
|
+
function Wn(e) {
|
|
2226
2262
|
q.configure(e), Q();
|
|
2227
2263
|
}
|
|
2228
|
-
function
|
|
2264
|
+
function Gn(e) {
|
|
2229
2265
|
Z().setConfigurationLocked(e);
|
|
2230
2266
|
}
|
|
2231
|
-
function
|
|
2267
|
+
function Kn(e, t) {
|
|
2232
2268
|
return Z().rotateSecurityContext(e, t);
|
|
2233
2269
|
}
|
|
2234
|
-
async function
|
|
2270
|
+
async function qn() {
|
|
2235
2271
|
let e = Z();
|
|
2236
2272
|
return Q(), {
|
|
2237
2273
|
...await e.health(),
|
|
@@ -2241,8 +2277,8 @@ async function Kn() {
|
|
|
2241
2277
|
}
|
|
2242
2278
|
};
|
|
2243
2279
|
}
|
|
2244
|
-
async function
|
|
2245
|
-
let e = await
|
|
2280
|
+
async function Jn() {
|
|
2281
|
+
let e = await qn();
|
|
2246
2282
|
return Z().debugBundle(e);
|
|
2247
2283
|
}
|
|
2248
2284
|
function Q() {
|
|
@@ -2253,125 +2289,125 @@ function Q() {
|
|
|
2253
2289
|
}
|
|
2254
2290
|
return t;
|
|
2255
2291
|
}
|
|
2256
|
-
function
|
|
2292
|
+
function Yn(e, t) {
|
|
2257
2293
|
let n = Q();
|
|
2258
2294
|
if (t || n === 0) return new B(Z, e, t);
|
|
2259
2295
|
let r = X.get(e);
|
|
2260
2296
|
return r ??= new B(Z, e), X.delete(e), X.set(e, r), Q(), r;
|
|
2261
2297
|
}
|
|
2262
2298
|
function $() {
|
|
2263
|
-
return
|
|
2299
|
+
return Yn("app");
|
|
2264
2300
|
}
|
|
2265
|
-
function
|
|
2301
|
+
function Xn(e, t) {
|
|
2266
2302
|
$().trace(e, t);
|
|
2267
2303
|
}
|
|
2268
|
-
function
|
|
2304
|
+
function Zn(e, t) {
|
|
2269
2305
|
$().debug(e, t);
|
|
2270
2306
|
}
|
|
2271
|
-
function
|
|
2307
|
+
function Qn(e, t) {
|
|
2272
2308
|
$().info(e, t);
|
|
2273
2309
|
}
|
|
2274
|
-
function
|
|
2310
|
+
function $n(e, t) {
|
|
2275
2311
|
$().warn(e, t);
|
|
2276
2312
|
}
|
|
2277
|
-
function
|
|
2313
|
+
function er(e, t, n) {
|
|
2278
2314
|
$().error(e, t, n);
|
|
2279
2315
|
}
|
|
2280
|
-
function
|
|
2316
|
+
function tr(e, t, n) {
|
|
2281
2317
|
$().fatal(e, t, n);
|
|
2282
2318
|
}
|
|
2283
|
-
function
|
|
2319
|
+
function nr(e, t) {
|
|
2284
2320
|
$().logAction(e, t);
|
|
2285
2321
|
}
|
|
2286
|
-
function
|
|
2322
|
+
function rr(e, t) {
|
|
2287
2323
|
$().logEvent(e, t);
|
|
2288
2324
|
}
|
|
2289
|
-
function
|
|
2290
|
-
q.current()?.diagnostics.report("config.invalid",
|
|
2291
|
-
}
|
|
2292
|
-
function ir(e, t = {}) {
|
|
2293
|
-
return Vt(e, t, (e, t, n) => {
|
|
2294
|
-
Z().recordMetric(e, t, n);
|
|
2295
|
-
}, rr);
|
|
2325
|
+
function ir(e) {
|
|
2326
|
+
q.current()?.diagnostics.report("config.invalid", v, void 0, e);
|
|
2296
2327
|
}
|
|
2297
2328
|
function ar(e, t = {}) {
|
|
2298
2329
|
return Ht(e, t, (e, t, n) => {
|
|
2299
2330
|
Z().recordMetric(e, t, n);
|
|
2300
|
-
},
|
|
2331
|
+
}, ir);
|
|
2301
2332
|
}
|
|
2302
2333
|
function or(e, t = {}) {
|
|
2303
2334
|
return Ut(e, t, (e, t, n) => {
|
|
2304
2335
|
Z().recordMetric(e, t, n);
|
|
2305
|
-
},
|
|
2336
|
+
}, ir);
|
|
2306
2337
|
}
|
|
2307
|
-
function sr(e, t) {
|
|
2338
|
+
function sr(e, t = {}) {
|
|
2339
|
+
return Wt(e, t, (e, t, n) => {
|
|
2340
|
+
Z().recordMetric(e, t, n);
|
|
2341
|
+
}, ir);
|
|
2342
|
+
}
|
|
2343
|
+
function cr(e, t) {
|
|
2308
2344
|
return Z().startMeasure(e, t);
|
|
2309
2345
|
}
|
|
2310
|
-
function
|
|
2346
|
+
function lr(e, t, n) {
|
|
2311
2347
|
let r = Z();
|
|
2312
|
-
return
|
|
2348
|
+
return Nt(r.startMeasure(e, n), t, r.diagnostics);
|
|
2313
2349
|
}
|
|
2314
|
-
function
|
|
2350
|
+
function ur() {
|
|
2315
2351
|
Z().setReplay(!0);
|
|
2316
2352
|
}
|
|
2317
|
-
function
|
|
2353
|
+
function dr() {
|
|
2318
2354
|
Z().setReplay(!1);
|
|
2319
2355
|
}
|
|
2320
|
-
var
|
|
2356
|
+
var fr = {
|
|
2321
2357
|
probe: (e, t) => j().probe(e, t, q.current()?.diagnostics),
|
|
2322
2358
|
time: (e, t) => j().time(e, t, q.current()?.diagnostics)
|
|
2323
2359
|
};
|
|
2324
|
-
function
|
|
2360
|
+
function pr(e, t) {
|
|
2325
2361
|
Z().addBreadcrumb(e, t);
|
|
2326
2362
|
}
|
|
2327
|
-
function
|
|
2363
|
+
function mr(e) {
|
|
2328
2364
|
let t = Z();
|
|
2329
2365
|
D(e) ? t.diagnostics.guard("record.sanitize_failed", "The library could not read the values of setContext().", () => {
|
|
2330
2366
|
t.context.merge(e);
|
|
2331
2367
|
}) : t.diagnostics.report("config.invalid", "setContext() takes an object. The library keeps the current context.");
|
|
2332
2368
|
}
|
|
2333
|
-
function
|
|
2369
|
+
function hr(e) {
|
|
2334
2370
|
Z().context.remove(e);
|
|
2335
2371
|
}
|
|
2336
|
-
function
|
|
2372
|
+
function gr(e, t) {
|
|
2337
2373
|
return Z().journey.start(e, t);
|
|
2338
2374
|
}
|
|
2339
|
-
function
|
|
2375
|
+
function _r() {
|
|
2340
2376
|
Z().journey.end();
|
|
2341
2377
|
}
|
|
2342
|
-
function
|
|
2378
|
+
function vr() {
|
|
2343
2379
|
return Z().journey.current();
|
|
2344
2380
|
}
|
|
2345
|
-
function
|
|
2381
|
+
function yr() {
|
|
2346
2382
|
return Z().journey.getToken();
|
|
2347
2383
|
}
|
|
2348
|
-
function
|
|
2384
|
+
function br(e) {
|
|
2349
2385
|
return Z().journey.adopt(e, "manual", !0);
|
|
2350
2386
|
}
|
|
2351
|
-
function
|
|
2387
|
+
function xr(e, t) {
|
|
2352
2388
|
return Z().registerWorker(e, t);
|
|
2353
2389
|
}
|
|
2354
|
-
function
|
|
2390
|
+
function Sr(e, t) {
|
|
2355
2391
|
return Z().registerFrame(e, t);
|
|
2356
2392
|
}
|
|
2357
|
-
function
|
|
2393
|
+
function Cr() {
|
|
2358
2394
|
Z().tracing.rotate("explicit");
|
|
2359
2395
|
}
|
|
2360
|
-
function
|
|
2396
|
+
function wr() {
|
|
2361
2397
|
return Z().tracing.headers();
|
|
2362
2398
|
}
|
|
2363
|
-
function
|
|
2399
|
+
function Tr(e) {
|
|
2364
2400
|
return Z().flush(e);
|
|
2365
2401
|
}
|
|
2366
|
-
function
|
|
2402
|
+
function Er() {
|
|
2367
2403
|
Z().newSession();
|
|
2368
2404
|
}
|
|
2369
|
-
function
|
|
2405
|
+
function Dr() {
|
|
2370
2406
|
return Z().diagnostics.snapshot();
|
|
2371
2407
|
}
|
|
2372
|
-
async function
|
|
2408
|
+
async function Or(e) {
|
|
2373
2409
|
await (q.current() ?? q.stopped())?.destroy(e);
|
|
2374
2410
|
}
|
|
2375
|
-
export {
|
|
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 };
|
|
2376
2412
|
|
|
2377
2413
|
//# sourceMappingURL=index.js.map
|