When Peter asked me the other day whether I could recommend some stack/platform/whatever for storing/viewing metrics, my first answer was Graphite, but it then quickly occurred to me that I myself never really got around to finishing that project. A Graphite installation is a bit messy, and I don't find it trivial to support.

I had previously stumbled over InfluxDB, and I liked the look of it because

  • it's a single binary
  • it has okay-ish documentation
  • it worked for me out of the box

Reasons enough for me to have a closer look.

I could write whole books about what I don't know about InfluxDB, and I have no idea whatsoever how it'll fare up to really heavy 10,000-server-type of usage, but I don't really care: my use-case is to get some decent time-series database set up for a SOHO environment (storing a few sensor datapoints, electricty consumption, and things like that), in addition to being able to easily render some nice-looking graphs, and all that without spending hours setting it up and maintaining it. (Also, my experience with Xiveley, the artist previously known as Cosm, the artist previously known as Pachube was only okay-ish (sometimes), and it's in a cloud, but I digress.)

Whatever it is I use should be easy. Period. It must have a decent-enough API, be supported by Python, and I want to be up and running (and hopefully not look back) within an hour or two. Maximum three.

InfluxDB seems to be a good match. It is based on LevelDB (I know somebody I admire who'd tear my head off for even using that word...), and it runs on all relevant platforms I can think of. It has a built-in administration panel which is good enough, API support with HTTP Basic authentication (or parametrized auth), and it's extensible: in addition to an HTTP API, I can configure InfluxDB for Graphite carbon support, which means I can submit data via a number different methods, and adding further listeners is possible and looks pretty straight forward for somebody in the know of Go. (I can immediately think of a listener I'd like to see; talk to me, do it, and make me happy. :-)

InfluxDB can also query Graphite data if that's your cuppa and/or if you already have a big dataset you want to use for it.

First off, the Carbon support made me add a carbon plugin to mqttwarn, and I used that to feed in a set of test data to InfluxDB to then glance at it via the built-in Web thing that InfluxDB has.

Using the InfluxDB API, I can then, say, retrieve values via HTTP:

[
    {
        "columns": [
            "time", 
            "sequence_number", 
            "value"
        ], 
        "name": "c.youless", 
        "points": [
            [
                1405011574000, 
                1, 
                1029
            ], 
            [
                1405011544000, 
                1, 
                2334
            ]
        ]
    }
]

InfluxDB's Web console is useful but a bit rudimentary. Enter Grafana which is based on or at least heavily inspired by ElasicSearch's Kibana.

I set that up, and the bit that took longest in this whole exercise was to find the right button to click in order to have Grafana read from InfluxDB. (I had already configured it to do so, I just couldn't find the data source button, so to speak.)

The result is rather nice, I find, even though I haven't been able to switch to a white background...

Whilst possibly not as flexible as Graphite, I'm certainly going to install this pair of utilities at home, and let it run for a while; it appears to be just what this doctor ordered for himself.

Flattr this
MQTT, metrics, graphite, and carbon :: 10 Jul 2014 :: e-mail

Comments

blog comments powered by Disqus