Skip to content
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

[docker] fix config bools, skip image stats option #1345

Merged
merged 2 commits into from
Feb 5, 2015

Conversation

LeoCavaille
Copy link
Member

Fixes #1342.
We should always cast boolean options from the config with
the _is_affirmative tool, otherwise you're exposed to
oddities like bool('false') == True.
This introduces a new option collect_images_stats that is
enabled by default and skips the collection of metrics
docker.images.available and docker.images.intermediate that
sometimes is very slow through docker API if you have a lot of
intermediate layer images.

Fixes #1342.
We should always cast boolean options from the config with
the `_is_affirmative` tool, otherwise you're exposed to
oddities like bool('false') == True.
This introduces a new option `collect_images_stats` that is
enabled by default and skips the collection of metrics
`docker.images.available` and `docker.images.intermediate` that
sometimes is very slow through docker API if you have a lot of
intermediate layer images.
@LeoCavaille
Copy link
Member Author

@remh classifying it as a bugfix still, because of the potential bad boolean flag parsing, so this could still make it for 5.2.

@@ -43,11 +43,12 @@ instances:
# - ".*"
#
# include all, except ubuntu and debian.
# include: []
# include: ".*"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be [".*"] instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OOPS

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even worse!
This is wrong, in this case you will include everything.

How it works: if a tag matches an exclude rule, it won't be included unless it also matches an include rule.

@LeoCavaille
Copy link
Member Author

@LotharSee thanks for the review, it was a careless mistake confusing different things, should be gtg now

@@ -39,6 +59,7 @@ def load_check(name, config, agentConfig):
try:
return check_class(name, init_config=init_config, agentConfig=agentConfig, instances=instances)
except Exception as e:
raise
raise Exception("Check is using old API, {0}".format(e))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One raise is enough!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😫

@LeoCavaille
Copy link
Member Author

should be fixed now...

@LeoCavaille LeoCavaille added this to the 5.2.0 milestone Feb 5, 2015
LeoCavaille added a commit that referenced this pull request Feb 5, 2015
[docker] fix config bools, skip image stats option
@LeoCavaille LeoCavaille merged commit 7a4294f into master Feb 5, 2015
@LeoCavaille LeoCavaille deleted the leo/dockercount branch February 5, 2015 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

High CPU Load and intermediate image count failure
2 participants