Zero's /health endpoint returns just "Ok" where the same Alpha's endpoint returns a JSON

Moved from GitHub dgraph/5517

Posted by lukaszlenart:

I’m testing Dgraph 1.2.3 version and notice there is a difference in /health endpoints for Zero and Alpha. It would be good to unify that endpoint to return the same JSON structure.

Zero’s response to curl http://localhost:6080/health

Ok

Alpha’s reponse to curl http://localhost:8080/health:

{"version":"v1.2.3","instance":"alpha","uptime":59131}

MichelDiz commented :

Also, let’s add "leader":"true"

tharun208 commented :

I like to work on this @MichelDiz

MichelDiz commented :

@tharun208 feel free. I think there’s no dev working on it right now.

cc @lgalatin

tharun208 commented :

@MichelDiz , Started with it and found that cyclic dependency is occurring. Can we pull out this healthCheck to a separate package?

MichelDiz commented :

@tharun208 You can do anything, someone will have to review it. Since I don’t manage these codes, I don’t have the competence to determine something there. But if your change doesn’t break anything. It will be welcome.

MichelDiz commented :

Hey @tharun208, would you mind to add a “default” version? like “master”. This would help this issue #5721

tharun208 commented :

Hey @tharun208, would you mind to add a “default” version? like “master”. This would help this issue #5721

@MichelDiz I am able to get the version number while working on this PR. My machine config is also darwin i386. I attached my output in the PR.