-
Notifications
You must be signed in to change notification settings - Fork 812
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
Conversation
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.
@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: ".*" |
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.
Shouldn't it be [".*"]
instead?
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.
OOPS
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.
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.
84b83f7
to
3eaed62
Compare
@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)) |
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.
One raise
is enough!
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.
😫
3eaed62
to
90e1671
Compare
should be fixed now... |
[docker] fix config bools, skip image stats option
Fixes #1342.
We should always cast boolean options from the config with
the
_is_affirmative
tool, otherwise you're exposed tooddities like bool('false') == True.
This introduces a new option
collect_images_stats
that isenabled by default and skips the collection of metrics
docker.images.available
anddocker.images.intermediate
thatsometimes is very slow through docker API if you have a lot of
intermediate layer images.