impr: Deprecate App Hang tracking - #8944
Conversation
Warn users before the legacy integration is removed in v10 and direct them to MetricKit for system-provided hang diagnostics. Keep appHangTimeoutInterval supported because watchdog termination classification still uses it in v10.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 543613f. Configure here.
📲 Install BuildsiOS
|
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| fc4e913 | 1231.79 ms | 1267.89 ms | 36.11 ms |
| 6f28fd8 | 1229.98 ms | 1271.73 ms | 41.75 ms |
| a7c42d9 | 1217.25 ms | 1253.98 ms | 36.73 ms |
| 230cc86 | 1225.33 ms | 1258.67 ms | 33.34 ms |
| 5556249 | 1208.87 ms | 1246.60 ms | 37.72 ms |
| 8ed81c1 | 1227.47 ms | 1249.24 ms | 21.77 ms |
| 92fada5 | 1217.60 ms | 1252.89 ms | 35.30 ms |
| 6d9f89d | 1226.37 ms | 1260.94 ms | 34.57 ms |
| 318f8af | 1213.09 ms | 1246.21 ms | 33.13 ms |
| 01ffe09 | 1208.52 ms | 1240.94 ms | 32.42 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| fc4e913 | 24.14 KiB | 1.17 MiB | 1.15 MiB |
| 6f28fd8 | 24.14 KiB | 1.30 MiB | 1.28 MiB |
| a7c42d9 | 24.14 KiB | 1.15 MiB | 1.13 MiB |
| 230cc86 | 24.14 KiB | 1.25 MiB | 1.23 MiB |
| 5556249 | 24.14 KiB | 1.29 MiB | 1.27 MiB |
| 8ed81c1 | 24.14 KiB | 1.23 MiB | 1.21 MiB |
| 92fada5 | 24.14 KiB | 1.17 MiB | 1.15 MiB |
| 6d9f89d | 24.14 KiB | 1.26 MiB | 1.23 MiB |
| 318f8af | 24.14 KiB | 1.30 MiB | 1.28 MiB |
| 01ffe09 | 24.14 KiB | 1.29 MiB | 1.27 MiB |
NinjaLikesCheez
left a comment
There was a problem hiding this comment.
Overall, LGTM - but I have 3 comments for your consideration before merging.
| @property (nonatomic) BOOL enableAppHangTracking | ||
| __attribute__((deprecated("App Hang tracking is deprecated and will be removed in v10 because " | ||
| "it can produce less relevant stack traces and false positives. " | ||
| "Migrate to MetricKit for system-provided hang diagnostics."))); |
There was a problem hiding this comment.
h: 'Migrate to MetricKit' is a little confusing - do you mean they should migrate to our MetricKit integration? If so, we should state more directly what a user should do and add a compiler fixit
| @property (nonatomic) BOOL enableAppHangTracking | |
| __attribute__((deprecated("App Hang tracking is deprecated and will be removed in v10 because " | |
| "it can produce less relevant stack traces and false positives. " | |
| "Migrate to MetricKit for system-provided hang diagnostics."))); | |
| @property (nonatomic) BOOL enableAppHangTracking | |
| __attribute__((deprecated("App Hang tracking is deprecated and will be removed in v10 because " | |
| "it can produce less relevant stack traces and false positives. " | |
| "Enable the MetricKit integration for system-provided hang diagnostics.", "enableMetricKit"))); |
There was a problem hiding this comment.
The same replacement could happen to the rest of the 'enableX' APIs
There was a problem hiding this comment.
I agree with @NinjaLikesCheez, enable enableMetrics sounds more natural and actionable
| #if !SDK_V10 | ||
| @objc public var enableReportNonFullyBlockingAppHangs: Bool { | ||
| get { wrapped.enableReportNonFullyBlockingAppHangs } | ||
| @available(*, deprecated, message: "App Hang tracking is deprecated and will be removed in v10 because it can produce less relevant stack traces and false positives. Migrate to MetricKit for system-provided hang diagnostics.") |
There was a problem hiding this comment.
Same as the objc version - we can (ab)use renamed: <...> to have a similar outcome for v9 users.
itaybre
left a comment
There was a problem hiding this comment.
LGTM after the wording changes
| @property (nonatomic) BOOL enableAppHangTracking | ||
| __attribute__((deprecated("App Hang tracking is deprecated and will be removed in v10 because " | ||
| "it can produce less relevant stack traces and false positives. " | ||
| "Migrate to MetricKit for system-provided hang diagnostics."))); |
There was a problem hiding this comment.
I agree with @NinjaLikesCheez, enable enableMetrics sounds more natural and actionable
|
Moving this PR back into draft until I have fully validated MetricKit hang diagnostics |

Deprecates the legacy App Hang tracking APIs before their removal in v10. The warnings explain that legacy tracking can produce less relevant stack traces and false positives, and direct users to MetricKit for system-provided hang diagnostics.
Compatibility
appHangTimeoutIntervalremains supported because v10 still uses it for watchdog termination classification. Tests continue exercising the deprecated APIs under explicit deprecation annotations or local Objective-C warning suppression.Related documentation: getsentry/sentry-docs#19263
Verification
make formatmake analyzemake generate-public-apimake build-ios FOR_AGENTS=truemake build-macos FOR_AGENTS=truemake test-ios FOR_AGENTS=trueSentryObjCTestson macOSCloses #5263
Closes #8945