-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Feature/read metrics from unix socket npipe #14558
Feature/read metrics from unix socket npipe #14558
Conversation
jenkins test this please. |
Had a good chat with @ycombinator yesterday and after going through the hell together we agreed the easiest solution is to actually used a combined scheme, in that case unix+http:// to correctly differentiate the "protocol" (http) from the "transport" (unix). To do this we will add new fields in the HostData that will encapsulate the kind of transport and the transport part (the unix domain socket)) and the NewHTTP function will take it into consideration to correctly generate the appropriate dialer. |
Thanks @ph. This is definitely looking nicer! After looking at the WDYT? |
I think the method vs interface a bit equivalent in such a small set of code. But if desired I can make the change. |
I'm not married to having the interface. The main point was more about having structs for different transport types and each of them implementing their own |
Okay, I've made the change, I just need to fix a cyclic import and things should be fine. |
@ycombinator ready for review, had to recheck everything on windows to make sure I didn't broke anything with files with custom build tags. |
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.
Left one nitpick comment. Overall LGTM!
Allow monitoring information from libbeat to be retrieved over unix domain socket and named pipes. (cherry picked from commit baf8c1d)
Easiest way to test this is to have metricbeat's beat module configuration with the following: - module: beat
metricsets:
- stats
- state
period: 10s
hosts: ["http+npipe://./pipe/custom"] And have a beat with monitoring enabled to publish it to the same named pipe: http.enabled: true
http.host: npipe:///custom |
After creating the above. I saw that the syntax are indeed a bit different and I've created #15832 |
Added more logic inside the metricbeat url parser to differentiate the "http+unix" and the "http+npipe" case. This should not have any impact on any current module and allow to "add" the behavior to the
helper.NewHTTP
without introducing any breaking changes.