Best way to do total count in case of counter reset ?
See original GitHub issueI am using prometheus + grafana, and wrote a simple query like sum(increase(some_count[$__range]))
, although this takes the difference between the first and last values, seeing prometheus values gets restart on restart of our node server, any better approach to tackle this problem ? Sample graph explaining the drop due to server restart
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
counter-reset - CSS: Cascading Style Sheets - MDN Web Docs
The counter-reset CSS property resets a CSS counter to a given value. This property will create a new counter or reversed counter with...
Read more >Prometheus how to handle counters on server - Stack Overflow
Counters are allowed to be reset to 0, so there's no need to do anything special here to handle it.
Read more >Working With Prometheus Counter Metrics - Level Up Coding
In this article, we will look at the Prometheus counter metric and explain how to use rate, increase, irate, and resets to get...
Read more >Reset Counter - The Art of PostgreSQL
All we have to do now is sum this computed columns entries. Remember that the sum() aggregate function will simply discard nulls, so...
Read more >resetting a counter for each day - Splunk Community
I try to count the maximum of concurrent sessions on a system where the ... to do that (or solve the problem somehow...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just to leave this here:
Is what I was looking for when I came here via search.
@somyarocketium With prometheus + grafana I believe you can get the grand total of all increase in the current window by using the legend. You can do something like this Query:
Setting $__interval will automatically use the minimum x-axis time unit based on your window resolution. $__interval is an auto scaling feature you can use with prometheus + grafana. Make sure to also set min step to 1m.
Visualization > Legend
The total that is reflected in the legend will be the total increase that happened in your window. This should work regardless if a counter reset happened
Result: