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

## Unreleased

### Features

- Added content-based error event throttling to prevent repeated errors from consuming quota. The new `IThrottler` interface and `ErrorEventThrottler` implementation deduplicate `LogError`, `LogException`, and `LogAssertion` events based on message + stacktrace fingerprinting. Configurable via the Editor window ("Enable Error Event Throttling" + "Dedupe Window"). Breadcrumbs and structured logs are not affected by default. ([#2479](https://github.com/getsentry/sentry-unity/pull/2479))

### Deprecations

- The time-based log debouncing system (`TimeDebounceBase`, `LogTimeDebounce`, `ErrorTimeDebounce`, `WarningTimeDebounce`) and related options (`EnableLogDebouncing`, `DebounceTimeLog`, `DebounceTimeWarning`, `DebounceTimeError`) are now marked as `[Obsolete]`. Use the new content-based event throttling instead. ([#2479](https://github.com/getsentry/sentry-unity/pull/2479))
Expand All @@ -26,12 +22,17 @@
### Features

- Added Nintendo Switch Native Support. The SDK now automatically syncs the scope - tags, breadcrumbs, context - to the native layer, so native crashes have the same rich context as managed events. ([#2503](https://github.com/getsentry/sentry-unity/pull/2503))
- [Sentry trace-connected Metrics](https://docs.sentry.io/product/explore/metrics/) are now available as _experimental_. ([#2533](https://github.com/getsentry/sentry-unity/pull/2533))
- Added content-based error event throttling to prevent repeated errors from consuming quota. The new `IThrottler` interface and `ErrorEventThrottler` implementation deduplicate `LogError`, `LogException`, and `LogAssertion` events based on message + stacktrace fingerprinting. Configurable via the Editor window ("Enable Error Event Throttling" + "Dedupe Window"). Breadcrumbs and structured logs are not affected by default. ([#2479](https://github.com/getsentry/sentry-unity/pull/2479))

### Dependencies

- Bump Java SDK from v8.28.0 to v8.32.0 ([#2462](https://github.com/getsentry/sentry-unity/pull/2462), [#2481](https://github.com/getsentry/sentry-unity/pull/2481), [#2493](https://github.com/getsentry/sentry-unity/pull/2493), [#2530](https://github.com/getsentry/sentry-unity/pull/2530))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8320)
- [diff](https://github.com/getsentry/sentry-java/compare/8.28.0...8.32.0)
- Bump .NET SDK from v6.0.0 to v6.1.0 ([#2533](https://github.com/getsentry/sentry-unity/pull/2533))
- [changelog](https://github.com/getsentry/sentry-dotnet/blob/main/CHANGELOG.md#610)
- [diff](https://github.com/getsentry/sentry-dotnet/compare/6.0.0...6.1.0)
- Bump Java SDK from v8.28.0 to v8.31.0 ([#2462](https://github.com/getsentry/sentry-unity/pull/2462), [#2481](https://github.com/getsentry/sentry-unity/pull/2481), [#2493](https://github.com/getsentry/sentry-unity/pull/2493))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8310)
- [diff](https://github.com/getsentry/sentry-java/compare/8.28.0...8.31.0)
- Bump Native SDK from v0.12.2 to v0.12.6 ([#2471](https://github.com/getsentry/sentry-unity/pull/2471), [#2505](https://github.com/getsentry/sentry-unity/pull/2505), [#2512](https://github.com/getsentry/sentry-unity/pull/2512), [#2524](https://github.com/getsentry/sentry-unity/pull/2524))
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0126)
- [diff](https://github.com/getsentry/sentry-native/compare/0.12.2...0.12.6)
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Deterministic>true</Deterministic>
<Features>strict</Features>
<SignAssembly>false</SignAssembly>
<NoWarn>$(NoWarn);SENTRYTRACECONNECTEDMETRICS</NoWarn>

<!-- This is the default for our lowest supported version 2020 LTS: netstandard2.0 -->
<!-- The TargetFramework gets overridden depending on the UnityVersion here and in test/props -->
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.100",
"workloadVersion": "10.0.100",
"version": "10.0.102",
"workloadVersion": "10.0.101.1",
"rollForward": "disable",
"allowPrerelease": false
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MonoBehaviour:
m_EditorHideFlags: 0
m_Script: {fileID: -668357930, guid: 43ec428a58422470fa764bdba9d9bc19, type: 3}
m_Name: SentryOptions
m_EditorClassIdentifier:
m_EditorClassIdentifier:
<Enabled>k__BackingField: 1
<Dsn>k__BackingField: https://e9ee299dbf554dfd930bc5f3c90d5d4b@o447951.ingest.us.sentry.io/4504604988538880
<CaptureInEditor>k__BackingField: 1
Expand All @@ -27,8 +27,8 @@ MonoBehaviour:
<AutoAwakeTraces>k__BackingField: 0
<AutoSessionTracking>k__BackingField: 1
<AutoSessionTrackingInterval>k__BackingField: 30000
<ReleaseOverride>k__BackingField:
<EnvironmentOverride>k__BackingField:
<ReleaseOverride>k__BackingField:
<EnvironmentOverride>k__BackingField:
<AttachStacktrace>k__BackingField: 1
<AttachScreenshot>k__BackingField: 1
<ScreenshotQuality>k__BackingField: 1
Expand Down Expand Up @@ -78,6 +78,7 @@ MonoBehaviour:
<PlayStationNativeSupportEnabled>k__BackingField: 1
<SwitchNativeSupportEnabled>k__BackingField: 1
<Il2CppLineNumberSupportEnabled>k__BackingField: 1
<EnableMetrics>k__BackingField: 1
<OptionsConfiguration>k__BackingField: {fileID: 11400000, guid: cea63afb7c75f429799422326f926abe, type: 2}
<Debug>k__BackingField: 1
<DebugOnlyInEditor>k__BackingField: 0
Expand Down
14 changes: 14 additions & 0 deletions src/Sentry.Unity.Editor/ConfigurationWindow/AdvancedTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,19 @@ internal static void Display(ScriptableSentryUnityOptions options, SentryCliOpti
}
}
}

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

{
GUILayout.Label("Metrics", EditorStyles.boldLabel);

options.EnableMetrics = EditorGUILayout.Toggle(
new GUIContent("Enable Metrics",
"Whether the SDK sends metrics to Sentry. " +
"Metrics are connected to traces for correlation."),
options.EnableMetrics);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private void ProcessStructuredLog(string message, LogType logType)

_options.LogDebug("Capturing structured log message of type '{0}'.", logType);

SentryLog.GetTraceIdAndSpanId(_hub, out var traceId, out var spanId);
_hub.GetTraceIdAndSpanId(out var traceId, out var spanId);
SentryLog log = new(_clock.GetUtcNow(), traceId, ToLogLevel(logType), message) { SpanId = spanId };

log.SetDefaultAttributes(_options, UnitySdkInfo.Sdk);
Expand Down
3 changes: 3 additions & 0 deletions src/Sentry.Unity/ScriptableSentryUnityOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +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; } = true;
[field: SerializeField] public SentryOptionsConfiguration? OptionsConfiguration { get; set; }

[field: SerializeField] public bool Debug { get; set; } = true;
Expand Down Expand Up @@ -227,6 +228,8 @@ internal SentryUnityOptions ToSentryUnityOptions(
AddBreadcrumbsWithStructuredLogs = AddBreadcrumbsWithStructuredLogs
};

options.Experimental.EnableMetrics = EnableMetrics;

// By default, the cacheDirectoryPath gets set on known platforms. We're overwriting this behaviour here.
if (!EnableOfflineCaching)
{
Expand Down
30 changes: 30 additions & 0 deletions src/Sentry.Unity/SentrySdk.Dotnet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -530,4 +530,34 @@ public static void ResumeSession()
/// </remarks>
[Obsolete("WARNING: This method deliberately causes a crash, and should not be used in a real application.")]
public static void CauseCrash(CrashType crashType) => Sentry.SentrySdk.CauseCrash(crashType);

/// <summary>
/// Sentry features that are currently in an experimental state.
/// </summary>
/// <remarks>
/// Experimental features are subject to binary, source and behavioral breaking changes in future updates.
/// </remarks>
public static ExperimentalSentrySdk Experimental { get; } = new();

/// <summary>
/// Sentry features that are currently in an experimental state.
/// </summary>
/// <remarks>
/// Experimental features are subject to binary, source and behavioral breaking changes in future updates.
/// </remarks>
public sealed class ExperimentalSentrySdk
{
internal ExperimentalSentrySdk()
{
}

/// <summary>
/// Gets the metric emitter for emitting counters, gauges, and distributions connected to traces.
/// </summary>
public SentryMetricEmitter Metrics
{
[DebuggerStepThrough]
get => Sentry.SentrySdk.Experimental.Metrics;
}
}
}
2 changes: 1 addition & 1 deletion src/sentry-dotnet
Submodule sentry-dotnet updated 135 files
3 changes: 3 additions & 0 deletions test/Sentry.Unity.Tests/Stubs/TestHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using Sentry.Internal;
using Sentry.Protocol.Envelopes;

namespace Sentry.Unity.Tests.Stubs;
Expand Down Expand Up @@ -124,6 +125,8 @@ public void WithScope(Action<Scope> scopeCallback)
public SentryStructuredLogger Logger { get; }
#pragma warning restore SENTRY0001

public SentryMetricEmitter Metrics => DisabledSentryMetricEmitter.Instance;

public ITransactionTracer StartTransaction(ITransactionContext context, IReadOnlyDictionary<string, object?> customSamplingContext) =>
new TransactionTracer(this, context);

Expand Down