Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NewRelic - How to Ignore part of a web application

I'd like to tell NewRelic to not monitor a subset of my web application. For example I'd like to exclude http://mysite/admin/* so NewRelic won't count traffic against this portion of my app against my apdex.

Something similar to how you can create filters in Google Analytics would be great.

like image 271
Aaron Barker Avatar asked Feb 03 '12 17:02

Aaron Barker


2 Answers

You can exclude a transaction from counting toward Apdex by calling IgnoreApdex in the New Relic .NET agent API. Add a reference to NewRelic.Agent.Api.dll in your project, then call that method in the code path common to your admin pages.

You can also ignore a transaction entirely (no Apdex, no response time, etc.) by calling IgnoreTransaction.

like image 120
rkb Avatar answered Oct 27 '22 00:10

rkb


I'm just going to add this if someone else is looking for the same thing. The new agents now allows exclusion in the config-file, check out the answer below from their support:

The second less intrusive way is to use a "Request Path Exclusion List". The browserMonitoring-element in newrelic.config now supports (as of agent version 2.22.79.0) an optional sub-element named requestPathsExcluded, as shown below:

<browserMonitoring autoInstrument="true">
   <requestPathsExcluded>
      <path regex="About{1}?" />
      <path regex="mvcForm/Home/{1}?" />
   </requestPathsExcluded>
</browserMonitoring>

Each "path" element must contain a "regex" attribute whose value is a regular expression that can be evaluated by the .NET Framework's Regular Expression evaluator. See http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.90).aspx as a reference.

like image 34
boena Avatar answered Oct 26 '22 23:10

boena