This page describes how to enable and customize Session Replay on crashes for your iOS apps.
Session Replay on crashes gives you additional context for crash analysis in the form of video-like screen recordings that replay all the user actions immediately preceding a detected crash.
Ensure that your system meets the following requirements:
- Dynatrace version 1.208+
- OneAgent version 1.207+
- An active Dynatrace Digital Experience Monitoring license
- Dynatrace Managed deployments only: A secondary disk configured to store user session data
Enable Session Replay on crashes
Do the following to enable Session Replay on crashes.
1. Enable Session Replay for mobile
This setting ensures that the Session Replay SDK is included in the Podfile that needs to be integrated into your application.
- In the Dynatrace menu, go to Mobile.
- Select the application you want to configure.
- Select Browse (…) > Edit.
- Select General from the Mobile app settings menu.
- Turn on Enable Session Replay.
2. Enable Session Replay on crashes.
This setting ensures that sessions with crashes are recorded.
- Select Instrumentation settings from the Mobile app settings menu.
- Turn on Include Session Replay on crashes.
3. Add Session Replay as dependency within Podfile specification
This step ensures that Session Replay is added as a dependency within your Podfile specification.
- Select Instrumentation wizard from the Mobile app settings menu.
- Select iOS.
- Copy the string from the Modify your Podfile step and add it to your Podfile. For example:
pod 'Dynatrace/SessionReplay', '~> 8.207'
After you enable Session Replay on crashes, you can start crash analysis from your mobile application overview page.
- In the Dynatrace menu, go to Mobile.
- Search for your mobile application, and select it to access the application overview page.
- In the infographic, select the Crashes tile. You'll see the graph showing the total number of crashes by version during the selected timeframe.
- Select Analyze crashes.
- All crashes caused by the same exception are organized into a Crash group. The Crash analysis page lets you filter the crash groups by the application version. In the Crash groups list, select a crash group you're interested in.
- In the crash group details page, you can use the Next / previous crash occurrence arrows to browse through all the crash occurrences. Select the crash occurrence you're interested in, and select the Session information tab to replay what happened on the user's screen immediately before your application crashed.
Mask sensitive data
Session Replay for mobile comes with the three predefined masking levels:
All the editable texts fields, images, labels, web views, and switches are masked.
All the editable texts fields are masked.
Masks the same as Safest by default, but you can decide exactly which app components or views should be masked.
Change masking level
By default, OneAgent applies the Safest masking level. To change it to the Safe or Custom level, use the API to configure OneAgent.
- Import the
DynatraceSessionReplayframework to the class.
- Set the level
let maskingConfiguration = MaskingConfiguration(maskingLevelType: .safe) // .safest or .custom AgentManager.setMaskingConfiguration(maskingConfiguration)
MaskingConfiguration *conf = [[MaskingConfiguration alloc] initWithMaskingLevelType: MaskingLevelTypeSafe]; // MaskingLevelTypeSafest // MaskingLevelTypeCustom [AgentManager setMaskingConfiguration: conf];
If you set the level to Custom, you can use additional API methods to decide exactly which app components or views should be masked.
You can enable or disable rules globally or for selected components, such as texts fields, images, labels, web views, and switches.
try? maskingConfiguration.add(rule: .maskAllImages) // Adds one rule try? maskingConfiguration.remove(rule: .maskAllSwitches) // Removes one rule try? maskingConfiguration.addAllRules() // Adds all rules try? maskingConfiguration.removeAllRules() // Removes all rules
[conf addWithRule:MaskingRuleMaskAllImages error:nil]; // Adds one rule [conf removeWithRule:MaskingRuleMaskAllSwitches error:nil]; // Removes one rule [conf addAllRulesAndReturnError:nil]; // Adds all rules [conf removeAllRulesAndReturnError:nil]; // Removes all rules
If you remove all masking rules, Session Replay won't mask anything. If you enable all masking rules, it's equivalent to the safest masking level.
You can also enable or disable masking of the selected views based on their accessibility identifier.
try? maskingConfiguration.addMaskedView(viewIds: ["masked_view_id"]) try? maskingConfiguration.removeMaskedView(viewIds: ["masked_view_id"]) try? maskingConfiguration.addNonMaskedView(viewIds: ["nonMasked_view_id"]) try? maskingConfiguration.removeNonMaskedView(viewIds: ["nonMasked_view_id"])
[conf addMaskedViewWithViewIds:@[@"masked_view_id"] error:nil]; [conf removeMaskedViewWithViewIds:@[@"masked_view_id"] error:nil]; [conf addNonMaskedViewWithViewIds:@[@"nonMasked_view_id"] error:nil]; [conf removeNonMaskedViewWithViewIds:@[@"nonMasked_view_id"] error:nil];