1

Is it possible to make a sum of values - depending on multi-selections in query (templating) - and showing those in a singlestat plugin in grafana?

setup:

  • grafana 3.1.1
  • datatsource: graphite

Use case:

A query-based dropdownlist allows me to select a logical volume.

The singlestat then shows me the size of this logical volume.

Now I have a multi-select query list so I'd love to achieve that the size value for each of those selected logical volumes is summed and shown in the singlestat.

I've been trying to find some function and I know there are sum functions but in my case, I don't know which are going to be the results of the selections in the templating query and there doesn't seem to exist a way to automatically add an "invisible" query to the metrics section while only showing a sum-of-all-queries-metric.

Are there any options to achieve this?

a sample query:

collectd.$host.$volumegroups.$logicalvolumes

where all 3 values are from a templating query with results like:

$host => the server in question
$volumegroups => vg00 (LVM Volume Group)
$logicalvolumes => lv_data, lv_root, ... (LVM Logical Volume)

Now when selecting multiple "$logicalvolumes" from the dropdown ofcourse, the singlestat goes "N/A".

In the list of plugins on grafana website, I don't find any other plugin to match this need.

  • groupByNode("sum",1) – MUY Belgium Nov 20 '17 at 13:01
1

Grafana community provided the answer here: 1

effectively by using the "sumseries" function it works as expected.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.