Skip to content
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
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

### Fixes

- Drastically improved performance of scope sync when targeting Android ([#2107](https://github.com/getsentry/sentry-unity/pull/2107))
- When targeting macOS, the SDK no longer fails to sync the scope to native events ([#2104](https://github.com/getsentry/sentry-unity/pull/2104))
- Updated the options grouping in the configuration window ([#2121](https://github.com/getsentry/sentry-unity/pull/2121))

### Features

- The trace used to connect errors on different layers of your game now gets regenerated every time the app gains focus again, or the active scene changes ([#2123](https://github.com/getsentry/sentry-unity/pull/2123))
- The SDK now links errors and events (managed and native errors) via `trace ID`. This allows you to correlate events captured from different layers of your game ([#1997](https://github.com/getsentry/sentry-unity/pull/1997), [#2089](https://github.com/getsentry/sentry-unity/pull/2089), [#2106](https://github.com/getsentry/sentry-unity/pull/2106))
- Drastically improved performance of scope sync when targeting Android ([#2107](https://github.com/getsentry/sentry-unity/pull/2107))
- The trace used to connect errors on different layers of your game gets regenerated every time the app gains focus, or the active scene changes ([#2123](https://github.com/getsentry/sentry-unity/pull/2123))
- The SDK now reports the game's name as part of the app context ([2083](https://github.com/getsentry/sentry-unity/pull/2083))
- The SDK now reports the active scene's name as part of the `Unity Context` ([2084](https://github.com/getsentry/sentry-unity/pull/2084))

Expand Down
212 changes: 84 additions & 128 deletions src/Sentry.Unity.Editor/ConfigurationWindow/AdvancedTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,140 +6,110 @@ namespace Sentry.Unity.Editor.ConfigurationWindow;

internal static class AdvancedTab
{
private static bool UnfoldFailedStatusCodeRanges;
private static bool UnfoldAutomaticOptions;
private static bool UnfoldNativeOptions;

internal static void Display(ScriptableSentryUnityOptions options, SentryCliOptions? cliOptions)
{
UnfoldAutomaticOptions = EditorGUILayout.BeginFoldoutHeaderGroup(UnfoldAutomaticOptions, "Automatic Behaviour");
EditorGUI.indentLevel++;
if (UnfoldAutomaticOptions)
{
options.AutoSessionTracking = EditorGUILayout.BeginToggleGroup(
new GUIContent("Auto Session Tracking", "Whether the SDK should start and end sessions " +
"automatically. If the timeout is reached the old session will" +
"be ended and a new one started."),
options.AutoSessionTracking);

options.AutoSessionTrackingInterval = EditorGUILayout.IntField(
new GUIContent("Session Timeout [ms]", "The duration of time a session can stay paused " +
"(i.e. the application has been put in the background) before " +
"it is considered ended."),
options.AutoSessionTrackingInterval);
options.AutoSessionTrackingInterval = Mathf.Max(0, options.AutoSessionTrackingInterval);
EditorGUILayout.EndToggleGroup();
}

EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();

{
options.AnrDetectionEnabled = EditorGUILayout.BeginToggleGroup(
new GUIContent("ANR Detection", "Whether the SDK should report 'Application Not " +
"Responding' events."),
options.AnrDetectionEnabled);

options.AnrTimeout = EditorGUILayout.IntField(
new GUIContent("ANR Timeout [ms]", "The duration in [ms] for how long the game has to be unresponsive " +
"before an ANR event is reported.\nDefault: 5000ms"),
options.AnrTimeout);
options.AnrTimeout = Math.Max(0, options.AnrTimeout);

EditorGUILayout.EndToggleGroup();
}

EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();

{
options.CaptureFailedRequests = EditorGUILayout.BeginToggleGroup(
new GUIContent("Capture Failed HTTP Requests",
"Whether the SDK should capture failed HTTP requests. This works out of the box for iOS only" +
"For the C# layer you need to add the 'SentryHttpMessageHandler' to your HTTP Client."),
options.CaptureFailedRequests);

UnfoldFailedStatusCodeRanges = EditorGUILayout.BeginFoldoutHeaderGroup(UnfoldFailedStatusCodeRanges, "Failed Status Codes Ranges");
if (UnfoldFailedStatusCodeRanges)
{
var rangeCount = options.FailedRequestStatusCodes.Count / 2;
rangeCount = EditorGUILayout.IntField(
new GUIContent("Status Codes Range Count", "The amount of ranges of HTTP status codes to capture."),
rangeCount);

// Because it's a range, we need to double the count
rangeCount *= 2;

if (rangeCount <= 0)
{
options.FailedRequestStatusCodes.Clear();
}

if (rangeCount < options.FailedRequestStatusCodes.Count)
{
options.FailedRequestStatusCodes.RemoveRange(rangeCount, options.FailedRequestStatusCodes.Count - rangeCount);
}
options.AutoSessionTracking = EditorGUILayout.BeginToggleGroup(
new GUIContent("Auto Session Tracking", "Whether the SDK should start and end sessions " +
"automatically. If the timeout is reached the old session will" +
"be ended and a new one started."),
options.AutoSessionTracking);

EditorGUI.indentLevel++;
options.AutoSessionTrackingInterval = EditorGUILayout.IntField(
new GUIContent("Timeout [ms]", "The duration of time a session can stay paused " +
"(i.e. the application has been put in the background) before " +
"it is considered ended."),
options.AutoSessionTrackingInterval);
options.AutoSessionTrackingInterval = Mathf.Max(0, options.AutoSessionTrackingInterval);
EditorGUI.indentLevel--;
EditorGUILayout.EndToggleGroup();
}

if (rangeCount > options.FailedRequestStatusCodes.Count)
{
var rangedToAdd = rangeCount - options.FailedRequestStatusCodes.Count;
for (var i = 0; i < rangedToAdd; i += 2)
{
options.FailedRequestStatusCodes.Add(500);
options.FailedRequestStatusCodes.Add(599);
}
}
EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();

for (var i = 0; i < options.FailedRequestStatusCodes.Count; i += 2)
{
GUILayout.BeginHorizontal();
{
options.AnrDetectionEnabled = EditorGUILayout.BeginToggleGroup(
new GUIContent("ANR Detection", "Whether the SDK should report 'Application Not " +
"Responding' events."),
options.AnrDetectionEnabled);
EditorGUI.indentLevel++;

options.AnrTimeout = EditorGUILayout.IntField(
new GUIContent("Timeout [ms]",
"The duration in [ms] for how long the game has to be unresponsive " +
"before an ANR event is reported.\nDefault: 5000ms"),
options.AnrTimeout);
options.AnrTimeout = Math.Max(0, options.AnrTimeout);

EditorGUI.indentLevel--;
EditorGUILayout.EndToggleGroup();
}

options.FailedRequestStatusCodes[i] = EditorGUILayout.IntField("Start", options.FailedRequestStatusCodes[i]);
options.FailedRequestStatusCodes[i + 1] = EditorGUILayout.IntField("End", options.FailedRequestStatusCodes[i + 1]);
EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();

GUILayout.EndHorizontal();
}
{
GUILayout.Label("Automatic Exception Filter", EditorStyles.boldLabel);

options.FilterBadGatewayExceptions = EditorGUILayout.Toggle(
new GUIContent("BadGatewayException", "Whether the SDK automatically filters Bad Gateway " +
"exceptions before they are being sent to Sentry."),
options.FilterBadGatewayExceptions);

options.FilterWebExceptions = EditorGUILayout.Toggle(
new GUIContent("WebException", "Whether the SDK automatically filters " +
"System.Net.WebException before they are being sent to Sentry."),
options.FilterWebExceptions);

options.FilterSocketExceptions = EditorGUILayout.Toggle(
new GUIContent("SocketException", "Whether the SDK automatically filters " +
"System.Net.Sockets.SocketException with error code '10049' from " +
"being sent to Sentry."),
options.FilterSocketExceptions);
}

EditorGUILayout.EndFoldoutHeaderGroup();
EditorGUILayout.EndToggleGroup();
EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();
}

EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();
EditorGUI.indentLevel--;
EditorGUILayout.EndFoldoutHeaderGroup();

UnfoldNativeOptions = EditorGUILayout.BeginFoldoutHeaderGroup(UnfoldNativeOptions, "Native Support");
EditorGUI.indentLevel++;
if (UnfoldNativeOptions)
{
GUILayout.Label("Automatic Exception Filter", EditorStyles.boldLabel);

options.FilterBadGatewayExceptions = EditorGUILayout.Toggle(
new GUIContent("BadGatewayException", "Whether the SDK automatically filters Bad Gateway " +
"exceptions before they are being sent to Sentry."),
options.FilterBadGatewayExceptions);

options.FilterWebExceptions = EditorGUILayout.Toggle(
new GUIContent("WebException", "Whether the SDK automatically filters " +
"System.Net.WebException before they are being sent to Sentry."),
options.FilterWebExceptions);

options.FilterSocketExceptions = EditorGUILayout.Toggle(
new GUIContent("SocketException", "Whether the SDK automatically filters " +
"System.Net.Sockets.SocketException with error code '10049' from " +
"being sent to Sentry."),
options.FilterSocketExceptions);
}
options.WindowsNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Windows", "Whether to enable native crashes support on Windows."),
options.WindowsNativeSupportEnabled);

EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();
options.MacosNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("macOS", "Whether to enable native crashes support on macOS."),
options.MacosNativeSupportEnabled);

GUILayout.Label("Native Support", EditorStyles.boldLabel);
options.LinuxNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Linux", "Whether to enable native crashes support on Linux."),
options.LinuxNativeSupportEnabled);

{
options.IosNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("iOS Native Support", "Whether to enable Native iOS support to capture" +
new GUIContent("iOS", "Whether to enable Native iOS support to capture" +
"errors written in languages such as Objective-C, Swift, C and C++."),
options.IosNativeSupportEnabled);

options.AndroidNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Android Native Support", "Whether to enable Native Android support to " +
new GUIContent("Android", "Whether to enable Native Android support to " +
"capture errors written in languages such as Java, Kotlin, C and C++."),
options.AndroidNativeSupportEnabled);
#pragma warning disable CS0618
Expand All @@ -162,26 +132,12 @@ internal static void Display(ScriptableSentryUnityOptions options, SentryCliOpti
options.NdkScopeSyncEnabled);
EditorGUI.EndDisabledGroup();
EditorGUI.EndDisabledGroup();
options.PostGenerateGradleProjectCallbackOrder = EditorGUILayout.IntField(
new GUIContent("Android Callback Order", "Override the default callback order of " +
"Sentry Gradle modification script that adds Sentry dependencies " +
"to the gradle project files."),
options.PostGenerateGradleProjectCallbackOrder);
EditorGUI.indentLevel--;

options.WindowsNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Windows Native Support", "Whether to enable native crashes support on Windows."),
options.WindowsNativeSupportEnabled);

options.MacosNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("macOS Native Support", "Whether to enable native crashes support on macOS."),
options.MacosNativeSupportEnabled);

options.LinuxNativeSupportEnabled = EditorGUILayout.Toggle(
new GUIContent("Linux Native Support", "Whether to enable native crashes support on Linux."),
options.LinuxNativeSupportEnabled);
}

EditorGUI.indentLevel--;
EditorGUILayout.EndFoldoutHeaderGroup();

EditorGUILayout.Space();
EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray);
EditorGUILayout.Space();
Expand Down
Loading
Loading