Skip to content

Commit

Permalink
don't crash upon failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Tschuy committed Sep 29, 2017
1 parent 587d568 commit 408cf63
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,10 @@ def check_health(endpoint, user, password):
logging.info("starting prometheus metrics server")
start_http_server(8000)
while True:
check_health(os.environ.get('JIRAENDPOINT', 'http://localhost:8080'), os.environ['JIRAUSER'], os.environ['JIRAPASSWORD'])
time.sleep(15)
try:
check_health(os.environ.get('JIRAENDPOINT', 'http://localhost:8080'), os.environ['JIRAUSER'], os.environ['JIRAPASSWORD'])
except Exception as e:
g.labels('healthy').set(0)
g.labels('unhealthy').set(1)
logging.warn(e)
time.sleep(15)

0 comments on commit 408cf63

Please sign in to comment.