Skip to content

Commit

Permalink
Use UnRegisterer in the Limiter
Browse files Browse the repository at this point in the history
To ensure that limit reloads will be able to re-register their metrics.

Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com>
  • Loading branch information
douglascamata committed Oct 11, 2022
1 parent 67ea81b commit fd98829
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/receive/limiter.go
Expand Up @@ -60,21 +60,21 @@ func NewLimiter(configFile fileContent, reg prometheus.Registerer, r ReceiverMod
writeGate: gate.NewNoop(),
requestLimiter: &noopRequestLimiter{},
HeadSeriesLimiter: NewNopSeriesLimit(),
registerer: reg,
registerer: NewUnRegisterer(reg),
logger: logger,
receiverMode: r,
}

if reg != nil {
limiter.configReloadCounter = promauto.With(reg).NewCounter(
limiter.configReloadCounter = promauto.With(limiter.registerer).NewCounter(
prometheus.CounterOpts{
Namespace: "thanos",
Subsystem: "receive",
Name: "limits_config_reload_total",
Help: "How many times the limit configuration was reloaded",
},
)
limiter.configReloadFailedCounter = promauto.With(reg).NewCounter(
limiter.configReloadFailedCounter = promauto.With(limiter.registerer).NewCounter(
prometheus.CounterOpts{
Namespace: "thanos",
Subsystem: "receive",
Expand Down

0 comments on commit fd98829

Please sign in to comment.