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 Plugin for Telegraf and Exclusive Parameters #3327

Closed
ono760 opened this issue Oct 12, 2017 · 0 comments · Fixed by #3331
Closed

Docker Plugin for Telegraf and Exclusive Parameters #3327

ono760 opened this issue Oct 12, 2017 · 0 comments · Fixed by #3331
Assignees
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@ono760
Copy link

ono760 commented Oct 12, 2017

Bug report

Telegraf plugin input docker says config can contain:

Containers to include and exclude. Collect all if empty. Globs accepted.

container_name_include = [] 
container_name_exclude = []

but inspection of this line here and testing shows that these are EXCLUSIVE parameters...

Expected behavior:

We would expect only "included*" containers that do not contain "test" to be published.

Actual behavior:

The following causes all but 'test' containers to be published:

container_name_include = [ "included*" ] 
container_name_exclude = ["*test*"]

Right now, whenever we do the above (specify BOTH include and exclude)
we get

included-something # should be here as expected - matches include ONLY 
somethingelse # should not be here - does not match include or exclude 
anotherthing # should not be here - does not match include or exclude 
include-somethingtest # should not be here - matches BOTH include AND exclude

but we don’t get

test-something-else-too # which matches exclude ONLY

We suspect the logic should be:

if len(d.ContainerInclude)>0 && ! d.ContainerFilter.containerInclude.Match(cname) { 
return nil 
} 
if len(d.ContainerExclude)>0 && d.ContainerFilter.containerExclude.Match(cname) { 
return nil 
}

System info:

Telegraf version: 1.4.1

@ono760 ono760 added the bug unexpected problem or unintended behavior label Oct 12, 2017
@danielnelson danielnelson added this to the 1.4.3 milestone Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants