Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCounter overflowing and wraparound to zero, and Go 2 #3031
Comments
This comment has been minimized.
This comment has been minimized.
|
If you are referring to counters as metric type, Prometheus uses float64 for them, so they don't wrap around like ints do. In general, it makes more sense to start discussions like this on the prometheus-developers mailing list rather than in a GitHub issue. On the mailing list, more people are available to take part, and the whole community can benefit from the results. |
beorn7
closed this
Aug 7, 2017
This comment has been minimized.
This comment has been minimized.
bcmills
commented
Aug 31, 2017
|
The thing to watch out for with If you're running on a machine clocked at 3GHz and (generously) increment the counter by one at every cycle cycle, that gives an uptime of ~34¾ days until the counter freezes. In more realistic scenarios you're looking at an uptime on the order of years before it becomes a problem. Of course, if you call |
This comment has been minimized.
This comment has been minimized.
|
Is there a scenario where one would call the Prometheus client at around a billion times a second? The only places I have seen such fast-increasing counters is in hardware devices (CPUs, switches) and extracted at scrape time. And in this scenario floats are very good because they will support 128-bit integers and beyond naturally. |
This comment has been minimized.
This comment has been minimized.
|
Actually, not beyond. TIL that the largest finite float64 is around 2^128. |
This comment has been minimized.
This comment has been minimized.
|
Anyway, this is all very interesting but I don't think panics from wrapped integers will be a problem. |
joshwilsdon
referenced this issue
Oct 22, 2018
Closed
node-artedi histograms should be compatible with Prometheus #17
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
jondot commentedAug 7, 2017
•
edited
Hello,
Assuming counters wrap around silently (given a process with a good uptime and a good amount of counter increase), for current Go version - is that by design? and also - how would it fare with this possible change? golang/go#19624
Thanks,