Closed phillip-haydon closed 3 months ago
How much are we talking in terms of " huge number of exceptions" for the overhead issue?
How much are we talking in terms of " huge number of exceptions" for the overhead issue?
When we tested it, we chucked it in a loop sending 100k exceptions to see what happened with the memory, it grew a little bit more than if it was delegated, not enough to cause a problem, but just didn't want people to think we were having a memory leak.
This change is more important than ~10mb of data showing up in memory profiling though.
Possibly fixes #536
This change is required for updates to Serilog provider where Serilog uses the base implementation of
SendInBackground
but depends onIRaygunUserProvider
to get the user info fromHttpContextAccessor.HttpContext
When the build message is sent as a delegate to
Enqueue
it gets executed out of context and the information is lost.There is a minor overhead in memory building the message up front but this only occurs when there's a huge number of exceptions being thrown.