Is it possible to add a fetch to the health condition of the instance?
I would like to make routine checks within my application.
Without having to turn to Prometheus / Grafana.
In my case, the Dgraph Server instance and Zero are behind an API. I do not expose them. I’ve tried using isomorphic-fetch but the result format is not compatible. And as I’m using Rancher, it gets tricky to keep exact internal domainname.
fetch('http://192.168.1.200:8089/health')
.then(function(response) {
if (response.status >= 400) {
throw new Error('Bad response from server');
}
return response.json();
})
.then(function(response) {
console.log(response.json());
});
Actually instances with the Dgraph stack are behind a Reverse Proxy. I did not want to open a public endpoint for it. An internal kind of “ping” from the client would help in this case.
But in the impossibility, no problem. It’s just a case.
Another point is that I’m using Rancher. Often times when upgrade the instances to a more current version or even restart the service or any other task. The IPs change, although Rancher has an internal DNS sometimes inconsistent.
This seems a bit specific use case to be added for general usage. @MichelDiz , I’m sure you can find a way around this, and use the HTTP based health checker.