New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add `/-/healthy` and `/-/ready` endpoints #2831

Closed
discordianfish opened this Issue Jun 10, 2017 · 10 comments

Comments

Projects
None yet
9 participants
@discordianfish
Copy link
Member

discordianfish commented Jun 10, 2017

Prometheus should provide an health endpoint which returns 200 if prometheus is ready to response to queries (recovery is done etc).

The officially recommendation on high availability is to run two instances behind a load balance. In such scenario we need a health endpoint to avoid hitting a prometheus server that got restarted and isn't ready to serve traffic.

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Jun 12, 2017

From the discussion in prometheus/pushgateway#105 , I'd say what you want here is a /-/ready endpoint. The other suggested endpoint is /-/healthy, which returns 200 for as long as Prometheus doesn't want to get restarted.

In other words:

Prometheus should bind to /-/healthy immediately after startup and keep responding 200 for as long as it doesn't wish to get killed.

Prometheus should start responding 200 to /-/ready once it is ready to accept queries.

@beorn7 beorn7 changed the title Add /-/health endpoint Add `/-/healthy` and `/-/ready` endpoints Jun 12, 2017

@discordianfish

This comment has been minimized.

Copy link
Member

discordianfish commented Jun 12, 2017

Ah nice, yes that totally makes sense 👍

@yonkeltron

This comment has been minimized.

Copy link

yonkeltron commented Jul 5, 2017

Just wanted to throw in my two cents for this one as it would be awesome to have this for Kubernetes to use as well.

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Jul 23, 2017

@gouthamve I just saw you pinged me on IRC about this. I think all my thoughts around this have already been dumped into my last comment above. Please let me know what you are missing, and I'll try to go into more details where needed.

@emluque

This comment has been minimized.

Copy link
Contributor

emluque commented Jul 26, 2017

Hi, I have been working on this on my local. I have arrived at a simple working solution. I think I could send a PR before end of week. If nobody else is working on this I would like to claim the issue.

@gouthamve

This comment has been minimized.

Copy link
Member

gouthamve commented Jul 26, 2017

Sure @emluque, looking forward to the PR! Incase you get stuck somewhere, feel free to hit us up on IRC or comment here.

EDIT: Hmm, I am not able to assign you to this issue, sorry. Just comment below if you stop working on this.

@gouthamve gouthamve assigned gouthamve and unassigned gouthamve Jul 26, 2017

grobie added a commit that referenced this issue Aug 7, 2017

Merge pull request #2997 from emluque/2831-Healthy_Ready_Endpoints
Add `/-/healthy` and `/-/ready` endpoints #2831
@SimenB

This comment has been minimized.

Copy link

SimenB commented Aug 15, 2017

#2997 is merged, should this be closed?

@grobie

This comment has been minimized.

Copy link
Member

grobie commented Aug 15, 2017

Resolved with #2997.

@grobie grobie closed this Aug 15, 2017

@julianvmodesto

This comment has been minimized.

Copy link

julianvmodesto commented Oct 5, 2017

Is it possible to backport this to 1.7.x? Related to coreos/prometheus-operator#658

@beorn7

This comment has been minimized.

Copy link
Member

beorn7 commented Oct 5, 2017

This is part of the 1.x line of Prometheus. It will in fact be released tomorrow (if nothing goes wrong). It will be 1.8.0, however, as this is a new feature and not a bug fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment