-
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
HAproxy admin socket filename globbing #1700
HAproxy admin socket filename globbing #1700
Conversation
Looks good but you'll need to write some tests for this, as well as documenting this behavior: see https://github.com/influxdata/telegraf/blob/master/plugins/inputs/haproxy/haproxy_test.go#L174 for how the current socket test looks. |
9dda06a
to
3fcfb97
Compare
Thanks for the suggestions. I took the opportunity to rework the tests a bit and updated docs in sample config to reflect the behavior of the plugin. |
great, thanks, any chance you could write a README for the plugin as well? 😬 🙏 see the general input example here: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/EXAMPLE_README.md |
Sure, I'll whip something up and add it to this lot. |
ff2c448
to
a6147b0
Compare
This behaviour was introduced along with socket support, but never got documented properly.
Map holding expected results was defined in multiple places, making test cases a bit hard to read. This way we can change our expectations of good results in one place and have them affect multiple test cases.
a6147b0
to
733f898
Compare
Rebased to current master branch. Is there anything holding this off? Readme is rather short as the plugin is simple in terms of options and operation. |
When dealing with multiple instances of HAproxy (or just multiple admin sockets) on a single server, it might be useful to just add wildcard match in configuration file, server=["/var/run/haproxy*.sock"] for example.
With proper naming and socket locations telegraf could send out stats without manual intervention. The only thing not tested is if telegraf client needs to be reloaded to pick up (or forget) sockets as they appear/disappear.
Required for all PRs: