Search code examples
prometheusgrafana

Why is increase() showing only zero values when I can see the metric value increasing?


I am using Grafana to visualise a Prometheus time-series. When I simply set my stacked graph to visualise my_metric I get this: enter image description here

If I change to increase(my_metric[1h]) I get all zeroes:

enter image description here

Everything else is basically the defaults so I don't understand. I can see the values change so am I misunderstanding something how increase() works?


Solution

  • There's no increases there, the time series appear with the value 1. If they had increased from 0 to 1 rather than nothing to 1 then increase would show a non-zero value. I'd recommend initialising your metrics with the label values you know about.