diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fa2f077c9..d4abfb8a0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Redact Authorization headers before sending events to Sentry ([#4164](https://github.com/getsentry/sentry-dotnet/pull/4164)) - Remove Strong Naming from Sentry.Hangfire ([#4099](https://github.com/getsentry/sentry-dotnet/pull/4099)) +- Increase `RequestSize.Small` threshold from 1 kB to 4 kB to match other SDKs ([#4177](https://github.com/getsentry/sentry-dotnet/pull/4177)) ### Features diff --git a/src/Sentry.AspNetCore.Grpc/ProtobufRequestExtractionDispatcher.cs b/src/Sentry.AspNetCore.Grpc/ProtobufRequestExtractionDispatcher.cs index 618d467b88..39aa1c678f 100644 --- a/src/Sentry.AspNetCore.Grpc/ProtobufRequestExtractionDispatcher.cs +++ b/src/Sentry.AspNetCore.Grpc/ProtobufRequestExtractionDispatcher.cs @@ -46,7 +46,7 @@ public ProtobufRequestExtractionDispatcher(IEnumerable ext switch (size) { - case RequestSize.Small when request.ContentLength < 1_000: + case RequestSize.Small when request.ContentLength < 4_000: case RequestSize.Medium when request.ContentLength < 10_000: case RequestSize.Always: _options.LogDebug("Attempting to read request body of size: {0}, configured max: {1}.", diff --git a/test/Sentry.Tests/Extensibility/RequestBodyExtractionDispatcherTests.cs b/test/Sentry.Tests/Extensibility/RequestBodyExtractionDispatcherTests.cs index 84cded0f00..49655636a1 100644 --- a/test/Sentry.Tests/Extensibility/RequestBodyExtractionDispatcherTests.cs +++ b/test/Sentry.Tests/Extensibility/RequestBodyExtractionDispatcherTests.cs @@ -51,10 +51,10 @@ public void ExtractPayload_ExtractorNull_ReturnsNull() [Theory] [InlineData(RequestSize.None, 1, false)] - [InlineData(RequestSize.Small, 999, true)] - [InlineData(RequestSize.Small, 10_000, false)] + [InlineData(RequestSize.Small, 3_999, true)] + [InlineData(RequestSize.Small, 4_000, false)] [InlineData(RequestSize.Medium, 9999, true)] - [InlineData(RequestSize.Medium, 100_000, false)] + [InlineData(RequestSize.Medium, 10_000, false)] [InlineData(RequestSize.Always, int.MaxValue, true)] // 2 GB event? No problem... public void ExtractPayload_RequestSizeSmall_ContentLength(RequestSize requestSize, int contentLength, bool readBody) {