references/setup.md · 24000
s collected from debug builds. No effect on release builds. |
| sampleRate | number | undefined (all installations) | Fraction of installations that dispatch, in [0, 1]. |
| errorHandlingEnabled | boolean | true | Record unhandled JS errors as exception events. |
| integrations | object | undefined | Opt in to expo-router, react-navigation, expo-image, react-native-reanimated, or a third-party integration. For expo-image and react-native-reanimated, see ./library-integrations.md. |
Network request monitoring is automatic and has no off switch. expo-observe observes URLSession traffic on iOS and OkHttpClient traffic on Android from launch, and attaches a rollup of the launch window to the TTI event — including the host of the slowest request (see ./metrics.md). Observe's own uploads are excluded. No configure() option disables it as of expo-observe 57.0.9, so treat request hosts as data that leaves the device.
Sampling is deterministic per installation: an installation is permanently in-sample or out-of-sample for a given rate, so the slice is stable across launches rather than a random subset of sessions. Out-of-sample installations drop pending metrics instead of accumulating them, so lowering the rate later does not retroactively send earlier sessions. Values outside [0, 1] are clamped. Sampling depends on dispatchingEnabled.
Manual flush. Events dispatch automatically when the app backgrounds — on Android through a background worker once connectivity returns, on iOS when the app resigns active or is about to terminate. Call await Observe.dispatchEvents() to flush early, which is mainly useful while testing.
Custom endpoint. EAS Observe sends OTLP over HTTP with a JSON payload, posting to <endpointUrl>/<project-id>/v1/metrics and <endpointUrl>/<project-id>/v1/logs. Point it at any OpenTelemetry-compatible backend or collector through the app config, not configure():
{ "expo": { "extra": { "eas": { "observe": { "endpointUrl": "https://your-endpoint.com" } } } } }
The URL is baked into the native layer at build time, so run npx expo prebuild and rebuild after changing it. If the backend expects standard OTLP paths without the project-ID prefix, route through a collector.
Quick checklist
- [ ] SDK ≥ 55, EAS project linked, development or production build (not Expo Go).
- [ ]
expo-observeinstalled vianpx expo install. - [ ] Root component exported through
AppMetricsRoot.wrap(...)(SDK 55) orObserveRoot.wrap(...)(SDK 56+). - [ ]
markInteractive()called from every entry screen once it is genuinely interactive — globalAppMetrics.markInteractive()on SDK 55, oruseObserve()hook on SDK 56+. - [ ] (Optional, SDK 56+) Per-route metrics enabled via
Observe.configure({ integrations: { ... } }), plus<ObserveNavigationContainer>(dynamic) or<ObserveNavigationProvider>(static) for React Navigation. - [ ] (Optional, SDK 57+) Sensitive route/query params listed in
filteredParams. - [ ] (Optional, SDK 56+) User-defined events emitted via
Observe.logEvent(name, { attributes })with stable, lowercase, dot-separated names and no PII. - [ ] (Optional) Library problem reports enabled via
integrations: { 'expo-image': true }(SDK 57+) orintegrations: { 'react-native-reanimated': true }(SDK 58+, Reanimated 4.7.0+), with noconfigureReanimatedLoggercall in the app. See./library-integrations.md. - [ ] (Optional, SDK 57+)
<ObserveErrorBoundary>(orerrorBoundaryFallbackonObserveRoot) around risky subtrees,Observe.reportErrorin recovery paths,"uploadSourceMaps": truein theeas.jsonbuild profile, andeas update --upload-source-mapswhen publishing updates. - [ ] New build produced with
eas buildand metrics visible in the Observe dashboard.