From 4477dfa9b3694d8305ff8fe048ad4668d2ba145b Mon Sep 17 00:00:00 2001 From: Will Rouesnel Date: Tue, 6 Jun 2017 22:47:52 +1000 Subject: [PATCH] Add warning if Postgres Version is lower then the minimum version. --- postgres_exporter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/postgres_exporter.go b/postgres_exporter.go index 9d745706..0ff18072 100644 --- a/postgres_exporter.go +++ b/postgres_exporter.go @@ -881,6 +881,9 @@ func (e *Exporter) checkMapVersions(ch chan<- prometheus.Metric, db *sql.DB) err return errors.New(fmt.Sprintln("Error scanning version string:", err)) } semanticVersion, err := parseVersion(versionString) + if semanticVersion.LT(lowestSupportedVersion) { + log.Warnln("PostgreSQL version is lower then our lowest supported version! Got", semanticVersion.String(), "minimum supported is", lowestSupportedVersion.String()) + } // Check if semantic version changed and recalculate maps if needed. if semanticVersion.NE(e.lastMapVersion) || e.metricMap == nil {