Fixed: differentiate stats gathered from multiple redis servers/instances

This commit is contained in:
Sherif Zain 2015-06-21 23:38:42 +02:00
parent 480f29bde7
commit 2ccd828e81
1 changed files with 3 additions and 2 deletions

View File

@ -157,11 +157,12 @@ func (g *Redis) gatherServer(addr string, acc plugins.Accumulator) error {
continue continue
} }
tags := map[string]string{"host": addr}
val := strings.TrimSpace(parts[1]) val := strings.TrimSpace(parts[1])
ival, err := strconv.ParseUint(val, 10, 64) ival, err := strconv.ParseUint(val, 10, 64)
if err == nil { if err == nil {
acc.Add(metric, ival, nil) acc.Add(metric, ival, tags)
continue continue
} }
@ -170,7 +171,7 @@ func (g *Redis) gatherServer(addr string, acc plugins.Accumulator) error {
return err return err
} }
acc.Add(metric, fval, nil) acc.Add(metric, fval, tags)
} }
return nil return nil