How to ignore specific errors from the new relic toolbar

Helllo,

My application is a web server that fires many requests to other servers. We set a maximum timeout on these requests, and whenever a timeout is reached, the connection is closed and ESOCKETTIMEDOUT is increased.

Error: socket hang up
at createHangUpError (http.js:1472:15)
at Socket.socketCloseListener (http.js:1522:23)
at Socket.EventEmitter.emit (events.js:117:20)
at TCP.close (net.js:465:12)

      

I want to exclude these errors from the New Relic dashboard as they skew the error rate and other metrics. Hiding them doesn't work either, as they still count towards the error rate.

How do I remove certain errors (which do not have an HTTP status code) from my dashboard?

+3


source to share


2 answers


You can pass status codes to ignore the error collector. If you are configuring the New Relic agent using environment variables, you can use a comma-separated list of codes as the value for NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERROR_CODES

.

See the README .

If you are using newrelic.js

this, you can set the error_collector.ignore_codes

Array of status codes to ignore:



See configuration example .

Important warning : when you manually set this value, you override the default 404

, which means that if you don't specify 404

in your manual configuration, the bug collector will start logging all 404

bugs in your application (which you probably don't want).

+3


source


I noticed that you have javascript, I'm not sure if my solution can help you, but I will answer in the hope that it does.

I am using Java agent and we have the same problem. So far, the only way to find something close to what I want is to have certain errors wrapped in a dedicated exception ("NewRelicIgnorableException") and wrap any error I don't want to see in it.

Then I need to go to the dashboard / app and select "collect errors". Finally, I would fill in "Ignore these errors" with the full package name and class name of the exception, for example com.mypackage.NewRelicIgnorableException. Save and enjoy. These specific errors shouldn't affect your apdex, but they will still count on RPM and other metrics.



Other solutions have their drawbacks. For example, if I throw ignoreexception, RPM and time metrics will not be counted. If you click the "hide errors" button, you will only hide them from the error bar, but everything else will be as usual. If you ignore the status code, you can get more or less the same results as ignoring a specific exception, but without relying on fine control.

It's a shame that their site has so little documentation, I had to run tests to find them.

0


source







All Articles