Add missing server label

Signed-off-by: Joe Adams <github@joeadams.io>
This commit is contained in:
Joe Adams 2022-02-09 21:56:48 -05:00
parent 21a19ed252
commit 1981623d9d
No known key found for this signature in database
GPG Key ID: 2A21CFFDE8B588C6

View File

@ -30,7 +30,7 @@ var pgDatabase = map[string]*prometheus.Desc{
"size_bytes": prometheus.NewDesc(
"pg_database_size_bytes",
"Disk space used by the database",
[]string{"datname"}, nil,
[]string{"datname", "server"}, nil,
),
}
@ -53,7 +53,7 @@ func (PGDatabaseCollector) Update(ctx context.Context, db *sql.DB, server string
}
metrics = append(metrics, prometheus.MustNewConstMetric(
pgDatabase["size_bytes"],
prometheus.GaugeValue, float64(size), datname,
prometheus.GaugeValue, float64(size), datname, server,
))
}
if err := rows.Err(); err != nil {