Skip to content

Commit

Permalink
send service health status including healthy, unhealthy, none and red…
Browse files Browse the repository at this point in the history
…eploy (#1427)

* send service health status including healthy, unhealthy, none and redeploy

* bump the version

* fix a bug

* fix a typo

* fix typo

* don't send none to statsboard

* fix a typo
  • Loading branch information
liyaqin1 authored Jan 26, 2024
1 parent 4f8ab95 commit 3a04f1d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deploy-agent/deployd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
# 2: puppet applied successfully with changes
PUPPET_SUCCESS_EXIT_CODES = [0, 2]

__version__ = '1.2.56'
__version__ = '1.2.57'
11 changes: 10 additions & 1 deletion deploy-agent/deployd/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,20 @@ def get_container_health_info(commit, service, redeploy):
labels = parts[2].split(',')
ret = redeploy_check(labels, service, redeploy)
if ret > 0:
send_statsboard_metric(name='deployd.service_health_status', value=1,
tags={"status": "redeploy", "service": service, "commit": commit})
return "redeploy-" + str(ret)
result.append(f"{name}:{status}")
except:
continue
return ";".join(result) if result else None
returnValue = ";".join(result) if result else None
if returnValue and "unhealthy" in returnValue:
send_statsboard_metric(name='deployd.service_health_status', value=1,
tags={"status": "unhealthy", "service": service, "commit": commit})
elif returnValue and "unhealthy" not in returnValue:
send_statsboard_metric(name='deployd.service_health_status', value=1,
tags={"status": "healthy", "service": service, "commit": commit})
return returnValue
else:
return None
except:
Expand Down

0 comments on commit 3a04f1d

Please sign in to comment.