Install the iOS RUM library for Splunk RUM π
To instrument your iOS application using the iOS RUM library and get data into Splunk RUM, follow the instructions on this page. You can install the library using Swift Package Manager, CocoaPods, or by building an XCFramework.
Note
Splunk APM is not required to instrument Splunk RUM for iOS.
Decide which version to run in your environment π
Latest updates automatically whenever Splunk RUM releases a new version. In pre-production, use latest to try out the most recent version of Splunk RUM. In production environments, use the pinned version which was previously tested in pre-production and update the production version on a monthly cycle.
Check compatibility and requirements π
Splunk RUM for Mobile supports the following versions:
iOS 11 and higher
iPadOS 13 and higher
Splunk RUM supports Apple Silicon.
Generate customized instructions using the guided setup π
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 Splunk Observability Cloud.
In the navigation menu, select
.Go to the Available integrations tab, or select Add Integration in the Deployed integrations tab.
In the integration filter menu, select By Use Case.
Select the Monitor user experience use case.
Select the iOS Instrumentation tile to open the iOS Instrumentation guided setup.
Install the iOS RUM library manually π
To install the iOS RUM library manually, follow these steps:
Add the dependency in Xcode π
To add the iOS RUM package to your project, follow the steps for your dependency manager. To build an XCFramework, see Build an XCFramework.
Swift package manager (SPM) π
To install the iOS RUM library using the Swift Package Manager (SPM) follow these steps:
In Xcode, select File, then Add Packages⦠or File, then Swift Packages, then Add Package Dependency, and enter the following URL in the search bar:
https://github.com/signalfx/splunk-otel-ios
Select Add Package to install the package.
Note
If you are also using CocoaPods, add the SPM package to the appβs project, not to the Pods project in your workspace.
CocoaPods π
To install the iOS RUM library using CocoaPods follow these steps:
Make sure your project is using CocoaPods.
Add
pod 'SplunkOtel
to your Podfile.Run
pod install --repo-update
in the directory where the Podfile is located.After installing the pod, make sure to open the .xcworkspace file instead of the .xcodeproj file.
Initialize the iOS RUM package π
Follow these steps to initialize the iOS RUM package.
Initialize the iOS RUM library with your configuration parameters:
import SplunkOtel //.. SplunkRumBuilder(realm: "<realm>", rumAuth: "<rum-token>") // Call functions to configure additional options .deploymentEnvironment(environment: "<environment>") .setApplicationName("<your_app_name>") .build()
@import SplunkOtel; SplunkRumBuilder *builder = [[SplunkRumBuilder alloc] initWithRealm:@"<realm>" rumAuth: @"<rum-token>"]]; [builder deploymentEnvironmentWithEnvironment:@"<environment-name>"]; [builder setApplicationName:@"<your_app_name>"]; [builder build];
realm
is the Splunk Observability Cloud realm, for example,us0
. To find your Splunk realm, see Note about realms.To generate a RUM access token, see Generate your RUM access token in Splunk Observability Cloud.
Deploy the changes to your application.
Activate crash reporting π
The Splunk iOS Crash Reporting module adds crash reporting to the iOS RUM library using PLCrashReporter.
Caution
Before activating crash reporting in the iOS RUM library, 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 library, follow these steps.
Add the dependency π
To add the iOS Crash Reporting package to your project, follow the steps for your package manager.
Swift package manager (SPM) π
To install the iOS RUM library using the Swift Package Manager (SPM) follow these steps:
In Xcode, select File, then Add Packages⦠or File, then Swift Packages, then Add Package Dependency, and enter the following URL in the search bar:
https://github.com/signalfx/splunk-otel-ios-crashreporting
Select Add Package to install the package.
CocoaPods π
To install the iOS Crash Reporting package using CocoaPods follow these steps:
Make sure your project is using CocoaPods.
Add
pod 'SplunkOtelCrashReporting
to your Podfile.Run
pod install --repo-update
in the directory where the Podfile is located.After installing the pod, make sure to open the .xcworkspace file instead of the .xcodeproj file.
Initialize Crash Reporting π
Initialize the crash reporting module with your configuration parameters:
import SplunkOtel
import SplunkOtelCrashReporting
import SplunkOtel
//..
SplunkRumBuilder(realm: "<realm>", rumAuth: "<rum-token>")
.deploymentEnvironment(environment: "<environment>")
.setApplicationName("<your_app_name>")
.build()
// Initialize crash reporting module after the iOS agent
SplunkRumCrashReporting.start()
@import SplunkOtel;
@import SplunkOtelCrashReporting;
//...
SplunkRumBuilder *builder = [[SplunkRumBuilder alloc] initWithRealm:@"<realm>" rumAuth: @"<rum-token>"]];
[builder deploymentEnvironmentWithEnvironment:@"<environment-name>"];
[builder setApplicationName:@"<your_app_name>"];
[builder build];
// Initialize crash reporting module after the iOS agent
[SplunkRumCrashReporting start]
realm
is the Splunk Observability Cloud realm, for example,us0
. To find your Splunk realm, see Note about realms.To generate a RUM access token, see Generate your RUM access token in Splunk Observability Cloud.
Note
Symbolication is not supported.
Build an XCFramework π
If you want to import the iOS RUM Agent as a framework into your project, follow these steps:
Check the build settings
Clone the splunk-otel-ios repository and open the SplunkRumWorkspace.xcworkspace file in Xcode.
Navigate to the Build Settings tab on the SplunkOtel
target and make sure the following settings are present:
Skip Install: No
Build Libraries for Distribution: Yes
Create a new archives directory
Open a terminal and navigate to the directory where the SplunkRum.xcodeproj file is located, for example SplunkRumWorkspace/SplunkRum
.
Run the following command to create a new archives directory containing the SplunkRum-iOS.xcarchive
file:
xcodebuild archive -project SplunkRum.xcodeproj -scheme SplunkOtel -destination "generic/platform=iOS" -archivePath "archives/SplunkRum-iOS"
Repeat the process for the simulator platform:
xcodebuild archive -project SplunkRum.xcodeproj -scheme SplunkOtel -destination "generic/platform=iOS Simulator" -archivePath "archives/SplunkRum-iOS_Simulator"
Create the new XCFramework
Run the following command to create the XCFramework:
xcodebuild -create-xcframework -archive archives/SplunkRum-iOS.xcarchive -framework SplunkOtel.framework -archive archives/SplunkRum-iOS_Simulator.xcarchive -framework SplunkOtel.framework -output xcframeworks/SplunkOtel.xcframework
Import the XCFramework into your project
Open your project in Xcode and drag the SplunkOtel.xcframework file into the project navigator. This automatically imports the framework. Go into the General tab in any targets using the framework and set their Embed property to Embed & Sign.
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 library π
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.
Next steps π
To add custom attributes, adapt the instrumentation to your environment and application, customize sampling, and more, see Configure the Splunk iOS RUM instrumentation.
To check that your data is in your Splunk RUM for Mobile instance, see Check that your data is coming in.
To troubleshoot, see Troubleshoot iOS instrumentation for Splunk Observability Cloud.