Receiving a total of two series of data from InfluxDB in Grafan

I am puzzled at this moment. I spent a day or three at the deep end of Influx and Grafana to get schedules that are critical to my needs. However, with the latter, I need to sum two metrics (two increment values, in a column value). Name them notifications.one and notifications.two. On the graph that I would like to display, it will work well, for a total of two, one line of the graph showing (notifications.one + notifications.two) instead of two separate ones.

I tried with the usual SELECT sum(value) fromtwo, but I don't get any data from it (what exists!). There is also merge () mentioned in the Influx documentation, but I can't get this to work.

The documentation for merging requires something like:

SELECT mean(value) FROM /notifications.*/ WHERE ...

It also returns as a flat zero line.

I hope that my question carries some weight, because I do not have enough knowledge to alleviate the problem as much as possible.

Thanks.

+4
source share
3 answers

In InfluxDB 0.9 there is no way to combine the results of a query by measurements. Within a dimension, all series are merged by default, but no series can be combined between dimensions. See https://influxdb.com/docs/v0.9/concepts/08_vs_09.html#joins for more details .

0.9 : notifications.one notifications.two, notifications foo=one foo=two . SELECT MEAN(value) FROM notifications, SELECT MEAN(value) FROM notifications GROUP BY foo

+4

InfluxDB 0.12 :

SELECT MEAN(usage_system) + MEAN(usage_user) + MEAN(usage_irq) AS cpu_total 
  FROM cpu
  WHERE time > now() - 10s 
  GROUP BY host;

, .

+10

Source: https://habr.com/ru/post/1617974/


All Articles