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
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

## Unreleased

### Behavioural Changes and Deprecations

- The `EnableMetrics` option is now marked as `[Obsolete]` and no longer has any effect, following the .NET SDK where metrics are always enabled. Disable the individual `Auto*Metrics` options instead, or filter emitted metrics with `SetBeforeSendMetric`. ([#2828](https://github.com/getsentry/sentry-unity/pull/2828))

### Fixes

- IL2CPP line numbers now work on Android x86/x86_64 builds. il2cpp fails to report the image UUID there, so the SDK falls back to looking the debug image up by name ([#2817](https://github.com/getsentry/sentry-unity/pull/2817))

### Dependencies

- Bump .NET SDK from v6.8.0 to v6.9.0 ([#2815](https://github.com/getsentry/sentry-unity/pull/2815))
- [changelog](https://github.com/getsentry/sentry-dotnet/blob/main/CHANGELOG.md#690)
- [diff](https://github.com/getsentry/sentry-dotnet/compare/6.8.0...6.9.0)
- Bump .NET SDK from v6.8.0 to v6.10.0 ([#2815](https://github.com/getsentry/sentry-unity/pull/2815), [#2828](https://github.com/getsentry/sentry-unity/pull/2828))
- [changelog](https://github.com/getsentry/sentry-dotnet/blob/main/CHANGELOG.md#6100)
- [diff](https://github.com/getsentry/sentry-dotnet/compare/6.8.0...6.10.0)
- Bump Native SDK from v0.16.2 to v0.16.4 ([#2820](https://github.com/getsentry/sentry-unity/pull/2820))
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0164)
- [diff](https://github.com/getsentry/sentry-native/compare/0.16.2...0.16.4)
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "10.0.302",
"workloadVersion": "10.0.302",
"version": "10.0.400",
"workloadVersion": "10.0.400",
"rollForward": "disable",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ MonoBehaviour:
<PlayStationNativeSupportEnabled>k__BackingField: 1
<SwitchNativeSupportEnabled>k__BackingField: 1
<Il2CppLineNumberSupportEnabled>k__BackingField: 1
<EnableMetrics>k__BackingField: 1
<Experimental>k__BackingField:
<MacosBackend>k__BackingField: 0
<WindowsBackend>k__BackingField: 0
Expand Down
5 changes: 0 additions & 5 deletions src/Sentry.Unity.Android/SentryJava.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,6 @@ public void Init(SentryUnityOptions options)
logsOptions.Call("setEnabled", options.EnableLogs);
}

using (var metricsOptions = androidOptions.Call<AndroidJavaObject>("getMetrics"))
{
metricsOptions.Call("setEnabled", options.EnableMetrics);
}

// Options that are not to be set by the user
// We're disabling some integrations as to not duplicate event or because the SDK relies on the .NET SDK
// implementation of certain feature - i.e. Session Tracking
Expand Down
10 changes: 0 additions & 10 deletions src/Sentry.Unity.Editor/ConfigurationWindow/AdvancedTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,6 @@ internal static void Display(ScriptableSentryUnityOptions options, SentryCliOpti
{
GUILayout.Label("Metrics", EditorStyles.boldLabel);

options.EnableMetrics = EditorGUILayout.BeginToggleGroup(
new GUIContent("Enable Metrics",
"Whether the SDK sends metrics to Sentry. " +
"Metrics are connected to traces for correlation."),
options.EnableMetrics);
EditorGUI.indentLevel++;

GUILayout.Label("EXPERIMENTAL: Auto-collect common game performance metrics and send them to Sentry.",
EditorStyles.wordWrappedMiniLabel);

Expand Down Expand Up @@ -305,9 +298,6 @@ internal static void Display(ScriptableSentryUnityOptions options, SentryCliOpti
}
EditorGUI.indentLevel--;
EditorGUILayout.EndToggleGroup();

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

EditorGUILayout.Space();
Expand Down
6 changes: 0 additions & 6 deletions src/Sentry.Unity.Native/SentryNativeBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ is RuntimePlatform.WindowsPlayer or RuntimePlatform.WindowsServer
Logger?.LogDebug("Setting EnableLogs: {0}", options.EnableLogs);
sentry_options_set_enable_logs(cOptions, options.EnableLogs ? 1 : 0);

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");
Expand Down Expand Up @@ -204,9 +201,6 @@ internal static string GetDatabasePath(SentryUnityOptions options, IApplication?
[DllImport(SentryLib)]
private static extern void sentry_options_set_enable_logs(IntPtr options, int enable_logs);

[DllImport(SentryLib)]
private static extern void sentry_options_set_enable_metrics(IntPtr options, int enable_metrics);

[DllImport(SentryLib)]
private static extern void sentry_options_set_enable_app_hang_tracking(IntPtr options, int enabled);

Expand Down
3 changes: 0 additions & 3 deletions src/Sentry.Unity.iOS/SentryCocoaBridgeProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ public static bool Init(SentryUnityOptions options)
Logger?.LogDebug("Setting EnableLogs: {0}", options.EnableLogs);
OptionsSetInt(cOptions, "enableLogs", options.EnableLogs ? 1 : 0);

Logger?.LogDebug("Setting EnableMetrics: {0}", options.EnableMetrics);
OptionsSetInt(cOptions, "enableMetrics", options.EnableMetrics ? 1 : 0);

foreach (var range in options.FailedRequestStatusCodes)
{
Logger?.LogDebug("Adding FailedRequestStatusCodeRange: {0}-{1}", range.Start, range.End);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ public void Register(IHub hub, SentryOptions sentryOptions)
return;
}

if (!options.EnableMetrics)
{
options.DiagnosticLogger?.LogWarning(
"Frame-time metrics are enabled but 'EnableMetrics' is disabled. No metrics will be collected.");
return;
}

var monitor = new FrameTimeMonitor(options);
var interval = options.FrameMetricsInterval < TimeSpan.FromSeconds(1)
? TimeSpan.FromSeconds(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ public void Register(IHub hub, SentryOptions sentryOptions)
return;
}

if (!options.EnableMetrics)
{
options.DiagnosticLogger?.LogWarning(
"Memory metrics are enabled but 'EnableMetrics' is disabled. No metrics will be collected.");
return;
}

var monitor = new GameStatsMonitor(options);
var interval = options.MemoryMetricsInterval < TimeSpan.FromSeconds(1)
? TimeSpan.FromSeconds(1)
Expand Down
7 changes: 0 additions & 7 deletions src/Sentry.Unity/Integrations/GcMetricsIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ public void Register(IHub hub, SentryOptions sentryOptions)
return;
}

if (!options.EnableMetrics)
{
options.DiagnosticLogger?.LogWarning(
"GC metrics are enabled but 'EnableMetrics' is disabled. No metrics will be collected.");
return;
}

var monitor = new GcMonitor(options);
var interval = options.GcMetricsInterval < TimeSpan.FromSeconds(1)
? TimeSpan.FromSeconds(1)
Expand Down
7 changes: 0 additions & 7 deletions src/Sentry.Unity/Integrations/NetworkMetricsIntegration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ public void Register(IHub hub, SentryOptions sentryOptions)
return;
}

if (!options.EnableMetrics)
{
options.DiagnosticLogger?.LogWarning(
"Network metrics are enabled but 'EnableMetrics' is disabled. No metrics will be collected.");
return;
}

var monitor = new NetworkMetricsMonitor(options);
if (!monitor.IsAvailable)
{
Expand Down
13 changes: 11 additions & 2 deletions src/Sentry.Unity/ScriptableSentryUnityOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,17 @@ 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; } = true;

/// <summary>
/// Metrics are always sent to Sentry.
/// </summary>
/// <remarks>
/// This option no longer has any effect. The getter always returns <see langword="true"/> and the
/// setter is ignored, matching <see cref="SentryOptions.EnableMetrics"/> in the .NET SDK.
/// </remarks>
[Obsolete("Metrics are always enabled. This option is ignored and will be removed in a future version. Disable the individual Auto*Metrics options instead, or filter emitted metrics with SetBeforeSendMetric.")]
public bool EnableMetrics { get => true; set { } }

[field: SerializeField] public ExperimentalSentryUnityOptions Experimental { get; set; } = new();
[field: SerializeField] public SentryOptionsConfiguration? OptionsConfiguration { get; set; }

Expand Down Expand Up @@ -264,7 +274,6 @@ internal SentryUnityOptions ToSentryUnityOptions(
AddBreadcrumbsWithStructuredLogs = AddBreadcrumbsWithStructuredLogs
};

options.EnableMetrics = EnableMetrics;
options.Experimental.MacosBackend = Experimental.MacosBackend;
options.Experimental.WindowsBackend = Experimental.WindowsBackend;
options.Experimental.LinuxBackend = Experimental.LinuxBackend;
Expand Down
9 changes: 4 additions & 5 deletions src/Sentry.Unity/SentryUnityOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ public sealed class SentryUnityOptions : SentryOptions

/// <summary>
/// EXPERIMENTAL: Automatically collect per-frame performance metrics, including frame time, FPS,
/// and CPU thread timings, and send them to Sentry as metrics. Requires <see cref="SentryOptions.EnableMetrics"/> to remain
/// enabled (the default).
/// and CPU thread timings, and send them to Sentry as metrics.
/// </summary>
public bool AutoFrameMetrics { get; set; } = false;

Expand All @@ -149,7 +148,7 @@ public sealed class SentryUnityOptions : SentryOptions

/// <summary>
/// EXPERIMENTAL: Periodically collect memory usage and send it to Sentry as
/// metrics. Requires <see cref="SentryOptions.EnableMetrics"/> to remain enabled (the default).
/// metrics.
/// </summary>
public bool AutoMemoryMetrics { get; set; } = false;

Expand All @@ -160,7 +159,7 @@ public sealed class SentryUnityOptions : SentryOptions

/// <summary>
/// EXPERIMENTAL: Periodically collect garbage-collection counts (per generation) and send them
/// to Sentry as metrics. Requires <see cref="SentryOptions.EnableMetrics"/> to remain enabled.
/// to Sentry as metrics.
/// </summary>
public bool AutoGcMetrics { get; set; } = false;

Expand All @@ -172,7 +171,7 @@ public sealed class SentryUnityOptions : SentryOptions
/// <summary>
/// EXPERIMENTAL: Periodically collect basic multiplayer network metrics - round-trip time (on
/// clients) and connected-client count (on the server) - and send them to Sentry as metrics.
/// Requires the Netcode for GameObjects package and <see cref="SentryOptions.EnableMetrics"/>.
/// Requires the Netcode for GameObjects package.
/// </summary>
public bool AutoNetworkMetrics { get; set; } = false;

Expand Down
2 changes: 1 addition & 1 deletion src/sentry-dotnet
Submodule sentry-dotnet updated 105 files
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public override void Configure(SentryUnityOptions options)
options.TracesSampleRate = 1.0d;

options.EnableLogs = true;
options.EnableMetrics = true;

// No custom HTTP handler -- events go to real sentry.io

Expand Down
Loading