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 the column labeling properly.
This commit is contained in:
@ -348,8 +348,9 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
|
|||||||
|
|
||||||
// Get the label values for this row
|
// Get the label values for this row
|
||||||
var labels = make([]string, len(mapping.labels))
|
var labels = make([]string, len(mapping.labels))
|
||||||
for i, n := range labels {
|
for idx, columnName := range mapping.labels {
|
||||||
labels[i], _ = dbToString(columnData[columnIdx[n]])
|
|
||||||
|
labels[idx], _ = dbToString(columnData[columnIdx[columnName]])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop over column names, and match to scan data. Unknown columns
|
// Loop over column names, and match to scan data. Unknown columns
|
||||||
|
Reference in New Issue
Block a user