New Relic allows most users the ability to monitor background processes and other jobs running outside the web application. Specific procedures depend on which agent you use.
To monitor a background task for a Go app, follow the procedures for instrumenting a non-web transaction.
To monitor background transactions, use the Java agent's
@Trace annotations to instrument your background task code.
By default, New Relic's .NET agent instruments IIS ASP workers. To instrument other (non-IIS) .NET applications, such as standalone (WCF) services, console apps, and other Windows services, see Instrumenting custom applications and Instrumenting WCF applications.
The .NET agent sometimes reports very high call counts in Non-web transactions. This is caused by limitations on tracking work as it moves across threads. When this occurs, the .NET agent counts background processes multiple times relative to their parent process in the web application. These high call counts are considered normal and are not a cause for concern.
To instrument background jobs for a Node.js app, use
The PHP agent assumes that all command-line run scripts are background jobs. You can mark a transaction as a background job using either of these methods:
newrelic_background_joband set the flag to
- Flag it as a web transaction by calling
newrelic_background_joband setting the flag to
If you are using the Celery or Gearman distributed task management system, you can have task executions recorded as background tasks against a designated application.
- For more information on Celery instrumentation, see Python agent and Celery.
- For procedures to monitor a custom background job or use Django management commands, see Python background tasks.
The Ruby agent allows you to configure background jobs to send metric data to New Relic, and to instrument background jobs so that they appear as transactions in the New Relic APM user interface. This includes built-in support for the
Delayed::Job background job processor. For more information, see Monitoring Ruby background processes and daemons.
View background processes and tasks
To view details about background processes and other tasks:
- Go to rpm.newrelic.com > (select an app) > Monitoring > Overview.
- From the main chart's dropdown on the APM Overview page, select your choice of available chart views for Non-web transactions.