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 feature: Health check via blueprint, default is a ping endpoint #36

Merged
merged 2 commits into from
Nov 14, 2018

Conversation

ppanero
Copy link
Member

@ppanero ppanero commented Nov 9, 2018

PR to solve #35

Two configuration variables are added:

  • APP_HEALTH_BLUEPRINT_ENABLED to allow the user to enable the health checks.
  • APP_HEALTH_BLUEPRINT to provide the import path to the function that creates the blueprint. This would allow more than one route for more than one check (e.g. uwsgi ping, elasticsearch ping, db ping).

By default (if enabled) there is only one route (/ping) that returns a 200.

A test has been provided for the default blueprint. A custom one has been tested, however, adding a test for a custom one would mean adding a views file.

Copy link
Member

@lnielsen lnielsen left a comment

Choose a reason for hiding this comment

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

@slint Is it necessary that the ping view is reachable via HTTP? I know we need it to be right now, but we could simply redirect from HAProxy instead of letting the HTTP query go all the way down to nginx.

invenio_app/ext.py Show resolved Hide resolved
invenio_app/ext.py Outdated Show resolved Hide resolved
@ppanero ppanero changed the title Add feature: Health check via blueprint, default is a ping endpoint WIP: Add feature: Health check via blueprint, default is a ping endpoint Nov 14, 2018
@ppanero ppanero changed the title WIP: Add feature: Health check via blueprint, default is a ping endpoint Add feature: Health check via blueprint, default is a ping endpoint Nov 14, 2018
@ppanero
Copy link
Member Author

ppanero commented Nov 14, 2018

@lnielsen @slint As discussed, there is just a /ping route. By default the config parameter is set to True.

Sorry for the -f's... forgot the config file.

@slint slint merged commit c3173fb into inveniosoftware:master Nov 14, 2018
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.

3 participants