Conversation
322c7e8 to
cc3c96a
Compare
SuperQ
left a comment
There was a problem hiding this comment.
Interesting idea. This also needs to be added to the Go documentation and probably the flag help string in web/kingpinflag/flag.go.
|
Please add documentation to the |
With this patch, node_exporter can run with `--web.listen-address=vsock: //:9100` to listen on vsock in qemu guest. Then host can get the metrics. Signed-off-by: Jeffrey Zhang <zhang.lei.fly@gmail.com>
|
👍🏽 |
|
Would you please rebase to fix the conflict? |
There was a problem hiding this comment.
LGTM
I'd like some testing for ListenAndServe here
exporter-toolkit/web/tls_config_test.go
Lines 479 to 492 in 48431d7
To make sure it listens both on tcp and vsock if specified.
But I won't block on this if other people don't think this is necessary 👍
| } else { | ||
| listener, err = net.Listen("tcp", address) | ||
| if err != nil { | ||
| return nil |
There was a problem hiding this comment.
Shouldn't this be return err? It silently swallows an error condition.
For your consideration, I rebased this branch as #220 to allow it to be merged (with original authorship of @jeffrey4l). The only conflict is |
septatrix
left a comment
There was a problem hiding this comment.
This behavior can already be archived using the existing systemd socket use case as those are not only able to listen on TCP/IP (AF_INET/AF_INET6) and Unix Domain Sockets (AF_UNIX), but also on Vsock (AF_VSOCK) - among some others.
|
Interesting, so you're saying that this isn't needed? Do we just need to update the documentation? |
Yes, at least for systems using systemd (or a compatible implementation of the listener interface). See
|
@SuperQ Also, another reminder that a rebased version of this PR exists as #220. (I am not trying to claim credit, I'm just interested in having this merged). |
|
Closing in favor of #220 |
metrics can be retrive without nic between host and qemu guest through vsock.
more info check