Skip to content
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 a health check #146

Merged
merged 6 commits into from
Jun 1, 2017
Merged

Add a health check #146

merged 6 commits into from
Jun 1, 2017

Conversation

smellsblue
Copy link
Contributor

@smellsblue smellsblue commented May 2, 2017

This fixes #145

The health endpoint is at /health and will check that reading and writing from storage is working.

If you want a health endpoint that doesn't do any work, you can use /health/heartbeat.

The HTTP status code will indicate success vs failure (200 vs 500), and you will receive a JSON response that will indicate the breakdown of what succeeded vs failed.

  • Add health check endpoint
  • Test health check endpoint
  • Include a check that the database connections work ok
  • Document health check endpoint

smellsblue added 4 commits May 3, 2017 16:15
Set the current Gemstash environment in the Gemstash::Env::RackMiddleware, otherwise health checks could fail
Preserve newline fix from commit bc811ec in the pandoc generation
@olleolleolle
Copy link
Member

@smellsblue Is there anything else you want us to have for this to be a healthcheck endpoint?

@smellsblue
Copy link
Contributor Author

@olleolleolle I was hoping to get a review, but then got caught up in other work. If you are happy with what I've done, I can merge it now. I looked at the build failures, and I don't think they are related to my changes.

@olleolleolle
Copy link
Member

@smellsblue I am quite happy with these changes!

The build failures do look unrelated.

LGTM!

♥️ 💛 💚 💙 💜

Copy link
Member

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hooray!

@smellsblue smellsblue merged commit a5a78e2 into master Jun 1, 2017
@smellsblue smellsblue deleted the add-health-check branch June 1, 2017 19:51
@dlackty
Copy link

dlackty commented Jun 13, 2017

@smellsblue We've tried this on production and got this error randomly:
Mysql2::Error: Duplicate entry 'health_check:fake_gem_name' for key 'rubygems_name_index'

Guessed some additional check needs to be performed before inserting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add health check endpoint
3 participants