[Alpha] Configure the Splunk RUM Flutter agent
Configure Splunk RUM instrumentation for 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.
AgentConfiguration
You can configure the Splunk RUM Flutter agent to add custom attributes, adapt the instrumentation to your environment and application, customize sampling, and more.
To configure the Splunk RUM Flutter agent, pass the settings to the agent in an AgentConfiguration object. The following example shows how to configure this object with your Splunk RUM token, Splunk realm, application name, and deployment environment
SplunkRum.instance.install(
agentConfiguration: AgentConfiguration(
endpointConfiguration: EndpointConfiguration.forRum(
realm: 'your-splunk-realm',
rumAccessToken: 'your-splunk-rum-access-token',
),
appName: 'your-app-name',
deploymentEnvironment: 'your-environment-name',
),
);
General settings
Use the following settings to configure the AgentConfiguration object:
| Option | Description |
|---|---|
appName (required) | Sets the application name. |
appVersion | Sets the application version. |
deferredUntilForeground | Defer telemetry until the app is brought to the foreground. Default: Android only. |
deploymentEnvironment (required) | Environment for all the spans produced by the application. For example, dev, test, or prod. |
enableDebugLogging | Activates debug logging. Default: false |
endpointConfiguration | Sets the configuration needed to export data to an endpoint. There are two required inputs:
|
globalAttributes | Attributes to append to every span collected. For an example, see Manage global attributes. |
instrumentedProcessName | Compares application ID and process name. If they are the same, the application is visible to user. If not, it is the background process. Android only. |
session | Configured by
|
user | Configured by
|
Instrumentation module settings
You can configure the following modules in the Splunk RUM Flutter agent:
- HTTP instrumentation module
- Navigation detection module (detection of screen names)
- Crash reporting module
- Application not responding module (Android only)
- Slow rendering module
- Interaction detection module
- Application lifecycle monitoring module
isEnabled attribute to true). All modules except navigation detection are activated by default. HTTP instrumentation module
The Splunk RUM Flutter agent monitors HTTP requests at the native platform level. This captures requests made through native HTTP clients.
Okhttp3(Android only)This instrumentation automatically modifies the code at build time and adds the necessary hooks for tracing network requests made through the
OkHttp3APIs. To activate this, add the following plugin to your android/build.gradle and android/app/build.gradle files:// android/build.gradle buildscript { repositories { google() mavenCentral() maven { url "https://splunk.jfrog.io/splunk/splunk-rum-android-releases" } } dependencies { classpath("com.splunk:rum-okhttp3-auto-plugin:splunk-rum-version") } }// android/app/build.gradle apply plugin: "com.splunk.rum-okhttp3-auto-plugin"Note: Build-time instrumentation required. If you don't add the plugin to the application at build time, the runtimeOkHttp3AutoModuleConfigurationwill have no effect.Note: There is currently an open issue with Google that may result in a build failure when an application is built with these plugins. It's related to the Jetifier. The issue is tracked in the Google Issue Tracker and can be resolved by setting theenableJetifierflag tofalsein yourgradle.propertiesfile. For example,android.enableJetifier=falseYou can opt-in to capture certain request and response headers using the HTTP instrumentation modules. If those headers are available, the resulting span will contain
http.request.header.keyandhttp.response.header.keyattributes with the header value(s):SplunkRum.instance.install( moduleConfigurations: [ HttpUrlModuleConfiguration( isEnabled: true, capturedRequestHeaders: [ 'authorization', 'content-type', 'user-agent', ], capturedResponseHeaders: [ 'content-type', 'cache-control', ], ), OkHttp3AutoModuleConfiguration( isEnabled: true, capturedRequestHeaders: [ 'authorization', 'accept', ], capturedResponseHeaders: [ 'content-type', 'content-length', ], ), ], );If you see ByteBuddy resolution errors, enforce the
ByteBuddyversion:configurations.matching { it.name.toLowerCase().contains("bytebuddyclasspath") }.all { resolutionStrategy { force("net.bytebuddy:byte-buddy:1.14.12") } }HttpUrlConnection(Android only)This instrumentation automatically modifies the code at build time and adds the necessary hooks for tracing network requests made via the
URLConnection,HttpURLConnection, orHttpsURLConnectionAPIs. To enable this, add the following plugin to android/build.gradle and android/app/build.gradle.// android/build.gradle buildscript { repositories { google() mavenCentral() maven { url "https://splunk.jfrog.io/splunk/splunk-rum-android-releases" } } dependencies { classpath("com.splunk:rum-httpurlconnection-auto-plugin:splunk-rum-version") } }// android/app/build.gradle apply plugin: "com.splunk.rum-httpurlconnection-auto-plugin"Note: Build-time instrumentation required. If you don't add the plugin to the application at build time, the runtime configuration will have no effect.Note: There is currently an open issue with Google that may result in a build failure when an application is built with these plugins. It's related to the Jetifier. The issue is tracked in the Google Issue Tracker and can be resolved by setting theenableJetifierflag tofalsein yourgradle.propertiesfile. For example,android.enableJetifier=falseYou can opt-in to capture certain request and response headers using the HTTP instrumentation modules. If those headers are available, the resulting span will contain
http.request.header.keyandhttp.response.header.keyattributes with the header value(s).SplunkRum.instance.install( moduleConfigurations: [ HttpUrlModuleConfiguration( isEnabled: true, capturedRequestHeaders: [ 'authorization', 'content-type', 'user-agent', ], capturedResponseHeaders: [ 'content-type', 'cache-control', ], ), ], );If you see ByteBuddy resolution errors, enforce the
ByteBuddyversion:configurations.matching { it.name.toLowerCase().contains("bytebuddyclasspath") }.all { resolutionStrategy { force("net.bytebuddy:byte-buddy:1.14.12") } }- Automatic
URLSessioninstrumentation (iOS only) Automatically instruments
URLSessionnetwork requests at the native platform level.Specify NSRegularExpression patterns to exclude specific URLs from instrumentation.
SplunkRum.instance.install( moduleConfigurations: [ NetworkInstrumentationModuleConfiguration( isEnabled: true, ignoreURLs: [ RegularExpression( pattern: "123", options: [ RegexOption.allowCommentsAndWhitespace, RegexOption.anchorsMatchLines, ], ), ], ), ], );
Crash reporting module
Automatically captures crashes on the native platform. Activated by default. To deactivate, see the codeblock below.
SplunkRum.instance.install(
moduleConfigurations: [
CrashReportsModuleConfiguration(isEnabled: false),
],
);Application not responding module (Android only)
Monitors the native Android main thread. Detects when the thread is blocked for more than five seconds. Activated by default. To deactivate, see the codeblock below.
SplunkRum.instance.install(
moduleConfigurations: [
AnrModuleConfiguration(isEnabled: false),
],
);Slow rendering module
Monitors rendering performance at the native platform level. Activated by default. Configure as follows:
SplunkRum.instance.install(
moduleConfigurations: [
SlowRenderingModuleConfiguration(
isEnabled: false,
interval: const Duration(seconds: 1),
),
],
);Interaction detection module
Captures user interaction coordinates and timing at the native platform level. Activated by default. To deactivate, see the codeblock below.
SplunkRum.instance.install(
moduleConfigurations: [
InteractionsModuleConfiguration(isEnabled: false),
],
);Network monitoring module
The network monitoring module is included in the new Splunk RUM agent and is activated by default. This module monitors network connectivity and quality at the native platform level. To deactivate, see the codeblock below.
SplunkRum.instance.install(
moduleConfigurations: [
NetworkMonitorModuleConfiguration(isEnabled: false),
],
);Application lifecycle monitoring module
The application lifecycle monitoring module is included in the new Splunk RUM agent and is activated by default. This module monitors application lifecycle events (foreground, background, termination) at the native platform level.To deactivate, see the codeblock below.
SplunkRum.instance.install(
moduleConfigurations: [
ApplicationLifecycleModuleConfiguration(isEnabled: false),
],
);