Add role tag to redis plugins (#1207)

fixes #1203

- Format code
This commit is contained in:
Anthony Brodard 2016-05-18 15:17:14 +02:00 committed by Cameron Sparr
parent c292e3931a
commit 33cacc71b8
1 changed files with 6 additions and 0 deletions

View File

@ -74,6 +74,7 @@ var Tracking = map[string]string{
"used_cpu_user": "used_cpu_user",
"used_cpu_sys_children": "used_cpu_sys_children",
"used_cpu_user_children": "used_cpu_user_children",
"role": "role",
}
var ErrProtocolError = errors.New("redis protocol error")
@ -206,6 +207,11 @@ func gatherInfoOutput(
keyspace_misses = ival
}
if name == "role" {
tags["role"] = val
continue
}
if err == nil {
fields[metric] = ival
continue