Search code examples
prometheusgrafanametrics

Calculate values from counter metric in grafana


I have a counter metric in prometheus, how can I calculate last, avg, min, max values for my grafana like it is in zabbix ?


Solution

  • You can use the Prometheus aggregation operators, like:

    avg(YOUR-METRIC[1h])
    min(YOUR-METRIC[1d])
    max(YOUR-METRIC[1w]) 
    

    Or use the display options of the Stat panel in a Grafana dashboard:

    enter image description here