Closed thomasf closed 5 years ago
I made a very small POC from this using https://github.com/armon/go-socks5 with a minor modification + https://github.com/valyala/fasthttp/blob/master/fasthttputil/inmemory_listener.go to bind the socks Dial to the http servers ServeTLS function. I did not add support for port ranges but other than that the config I used above works exactly like that.
I pushed my test code here: https://github.com/thomasf/exporter_exporter/commit/fcc25b9de59b5a5b143fc22395238f6dbeaf4505
It's not like it's close to anything resembling a proper solution but it is working.
And you have to compile prometheus with go 1.9 to be able to use a socks5 proxy for http.
Sorry for the silence, this will take a bit of reviewing, but sounds like a good move.
the prometheus 1.8.0 binary release is compiled w. go 1.9.1 thus supporting socks5 proxy..
I will revisit this soon, I might copy the relevant parts from the go-socks5 lib into this project instead of using it as a library, not sure yet but it looks like that might be for the best..
It could maybe be a good idea to split exporter_exporter into a few packages instead of only having one main.. idk.
I think this is doable when prometheus is compiled with go 1.9 and gets socks5 proxy support for it's
proxy_url
argument.something like this could work where node:1 is resolved by the socks proxy to match a module named node in exporter_exporter as the first entry in the node exporter section.
It get's interesting when we suddenly have a process cluster running on a node which exporterexporter needs to pick up.
One could imagine something like this:
which would map to scrapable myqpp-targets 1-16
As exporterexporter works right now I need one job for each
myapp
process in that host local application cluster which is the main problem I want to solve.