Breaking changes
Please read through all breaking changes relevant to you before upgrading.
!Important: Grouping Changes
The format of the stack traces were greatly improved with the help of Ben Adam's iconic library Ben.Demystifier
. Frames now include details such as async
, static
, the actual return type, method parameters, tuples and their names, and more.
One big caveat is that this will affect grouping!. If you prefer to stay with the original stack trace format, you can opt-out of this feature with:
options.StackTraceMode = StackTraceMode.Original;
ASP.NET
ASP.NET (not Core) users need to install an additional package:
Sentry.AspNet
.
Without this, HTTP related information will not be added to events.
You can plug it in to the Init
as follows:
SentrySdk.Init(o =>
{
o.AddAspNet();
});
The motivation was to remove the reference to System.Web
to decouple the core of the package with any specific namespaces of the .NET Framework, which improves the experience from other environments such as game engines like Unity and Godot.
ASP.NET Core Environment Casing
To match Sentry's default environment naming convention, unless explicitly set otherwise, the Sentry environment will be reported lowercase. That means if ASPNET_ENVIRONMENT
is equal to Production
, the Sentry SDK will report it as production
#551
ASP.NET Core IncludeRequestPayload
The option IncludeRequestPayload
that was deprecated in the Sentry SDK 2.0 was finally removed.
The replacement has been the option MaxRequestBodySize
.
IHub
received two new methods
Sentry's Performance product requires additive API changes to interfaces such as IHub
. If you implement your own IHub
, you'll need to implement two new methods:
StartTransaction
and GetTraceHeader
.
DiagnosticsLogger
renamed to DiagnosticLogger
To align with other SDKs, the option is now named: DiagnosticLogger
Docs PR Change: #759
Dsn
is just a string
SentryOptions
now take a string for Dsn
:
Before: o.Dsn = new Dsn("..");
After: o.Dsn = "..";
LogEntry
became Message
The property of SentryEvent
that supports a structured log entry was renamed to Message
to align with the protocol and other SDKs.
Sentry On Premise Support
This version uses the envelope endpoint. If you are using an on-premise installation it requires Sentry version >= v20.6.0 to work. If you are using sentry.io nothing will change and no action is needed.
New features and improvements
Offline Caching
You can optionally have events cached to disk.
To do that, you must specify which directory the SDK can use to write the crash files:
options.CacheDirectoryPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData))
Attachments
You can add attachments to events now. Please refer to the Attachments documentation.
User Feedback
You can add user feedback to events via a .NET API. Please refer to the Attachments documentation.
.NET 5
There are no dependencies when targeting .NET 5 or newer.
ASP.NET Core gRPC support
A new package was added ASP.NET Core gPRC support. With the ability to log the request payload in case of errors.
Changes
- Add support for dynamic transaction sampling. (#753) @Tyrrrz
- Integrate trace headers. (#758) @Tyrrrz
- Renamed Option
DiagnosticsLevel
toDiagnosticLevel
(#759) @bruno-garcia - Add additional data to transactions (#763) @Tyrrrz
- Improve transaction instrumentation on ASP.NET Core (#766) @Tyrrrz
- Add
Release
toScope
(#765) @Tyrrrz - Don't fallback to
HttpContext.RequestPath
if a route is unknown (#767 #769) @kanadaj @Tyrrrz - Add instruction_addr to SentryStackFrame. (#744) @lucas-zimerman
- Default stack trace format: Ben.Demystifier (#732) @bruno-garcia
- Limit attachment size (#705)
- Separate tracing middleware (#737)
- Disabled Mono StackTrace Factory. (#709) @lucas-zimerman
- Adds to the existing User Other dict rather than replacing (#729) @brettjenkins
- Handle non-json error response messages on HttpTransport. (#690) @lucas-zimerman
- Fix deadlock on missing ConfigureAwait into foreach loops. (#694) @lucas-zimerman
- Report gRPC sdk name (#700) @bruno-garcia
- Include parameters in stack frames. (#662) @Tyrrrz
- Remove CultureUIInfo if value is even with CultureInfo. (#671) @lucas-zimerman
- Make all fields on UserFeedback optional. (#660) @Tyrrrz
- Align transaction names with Java. (#659) @Tyrrrz
- Add support for attachments. (#670) @Tyrrrz
- Improve logging for relay errors. (#683) @Tyrrrz
- Report sentry.dotnet.aspnet on the new Sentry.AspNet package. (#681) @Tyrrrz
- Ref moved SentryId from namespace Sentry.Protocol to Sentry (#643) @lucas-zimerman
- Ref renamed
CacheFlushTimeout
toInitCacheFlushTimeout
(#638) @lucas-zimerman - Add support for performance. (#633)
- Transaction (of type
string
) on Scope and Event now is called TransactionName. (#633) - Abandon ValueTask #611
- Fix Cache deleted on HttpTransport exception. (#610) @lucas-zimerman
- Add SentryScopeStateProcessor #603
- Add net5.0 TFM to libraries #606
- Add more logging to CachingTransport #619
- Bump Microsoft.Bcl.AsyncInterfaces to 5.0.0 #618
- Replaced
BaseScope
withIScope
. (#590) @Tyrrrz - Removed code coverage report from the test folder. (#592) @lucas-zimerman
- Add target framework NET5.0 on Sentry.csproj. Change the type of
Extra
where value parameter become nullable. @lucas-zimerman - Implement envelope caching. (#576) @Tyrrrz
- Add a list of .NET Frameworks installed when available. (#531) @lucas-zimerman
- Parse Mono and IL2CPP stacktraces for Unity and Xamarin (#578) @bruno-garcia
- Update TFMs and dependency min version (#580) @bruno-garcia
- Run all tests on .NET 5 (#583) @bruno-garcia
- Add the client user ip if both SendDefaultPii and IsEnvironmentUser are set. (#1015) @lucas-zimerman
- Replace Task with ValueTask where possible. (#564) @Tyrrrz
- Add support for ASP.NET Core gRPC (#563) @Mitch528
- Push API docs to GitHub Pages GH Actions (#570) @bruno-garcia
- Add support for user feedback. (#559) @lucas-zimerman
- Add support for envelope deserialization (#558) @Tyrrrz
- Add package description and tags to Sentry.AspNet @Tyrrrz
- Fix internal url references for the new Sentry documentation. (#562) @lucas-zimerman
- Set the Environment setting to 'production' if none was provided. (#550) @PureKrome
- ASPNET.Core hosting environment is set to 'production' / 'development' (notice lower casing) if no custom options.Enviroment is set. (#554) @PureKrome
- Add most popular libraries to InAppExclude #555 (@bruno-garcia)
- Add support for individual rate limits.
- Extend
SentryOptions.BeforeBreadcrumb
signature to accept returning nullable values. - Rename LogEntry to SentryMessage. Change type of SentryEvent.Message from string to SentryMessage.
- Change the type of Gpu.VendorId from int to string.
- Add support for envelopes.
- Move aspnet-classic integration to Sentry.AspNet (#528) @Tyrrrz
- Merge Sentry.Protocol into Sentry (#527) @Tyrrrz
- Framework and runtime info (#526) @bruno-garcia
- Add NRTS to Sentry.Extensions.Logging (#524) @Tyrrrz
- Add NRTs to Sentry.Serilog, Sentry.NLog, Sentry.Log4Net (#521) @Tyrrrz
- Add NRTs to Sentry.AspNetCore (#520) @Tyrrrz
- Fix CI build on GitHub Actions (#523) @Tyrrrz
- Add GitHubActionsTestLogger (#511) @Tyrrrz
- Add nullable reference types support (Sentry, Sentry.Protocol) (#509)
- fix: Use ASP.NET Core endpoint FQDN (#485)
- feat: Add integration to TaskScheduler.UnobservedTaskException (#481)