After completing the Flutter Monitoring Setup, use this guide to configure additional agent capabilities. Each section is independent and can be enabled as needed.

Control the Sampling Rate

To manage the volume of data sent to Atatus, set a session sampling rate. The value is a percentage between 0.0 and 100.0, and defaults to 100.0 (every session is kept). Values outside that range are clamped. For example, the following configuration retains 80% of sessions:

SDK Configuration Options

AtatusConfiguration holds the settings that apply to the whole SDK. licenseKey, env, and appName are required. Everything else has a default:
version matters for symbolication. If you upload Flutter symbols or an Android mapping file, the version here must match the version used in the upload, or stack traces are not deobfuscated.
AtatusConfiguration also accepts sessionPersistence, trackSessionsAcrossSubdomains, useSecureSessionCookie, and usePartitionedCrossSiteSessionCookie. These apply to Flutter Web only and have no effect on Android.

RUM Configuration Options

AtatusRumConfiguration accepts the following options. All of them are optional:
sessionSamplingRate, traceSampleRate, and longTaskThreshold are clamped to their valid ranges, so a value outside the range is corrected rather than rejected.

Manual Initialization and Error Tracking

By default, the SDK is initialized using the AtatusSdk.runApp wrapper which wraps the Flutter runApp execution. Alternatively, you can initialize the SDK manually. This is useful if you need to run custom asynchronous initialization logic before starting the SDK, or if you want to set up custom error boundaries. To initialize Atatus manually:
  1. Call WidgetsFlutterBinding.ensureInitialized() first.
  2. Initialize the SDK using AtatusSdk.instance.initialize(...).
  3. Capture unhandled Flutter framework errors using FlutterError.onError.
  4. Capture asynchronous platform errors using PlatformDispatcher.instance.onError.

Customizing Route and View Names

To customize screen names as they appear in the RUM dashboard, or to assign custom attributes to specific routes, use a custom ViewInfoExtractor callback. This is especially helpful if routes use obfuscated class names or dynamic parameters that you wish to standardize.

Using ViewInfoExtractor

Define a route extractor function that inspects the dynamic route and returns a customized RumViewInfo object. You can fall back to the default behavior using defaultViewInfoExtractor(route) for other routes:

Overriding View Info with RouteAware Mixins

For widgets that implement the standard Flutter RouteAware observer lifecycle, you can mix in the AtatusRouteAwareMixin on the widget’s State to override the reported name directly inside the view code:

Custom Action Labels

For custom widgets where the RumUserActionDetector cannot infer a meaningful label, annotate the widget with a description using RumUserActionAnnotation. This ensures the action appears with a human-readable name in the Atatus dashboard:

Track User Sessions

Adding user information to your RUM sessions enables you to follow the journey of a specific user, identify which users are most affected by errors, and monitor performance for your most important users. Use setUserInfo to associate an identity with all RUM events in the current session:
The following attributes are available on all RUM events after this call: To clear user information (for example, on sign-out), call clearUserInfo:
setUserInfo requires a non-null id, so it cannot be used to clear the user. Use clearUserInfo instead. Clearing also empties the user attribute on the active session and view. To keep the user on events already collected, stop the session with AtatusSdk.instance.rum?.stopSession() or the view with stopView before clearing.

Add Custom User Attributes

You can attach additional custom attributes to the user session. These attributes are automatically applied to all subsequent RUM events, logs, and traces:
To remove an existing attribute, set its value to null:
You can also pass these attributes when you set the user, using the extraInfo parameter of setUserInfo.

Track Accounts

For business-to-business applications, you can record the account a user belongs to, alongside the user identity:

Set Custom Global Attributes

To attach contextual metadata to every RUM event emitted by the SDK, use global attributes. These are useful for filtering and grouping data in the Atatus dashboard, for example by feature flag, A/B test variant, or store identifier.
To scope attributes to the current view instead of the whole session, use addViewAttribute, addViewAttributes, removeViewAttribute, and removeViewAttributes:

Manually Track User Actions

The RumUserActionDetector widget captures common tap interactions automatically. For interactions it cannot detect, such as programmatic triggers, long presses, or scroll events, use manual action tracking.

Instantaneous Actions

For discrete actions (taps, clicks), use addAction:

Continuous Actions

For time-bound actions (scrolls, swipes), use startAction and stopAction:
When using startAction and stopAction, the type parameter must be the same in both calls for the SDK to match the start and end of the action.

Manually Track Custom Resources

In addition to the automatic resource tracking provided by the Dio interceptor and the Atatus Tracking HTTP Client, you can manually track network requests or third-party API calls that are not covered by automatic instrumentation.
If the resource request fails, report the error using stopResourceWithErrorInfo, which takes a message and an error type:
If you are holding the caught Exception, pass it to stopResourceWithError instead:
The key string must be unique for each resource and must be the same in the startResource and corresponding stopResource, stopResourceWithErrorInfo, or stopResourceWithError calls.
The resourceKey string must be unique for each resource and must be the same in the startResource and corresponding stopResource or stopResourceWithError calls.

