Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add experimental EnableAppHangTrackingV2 configuration flag to the dotnet SDK #3877

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Features

- .NET on iOS: Add experimental EnableAppHangTrackingV2 configuration flag to the options binding SDK ([#3877](https://github.com/getsentry/sentry-dotnet/pull/3877))

### Fixes

- .NET Mobile: Disable and made obsolete the iOS Watchdog termination feature which is based on heuristics that don't work in .NET ([#3867](https://github.com/getsentry/sentry-dotnet/pull/3867))
Expand Down
2 changes: 2 additions & 0 deletions src/Sentry/Platforms/Cocoa/BindableSentryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class NativeOptions
public TimeSpan? AppHangTimeoutInterval { get; set; }
public TimeSpan? IdleTimeout { get; set; }
public bool? EnableAppHangTracking { get; set; }
public bool? EnableAppHangTrackingV2 { get; set; }
public bool? EnableAutoBreadcrumbTracking { get; set; }
public bool? EnableAutoPerformanceTracing { get; set; }
public bool? EnableCoreDataTracing { get; set; }
Expand All @@ -32,6 +33,7 @@ public void ApplyTo(SentryOptions.NativeOptions options)
options.AppHangTimeoutInterval = AppHangTimeoutInterval ?? options.AppHangTimeoutInterval;
options.IdleTimeout = IdleTimeout ?? options.IdleTimeout;
options.EnableAppHangTracking = EnableAppHangTracking ?? options.EnableAppHangTracking;
options.EnableAppHangTrackingV2 = EnableAppHangTrackingV2 ?? options.EnableAppHangTrackingV2;
options.EnableAutoBreadcrumbTracking = EnableAutoBreadcrumbTracking ?? options.EnableAutoBreadcrumbTracking;
options.EnableAutoPerformanceTracing = EnableAutoPerformanceTracing ?? options.EnableAutoPerformanceTracing;
options.EnableCoreDataTracing = EnableCoreDataTracing ?? options.EnableCoreDataTracing;
Expand Down
17 changes: 17 additions & 0 deletions src/Sentry/Platforms/Cocoa/SentryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ internal NativeOptions(SentryOptions options)
/// </remarks>
public bool EnableAppHangTracking { get; set; } = true;

/// <summary>
/// IMPORTANT: This feature is experimental and may have bugs.
/// <br/>
/// As of version 8.39.0-beta.1 of the sentry-cocoa SDK, 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.
/// </summary>
/// <remarks>
/// See https://docs.sentry.io/platforms/apple/configuration/app-hangs/#app-hangs-v2
/// </remarks>
public bool EnableAppHangTrackingV2 { get; set; } = true;

/// <summary>
/// When enabled, the SDK adds breadcrumbs for various system events.
/// The default value is <c>true</c> (enabled).
Expand Down
1 change: 1 addition & 0 deletions src/Sentry/Platforms/Cocoa/SentrySdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ private static void InitSentryCocoaSdk(SentryOptions options)
nativeOptions.IdleTimeout = options.Native.IdleTimeout.TotalSeconds;
nativeOptions.Dist = options.Distribution;
nativeOptions.EnableAppHangTracking = options.Native.EnableAppHangTracking;
nativeOptions.EnableAppHangTrackingV2 = options.Native.EnableAppHangTrackingV2;
nativeOptions.EnableAutoBreadcrumbTracking = options.Native.EnableAutoBreadcrumbTracking;
nativeOptions.EnableAutoPerformanceTracing = options.Native.EnableAutoPerformanceTracing;
nativeOptions.EnableCoreDataTracing = options.Native.EnableCoreDataTracing;
Expand Down
Loading