Skip to content

grails/grails-melody-plugin

 
 

Repository files navigation

grails-melody-plugin

JavaMelody monitoring plugin for Grails 5, to monitor application performance.

Screenshots

The goal of JavaMelody is to monitor applications in QA and production environments. It is not a tool to simulate requests from users, it is a tool to measure and calculate statistics on real operation of an application depending on the usage of the application by users.

Installation

To install the plugin, add the following dependency:

dependencies {
    runtimeOnly 'org.grails.plugins:grails-melody-plugin:2.0.0'
}

Then you will be able to monitor the application at http://localhost:8080/<YourContext>/monitoring.

Download Plugin

JavaMelody Release Notes

More configuration

A few things you might want to know:

  • the plugin overwrites original grails 'dataSource' bean in spring context with a JavaMelody datasource proxy.
  • the plugin uses groovy meta programming to intercept grails services method calls.

All parameters described in the JavaMelody User's guide can be configured in your grails-app/conf/application.yml file. For example, add the following to disable the monitoring:

javamelody:
    disabled: true

JavaMelody uses URIs to resolve HTTP requests. This means that

/book/show/1 and 
/book/show/23 

will resolve as different requests. While that's desirable in some cases, often you want the statistics to be gathered for the show action, irrespective of parameters. In that case, add the following configuration in your grails-app/conf/application.yml file and the above URIs will show up as /book/show/$.

javamelody:
    # filter out numbers from URI
    http-transform-pattern: \d+

Similar issue may come for SQL monitoring - you can use a similar Regex to filter it.

javamelody:
    sql-transform-pattern: \d+

Other parameters such as storage-directory, url-exclude-pattern, log, monitoring-path, authorized-users or allowed-addr-pattern can also be configured.

You can also add rules for the spring security plugin, if installed. If configuring with application.groovy:

grails.plugin.springsecurity.controllerAnnotations.staticRules = [
  [pattern: '/monitoring', access: ['ROLE_ADMIN']]
]

If configuring with application.yml:

grails:
  plugin:
    springsecurity:
      controllerAnnotations:
        staticRules:
          - pattern: '/monitoring'
            access: ['ROLE_ADMIN']

Or you can add an authorized-users parameter:

javamelody:
    authorized-users: user1:pwd1, user2:pwd2

About

JavaMelody monitoring plugin for Grails, to monitor application performance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 55.2%
  • Groovy 33.0%
  • Shell 7.5%
  • Batchfile 3.7%
  • JavaScript 0.6%