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:
Log in to Observability Cloud.
In the left navigation menu, select
to open the Integrate Your Data page.In the integration filter menu, select By Use Case.
Select the Monitor user experience use case.
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.
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
Click Add Package to install the package.
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>"))
@import SplunkOtel; //... SplunkRumOptions *options = [[SplunkRumOptions alloc] init]; options.environment = @"<environment-name>"; [SplunkRum initializeWithBeaconUrl:@"https://rum-ingest.<realm>.signalfx.com/v1/rum" rumAuth: @"<rum-token>" options: options];
In the beacon URL,
realm
is the Observability Cloud realm, for example,us0
. To find the realm name of your account, follow these steps:Open the left navigation menu in Observability Cloud.
Select
.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.
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:
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
Click Add Package to install the package.
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()
@import SplunkOtel; @import SplunkOtelCrashReporting; //... SplunkRumOptions *options = [[SplunkRumOptions alloc] init]; options.environment = @"<environment-name>"; [SplunkRum initializeWithBeaconUrl: @"https://rum-ingest.<realm>.signalfx.com/v1/rum" rumAuth: @"<rum-token>" options: nil]; // 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:Open the left navigation menu in Observability Cloud.
Select
.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.
Deploy the changes to your application.
Note
Symbolication is not supported.
Link RUM with Splunk APM ๐
Splunk RUM uses server timing to calculate the response time between the front end and back end of your application, and to join the front-end and back-end traces for end-to-end visibility.
By default, the Splunk Distributions of OpenTelemetry already send the Server-Timing
header. The header links spans from the browser with back-end spans and traces.
The APM environment variable for controlling the Server-Timing
header is SPLUNK_TRACE_RESPONSE_HEADER_ENABLED
. Set SPLUNK_TRACE_RESPONSE_HEADER_ENABLED=true
to link to Splunk APM.
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.