ganders
ganders

Reputation: 7441

NewRelic ignore a single page from monitoring

I have a site hosted on Appharbor (free version), and then have the NewRelic free add-on. I setup the availability monitoring to go against my homepage.

Now, I'm getting a bunch of errors because my REST api page is returning errors. I want NewRelic to completely ignore this page.

How do I have NewRelic ignore this page?

Upvotes: 2

Views: 967

Answers (1)

Kristen - NR Support
Kristen - NR Support

Reputation: 136

It sounds like you want to investigate DisableBrowserMonitoring() in the New Relic .NET agent API.

If you only want to turn off the RUM feature for some applications (app/website being monitored) you can use the DisableBrowserMonitoring() in the New Relic .NET agent API mentioned above. This disables the automatic insertion of browser monitoring scripts for specific pages. Currently, this is only supported with web applications, but we have experienced success that this can work with static pages. Add this call to any pages you do not wish to instrument with page load timing (sometimes referred to as real user monitoring or RUM). More information, recommendations and an example how to use this here: http://docs.newrelic.com/docs/agents/net-agent/features/net-agent-api#disable_browser.

Another solution is to use the browserMonitoring element child of the configuration element. browserMonitoring configures page load timing (sometimes referred to as real user monitoring or RUM) in your .NET application. Page load timing gives you insight your end users' performance experience. This is accomplished by measuring the time it takes for your users' browsers to download and render your webpages by injecting a small amount of JavaScript code into the header and footer of each page. More information: https://docs.newrelic.com/docs/agents/net-agent/installation-configuration/net-agent-configuration#browsermon-autoInstrument

<browserMonitoring autoInstrument="true">
<attributes enabled=”true”>
    <exclude>myApiKey.*</exclude>
    <include>myApiKey.foo</include>
  </attributes>
 </browserMonitoring>

The config file method lets you filter without having to change code. However, you also have to be careful if you use the config option to exclude paths because you're putting a Regular Expression in there, and if it is a complex one (which it shouldn't be) it could affect performance and things like that. On the other hand, if you just use a plain and simple regex to look for a page, it is pretty fast too.

I think that the API calls might perform better but that is totally subjective, and I wanted to give you both options.

Note, after any change in your configuration, you will need to perform an iisreset as administrator and exercise your app for a while to see the changes reflected on your New Relic Dashboard.

Upvotes: 2

Related Questions