# Fetch health condition (enhancement)

**URL:** <https://discuss.dgraph.io/t/fetch-health-condition-enhancement/8149>\
**Category:** Dgraph Clients\
**Tags:** kind:question, kind:enhancement, dgraph-js\
**Created:** [March 13, 2018, 4:55pm UTC](https://discuss.dgraph.io/t/fetch-health-condition-enhancement/8149 "2018-03-13T16:55:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [March 13, 2018, 4:55pm UTC](https://discuss.dgraph.io/t/fetch-health-condition-enhancement/8149/1 "2018-03-13T16:55:21Z")

</div>

**Moved from GitHub [dgraph-js/27](https://github.com/dgraph-io/dgraph-js/issues/27)**

_Posted by_ [MichelDiz](https://github.com/MichelDiz):

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.

```auto
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());
  });

```

It would be possible?

Thanks.

Cheers.

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [March 16, 2018, 4:11am UTC](https://discuss.dgraph.io/t/fetch-health-condition-enhancement/8149/2 "2018-03-16T04:11:13Z")

</div>

[manishrjain](https://github.com/manishrjain) _commented_ :

If an external Dgraph client can talk to these servers, then you could potentially use some HTTP client to query for health.

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [March 16, 2018, 2:42pm UTC](https://discuss.dgraph.io/t/fetch-health-condition-enhancement/8149/3 "2018-03-16T14:42:13Z")

</div>

[MichelDiz](https://github.com/MichelDiz) _commented_ :

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.

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [March 16, 2018, 3:47pm UTC](https://discuss.dgraph.io/t/fetch-health-condition-enhancement/8149/4 "2018-03-16T15:47:10Z")

</div>

[gpahal](https://github.com/gpahal) _commented_ :

But the client also requires you to open a public grpc port. Is the client also behind the proxy?

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [March 16, 2018, 5:04pm UTC](https://discuss.dgraph.io/t/fetch-health-condition-enhancement/8149/5 "2018-03-16T17:04:25Z")

</div>

[MichelDiz](https://github.com/MichelDiz) _commented_ :

I’m not using gRPC in my own user client. I’m query through a Graphql gateway. So That way I can take advantage of an Apollo (apollographql).

PS. We can see /health through grpc??

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [March 16, 2018, 5:12pm UTC](https://discuss.dgraph.io/t/fetch-health-condition-enhancement/8149/6 "2018-03-16T17:12:51Z")

</div>

[MichelDiz](https://github.com/MichelDiz) _commented_ :

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.

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [March 16, 2018, 5:16pm UTC](https://discuss.dgraph.io/t/fetch-health-condition-enhancement/8149/7 "2018-03-16T17:16:33Z")

</div>

[manishrjain](https://github.com/manishrjain) _commented_ :

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.

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [March 16, 2018, 5:42pm UTC](https://discuss.dgraph.io/t/fetch-health-condition-enhancement/8149/8 "2018-03-16T17:42:35Z")

</div>

[MichelDiz](https://github.com/MichelDiz) _commented_ :

I’ll try this [dgraph/connection.js at 0cbe6030569452f29dbaab6e37a2311b4800b71c · dgraph-io/dgraph · GitHub](https://github.com/dgraph-io/dgraph/blob/0cbe6030569452f29dbaab6e37a2311b4800b71c/dashboard/src/actions/connection.js#L16) But I will have to deal with the internal domain thing.

---

<div class="post-metadata">

**Author:** ![diggy](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/diggy/32/3666_2.png) [@diggy](https://discuss.dgraph.io/u/diggy)\
**Post date:** [July 11, 2020, 4:14am UTC](https://discuss.dgraph.io/t/fetch-health-condition-enhancement/8149/9 "2020-07-11T04:14:43Z")

</div>

Closed on July 11, 2020, 4:14am UTC


