prometheus-community / prom-label-proxy

A proxy that enforces a given label in a given PromQL query.
Apache License 2.0
249 stars 95 forks source link

[feature request] add support for host header rewrite #135

Open awx-fuyuanchu opened 1 year ago

awx-fuyuanchu commented 1 year ago

Traffic flow:

client  --> proxy.local.example.com[prom-label-proxy] ---> central.example.com[upstream]

We are using an ingress hostname as the upstream of a prom-label-proxy. The ingress relies on the host header to route the traffic.

But currently, the proxy doesn't rewrite the host header. As a result, prom-label-proxy will send requests to the upstream with the host header proxy.local.example.com and it'll always get a 404 error since the ingress couldn't find a proper route for this hostname.

So we are here to request a feature flag that could rewrite the host header while proxy requests.