There's no easy, or any, way of check if consul is actually up and running
I haven't found it. I'd simply would like to check, using this library, if consul daemon is running, or do something else instead if it's not.
Hi @JJ you could retry, if you get an http error. After some tries you can kill your service and let the environment deal with that state.
That's not easy, and it's not an "official" way of doing it. I was looking for something along the lines of the status subcommand that some services (if not most) have.
The last time I looked consul didn't have a dedicated health endpoint (for the agent).
I consider the scope of this library to be about the same as the Go API client. If that client has method that does what you want I'd look into implementing it.
There's /v1/status/host that has a great deal of data, perhaps too much. Perhaps the same for /v1/agent/self. I wonder how much information /v1/status/leader reveals about the cluster.
You'll know if the agent is up. If your agent isn't part of the cluster, what do you get back from leader?