-
Notifications
You must be signed in to change notification settings - Fork 814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add service check for gunicorn #1163
Conversation
if working == 0 and idle == 0: | ||
self.service_check(self.SVC_NAME, AgentCheck.CRITICAL, tags=['app:'+ proc_name]) | ||
else: | ||
self.service_check(self.SVC_NAME, AgentCheck.OK, tags=['app:'+ proc_name]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a message with additional context to differentiate theses from the other service check later on? e.g.: "Found # idle and # working workers"? The one below could be something like "Found no master process with name ..."
|
||
msg = "%s working and %s idle workers for %s" % (working, idle, proc_name) | ||
|
||
if working == 0 and idle == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not clean this up a bit?
status = CRIT if working == 0 and idle == 0 else OK
self.service_check(self.SVC_NAME, status, tags=['app:'+ proc_name], message=msg)
it makes the intent clearer. always submit a value, just with a different status and less duplicated code.
Add service check for gunicorn
Alerts critical if no process with given name is found or if no workers are present (idle or running).
OK if workers are running or idle.
Description for UI: https://github.com/DataDog/dogweb/pull/5844