We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 790ee13 + d279aa0 commit 94d2d77Copy full SHA for 94d2d77
collector/collector.go
@@ -39,6 +39,13 @@ func parseStatus(data sql.RawBytes) (float64, bool) {
39
if bytes.Compare(data, []byte("Connecting")) == 0 {
40
return 0, true
41
}
42
+ // SHOW GLOBAL STATUS like 'wsrep_cluster_status' can return "Primary" or "Non-Primary"/"Disconnected"
43
+ if bytes.Compare(data, []byte("Primary")) == 0 {
44
+ return 1, true
45
+ }
46
+ if bytes.Compare(data, []byte("Non-Primary")) == 0 || bytes.Compare(data, []byte("Disconnected")) == 0 {
47
+ return 0, true
48
49
if logNum := logRE.Find(data); logNum != nil {
50
value, err := strconv.ParseFloat(string(logNum), 64)
51
return value, err == nil
0 commit comments