openedx.core.djangoapps.heartbeat package#
Submodules#
openedx.core.djangoapps.heartbeat.default_checks module#
A set of built-in default checks for the platform heartbeat endpoint
Other checks should be included in their respective modules/djangoapps
- openedx.core.djangoapps.heartbeat.default_checks.check_cache_get()#
Check getting a cache value
- Returns:
- A tuple containing the name of the check, whether it succeeded, and a unicode
string of either “OK” or the failure message
- Return type:
(string, Boolean, unicode)
- openedx.core.djangoapps.heartbeat.default_checks.check_cache_set()#
Check setting a cache value
- Returns:
- A tuple containing the name of the check, whether it succeeded, and a unicode
string of either “OK” or the failure message
- Return type:
(string, Boolean, unicode)
- openedx.core.djangoapps.heartbeat.default_checks.check_celery()#
Check running a simple asynchronous celery task
- Returns:
- A tuple containing the name of the check, whether it succeeded, and a unicode
string of either “OK” or the failure message
- Return type:
(string, Boolean, unicode)
- openedx.core.djangoapps.heartbeat.default_checks.check_database()#
Check the database connection by attempting a no-op query
- Returns:
- A tuple containing the name of the check, whether it succeeded, and a unicode
string of either “OK” or the failure message
- Return type:
(string, Boolean, unicode)
- openedx.core.djangoapps.heartbeat.default_checks.check_modulestore()#
Check the modulestore connection
- Returns:
- A tuple containing the name of the check, whether it succeeded, and a unicode
string of either “OK” or the failure message
- Return type:
(string, Boolean, unicode)
openedx.core.djangoapps.heartbeat.runchecks module#
Code for system checks.
- openedx.core.djangoapps.heartbeat.runchecks.runchecks(include_extended=False)#
Iterates through a tuple of systems checks, then returns a dictionary containing the check name as the key, and a dict containing a status boolean and string describing the status, including any failure or error messages
openedx.core.djangoapps.heartbeat.tasks module#
A trivial task for health checks
openedx.core.djangoapps.heartbeat.urls module#
Urls for verifying health (heartbeat) of the app.
openedx.core.djangoapps.heartbeat.views module#
Views for verifying the health (heartbeat) of the app.
- openedx.core.djangoapps.heartbeat.views.heartbeat(request)#
Simple view that a loadbalancer can check to verify that the app is up. Returns a json doc of service id: status or message. If the status for any service is anything other than True, it returns HTTP code 503 (Service Unavailable); otherwise, it returns 200.