Crash analysis
The mobile application developers can use the crash analysis feature in Instana to detect, understand, and fix the application crash as soon as possible. This feature helps to minimize the number of affected users and reduce the negative impact of the crash.
Supported technologies
Instana crash collection is supported for Android and iOS native applications. This feature is supported in the following agent versions:
- Instana Android agent 6.0.11 or later (Based on Gradle 7.3.3)
- Instana Android agent 5.2.6 or later (Based on Gradle version lower than 7.3.3)
- Instana iOS agent 1.6.8 or later
Things to note
- iOS
- iOS agent attempts to do the symbolication if possible, otherwise the raw data is shown in the Instana UI.
- Crash data is not sent to Instana if the application is run in iOS emulators.
- Crash data is sent to Instana the next time when the application is started again after the crash. For more information, see MetricKit.
- App ID needs to be a valid Apple App ID. Or else, the crash collection feature doesn't work.
Enabling crash collection in Android agent
Make sure that the Instana Android agent plug-in and SDK are integrated in your Android application. For more information, see Android agent instructions.
Then, set the enableCrashReporting property to true when the Instana.setup() method is called. See the following example:
class ExampleApp : Application() {
override fun onCreate() {
super.onCreate()
val instanaConfig = InstanaConfig(
key = "GbYHxegG4gcgta",
reportingURL = "https://instana-prod.io/mobile",
enableCrashReporting = true
)
Instana.setup(this, instanaConfig)
}
}
For more information about how to enable crash collection in an android agent, see the Sample android application.
Enabling crash collection in iOS agent
To enable crash collection in an iOS agent, complete the following steps:
Make sure that the Instana iOS agent is installed. For more information, see the iOS agent instructions.
Then, set the enableCrashReporting property to true when the Instana.setup() method is called. See the following example:
import UIKit
import InstanaAgent
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// App needs to explicitly get user permission for collecting crash payloads before setting enableCrashReporting to true.
let options = InstanaSetupOptions(enableCrashReporting: true)
Instana.setup(
key: "GbYHxegG4gcgta",
reportingURL: URL(string: "https://instana-prod.io/mobile")!,
options: options
)
return true
}
}
For more information about how to enable crash collection in an iOS agent, see the Sample iOS application.
Analyzing crashes in the Instana UI
After you enable crash collection for an application, when a crash occurs, the crash data is sent to Instana. You can start analyzing the crash data.
-
Click Analytics in the Instana UI.
-
In the Analytics page, click Mobile App > Crashes.
-
Filter your application as follows:
Figure 1. Mobile app crash analytics view
To see the crash details, expand the Crash section, and then you can see the stack trace. See the following screenshot:
Figure 2. Stack trace of a crash
Instana can translate the stack trace into meaningful information by uploading the symbol files and source-mapping files.
Troubleshooting
Crashes in my app are not translated. Why?
Check the iOS symbol files or source-mapping files based on your app type and confirm that you uploaded and committed the sourcemap files for the app version that generates the crashes. If the app version that generates the crash does not match the version in the sourcemap, Instana does not translate the crash.
- Identify the app version that generated the crash. To find the app version that generates a crash beacon, perform the following steps:
- In the mobile app, open the Crashes tab and click a crash location, then click Analyze crashes. You can see the crash beacons for each occurrence of the crash.
- Click the beacon for the most recent occurrence of the crash (usually the topmost beacon).
- Scroll up the page and click Download to download the group of beacons associated with that crash.
- Open the downloaded JSON and search for the beacon with the
typefieldcrash. - In that beacon, check the
appVersionvalue to determine the version of the app that generates the crash.
- Confirm that you uploaded and committed the sourcemap files correctly. After your files are uploaded, validate the following elements in the
Symbol file upload configurationstable in the Stack trace translation menu in your mobile app Configuration tab:Files: The number of files for the uploaded configuration is as expected.Total size: The total size of the uploaded sourcemap files listed is as expected.Blobs uploaded: The number of blobs uploaded is the total number of blobs that the sourcemap file was split into.Commit status: The commit status displaysSuccess. If theCommit statusshows-, call theCommit uploadAPI as described in step 5 of the Uploading dSYM files or Uploading mapping files instructions.
I have already uploaded and committed the source map/symbol files, but older crashes are not translated.
Instana does not support retroactive crash translation. Instana translates only the crashes that occur after the source maps/symbol are properly uploaded and committed.
I am not able to see the translated crash logs
Make sure that your agent is updated to the latest version. You can view the change logs here:
- Android: android-agent-change-log
- iOS: ios-agent-change-log
If you followed all these steps and still cannot see translated crash logs, reach out to Instana Support. If possible, include the sourcemap or dSYM file in your support ticket, to effectively debug the issue.