mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-25 12:38:03 +00:00
Fix the column labeling properly.
This commit is contained in:
parent
4191c1a938
commit
ddf582dcdf
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user