Product Benefits Pricing Guides Docs About Contact us Try it out
Performance

Sentry Cocoa False Watchdog Termination Tracking

Sentry Cocoa watchdog termination tracking: stop false reports after SentrySDK.close() and flush transactions safely with SDK 9.32.0.

· 3 min read

A false alarm in crash reporting is worse than a quiet dashboard. If your team sees “watchdog termination” events that never happened, people stop trusting the data, and a real launch problem gets lost in the noise.

Sentry Cocoa 9.32.0 fixes a case of this. After you call SentrySDK.close(), the next launch could report a watchdog termination even though the app was closed on purpose. The same release makes flush and close wait for transactions that are still being captured on a background thread, and keeps pending Session Replay video when replay.stop() follows flush().

Data Points to Track

  • watchdog_termination_count per release, per day
  • launches_after_close, the count of launches that follow a deliberate SDK close
  • close_reason (logout, consent withdrawn, test reset, environment switch)
  • transactions_pending_at_close and transactions_delivered_after_flush
  • replay_segments_lost after stop and flush
  • sdk_version and app_version
  • os_version and device_model
  • time_since_last_launch to spot repeated reopen patterns

Setup Steps

  1. Find every call to SentrySDK.close() in your app. Common places are logout, consent screens and debug menus.
  2. Log a local event with a close_reason each time, so you can match it with later reports.
  3. Upgrade to Sentry Cocoa 9.32.0 or later.
  4. Call flush before close if you need pending transactions delivered, and give it a sensible timeout.
  5. Test the sequence: start, close, kill, relaunch. Confirm no watchdog report appears.
  6. Compare watchdog counts for two releases before and after the upgrade.
  7. Filter your dashboard so legitimate watchdog terminations, caused by real main thread blocks, stay visible.

Actionable Insights

First, check whether watchdog reports cluster after launches that follow a close. If they do, you were looking at false positives, and your true watchdog rate is lower than it seemed. Update any targets or alerts that were set using the inflated number.

Second, if watchdog reports remain after the upgrade, they are probably real. Look at launch time, main thread work and what ran in the first seconds. Those are the cases worth engineering time.

Third, review how often you close the SDK. Apps that close and restart it on every consent change may lose data in the gap. Reduce that churn where you can, and always flush first.

Lastly, check that transactions and replays still arrive for sessions that end in a close. Missing tail data in those sessions can make a flow look shorter or more broken than it was.

Document what you learn. A short note in your release checklist, covering when the SDK is closed, why, and what you expect on the next launch, saves the next engineer from chasing the same ghost. It also makes it easy to explain any change in watchdog numbers to product managers, who usually only see the chart.