2

I have a Grafana dashboard with a Prometheus data source with multiple queries, based on different metrics, each giving some resource usage of a server.

The time series of those queries might be like this (simplified):

time --->
server 1:  10  11  11  10
server 2:  25  25  27  26
server 3:  49  35  28  23

I'm only interested in the current value (last not null), but the queries give a time series, of course. So I am using the Gauge visualization. And then I want to show the resource usage of the busiest server.

I have tried all kinds of transformations, but either I get the maximum of all the retrieved data (in this example 49), or some number I can't really interpret, but which is definitely not the maximum of the current values. In the example I expect to get 26.

I think it is not possible or at least not wise from a performance perspective to combine the queries into one (in my case I have 6 queries), and I can't find a transformation that seems to do the work.

Complication is that the various time series are not scraped at the same time. Say for example that series 1 and 2 are scraped at 10 sec past the minute, and series 3 at 30 seconds past the minute. Then at 20 seconds past the minute, then the transformation "Add field from calculation", mode "Reduce row", calculation "max" gives 26. But at 35 seconds past the minute, it will give 23.

Marco
  • 21
  • 2

0 Answers0