Separate root scope used on the finalizer thread
See original GitHub issueEnvironment
How do you use Sentry? Sentry SaaS (sentry.io)
Which SDK and version? sentry.dotnet.serilog 3.3.4 sentry.dotnet.nlog 2.1.8
Steps to Reproduce
- Call
logger.Debug("debug messages")
- Call
Task.Run(()=>{ throw new Exception(); });
Minimal proof of concept repo: https://github.com/Genteure/SentryMissingBreadcrumbPoc
Expected Result
“debug messages” is visible on sentry dashboard as breadcrumb.
Actual Result
No breadcrumb is available.
The exception is not added to breadcrumb either.
Screenshots from my published application:
This is from a older version that uses NLog instead of Serilog
I disabled sentry’s UnhanledException
integration via DisableAppDomainUnhandledExceptionCapture()
, capturing errors by routing exceptions through NLog or Serilog so it would also be saved in log files.
Previous errors from TaskScheduler.UnobservedTaskException
are sent as breadcrumb, but all other messages are missing.
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (14 by maintainers)
Top GitHub Comments
We’ll address this through: #628 and we plan to tackle it soon
We’ve implemented global scope:
The way the Sentry SDK handles scopes is so that different threads and async flows have different scopes. You can change that behavior (and arguably it should be something we do by default for WPF and WinForms apps) to have a single, global scope.
That means that anywhere you call ConfigureScope, will affect any event, happening in any thread. One side effect though is that SentrySdk.WithScope will no longer work. We have an issue to introduce an alternative:
You can turn on global mode with: https://github.com/getsentry/sentry-dotnet/blob/41cf450f3000f7a2a0311d85011a4ca5bbacd56a/src/Sentry/SentryOptions.cs#L33
Please note we’ll make that the default for desktop apps like WPF and WinForms through: