[Alpha] Install the Splunk RUM Flutter agent
Use the Splunk RUM Flutter agent to instrument your Flutter applications.
Alpha features described in this document are provided by Splunk to you "as is" without any warranties, maintenance and support, or service-level commitments. Splunk makes this alpha feature available in its sole discretion and may discontinue it at any time. These documents are not yet publicly available and we ask that you keep such information confidential. Use of alpha features is subject to the Splunk Pre-Release Agreement for Hosted Services.
Alpha documentation links
Use these links to navigate through the documentation for this alpha release. These links aren't visible in the left nav.
Summary
With Splunk Real User Monitoring (RUM), you can gain insight about the performance and health of your front-end user application. To get started, instrument your Flutter application automatically by installing the Splunk RUM Flutter agent as outlined below.
Check compatibility and requirements
- Flutter 3.32.0 and above
- Dart 3.8.0 and above
- Android API 24 and above
- iOS 15 and above
This combination of minimum versions allows you to instrument your Flutter applications running on both Android and iOS.
Before you begin
Get this information:
Your Splunk access token: See Generate your RUM access token in Splunk Observability Cloud.
The name of the application that you're instrumenting.
(Optional) The version number of the application that you're instrumenting.
A name for the environment where the application will run.
Your application name, application version, and deployment environment should be non-identical strings.
Procedure
Install the Splunk RUM Flutter agent:
Add the SDK to your Flutter project:
flutter pub add splunk_otel_flutterRefresh your Flutter project's dependencies:
flutter pub get
Set up the "native" side:
- For Android, activate desugaring in your application
In yor application module's build.gradle file, update the
compileOptionsand dependencies sections as in the following examples:android { compileOptions { // Flag to enable support for the new language APIs // For AGP 4.1+ isCoreLibraryDesugaringEnabled = true // For AGP 4.0 // coreLibraryDesugaringEnabled = true // Sets Java compatibility to Java 8 sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { // If this setting is present, jvmTarget must be "1.8" jvmTarget = "1.8" } } dependencies { // For AGP 7.4+ coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.3") // For AGP 7.3 // coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.2.3") // For AGP 4.0 to 7.2 // coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.9") }- Save and sync your project.
- iOS
- Not applicable.
Initialize the agent in your
mainfunction.Dart:import 'package:splunk_otel_flutter/splunk_otel_flutter.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await SplunkOtelFlutter.instance.install( agentConfiguration: AgentConfiguration( endpointConfiguration: EndpointConfiguration.forRum( realm: "<inserted>", rumAccessToken: "<inserted>", ), appName: "<inserted>", deploymentEnvironment: "<inserted>", appVersion: "<inserted>", ), ); runApp(const MyApp()); }Generate some user activity in your application. To see your application in Splunk Observability Cloud, select .