Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. ([#2635](https://github.com/getsentry/sentry-unity/pull/2635))

### Fixes

Expand Down
6 changes: 6 additions & 0 deletions src/Sentry.Unity.Native/SentryNativeBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Comment thread
JoshuaMoelans marked this conversation as resolved.

if (options.UnityInfo.IL2CPP)
{
Logger?.LogDebug("Setting the native logger");
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.Unity/ScriptableSentryUnityOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading