-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 support for glob patterns in net input plugin #3140
Add support for glob patterns in net input plugin #3140
Conversation
@danielnelson any chance this PR will be merge before 1.5.0? |
I think we can get this in, looking over the code I assume the code causing the performance issue is caused by calling |
Godeps
Outdated
@@ -27,6 +27,7 @@ github.com/go-ole/go-ole be49f7c07711fcb603cff39e1de7c67926dc0ba7 | |||
github.com/google/go-cmp f94e52cad91c65a63acc1e75d4be223ea22e99bc | |||
github.com/gorilla/mux 392c28fe23e1c45ddba891b0320b3b5df220beea | |||
github.com/go-sql-driver/mysql 2e00b5cd70399450106cec6431c2e2ce3cae5034 | |||
github.com/gobwas/glob bea32b9cd2d6f55753d94a28e959b13f0244797a |
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.
We already have this (line 21)
plugins/inputs/system/net.go
Outdated
"github.com/influxdata/telegraf" | ||
"github.com/influxdata/telegraf/plugins/inputs" | ||
) | ||
|
||
type NetIOStats struct { | ||
ps PS | ||
patterns []glob.Glob |
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.
Use filter.Filter here
I think the performance problem can currently be mitigated by explicitly specifying a list of interfaces, it's just that support for glob patterns makes doing so less verbose and more adapting to different environments (e.g. |
@bobmshannon It would be super cool if you could add blacklist, I would love to blacklist all calico interfaces. |
@danielnelson I have addressed the PR comments, but it looks like the build may have flaked. @ljagiello A blacklist sounds like an interesting idea. I'm not sure I can get that in this PR but it may be worth opening a separate issue for. @danielnelson, what do you think about such an option? |
We can add the blacklist, usually we have a pair of options like |
I think the tests are failing because the branch is so far behind master. Failures are in unrelated code though so I don't mind merging. |
An approach for fixing #1073.
Adds support for specifying golang glob-style patterns.
Example
Required for all PRs: