Skip to content

Commit 9cdd620

Browse files
authored
Merge pull request #6 from marcusmartins/duration_handling
Handle `pg_runtime_variable` return values
2 parents 382729a + 2a8bef5 commit 9cdd620

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
@@ -288,6 +288,10 @@ func makeDescMap(metricMaps map[string]map[string]ColumnMapping) map[string]Metr
288288
return math.NaN(), false
289289
}
290290

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

0 commit comments

Comments
 (0)