You've already forked postgres_exporter
mirror of
https://github.com/prometheus-community/postgres_exporter.git
synced 2025-07-31 20:44:25 +03:00
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:
@ -21,8 +21,10 @@ import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
const databaseSubsystem = "database"
|
||||
|
||||
func init() {
|
||||
registerCollector("database", defaultEnabled, NewPGDatabaseCollector)
|
||||
registerCollector(databaseSubsystem, defaultEnabled, NewPGDatabaseCollector)
|
||||
}
|
||||
|
||||
type PGDatabaseCollector struct {
|
||||
@ -43,7 +45,11 @@ func NewPGDatabaseCollector(config collectorConfig) (Collector, error) {
|
||||
|
||||
var (
|
||||
pgDatabaseSizeDesc = prometheus.NewDesc(
|
||||
"pg_database_size_bytes",
|
||||
prometheus.BuildFQName(
|
||||
namespace,
|
||||
databaseSubsystem,
|
||||
"size_bytes",
|
||||
),
|
||||
"Disk space used by the database",
|
||||
[]string{"datname"}, nil,
|
||||
)
|
||||
|
Reference in New Issue
Block a user