learninglocker icon indicating copy to clipboard operation
learninglocker copied to clipboard

Add health checks end points for servers

Open jmaupetit opened this issue 6 years ago • 6 comments

Version

v2.6.4

Steps to reproduce the bug

This is more a feature request but... OK then:

  1. Visit the /healthcheck end point, nothing happens :stuck_out_tongue:

Expected behavior

Visiting such endpoint should respond with a 200 HTTP status and a JSON payload describing backing services status (databases, etc.) if the application is healthy and a 5xx HTTP status on error.

Detailed context

We are running Learning Locker in a Kubernetes environment (see Arnold), and we need to implement both readiness and liveness probes so that our containers can accept connections when ready and are restarted when required.

Actual behavior

Nothing happens as it has not been implemented yet.

Ready to contribute?

Sure, I can work on a PR to implement such endpoint if you agree with this :wink:

Last remark: we are following Mozilla's Dockerflow specification on our projects to implement such feature.

jmaupetit avatar Feb 06 '19 16:02 jmaupetit

Hey @jmaupetit, apologies for delayed responses. Where is the /healthcheck defined in the Mozilla Dockerflow Specification?

ryasmi avatar Feb 18 '19 14:02 ryasmi

:wave: They call this endpoint /__heartbeat__ (see point 5).

jmaupetit avatar Feb 19 '19 08:02 jmaupetit

So the endpoint should be /__heartbeat__ instead of /healthcheck?

ryasmi avatar Feb 19 '19 11:02 ryasmi

Yes, but in fact It's up to you: you are free to stick to Mozilla's convention literally or not.

jmaupetit avatar Feb 19 '19 20:02 jmaupetit

Probably best to stick to it literally since it says "The specification has requirements that a container must comply with" and "When the application is ran in the container it must ... Respond to /__heartbeat__ with a HTTP 200 or 5xx on error"

ryasmi avatar Feb 20 '19 09:02 ryasmi

If we're not going to stick to this literally you can just use the /data/xAPI/about endpoint as a health check for the xAPI.

ryasmi avatar Feb 20 '19 09:02 ryasmi