MetricKit Crash Fallback
Description
If SentryCrash cannot capture a crash report, the SDK can use MetricKit crash data as a fallback. This would increase the reliability of our SDK.
It can happen that SentryCrash can't capture and report some types of crashes MetricKit can. The watchdog termination integration currently reports such crashes as watchdog terminations. Before doing that, the SDK could wait for MetricKit to report a crash. If it does, the SDK creates a normal crash event and sends it to Sentry, instead of a watchdog termination event. Since iOS 15, this happens almost immediately when starting the app again after a crash.
The goal is not to replace SentryCrash with MetricKit, as with SentryCrash the SDK can store the app's current state to disk, which is impossible with MetricKit.
We have to ensure we dont have duplicate crashes report.
Another thing to consider is that if Sentry is able to capture an event, but MetricKit has an additional context (does it?), we could empower the error sent to Sentry with this extra context.
but MetricKit has an additional context (does it?)
I don't think that it has, but worth investigating.
Hi @philipphofmann,
We are seeing a number of watchdog termination errors reported in Sentry. Unfortunately, we haven't been able to reproduce on a local build and the breadcrumbs we have at the moment don't seem to help us much. In the issue description, this piece caught my eye:
It can happen that SentryCrash can't capture and report some types of crashes MetricKit can. The watchdog termination integration currently reports such crashes as watchdog terminations.
Checking my understanding here... could we be seeing watchdog termination errors reported simply because the sentry SDK wasn't able to capture and report what the crash was? In some cases, it sounds like watchdog termination is the fallback that sentry reports?
Checking my understanding here... could we be seeing watchdog termination errors reported simply because the sentry SDK wasn't able to capture and report what the crash was? In some cases, it sounds like watchdog termination is the fallback that sentry reports?
Yes, that could be the case, @chaseklingelzen. We don't expect the number to be high, though, and we haven't heard anything like that from our users yet, but you never know. Implementing this issue would tell us how high that number is.
Checking my understanding here... could we be seeing watchdog termination errors reported simply because the sentry SDK wasn't able to capture and report what the crash was? In some cases, it sounds like watchdog termination is the fallback that sentry reports?
Yes, that could be the case, @chaseklingelzen. We don't expect the number to be high, though, and we haven't heard anything like that from our users yet, but you never know. Implementing this issue would tell us how high that number is.
Great, thanks @philipphofmann!