add tag: replica_role for redis plugin Merge pull request #50 from flashcatcloud/redis_plugin
add tag: replica_role for redis plugin
This commit is contained in:
commit
5b89d64dcc
|
@ -278,6 +278,11 @@ func (r *Redis) gatherInfoAll(slist *list.SafeList, ins *Instance, tags map[stri
|
|||
continue
|
||||
}
|
||||
|
||||
if name == "role" {
|
||||
tags["replica_role"] = val
|
||||
continue
|
||||
}
|
||||
|
||||
// ignore other string fields
|
||||
}
|
||||
|
||||
|
@ -389,7 +394,7 @@ func gatherReplicationLine(
|
|||
}
|
||||
|
||||
tags["replica_id"] = strings.TrimLeft(name, "slave")
|
||||
tags["replica_role"] = "slave"
|
||||
// tags["replica_role"] = "slave"
|
||||
|
||||
parts := strings.Split(line, ",")
|
||||
for _, part := range parts {
|
||||
|
|
Loading…
Reference in New Issue