You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our use case we have a requirement to know the number of slaves that a master is currently replication to. We have a workaround assuming that the master was previously replication by using the mysql_slave_* metrics, however it would be more reliable to check the output of SHOW SLAVE HOSTS from the master.
Proposed metrics
I've left out server_uuid to keep compatability between old MySQL and new MySQL as I don't know how much more it adds compared to the server_id.
# HELP The master ID that the slave uses to identify the master
# TYPE mysql_slave_hosts_master_id gauge
mysql_slave_hosts_master_id{host="backup_server_1", server_id="380239978"} 1
# HELP The port that the slave is connected to the master on (0 means --report-port is not set)
# TYPE mysql_slave_hosts_master_id gauge
mysql_slave_hosts_port{host="backup_server_1", server_id="380239978"} 0
The text was updated successfully, but these errors were encountered:
# HELP mysql_slave_hosts_info Information from SHOW SLAVE HOSTS
# TYPE mysql_slave_hosts_info gauge
mysql_slave_hosts_info{server_id="380239978",host="backup_server_1",port="0",master_id="",slave_uuid=""} 1
mysql_slave_hosts_info{server_id="192168010",host="iconnect2",port="3306",master_id="192168011",slave_uuid="14cb6624-7f93-11e0-b2c0-c80aa9429562"} 1
Of course, you wouldn't get metrics exactly like above, as you would only get one style from a server. But keeping consistent labels between the two variations of SHOW SLAVE HOSTS would allow for easier comparisons.
I don't see a large value in having the port as an actual metric.
Description
Create some metrics based off of the output of SHOW SLAVE HOSTS.
Example output (very old mysql):
Example output (new mysql):
Motivation
In our use case we have a requirement to know the number of slaves that a master is currently replication to. We have a workaround assuming that the master was previously replication by using the mysql_slave_* metrics, however it would be more reliable to check the output of SHOW SLAVE HOSTS from the master.
Proposed metrics
I've left out server_uuid to keep compatability between old MySQL and new MySQL as I don't know how much more it adds compared to the server_id.
The text was updated successfully, but these errors were encountered: