Skip to content

Commit 2bb86cd

Browse files
sysadmindSuperQ
andauthored
Update config/config.go
Co-authored-by: Ben Kochie <superq@gmail.com>
1 parent 1263ccd commit 2bb86cd

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

config/config.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,24 @@ import (
2222

2323
"github.com/go-kit/log"
2424
"github.com/prometheus/client_golang/prometheus"
25+
"github.com/prometheus/client_golang/prometheus/promauto"
2526
"gopkg.in/yaml.v3"
2627
)
2728

2829
var (
29-
configReloadSuccess = prometheus.NewGauge(prometheus.GaugeOpts{
30+
configReloadSuccess = promauto.NewGauge(prometheus.GaugeOpts{
3031
Namespace: "postgres_exporter",
3132
Name: "config_last_reload_successful",
3233
Help: "Postgres exporter config loaded successfully.",
3334
})
3435

35-
configReloadSeconds = prometheus.NewGauge(prometheus.GaugeOpts{
36+
configReloadSeconds = promauto.NewGauge(prometheus.GaugeOpts{
3637
Namespace: "postgres_exporter",
3738
Name: "config_last_reload_success_timestamp_seconds",
3839
Help: "Timestamp of the last successful configuration reload.",
3940
})
4041
)
4142

42-
func init() {
43-
prometheus.MustRegister(configReloadSuccess)
44-
prometheus.MustRegister(configReloadSeconds)
45-
}
46-
4743
type Config struct {
4844
AuthModules map[string]AuthModule `yaml:"auth_modules"`
4945
}

0 commit comments

Comments
 (0)