Skip to content

Commit 4a3198a

Browse files
Enable backpressure handling by default (#4615)
1 parent c32dfbb commit 4a3198a

10 files changed

+33
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- `BreadcrumbLevel.Critical` has been renamed to `BreadcrumbLevel.Fatal` for consistency with the other Sentry SDKs ([#4605](https://github.com/getsentry/sentry-dotnet/pull/4605))
88
- SentryOptions.IsEnvironmentUser now defaults to false on MAUI. The means the User.Name will no longer be set, by default, to the name of the device ([#4606](https://github.com/getsentry/sentry-dotnet/pull/4606))
99
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602))
10+
- Backpressure handling is now enabled by default, meaning that the SDK will monitor system health and reduce the sampling rate of events and transactions when the system is under load. When the system is determined to be healthy again, the sampling rates are returned to their original levels. ([#4615](https://github.com/getsentry/sentry-dotnet/pull/4615))
1011
- ScopeExtensions.Populate is now internal ([#4611](https://github.com/getsentry/sentry-dotnet/pull/4611))
1112

1213
### Fixes

src/Sentry/SentryOptions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ public bool IsGlobalModeEnabled
9898
/// Enables or disables automatic backpressure handling. When enabled, the SDK will monitor system health and
9999
/// reduce the sampling rate of events and transactions when the system is under load.
100100
/// </summary>
101-
public bool EnableBackpressureHandling { get; set; } = false;
101+
/// <remarks>
102+
/// Defaults to true / enabled.
103+
/// </remarks>
104+
public bool EnableBackpressureHandling { get; set; } = true;
102105

103106
/// <summary>
104107
/// This holds a reference to the current transport, when one is active.

test/Sentry.Tests/SentryOptionsTests.Integrations_default_ones_are_properly_registered.DotNet10_0.DotNet.verified.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
https://d4d82fc1c2c4032a83f3a29aa3a3aff@fake-sentry.io:65535/2147483647
66
]
77
},
8+
{
9+
Message: Starting BackpressureMonitor.
10+
},
811
{
912
Message: Registering integration: '{0}'.,
1013
Args: [

test/Sentry.Tests/SentryOptionsTests.Integrations_default_ones_are_properly_registered.DotNet10_0.Windows.DotNet.verified.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
https://d4d82fc1c2c4032a83f3a29aa3a3aff@fake-sentry.io:65535/2147483647
66
]
77
},
8+
{
9+
Message: Starting BackpressureMonitor.
10+
},
811
{
912
Message: Registering integration: '{0}'.,
1013
Args: [

test/Sentry.Tests/SentryOptionsTests.Integrations_default_ones_are_properly_registered.DotNet8_0.DotNet.verified.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
https://d4d82fc1c2c4032a83f3a29aa3a3aff@fake-sentry.io:65535/2147483647
66
]
77
},
8+
{
9+
Message: Starting BackpressureMonitor.
10+
},
811
{
912
Message: Registering integration: '{0}'.,
1013
Args: [

test/Sentry.Tests/SentryOptionsTests.Integrations_default_ones_are_properly_registered.DotNet8_0.Windows.DotNet.verified.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
https://d4d82fc1c2c4032a83f3a29aa3a3aff@fake-sentry.io:65535/2147483647
66
]
77
},
8+
{
9+
Message: Starting BackpressureMonitor.
10+
},
811
{
912
Message: Registering integration: '{0}'.,
1013
Args: [

test/Sentry.Tests/SentryOptionsTests.Integrations_default_ones_are_properly_registered.DotNet9_0.DotNet.verified.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
https://d4d82fc1c2c4032a83f3a29aa3a3aff@fake-sentry.io:65535/2147483647
66
]
77
},
8+
{
9+
Message: Starting BackpressureMonitor.
10+
},
811
{
912
Message: Registering integration: '{0}'.,
1013
Args: [

test/Sentry.Tests/SentryOptionsTests.Integrations_default_ones_are_properly_registered.DotNet9_0.Windows.DotNet.verified.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
https://d4d82fc1c2c4032a83f3a29aa3a3aff@fake-sentry.io:65535/2147483647
66
]
77
},
8+
{
9+
Message: Starting BackpressureMonitor.
10+
},
811
{
912
Message: Registering integration: '{0}'.,
1013
Args: [

test/Sentry.Tests/SentryOptionsTests.Integrations_default_ones_are_properly_registered.Net4_8.Windows.Net.verified.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
https://d4d82fc1c2c4032a83f3a29aa3a3aff@fake-sentry.io:65535/2147483647
66
]
77
},
8+
{
9+
Message: Starting BackpressureMonitor.
10+
},
811
{
912
Message: Registering integration: '{0}'.,
1013
Args: [

test/Sentry.Tests/SentryOptionsTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ public void DecompressionMethods_ByDefault_AllBitsSet()
1313
Assert.Equal(~DecompressionMethods.None, sut.DecompressionMethods);
1414
}
1515

16+
[Fact]
17+
public void EnableBackpressureHandling_Default_True()
18+
{
19+
var sut = new SentryOptions();
20+
sut.EnableBackpressureHandling.Should().BeTrue();
21+
}
22+
1623
[Fact]
1724
public void RequestBodyCompressionLevel_ByDefault_Optimal()
1825
{

0 commit comments

Comments
 (0)