Skip to content

Commit 2a8bef5

Browse files
committed
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`
1 parent 4c8b970 commit 2a8bef5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

postgres_exporter.go

+4
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ func makeDescMap(metricMaps map[string]map[string]ColumnMapping) map[string]Metr
286286
return math.NaN(), false
287287
}
288288

289+
if durationString == "-1" {
290+
return math.NaN(), false
291+
}
292+
289293
d, err := time.ParseDuration(durationString)
290294
if err != nil {
291295
log.Errorln("Failed converting result to metric:", columnName, in, err)

0 commit comments

Comments
 (0)