From 2ccd828e8135529be5f7ea594cc8f55e4352a1e9 Mon Sep 17 00:00:00 2001 From: Sherif Zain Date: Sun, 21 Jun 2015 23:38:42 +0200 Subject: [PATCH] Fixed: differentiate stats gathered from multiple redis servers/instances --- plugins/redis/redis.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/redis/redis.go b/plugins/redis/redis.go index 2b56ac8c3..2dd184a12 100644 --- a/plugins/redis/redis.go +++ b/plugins/redis/redis.go @@ -157,11 +157,12 @@ func (g *Redis) gatherServer(addr string, acc plugins.Accumulator) error { continue } + tags := map[string]string{"host": addr} val := strings.TrimSpace(parts[1]) ival, err := strconv.ParseUint(val, 10, 64) if err == nil { - acc.Add(metric, ival, nil) + acc.Add(metric, ival, tags) continue } @@ -170,7 +171,7 @@ func (g *Redis) gatherServer(addr string, acc plugins.Accumulator) error { return err } - acc.Add(metric, fval, nil) + acc.Add(metric, fval, tags) } return nil