You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an API which has both a REST API as well as several background processes which work via Kafka or a background services.
In order to better understand issues which are caused by requests from our frontend, we enabled request body capturing. From what I found on the internet this line should be enough to do so:
Now since we have background processes as well, it seems that Sentry is ignorantly trying to capture the body without checking it's situation. Obviously background services and triggered parts do not have any HttpContext or other features of these. Whenever Sentry tries to create events, it instead fails with the following logs spamming our log files:
[ERROR] | Failed invoking event handler. | System.ObjectDisposedException: IFeatureCollection has been disposed.
Object name: 'Collection'.
at void Microsoft.AspNetCore.Http.Features.FeatureReferences.ThrowContextDisposed()
at void Sentry.AspNetCore.ScopeExtensions.Populate(Scope scope, HttpContext context, SentryAspNetCoreOptions options)
at void Sentry.AspNetCore.SentryMiddleware.PopulateScope(HttpContext context, Scope scope)
at void Sentry.Scope.Evaluate()
Expected Result
No errors from Sentry. If there's noting to capture or no context available it should gracefully ignore that.
Actual Result
Half our logs are Sentry logs telling us that the feature collection was disposed.
The text was updated successfully, but these errors were encountered:
Hi @Skyppid , thanks for getting in touch. Are you able to provide a small app that demonstrates this issue reliably? That would definitely help identify and resolve any problems more quickly.
Package
Sentry
.NET Flavor
.NET
.NET Version
8.x
OS
Linux
SDK Version
4.10.2
Self-Hosted Sentry Version
No response
Steps to Reproduce
We have an API which has both a REST API as well as several background processes which work via Kafka or a background services.
In order to better understand issues which are caused by requests from our frontend, we enabled request body capturing. From what I found on the internet this line should be enough to do so:
Now since we have background processes as well, it seems that Sentry is ignorantly trying to capture the body without checking it's situation. Obviously background services and triggered parts do not have any
HttpContext
or other features of these. Whenever Sentry tries to create events, it instead fails with the following logs spamming our log files:Expected Result
No errors from Sentry. If there's noting to capture or no context available it should gracefully ignore that.
Actual Result
Half our logs are Sentry logs telling us that the feature collection was disposed.
The text was updated successfully, but these errors were encountered: