3

Is it possible to tell NewRelic to skip instrumentation from part of an application?

Let say I have an url:

www.example.com/?download=dwn_id

It takes minutes to tens of minutes for php processes the accomplish. I don't want to optimize the download, only skip it from the instrumentation as it is affecting NewRelic stats causing unnecessary alerts and affecting Apdex score.

Other example might be:

www.example.com/?task=cron

For a long running CRON jobs every minute, again this is not relevant for end-users thus worth skipping it.

It would make sense to skip theses parts of the app, I think, like any /admin backend resource as they are not relevant for the end-users.

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
WooDzu
  • 4,771
  • 6
  • 31
  • 61

1 Answers1

4

Where you check if it is a cronjob, simply add:

if (extension_loaded('newrelic')) {
    newrelic_ignore_transaction();
}

NewRelic will then not calculate any of the metrics for it. I've added this to a cronjob of my own.

Source: https://docs.newrelic.com/docs/php/the-php-api

Thomas Lomas
  • 1,553
  • 10
  • 22