mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-05-05 01:18:02 +00:00
Handle pg_runtime_variable
return values
When querying postgres `pg_runtime_variable`, postgres might return -1 for `max_standby_archive_delay` and `max_standby_streaming_delay`
This commit is contained in:
parent
4c8b9700c6
commit
2a8bef5235
@ -286,6 +286,10 @@ func makeDescMap(metricMaps map[string]map[string]ColumnMapping) map[string]Metr
|
|||||||
return math.NaN(), false
|
return math.NaN(), false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if durationString == "-1" {
|
||||||
|
return math.NaN(), false
|
||||||
|
}
|
||||||
|
|
||||||
d, err := time.ParseDuration(durationString)
|
d, err := time.ParseDuration(durationString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorln("Failed converting result to metric:", columnName, in, err)
|
log.Errorln("Failed converting result to metric:", columnName, in, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user