This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Configure Expo Observe
Edit page
Control how Expo Observe collects and dispatches metrics, including environment settings, development mode, custom endpoints, and data ingestion.
Configure Expo Observe at runtime to fit your app's build setup, environment, and data routing. This page covers enabling metrics in development, sampling, ignoring selected metrics and events, using a custom endpoint, separating data by environment, and turning off data ingestion from the dashboard. For the runtime methods themselves, see the configure() and dispatchEvents() API references.
Sampling
By default, every installation dispatches its metrics. For high-volume apps, you can sample a fraction of installations by setting sampleRate to a value between 0 and 1:
import { Observe } from 'expo-observe'; // Dispatch metrics from ~25% of installations. Observe.configure({ sampleRate: 0.25, });
The sampling decision is deterministic per installation. Each installation is either permanently in-sample or out-of-sample for a given rate, so the choice is stable across app launches and you get a consistent slice of installations rather than a random subset of sessions.
A few details worth knowing:
- Values outside the
[0, 1]range are clamped to the nearest edge.0always drops;1always dispatches. - Out-of-sample devices drop pending metrics rather than accumulating them. Lowering the rate later does not retroactively send earlier sessions.
- Sampling depends on
dispatchingEnabled. IfdispatchingEnabledisfalse, nothing is dispatched regardless ofsampleRate.
Sample errors separately
To keep more errors than other events, set errorSampleRate. Errors include unhandled JavaScript errors, errors from reportError and ObserveErrorBoundary, and native crash reports. All other events follow sampleRate:
import { Observe } from 'expo-observe'; // Dispatch metrics from ~3% of installations, and errors from all installations. Observe.configure({ sampleRate: 0.03, errorSampleRate: 1, });
errorSampleRate is a minimum. Installations in-sample for sampleRate always send errors. A lower value has no effect, and configure() prints a warning. An unset sampleRate counts as 1.
Ignore metrics and events
If you don't use some metrics or events, skip them with ignoredMetrics and ignoredEvents to send less data:
import { Observe } from 'expo-observe'; Observe.configure({ ignoredMetrics: ['expo.app_startup.tti'], ignoredEvents: ['reanimated.warning', 'checkout.completed'], });
ignoredMetrics matches metric names such as expo.app_startup.tti. ignoredEvents matches event names, including custom names passed to Observe.logEvent. Ignored data is still recorded on the device but never sent.
Enable metrics in development
By default, metrics collected from debug builds are not dispatched. To dispatch them anyway (for example, while testing your Expo Observe integration), set dispatchInDebug to true when calling configure():
import { Observe } from 'expo-observe'; Observe.configure({ dispatchInDebug: true, });
A build is treated as a debug build if either the native app is a debug build or the JS bundle is a development bundle (__DEV__ is true). This detection is independent of the environment value (see Environments).
dispatchInDebug has no effect on release builds, which always dispatch (subject to dispatchingEnabled and sampleRate). If dispatchingEnabled is false, nothing dispatches regardless of dispatchInDebug. sampleRate and errorSampleRate also apply in debug builds.
Enable this only when testing your Expo Observe integration. Development/debug performance differs significantly from production, so collecting development/debug metrics may distort the results shown in your dashboard.
Custom endpoint
Expo Observe sends data using the OpenTelemetry Protocol (OTLP) over HTTP with a JSON payload. It posts metrics to <endpointUrl>/<project-id>/v1/metrics and logs to <endpointUrl>/<project-id>/v1/logs, where <project-id> is your Expo Services project ID. This means you can set endpointUrl to an OpenTelemetry-compatible backend or an OpenTelemetry Collector to route your observability data there.
To change the endpoint, set the endpointUrl value in your app config:
The endpoint URL is baked into the native layer of the app at build time, so changing it requires regenerating native code. After updating your app config, run npx expo prebuild and create a new build to apply the change.
The path includes your project ID before the standard /v1/metrics and /v1/logs OTLP paths. If your backend expects the standard OTLP path without that prefix, send the data to an OpenTelemetry Collector that receives it and re-exports it to your backend.
Environments
All metrics are grouped by environment. The environment value is derived from process.env.NODE_ENV by default (falling back to 'production' if unset). To override it, use configure({ environment }).
The environment is a metadata tag attached to each metric and is independent of how the bundle was built. To control whether debug-build metrics are dispatched, see Enable metrics in development. To disable all dispatching globally, use configure({ dispatchingEnabled: false }).
Network traces
Network traces require SDK 58 and later.
Completed network requests can be recorded as trace spans. Recording is off by default, because each span counts toward your event quota. Turn it on with:
import { Observe } from 'expo-observe'; Observe.configure({ networkTraces: true });
Pass an object to record only the requests you care about. Hosts match exactly and case-insensitively, so subdomains are not implied. An omitted field matches every request, and an empty array matches none:
Observe.configure({ networkTraces: { filter: { hosts: ['api.myapp.com'], methods: ['GET', 'POST'] } }, });
The object form records unless you say otherwise, so set enabled: false to keep a filter configured while recording nothing.
A request that is turned off or filtered out never reaches the local database, so nothing is stored and nothing is exported. The setting applies to future requests, so spans recorded earlier in the launch are still sent. It also persists across launches, so requests observed before configure runs on the next launch follow the last value you set.
Because the value persists, removing the option takes effect the next time configure runs, not immediately. The same applies to a narrow hosts list: it keeps suppressing early-startup requests until a configure widens it.
URLs are redacted before they are stored. A username and password in the URL are replaced with REDACTED, as are the query parameters AWSAccessKeyId, Signature, sig, X-Amz-Signature, X-Amz-Credential, X-Amz-Security-Token, and X-Goog-Signature. A secret in any other query parameter is stored as-is.
Turn off data ingestion
The options above control what your app sends. You can also stop Expo Observe from accepting data on the server side, without shipping an app update, using the Observe data ingestion toggle in the Expo dashboard:
- Account level: open Account settings and turn off Observe data ingestion. This pauses ingestion for all projects in the account.
- Project level: open Project settings and turn off Observe data ingestion. This pauses ingestion for that project only.
While ingestion is paused, Expo Observe does not accept events, metrics, or logs sent by your apps. Data that was already ingested stays available in the dashboard and the CLI. Turn the toggle back on to resume ingestion.