From f5e707b4941d1ab0bec33816749b1157d5a7828a Mon Sep 17 00:00:00 2001 From: GitHub Date: Tue, 7 Apr 2026 16:04:57 +0000 Subject: [PATCH 1/5] chore: update modules/sentry-native to 0.13.5 --- CHANGELOG.md | 6 +++--- modules/sentry-native | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a63b978c3..a8eabe593 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,9 +21,9 @@ - Bump Cocoa SDK from v9.7.0 to v9.8.0 ([#2596](https://github.com/getsentry/sentry-unity/pull/2596)) - [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#980) - [diff](https://github.com/getsentry/sentry-cocoa/compare/9.7.0...9.8.0) -- Bump Native SDK from v0.13.2 to v0.13.4 ([#2597](https://github.com/getsentry/sentry-unity/pull/2597), [#2612](https://github.com/getsentry/sentry-unity/pull/2612)) - - [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0134) - - [diff](https://github.com/getsentry/sentry-native/compare/0.13.2...0.13.4) +- Bump Native SDK from v0.13.2 to v0.13.5 ([#2597](https://github.com/getsentry/sentry-unity/pull/2597), [#2612](https://github.com/getsentry/sentry-unity/pull/2612), [#2631](https://github.com/getsentry/sentry-unity/pull/2631)) + - [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0135) + - [diff](https://github.com/getsentry/sentry-native/compare/0.13.2...0.13.5) - Bump Java SDK from v8.35.0 to v8.37.1 ([#2591](https://github.com/getsentry/sentry-unity/pull/2591), [#2605](https://github.com/getsentry/sentry-unity/pull/2605)) - [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8371) - [diff](https://github.com/getsentry/sentry-java/compare/8.35.0...8.37.1) diff --git a/modules/sentry-native b/modules/sentry-native index a35214dcc..6ebd29bd9 160000 --- a/modules/sentry-native +++ b/modules/sentry-native @@ -1 +1 @@ -Subproject commit a35214dccd4e6ce0cef1b5818a8558b02f7a1eca +Subproject commit 6ebd29bd9742fd2f93b6770b5023e31a8efbc10e From 9b94c4094f075040c98cb62a2a1e4fa9dca60d01 Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Wed, 8 Apr 2026 17:35:50 +0200 Subject: [PATCH 2/5] Sync EnableMetrics setting to native SDK and default to true The sentry-native 0.13.5 update changed metrics to be enabled by default. This syncs the Unity EnableMetrics option to the native layer via sentry_options_set_enable_metrics and aligns the Unity default to true, matching the cross-SDK standard from develop docs. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/Sentry.Unity.Native/SentryNativeBridge.cs | 6 ++++++ src/Sentry.Unity/ScriptableSentryUnityOptions.cs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Sentry.Unity.Native/SentryNativeBridge.cs b/src/Sentry.Unity.Native/SentryNativeBridge.cs index 66dc18fcd..18ea06305 100644 --- a/src/Sentry.Unity.Native/SentryNativeBridge.cs +++ b/src/Sentry.Unity.Native/SentryNativeBridge.cs @@ -93,6 +93,9 @@ is RuntimePlatform.WindowsPlayer or RuntimePlatform.WindowsServer } #endif + Logger?.LogDebug("Setting EnableMetrics: {0}", options.EnableMetrics); + sentry_options_set_enable_metrics(cOptions, options.EnableMetrics ? 1 : 0); + if (options.UnityInfo.IL2CPP) { Logger?.LogDebug("Setting the native logger"); @@ -166,6 +169,9 @@ internal static string GetDatabasePath(SentryUnityOptions options, IApplication? [DllImport(SentryLib)] private static extern void sentry_options_set_attach_screenshot(IntPtr options, int attachScreenshot); + [DllImport(SentryLib)] + private static extern void sentry_options_set_enable_metrics(IntPtr options, int enable_metrics); + [UnmanagedFunctionPointer(CallingConvention.Cdecl, SetLastError = true)] private delegate void sentry_logger_function_t(int level, IntPtr message, IntPtr argsAddress, IntPtr userData); diff --git a/src/Sentry.Unity/ScriptableSentryUnityOptions.cs b/src/Sentry.Unity/ScriptableSentryUnityOptions.cs index 87e93fbb4..e357b6724 100644 --- a/src/Sentry.Unity/ScriptableSentryUnityOptions.cs +++ b/src/Sentry.Unity/ScriptableSentryUnityOptions.cs @@ -130,7 +130,7 @@ public static string GetConfigPath(string? notDefaultConfigName = null) [field: SerializeField] public bool PlayStationNativeSupportEnabled { get; set; } = true; [field: SerializeField] public bool SwitchNativeSupportEnabled { get; set; } = true; [field: SerializeField] public bool Il2CppLineNumberSupportEnabled { get; set; } = true; - [field: SerializeField] public bool EnableMetrics { get; set; } = false; + [field: SerializeField] public bool EnableMetrics { get; set; } = true; [field: SerializeField] public SentryOptionsConfiguration? OptionsConfiguration { get; set; } [field: SerializeField] public bool Debug { get; set; } = true; From d96553d6944da75b80ad53a2c3a3d0be3cb0d39a Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Wed, 8 Apr 2026 17:42:49 +0200 Subject: [PATCH 3/5] changelog update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fdd4db1a..b72fa95fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Behavioral Changes - The SDK no longer relies on UnityEngine.Analytics.AnalyticsSessionInfo to determine unique users but uses SDK-internal mechanisms instead. ([#2625](https://github.com/getsentry/sentry-unity/pull/2625)) +- Metrics are now enabled by default, matching the cross-SDK standard. The `EnableMetrics` setting is now also synced to the native SDK on Windows, Linux, and consoles. ([#XXXX](https://github.com/getsentry/sentry-unity/pull/XXXX)) ### Fixes From 69ddd3cd83c9fb7e7e498c8079d6eece682d4dfd Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Wed, 8 Apr 2026 17:59:36 +0200 Subject: [PATCH 4/5] actually point at the PR --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b72fa95fe..89a271126 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ ### Behavioral Changes - The SDK no longer relies on UnityEngine.Analytics.AnalyticsSessionInfo to determine unique users but uses SDK-internal mechanisms instead. ([#2625](https://github.com/getsentry/sentry-unity/pull/2625)) -- Metrics are now enabled by default, matching the cross-SDK standard. The `EnableMetrics` setting is now also synced to the native SDK on Windows, Linux, and consoles. ([#XXXX](https://github.com/getsentry/sentry-unity/pull/XXXX)) +- Metrics are now enabled by default, matching the cross-SDK standard. The `EnableMetrics` setting is now also synced to the native SDK on Windows, Linux, and consoles. ([#2635](https://github.com/getsentry/sentry-unity/pull/2635)) ### Fixes From 1cc7ee50f78da0215e9631110456f51839d8940b Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Thu, 9 Apr 2026 10:50:22 +0200 Subject: [PATCH 5/5] add stub for switch --- package-dev/Plugins/Switch/sentry_native_stubs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package-dev/Plugins/Switch/sentry_native_stubs.c b/package-dev/Plugins/Switch/sentry_native_stubs.c index 91a2479f8..c8b21851d 100644 --- a/package-dev/Plugins/Switch/sentry_native_stubs.c +++ b/package-dev/Plugins/Switch/sentry_native_stubs.c @@ -108,6 +108,12 @@ void sentry_options_set_attach_screenshot(void* options, int attach) (void)attach; } +void sentry_options_set_enable_metrics(void* options, int enable_metrics) +{ + (void)options; + (void)enable_metrics; +} + void sentry_options_set_logger(void* options, void* logger, void* userdata) { (void)options;