OneAgent for iOS auto-instrumentation features
Auto-instrumentation with OneAgent for iOS occurs during runtime. The resulting application is instrumented to the levels configured in the application's Info.plist
file.
The following features are automatically instrumented when you set up OneAgent for your project. These features are enabled by default, but you can disable or configure them by adding configuration keys to your application's Info.plist
file.
Use auto-instrumentation in combination with manual instrumentation to capture additional data. For example, you might want to manually instrument certain actions, report values, or tag specific users.
Automatic OneAgent startup
OneAgent for iOS is initialized automatically at library load time—this is when the binary for the OneAgent library is loaded into a mobile application at application startup. This happens before applicationWillFinishLaunching
, where OneAgent can be started manually.
Set the DTXAutoStart
configuration key to false
to disable automatic OneAgent startup. In that case, you'll need to start OneAgent manually.
Lifecycle monitoring
OneAgent collects data on the following events.
AppStart
(application start event)- Automatic OneAgent startup: Measures the timespan from when OneAgent starts to when the
application(_:didFinishLaunchingWithOptions:)
method is called. - Manual OneAgent startup: Measures the timespan from when the OneAgent manual startup API is called to when the
application(_:didFinishLaunchingWithOptions:)
method is called. When the manual startup API is called afterapplication(_:didFinishLaunchingWithOptions:)
, theAppStart
event is not generated.
- Automatic OneAgent startup: Measures the timespan from when OneAgent starts to when the
Display
: Measures the timespan from loading a view to when the view appears on the screen. Timestamps of theviewDidLoad
,viewWillAppear
, andviewDidAppear
calls of theViewController
classes are displayed in the user action waterfall analysis and are marked as a Lifecycle event.Redisplay
: Measures the timespan from loading a view to when the view reappears on the screen. Timestamps of theviewWillAppear
andviewDidAppear
calls of theViewController
classes are displayed in the user action waterfall analysis and are marked as a Lifecycle event.
Set the DTXInstrumentLifecycleMonitoring
configuration key to false
to disable automatic lifecycle monitoring. Also, check other keys in the Lifecycle monitoring section for more configuration options.
To learn which lifecycle events are reported for SwiftUI, see Instrument SwiftUI controls | Lifecycle monitoring.
Crash reporting
OneAgent captures all unhandled exceptions and sends the crash report to the server. The crash report includes the occurrence time and the full stack trace of the exception.
The crash details are sent only when the user reopens the mobile application (so on the next application launch). However, if the user doesn't open the application within 10 minutes, the crash report is deleted. This is because Dynatrace doesn't send crash reports that are older than 10 minutes (as such reports can no longer be correlated on the Dynatrace Cluster).
Set the DTXCrashReportingEnabled
configuration key to false
to disable crash reporting.
Web request monitoring
OneAgent automatically instruments and tags your web requests. To track web requests, OneAgent adds the x-dynatrace
HTTP header with a unique value to the web request. This is required to correlate the server-side monitoring data to the corresponding mobile web request.
Set the DTXInstrumentWebRequestTiming
configuration key to false
to disable web request monitoring. Also, check other keys in the Web requests section to configure web request timing and tagging.
To learn how to manually instrument web requests, see Measure web requests.
Web request monitoring for requests passed to WKWebView
OneAgent automatically instruments and tags web requests that are passed to WKWebView
.
Note that OneAgent does not monitor requests issued inside WKWebView
. Such requests are handled by the RUM JavaScript if you've properly configured your hybrid application monitoring with Dynatrace.
Set the DTXInstrumentWebViewTiming
configuration key to false
to disable automatic web request timing and tagging for requests passed to WKWebView
.
User action detection
OneAgent detects and times user actions such as button taps, view actions, and other UI control interactions. OneAgent creates user actions based on the UI components that trigger these actions and automatically combines user action data with other monitoring data, such as information on web requests and crashes. OneAgent extends the lifetime of user actions to properly aggregate them with other events that are executed in a background thread or immediately after a user action.
Set the DTXInstrumentAutoUserAction
configuration key to false
to disable automatic creation of user actions. Also, check other configuration keys in the User actions section to control user action detection.
Using OneAgent for iOS, you can also perform the following actions related to user actions.
To learn how OneAgent constructs user action names, see User action naming.
Rage tap detection
When your mobile application doesn't respond quickly or there's a user interface issue, your users might repeatedly tap the screen or affected UI control. OneAgent detects such behavior as a rage tap.
Set the DTXDetectRageTaps
configuration key to false
to stop detecting rage taps.
Location monitoring
🔴 Disabled by default
OneAgent can capture the location of your application's end users and send the captured location as a metric to the server. To protect the privacy of your users, OneAgent captures only a precision of three fractional digits.
Set the DTXInstrumentGPSLocation
configuration key to true
to enable location capturing.