-
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
[marathon] Count running/pending deployments #2788
Conversation
tags = ["url:{0}".format(url)] | ||
) | ||
|
||
return r.json() |
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.
Converted spaces to tabs here for consistency.
@@ -56,6 +56,10 @@ def check(self, instance): | |||
if attr in app: | |||
self.gauge('marathon.' + attr, app[attr], tags=tags) | |||
|
|||
response = self.get_json(urljoin(url, "v2/deployments"), timeout, auth) |
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.
Do you think we can get this behind a config flag? I imagine this will slow down the check a bit, being not a Marathon expert was wondering if this is something any Marathon user would trade for the new metric or not.
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.
I'm cool with tossing this behind a config flag. I'll push up a commit for that momentarily.
@masci I've pushed some commits that address your feedback. |
It'd be really great to get this merged so that we can start monitoring this! I'd like to avoid having to start sending my own metrics via an external script :( |
@bradhe I'll push this up on our queue but at the time you submitted the PR the agent was already in feature freeze for |
Thanks @masci, no problem-o. |
What does this PR do?
Adds a new metric for to Marathon checks to count the number of deployments that are pending.
Motivation
Basically, we'd like to track when that number stays high (e.g. > 1) so that we can alert on stuck deployments.
Testing Guidelines
An overview on testingis available in our contribution guidelines.
Added some tests, there was no real coverage for this guy.
Additional Notes
I added a new helper method for loading a JSON fixture. I'm happy to pull that out, though, as it feels like it's extending this a little much.