@nathanclaire/edge-telemetry-sdk 4.0.0 → 5.0.1
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/LICENSE +21 -0
- package/README.md +185 -30
- package/dist/appLifecycle-DS_fEclk.cjs +2 -0
- package/dist/appLifecycle-DS_fEclk.cjs.map +1 -0
- package/dist/{appLifecycle-DQErzJIR.js → appLifecycle-PffQ4vC1.js} +5 -3
- package/dist/appLifecycle-PffQ4vC1.js.map +1 -0
- package/dist/autoTaps.native-By9I4Kr2.cjs +2 -0
- package/dist/autoTaps.native-By9I4Kr2.cjs.map +1 -0
- package/dist/autoTaps.native-DQCXevD7.js +66 -0
- package/dist/autoTaps.native-DQCXevD7.js.map +1 -0
- package/dist/crashHandler.web-6KvedEB-.cjs +2 -0
- package/dist/crashHandler.web-6KvedEB-.cjs.map +1 -0
- package/dist/crashHandler.web-BUlSXYoS.js +30 -0
- package/dist/crashHandler.web-BUlSXYoS.js.map +1 -0
- package/dist/crashHandlerNative.native-CFVQ5UcO.cjs +2 -0
- package/dist/crashHandlerNative.native-CFVQ5UcO.cjs.map +1 -0
- package/dist/{crashHandlerNative.native-FupMnr1U.js → crashHandlerNative.native-DsCRd-oN.js} +13 -13
- package/dist/crashHandlerNative.native-DsCRd-oN.js.map +1 -0
- package/dist/deviceInfo.native-D5gNBG7m.cjs +2 -0
- package/dist/{deviceInfo.native-BoeTZcD6.cjs.map → deviceInfo.native-D5gNBG7m.cjs.map} +1 -1
- package/dist/deviceInfo.native-DiiHrnI3.js +53 -0
- package/dist/{deviceInfo.native-BJ-3Jj1T.js.map → deviceInfo.native-DiiHrnI3.js.map} +1 -1
- package/dist/{deviceInfo.web-BFB1-pcA.js → deviceInfo.web-BHsjVveq.js} +3 -3
- package/dist/{deviceInfo.web-BFB1-pcA.js.map → deviceInfo.web-BHsjVveq.js.map} +1 -1
- package/dist/{deviceInfo.web-3L3IDQQA.cjs → deviceInfo.web-DGCUHAnv.cjs} +2 -2
- package/dist/{deviceInfo.web-3L3IDQQA.cjs.map → deviceInfo.web-DGCUHAnv.cjs.map} +1 -1
- package/dist/deviceState.native-BEysbZ6O.js +58 -0
- package/dist/deviceState.native-BEysbZ6O.js.map +1 -0
- package/dist/deviceState.native-CrQMy11_.cjs +2 -0
- package/dist/deviceState.native-CrQMy11_.cjs.map +1 -0
- package/dist/deviceState.web-ByaQm9Ry.js +14 -0
- package/dist/deviceState.web-ByaQm9Ry.js.map +1 -0
- package/dist/deviceState.web-CSfUgHDU.cjs +2 -0
- package/dist/deviceState.web-CSfUgHDU.cjs.map +1 -0
- package/dist/frameTracker-9j0en6Zm.cjs +2 -0
- package/dist/frameTracker-9j0en6Zm.cjs.map +1 -0
- package/dist/{frameTracker-DdB8W_kC.js → frameTracker-BzXnxSkb.js} +18 -19
- package/dist/frameTracker-BzXnxSkb.js.map +1 -0
- package/dist/{httpAttributes-BrrtM8zh.js → httpAttributes-BWXOr4eP.js} +1 -1
- package/dist/{httpAttributes-BrrtM8zh.js.map → httpAttributes-BWXOr4eP.js.map} +1 -1
- package/dist/{httpAttributes-D0m6UID7.cjs → httpAttributes-COY0_kiF.cjs} +1 -1
- package/dist/{httpAttributes-D0m6UID7.cjs.map → httpAttributes-COY0_kiF.cjs.map} +1 -1
- package/dist/index.native.cjs +1 -1
- package/dist/index.native.cjs.map +1 -1
- package/dist/index.native.d.ts +1 -1
- package/dist/index.native.js +128 -71
- package/dist/index.native.js.map +1 -1
- package/dist/index.web.cjs +1 -1
- package/dist/index.web.cjs.map +1 -1
- package/dist/index.web.d.ts +1 -1
- package/dist/index.web.js +51 -38
- package/dist/index.web.js.map +1 -1
- package/dist/{interactionWeb.web-CJAviVQ7.js → interactionWeb.web-BWBjmovb.js} +8 -8
- package/dist/{interactionWeb.web-CJAviVQ7.js.map → interactionWeb.web-BWBjmovb.js.map} +1 -1
- package/dist/interactionWeb.web-CKDJLD9r.cjs +2 -0
- package/dist/{interactionWeb.web-Bl_cZlgh.cjs.map → interactionWeb.web-CKDJLD9r.cjs.map} +1 -1
- package/dist/{interceptFetchWeb.web-UXC2Lb6X.js → interceptFetchWeb.web-DjSR_Rft.js} +18 -17
- package/dist/interceptFetchWeb.web-DjSR_Rft.js.map +1 -0
- package/dist/interceptFetchWeb.web-ZHw6IQkU.cjs +2 -0
- package/dist/{interceptFetchWeb.web-UXC2Lb6X.js.map → interceptFetchWeb.web-ZHw6IQkU.cjs.map} +1 -1
- package/dist/{interceptHttpNative.native-BVpFuoNB.cjs → interceptHttpNative.native-C5scIcgY.cjs} +2 -2
- package/dist/{interceptHttpNative.native-BVpFuoNB.cjs.map → interceptHttpNative.native-C5scIcgY.cjs.map} +1 -1
- package/dist/{interceptHttpNative.native-rX-lPNST.js → interceptHttpNative.native-vF_Fksjk.js} +2 -2
- package/dist/{interceptHttpNative.native-rX-lPNST.js.map → interceptHttpNative.native-vF_Fksjk.js.map} +1 -1
- package/dist/{loadingTime-Bhomd9qq.cjs → loadingTime-Cj5Oh8lT.cjs} +1 -1
- package/dist/{loadingTime-Bhomd9qq.cjs.map → loadingTime-Cj5Oh8lT.cjs.map} +1 -1
- package/dist/{loadingTime-ZkYvFijA.js → loadingTime-DMc0zTY8.js} +1 -1
- package/dist/{loadingTime-ZkYvFijA.js.map → loadingTime-DMc0zTY8.js.map} +1 -1
- package/dist/memoryNative.native-CK3QFVjY.cjs +2 -0
- package/dist/memoryNative.native-CK3QFVjY.cjs.map +1 -0
- package/dist/{memoryNative.native-C42h9SjK.js → memoryNative.native-DkA6f7id.js} +12 -12
- package/dist/memoryNative.native-DkA6f7id.js.map +1 -0
- package/dist/nativeSender-Dt1HLaLi.js +37 -0
- package/dist/nativeSender-Dt1HLaLi.js.map +1 -0
- package/dist/nativeSender-hCgUa7Vz.cjs +2 -0
- package/dist/nativeSender-hCgUa7Vz.cjs.map +1 -0
- package/dist/navigationRef-CVIv0aIK.js +30 -0
- package/dist/navigationRef-CVIv0aIK.js.map +1 -0
- package/dist/navigationRef-CfIbeXX8.cjs +2 -0
- package/dist/navigationRef-CfIbeXX8.cjs.map +1 -0
- package/dist/navigationWeb.web-CRHpr5zl.js +51 -0
- package/dist/navigationWeb.web-CRHpr5zl.js.map +1 -0
- package/dist/navigationWeb.web-DwWjL80b.cjs +2 -0
- package/dist/navigationWeb.web-DwWjL80b.cjs.map +1 -0
- package/dist/{networkChange-CUO1hRLj.cjs → networkChange-2FGIQM-N.cjs} +2 -2
- package/dist/networkChange-2FGIQM-N.cjs.map +1 -0
- package/dist/{networkChange-D39hdSb0.js → networkChange-QA0893vW.js} +2 -2
- package/dist/networkChange-QA0893vW.js.map +1 -0
- package/dist/networkInfo.native-CcJ3JVRF.js +31 -0
- package/dist/networkInfo.native-CcJ3JVRF.js.map +1 -0
- package/dist/networkInfo.native-whB2wf6a.cjs +2 -0
- package/dist/networkInfo.native-whB2wf6a.cjs.map +1 -0
- package/dist/{networkInfo.web-B2YlLNsI.js → networkInfo.web-CcUpXMUK.js} +2 -2
- package/dist/networkInfo.web-CcUpXMUK.js.map +1 -0
- package/dist/{networkInfo.web-PltJTHsy.cjs → networkInfo.web-DfO-BUFx.cjs} +2 -2
- package/dist/networkInfo.web-DfO-BUFx.cjs.map +1 -0
- package/dist/react-bqe7KPOf.cjs +4 -0
- package/dist/react-bqe7KPOf.cjs.map +1 -0
- package/dist/react-urNtDGTL.js +413 -0
- package/dist/react-urNtDGTL.js.map +1 -0
- package/dist/runtimeReady.native-CxFl1rQR.js +35 -0
- package/dist/runtimeReady.native-CxFl1rQR.js.map +1 -0
- package/dist/runtimeReady.native-zueSbsEv.cjs +2 -0
- package/dist/runtimeReady.native-zueSbsEv.cjs.map +1 -0
- package/dist/{runtimeReady.web-C8fdIbVR.js → runtimeReady.web-JuE239Tg.js} +2 -2
- package/dist/{runtimeReady.web-C8fdIbVR.js.map → runtimeReady.web-JuE239Tg.js.map} +1 -1
- package/dist/{runtimeReady.web-DHW682RN.cjs → runtimeReady.web-vhAJFU61.cjs} +2 -2
- package/dist/{runtimeReady.web-DHW682RN.cjs.map → runtimeReady.web-vhAJFU61.cjs.map} +1 -1
- package/dist/{seedRuntimeReady-Cz8nOKoo.js → seedRuntimeReady-BlRdf3pR.js} +2 -2
- package/dist/{seedRuntimeReady-Cz8nOKoo.js.map → seedRuntimeReady-BlRdf3pR.js.map} +1 -1
- package/dist/seedRuntimeReady-CbjqbWCd.cjs +2 -0
- package/dist/{seedRuntimeReady-BKwkBEAF.cjs.map → seedRuntimeReady-CbjqbWCd.cjs.map} +1 -1
- package/dist/src/adapters/appLifecycle.d.ts +3 -3
- package/dist/src/adapters/batch.d.ts +44 -0
- package/dist/src/adapters/crashCapture.d.ts +5 -1
- package/dist/src/adapters/deviceState.d.ts +9 -0
- package/dist/src/adapters/frameAggregate.d.ts +15 -13
- package/dist/src/adapters/frameTracker.d.ts +1 -1
- package/dist/src/adapters/hangDetector.d.ts +41 -0
- package/dist/src/adapters/manualSpans.d.ts +41 -0
- package/dist/src/adapters/native/autoTaps.native.d.ts +15 -0
- package/dist/src/adapters/native/deviceState.native.d.ts +15 -0
- package/dist/src/adapters/native/memoryNative.native.d.ts +3 -3
- package/dist/src/adapters/native/networkInfo.native.d.ts +1 -1
- package/dist/src/adapters/native/runtimeReady.native.d.ts +16 -0
- package/dist/src/adapters/navigationRef.d.ts +17 -9
- package/dist/src/adapters/networkChange.d.ts +2 -2
- package/dist/src/adapters/traceManager.d.ts +18 -5
- package/dist/src/adapters/uiInteraction.d.ts +1 -1
- package/dist/src/adapters/viewManager.d.ts +24 -8
- package/dist/src/adapters/web/deviceState.web.d.ts +10 -0
- package/dist/src/adapters/web/navigationWeb.web.d.ts +6 -10
- package/dist/src/adapters/web/webVitals.web.d.ts +7 -0
- package/dist/src/adapters/xhrIntercept.d.ts +2 -0
- package/dist/src/core/breadcrumbs.d.ts +10 -0
- package/dist/src/core/telemetry.d.ts +139 -29
- package/dist/src/core/userProfile.d.ts +7 -0
- package/dist/src/createTelemetry.native.d.ts +3 -1
- package/dist/src/createTelemetry.web.d.ts +2 -1
- package/dist/src/golden.helper.d.ts +4 -0
- package/dist/src/index.base.d.ts +80 -6
- package/dist/src/index.native.d.ts +4 -61
- package/dist/src/index.web.d.ts +4 -51
- package/dist/src/react.d.ts +45 -0
- package/dist/src/telemetryNative.native.d.ts +79 -0
- package/dist/src/telemetryWeb.web.d.ts +59 -0
- package/dist/{store.native-TPqXngmF.cjs → store.native-BbS76uWV.cjs} +1 -1
- package/dist/{store.native-TPqXngmF.cjs.map → store.native-BbS76uWV.cjs.map} +1 -1
- package/dist/{store.native-BYBJcy6o.js → store.native-MlWyGgBp.js} +1 -1
- package/dist/{store.native-BYBJcy6o.js.map → store.native-MlWyGgBp.js.map} +1 -1
- package/dist/{store.web-CvqqN-_Z.cjs → store.web-BzKaP57Z.cjs} +1 -1
- package/dist/{store.web-CvqqN-_Z.cjs.map → store.web-BzKaP57Z.cjs.map} +1 -1
- package/dist/{store.web-DJAlN0nc.js → store.web-rhh0NOfs.js} +1 -1
- package/dist/{store.web-DJAlN0nc.js.map → store.web-rhh0NOfs.js.map} +1 -1
- package/dist/telemetry-60sfWkh0.js +1754 -0
- package/dist/telemetry-60sfWkh0.js.map +1 -0
- package/dist/telemetry-CW63glwb.cjs +2 -0
- package/dist/telemetry-CW63glwb.cjs.map +1 -0
- package/dist/{uiInteraction-DAqxxz0q.js → uiInteraction-BIDOMcrL.js} +39 -34
- package/dist/{uiInteraction-DAqxxz0q.js.map → uiInteraction-BIDOMcrL.js.map} +1 -1
- package/dist/uiInteraction-DxlwCVSn.cjs +2 -0
- package/dist/{uiInteraction-CdzvEI1p.cjs.map → uiInteraction-DxlwCVSn.cjs.map} +1 -1
- package/dist/{viewport-Dd85GUNO.cjs → viewport-9JcVIXYF.cjs} +1 -1
- package/dist/{viewport-Dd85GUNO.cjs.map → viewport-9JcVIXYF.cjs.map} +1 -1
- package/dist/{viewport-Dzmt5QwK.js → viewport-GWTEBt2K.js} +1 -1
- package/dist/{viewport-Dzmt5QwK.js.map → viewport-GWTEBt2K.js.map} +1 -1
- package/dist/{web-vitals.attribution-CVCPiX-h.cjs → web-vitals.attribution-DAvBvdng.cjs} +1 -1
- package/dist/{web-vitals.attribution-CVCPiX-h.cjs.map → web-vitals.attribution-DAvBvdng.cjs.map} +1 -1
- package/dist/{web-vitals.attribution-xw9N5MKQ.js → web-vitals.attribution-DcoMtvlY.js} +1 -1
- package/dist/{web-vitals.attribution-xw9N5MKQ.js.map → web-vitals.attribution-DcoMtvlY.js.map} +1 -1
- package/dist/webSender-DA087xb5.cjs +2 -0
- package/dist/webSender-DA087xb5.cjs.map +1 -0
- package/dist/webSender-g4rs5TIg.js +44 -0
- package/dist/webSender-g4rs5TIg.js.map +1 -0
- package/dist/{webVitals.web-CNIpsKlA.js → webVitals.web-DRTDK6s5.js} +39 -24
- package/dist/webVitals.web-DRTDK6s5.js.map +1 -0
- package/dist/webVitals.web-DvScDIjX.cjs +2 -0
- package/dist/webVitals.web-DvScDIjX.cjs.map +1 -0
- package/dist/{xhrIntercept-BNiA41Mj.js → xhrIntercept-9uAkQh3N.js} +16 -14
- package/dist/xhrIntercept-9uAkQh3N.js.map +1 -0
- package/dist/xhrIntercept-xG1Yl5RI.cjs +2 -0
- package/dist/xhrIntercept-xG1Yl5RI.cjs.map +1 -0
- package/docs/migration-v4.md +1 -1
- package/docs/migration-v5.md +178 -0
- package/package.json +12 -4
- package/dist/appLifecycle-CECgRVu_.cjs +0 -2
- package/dist/appLifecycle-CECgRVu_.cjs.map +0 -1
- package/dist/appLifecycle-DQErzJIR.js.map +0 -1
- package/dist/batch-CwoO7noL.js +0 -56
- package/dist/batch-CwoO7noL.js.map +0 -1
- package/dist/batch-DNu8Xr9T.cjs +0 -2
- package/dist/batch-DNu8Xr9T.cjs.map +0 -1
- package/dist/crashCapture-BOJ8nSAZ.cjs +0 -4
- package/dist/crashCapture-BOJ8nSAZ.cjs.map +0 -1
- package/dist/crashCapture-BW8WuyaU.js +0 -70
- package/dist/crashCapture-BW8WuyaU.js.map +0 -1
- package/dist/crashHandler.web-8F_k2veo.js +0 -29
- package/dist/crashHandler.web-8F_k2veo.js.map +0 -1
- package/dist/crashHandler.web-CWmF56mJ.cjs +0 -2
- package/dist/crashHandler.web-CWmF56mJ.cjs.map +0 -1
- package/dist/crashHandlerNative.native-C2kSikDt.cjs +0 -2
- package/dist/crashHandlerNative.native-C2kSikDt.cjs.map +0 -1
- package/dist/crashHandlerNative.native-FupMnr1U.js.map +0 -1
- package/dist/deviceInfo.native-BJ-3Jj1T.js +0 -53
- package/dist/deviceInfo.native-BoeTZcD6.cjs +0 -2
- package/dist/frameTracker-CHG6sIx9.cjs +0 -2
- package/dist/frameTracker-CHG6sIx9.cjs.map +0 -1
- package/dist/frameTracker-DdB8W_kC.js.map +0 -1
- package/dist/index-BtLlV1HA.js +0 -57
- package/dist/index-BtLlV1HA.js.map +0 -1
- package/dist/index-C2XQ-EYw.js +0 -1122
- package/dist/index-C2XQ-EYw.js.map +0 -1
- package/dist/index-CXsVZY35.cjs +0 -2
- package/dist/index-CXsVZY35.cjs.map +0 -1
- package/dist/index-DLquF88M.cjs +0 -2
- package/dist/index-DLquF88M.cjs.map +0 -1
- package/dist/interactionWeb.web-Bl_cZlgh.cjs +0 -2
- package/dist/interceptFetchWeb.web-T88kO-bE.cjs +0 -2
- package/dist/interceptFetchWeb.web-T88kO-bE.cjs.map +0 -1
- package/dist/memoryNative.native-C42h9SjK.js.map +0 -1
- package/dist/memoryNative.native-CA-7w9w1.cjs +0 -2
- package/dist/memoryNative.native-CA-7w9w1.cjs.map +0 -1
- package/dist/memoryStore-BIGZmmfD.cjs +0 -2
- package/dist/memoryStore-BIGZmmfD.cjs.map +0 -1
- package/dist/memoryStore-F5I-GQKM.js +0 -193
- package/dist/memoryStore-F5I-GQKM.js.map +0 -1
- package/dist/nativeSender-CfQaRuDK.cjs +0 -2
- package/dist/nativeSender-CfQaRuDK.cjs.map +0 -1
- package/dist/nativeSender-pgVSIv-X.js +0 -59
- package/dist/nativeSender-pgVSIv-X.js.map +0 -1
- package/dist/navigationRef-BzYbs8cm.js +0 -28
- package/dist/navigationRef-BzYbs8cm.js.map +0 -1
- package/dist/navigationRef-C-_qhb43.cjs +0 -2
- package/dist/navigationRef-C-_qhb43.cjs.map +0 -1
- package/dist/navigationTracker-BmywA_Bg.js +0 -19
- package/dist/navigationTracker-BmywA_Bg.js.map +0 -1
- package/dist/navigationTracker-HkwVyywz.cjs +0 -2
- package/dist/navigationTracker-HkwVyywz.cjs.map +0 -1
- package/dist/navigationWeb.web-CW_z7Ca4.cjs +0 -2
- package/dist/navigationWeb.web-CW_z7Ca4.cjs.map +0 -1
- package/dist/navigationWeb.web-CcwgKuIZ.js +0 -55
- package/dist/navigationWeb.web-CcwgKuIZ.js.map +0 -1
- package/dist/networkChange-CUO1hRLj.cjs.map +0 -1
- package/dist/networkChange-D39hdSb0.js.map +0 -1
- package/dist/networkInfo.native-CGrx9cnH.js +0 -343
- package/dist/networkInfo.native-CGrx9cnH.js.map +0 -1
- package/dist/networkInfo.native-YVySdv3S.cjs +0 -2
- package/dist/networkInfo.native-YVySdv3S.cjs.map +0 -1
- package/dist/networkInfo.web-B2YlLNsI.js.map +0 -1
- package/dist/networkInfo.web-PltJTHsy.cjs.map +0 -1
- package/dist/runtimeReady.native-Bh7EcYmK.js +0 -14
- package/dist/runtimeReady.native-Bh7EcYmK.js.map +0 -1
- package/dist/runtimeReady.native-jUmuE1lV.cjs +0 -2
- package/dist/runtimeReady.native-jUmuE1lV.cjs.map +0 -1
- package/dist/seedRuntimeReady-BKwkBEAF.cjs +0 -2
- package/dist/src/adapters/navigationTracker.d.ts +0 -6
- package/dist/src/adapters/screenTiming.d.ts +0 -15
- package/dist/telemetry-ByDJIz_9.js +0 -1280
- package/dist/telemetry-ByDJIz_9.js.map +0 -1
- package/dist/telemetry-CrU7i1Jc.cjs +0 -2
- package/dist/telemetry-CrU7i1Jc.cjs.map +0 -1
- package/dist/uiInteraction-CdzvEI1p.cjs +0 -2
- package/dist/webSender-BIwslfpT.js +0 -63
- package/dist/webSender-BIwslfpT.js.map +0 -1
- package/dist/webSender-CVtE4sOF.cjs +0 -2
- package/dist/webSender-CVtE4sOF.cjs.map +0 -1
- package/dist/webVitals.web-CNIpsKlA.js.map +0 -1
- package/dist/webVitals.web-DpWJ-iYp.cjs +0 -2
- package/dist/webVitals.web-DpWJ-iYp.cjs.map +0 -1
- package/dist/xhrIntercept-BADex6Cq.cjs +0 -2
- package/dist/xhrIntercept-BADex6Cq.cjs.map +0 -1
- package/dist/xhrIntercept-BNiA41Mj.js.map +0 -1
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/** #167's bounds on one crumb, so 20 of them cannot blow `app.crash`'s budget. */
|
|
2
|
+
export declare const CRUMB_NAME_MAX = 64;
|
|
3
|
+
export declare const CRUMB_DATA_KEYS = 8;
|
|
4
|
+
/**
|
|
5
|
+
* A crumb, bounded: `name` capped at 64, the first 8 `data` keys kept, each value by the
|
|
6
|
+
* `user.custom.*` bag rule (primitive as itself, else stringified; capped at 255; dropped if it
|
|
7
|
+
* cannot be stringified). `name` and `timestamp` are set last, so `data` cannot rename the crumb.
|
|
8
|
+
* No `category`, no `level` — a crumb is a name and a little context.
|
|
9
|
+
*/
|
|
10
|
+
export declare function boundCrumb(name: unknown, data?: Record<string, unknown>, at?: Date): Record<string, unknown>;
|
|
1
11
|
/**
|
|
2
12
|
* Fixed-size ring buffer of recent actions, attached to `app.crash` as the
|
|
3
13
|
* JSON-stringified `crash.breadcrumbs` (last N, oldest evicted first). See #28.
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { ScreenTimingTracker } from '../adapters/screenTiming';
|
|
2
1
|
import { ViewManager, ViewNameSource } from '../adapters/viewManager';
|
|
3
2
|
import { TraceManager } from '../adapters/traceManager';
|
|
3
|
+
import { HangDetector } from '../adapters/hangDetector';
|
|
4
|
+
import { OpenSpan, TaskOutcome } from '../adapters/manualSpans';
|
|
4
5
|
import { ErrorSource } from '../adapters/crashCapture';
|
|
5
6
|
import { Store } from './store';
|
|
6
7
|
import { BeforeSend } from './beforeSend';
|
|
7
8
|
import { Orientation } from '../adapters/viewport';
|
|
8
9
|
export type { BeforeSend } from './beforeSend';
|
|
9
10
|
export type { Orientation };
|
|
10
|
-
/** `sdk.drop_reason` (§11). `rejected`
|
|
11
|
+
/** `sdk.drop_reason` (§11). `rejected` is a 4xx-dropped batch (§2.5, #162). */
|
|
11
12
|
export type DropReason = "queue_full" | "store_full" | "rejected";
|
|
12
13
|
/**
|
|
13
14
|
* §4.7's two error names. Both book `sdk.error_count` and `view.error_count` — a closed
|
|
@@ -21,8 +22,8 @@ export declare function evictIndex(events: TelemetryEvent[]): number;
|
|
|
21
22
|
export declare const DEVICE_ID_KEY = "telemetry_device_id";
|
|
22
23
|
/** Store key for the resumable session record (#92). */
|
|
23
24
|
export declare const SESSION_KEY = "telemetry_session";
|
|
24
|
-
/**
|
|
25
|
-
export type SessionReason = "launch" | "
|
|
25
|
+
/** Why a session started/ended. `launch` is internal only — it ships as no `session.reason` (catalogue #179). */
|
|
26
|
+
export type SessionReason = "launch" | "timeout" | "max_duration" | "manual";
|
|
26
27
|
export type SessionEndReason = Exclude<SessionReason, "launch">;
|
|
27
28
|
/**
|
|
28
29
|
* §4.6's mint/emit split, for the one event that has one. A `ui.interaction` is emitted
|
|
@@ -90,6 +91,18 @@ export interface MemoryHandler {
|
|
|
90
91
|
/** Torn down by `shutdown()`: unlike the rAF-driven trackers this one owns a timer. */
|
|
91
92
|
stop?(): void;
|
|
92
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* #173's device state. `battery()` is synchronous on purpose — a cached last read — so no
|
|
96
|
+
* failure row ever awaits a native call. Native implements all of it; web only `accessibility`.
|
|
97
|
+
*/
|
|
98
|
+
export interface DeviceStateHandler {
|
|
99
|
+
battery?(): Record<string, number | boolean>;
|
|
100
|
+
refresh?(): Promise<void>;
|
|
101
|
+
start?(): void;
|
|
102
|
+
stop?(): void;
|
|
103
|
+
/** Read once per session, onto `session.started`. A failed read omits only its own key. */
|
|
104
|
+
accessibility(): Promise<Record<string, number | boolean>>;
|
|
105
|
+
}
|
|
93
106
|
export interface NavigationHandler {
|
|
94
107
|
start(): Promise<void>;
|
|
95
108
|
}
|
|
@@ -106,11 +119,11 @@ export interface DeviceInfo {
|
|
|
106
119
|
model?: string;
|
|
107
120
|
manufacturer?: string;
|
|
108
121
|
brand?: string;
|
|
109
|
-
android_sdk?:
|
|
122
|
+
android_sdk?: number;
|
|
110
123
|
android_release?: string;
|
|
111
124
|
hardware?: string;
|
|
112
125
|
product?: string;
|
|
113
|
-
|
|
126
|
+
system_name?: string;
|
|
114
127
|
cpu_abi?: string;
|
|
115
128
|
low_ram?: boolean;
|
|
116
129
|
screen_density?: number;
|
|
@@ -121,20 +134,20 @@ export interface DeviceInfo {
|
|
|
121
134
|
}
|
|
122
135
|
export interface UserProfile {
|
|
123
136
|
userId?: string;
|
|
124
|
-
/** @deprecated Removed in
|
|
137
|
+
/** @deprecated Removed in v6 — use `identify({ name })`. Still the source of `user.name`. */
|
|
125
138
|
fullName?: string;
|
|
126
|
-
/** @deprecated Removed in
|
|
139
|
+
/** @deprecated Removed in v6 — never reached the wire; `identify()` could not set it. */
|
|
127
140
|
firstName?: string;
|
|
128
|
-
/** @deprecated Removed in
|
|
141
|
+
/** @deprecated Removed in v6 — never reached the wire; `identify()` could not set it. */
|
|
129
142
|
lastName?: string;
|
|
130
143
|
email?: string;
|
|
131
144
|
phone?: string;
|
|
132
|
-
/** @deprecated Removed in
|
|
145
|
+
/** @deprecated Removed in v6 — no column and no reader; `user.avatar` is off the wire (§3.4). */
|
|
133
146
|
avatar?: string;
|
|
134
147
|
customAttributes?: Record<string, any>;
|
|
135
|
-
/** @deprecated Removed in
|
|
148
|
+
/** @deprecated Removed in v6 — in-memory only, so it meant "first identify() this process" (§3.4). */
|
|
136
149
|
createdAt?: number;
|
|
137
|
-
/** @deprecated Removed in
|
|
150
|
+
/** @deprecated Removed in v6 — byte-identical to `createdAt` for any one-identify() app (§3.4). */
|
|
138
151
|
updatedAt?: number;
|
|
139
152
|
}
|
|
140
153
|
type Opts = {
|
|
@@ -148,13 +161,14 @@ type Opts = {
|
|
|
148
161
|
platform?: string;
|
|
149
162
|
traceLaunchStart?: number;
|
|
150
163
|
deviceInfoHandler?: DeviceInfoHandler;
|
|
164
|
+
deviceStateHandler?: DeviceStateHandler;
|
|
151
165
|
networkInfoHandler?: NetworkInfoHandler;
|
|
152
166
|
store?: Store;
|
|
153
167
|
beforeSend?: BeforeSend;
|
|
154
168
|
sessionSampleRate?: number;
|
|
155
169
|
traceHostAllowlist?: string[];
|
|
156
170
|
buildId?: string;
|
|
157
|
-
|
|
171
|
+
enabled?: boolean;
|
|
158
172
|
};
|
|
159
173
|
/**
|
|
160
174
|
* Telemetry core: queueing, batching, retries, auto-replay and session/user management.
|
|
@@ -168,8 +182,6 @@ export declare class Telemetry {
|
|
|
168
182
|
private intervalId;
|
|
169
183
|
private endpoint?;
|
|
170
184
|
private crashHandler?;
|
|
171
|
-
private navigationTracker?;
|
|
172
|
-
screens: ScreenTimingTracker;
|
|
173
185
|
readonly views: ViewManager;
|
|
174
186
|
readonly trace: TraceManager;
|
|
175
187
|
webInteractions?: {
|
|
@@ -177,10 +189,12 @@ export declare class Telemetry {
|
|
|
177
189
|
};
|
|
178
190
|
webVitals?: {
|
|
179
191
|
start(): Promise<void>;
|
|
192
|
+
stop(): void;
|
|
180
193
|
};
|
|
181
|
-
|
|
182
|
-
|
|
194
|
+
readonly hangs?: HangDetector;
|
|
195
|
+
readonly deviceState?: DeviceStateHandler;
|
|
183
196
|
private networkInfoHandler;
|
|
197
|
+
private networkStarted;
|
|
184
198
|
private deviceInfoHandler;
|
|
185
199
|
readonly store: Store;
|
|
186
200
|
private frameDropsHandler?;
|
|
@@ -214,6 +228,14 @@ export declare class Telemetry {
|
|
|
214
228
|
private dropReason?;
|
|
215
229
|
private crashPersistedThrough;
|
|
216
230
|
private appStartEmitted;
|
|
231
|
+
/** `app.start.js_ready_ms` (§4.3, #171) — native only; the entry's reader, run at emit. */
|
|
232
|
+
jsReadyMs?: () => number | undefined;
|
|
233
|
+
/** `app.start.duration_ms` (#179) — the entry's reader; resolves `undefined` when unknown. */
|
|
234
|
+
appStartMs?: () => Promise<number | undefined>;
|
|
235
|
+
private readonly spans;
|
|
236
|
+
private finalizing;
|
|
237
|
+
private enabled;
|
|
238
|
+
private pendingStart;
|
|
217
239
|
constructor(opts?: Opts);
|
|
218
240
|
/**
|
|
219
241
|
* §4.7 — report a handled error. Accepts `unknown` on purpose: half of real `catch`
|
|
@@ -234,16 +256,39 @@ export declare class Telemetry {
|
|
|
234
256
|
* Extend the breadcrumb trail without emitting anything. §4.7 demotes `console.warn` to
|
|
235
257
|
* exactly this — React's dev-mode warnings were the bulk of v3's `app.crash` volume.
|
|
236
258
|
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
* should `log()` an event, which extends the trail anyway.
|
|
259
|
+
* Also the public `addBreadcrumb()` (#167) — one path, so the SDK's own crumbs and the
|
|
260
|
+
* host's obey the same bounds (`boundCrumb`). Shows on `app.crash` and `app.hang`.
|
|
240
261
|
*/
|
|
241
262
|
addBreadcrumb(name: string, data?: Record<string, any>): void;
|
|
263
|
+
/**
|
|
264
|
+
* `startNewSession()` (#167) — logout/login. The same finalize + started pair as an idle
|
|
265
|
+
* or max-duration rotation, with `session.reason: manual` on both.
|
|
266
|
+
*/
|
|
267
|
+
startNewSession(): Promise<void>;
|
|
242
268
|
trackErrors(crashHandler: CrashHandler, options?: CrashHandlerOptions): void;
|
|
243
269
|
getDeviceInfo(deviceInfoHandler: DeviceInfoHandler): void;
|
|
270
|
+
/** Starts the network tracker once; later calls are no-ops, so listeners never stack. */
|
|
244
271
|
getNetworkInfo(networkInfoHandler: NetworkInfoHandler): void;
|
|
245
272
|
trackFrameDrops(frameDropsHandler: FrameDropsHandler): void;
|
|
246
273
|
trackNetworkRequests(networkHandler: NetworkHandler): void;
|
|
274
|
+
/** The offline replay and the flush timer — at construction, and again at each `enable()`. */
|
|
275
|
+
private startDelivery;
|
|
276
|
+
isEnabled(): boolean;
|
|
277
|
+
/**
|
|
278
|
+
* The consent kill-switch (#172). Synchronous: the flag is off before this returns. The
|
|
279
|
+
* in-memory queue, the offline store and the session record are dropped — an opt-out
|
|
280
|
+
* means nothing is sent **and nothing is kept**, open spans included — and every timer
|
|
281
|
+
* stops; the rAF loop keeps running but `logMetric` discards its samples. While off the
|
|
282
|
+
* network patches pass through untouched. `device.id` is kept: it is not telemetry, and
|
|
283
|
+
* minting a new one at re-consent would read as a new install.
|
|
284
|
+
*/
|
|
285
|
+
disable(): void;
|
|
286
|
+
/**
|
|
287
|
+
* Resume collection (#172) and run the lazy session-expiry check — a session can expire
|
|
288
|
+
* while disabled. A dark-started process announces its session here (`session.started`,
|
|
289
|
+
* unless a live record resumes) and never emits `app.start`.
|
|
290
|
+
*/
|
|
291
|
+
enable(): Promise<void>;
|
|
247
292
|
trackMemoryUsage(memoryHandler: MemoryHandler): void;
|
|
248
293
|
autoTrackNavigation(navigationHandler?: NavigationHandler): void;
|
|
249
294
|
/**
|
|
@@ -298,6 +343,20 @@ export declare class Telemetry {
|
|
|
298
343
|
* `session.start_time` before the fresh one takes over.
|
|
299
344
|
*/
|
|
300
345
|
private hydrateSession;
|
|
346
|
+
/**
|
|
347
|
+
* Another tab wrote the shared session record (#161, web's `storage` event). Two tabs keep
|
|
348
|
+
* their own in-memory `lastActivity`, so without this one can idle-expire a session the
|
|
349
|
+
* other is still using, or both can finalize the same `session.id`.
|
|
350
|
+
*
|
|
351
|
+
* Same id: fold in the other tab's progress — activity and the ordinals only ever move
|
|
352
|
+
* forward, so `max` is the merge. A different id is the other tab's rotation: this tab's
|
|
353
|
+
* live view is emitted under the session it belongs to, then the successor session is
|
|
354
|
+
* adopted **silently** — its `session.started` already shipped from the tab that rotated,
|
|
355
|
+
* and the retired one's `session.finalized` too, which is the whole point.
|
|
356
|
+
*
|
|
357
|
+
* Shared core, no platform branch: the entry decides what feeds it.
|
|
358
|
+
*/
|
|
359
|
+
adoptSessionRecord(raw: string | null | undefined): Promise<void>;
|
|
301
360
|
/**
|
|
302
361
|
* Which boundary, if any, the current session has crossed. Idle is checked first:
|
|
303
362
|
* when a long session has also gone quiet, the reason it ended is that the user left.
|
|
@@ -325,8 +384,28 @@ export declare class Telemetry {
|
|
|
325
384
|
* not the 6 idle hours that followed it.
|
|
326
385
|
*/
|
|
327
386
|
finalizeSession(reason: SessionEndReason): Promise<void>;
|
|
387
|
+
/** Every span frozen to the session being left ships `abandoned` under it — before the switch. */
|
|
388
|
+
private abandonSpans;
|
|
328
389
|
/** Begin a fresh session: new id/start, reset per-session counters, emit session.started. */
|
|
329
390
|
newSession(reason: SessionReason): Promise<void>;
|
|
391
|
+
/**
|
|
392
|
+
* Open a manual span — **synchronously**, so the trace keys, `view.id` and `session.id`
|
|
393
|
+
* freeze at the call (§3.1). Inert (`undefined`, reported through `debug()`) for a blank
|
|
394
|
+
* name or past 32 open spans; never throws. Refreshes `lastActivity` but is not an
|
|
395
|
+
* action: `view.action_count` counts `ui.interaction` only.
|
|
396
|
+
*
|
|
397
|
+
* On a session that has already expired the freeze waits for the rotation the start
|
|
398
|
+
* itself triggers, so a journey begun after a long idle belongs to the new session
|
|
399
|
+
* rather than being `abandoned` by the very next row.
|
|
400
|
+
*/
|
|
401
|
+
startSpan(name: unknown, attrs?: Record<string, unknown>, at?: number): OpenSpan | undefined;
|
|
402
|
+
/**
|
|
403
|
+
* Close a span by name and emit its one `task.complete`. An unknown or already-closed
|
|
404
|
+
* name is a no-op. With `only`, the close is a handle's, and a superseded handle cannot
|
|
405
|
+
* close the span that replaced it.
|
|
406
|
+
*/
|
|
407
|
+
endSpan(name: unknown, outcome?: TaskOutcome, attrs?: Record<string, unknown>, at?: number, only?: OpenSpan, reason?: unknown): Promise<void>;
|
|
408
|
+
private emitTask;
|
|
330
409
|
/** Boundary rotation: finalize the old session then start a fresh one (the pair). */
|
|
331
410
|
rotateSession(reason: SessionEndReason): Promise<void>;
|
|
332
411
|
/** Truncated at source (§3.2): the collector caps at 255 and we must not be the one over. */
|
|
@@ -409,6 +488,10 @@ export declare class Telemetry {
|
|
|
409
488
|
* Automatically attaches userId and sessionId to every queued event.
|
|
410
489
|
*/
|
|
411
490
|
log(name: string, data?: Record<string, any>, snapshot?: LogSnapshot): Promise<void>;
|
|
491
|
+
/** §2.5 4xx: drop the batch, book it, and tell a dev once — it is usually a wrong apiKey. */
|
|
492
|
+
private reject;
|
|
493
|
+
/** §2.5 429: halt the drain until `X-RateLimit-Reset`, 1 s when the header is absent. */
|
|
494
|
+
private holdFor;
|
|
412
495
|
/**
|
|
413
496
|
* The crash path (§2 / §9.4): persist the whole queue, then send **one** batch reordered
|
|
414
497
|
* so the crash rides in it. Not a drain — a dying process gets one round trip.
|
|
@@ -444,7 +527,7 @@ export declare class Telemetry {
|
|
|
444
527
|
* don't extend the breadcrumb trail and don't count as session activity — a periodic sampler
|
|
445
528
|
* (memory/frames) must not keep a session alive and defeat the 30-min idle rotation.
|
|
446
529
|
*/
|
|
447
|
-
logMetric(metricName: string, value: number, data?: Record<string, any
|
|
530
|
+
logMetric(metricName: string, value: number, data?: Record<string, any>, unitOverride?: string, hostName?: string): Promise<void>;
|
|
448
531
|
/**
|
|
449
532
|
* The single enqueue point: neither the sample decision nor `beforeSend` can be
|
|
450
533
|
* bypassed by a future emit path, and the hook runs *before* the queue — which is
|
|
@@ -473,10 +556,40 @@ export declare class Telemetry {
|
|
|
473
556
|
private recordDrop;
|
|
474
557
|
private flattenWithPrefix;
|
|
475
558
|
/**
|
|
476
|
-
*
|
|
559
|
+
* The public metric path (#167), sent as `custom.metric` with the host's name in
|
|
560
|
+
* `metric.name` (processor #41). The SDK's own names stay **reserved**, and no cap on distinct
|
|
561
|
+
* names. A non-finite value is dropped, never shipped as a fabricated number. `unit`
|
|
562
|
+
* becomes `metric.unit`, stamped after `data` so an attribute cannot mislabel it.
|
|
563
|
+
*/
|
|
564
|
+
recordMetric(name: string, value: number, data?: Record<string, any>, opts?: {
|
|
565
|
+
unit?: string;
|
|
566
|
+
}): Promise<void> | undefined;
|
|
567
|
+
/**
|
|
568
|
+
* §2.4's draining flush (#162): batches go **sequentially** until the queue is empty,
|
|
569
|
+
* stopping at the first failure, at most `DRAIN_MAX_BATCHES` per call and paced to the
|
|
570
|
+
* collector's 10 req/s burst. Sequential because parallel batches are how a cold backend
|
|
571
|
+
* gets stampeded by a replay. Retry + backoff live in the Sender (`sendWithRetry`).
|
|
572
|
+
*
|
|
573
|
+
* A call landing while a drain is in flight joins it rather than starting a second loop:
|
|
574
|
+
* the interval and the batch-full trigger both fire `flush()` unawaited, and two loops
|
|
575
|
+
* would interleave their sends and break the pacing.
|
|
477
576
|
*/
|
|
478
|
-
recordMetric(name: string, value: number, data?: Record<string, any>): Promise<void>;
|
|
479
577
|
flush(): Promise<void>;
|
|
578
|
+
private draining?;
|
|
579
|
+
/** Epoch ms before which no batch may be sent — a 429's `X-RateLimit-Reset` (§2.5). */
|
|
580
|
+
private holdUntil;
|
|
581
|
+
private drain;
|
|
582
|
+
/**
|
|
583
|
+
* §2.5's status table, for a batch the sender gave up on.
|
|
584
|
+
*
|
|
585
|
+
* | 4xx | dropped — no persist — booked `rejected`, one `__DEV__` warning per process |
|
|
586
|
+
* | 429 | requeued at the front; the drain halts until `X-RateLimit-Reset` |
|
|
587
|
+
* | 5xx / network | persisted through the sender, or requeued when it cannot persist |
|
|
588
|
+
*
|
|
589
|
+
* A wrong credential is the realistic 4xx, and persisting it would make it terminal: the
|
|
590
|
+
* drain halts at batch 1 on every launch forever while the store fills and evicts.
|
|
591
|
+
*/
|
|
592
|
+
private onSendFailure;
|
|
480
593
|
/**
|
|
481
594
|
* Book an acknowledged (2xx) batch. `session.sequence` orders a session's batches (#29),
|
|
482
595
|
* and it is persisted because a resumed session restarting at 0 would emit duplicate
|
|
@@ -487,13 +600,10 @@ export declare class Telemetry {
|
|
|
487
600
|
shutdown(): Promise<void>;
|
|
488
601
|
getEventCount(): number;
|
|
489
602
|
/**
|
|
490
|
-
* A route change
|
|
491
|
-
*
|
|
492
|
-
* touched `inst.screens`, so a React Navigation consumer emitted `navigation` on every
|
|
493
|
-
* route change and never a single `screen.duration`. Unifying them here is what fixes
|
|
494
|
-
* that, which is why a *deprecated* event starts firing where it never has.
|
|
603
|
+
* A route change (§4.5): rung 2 of the name ladder. The two deprecated feeds it used to
|
|
604
|
+
* emit alongside — `navigation` and `screen.duration` — are gone in v5 (#163).
|
|
495
605
|
*/
|
|
496
|
-
recordRouteChange(
|
|
606
|
+
recordRouteChange(to: string): Promise<void>;
|
|
497
607
|
/**
|
|
498
608
|
* Feed the name ladder (§4.5.1). Rungs 1 and 2 arrive unnormalized; rung 3's caller
|
|
499
609
|
* normalizes before calling. Whether this re-stamps the current view or mints a
|
|
@@ -5,6 +5,13 @@ export declare const PHONE_CAP = 50;
|
|
|
5
5
|
export declare const CUSTOM_MAX_KEYS = 64;
|
|
6
6
|
export declare const CUSTOM_KEY_CAP = 64;
|
|
7
7
|
export declare const CUSTOM_VALUE_CAP = 255;
|
|
8
|
+
/**
|
|
9
|
+
* A primitive rides as itself; anything else is stringified and truncated. A value that
|
|
10
|
+
* cannot be stringified — a cycle, a throwing `toJSON` — drops the key rather than the
|
|
11
|
+
* process. Consumer keys pass through **verbatim, casing included** (§4.10): the SDK
|
|
12
|
+
* imposes no normalization here, so an over-long key is dropped, never truncated.
|
|
13
|
+
*/
|
|
14
|
+
export declare function customValue(value: unknown): string | number | boolean | undefined;
|
|
8
15
|
/**
|
|
9
16
|
* The wire keys for `user.profile.update`. `user.id` is not here — it rides the Context
|
|
10
17
|
* block, where it is present on this event by construction.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TelemetryNative } from './
|
|
1
|
+
import { TelemetryNative } from './telemetryNative.native';
|
|
2
2
|
import { Store } from './core/store';
|
|
3
3
|
import { BeforeSend } from './core/beforeSend';
|
|
4
4
|
export type TelemetryOpts = {
|
|
@@ -14,6 +14,8 @@ export type TelemetryOpts = {
|
|
|
14
14
|
sessionSampleRate?: number;
|
|
15
15
|
traceHostAllowlist?: string[];
|
|
16
16
|
buildId?: string;
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
autoTrackTaps?: boolean;
|
|
17
19
|
};
|
|
18
20
|
export declare function assertApiKey(apiKey?: string): void;
|
|
19
21
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TelemetryWeb } from './
|
|
1
|
+
import { TelemetryWeb } from './telemetryWeb.web';
|
|
2
2
|
import { SyncStore } from './core/store';
|
|
3
3
|
import { BeforeSend } from './core/beforeSend';
|
|
4
4
|
export type TelemetryOpts = {
|
|
@@ -14,6 +14,7 @@ export type TelemetryOpts = {
|
|
|
14
14
|
sessionSampleRate?: number;
|
|
15
15
|
traceHostAllowlist?: string[];
|
|
16
16
|
buildId?: string;
|
|
17
|
+
enabled?: boolean;
|
|
17
18
|
};
|
|
18
19
|
export declare function assertApiKey(apiKey?: string): void;
|
|
19
20
|
/**
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TelemetryEvent } from './core/telemetry';
|
|
2
|
+
export declare const RAW_DIR = "test/raw";
|
|
3
|
+
/** Writes `batch<suffix>-<i>.json` per batch, after removing this build's files from a prior run. */
|
|
4
|
+
export declare function dumpRaw(batches: TelemetryEvent[][], suffix?: string): void;
|
package/dist/src/index.base.d.ts
CHANGED
|
@@ -1,19 +1,83 @@
|
|
|
1
|
+
import { Telemetry } from './core/telemetry';
|
|
2
|
+
import { TaskOutcome } from './adapters/manualSpans';
|
|
3
|
+
/** What `startSpan()` returns. `end()` is idempotent, never throws, and returns nothing to await. */
|
|
4
|
+
export type SpanHandle = {
|
|
5
|
+
/** `reason` becomes `task.failure_reason` on a `failed` end, and is ignored otherwise (#179). */
|
|
6
|
+
end(opts?: {
|
|
7
|
+
outcome?: TaskOutcome;
|
|
8
|
+
reason?: string;
|
|
9
|
+
attributes?: Record<string, unknown>;
|
|
10
|
+
}): void;
|
|
11
|
+
};
|
|
1
12
|
type ProfileInput = {
|
|
2
13
|
userId?: string;
|
|
3
|
-
/** @deprecated Removed in
|
|
14
|
+
/** @deprecated Removed in v6 — use `identify({ name })`. */
|
|
4
15
|
fullName?: string;
|
|
5
|
-
/** @deprecated Removed in
|
|
16
|
+
/** @deprecated Removed in v6 — never reaches the wire (§3.4). */
|
|
6
17
|
firstName?: string;
|
|
7
|
-
/** @deprecated Removed in
|
|
18
|
+
/** @deprecated Removed in v6 — never reaches the wire (§3.4). */
|
|
8
19
|
lastName?: string;
|
|
9
20
|
email?: string;
|
|
10
21
|
phone?: string;
|
|
11
|
-
/** @deprecated Removed in
|
|
22
|
+
/** @deprecated Removed in v6 — never reaches the wire (§3.4). */
|
|
12
23
|
avatar?: string;
|
|
13
24
|
customAttributes?: Record<string, any>;
|
|
14
25
|
};
|
|
15
26
|
export declare abstract class TelemetryBase {
|
|
16
27
|
protected instancePromise: Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* The resolved core, once `instancePromise` settles — set by each entry. The synchronous
|
|
30
|
+
* methods (`startSpan`, native `trackTap`) cannot afford an `await` before they read the
|
|
31
|
+
* world: the host navigates on the very next line (§4.6's mint/emit split). Before it is
|
|
32
|
+
* set they fall back to emit-time identity.
|
|
33
|
+
*/
|
|
34
|
+
protected resolved?: Telemetry;
|
|
35
|
+
/** Run `fn` against the core now if it is resolved, else once it is. Never throws or rejects. */
|
|
36
|
+
private now;
|
|
37
|
+
/**
|
|
38
|
+
* "This screen is usable now" (#171). Synchronous, no arguments: it marks the **current**
|
|
39
|
+
* view, so your name and the SDK's cannot disagree. The time is taken now; the view is
|
|
40
|
+
* chosen one macrotask later, so a mark from a new screen's mount effect lands on that
|
|
41
|
+
* screen even though the navigation that opened it settles behind it. The `view` row then
|
|
42
|
+
* carries `view.ready_time` and `view.ready_outcome`. First mark per view wins. Before init
|
|
43
|
+
* the mark is buffered and lands on the initial view.
|
|
44
|
+
*/
|
|
45
|
+
markScreenReady(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Stop collecting, and keep nothing: the queue, the offline store and the session record
|
|
48
|
+
* are dropped, every timer stops, and the network patches pass through untouched. The flag
|
|
49
|
+
* is off before this returns. Survives only this process — persist the user's choice
|
|
50
|
+
* yourself and construct with `enabled: false` next launch.
|
|
51
|
+
*/
|
|
52
|
+
disable(): void;
|
|
53
|
+
/** Resume collection. A session that expired while disabled rotates. */
|
|
54
|
+
enable(): void;
|
|
55
|
+
/** Ship your own number. `unit` → `metric.unit`. The SDK's metric names are reserved; a non-finite value is dropped. */
|
|
56
|
+
recordMetric(name: string, value: number, attributes?: Record<string, any>, opts?: {
|
|
57
|
+
unit?: string;
|
|
58
|
+
}): Promise<any>;
|
|
59
|
+
/** Add a step to the trail of 20 that rides `app.crash` and `app.hang`. Name ≤64, ≤8 data keys, values ≤255. */
|
|
60
|
+
addBreadcrumb(name: string, data?: Record<string, unknown>): Promise<void>;
|
|
61
|
+
/** End the current session and start a fresh one — e.g. on logout. `session.reason: manual`. */
|
|
62
|
+
startNewSession(): Promise<any>;
|
|
63
|
+
/**
|
|
64
|
+
* Time a journey: one `task.complete` row when the handle is ended. Synchronous — the
|
|
65
|
+
* trace keys, `view.id` and `session.id` freeze here. A span joins the live action's
|
|
66
|
+
* root, else mints a `custom` one; requests inside it parent to that root, not the span.
|
|
67
|
+
* Starting a name that is already open supersedes it. Blank names and a 33rd open span
|
|
68
|
+
* are inert. Misuse never throws.
|
|
69
|
+
*/
|
|
70
|
+
startSpan(name: string, attributes?: Record<string, unknown>): SpanHandle;
|
|
71
|
+
/**
|
|
72
|
+
* `startSpan` + `end` around `fn`, sync or async. A throw (or rejection) ends the span
|
|
73
|
+
* `failed` and is rethrown untouched — no `app.error` is emitted; your catch decides.
|
|
74
|
+
*/
|
|
75
|
+
withSpan<T>(name: string, fn: () => T, attributes?: Record<string, unknown>): T;
|
|
76
|
+
/**
|
|
77
|
+
* Close an open span by name — for a journey that ends in a different component. `reason`
|
|
78
|
+
* becomes `task.failure_reason` on a `failed` end (#179).
|
|
79
|
+
*/
|
|
80
|
+
endSpan(name: string, outcome?: TaskOutcome, attributes?: Record<string, unknown>, reason?: string): void;
|
|
17
81
|
log(event: string, data?: Record<string, any>): Promise<any>;
|
|
18
82
|
flush(): Promise<any>;
|
|
19
83
|
shutdown(): Promise<any>;
|
|
@@ -29,9 +93,19 @@ export declare abstract class TelemetryBase {
|
|
|
29
93
|
* There is no public path to `app.crash`, by design (#100).
|
|
30
94
|
*/
|
|
31
95
|
captureError(error: unknown, context?: Record<string, any>): Promise<any>;
|
|
32
|
-
|
|
96
|
+
/**
|
|
97
|
+
* `<EdgeErrorBoundary>`'s path (#166) — `app.error` with `error.source: boundary` and the
|
|
98
|
+
* component stack. Not for host code: `captureError()` is the public way to report.
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
captureBoundaryError(error: unknown, componentStack?: string | null): Promise<any>;
|
|
102
|
+
/**
|
|
103
|
+
* Wired per entry (#160): each build imports its own crash handler. Shared code importing
|
|
104
|
+
* the native one is what made the web build resolve it at runtime and reject.
|
|
105
|
+
*/
|
|
106
|
+
abstract trackErrors(options?: {
|
|
33
107
|
captureConsole?: boolean;
|
|
34
|
-
}): Promise<
|
|
108
|
+
}): Promise<void>;
|
|
35
109
|
setUserId(id: string): Promise<void>;
|
|
36
110
|
setUserProfile(profile: ProfileInput): Promise<void>;
|
|
37
111
|
setUserDetails(details: ProfileInput): Promise<void>;
|
|
@@ -1,65 +1,8 @@
|
|
|
1
|
-
import { TelemetryBase } from './index.base';
|
|
2
|
-
import { Store } from './core/store';
|
|
3
|
-
import { BeforeSend } from './core/beforeSend';
|
|
4
1
|
export { createTelemetry, type TelemetryOpts } from './createTelemetry.native';
|
|
2
|
+
export type { TelemetryNative } from './telemetryNative.native';
|
|
5
3
|
export type { Store, SyncStore, AsyncStore, StoreRead, StoreWrite } from './core/store';
|
|
6
4
|
export { memoryStore, type MemoryStoreOpts } from './core/memoryStore';
|
|
7
5
|
export type { BeforeSend } from './core/beforeSend';
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The resolved core, once `instancePromise` settles. `trackTap` is the one public method that
|
|
13
|
-
* cannot afford an `await` before it reads the world: the host's own press handler
|
|
14
|
-
* navigates on the very next line (§4.6's mint/emit split).
|
|
15
|
-
*/
|
|
16
|
-
private resolved?;
|
|
17
|
-
constructor(opts?: {
|
|
18
|
-
apiKey?: string;
|
|
19
|
-
sender?: any;
|
|
20
|
-
batchSize?: number;
|
|
21
|
-
flushIntervalMs?: number;
|
|
22
|
-
endpoint?: string;
|
|
23
|
-
captureConsole?: boolean;
|
|
24
|
-
debug?: boolean;
|
|
25
|
-
store?: Store;
|
|
26
|
-
beforeSend?: BeforeSend;
|
|
27
|
-
sessionSampleRate?: number;
|
|
28
|
-
traceHostAllowlist?: string[];
|
|
29
|
-
buildId?: string;
|
|
30
|
-
});
|
|
31
|
-
attachAppLifecycle(): Promise<void>;
|
|
32
|
-
getDeviceInfo(): Promise<any>;
|
|
33
|
-
getNetworkInfo(): Promise<any>;
|
|
34
|
-
trackFrameDrops(): Promise<any>;
|
|
35
|
-
trackNetworkRequests(): Promise<any>;
|
|
36
|
-
trackMemoryUsage(): Promise<any>;
|
|
37
|
-
screenStart(name: string): Promise<any>;
|
|
38
|
-
screenEnd(name: string): Promise<any>;
|
|
39
|
-
trackRoute(from: string, to: string): Promise<any>;
|
|
40
|
-
/**
|
|
41
|
-
* §4.6's native producer, explicit-only (#103). `interactionProps()` is gone with
|
|
42
|
-
* `user.interaction` (#102): it sat on the consumer's **root** `<View>`, where
|
|
43
|
-
* `PressEvent.nativeEvent.target` is a node tag number with no public API resolving it,
|
|
44
|
-
* so it could not tell a tap on a button from a tap on padding and every row it emitted
|
|
45
|
-
* was un-nameable. There is no role model to gate on and no DOM to derive from, so
|
|
46
|
-
* anything auto-derived here would be either wrong or a PII leak.
|
|
47
|
-
*
|
|
48
|
-
* `name` is web's rung 1 — explicit author intent — so it ships **unnormalized and
|
|
49
|
-
* uncapped**, and `ui.name_source` has exactly **two** values: `edge_action`, or `none`
|
|
50
|
-
* for a blank name, whose `ui.target` is `unnamed`. **`surface` never appears**: it only
|
|
51
|
-
* means something where role-less elements exist.
|
|
52
|
-
*
|
|
53
|
-
* ⚠ **The mint/emit split.** The row's `timestamp`, `view.id`, `view.name` and
|
|
54
|
-
* `session.id` are snapshotted **here, synchronously**, because the host's press handler
|
|
55
|
-
* navigates on the next line and the emit rides a promise. Stamping emit time would
|
|
56
|
-
* attribute a navigating tap to **the view it opened**, inverting every "which screen
|
|
57
|
-
* frustrates users" query. Before `instancePromise` settles there is no core to snapshot
|
|
58
|
-
* from, so a tap that early falls back to emit-time identity — the launch view either
|
|
59
|
-
* way.
|
|
60
|
-
*
|
|
61
|
-
* ⚠ **`ui.dead` is absent on every native row**, never `false`: with no DOM there is no
|
|
62
|
-
* mutation signal, so any dead-click *rate* must filter to the web build.
|
|
63
|
-
*/
|
|
64
|
-
trackTap(name: string): Promise<any>;
|
|
65
|
-
}
|
|
6
|
+
export type { SpanHandle } from './index.base';
|
|
7
|
+
export type { TaskOutcome } from './adapters/manualSpans';
|
|
8
|
+
export { EdgeErrorBoundary, useScreenReady, type EdgeErrorBoundaryProps } from './react';
|
package/dist/src/index.web.d.ts
CHANGED
|
@@ -1,55 +1,8 @@
|
|
|
1
|
-
import { TelemetryBase } from './index.base';
|
|
2
|
-
import { SyncStore } from './core/store';
|
|
3
|
-
import { BeforeSend } from './core/beforeSend';
|
|
4
1
|
export { createTelemetry, type TelemetryOpts } from './createTelemetry.web';
|
|
2
|
+
export type { TelemetryWeb } from './telemetryWeb.web';
|
|
5
3
|
export type { Store, SyncStore, AsyncStore, StoreRead, StoreWrite } from './core/store';
|
|
6
4
|
export { memoryStore, type MemoryStoreOpts } from './core/memoryStore';
|
|
7
5
|
export type { BeforeSend } from './core/beforeSend';
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
sender?: any;
|
|
12
|
-
batchSize?: number;
|
|
13
|
-
flushIntervalMs?: number;
|
|
14
|
-
endpoint?: string;
|
|
15
|
-
captureConsole?: boolean;
|
|
16
|
-
debug?: boolean;
|
|
17
|
-
store?: SyncStore;
|
|
18
|
-
beforeSend?: BeforeSend;
|
|
19
|
-
sessionSampleRate?: number;
|
|
20
|
-
traceHostAllowlist?: string[];
|
|
21
|
-
buildId?: string;
|
|
22
|
-
});
|
|
23
|
-
/**
|
|
24
|
-
* A bfcache restore resumes a frozen JS context, so the in-memory session survives on its
|
|
25
|
-
* own — but the freeze can have outlasted the idle window, and a sibling tab may have
|
|
26
|
-
* rotated the shared localStorage record while this one was suspended. Re-running the
|
|
27
|
-
* init decision against the Store is what reconciles both (#92, §4.2).
|
|
28
|
-
*/
|
|
29
|
-
private attachBfcacheRestore;
|
|
30
|
-
attachAppLifecycle(): Promise<void>;
|
|
31
|
-
trackErrors(options?: {
|
|
32
|
-
captureConsole?: boolean;
|
|
33
|
-
}): Promise<any>;
|
|
34
|
-
trackFrameDrops(): Promise<any>;
|
|
35
|
-
trackNetworkRequests(): Promise<any>;
|
|
36
|
-
/**
|
|
37
|
-
* §4.6/#102 — one capture-phase `click` listener on `document`. Auto-started, like every
|
|
38
|
-
* other capture: `ui.interaction` is what §6.2's interaction root hangs off, so a
|
|
39
|
-
* consumer forgetting to call it would leave every tap-driven request unattributed.
|
|
40
|
-
*/
|
|
41
|
-
trackInteractions(): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* §5.3/#106 — the five Core Web Vitals on the metric path, web only. Auto-started and
|
|
44
|
-
* deliberately not public API: there is nothing for a consumer to configure, and a vital
|
|
45
|
-
* that only fires if someone remembered to call a method is a vital nobody has.
|
|
46
|
-
*
|
|
47
|
-
* `web-vitals/attribution` is bundled, so this is the only import of it in the tree and
|
|
48
|
-
* `index.native` never reaches it. A failed chunk load is caught by the caller and costs
|
|
49
|
-
* the vitals, nothing else.
|
|
50
|
-
*/
|
|
51
|
-
private trackWebVitals;
|
|
52
|
-
autoTrackNavigation(): Promise<any>;
|
|
53
|
-
getDeviceInfo(): Promise<any>;
|
|
54
|
-
getNetworkInfo(): Promise<any>;
|
|
55
|
-
}
|
|
6
|
+
export type { SpanHandle } from './index.base';
|
|
7
|
+
export type { TaskOutcome } from './adapters/manualSpans';
|
|
8
|
+
export { EdgeErrorBoundary, useScreenReady, type EdgeErrorBoundaryProps } from './react';
|