This sample project demonstrates usage of Metrics + Graphite + Graphana.
You can check my Metrics, check your performance slides for some background informations about those samples.
This project wire together 3 monitoring components :
-
Metrics which is a Java library which gives you insight into what your code does in production environment. It's a powerful toolkit which provide glues metrics for common libraries like Jetty, Logback, Log4j, Apache HttpClient, Ehcache, JDBI, Jersey. You can report to backends like Ganglia and Graphite.
-
Graphite is a highly scalable real-time graphing system. It will collects numeric time-series data into Graphite's processing backend, Carbon.
-
Graphana is metrics dashboard and graph editor for Graphite, InfluxDB & OpenTSDB. It's forked version from Kibana reworked for more generic usage.
Current project provides a sample integration between JEE Servlet and Metrics. You can check sample code :
- HelloWorldServlet compute some metrics about received requests
- MetricRegistryCListener create MetricRegistry and register some reporter for JMX and Graphite.
Graphite and Graphana are a bit complex components to deploy, so I provide some pre-build containers using :
- Docker provide easy to deploy containers: it provide a portable, lightweight runtime and packaging tool.
- Fig is a fast and isolated development environments using Docker.
Once you have Docker and Fig installed and configured, you can run :
fig up graphite
It will download & start a full-blown graphite+graphana container.
You can then submit your metrics to localhost:2003 (Graphite UDP port).