Control the Sampling Rate
To manage the volume of data sent to Atatus, set a session sampling rate. The value is a percentage between0.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 theAtatusSdk.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:
- Call
WidgetsFlutterBinding.ensureInitialized()first. - Initialize the SDK using
AtatusSdk.instance.initialize(...). - Capture unhandled Flutter framework errors using
FlutterError.onError. - 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 customViewInfoExtractor 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 customizedRumViewInfo 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 FlutterRouteAware 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 theRumUserActionDetector 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. UsesetUserInfo to associate an identity with all RUM events in the current session:
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:null:
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.addViewAttribute, addViewAttributes, removeViewAttribute, and removeViewAttributes:
Manually Track User Actions
TheRumUserActionDetector 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), useaddAction:
Continuous Actions
For time-bound actions (scrolls, swipes), usestartAction 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.stopResourceWithErrorInfo, which takes a message and an error type:
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 usingaddTiming. 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.
@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:Track Feature Operations
Feature operations measure a business workflow that can succeed or fail, such as a checkout or an onboarding flow: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
TheAtatusNavigationObserver 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:
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
UsestopSession 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.
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
UseclearAllData 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: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 whyenableHttpTracking() is a call on the configuration rather than on the SDK.
Add a plugin when you build your configuration:
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, setreportFlutterPerformance 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:
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.Set Tracking Consent (GDPR)
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.