Counter resetting?

I want to have a graph for “logins per day”.

When I just use sum(api_logins) I am getting a graph like this:

Screen Shot 2021-05-03 at 22.32.56

This is a prometheus counter. It should be monotonically increasing. Now there might be restarts (where it goes back to zero). I haven’t overlaid the data - but I assume that’s what caused the set backs.

The question is - how do I get the graph without the drops?
I thought a combination of sum and increase would do it - but I couldn’t quite get that to work.


Thanks for the help.

This seems to be getting me closer - but it’s still not it.


How hard can this be? None of the following seems to be right:


The graph still isn’t monotonously increasing.

How on earth can sum(increase(api_logins[$__range])) result in this graph?

Screen Shot 2021-05-05 at 01.32.01

From reading the docs it should be just monotonously increasing.

Anyone? I still haven’t found a solution for this.