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.

increase(sum(api_logins))

Thanks for the help.

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

sum(sum_over_time(api_logins[$__interval]))

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

sum(sum_over_time(api_logins[$__interval]))
sum(increase(api_logins[$__interval]))
sum(sum_over_time(api_logins[$__range]))
sum(increase(api_logins[$__range]))

The graph still isn’t monotonously increasing.
Anyone?

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.