When MariaDB IO Thread is in Connecting state then Alerting is not working

When the IO state is in the Yes/No state, the below query is working fine, but when the IO state is in the Connecting state, the below query is not working, and we are not able to receive the alerts.

Query: mysql_slave_status_master_server_id > 0 and ON (instance) mysql_slave_status_slave_io_running == 0

But as per the below screenshot, on the Replication Dashboard, the IO thread status is NO.

And on the DB server, the IO thread status

But when I change the query like below, then it’s working fine.

mysql_slave_status_master_server_id == 0 and ON (instance) mysql_slave_status_slave_io_running == 0

NOTE: Even Replication error number also missing on the dashboard.

I was able to fix the above issue using the below options.

A Query: label_match(( mysql_slave_status_slave_sql_running == 0 or mysql_slave_status_slave_io_running == 0), “environment”, “PROD|GCP-PROD”)

B Expression: $A == 0