Fix up collector registration (#812)

Use const definitions to make collector registration consistent.
* Use collector subsystem name consistently.
* Fix up replication metric name unit.

Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
Ben Kochie
2023-06-13 17:28:11 +02:00
committed by GitHub
parent 3e585c4061
commit 99828de70a
11 changed files with 65 additions and 29 deletions

View File

@@ -21,16 +21,16 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
const processIdleSubsystem = "process_idle"
func init() {
registerCollector("statements", defaultEnabled, NewPGProcessIdleCollector)
registerCollector(processIdleSubsystem, defaultEnabled, NewPGProcessIdleCollector)
}
type PGProcessIdleCollector struct {
log log.Logger
}
const processIdleSubsystem = "process_idle"
func NewPGProcessIdleCollector(config collectorConfig) (Collector, error) {
return &PGProcessIdleCollector{log: config.logger}, nil
}