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:
ulricqin 2022-06-24 19:40:20 +08:00 committed by GitHub
commit 5b89d64dcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -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 {