Improvements to health checks
- Adds a warning endpoint for warning-only checks - Changes the default for the disk space check to 1%, instead of 10% - Removes instance services from the overall health check endpoint
This commit is contained in:
parent
6661ee8119
commit
cac5f44d15
3 changed files with 75 additions and 31 deletions
|
@ -3,7 +3,7 @@ import logging
|
|||
|
||||
from auth.permissions import SuperUserPermission
|
||||
from flask import session
|
||||
from health.services import check_all_services
|
||||
from health.services import check_all_services, check_warning_services
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -20,12 +20,20 @@ class HealthCheck(object):
|
|||
self.instance_keys = instance_keys
|
||||
self.instance_skips = instance_skips or []
|
||||
|
||||
def check_warning(self):
|
||||
"""
|
||||
Conducts a check on the warnings, returning a dict representing the HealthCheck
|
||||
output and a number indicating the health check response code.
|
||||
"""
|
||||
service_statuses = check_warning_services(self.app, [])
|
||||
return self.get_instance_health(service_statuses)
|
||||
|
||||
def check_instance(self):
|
||||
"""
|
||||
Conducts a check on this specific instance, returning a dict representing the HealthCheck
|
||||
output and a number indicating the health check response code.
|
||||
"""
|
||||
service_statuses = check_all_services(self.app, self.instance_skips)
|
||||
service_statuses = check_all_services(self.app, self.instance_skips, for_instance=True)
|
||||
return self.get_instance_health(service_statuses)
|
||||
|
||||
def check_endtoend(self):
|
||||
|
@ -33,7 +41,7 @@ class HealthCheck(object):
|
|||
Conducts a check on all services, returning a dict representing the HealthCheck
|
||||
output and a number indicating the health check response code.
|
||||
"""
|
||||
service_statuses = check_all_services(self.app, [])
|
||||
service_statuses = check_all_services(self.app, [], for_instance=False)
|
||||
return self.calculate_overall_health(service_statuses)
|
||||
|
||||
def get_instance_health(self, service_statuses):
|
||||
|
|
Reference in a new issue