Comments (5)
Hi thanks for creating this issue.
Just to let you know, I managed to skip the unhandled exception UI (thus not calling anymore the Environment.Exit function):
https://msdn.microsoft.com/en-us/library/windows/desktop/ms680621%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
SetErrorMode(ErrorModes.SEM_NOGPFAULTERRORBOX);
But even without the Environment.Exit, the same problem is there.
When handling the AppDomain.CurrentDomain.UnhandledException, not long after being notified will the process be shut down.
I need to know in a way, that when calling the RollbarInstance.Critical(exception) function, I want to be sure that "That log entry" is sent.
Currently, here's what I need to do to achieve this:
`
var eventSent = new ManualResetEvent(false);
RollbarQueueController.Instance.InternalEvent += (o, args) =>
{
if (args is CommunicationEventArgs communicationArgs && communicationArgs.Response.Error == 0)
{
eventSent.Set();
}
};
RollbarLocator.RollbarInstance.Critical(exception);
//For now wait a little hoping that Rollbar has enough time to send the event
if (!eventSent.WaitOne(TimeSpan.FromSeconds(1)))
{
GlobalFactory.Instance.Resolve<TraceSource>().TraceEvent(TraceEventType.Error, 0, "Could not send Rollback event! Timeout reached");
}
`
Currently I need to know how the internals of the communication work in order to make sure it's being sent
- CommunicationEventArgs seems to be sent when successful
- It's error will be == 0 (since RollbarApiErrorEventArgs derives also from CommunicationEventArgs, that's another way to make sure that all was successful)
- And if I've read correctly, it tries 3 times with 250ms delays, so basically that should all be finished in about 750ms.
Life would be easier if calling the "Critical" method would return me a Task which I could await (or similar idea), or else a token/item on which I could subscribe to an event.
from rollbar.net.
I see where are you going with this. And it does make sense and would work fine if the reported info was reported individually. However, we have a requirement to support multiple instances of RollbarLogger potentially configured for different Rollbar access tokens. They all have to obey reporting rate limits per access token. So, internally we allocate payloads from the reported info on background threads and placing payloads in proper processing queue which is part of a queue collection and then have one processing thread that cycles all the queues and processes the queued payloads while obeying predefined reporting rates and doing re-sends as needed.
from rollbar.net.
Or maybe is there another way to achieve this? Maybe this issue is not a problem, but a bad usage of the framework?
I'm seeing Rollbar as primary's goal being an exception reporter (thus especially the unhandled ones would be the main concern and the most "wanted to be reported").
So, when an unhandled exception is happening, how do your other users properly send the exception to Rollbar?
from rollbar.net.
Nope, you are not misusing the notifier and you are properly waiting for the communication event. Reporting unhandled exceptions is only one of the purposes of Rollbar. Reporting "expected" exceptions is another one and simple remote logging as well. We try to make it as less intrusive as possible (as any instrumentation tool should be) so its activities affect main operation of the hosting application as little as possible. That is why all the reporting functionality happens in async mode by default.
We are thinking about adding a wrapper class that would internally synchronize/block the reporting process so it could be used easily in scenarios like yours. Internally, it would do things similar to what you prototyped above.
from rollbar.net.
implemented in v1.0.2
from rollbar.net.
Related Issues (20)
- Prepare release 5.1.0 (moving out of Beta)
- Remove explicit build targets for unsupported .NET Framework versions
- Remove explicit build targets for unsupported .NET versions
- ConnectivityMonitor tests wrong thing HOT 1
- Fix the CI pipeline
- Consider replacing Newtonsoft.Json with System.Text.Json HOT 2
- Release v5.1.1
- NullReference exception while initializing RollbarInfrastructure
- Telemetry in DotNet Core 3.1 is not initialized
- Capture RollbarInfrastructureConfig with each payload
- No option to set code_version at the config level in v5 of the SDK HOT 9
- Release v5.2.0
- code_version setting is NOT in the expected location of the payload. Versions functionality doesnโt work HOT 2
- RollbarConfigurationLoader searches in wrong directory HOT 1
- NLog plugin: report custom properties like application name HOT 1
- Rollbar NuGet package version 5.x does not work according to onboarding examples HOT 7
- Is there a quickstart for Xamarin Android? HOT 2
- Argument should be equal to false. Parameter name: IsInitialized HOT 2
- A lot of notifier properties come through when logging a request, including access token. HOT 5
- Not seeing first event during project setup HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rollbar.net.