Skip to content

Commit

Permalink
Merge pull request #37 from oliver006/oh_continue_without_CONFIG
Browse files Browse the repository at this point in the history
Continue even if CONFIG fails (for AWS ElastiCache)
  • Loading branch information
oliver006 authored Nov 3, 2016
2 parents 817895f + 1a5878f commit 8a7ff20
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions exporter/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ func (e *Exporter) initGauges() {
Name: "db_avg_ttl_seconds",
Help: "Avg TTL in seconds",
}, []string{"addr", "db"})
// Emulate a Summary.

// Emulate a Summary.
e.metrics["command_call_duration_seconds_count"] = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: e.namespace,
Name: "command_call_duration_seconds_count",
Expand Down Expand Up @@ -442,15 +443,8 @@ func (e *Exporter) scrape(scrapes chan<- scrapeResult) {
continue
}

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

if err != nil {
log.Printf("redis err: %s", err)
errorCount++
continue
if config, err := redis.Strings(c.Do("CONFIG", "GET", "maxmemory")); err == nil {
extractConfigMetrics(config, addr, scrapes)
}

for _, k := range e.keys {
Expand Down

0 comments on commit 8a7ff20

Please sign in to comment.