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
I am wring a code where I am sending data to new relic endpoint using TelemetryClient. But in case where batch to be scheduled cannot be allocated, the scheduler just logs the warning and proceeds. Ideal case would be to throw exception in these scenarios, so that client can handle it properly.
WARN Refusing to schedule batch of size 500 (would put us over max size 1000000, available = 96) (com.newrelic.telemetry.LimitingScheduler:37)
WARN DATA IS BEING LOST! (com.newrelic.telemetry.LimitingScheduler:45)
(Migrate to Jira)
The text was updated successfully, but these errors were encountered:
Imagine if a logging framework threw an exception and ended up rolling back a transaction or ending a procedure early. It would not look good, and try/catch every log call is not feasible.
The point here is that both logging and New Relic are 3rd parties that should not prevent the main application from functioning.
That does not mean it is not a good idea to have a method that can allows to treatment of an exception.
So ideally there should be 2 methods:
one that only logs;
one that throws checked exceptions.
Implementation wise, the logging method should call the exception method, catch the exception, log it and continue the flow.
@meiao I understand that 3rd parties should not prevent main application from functioning, but data loss is such a crucial error that just logging it seems like a bug.
Also the option for logging or throwing exception can be handled using the NotificationHandler if appropriate exception get thrown to TelemetryClient.
I am wring a code where I am sending data to new relic endpoint using TelemetryClient. But in case where batch to be scheduled cannot be allocated, the scheduler just logs the warning and proceeds. Ideal case would be to throw exception in these scenarios, so that client can handle it properly.
WARN Refusing to schedule batch of size 500 (would put us over max size 1000000, available = 96) (com.newrelic.telemetry.LimitingScheduler:37)
WARN DATA IS BEING LOST! (com.newrelic.telemetry.LimitingScheduler:45)
(Migrate to Jira)
The text was updated successfully, but these errors were encountered: