Skip to content

Commit e8fc892

Browse files
Prepare 5.0.0 release (#3856)
1 parent a421af5 commit e8fc892

11 files changed

+78
-48
lines changed

CHANGELOG.md

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,46 @@
55
### API Changes
66

77
- Removed net6.0 and net7.0 TFMs as Microsoft has stopped supporting both of these now. If you need to target net6.0 or net7.0 then we recommend using version 4.x of the .NET SDK for Sentry. ([#3807](https://github.com/getsentry/sentry-dotnet/pull/3807))
8+
- Sentry's Experimental Metrics feature has been deprecated and removed from the SDK. ([#3718](https://github.com/getsentry/sentry-dotnet/pull/3718))
9+
- `SentryOptions.EnableTracing` has been removed. Instead, tracing should be enabled or disabled by setting the `SentryOptions.TracesSampleRate` or by using `SentryOptions.TracesSampler` to configure a sampling function ([#3569](https://github.com/getsentry/sentry-dotnet/pull/3569))
810
- Temporarily removed experimental Session Replay support ([#3827](https://github.com/getsentry/sentry-dotnet/pull/3827))
9-
10-
### Fixes
11-
- Fixed JNI Error when accessing Android device data from multiple threads ([#3802](https://github.com/getsentry/sentry-dotnet/pull/3802))
12-
- Android - fix bug that prevents logcat.log from getting attached to unhandled events (SIGSEGV Segfault) ([#3694](https://github.com/getsentry/sentry-dotnet/pull/3694))
13-
- Fix "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'idData')" error propagating OpenTelemetry span ids ([#3850](https://github.com/getsentry/sentry-dotnet/pull/3850))
14-
- Address Trim warnings so that MAUI applications can be compiled AOT ([#3841](https://github.com/getsentry/sentry-dotnet/pull/3841))
15-
16-
### Dependencies
17-
18-
- Bump CLI from v2.39.0 to v2.39.1 ([#3799](https://github.com/getsentry/sentry-dotnet/pull/3799))
19-
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2391)
20-
- [diff](https://github.com/getsentry/sentry-cli/compare/2.39.0...2.39.1)
21-
- Bump Java SDK from v7.18.0 to v7.19.0 ([#3805](https://github.com/getsentry/sentry-dotnet/pull/3805), [#3844](https://github.com/getsentry/sentry-dotnet/pull/3844))
22-
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7190)
23-
- [diff](https://github.com/getsentry/sentry-java/compare/7.18.0...7.19.0)
24-
- Bump Native SDK from v0.7.15 to v0.7.16 ([#3825](https://github.com/getsentry/sentry-dotnet/pull/3825))
25-
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0716)
26-
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.15...0.7.16)
27-
28-
## 5.0.0-alpha.1
29-
30-
### API Changes
31-
3211
- You should no longer pass `AndroidContext` as an argument to `SentrySdk.Init` ([#3562](https://github.com/getsentry/sentry-dotnet/pull/3562))
3312
- The `SentryUser.Segment` property has been deprecated. Consider sending this as a tag or additional data instead ([#3563](https://github.com/getsentry/sentry-dotnet/pull/3563))
3413
- The ITraceContext now includes an [Origin](https://develop.sentry.dev/sdk/telemetry/traces/trace-origin/), which is set automatically and is primarily used internally by the Sentry server ([#3564](https://github.com/getsentry/sentry-dotnet/pull/3564))
3514
- `Device.BatteryLevel` and `Device.ProcessorFrequency` are now stored as floats rather than ints, to align with the Cocoa and Java SDKs ([#3567](https://github.com/getsentry/sentry-dotnet/pull/3567))
36-
- `SentryOptions.EnableTracing` has been removed. Instead, tracing should be enabled or disabled by setting the `SentryOptions.TracesSampleRate` or by using `SentryOptions.TracesSampler` to configure a sampling function ([#3569](https://github.com/getsentry/sentry-dotnet/pull/3569))
3715
- The `FailedRequestTargets`, `TagFilters` and `TracePropagationTargets` options have all been changed from `SubstringOrRegexPattern` to `IList<StringOrRegex>` ([#3566](https://github.com/getsentry/sentry-dotnet/pull/3566))
3816
- `Scope.Transaction` is now always stored as an `AsyncLocal` also in [Global Mode](https://docs.sentry.io/platforms/dotnet/configuration/options/#is-global-mode-enabled), to prevent auto-instrumented spans from the UI ending up parented to transactions from a background task (or vice versa). ([#3596](https://github.com/getsentry/sentry-dotnet/pull/3596))
39-
- Heap dumps can be captured automatically when memory usage exceeds a configurable threshold ([#3667](https://github.com/getsentry/sentry-dotnet/pull/3667))
40-
- Sentry's Experimental Metrics feature has been deprecated and removed from the SDK. ([#3718](https://github.com/getsentry/sentry-dotnet/pull/3718))
4117

4218
### Features
43-
- Added support for `.NET 9` (preview) ([#3699](https://github.com/getsentry/sentry-dotnet/pull/3699))
19+
- Added support for `.NET 9` ([#3699](https://github.com/getsentry/sentry-dotnet/pull/3699))
20+
- Heap dumps can be captured automatically when memory usage exceeds a configurable threshold. Note that this API is still experimental and may change based on user feedback. ([#3667](https://github.com/getsentry/sentry-dotnet/pull/3667))
4421
- libsentrysupplemental.so now supports 16 KB page sizes on Android ([#3723](https://github.com/getsentry/sentry-dotnet/pull/3723))
4522
- Added `SentryOptions` extension for profiling: `options.AddProfilingIntegration()` ([#3660](https://github.com/getsentry/sentry-dotnet/pull/3660))
4623

4724
### Fixes
48-
25+
- Address Trim warnings to enable AOT support, including support for MAUI specifically. ([#3841](https://github.com/getsentry/sentry-dotnet/pull/3841))
26+
- Fixed JNI Error when accessing Android device data from multiple threads ([#3802](https://github.com/getsentry/sentry-dotnet/pull/3802))
27+
- Android - fix bug that prevents logcat.log from getting attached to unhandled events (SIGSEGV Segfault) ([#3694](https://github.com/getsentry/sentry-dotnet/pull/3694))
4928
- Fixed ArgumentNullException in FormRequestPayloadExtractor when handling invalid form data on ASP.NET ([#3734](https://github.com/getsentry/sentry-dotnet/pull/3734))
5029
- Fixed NullReferenceException in SentryTraceHeader when parsing null or empty values ([#3757](https://github.com/getsentry/sentry-dotnet/pull/3757))
30+
- Fix "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'idData')" error propagating OpenTelemetry span ids ([#3850](https://github.com/getsentry/sentry-dotnet/pull/3850))
5131
- ArgumentNullException in FormRequestPayloadExtractor when handling invalid form data on ASP.NET ([#3734](https://github.com/getsentry/sentry-dotnet/pull/3734))
52-
- Crash when using NLog with FailedRequestStatusCodes options in a Maui app with Trimming enabled ([#3743](https://github.com/getsentry/sentry-dotnet/pull/3743))
32+
- Fixed crash when using NLog with FailedRequestStatusCodes options in a Maui app with Trimming enabled ([#3743](https://github.com/getsentry/sentry-dotnet/pull/3743))
5333

5434
### Dependencies
5535

36+
- Bump CLI from v2.38.2 to v2.39.1 ([#3782](https://github.com/getsentry/sentry-dotnet/pull/3782)) ([#3799](https://github.com/getsentry/sentry-dotnet/pull/3799))
37+
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2391)
38+
- [diff](https://github.com/getsentry/sentry-cli/compare/2.38.2...2.39.1)
39+
- Bump Java SDK from v7.16.0 to v7.19.0 ([#3749](https://github.com/getsentry/sentry-dotnet/pull/3749), [#3771](https://github.com/getsentry/sentry-dotnet/pull/3771)) ([#3805](https://github.com/getsentry/sentry-dotnet/pull/3805), [#3844](https://github.com/getsentry/sentry-dotnet/pull/3844))
40+
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7190)
41+
- [diff](https://github.com/getsentry/sentry-java/compare/7.16.0...7.19.0)
5642
- Bump Cocoa SDK from v8.36.0 to v8.39.0 ([#3727](https://github.com/getsentry/sentry-dotnet/pull/3727))
57-
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8390)
58-
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.36.0...8.39.0)
59-
- Bump Java SDK from v7.16.0 to v7.18.0 ([#3749](https://github.com/getsentry/sentry-dotnet/pull/3749), [#3771](https://github.com/getsentry/sentry-dotnet/pull/3771))
60-
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7180)
61-
- [diff](https://github.com/getsentry/sentry-java/compare/7.16.0...7.18.0)
62-
- Bump Native SDK from v0.7.11 to v0.7.15 ([#3731](https://github.com/getsentry/sentry-dotnet/pull/3731), [#3770](https://github.com/getsentry/sentry-dotnet/pull/3770), [#3775](https://github.com/getsentry/sentry-dotnet/pull/3775), [#3779](https://github.com/getsentry/sentry-dotnet/pull/3779))
63-
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0715)
64-
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.11...0.7.15)
65-
- Bump CLI from v2.38.2 to v2.39.0 ([#3782](https://github.com/getsentry/sentry-dotnet/pull/3782))
66-
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2390)
67-
- [diff](https://github.com/getsentry/sentry-cli/compare/2.38.2...2.39.0)
43+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8390)
44+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.36.0...8.39.0)
45+
- Bump Native SDK from v0.7.11 to v0.7.16 ([#3731](https://github.com/getsentry/sentry-dotnet/pull/3731), [#3770](https://github.com/getsentry/sentry-dotnet/pull/3770), [#3775](https://github.com/getsentry/sentry-dotnet/pull/3775), [#3779](https://github.com/getsentry/sentry-dotnet/pull/3779)) ([#3825](https://github.com/getsentry/sentry-dotnet/pull/3825))
46+
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0716)
47+
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.11...0.7.16)
6848

6949
## 4.13.0
7050

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
<Features>strict</Features>
1212
<ImplicitUsings>true</ImplicitUsings>
1313

14+
<!-- Ignore our own diagnostic ids - these are meant to be external warnings only -->
15+
<NoWarn>$(NoWarn);SENTRY0001</NoWarn>
16+
1417
<!-- Allow references to unsigned assemblies (like MAUI) from signed projects -->
1518
<NoWarn>$(NoWarn);CS8002</NoWarn>
1619

src/Sentry/Debouncer.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
using Sentry.Infrastructure;
2+
13
namespace Sentry;
24

5+
#if MEMORY_DUMP_SUPPORTED
6+
37
/// <summary>
48
/// A debouncer that can be used to limit the number of occurrences of an event within a given interval and optionally,
59
/// enforce a minimum cooldown period between events.
610
/// </summary>
11+
[Experimental(DiagnosticId.ExperimentalFeature)]
712
public class Debouncer
813
{
914
internal enum DebouncerInterval { Minute, Hour, Day, ApplicationLifetime }
@@ -101,3 +106,5 @@ internal bool CanProcess(DateTimeOffset? timestamp = null)
101106
return _cooldown is not { } cooldown || _lastEvent + cooldown <= eventTime;
102107
}
103108
}
109+
110+
#endif

src/Sentry/HeapDumpTriggers.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
using Sentry.Infrastructure;
2+
13
namespace Sentry;
24

5+
#if MEMORY_DUMP_SUPPORTED
6+
37
/// <summary>
48
/// Delegate that determines whether a heap dump should be triggered or not.
59
/// </summary>
610
/// <param name="usedMemory">Memory currently used by the process</param>
711
/// <param name="totalMemory">Total available memory</param>
812
/// <returns><see langword="true"/> if the heap dump should be triggered; otherwise, <see langword="false"/>.</returns>
13+
[Experimental(DiagnosticId.ExperimentalFeature)]
914
public delegate bool HeapDumpTrigger(long usedMemory, long totalMemory);
1015

1116
internal static class HeapDumpTriggers
@@ -25,3 +30,5 @@ internal static HeapDumpTrigger MemoryPercentageThreshold(int memoryPercentageTh
2530
};
2631
}
2732
}
33+
34+
#endif
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace Sentry.Infrastructure;
2+
3+
internal static class DiagnosticId
4+
{
5+
#if NET5_0_OR_GREATER
6+
/// <summary>
7+
/// Indicates that the feature is experimental and may be subject to change or removal in future versions.
8+
/// </summary>
9+
internal const string ExperimentalFeature = "SENTRY0001";
10+
#endif
11+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
namespace Sentry.Internal;
22

3+
#if MEMORY_DUMP_SUPPORTED
4+
35
internal record HeapDumpOptions(HeapDumpTrigger Trigger, Debouncer Debouncer, SentryLevel Level);
6+
7+
#endif

src/Sentry/SentryOptions.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,18 @@ public int MaxQueueItems
525525
#if MEMORY_DUMP_SUPPORTED
526526

527527
/// <summary>
528+
/// <para>
528529
/// Configures a heap dump to be captured if the percentage of memory used exceeds a certain threshold.
529530
/// This can be useful to diagnose memory leaks.
531+
/// </para>
532+
/// <para>
533+
/// Note: This feature requires `dotnet-gcdump` to be installed globally on the machine or container where the heap
534+
/// dumps will be captured. You can install this by running: `dotnet tool install --global dotnet-gcdump`
535+
/// </para>
530536
/// </summary>
537+
/// <remarks>
538+
/// This API is experimental and may change in future versions.
539+
/// </remarks>
531540
/// <param name="memoryPercentageThreshold">
532541
/// The memory threshold at which to trigger a heap dump, as a percentage of total available memory.
533542
/// Must be a number between 1 and 99.
@@ -538,6 +547,7 @@ public int MaxQueueItems
538547
/// </param>
539548
/// <param name="level">Optional parameter controlling the event level associated with heap dumps.
540549
/// Defaults to <see cref="SentryLevel.Warning"/>.</param>
550+
[Experimental(DiagnosticId.ExperimentalFeature)]
541551
public void EnableHeapDumps(short memoryPercentageThreshold, Debouncer? debouncer = null, SentryLevel level = SentryLevel.Warning)
542552
=> EnableHeapDumps(HeapDumpTriggers.MemoryPercentageThreshold(memoryPercentageThreshold), debouncer, level);
543553

@@ -550,6 +560,9 @@ public void EnableHeapDumps(short memoryPercentageThreshold, Debouncer? debounce
550560
/// dumps will be captured. You can install this by running: `dotnet tool install --global dotnet-gcdump`
551561
/// </para>
552562
/// </summary>
563+
/// <remarks>
564+
/// This API is experimental and may change in future versions.
565+
/// </remarks>
553566
/// <param name="trigger">
554567
/// A custom trigger function that accepts the current memory usage and total available memory as arguments and
555568
/// return true to indicate that a heap dump should be captured or false otherwise.
@@ -560,6 +573,7 @@ public void EnableHeapDumps(short memoryPercentageThreshold, Debouncer? debounce
560573
/// </param>
561574
/// <param name="level">Optional parameter controlling the event level associated with heap dumps.
562575
/// Defaults to <see cref="SentryLevel.Warning"/>.</param>
576+
[Experimental(DiagnosticId.ExperimentalFeature)]
563577
public void EnableHeapDumps(HeapDumpTrigger trigger, Debouncer? debouncer = null, SentryLevel level = SentryLevel.Warning)
564578
=> HeapDumpOptions = new HeapDumpOptions(trigger, debouncer ?? Debouncer.PerApplicationLifetime(), level);
565579

test/Sentry.Tests/ApiApprovalTests.Run.DotNet8_0.verified.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ namespace Sentry
7575
ManagedBackgroundThread = 1,
7676
Native = 2,
7777
}
78+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
7879
public class Debouncer
7980
{
8081
public static Sentry.Debouncer PerApplicationLifetime(int eventMaximum = 1, System.TimeSpan? cooldown = default) { }
@@ -132,6 +133,7 @@ namespace Sentry
132133
{
133134
public static void SetTags(this Sentry.IHasTags hasTags, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> tags) { }
134135
}
136+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
135137
public delegate bool HeapDumpTrigger(long usedMemory, long totalMemory);
136138
public static class HintTypes
137139
{
@@ -730,7 +732,9 @@ namespace Sentry
730732
public void DisableSystemDiagnosticsMetricsIntegration() { }
731733
public void DisableUnobservedTaskExceptionCapture() { }
732734
public void DisableWinUiUnhandledExceptionIntegration() { }
735+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
733736
public void EnableHeapDumps(Sentry.HeapDumpTrigger trigger, Sentry.Debouncer? debouncer = null, Sentry.SentryLevel level = 2) { }
737+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
734738
public void EnableHeapDumps(short memoryPercentageThreshold, Sentry.Debouncer? debouncer = null, Sentry.SentryLevel level = 2) { }
735739
public System.Collections.Generic.IEnumerable<Sentry.Extensibility.ISentryEventProcessor> GetAllEventProcessors() { }
736740
public System.Collections.Generic.IEnumerable<Sentry.Extensibility.ISentryEventExceptionProcessor> GetAllExceptionProcessors() { }

test/Sentry.Tests/ApiApprovalTests.Run.DotNet9_0.verified.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ namespace Sentry
7575
ManagedBackgroundThread = 1,
7676
Native = 2,
7777
}
78+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
7879
public class Debouncer
7980
{
8081
public static Sentry.Debouncer PerApplicationLifetime(int eventMaximum = 1, System.TimeSpan? cooldown = default) { }
@@ -132,6 +133,7 @@ namespace Sentry
132133
{
133134
public static void SetTags(this Sentry.IHasTags hasTags, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> tags) { }
134135
}
136+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
135137
public delegate bool HeapDumpTrigger(long usedMemory, long totalMemory);
136138
public static class HintTypes
137139
{
@@ -730,7 +732,9 @@ namespace Sentry
730732
public void DisableSystemDiagnosticsMetricsIntegration() { }
731733
public void DisableUnobservedTaskExceptionCapture() { }
732734
public void DisableWinUiUnhandledExceptionIntegration() { }
735+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
733736
public void EnableHeapDumps(Sentry.HeapDumpTrigger trigger, Sentry.Debouncer? debouncer = null, Sentry.SentryLevel level = 2) { }
737+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
734738
public void EnableHeapDumps(short memoryPercentageThreshold, Sentry.Debouncer? debouncer = null, Sentry.SentryLevel level = 2) { }
735739
public System.Collections.Generic.IEnumerable<Sentry.Extensibility.ISentryEventProcessor> GetAllEventProcessors() { }
736740
public System.Collections.Generic.IEnumerable<Sentry.Extensibility.ISentryEventExceptionProcessor> GetAllExceptionProcessors() { }

test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,6 @@ namespace Sentry
7474
Managed = 0,
7575
ManagedBackgroundThread = 1,
7676
}
77-
public class Debouncer
78-
{
79-
public static Sentry.Debouncer PerApplicationLifetime(int eventMaximum = 1, System.TimeSpan? cooldown = default) { }
80-
public static Sentry.Debouncer PerDay(int eventMaximum = 1, System.TimeSpan? cooldown = default) { }
81-
public static Sentry.Debouncer PerHour(int eventMaximum = 1, System.TimeSpan? cooldown = default) { }
82-
public static Sentry.Debouncer PerMinute(int eventMaximum = 1, System.TimeSpan? cooldown = default) { }
83-
}
8477
[System.Flags]
8578
public enum DeduplicateMode
8679
{
@@ -130,7 +123,6 @@ namespace Sentry
130123
{
131124
public static void SetTags(this Sentry.IHasTags hasTags, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>> tags) { }
132125
}
133-
public delegate bool HeapDumpTrigger(long usedMemory, long totalMemory);
134126
public static class HintTypes
135127
{
136128
public const string HttpResponseMessage = "http-response-message";

0 commit comments

Comments
 (0)