Skip to content

Commit

Permalink
Merge pull request #46 from eagafonov/master
Browse files Browse the repository at this point in the history
Add redis_up gauge
  • Loading branch information
oliver006 authored Dec 19, 2016
2 parents a410b50 + 5d903fc commit 45ed897
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions exporter/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ func (e *Exporter) scrape(scrapes chan<- scrapeResult) {
var c redis.Conn
var err error

scrapes <- scrapeResult{Name: "up", Addr: addr, Value: 0}

var options []redis.DialOption
if len(e.redis.Passwords) > idx && e.redis.Passwords[idx] != "" {
options = append(options, redis.DialPassword(e.redis.Passwords[idx]))
Expand Down Expand Up @@ -444,6 +446,8 @@ func (e *Exporter) scrape(scrapes chan<- scrapeResult) {
continue
}

scrapes <- scrapeResult{Name: "up", Addr: addr, Value: 1}

if config, err := redis.Strings(c.Do("CONFIG", "GET", "maxmemory")); err == nil {
extractConfigMetrics(config, addr, scrapes)
}
Expand Down

0 comments on commit 45ed897

Please sign in to comment.