mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-01-10 08:19:31 +00:00
Add missing server label
Signed-off-by: Joe Adams <github@joeadams.io>
This commit is contained in:
parent
21a19ed252
commit
1981623d9d
@ -30,7 +30,7 @@ var pgDatabase = map[string]*prometheus.Desc{
|
|||||||
"size_bytes": prometheus.NewDesc(
|
"size_bytes": prometheus.NewDesc(
|
||||||
"pg_database_size_bytes",
|
"pg_database_size_bytes",
|
||||||
"Disk space used by the database",
|
"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(
|
metrics = append(metrics, prometheus.MustNewConstMetric(
|
||||||
pgDatabase["size_bytes"],
|
pgDatabase["size_bytes"],
|
||||||
prometheus.GaugeValue, float64(size), datname,
|
prometheus.GaugeValue, float64(size), datname, server,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
if err := rows.Err(); err != nil {
|
if err := rows.Err(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user