Upgrade the Splunk RUM Android agent

Migrate existing deployments to the new Splunk RUM agent.

Note: If you don't have existing Android instrumentation, skip this page. Go directly to Install the Splunk RUM Android agent.

If you're using the old Splunk RUM agent in your Android applications, follow these steps to migrate your Android applications to the new Splunk RUM agent:

  1. Update the API class package imports:

    Rename the API class package, which includes SplunkRum and SplunkRumBuilder, from com.splunk.rum to com.splunk.rum.integration.agent.api.

  2. Remove the library dependency on io.opentelemetry.android:instrumentation from your gradle file.

    With the new Splunk RUM agent, its inclusion leads to AAR metadata errors with duplicate classes.

  3. Remove the line below your dependencies (the upstream opentelemetry-android repository) because it's already linked in our SDK:
    implementation("io.opentelemetry.android:instrumentation:2.0.0") 
  4. If you're using import com.splunk.rum.StandardAttributes, change it to import com.splunk.rum.integration.agent.api.attributes.StandardAttributes.
    Note: import com.splunk.rum.StandardAttributes is deprecated.
  5. Update your minSDK version to 24.

    The old Splunk RUM agent was compatible with minSDK version 21 but the new agent is only compatible with version 24.

  6. Change the version of compileSdk to 35 and AGP to 8.6.0.

    If you can't upgrade to compileSdk version 35 and the newer AGP, add this block to your build.gradle to force compatible Android library versions. Remember to update the kotlin-stdlib version as needed:

    configurations.all {
        resolutionStrategy {
            force("org.jetbrains.kotlin:kotlin-stdlib:2.0.0")
            force("androidx.core:core:1.13.1")
            force("androidx.core:core-ktx:1.13.1")
        }
    }
  7. Initialize the Splunk RUM agent:
    1. Confirm that Maven Central is included in your build scripts. In your project's root build.gradle file, inside the allprojects block, add mavenCentral() to the list of repositories, and also an additional URL to include session replay:

      Kotlin DSL (build.gradle.kts)
      allprojects {
          repositories {
              google()
              mavenCentral()
              
              ...
          }
      }
      Groovy (build.gradle)
      allprojects {
          repositories {
              google()
              mavenCentral()
              
              ...
          }
      }
    2. Add the Splunk RUM agent library to your build scripts. In your app module's build.gradle file, inside the dependencies block, include the following: file, inside the dependencies block, include the following:

      Note: Change the versions of these dependencies with every release. Don't use the + wildcard notation to specify the version.
      Kotlin DSL (build.gradle.kts)
      dependencies {
          implementation("com.splunk:splunk-otel-android:2.0.0")
          ...
      }
      Groovy (build.gradle)
      dependencies {
          implementation 'com.splunk:splunk-otel-android:2.0.0'
          ...
      }

      Remove the line below your dependencies (the upstream opentelemetry-android repository) because it's already linked in our SDK:

      implementation 'io.opentelemetry.android:instrumentation:2.0.0'
    3. Initialize the Android RUM agent by passing a configuration object to the initialization call in Application.onCreate():

      Note: In case of integration onboarding, all places in the code visible in the following code blocks that are marked as placeholder must be replaced with a string value that is either generated (rumAccessToken) or prefilled by the client in previous steps (appName, deploymentEnvironment, appVersion) based on the previous steps.

      In case the appVersion, which is optional to fill, was not specified by the client, this line of code should be removed from the code blocks, along with its trailing comma (,).

      Kotlin
      class App: Application() {
          override fun onCreate() {
              super.onCreate()
              val agent = SplunkRum.install(
                  application = this,
                  agentConfiguration = AgentConfiguration(
                      endpoint = EndpointConfiguration(
                          realm = "<inserted>",
                          rumAccessToken = "<inserted>"
                      ),
                      appName = "<inserted>",
                      deploymentEnvironment = "<inserted>",
                      appVersion = "<inserted>"
                  )
              )
          }
      }
      Java
      public class App extends Application {
          @Override
          public void onCreate() {
              super.onCreate();
              SplunkRum agent = SplunkRum.install(
                  this,
                  new AgentConfiguration(
                      new EndpointConfiguration(
                          "<inserted>", // Splunk realm
                          "<inserted>" // Splunk access token
                      ),
                      "<inserted>", // Application name
                      "<inserted>", // Deployment environment
                      "<inserted>"  // Application version
                  )
              );
          }
      }
      • The value passed to EndpointConfiguration is the Splunk Observability Cloud realm, for example, us0. To find the realm name of your account, follow these steps:

        1. Open the navigation menu in Splunk Observability Cloud.

        2. Select Settings.

        3. Select your username.

        The realm name appears in the Organizations section.

      • To generate a RUM access token, see Generate your RUM access token in Splunk Observability Cloud.

The following configurations are not supported and are deprecated in the new Splunk RUM agent:

  • enableDiskBuffering()

  • enableReactNativeSupport()

  • VolleyTracing and VolleyTracingBuilder

  • updateLocation(@Nullable Location location)

  • experimentalSetScreenName has a replacement API

  • Call.Factory createRumOkHttpCallFactory(OkHttpClient client) has a replacement API

The best practice is to replace all deprecated configurations and APIs with the new ones provided by this new Splunk RUM agent.