Configuration settings

The auto-instrumentation process instruments your iOS apps for monitoring with OneAgent. The instrumentation process is an automated way of adding OneAgent to an app without manually modifying its source code. An auto-instrumented app is equivalent to an app that is manually instrumented for basic data collection. This level of instrumentation provides visibility into the real user experience delivered by your app. It also enables crash detection and performance monitoring related to app start-up and web request response times.

Auto-instrumentation features

The following features are automatically instrumented:

  • Automatic OneAgent startup
  • Lifecycle data
  • Crash reporting
  • Web request tagging
  • Web request events execution time and the data sent are reported, 3rd-party requests are identified
  • Web views
  • Automatic user action detection (detection and timing of user actions, such as button clicks, view actions, and other controls)

All these features are enabled by default. You can disable or refine auto-instrumentation functions by adding configuration keys to your app’s Info.plist file.

Auto-instrumentation occurs during runtime. The resulting app is instrumented to the levels configured in the app's Info.plist file.

You can combine manual instrumentation with auto-instrumentation to capture additional details. For example, you may want to manually instrument certain user-defined actions, report values, and events.

Configuration keys

Configuration keys are essentially properties you can set to your preferences for auto-instrumentation. Add the keys to your app's Info.plist file, as required to fine-tune auto-instrumentation.

To keep your Info.plist file clean, move all OneAgent-related DTX keys to a Dynatrace.plist file and add the Dynatrace.plist to the Copy Bundle Resources build phase. The Dynatrace.plist file must be at the root of your resources bundle, so it should be created in the same location as the Info.plist file.

The following table includes all configuration keys for iOS auto-instrumentation.

Security and authentication

You can use the Public Key Hash Pinning feature for authentication purposes.


Public key pinning can be dangerous. If you make a mistake, you might cause your app to pin a set of keys that validates today but which stops validating a week or a year from now. In that case, your app will no longer be able to connect to the server and will most likely stop working until it gets updated with a new set of keys.

How to use PKH pinning with Dynatrace

Step 1

Generate the hashes from your certificates. From your agent kit run the script to generate a hash from your certificate:

python <path to your cert>.<der|pem> --type <DER | PEM>

The output should look like this:

subject= *****
issuer= *****
SHA1 Fingerprint= ******

---------------------- DTXDomainPins item ----------------------
DTXPKHash: SomePublicKeyHash=
DTXPKHashAlgoritm: DTXAlgorithmRsa2048

Step 2

Use the output from the script in your info.plist as a dictionary under the key DTXPublicKeyPins as explained above.

Custom HTTP headers

If the HTTP requests of OneAgent do not fulfills the security requirements of your server infrastructure, you can modify the HTTP headers of OneAgent with Dynatrace.setBeaconHeaders([String : String]?). This feature allows you to add an Authorization header to the HTTP requests and immediately reconnect to the Cluster ActiveGate when the token has expired. To delete the old headers call Dynatrace.setBeaconHeaders(nil).

Dynatrace.setBeaconHeaders(["Cookie" : "n1=v1; n2=v2", "MyHeader" : "MyHeader", "Authorization" : "API-Token aa11bb22cc33dd44ee55"]) //set headers onto beacon
let headers: Dictionary<String, String>? = Dynatrace.beaconHeaders()    //request the headers that have been set
//listen for communication problems (e.g. if beacon header contains a token that can expire required to pass a firewall)
NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: Dynatrace.getCommunicationProblemNotificationName()), object: nil, queue: nil) { _ in
    //e.g. update beacon header with new token


  • An auto-instrumented application can't carry out functions such as Dynatrace.shutdown() or Dynatrace .flushEvents(). You can manually insert these methods and other user-defined actions and events before performing auto-instrumentation.
  • The following controls can't be used to create auto user actions:
    • Gestures
    • Certain UIBarButton items, including custom UIBarButton items added to the navigation bar by a storyboard (such as info) that use segues to transition to other views.