Joe Moore
Joe Moore

Reputation: 53

Ignoring status codes in New Relic with custom agent

I'm using the custom agent setup for Nancy as outlined here for a web site hosted in Azure. Normally, everything works fine, but my service returns some 4xx errors that I don't want reported in New Relic. Unfortunately, my changes to the newrelic.config file don't appear to be getting picked up.

My errorCollector section looks fairly 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 only 401 and 404 (the defaults) are ignored.

It looks like this 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 configuration to New Relic itself, but I like having the history available in git.

Thoughts?

Upvotes: 3

Views: 1103

Answers (1)

Joe Moore
Joe Moore

Reputation: 53

Turns out this really only applies to the service and not on the New Relic (even though you can configure it from their site). To make it work, I had to figure out what status code I would return and then include that in my New Relic report.

Upvotes: 1

Related Questions