Skip to content

Commit 261475d

Browse files
philipphofmannAlex Krawieclizokm
authored
feat(apple): Add docs for app hangs v2 (#11458)
Add docs for the experimental feature app hangs V2 for the Cocoa SDK. Co-authored-by: Alex Krawiec <[email protected]> Co-authored-by: Liza Mock <[email protected]>
1 parent f51a974 commit 261475d

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

docs/platforms/apple/common/configuration/app-hangs.mdx

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,53 @@ SentrySDK.resumeAppHangTracking()
130130
[SentrySDK resumeAppHangTracking];
131131

132132
```
133+
134+
### App Hangs V2
135+
136+
<Note>
137+
138+
This feature is experimental and may have bugs.
139+
140+
</Note>
141+
142+
As of version 8.37.0, you can enable AppHangsV2, which is available on iOS and tvOS. The main difference is that AppHangsV2 differentiates between fully-blocking and non-fully-blocking app hangs, which you might choose to ignore. A fully-blocking app hang is when the main thread is stuck completely, and the app can't render a single frame. A non-fully-blocking app hang is when the app appears stuck to the user, but can still render a few frames. Fully-blocking app hangs are more actionable because the stacktrace shows the exact blocking location on the main thread. Non-fully-blocking app hangs can have a stacktrace that doesn't highlight the exact blocking location, since the main thread isn't completely blocked.
143+
144+
To enable the feature:
145+
146+
```swift {tabTitle:Swift}
147+
import Sentry
148+
149+
SentrySDK.start { options in
150+
options.dsn = "___PUBLIC_DSN___"
151+
options.enableAppHangTrackingV2 = true
152+
}
153+
```
154+
155+
```objc {tabTitle:Objective-C}
156+
@import Sentry;
157+
158+
[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
159+
options.dsn = @"___PUBLIC_DSN___";
160+
options.enableAppHangTrackingV2 = YES;
161+
}];
162+
```
163+
164+
As stacktraces might not be 100% accurate for non-fully-blocking app hangs, you can disable them with the option `enableReportNonFullyBlockingAppHangs`:
165+
166+
```swift {tabTitle:Swift}
167+
import Sentry
168+
169+
SentrySDK.start { options in
170+
options.dsn = "___PUBLIC_DSN___"
171+
options.enableReportNonFullyBlockingAppHangs = false
172+
}
173+
```
174+
175+
```objc {tabTitle:Objective-C}
176+
@import Sentry;
177+
178+
[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
179+
options.dsn = @"___PUBLIC_DSN___";
180+
options.enableReportNonFullyBlockingAppHangs = NO;
181+
}];
182+
```

0 commit comments

Comments
 (0)