Configure the Splunk iOS RUM instrumentation 🔗
You can configure the iOS RUM library from the Splunk OpenTelemetry Instrumentation for iOS to add custom attributes, adapt the instrumentation to your environment and application, customize sampling, and more.
To configure the iOS RUM library, pass the settings as methods when initializating the SplunkRum
module. The Splunk Observability Cloud realm and RUM token are passed as arguments to the SplunkRumBuilder
function.
The following example shows how to configure the RUM token, realm, environment name, app name, and other settings:
import SplunkOtel
//..
SplunkRumBuilder(realm: "<realm>", rumAuth: "<rum-token>")
// Call functions to configure additional options
.allowInsecureBeacon(enabled: true)
.debug(enabled: true)
.globalAttributes(globalAttributes: ["strKey": "strVal", "intKey": 7, "doubleKey": 1.5, "boolKey": true])
.deploymentEnvironment(environment: "env")
.setApplicationName("<your_app_name>")
.ignoreURLs(ignoreURLs: try! NSRegularExpression(pattern: ".*ignore_this.*"))
.screenNameSpans(enabled: true)
// The build method always come last
.build()
@import SplunkOtel;
//...
SplunkRumBuilder *builder = [[SplunkRumBuilder alloc] initWithBeaconUrl:@"https://rum-ingest.<realm>.signalfx.com/v1/rum" rumAuth: @"<rum-token>"]];
[builder allowInsecureBeaconWithEnabled:true];
[builder globalAttributesWithGlobalAttributes:[NSDictionary dictionary]];
[builder debugWithEnabled:true];
[builder deploymentEnvironmentWithEnvironment:@"environment-name"];
[builder setApplicationName:@"<your_app_name>"];
NSError* error = nil;
[builder ignoreURLsWithIgnoreURLs: [NSRegularExpression regularExpressionWithPattern: @".*ignore_this.*" options: 0 error: &error]];
[builder screenNameSpansWithEnabled:true];
// The build method always come last
[builder build];
General settings 🔗
Use the following settings to configure the iOS RUM library:
Option |
Description |
---|---|
|
The name of your organization’s realm, for example, |
|
RUM token that authorizes the agent to send telemetry data to Splunk Observability Cloud. To generate a RUM access token, see Generate your RUM access token in Splunk Observability Cloud. |
|
Ingest URL to which the agent sends collected telemetry. The URL must contain your realm in Splunk Observability Cloud. For example, |
|
Sets additional attributes added to all spans. Attributes are defined as an array of comma-separated key-value pairs. For example: |
|
Environment for all the spans produced by the application. For example, |
|
Sets the application name. If not set, the library uses the bundle name instead. Default value is nil. |
iOS RUM features 🔗
Use the following settings to configure the behavior of iOS RUM instrumentation:
Option |
Description |
---|---|
|
Regular expression pattern that matches URLs you want to ignore when reporting HTTP activity. |
|
Closure of type |
|
Percentage of sessions to sample. Expressed as a proportion in the range |
|
If set to |
|
Activates caching of exported spans. All spans are written to local storage and deleted after a successful export. The default value is |
|
Threshold, in megabytes, from which spans start to be dropped from the disk cache. The oldest spans are dropped first. Only applicable when disk caching is activated. The default value is |
|
Sets the maximum interval between two consecutive span exports. The default value is 5 seconds. |
|
Activates the slow rendering detection feature. The default value is |
|
Optional setting that tags as slow all frames that took more than the specified time, in milliseconds. The default value is |
|
Optional setting that tags as frozen all frames that took more than the specified time, in milliseconds. The default value is |
|
Activates debug logging. The default value is |
Instrumentation settings 🔗
Use the following settings to activate or deactivate the collection of specific data:
Option |
Description |
---|---|
|
Activates the creation of spans for |
|
Activates the creation of spans for changes to the screen name. The default value is |
|
Activates the creation of spans for network activities. The default value is |