prometheus-community / PushProx

Proxy to allow Prometheus to scrape through NAT etc.
Apache License 2.0
705 stars 132 forks source link

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

Open mcastellini opened 4 years ago

mcastellini commented 4 years ago

In some situations I have encoutered it would be very helpful to advertise a given FQDN while targeting a hostname different from such FQDN.

One situation in which I would find this quite helpful is having to scrape multiple environment through a common PushProx proxy instance. If those environments are basically clones (e.g.: they are created via docker-compose and PushProx client itself is running inside a container) I end up havin to expose via --fqdn the same hostname (i.e.: node-exporter) for many instances which, in turn, leads to clashes at proxy component level.

In this case it would be nice to be able to provide a --target=node-exporter flag at client level that along with a different --fqdn for each environment (e.g.: --fqdn=dev.foo.com, --fqdn=qa1.foo.com, --fqdn=qa2.foo.com) would allow to point to the same proxy.

I put together a PR for this: #80.

mcastellini commented 4 years ago

@SuperQ is this proposal in line with PushProx's scope?