Alternatively, you can download ZIP archive
of this repo and unpack it into /var/lib/grafana/plugins directory.

Motivation

We had a desperate need to visualize a set of timeseries statuses over time period, so we can
see a history of changes for objects' status. Since we maintain a lot of Kubernetes clusters
(and related infrastructure), our main cases for that are visualization of servers & Kubernetes
pods health states as well as HTTP services health checks. We've tried a variety of Grafana
plugins available (they are listed in Acknowledgements below) but none of them could provide
the features and visualization really close to what we've been looking for.

NB: You can find more details about our journey of creating the plugin in
this post.

Objects being visualized with this plugin may be different: not only IT components (e.g. server
hosts and Kubernetes pods) but just anything you can imagine like coffee makers on the picture
above. These objects should have discrete statuses which are sets of predefined values, e.g.
ok = 0, off = 1, fail = 2, etc.

Datasource notes

To make multiple values mode works as expected you should define multiple queries: one query for each possible status.

Plugin doesn't aggregate data in time for now, it only renders input data as buckets. Because of this
data should contain points for each timestamp in time range and equal timestamps for every possible
target (y-axis label). This limitation is addressed by issue #53.

Prometheus

To work with data from Prometheus you will need to setup discrete statuses for your objects.
Requirements to store these statuses in metrics are as follows:

That's how coffee_maker_status metric with value 3 will be transformed into new metric:

coffee_maker_status:discrete{status="3"} 1

Now, when Prometheus has 0 and 1 values for each status, all these metrics can be
aggregated, so you will get all available statuses of your objects over time.

InfluxDB

Choose 'Time series' for 'Format as' and use GROUP BY ($__interval) in query. $tag_<tag name> can be used in 'Alias by' to define y-axis labels.

Mysql

Example query with aggregation over $__interval is like this (you need one query for each possible status value):

SELECT
$__timeGroupAlias(date_insert,$__interval),
name AS metric,
min(statusi) AS "statusi"
FROM coffee_makers
WHERE
$__timeFilter(date_insert) AND statusi=1
GROUP BY 1,2
ORDER BY $__timeGroup(date_insert,$__interval)

metric column is used as y-axis label.

Panel

First of all, an individual query for each possible status' value should be created.
Each query should also have similar legend for grouping:

Then, color mapping for status' values should be defined in Discrete color mode:

Use can use presets to define a trafic light colors or 8 colors from solarized palette:

Note: Spectrum and Opacity color modes function the same way they do in Heatmap plugin.

More options

Bucket

Multiple values checkbox specifies how they should be displayed:

If it's off, multiple values for one bucket are treated as error;

If it's on, color for such bucket would be determined by the value having least index in color mapping.

Null values can be treated as empty buckets or displayed with the color of 0 value.

Min width and spacing are used to specify minimal bucket width and spacing between buckets.
Rounding may be used to round edges.

Display

Show legend checkbox toggles legend at the bottom of the panel.

Show tooltip toggles tooltip display on mouse over buckets.

Y axis sort can be used to sort labels on Y axis. Metrics — sort y labels as they are defined on Metrics tab. a→z and z→a sort labels descending or ascending in a natural order.

Development

To test and improve the plugin you can run Grafana instance in Docker using following command (in
the directory containing Statusmap plugin):

This will expose local plugin from your machine to Grafana container. Now run grunt to compile
dist directory and start changes watcher:

grunt watch

Acknowledgements

The first public release of this plugin has been fully made by Flant engineers. The whole idea has come from Dmitry Stolyarov (@distol), initial version has been written by Sergey Gnuskov (@gsmetal) and final changes has been made by Ivan Mikheykin (@diafour).

This plugin is based on "Heatmap" panel by Grafana and partly inspired by ideas from Carpet plot, Discrete panel, Status Panel, Status Dot, Status By Group.