New Relic has awesome support for monitoring web applications written in Play Framework. But I couldn’t find any open source libraries or tools closer to it. Recently, I deployed a InfluxDB, collectd and Grafana based solution for monitoring cluster of nodes in our lab and it worked out nicely. So the best solution I could think of was to publish Play app metrics to InfluxDB and do a dashboard using Grafana. So I started to browse through different Play application monitoring solutions available on the web and found metrics-play which is a Play plugin written based on Dropwizard’s Metrics library with support for Graphite (InfluxDB has a native Graphite input plugin).
Even though metrics-play doesn’t include support for Graphite reporter, I forked it and added support for Graphite reporter. If anyone is interested you can grab the code from here and Graphite support is there in graphite-publisher branch. To add this to your Play application you have to do following.
- Add metrics-play with Graphite reporter into you Play app dependencies.
Next, add the Play plugin com.kenshoo.play.metrics.MetricsPlugin to your play.plugins file.
Enable the Graphite reporter by putting following configuration to you application.conf.
- And make sure you have enabled Graphite input plugin in InfluxDB configuration like below.
If you got all the configurations correct you should see the Play app monitoring data including JVM stats in you InfluxDB.
Current metrics-play implementation supports only limited monitoring capabilities. I am planning to improve it to publish route level metrics such as number of requests and response times. So keep watching my fork for new features.