PushProx icon indicating copy to clipboard operation
PushProx copied to clipboard

Allow client to scrape a custom target while advertising a different FQDN

Open mcastellini opened this issue 5 years ago • 8 comments

Some use cases might require exposing a given FQDN while targeting a different host name.

This is quite visibile when using a containerized version of the PushProx client to scrape an instance inside a docker-compose based deployment: if multiple instances of such deployments are referring to the same PushProx proxy, they will end up POSTing the same FQDN in /poll (e.g.: node-exporter), which in turn leads to naming clashes at proxy component level.

This PR allows to specify a --target option so that one would be able to specify a given FQDN while in practice being able to scrape an internal target without needing to worry of potential naming clashes at proxy level.

mcastellini avatar Jun 03 '20 15:06 mcastellini

LGTM. I had a similar case where FQDNs resolve to a host's external IP address (e.g. 192.0.2.1), but exporters listen only on 127.0.0.1/::1. The solution was to bind-mount a custom /etc/hosts file in my Pushprox service instances.

@SuperQ FYI

hansmi avatar Jan 05 '21 22:01 hansmi

@hansmi @mcastellini any information about possible merge soon?

szaudowsky avatar Jan 18 '21 22:01 szaudowsky

@szaudowsky I rebased the PR against the latest master, though I have no idea if it will be merged soon.

mcastellini avatar Jan 19 '21 10:01 mcastellini

@brian-brazil @SuperQ are there any plans on a new release? Would it be possible to include this feature?

Liczi avatar Jan 19 '21 10:01 Liczi

I am wondering if that should be a feature given that Prometheus itself does not support that. And also I wonder, if the maintainers of this repo want it, if that should be a request parameter instead.

roidelapluie avatar Jan 19 '21 11:01 roidelapluie

Where is the problem that this PR hasn't been merged yet (since several months)? There are a few lines of code which has been modified. We really need this feature of setting the FQDN manually by a parameter as our raspberry pi's have issues with identifying the FQDN correctly. It's really unpredictable what they choose and requires a lot of fiddling. And we have cases where we don't know the domain name. So to make a long story short, it's very important that we can configure the FQDN manually with a parameter.

jozahner avatar Mar 11 '21 19:03 jozahner

More than that, it makes monitoring of docker services harder as they use service name as an FQDN inside the docker network. It basically forces us to use network_mode: host even though the push-proxy could work as a docker container and use internal addressing.

Liczi avatar Mar 11 '21 19:03 Liczi

I have poked @SuperQ about this one. I still think this could be an HTTP parameter instead of a pushprox parameter.

roidelapluie avatar Mar 11 '21 20:03 roidelapluie