Ignore status codes in new relic with custom agent

I am using a custom agent setup for Nancy as described here for an Azure hosted website. This usually works fine, but my service is returning some 4xx errors that I don't want to report to New Relic. Unfortunately my changes to the newrelic.config file don't seem to work.

My errorCollector scope looks pretty standard:

<errorCollector enabled="true">
  <ignoreErrors>
    <exception>System.IO.FileNotFoundException</exception>
    <exception>System.Threading.ThreadAbortException</exception>
  </ignoreErrors>
  <ignoreStatusCodes>
    <code>400</code>
    <code>401</code>
    <code>403</code>
    <code>404</code>
    <code>405</code>
    <code>409</code>
  </ignoreStatusCodes>
</errorCollector>

      

but the site still says that only 401 and 404 (default) are ignored.

It looks like it was a bug in New Relic 2.x and was fixed in 3.0 , but I just upgraded to 3.4.

I can move the config to New Relic, but I like to have the history available in git.

Thoughts?

+3


source to share


1 answer


It turns out that this really only applies to the service and not the new relic (even if you can customize it from your site). To get it working, I had to figure out which status code I would return and then include it in my New Relic report.



+1


source







All Articles