Skip to content

DB Load balancing: Log Prometheus current number of hosts and current index

Problem to solve:

We don't know what each application host's idea of number of hosts and it's current index is.

We may want to log a Prometheus metric for the current number of hosts in the load balancer and the current index. I think we can use https://docs.gitlab.com/ee/development/instrumentation.html to achieve this.

Proposal:

  1. Log current number of hosts and current index when #initialize is called
  2. Log current number of hosts and current index when #next is called
  3. Log current number of hosts and current index when #hosts= is called
Edited by Thong Kuah