From f870f9591b9eb0a524a3b0ce109827d9992bcee5 Mon Sep 17 00:00:00 2001 From: Don Petersen Date: Tue, 25 Feb 2020 03:56:49 -0800 Subject: [PATCH] Don't ignore errors in parseUserQueries (#362) Failures in parsing the user's queries are just being swallowed, which makes troubleshooting YAML issues frustrating/impossible. I'm presuming this was not intentional, since there is error handling code in the function that calls this one, though it is unreachable as far as I can tell without this change. Co-authored-by: Will Rouesnel --- cmd/postgres_exporter/postgres_exporter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/postgres_exporter/postgres_exporter.go b/cmd/postgres_exporter/postgres_exporter.go index 1a9eaaa7..37795aac 100644 --- a/cmd/postgres_exporter/postgres_exporter.go +++ b/cmd/postgres_exporter/postgres_exporter.go @@ -542,7 +542,7 @@ func parseUserQueries(content []byte) (map[string]intermediateMetricMap, map[str func addQueries(content []byte, pgVersion semver.Version, server *Server) error { metricMaps, newQueryOverrides, err := parseUserQueries(content) if err != nil { - return nil + return err } // Convert the loaded metric map into exporter representation partialExporterMap := makeDescMap(pgVersion, server.labels, metricMaps)