Add metrics for tracking when instance key renewal succeeds and fails, as well as when instance key *lookup* fails
This commit is contained in:
parent
a927ce3e0f
commit
bbdf9e074c
10 changed files with 61 additions and 24 deletions
|
@ -119,7 +119,7 @@ class RedisBuildLogs(object):
|
|||
args.update({'socket_connect_timeout': 1, 'socket_timeout': 1})
|
||||
|
||||
connection = redis.StrictRedis(**args)
|
||||
if not connection.ping() == True:
|
||||
if not connection.ping():
|
||||
return (False, 'Could not ping redis')
|
||||
|
||||
# Ensure we can write and read a key.
|
||||
|
|
|
@ -16,6 +16,7 @@ def check_health(app_config):
|
|||
|
||||
# We will connect to the db, check that it contains some team role kinds
|
||||
try:
|
||||
return (bool(list(TeamRole.select().limit(1))), 'Could not connect to the database')
|
||||
okay = bool(list(TeamRole.select().limit(1)))
|
||||
return (okay, 'Could not connect to the database' if not okay else None)
|
||||
except Exception as ex:
|
||||
return (False, 'Could not connect to the database: %s' % ex.message)
|
||||
|
|
Reference in a new issue