Docs » Instrument mobile and web applications for Splunk RUM » Instrument iOS applications for Splunk RUM » Install the iOS RUM agent for Splunk RUM

Install the iOS RUM agent for Splunk RUM ๐Ÿ”—

You can instrument your iOS applications for Splunk RUM using the iOS RUM agent from the Splunk OpenTelemetry Instrumentation for iOS.

To instrument your iOS application and get data into Splunk RUM, follow the instructions on this page.

Note

Splunk APM is not required to instrument Splunk RUM for iOS.

Check compatibility and requirements ๐Ÿ”—

Splunk RUM for Mobile supports iOS 11 and higher, including iPadOS 13 and higher.

Instrument your iOS application for Splunk RUM ๐Ÿ”—

Before you instrument and configure Splunk RUM for your iOS application, understand which data RUM collects about your application and determine the scope of what you want to monitor. See Data collected by Splunk RUM.

Tip: To generate all the basic installation commands for your environment and application, use the iOS Instrumentation guided setup. To access the iOS Instrumentation guided setup, follow these steps:

  1. Log in to Observability Cloud.

  2. In the left navigation menu, select Data Management to open the Integrate Your Data page.

  3. In the integration filter menu, select By Use Case.

  4. Select the Monitor user experience use case.

  5. Click the iOS Instrumentation tile to open the iOS Instrumentation guided setup.

Import and initialize the iOS RUM package ๐Ÿ”—

Follow these steps to import and initialize the iOS RUM package.

  1. In Xcode, select File > Add Packagesโ€ฆ or File > Swift Packages > Add Package Dependency and enter the following URL in the search bar:

    https://github.com/signalfx/splunk-otel-ios

  2. Click Add Package to install the package.

  3. Initialize the iOS RUM agent with your configuration parameters:

    import SplunkOtel
    //..
    SplunkRum.initialize(beaconUrl: "https://rum-ingest.<realm>.signalfx.com/v1/rum",
          rumAuth: "<rum-token>",
          options: SplunkRumOptions(environment:"<environment-name>"))
    
    • In the beacon URL, realm is the Observability Cloud realm, for example, us0. To find the realm name of your account, follow these steps:

      1. Open the left navigation menu in 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 Observability Cloud.

    Note

    If your application uses CocoaPods, import the iOS RUM package into your main app. If you import the package into your Pods project, the dependency might disappear when you recreate the project.

  4. Deploy the changes to your application.

Activate crash reporting ๐Ÿ”—

The Splunk iOS Crash Reporting module adds crash reporting to the iOS RUM agent using PLCrashReporter.

Caution

Before enabling crash reporting in the iOS RUM agent, deactivate any other crash reporting package or library in your application. Existing crash reporting functionality might produce unexpected results, including build failures.

To activate crash reporting in the iOS RUM agent, follow these steps:

  1. In Xcode, select File > Add Packagesโ€ฆ or File > Swift Packages > Add Package Dependency and enter the following URL in the search bar:

    https://github.com/signalfx/splunk-otel-ios-crashreporting

  2. Click Add Package to install the package.

  3. Initialize the crash reporting module with your configuration parameters:

    import SplunkOtel
    import SplunkOtelCrashReporting
    //..
    SplunkRum.initialize(beaconUrl: "https://rum-ingest.<realm>.signalfx.com/v1/rum",
                      rumAuth: "<rum-token>",
                      options: SplunkRumOptions(environment:"<environment-name>"))
    // Initialize crash reporting module after the iOS agent
    SplunkRumCrashReporting.start()
    
    • In the beacon URL, realm is the Observability Cloud realm, for example, us0. To find the realm name of your account, follow these steps:

      1. Open the left navigation menu in 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 Observability Cloud.

  4. Deploy the changes to your application.

Note

Symbolication is not supported.

Instrument iOS WebViews using the Browser RUM agent ๐Ÿ”—

You can use Mobile RUM instrumentation and Browser RUM instrumentation simultaneously to see RUM data combined in one stream. You can do this by sharing the splunk.rumSessionId between both instrumentations.

The following Swift snippet shows how to integrate iOS RUM with Splunk Browser RUM:

import WebKit
import SplunkOtel

...
   /*
Make sure that the WebView instance only loads pages under
your control and instrumented with Splunk Browser RUM. The
integrateWithBrowserRum() method can expose the splunk.rumSessionId
of your user to every site/page loaded in the WebView instance.
*/
   let webview: WKWebView = ...
   SplunkRum.integrateWithBrowserRum(webview)

Change attributes before theyโ€™re collected ๐Ÿ”—

To remove or change attributes in your spans, such as personally identifiable information (PII), see Filter spans.

How to contribute ๐Ÿ”—

The Splunk OpenTelemetry Instrumentation for iOS is open-source software. You can contribute to its improvement by creating pull requests in GitHub. To learn more, see the contributing guidelines in GitHub.