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:
@@ -20,8 +20,10 @@ import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
const postmasterSubsystem = "postmaster"
|
||||
|
||||
func init() {
|
||||
registerCollector("postmaster", defaultEnabled, NewPGPostmasterCollector)
|
||||
registerCollector(postmasterSubsystem, defaultEnabled, NewPGPostmasterCollector)
|
||||
}
|
||||
|
||||
type PGPostmasterCollector struct {
|
||||
@@ -33,7 +35,11 @@ func NewPGPostmasterCollector(collectorConfig) (Collector, error) {
|
||||
|
||||
var (
|
||||
pgPostMasterStartTimeSeconds = prometheus.NewDesc(
|
||||
"pg_postmaster_start_time_seconds",
|
||||
prometheus.BuildFQName(
|
||||
namespace,
|
||||
postmasterSubsystem,
|
||||
"start_time_seconds",
|
||||
),
|
||||
"Time at which postmaster started",
|
||||
[]string{}, nil,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user