Open krukru opened 7 years ago
What's your use case for resetting counters?
For example, we keep track of the number of successful/failed http requests since the last server restart. I guess that this could be handled with a workaround (labels), but it seemed just practical to reset the counters on a server crash and start counting again from 0.
Ah, so you want to reset metrics in Redis, correct? Because with APC they would automatically be resetted.
Right, APC would be reset since it is not persistent. But Redis (and a theoretical File Storage adapter) would require this to be reset.
OK, but wouldn't it make sense than to add this to every possible metric?
Well, you are right on that account :)
If you think this is a good PR I can update it to include other metrics as well (not just Counter
)
But how does it matter to prometheus, it anyway handles counter resets doing some normalisation, right? I am just curious how do you end up using this data.
I couldn't find a way to reset the counter values to zero (since they persist in Redis/APC) so I added a reset method.