Open
Description
Hi,
I think it makes sense to have this verification on client-side in official Prometheus library - some rules are must-have like _total
. I guess the problem is how to error... probably panic is the only option?
Alternatively, we can implement it on our (e.g Thanos side). Plus we can be even more opinionated. Some wrapper that will panic if:
- NewCounter is invoked without
_total
suffix - NewTimeHistogram invoked without
_seconds
andNewSizeHistogram
invoked without_bytes
(we only have two types).
Alternatively (3rd) NewCounter
could always add _total
if not specified, but that's surprising. Sometimes we discover metrics from code.
Use case: 10000 bugs where we forgot to ensure _total
of counter suffix in PR review time...