Visualize Your OpenStack Cloud: Gnocchi & Grafana
Building an OpenStack cloud is becoming an amazing option for dev shops given the maturity and growth of tooling. Gnocchi and Grafana make a combo that will build awesome monitoring visualizations.
Join the DZone community and get the full member experience.Join For Free
We've been hard working with the Gnocchi team these last months to store your metrics, and I guess it's time to show off a bit.
So far Gnocchi offers scalable metric storage and resource indexation, especially for OpenStack cloud – but not only, we're generic. It's cool to store metrics, but it can be even better to have a way to visualize them!
We very soon started to build a little HTML interface. Being REST-friendly guys, we enabled it on the same endpoints that were being used to retrieve information and measures about metric, sending back
text/html instead of
application/json if you were requesting those pages from a Web browser.
Obviously it never happened.
Ok, So What's Out There?
It turns out there are back-end agnostic solutions out there, and we decided to pick Grafana. Grafana is a complete graphing dashboard solution that can be plugged on top of any back-end. It already supports timeseries databases such as Graphite, InfluxDB and OpenTSDB.
That was largely enough for that my fellow developer Mehdi Abaakouk to jump in and start writing a Gnocchi plugin for Grafana! Consequently, there is now a basic but solid and working back-end for Grafana that lies in the grafana-plugins repository.
With that plugin, you can graph anything that is stored in Gnocchi, from raw metrics to metrics tied to resources. You can use templating, but no annotation yet. The back-end supports Gnocchi with or without Keystone involved, and any type of authentication (basic auth or Keystone token). So yes, it even works if you're not running Gnocchi with the rest of OpenStack.
It also supports advanced queries, so you can search for resources based on some criterion and graphs their metrics.
I want to try it!
If you want to deploy it, all you need to do is to install Grafana and its plugins, and create a new datasource pointing to Gnocchi. It is that simple. There's some CORS middleware configuration involved if you're planning on using Keystone authentication, but it's pretty straightforward – just set the
cors.allowed_origin option to the URL of your Grafana dashboard.
Moving to Grafana Core
Mehdi just opened a pull request a few days ago to merge the plugin into Grafana core. It's actually one of the most unit-tested plugin in Grafana so far, so it should be on a good path to be merged in the future and have support of Gnocchi directly into Grafana without any plugin involved.
Published at DZone with permission of Julien Danjou. See the original article here.
Opinions expressed by DZone contributors are their own.