Implemented ip_hash in Nginx to ensure consistent upstream selection
for Prometheus in HA scenarios. This helps maintain query consistency
in Grafana and reduces gaps caused by Prometheus instance failovers.
Fixes: https://tracker.ceph.com/issues/70352?
Signed-off-by: Redouane Kachach <rkachach@ibm.com>
{% if prometheus_endpoints %}
upstream prometheus_servers {
+ ip_hash;
{% for ep in prometheus_endpoints %}
server {{ ep }};
{% endfor %}
}
upstream prometheus_servers {
+ ip_hash;
server 192.168.100.100:9095;
server 192.168.100.101:9095;
}
}
upstream prometheus_servers {
+ ip_hash;
server 192.168.100.100:9095;
server 192.168.100.101:9095;
}