Docs » Supported integrations in Splunk Observability Cloud » Instrument mobile and web applications for Splunk RUM » Instrument iOS applications for Splunk RUM » Configure the Splunk iOS RUM instrumentation

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()

General settings 🔗

Use the following settings to configure the iOS RUM library:

Option

Description

realm

The name of your organization’s realm, for example, us0. To find your Splunk realm, see Note about realms.

rumAuth

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.

beaconUrl

Ingest URL to which the agent sends collected telemetry. The URL must contain your realm in Splunk Observability Cloud. For example, https://rum-ingest.us0.signalfx.com/v1/rum is the ingest URL for the us0 realm. When defined, it overrides the value in realm.

globalAttributes

Sets additional attributes added to all spans. Attributes are defined as an array of comma-separated key-value pairs. For example: ["key1":"value1","key2":3]. See Manage global attributes.

environment

Environment for all the spans produced by the application. For example, dev, test, or prod.

appName

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

ignoreURLs

Regular expression pattern that matches URLs you want to ignore when reporting HTTP activity.

spanFilter

Closure of type ((SpanData) -> SpanData?)? to modify or ignore spans. See Filter spans.

sessionSamplingRatio

Percentage of sessions to sample. Expressed as a proportion in the range 0.0 to 1.0. The default value is 1.0.

allowInsecureBeacon

If set to true, this setting allows beacon URLs that use the HTTP protocol. The default value is false.

enableDiskCache

Activates caching of exported spans. All spans are written to local storage and deleted after a successful export. The default value is false.

spanDiskCacheMaxSize

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 25 megabytes.

bspScheduleDelay

Sets the maximum interval between two consecutive span exports. The default value is 5 seconds.

slowRenderingDetectionEnabled

Activates the slow rendering detection feature. The default value is true. See Slow rendering detection.

slowFrameDetectionThresholdMs

Optional setting that tags as slow all frames that took more than the specified time, in milliseconds. The default value is 16.7 milliseconds.

frozenFrameDetectionThresholdMs

Optional setting that tags as frozen all frames that took more than the specified time, in milliseconds. The default value is 700 milliseconds.

debug

Activates debug logging. The default value is false.

Instrumentation settings 🔗

Use the following settings to activate or deactivate the collection of specific data:

Option

Description

showVCInstrumentation

Activates the creation of spans for ViewController Show events. The default value is true.

screenNameSpans

Activates the creation of spans for changes to the screen name. The default value is true.

networkInstrumentation

Activates the creation of spans for network activities. The default value is true.

This page was last updated on Feb 26, 2024.