Plugins You can find out about all the publicly available Grails plugins.

Newrelic Plugin

0 vote
compile "org.grails.plugins:newrelic:1.0-2.18.0"

 Documentation  Source  Issues


Newrelic plugin for Grails


grails install-plugin newrelic


More in-depth documentation is available on the Github page

New Relic

For the plugin to work, NewRelic must be installed and configured

The Plugin

This plugin allows you to add the Real User Monitoring feature to your GSP pages. By default this plugin is only enabled for Production environments. If you need to enable it for other environments see the configuration section below.

Usage in GSP

Once this is complete, the Real User Monitoring code can be added to your GSP page as follows:

<!DOCTYPE html>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <!-- other tags -->
    <!-- more tags -->

Usage in Controllers/Services

The NewRelic API is accessible through the NewRelic service. This service can be injected into a controller by declaring a bean named newRelicService. The following example code below describes an example situation where the current transaction name and URL is to be logged into NewRelic.


class BlogController {

def newRelicService

def index() { newRelicService.setTransactionName(null, "/blog/view") } }


The RUM code will only be added in Production environments. To enable it for other environments add the following configuration to your specific environment config

newrelic.enabled = true

Version numbering

Since the v1.0 release of this plugin, the version numbering has changed. The version number is separated by a @[email protected] The number before the dash represents changes (fixes/features/etc) made to this plugin, and the number after the dash is the version of the NewRelic API distributed with this plugin.


  • 0.1 - newrelic taglib to allwo RUM from GSP pages.
  • 0.2 - NewRelic service can now be injected as a bean. This allows NewRelic Agent APIs to be called from controllers/services.
  • 0.3 - Fixed defect where the service is transactional (so always depends on transactionManager bean, and cannot be used in non-transactional services)
  • 0.4 - Includes a Filter to automatically name transactions based on controller name, and if specified the action name.
  • 0.5 - The Filter now intercepts all URIs, and uses the Request.ServletPath if no controller name is found.
  • 0.6 - Updated to use v2.12.0 of the NewRelic API JAR. Removed NewRelic JAR from plugin, it is now downloaded from (public) maven repository.
  • 1.0-2.18.0 - 1.0 release of plugin with new version numbering scheme. Also updated with NewRelic v2.18.0 API.