You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A mistake, hard to spot during code reviews, is to create Prometheus metrics but not register them to the registry.
In order to overcome this problem, I've drafted a plan in Cortex cortexproject/cortex#2204 long time ago. I did a check and I think we're finally ready to enforce it in Mimir.
My proposed plan is to enforce the usage of promauto.With(reg).XXX() everywhere, doing the following:
Forbid the usage of promauto.{NewCounter,NewCounterVec,NewCounterFunc,NewGauge,NewGaugeVec,NewGaugeFunc,NewSummary,NewSummaryVec,NewHistogram,NewHistogramVec} and prometheus.{NewCounter,NewCounterVec,NewCounterFunc,NewGauge,NewGaugeVec,NewGaugeFunc,NewSummary,NewSummaryVec,NewHistogram,NewHistogramVec}, except few places where it's very difficult to get rid of it (with a //lint:ignore directive)
The text was updated successfully, but these errors were encountered:
A mistake, hard to spot during code reviews, is to create Prometheus metrics but not register them to the registry.
In order to overcome this problem, I've drafted a plan in Cortex cortexproject/cortex#2204 long time ago. I did a check and I think we're finally ready to enforce it in Mimir.
My proposed plan is to enforce the usage of
promauto.With(reg).XXX()
everywhere, doing the following:prometheus.{MustRegister,Register,DefaultRegisterer}
(see Reduce usage of global Prometheus registerer #2750)promauto.{NewCounter,NewCounterVec,NewCounterFunc,NewGauge,NewGaugeVec,NewGaugeFunc,NewSummary,NewSummaryVec,NewHistogram,NewHistogramVec}
andprometheus.{NewCounter,NewCounterVec,NewCounterFunc,NewGauge,NewGaugeVec,NewGaugeFunc,NewSummary,NewSummaryVec,NewHistogram,NewHistogramVec}
, except few places where it's very difficult to get rid of it (with a//lint:ignore
directive)The text was updated successfully, but these errors were encountered: