Have the health check also ping the registry endpoint to make sure it is functional.

This commit is contained in:
Joseph Schorr 2015-01-14 23:39:58 -05:00
parent 90b724d3a0
commit a4de476a85
3 changed files with 24 additions and 7 deletions

View file

@ -7,7 +7,7 @@ class HealthCheck(object):
def __init__(self):
pass
def conduct_healthcheck(self, db_healthy, buildlogs_healthy):
def conduct_healthcheck(self, db_healthy, buildlogs_healthy, registry_healthy):
"""
Conducts any custom healthcheck work, returning a dict representing the HealthCheck
output and a boolean indicating whether the instance is healthy.
@ -31,10 +31,11 @@ class LocalHealthCheck(HealthCheck):
def check_name(cls):
return 'LocalHealthCheck'
def conduct_healthcheck(self, db_healthy, buildlogs_healthy):
def conduct_healthcheck(self, db_healthy, buildlogs_healthy, registry_healthy):
data = {
'db_healthy': db_healthy,
'buildlogs_healthy': buildlogs_healthy
'buildlogs_healthy': buildlogs_healthy,
'registry_healthy': registry_healthy
}
return (data, db_healthy and buildlogs_healthy)
@ -49,10 +50,11 @@ class ProductionHealthCheck(HealthCheck):
def check_name(cls):
return 'ProductionHealthCheck'
def conduct_healthcheck(self, db_healthy, buildlogs_healthy):
def conduct_healthcheck(self, db_healthy, buildlogs_healthy, registry_healthy):
data = {
'db_healthy': db_healthy,
'buildlogs_healthy': buildlogs_healthy
'buildlogs_healthy': buildlogs_healthy,
'registry_healthy': registry_healthy
}
# Only report unhealthy if the machine cannot connect to the DB. Redis isn't required for
@ -81,4 +83,4 @@ class ProductionHealthCheck(HealthCheck):
# requests once RDS comes back up.
return (data, not is_rds_working)
return (data, db_healthy)
return (data, db_healthy and registry_healthy)