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

Add options to set headers on upstream http requests #154

Open graemechristie opened 11 months ago

graemechristie commented 11 months ago

This PR adds the command line option extra-http-header, which facilitates setting arbitrary http headers on the upstream prometheus request. This is required to support queries to prometheus compatible endpoints like Grafana Mimir, which expect an "X-Scope-OrgID:" header in the request to specify the tenant to query the data for.

Additionally, I have added a rewrite-host-header-to parameter, which supports rewriting the host to a different value than the source request. This would be needed in the case where the upstream prometheus endpoint is an nginx proxy or simliar using host base proxying. This addresses the issue https://github.com/prometheus-community/prom-label-proxy/issues/135.

graemechristie commented 11 months ago

Does not seem to be alot of activity in this repo. @SuperQ could you have a look at this PR ?

graemechristie commented 11 months ago

@simonpasquier are you able to look this PR ?