fix: redundant registration for prometheus collector metrics (#21156)

pull/21162/head v1.9.0rc1
Sam Arnold 2021-04-07 13:38:00 -03:00 committed by GitHub
parent 333cff1b15
commit fed8ca1ace
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 14 deletions

View File

@ -19,6 +19,7 @@ v1.9.0 [unreleased]
### Bugfixes
- [#21156](https://github.com/influxdata/influxdb/pull/21156): fix: redundant registration for prometheus collector metrics
- [#21052](https://github.com/influxdata/influxdb/pull/21052): fix: help text for influx_inspect
- [#20889](https://github.com/influxdata/influxdb/pull/20889): fix: Add back flux CLI (#20889)
- [#20802](https://github.com/influxdata/influxdb/pull/20802): fix(tsm1): fix data race and validation in cache ring

View File

@ -41,7 +41,6 @@ import (
"github.com/influxdata/influxdb/tsdb"
"github.com/influxdata/influxdb/uuid"
"github.com/influxdata/influxql"
prom "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/prometheus/prompb"
"go.uber.org/zap"
@ -134,7 +133,6 @@ type Handler struct {
// Flux services
Controller Controller
CompilerMappings flux.CompilerMappings
registered bool
Config *Config
Logger *zap.Logger
@ -332,11 +330,6 @@ func (h *Handler) Open() {
if h.Config.AuthEnabled && h.Config.SharedSecret == "" {
h.Logger.Info("Auth is enabled but shared-secret is blank. BearerAuthentication is disabled.")
}
if h.Config.FluxEnabled {
h.registered = true
prom.MustRegister(h.Controller.PrometheusCollectors()...)
}
}
func (h *Handler) Close() {
@ -349,13 +342,6 @@ func (h *Handler) Close() {
h.accessLog = nil
h.accessLogFilters = nil
}
if h.registered {
for _, col := range h.Controller.PrometheusCollectors() {
prom.Unregister(col)
}
h.registered = false
}
}
// Statistics maintains statistics for the httpd service.