diff --git a/apps/postgres.go b/apps/postgres.go index 6046eb5..3a007cb 100644 --- a/apps/postgres.go +++ b/apps/postgres.go @@ -9,13 +9,13 @@ import ( ) func Postgres(m Metrics) { - out, err := exec.Command("psql", "--version").Output() + out, err := exec.Command("pg_config", "--version").Output() if err != nil { log.Printf(">> WARN: Unable to get Postgres version: %v", err) return } - version := strings.Split(string(out), " ")[2] + version := strings.Split(string(out), " ")[1] m.Postgres.With(prometheus.Labels{"version": version}).Set(1) }