Skip to content

Commit

Permalink
Merge pull request #5 from d0x2f/master
Browse files Browse the repository at this point in the history
set 'up' metric to 1 if the ping test doesn't fail.
  • Loading branch information
pengbo0328 authored Jul 21, 2021
2 parents 566a3be + 8a9dc56 commit 71733ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pgpool2_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"sync"
"time"


"github.com/go-kit/kit/log/level"
_ "github.com/lib/pq"
"github.com/blang/semver"
Expand Down Expand Up @@ -450,7 +451,7 @@ func dbToString(t interface{}) (string, bool) {
return v, true
case bool:
if v {
return "true", true
return "true", true
}
return "false", true
default:
Expand Down Expand Up @@ -604,11 +605,10 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
}
e.up.Set(0)
return
} else {
e.up.Set(1)
}
}

e.up.Set(1)
e.error.Set(0)

e.mutex.RLock()
Expand Down

0 comments on commit 71733ed

Please sign in to comment.