Custom Performance Timings

Measure custom performance milestones within a view using addTiming. The timing is recorded relative to the start of the current RUM view, making it ideal for tracking content render times, hero image loads, or any application-specific milestone.
After the timing is set, it is accessible as @view.custom_timings.<timing_name> (for example, @view.custom_timings.hero_image). Use these values to create custom measures and visualizations in the Atatus dashboard.

Track Feature Flags

Record which variant of a feature flag a user saw, so you can compare errors and performance between variants:
The evaluation is attached to the current view and to the events collected in it.

Track Feature Operations

Feature operations measure a business workflow that can succeed or fail, such as a checkout or an onboarding flow:
The failure reason is one of RumFeatureOperationFailureReason.error (an error during execution), .abandoned (the user or process gave up), or .other. Pass operationKey when several instances of the same operation can run at once, and attributes to attach context to the operation.

Manual View Tracking

The AtatusNavigationObserver cannot see every kind of navigation, such as a custom navigator or a widget that swaps content in place. In those cases, start and stop views yourself:
The key must be the same in both calls. If you omit the name, the key is used as the view name.

Stop the Current Session

Use stopSession to end the active RUM session. The next user interaction starts a new one. This is useful at sign-out, when you want the next session to be attributed to a different user:

Modify or Drop RUM Events

To modify the attributes of a RUM event before it is sent to Atatus, or to drop an event entirely, use Event Mappers during SDK configuration. Each mapper is a function with the signature (T) → T? where T is a concrete RUM event type. Returning null from a mapper drops the event.
Important: The view event mapper must not return null. Returning null from the error, resource, or action mappers drops the event entirely, so it is not sent to Atatus.
The following event properties can be modified:

Retrieve the RUM Session ID

Retrieving the current RUM session ID is helpful for troubleshooting. You can attach it to support tickets, bug reports, or internal logs to correlate user-reported issues with the corresponding session in the Atatus dashboard.

Clear All Data

Use clearAllData to wipe all locally queued data that has not yet been transmitted to Atatus. This is useful for implementing user data deletion requests or clearing state after a user logs out.

Track Work in a Background Isolate

The SDK is initialized in your root isolate. Work running in a background isolate does not see it, so requests and errors from there are not reported until you attach:
Call this inside the background isolate, after the SDK has been initialized in your root isolate.
If Atatus has not finished initializing in the root isolate when you call this, the call fails silently. Nothing is reported from the isolate and no error is logged, so initialize first and attach second.

Attach to an Existing Native SDK

If your Flutter code runs inside an existing Android application that already initializes the native Atatus SDK, do not initialize the SDK again from Dart. Attach to the running instance instead:
AtatusAttachConfiguration covers only the Dart side of the SDK. Settings that belong to the native SDK, such as the license key, the environment, and the sample rate, keep the values the host application set. Logs and RUM are enabled on the Dart side only if the native SDK already has them enabled.

Extend the SDK with Plugins

Plugins let a package hook into the SDK lifecycle. The network integrations use this mechanism, which is why enableHttpTracking() is a call on the configuration rather than on the SDK. Add a plugin when you build your configuration:
Retrieve a plugin later by its type:
To write one, implement AtatusPluginConfiguration with a create method that returns your AtatusPlugin. The plugin’s initialize method runs once the SDK is ready, and shutdown runs when it stops.
Only one plugin of each runtime type is allowed. Adding a second of the same type is ignored, and an error is logged.

Flutter-Specific Performance Metrics

To enable the collection of Flutter-specific rendering metrics, meaning widget build times and raster (frame render) times, set reportFlutterPerformance to true on AtatusRumConfiguration. These metrics are displayed in the Mobile Vitals section of the Atatus dashboard.

Session Replay

Session Replay records what the user saw and did, and links the recording to its RUM session. It ships as a separate package, atatus_session_replay, and is enabled with enableSessionReplay on your AtatusConfiguration:
Replay also needs a SessionReplayCapture widget at the root of your widget tree. For the full setup, the privacy levels, and per-widget masking, see Flutter Session Replay.

Log Correlation

The Atatus SDK supports sending structured log messages from your Flutter application and correlating them with RUM sessions. When log correlation is enabled, each log entry is automatically linked to the active RUM view and session, providing full context during incident investigation. For detailed setup instructions, see Flutter Log Collection. To comply with GDPR and similar data protection regulations, the SDK requires a tracking consent value at initialization. Three values are available:
  • TrackingConsent.pending: the SDK collects and batches data locally but does not transmit it until consent is updated.
  • TrackingConsent.granted: the SDK collects data and transmits it to Atatus.
  • TrackingConsent.notGranted: the SDK does not collect any data.
Update the consent value at any time after initialization:

Sending Data When the Device Is Offline

RUM data is batched and stored locally on the device when no network connection is available. The SDK uploads all stored data automatically once connectivity is restored. No additional configuration is required. This ensures complete data capture regardless of network conditions.