From 65c3d04de63229e2979a3d1a0c4276d5b59f8513 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 17 Apr 2025 15:33:36 +0200 Subject: [PATCH 1/8] added logging tab --- .../ConfigurationWindow/CoreTab.cs | 32 ---- .../ConfigurationWindow/EnrichmentTab.cs | 142 ++++++------------ .../ConfigurationWindow/LoggingTab.cs | 103 +++++++++++++ .../ConfigurationWindow/SentryWindow.cs | 14 +- 4 files changed, 158 insertions(+), 133 deletions(-) create mode 100644 src/Sentry.Unity.Editor/ConfigurationWindow/LoggingTab.cs diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs index cc4143427..86938c921 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs @@ -53,38 +53,6 @@ internal static void Display(ScriptableSentryUnityOptions options) EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); EditorGUILayout.Space(); - { - options.EnableLogDebouncing = EditorGUILayout.BeginToggleGroup( - new GUIContent("Enable Log Debouncing", "The SDK debounces log messages of the " + - "same type if they are more frequent than once per second."), - options.EnableLogDebouncing); - - options.DebounceTimeLog = EditorGUILayout.IntField( - new GUIContent("Log Debounce [ms]", "The time that has to pass between events of " + - "LogType.Log before the SDK sends it again."), - options.DebounceTimeLog); - options.DebounceTimeLog = Math.Max(0, options.DebounceTimeLog); - - options.DebounceTimeWarning = EditorGUILayout.IntField( - new GUIContent("Warning Debounce [ms]", "The time that has to pass between events of " + - "LogType.Warning before the SDK sends it again."), - options.DebounceTimeWarning); - options.DebounceTimeWarning = Math.Max(0, options.DebounceTimeWarning); - - options.DebounceTimeError = EditorGUILayout.IntField( - new GUIContent("Error Debounce [ms]", "The time that has to pass between events of " + - "LogType.Assert, LogType.Exception and LogType.Error before " + - "the SDK sends it again."), - options.DebounceTimeError); - options.DebounceTimeError = Math.Max(0, options.DebounceTimeError); - - EditorGUILayout.EndToggleGroup(); - } - - EditorGUILayout.Space(); - EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); - EditorGUILayout.Space(); - { GUILayout.Label("Tracing - Performance Monitoring", EditorStyles.boldLabel); diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs index 5fc269801..dec037b9e 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs @@ -1,4 +1,3 @@ -using System; using UnityEditor; using UnityEngine; @@ -8,44 +7,9 @@ internal static class EnrichmentTab { internal static void Display(ScriptableSentryUnityOptions options) { - GUILayout.Label("Tag Overrides", EditorStyles.boldLabel); - - options.ReleaseOverride = EditorGUILayout.TextField( - new GUIContent("Override Release", "By default release is built from the Application info as: " + - "\"{productName}@{version}+{buildGUID}\". " + - "\nThis option is an override."), - options.ReleaseOverride); - - options.EnvironmentOverride = EditorGUILayout.TextField( - new GUIContent("Override Environment", "Auto detects 'production' or 'editor' by " + - "default based on 'Application.isEditor." + - "\nThis option is an override."), - options.EnvironmentOverride); - - EditorGUILayout.Space(); - EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); - EditorGUILayout.Space(); - - GUILayout.Label("Stacktrace", EditorStyles.boldLabel); - - options.AttachStacktrace = EditorGUILayout.Toggle( - new GUIContent("Stacktrace For Logs", "Whether to include a stack trace for non " + - "error events like logs. Even when Unity didn't include and no " + - "exception was thrown. Refer to AttachStacktrace on sentry docs."), - options.AttachStacktrace); - - // Enhanced not supported on IL2CPP so not displaying this for the time being: - // Options.StackTraceMode = (StackTraceMode) EditorGUILayout.EnumPopup( - // new GUIContent("Stacktrace Mode", "Enhanced is the default." + - // "\n - Enhanced: Include async, return type, args,..." + - // "\n - Original - Default .NET stack trace format."), - // Options.StackTraceMode); - - EditorGUILayout.Space(); - EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); - EditorGUILayout.Space(); - { + GUILayout.Label("If the SDK should include data that potentially includes PII, such as Machine Name", EditorStyles.boldLabel); + options.SendDefaultPii = EditorGUILayout.BeginToggleGroup( new GUIContent("Send default PII", "Whether to include default Personal Identifiable " + "Information."), @@ -63,77 +27,63 @@ internal static void Display(ScriptableSentryUnityOptions options) EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); EditorGUILayout.Space(); - GUILayout.Label("Automatically capture and send events for:", EditorStyles.boldLabel); - EditorGUILayout.Space(); - - options.CaptureLogErrorEvents = EditorGUILayout.Toggle( - new GUIContent("Debug.LogError", "Whether the SDK automatically captures events for 'Debug.LogError'."), - options.CaptureLogErrorEvents); - - EditorGUILayout.Space(); - GUILayout.Label("Automatically create breadcrumbs for:", EditorStyles.boldLabel); - EditorGUILayout.Space(); + { + GUILayout.Label("Tag Overrides", EditorStyles.boldLabel); - options.BreadcrumbsForLogs = EditorGUILayout.Toggle( - new GUIContent("Debug.Log", "Whether the SDK automatically adds breadcrumbs 'Debug.Log'."), - options.BreadcrumbsForLogs); - options.BreadcrumbsForWarnings = EditorGUILayout.Toggle( - new GUIContent("Debug.Warning", "Whether the SDK automatically adds breadcrumbs for 'Debug.LogWarning'."), - options.BreadcrumbsForWarnings); - options.BreadcrumbsForAsserts = EditorGUILayout.Toggle( - new GUIContent("Debug.Assert", "Whether the SDK automatically adds breadcrumbs for 'Debug.Assert'."), - options.BreadcrumbsForAsserts); - options.BreadcrumbsForErrors = EditorGUILayout.Toggle( - new GUIContent("Debug.Error", "Whether the SDK automatically adds breadcrumbs for 'Debug.LogError'."), - options.BreadcrumbsForErrors); - options.BreadcrumbsForExceptions = EditorGUILayout.Toggle( - new GUIContent("Debug.Exception", "Whether the SDK automatically adds breadcrumbs for exceptions and 'Debug.LogException'."), - options.BreadcrumbsForExceptions); + options.ReleaseOverride = EditorGUILayout.TextField( + new GUIContent("Override Release", "By default release is built from the Application info as: " + + "\"{productName}@{version}+{buildGUID}\". " + + "\nThis option is an override."), + options.ReleaseOverride); + + options.EnvironmentOverride = EditorGUILayout.TextField( + new GUIContent("Override Environment", "Auto detects 'production' or 'editor' by " + + "default based on 'Application.isEditor." + + "\nThis option is an override."), + options.EnvironmentOverride); + + options.ReportAssembliesMode = (ReportAssembliesMode)EditorGUILayout.EnumPopup( + new GUIContent("Report Assemblies Mode", "Whether or not to include referenced assemblies " + + "Version or InformationalVersion in each event sent to sentry."), + options.ReportAssembliesMode); + } EditorGUILayout.Space(); EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); EditorGUILayout.Space(); - options.MaxBreadcrumbs = EditorGUILayout.IntField( - new GUIContent("Max Breadcrumbs", "Maximum number of breadcrumbs that get captured." + - "\nDefault: 100"), - options.MaxBreadcrumbs); - options.MaxBreadcrumbs = Math.Max(0, options.MaxBreadcrumbs); + { + GUILayout.Label("Capture Screenshots", EditorStyles.boldLabel); + + options.AttachScreenshot = EditorGUILayout.BeginToggleGroup( + new GUIContent("Attach Screenshot", "Try to attach current screenshot on events.\n" + + "This is an early-access feature and may not work on all platforms (it is explicitly disabled on WebGL).\n" + + "Additionally, the screenshot is captured mid-frame, when an event happens, so it may be incomplete.\n" + + "A screenshot might not be able to be attached, for example when the error happens on a background thread."), + options.AttachScreenshot); + + options.ScreenshotQuality = (ScreenshotQuality)EditorGUILayout.EnumPopup( + new GUIContent("Quality", "The resolution quality of the screenshot.\n" + + "'Full': Fully of the current resolution\n" + + "'High': 1080p\n" + + "'Medium': 720p\n" + + "'Low': 480p"), + options.ScreenshotQuality); + + options.ScreenshotCompression = EditorGUILayout.IntSlider( + new GUIContent("Compression", "The compression of the screenshot."), + options.ScreenshotCompression, 1, 100); - options.ReportAssembliesMode = (ReportAssembliesMode)EditorGUILayout.EnumPopup( - new GUIContent("Report Assemblies Mode", "Whether or not to include referenced assemblies " + - "Version or InformationalVersion in each event sent to sentry."), - options.ReportAssembliesMode); + EditorGUILayout.EndToggleGroup(); + } EditorGUILayout.Space(); EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); EditorGUILayout.Space(); - options.AttachScreenshot = EditorGUILayout.BeginToggleGroup( - new GUIContent("Attach Screenshot", "Try to attach current screenshot on events.\n" + - "This is an early-access feature and may not work on all platforms (it is explicitly disabled on WebGL).\n" + - "Additionally, the screenshot is captured mid-frame, when an event happens, so it may be incomplete.\n" + - "A screenshot might not be able to be attached, for example when the error happens on a background thread."), - options.AttachScreenshot); - - options.ScreenshotQuality = (ScreenshotQuality)EditorGUILayout.EnumPopup( - new GUIContent("Quality", "The resolution quality of the screenshot.\n" + - "'Full': Fully of the current resolution\n" + - "'High': 1080p\n" + - "'Medium': 720p\n" + - "'Low': 480p"), - options.ScreenshotQuality); - - options.ScreenshotCompression = EditorGUILayout.IntSlider( - new GUIContent("Compression", "The compression of the screenshot."), - options.ScreenshotCompression, 1, 100); - - EditorGUILayout.EndToggleGroup(); - - EditorGUILayout.Space(); - EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); - EditorGUILayout.Space(); { + GUILayout.Label("Capture Scene Hierarchy", EditorStyles.boldLabel); + options.AttachViewHierarchy = EditorGUILayout.BeginToggleGroup( new GUIContent("Attach Hierarchy", "Try to attach the current scene's hierarchy."), options.AttachViewHierarchy); diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/LoggingTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/LoggingTab.cs new file mode 100644 index 000000000..fecbc33a6 --- /dev/null +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/LoggingTab.cs @@ -0,0 +1,103 @@ +using System; +using UnityEditor; +using UnityEngine; + +namespace Sentry.Unity.Editor.ConfigurationWindow; + +internal static class LoggingTab +{ + internal static void Display(ScriptableSentryUnityOptions options) + { + { + options.MaxBreadcrumbs = EditorGUILayout.IntField( + new GUIContent("Max Breadcrumbs", "Maximum number of breadcrumbs that get captured." + + "\nDefault: 100"), + options.MaxBreadcrumbs); + options.MaxBreadcrumbs = Math.Max(0, options.MaxBreadcrumbs); + } + + EditorGUILayout.Space(); + EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); + EditorGUILayout.Space(); + + { + options.EnableLogDebouncing = EditorGUILayout.BeginToggleGroup( + new GUIContent("Enable Log Debouncing", "The SDK debounces log messages of the " + + "same type if they are more frequent than once per second."), + options.EnableLogDebouncing); + + options.DebounceTimeLog = EditorGUILayout.IntField( + new GUIContent("Log Debounce [ms]", "The time that has to pass between events of " + + "LogType.Log before the SDK sends it again."), + options.DebounceTimeLog); + options.DebounceTimeLog = Math.Max(0, options.DebounceTimeLog); + + options.DebounceTimeWarning = EditorGUILayout.IntField( + new GUIContent("Warning Debounce [ms]", "The time that has to pass between events of " + + "LogType.Warning before the SDK sends it again."), + options.DebounceTimeWarning); + options.DebounceTimeWarning = Math.Max(0, options.DebounceTimeWarning); + + options.DebounceTimeError = EditorGUILayout.IntField( + new GUIContent("Error Debounce [ms]", "The time that has to pass between events of " + + "LogType.Assert, LogType.Exception and LogType.Error before " + + "the SDK sends it again."), + options.DebounceTimeError); + options.DebounceTimeError = Math.Max(0, options.DebounceTimeError); + + EditorGUILayout.EndToggleGroup(); + } + + EditorGUILayout.Space(); + EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); + EditorGUILayout.Space(); + + { + GUILayout.Label("Automatically capture and send events for:", EditorStyles.boldLabel); + + options.CaptureLogErrorEvents = EditorGUILayout.Toggle( + new GUIContent("Debug.LogError", "Whether the SDK automatically captures events for 'Debug.LogError'."), + options.CaptureLogErrorEvents); + + EditorGUILayout.Space(); + GUILayout.Label("Automatically add breadcrumbs for:", EditorStyles.boldLabel); + + options.BreadcrumbsForLogs = EditorGUILayout.Toggle( + new GUIContent("Debug.Log", "Whether the SDK automatically adds breadcrumbs 'Debug.Log'."), + options.BreadcrumbsForLogs); + options.BreadcrumbsForWarnings = EditorGUILayout.Toggle( + new GUIContent("Debug.Warning", "Whether the SDK automatically adds breadcrumbs for 'Debug.LogWarning'."), + options.BreadcrumbsForWarnings); + options.BreadcrumbsForAsserts = EditorGUILayout.Toggle( + new GUIContent("Debug.Assert", "Whether the SDK automatically adds breadcrumbs for 'Debug.Assert'."), + options.BreadcrumbsForAsserts); + options.BreadcrumbsForErrors = EditorGUILayout.Toggle( + new GUIContent("Debug.Error", "Whether the SDK automatically adds breadcrumbs for 'Debug.LogError'."), + options.BreadcrumbsForErrors); + options.BreadcrumbsForExceptions = EditorGUILayout.Toggle( + new GUIContent("Debug.Exception", "Whether the SDK automatically adds breadcrumbs for exceptions and 'Debug.LogException'."), + options.BreadcrumbsForExceptions); + } + + EditorGUILayout.Space(); + EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); + EditorGUILayout.Space(); + + { + GUILayout.Label("Create and attach stack trace when capturing a log message. These will not contain line numbers.", EditorStyles.boldLabel); + + options.AttachStacktrace = EditorGUILayout.Toggle( + new GUIContent("Attach Stack Trace", "Whether to include a stack trace for non " + + "error events like logs. Even when Unity didn't include and no " + + "exception was thrown. Refer to AttachStacktrace on sentry docs."), + options.AttachStacktrace); + + // Enhanced not supported on IL2CPP so not displaying this for the time being: + // Options.StackTraceMode = (StackTraceMode) EditorGUILayout.EnumPopup( + // new GUIContent("Stacktrace Mode", "Enhanced is the default." + + // "\n - Enhanced: Include async, return type, args,..." + + // "\n - Original - Default .NET stack trace format."), + // Options.StackTraceMode); + } + } +} diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs index 054b8e28a..2b9c60fc5 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs @@ -35,7 +35,7 @@ public static void OnMenuClick() public static void OpenSentryWindow() { Instance = GetWindow(); - Instance.minSize = new Vector2(600, 420); + Instance.minSize = new Vector2(800, 600); } public static SentryWindow? Instance; @@ -53,6 +53,7 @@ public static void OpenSentryWindow() private readonly string[] _tabs = { "Core", + "Logging", "Enrichment", "Transport", "Advanced", @@ -137,18 +138,21 @@ private void OnGUI() CoreTab.Display(Options); break; case 1: - EnrichmentTab.Display(Options); + LoggingTab.Display(Options); break; case 2: - TransportTab.Display(Options); + EnrichmentTab.Display(Options); break; case 3: - AdvancedTab.Display(Options, CliOptions); + TransportTab.Display(Options); break; case 4: - OptionsConfigurationTab.Display(Options); + AdvancedTab.Display(Options, CliOptions); break; case 5: + OptionsConfigurationTab.Display(Options); + break; + case 6: DebugSymbolsTab.Display(CliOptions); break; default: From 2603a43ee05c3f18fbea61b49102641e3559e2cf Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 17 Apr 2025 15:57:30 +0200 Subject: [PATCH 2/8] . --- .../ConfigurationWindow/CoreTab.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs index 86938c921..8c277314f 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs @@ -56,28 +56,32 @@ internal static void Display(ScriptableSentryUnityOptions options) { GUILayout.Label("Tracing - Performance Monitoring", EditorStyles.boldLabel); - options.TracesSampleRate = EditorGUILayout.Slider( + var sampleRate = EditorGUILayout.FloatField( new GUIContent("Traces Sample Rate", "Indicates the percentage of transactions that are " + "captured. Setting this to 0 discards all trace data. " + "Setting this to 1.0 captures all."), - (float)options.TracesSampleRate, 0.0f, 1.0f); + (float)options.TracesSampleRate); + options.TracesSampleRate = Mathf.Clamp01(sampleRate); EditorGUI.BeginDisabledGroup(options.TracesSampleRate <= 0); + EditorGUILayout.Space(); + GUILayout.Label("Auto Instrumentation", EditorStyles.boldLabel); + options.AutoStartupTraces = EditorGUILayout.Toggle( - new GUIContent("Auto Startup Traces ", "Whether the SDK should automatically create " + + new GUIContent("Startup Traces ", "Whether the SDK should automatically create " + "traces during startup. This integration is currently " + "unavailable on WebGL."), options.AutoStartupTraces); options.AutoSceneLoadTraces = EditorGUILayout.Toggle( - new GUIContent("Auto Scene Traces ", "Whether the SDK should automatically create traces " + + new GUIContent("Scene Traces ", "Whether the SDK should automatically create traces " + "during scene loading. Requires Unity 2020.3 or newer."), options.AutoSceneLoadTraces); EditorGUILayout.Space(); - GUILayout.Label("Auto Instrumentation - Experimental", EditorStyles.boldLabel); + GUILayout.Label("Instrumentation through IL Weaving", EditorStyles.boldLabel); EditorGUILayout.HelpBox("The SDK will modify the compiled assembly during a post build step " + "to create transaction and spans automatically.", MessageType.Info); From e41f7a11e9b4c1e7671c36dc71738425323bce09 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 24 Apr 2025 13:49:30 +0200 Subject: [PATCH 3/8] window facelift #2 --- .../ConfigurationWindow/AdvancedTab.cs | 212 +++++++----------- .../ConfigurationWindow/CoreTab.cs | 16 +- .../ConfigurationWindow/DebugSymbolsTab.cs | 5 +- .../ConfigurationWindow/EnrichmentTab.cs | 69 +++--- .../ConfigurationWindow/LoggingTab.cs | 34 +-- .../OptionsConfigurationTab.cs | 2 + .../ConfigurationWindow/SentryWindow.cs | 3 + .../ConfigurationWindow/TransportTab.cs | 85 ++++--- 8 files changed, 204 insertions(+), 222 deletions(-) diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/AdvancedTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/AdvancedTab.cs index 2c1ecc8f1..775757a1a 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/AdvancedTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/AdvancedTab.cs @@ -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 @@ -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(); diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs index 8c277314f..d81b168a4 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/CoreTab.cs @@ -9,8 +9,6 @@ internal static class CoreTab internal static void Display(ScriptableSentryUnityOptions options) { { - GUILayout.Label("Base Options", EditorStyles.boldLabel); - options.Dsn = EditorGUILayout.TextField( new GUIContent("DSN", "The URL to your Sentry project. " + "Get yours on sentry.io -> Project Settings."), @@ -21,6 +19,15 @@ internal static void Display(ScriptableSentryUnityOptions options) EditorGUILayout.HelpBox("The SDK requires a DSN.", MessageType.Error); } + var sampleRate = EditorGUILayout.FloatField( + new GUIContent("Event Sample Rate", "Indicates the percentage of events that are " + + "captured. Setting this to 0.1 captures 10% of events. " + + "Setting this to 1.0 captures all events." + + "\nThis affects only errors and logs, not performance " + + "(transactions) data. See TraceSampleRate for that."), + options.SampleRate); + options.SampleRate = Mathf.Clamp01(sampleRate); + options.CaptureInEditor = EditorGUILayout.Toggle( new GUIContent("Capture In Editor", "Capture errors while running in the Editor."), options.CaptureInEditor); @@ -36,6 +43,7 @@ internal static void Display(ScriptableSentryUnityOptions options) "diagnostic logs to the console."), options.Debug); + EditorGUI.indentLevel++; options.DebugOnlyInEditor = EditorGUILayout.Toggle( new GUIContent("Only In Editor", "Only print logs when in the editor. Development " + "builds of the player will not include Sentry's SDK diagnostics."), @@ -46,6 +54,7 @@ internal static void Display(ScriptableSentryUnityOptions options) "Log messages with a level below this level are dropped."), options.DiagnosticLevel); + EditorGUI.indentLevel--; EditorGUILayout.EndToggleGroup(); } @@ -55,6 +64,7 @@ internal static void Display(ScriptableSentryUnityOptions options) { GUILayout.Label("Tracing - Performance Monitoring", EditorStyles.boldLabel); + EditorGUI.indentLevel++; var sampleRate = EditorGUILayout.FloatField( new GUIContent("Traces Sample Rate", "Indicates the percentage of transactions that are " + @@ -65,7 +75,6 @@ internal static void Display(ScriptableSentryUnityOptions options) EditorGUI.BeginDisabledGroup(options.TracesSampleRate <= 0); - EditorGUILayout.Space(); GUILayout.Label("Auto Instrumentation", EditorStyles.boldLabel); options.AutoStartupTraces = EditorGUILayout.Toggle( @@ -91,6 +100,7 @@ internal static void Display(ScriptableSentryUnityOptions options) "of Awake as Spans."), options.AutoAwakeTraces); + EditorGUI.indentLevel--; EditorGUI.EndDisabledGroup(); } } diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/DebugSymbolsTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/DebugSymbolsTab.cs index 6d06c3901..81c7ae46d 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/DebugSymbolsTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/DebugSymbolsTab.cs @@ -11,6 +11,7 @@ internal static void Display(SentryCliOptions cliOptions) new GUIContent("Upload Symbols", "Whether debug symbols should be uploaded automatically " + "on release builds."), cliOptions.UploadSymbols); + EditorGUI.indentLevel++; cliOptions.UploadDevelopmentSymbols = EditorGUILayout.Toggle( new GUIContent("Upload Dev Symbols", "Whether debug symbols should be uploaded automatically " + @@ -52,10 +53,12 @@ internal static void Display(SentryCliOptions cliOptions) cliOptions.CliOptionsConfiguration = OptionsConfigurationItem.Display( cliOptions.CliOptionsConfiguration, - "Sentry CLI Config Script", + "CLI Config Script", "SentryCliConfiguration", "A scriptable object that inherits from 'SentryCliOptionsConfiguration'." + "It allows you to programmatically modify the options used during debug symbols upload." ); + + EditorGUI.indentLevel--; } } diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs index dec037b9e..9b2db1ddb 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs @@ -14,38 +14,16 @@ internal static void Display(ScriptableSentryUnityOptions options) new GUIContent("Send default PII", "Whether to include default Personal Identifiable " + "Information."), options.SendDefaultPii); + EditorGUI.indentLevel++; options.IsEnvironmentUser = EditorGUILayout.Toggle( new GUIContent("Auto Set UserName", "Whether to report the 'Environment.UserName' as " + "the User affected in the event. Should be disabled for " + "Android and iOS."), options.IsEnvironmentUser); - EditorGUILayout.EndToggleGroup(); - } - - EditorGUILayout.Space(); - EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); - EditorGUILayout.Space(); - - { - GUILayout.Label("Tag Overrides", EditorStyles.boldLabel); - - options.ReleaseOverride = EditorGUILayout.TextField( - new GUIContent("Override Release", "By default release is built from the Application info as: " + - "\"{productName}@{version}+{buildGUID}\". " + - "\nThis option is an override."), - options.ReleaseOverride); - options.EnvironmentOverride = EditorGUILayout.TextField( - new GUIContent("Override Environment", "Auto detects 'production' or 'editor' by " + - "default based on 'Application.isEditor." + - "\nThis option is an override."), - options.EnvironmentOverride); - - options.ReportAssembliesMode = (ReportAssembliesMode)EditorGUILayout.EnumPopup( - new GUIContent("Report Assemblies Mode", "Whether or not to include referenced assemblies " + - "Version or InformationalVersion in each event sent to sentry."), - options.ReportAssembliesMode); + EditorGUI.indentLevel--; + EditorGUILayout.EndToggleGroup(); } EditorGUILayout.Space(); @@ -53,14 +31,13 @@ internal static void Display(ScriptableSentryUnityOptions options) EditorGUILayout.Space(); { - GUILayout.Label("Capture Screenshots", EditorStyles.boldLabel); - options.AttachScreenshot = EditorGUILayout.BeginToggleGroup( - new GUIContent("Attach Screenshot", "Try to attach current screenshot on events.\n" + + new GUIContent("Attach Screenshots to Events", "Try to attach current screenshot on events.\n" + "This is an early-access feature and may not work on all platforms (it is explicitly disabled on WebGL).\n" + "Additionally, the screenshot is captured mid-frame, when an event happens, so it may be incomplete.\n" + "A screenshot might not be able to be attached, for example when the error happens on a background thread."), options.AttachScreenshot); + EditorGUI.indentLevel++; options.ScreenshotQuality = (ScreenshotQuality)EditorGUILayout.EnumPopup( new GUIContent("Quality", "The resolution quality of the screenshot.\n" + @@ -74,6 +51,7 @@ internal static void Display(ScriptableSentryUnityOptions options) new GUIContent("Compression", "The compression of the screenshot."), options.ScreenshotCompression, 1, 100); + EditorGUI.indentLevel--; EditorGUILayout.EndToggleGroup(); } @@ -82,11 +60,10 @@ internal static void Display(ScriptableSentryUnityOptions options) EditorGUILayout.Space(); { - GUILayout.Label("Capture Scene Hierarchy", EditorStyles.boldLabel); - options.AttachViewHierarchy = EditorGUILayout.BeginToggleGroup( - new GUIContent("Attach Hierarchy", "Try to attach the current scene's hierarchy."), + new GUIContent("Attach Hierarchy to Events", "Try to attach the current scene's hierarchy."), options.AttachViewHierarchy); + EditorGUI.indentLevel++; options.MaxViewHierarchyRootObjects = EditorGUILayout.IntField( new GUIContent("Max Root GameObjects", "Maximum number of captured GameObjects in " + @@ -118,7 +95,37 @@ internal static void Display(ScriptableSentryUnityOptions options) options.MaxViewHierarchyDepth = 0; } + EditorGUI.indentLevel--; EditorGUILayout.EndToggleGroup(); } + + EditorGUILayout.Space(); + EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); + EditorGUILayout.Space(); + + { + options.ReleaseOverride = EditorGUILayout.TextField( + new GUIContent("Override Release", "By default release is built from the Application info as: " + + "\"{productName}@{version}+{buildGUID}\". " + + "\nThis option is an override."), + options.ReleaseOverride); + + options.EnvironmentOverride = EditorGUILayout.TextField( + new GUIContent("Override Environment", "Auto detects 'production' or 'editor' by " + + "default based on 'Application.isEditor." + + "\nThis option is an override."), + options.EnvironmentOverride); + } + + EditorGUILayout.Space(); + EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); + EditorGUILayout.Space(); + + { + options.ReportAssembliesMode = (ReportAssembliesMode)EditorGUILayout.EnumPopup( + new GUIContent("Report Assemblies Mode", "Whether or not to include referenced assemblies " + + "Version or InformationalVersion in each event sent to sentry."), + options.ReportAssembliesMode); + } } } diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/LoggingTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/LoggingTab.cs index fecbc33a6..be81ad3af 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/LoggingTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/LoggingTab.cs @@ -8,24 +8,14 @@ internal static class LoggingTab { internal static void Display(ScriptableSentryUnityOptions options) { - { - options.MaxBreadcrumbs = EditorGUILayout.IntField( - new GUIContent("Max Breadcrumbs", "Maximum number of breadcrumbs that get captured." + - "\nDefault: 100"), - options.MaxBreadcrumbs); - options.MaxBreadcrumbs = Math.Max(0, options.MaxBreadcrumbs); - } - - EditorGUILayout.Space(); - EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); - EditorGUILayout.Space(); - { options.EnableLogDebouncing = EditorGUILayout.BeginToggleGroup( new GUIContent("Enable Log Debouncing", "The SDK debounces log messages of the " + "same type if they are more frequent than once per second."), options.EnableLogDebouncing); + EditorGUI.indentLevel++; + options.DebounceTimeLog = EditorGUILayout.IntField( new GUIContent("Log Debounce [ms]", "The time that has to pass between events of " + "LogType.Log before the SDK sends it again."), @@ -45,6 +35,7 @@ internal static void Display(ScriptableSentryUnityOptions options) options.DebounceTimeError); options.DebounceTimeError = Math.Max(0, options.DebounceTimeError); + EditorGUI.indentLevel--; EditorGUILayout.EndToggleGroup(); } @@ -54,6 +45,7 @@ internal static void Display(ScriptableSentryUnityOptions options) { GUILayout.Label("Automatically capture and send events for:", EditorStyles.boldLabel); + EditorGUI.indentLevel++; options.CaptureLogErrorEvents = EditorGUILayout.Toggle( new GUIContent("Debug.LogError", "Whether the SDK automatically captures events for 'Debug.LogError'."), @@ -77,6 +69,20 @@ internal static void Display(ScriptableSentryUnityOptions options) options.BreadcrumbsForExceptions = EditorGUILayout.Toggle( new GUIContent("Debug.Exception", "Whether the SDK automatically adds breadcrumbs for exceptions and 'Debug.LogException'."), options.BreadcrumbsForExceptions); + + EditorGUI.indentLevel--; + } + + EditorGUILayout.Space(); + EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); + EditorGUILayout.Space(); + + { + options.MaxBreadcrumbs = EditorGUILayout.IntField( + new GUIContent("Max Breadcrumbs", "Maximum number of breadcrumbs that get captured." + + "\nDefault: 100"), + options.MaxBreadcrumbs); + options.MaxBreadcrumbs = Math.Max(0, options.MaxBreadcrumbs); } EditorGUILayout.Space(); @@ -84,7 +90,8 @@ internal static void Display(ScriptableSentryUnityOptions options) EditorGUILayout.Space(); { - GUILayout.Label("Create and attach stack trace when capturing a log message. These will not contain line numbers.", EditorStyles.boldLabel); + GUILayout.Label("Attach the stack trace when capturing log messages. NOTE: These will not contain line numbers.", EditorStyles.boldLabel); + EditorGUI.indentLevel++; options.AttachStacktrace = EditorGUILayout.Toggle( new GUIContent("Attach Stack Trace", "Whether to include a stack trace for non " + @@ -92,6 +99,7 @@ internal static void Display(ScriptableSentryUnityOptions options) "exception was thrown. Refer to AttachStacktrace on sentry docs."), options.AttachStacktrace); + EditorGUI.indentLevel--; // Enhanced not supported on IL2CPP so not displaying this for the time being: // Options.StackTraceMode = (StackTraceMode) EditorGUILayout.EnumPopup( // new GUIContent("Stacktrace Mode", "Enhanced is the default." + diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/OptionsConfigurationTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/OptionsConfigurationTab.cs index 55bf05fd7..03e6e7a56 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/OptionsConfigurationTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/OptionsConfigurationTab.cs @@ -55,6 +55,7 @@ public static void Display(ScriptableSentryUnityOptions options) EditorGUILayout.HelpBox("The 'Option Config Script' allows you to programmatically configure and " + "modify the options used by the Sentry SDK.", MessageType.Info); + EditorGUI.indentLevel++; options.OptionsConfiguration = OptionsConfigurationItem.Display( options.OptionsConfiguration, "Option Config Script", @@ -63,6 +64,7 @@ public static void Display(ScriptableSentryUnityOptions options) "and allows you to programmatically modify Sentry options." ); + EditorGUI.indentLevel--; EditorGUILayout.EndVertical(); } } diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs index 2b9c60fc5..31002b7cc 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs @@ -130,6 +130,9 @@ private void OnGUI() } EditorGUI.BeginDisabledGroup(!Options.Enabled); + + EditorGUILayout.Space(); + EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); EditorGUILayout.Space(); switch (_currentTab) diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs index 92803c88b..8eee01be3 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs @@ -8,56 +8,49 @@ internal static class TransportTab { internal static void Display(ScriptableSentryUnityOptions options) { - options.EnableOfflineCaching = EditorGUILayout.BeginToggleGroup( - new GUIContent("Enable Offline Caching", ""), + { + options.EnableOfflineCaching = EditorGUILayout.BeginToggleGroup( + new GUIContent("Enable Offline Caching", "Whether the SDK Sentry SDK will persist events locally " + + "\nbefore sending them to Sentry. This helps in cases where internet connectivity is limited."), options.EnableOfflineCaching); - - options.MaxCacheItems = EditorGUILayout.IntField( - new GUIContent("Max Cache Items", "The maximum number of files to keep in the disk cache. " + - "The SDK deletes the oldest when the limit is reached.\nDefault: 30"), - options.MaxCacheItems); - options.MaxCacheItems = Math.Max(0, options.MaxCacheItems); - - options.InitCacheFlushTimeout = EditorGUILayout.IntField( - new GUIContent("Init Flush Timeout [ms]", "The timeout that limits how long the SDK " + - "will attempt to flush existing cache during initialization, " + - "potentially slowing down app start up to the specified time." + - "\nThis features allows capturing errors that happen during " + - "game startup and would not be captured because the process " + - "would be killed before Sentry had a chance to capture the event."), - options.InitCacheFlushTimeout); - options.InitCacheFlushTimeout = Math.Max(0, options.InitCacheFlushTimeout); - - EditorGUILayout.EndToggleGroup(); - - EditorGUILayout.Space(); - EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 1), Color.gray); - EditorGUILayout.Space(); - + EditorGUI.indentLevel++; + + options.MaxCacheItems = EditorGUILayout.IntField( + new GUIContent("Max Cache Items", "The maximum number of files to keep in the disk cache. " + + "The SDK deletes the oldest when the limit is reached.\nDefault: 30"), + options.MaxCacheItems); + options.MaxCacheItems = Math.Max(0, options.MaxCacheItems); + + options.InitCacheFlushTimeout = EditorGUILayout.IntField( + new GUIContent("Init Flush Timeout [ms]", "The timeout that limits how long the SDK " + + "will attempt to flush existing cache during initialization, " + + "potentially slowing down app start up to the specified time." + + "\nThis features allows capturing errors that happen during " + + "game startup and would not be captured because the process " + + "would be killed before Sentry had a chance to capture the event."), + options.InitCacheFlushTimeout); + options.InitCacheFlushTimeout = Math.Max(0, options.InitCacheFlushTimeout); + + EditorGUILayout.EndToggleGroup(); + + options.ShutdownTimeout = EditorGUILayout.IntField( + new GUIContent("Shut Down Timeout [ms]", "How many milliseconds to wait before shutting down to " + + "give Sentry time to send events from the background queue."), + options.ShutdownTimeout); + options.ShutdownTimeout = Mathf.Clamp(options.ShutdownTimeout, 0, int.MaxValue); + + options.MaxQueueItems = EditorGUILayout.IntField( + new GUIContent("Max Queue Items", "The maximum number of events to keep in memory while " + + "the worker attempts to send them."), + options.MaxQueueItems + ); + options.MaxQueueItems = Math.Max(0, options.MaxQueueItems); + } + + EditorGUI.indentLevel--; // Options.RequestBodyCompressionLevel = (CompressionLevelWithAuto)EditorGUILayout.EnumPopup( // new GUIContent("Compress Payload", "The level of which to compress the Sentry event " + // "before sending to Sentry."), // Options.RequestBodyCompressionLevel); - - options.SampleRate = EditorGUILayout.Slider( - new GUIContent("Event Sample Rate", "Indicates the percentage of events that are " + - "captured. Setting this to 0.1 captures 10% of events. " + - "Setting this to 1.0 captures all events." + - "\nThis affects only errors and logs, not performance " + - "(transactions) data. See TraceSampleRate for that."), - options.SampleRate, 0.01f, 1); - - options.ShutdownTimeout = EditorGUILayout.IntField( - new GUIContent("Shut Down Timeout [ms]", "How many milliseconds to wait before shutting down to " + - "give Sentry time to send events from the background queue."), - options.ShutdownTimeout); - options.ShutdownTimeout = Mathf.Clamp(options.ShutdownTimeout, 0, int.MaxValue); - - options.MaxQueueItems = EditorGUILayout.IntField( - new GUIContent("Max Queue Items", "The maximum number of events to keep in memory while " + - "the worker attempts to send them."), - options.MaxQueueItems - ); - options.MaxQueueItems = Math.Max(0, options.MaxQueueItems); } } From 63f65ea15461dac1733d3542a0597173f09977dc Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 24 Apr 2025 13:54:54 +0200 Subject: [PATCH 4/8] windowsize --- src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs index 31002b7cc..0bbe83911 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/SentryWindow.cs @@ -35,7 +35,7 @@ public static void OnMenuClick() public static void OpenSentryWindow() { Instance = GetWindow(); - Instance.minSize = new Vector2(800, 600); + Instance.minSize = new Vector2(800, 550); } public static SentryWindow? Instance; From 208e4965c0c79109f331cc12f142778cf5e1f569 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 24 Apr 2025 13:57:01 +0200 Subject: [PATCH 5/8] Updated CHANGELOG.md --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5f998420..d95230669 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) From ccf47c44c8006b601f3c89a93555edbfcb97ff4a Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Thu, 24 Apr 2025 14:11:56 +0200 Subject: [PATCH 6/8] . --- src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs index 8eee01be3..78285ecb3 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs @@ -34,7 +34,7 @@ internal static void Display(ScriptableSentryUnityOptions options) EditorGUILayout.EndToggleGroup(); options.ShutdownTimeout = EditorGUILayout.IntField( - new GUIContent("Shut Down Timeout [ms]", "How many milliseconds to wait before shutting down to " + + new GUIContent("Shutdown Timeout [ms]", "How many milliseconds to wait before shutting down to " + "give Sentry time to send events from the background queue."), options.ShutdownTimeout); options.ShutdownTimeout = Mathf.Clamp(options.ShutdownTimeout, 0, int.MaxValue); From e025bf3a3bcc9c74a6c6299df93bcc66acedd1ac Mon Sep 17 00:00:00 2001 From: Stefan Jandl Date: Thu, 24 Apr 2025 14:13:53 +0200 Subject: [PATCH 7/8] Update src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs index 9b2db1ddb..32b730062 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/EnrichmentTab.cs @@ -112,7 +112,7 @@ internal static void Display(ScriptableSentryUnityOptions options) options.EnvironmentOverride = EditorGUILayout.TextField( new GUIContent("Override Environment", "Auto detects 'production' or 'editor' by " + - "default based on 'Application.isEditor." + + "default based on 'Application.isEditor'." + "\nThis option is an override."), options.EnvironmentOverride); } From 344b89a6c56dcedab5a104a74c00ad9d3d02f501 Mon Sep 17 00:00:00 2001 From: Stefan Jandl Date: Thu, 24 Apr 2025 14:14:02 +0200 Subject: [PATCH 8/8] Update src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs b/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs index 78285ecb3..10368e374 100644 --- a/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs +++ b/src/Sentry.Unity.Editor/ConfigurationWindow/TransportTab.cs @@ -10,7 +10,7 @@ internal static void Display(ScriptableSentryUnityOptions options) { { options.EnableOfflineCaching = EditorGUILayout.BeginToggleGroup( - new GUIContent("Enable Offline Caching", "Whether the SDK Sentry SDK will persist events locally " + + new GUIContent("Enable Offline Caching", "Whether the Sentry SDK will persist events locally " + "\nbefore sending them to Sentry. This helps in cases where internet connectivity is limited."), options.EnableOfflineCaching); EditorGUI.indentLevel++;