From f6eef14451b02e950c501f43ff2696fe308342fc Mon Sep 17 00:00:00 2001 From: emma Date: Thu, 23 Feb 2023 12:21:59 +0100 Subject: [PATCH] fix bug #469, don't send replication metric when topology galera or grouprep --- cluster/srv_snd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster/srv_snd.go b/cluster/srv_snd.go index 235f0b058..efa728c93 100644 --- a/cluster/srv_snd.go +++ b/cluster/srv_snd.go @@ -24,7 +24,7 @@ func (server *ServerMonitor) GetDatabaseMetrics() []graphite.Metric { replacer := strings.NewReplacer("`", "", "?", "", " ", "_", ".", "-", "(", "-", ")", "-", "/", "_", "<", "-", "'", "-", "\"", "-") hostname := replacer.Replace(server.Variables["HOSTNAME"]) var metrics []graphite.Metric - if server.IsSlave { + if server.IsSlave && server.GetCluster().GetTopology() != topoMultiMasterWsrep && server.GetCluster().GetTopology() != topoMultiMasterGrouprep { m := graphite.NewMetric(fmt.Sprintf("mysql.%s.mysql_slave_status_seconds_behind_master", hostname), fmt.Sprintf("%d", server.SlaveStatus.SecondsBehindMaster.Int64), time.Now().Unix()) metrics = append(metrics, m) metrics = append(metrics, graphite.NewMetric(fmt.Sprintf("mysql.%s.mysql_slave_status_exec_master_log_pos", hostname), fmt.Sprintf("%s", server.SlaveStatus.ExecMasterLogPos.String), time.Now().Unix()))