What are the pros/cons of doing this in HAProxy natively?
Could you just use something like a health-check on a cluster system like zookeeper/etcd/consul/keepalived/... to simply peek at the lag time, and then mark a replica as unhealthy and regenerate your HAProxy config?
Just curious as I have very little experience with HAProxy. I do everything with consul right now and it works very well (previously I used keepalived + vrrp, or pacemaker/corosync but no multicast "in the cloud.").