http client config: Allow overwriting Host Header#13157
http client config: Allow overwriting Host Header#13157jkroepke wants to merge 1 commit intoprometheus:mainfrom
Conversation
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>
ca746c3 to
0377b56
Compare
Ah. I see. I'm coming from https://github.com/grafana/agent which is using the prometheus libaries without the config validations. I did not tried proxy_url. I expect with proxy, the HTTP CONNECT will be used to etablish an https connection over an proxy with is not supported by prometheus. In my case, there is no proxy between client and server. @machine424 What did you think about removing the host header from the |
|
I don't fully understand what you're trying to achieve by setting Regarding |
Yes: With Prometheus, I have to write metrics to a endpoint, for example This issue, I have to do this in enterprise-grade environments. In such environments DNS can also have some issues which are impossible so fix or solve. I have to provide a DNS agonistic solution here is barely base on IP addresses. As workaround, I would like to configure Prometheus to call the IP directly, for example: An other solution would be |
|
I will look at this, but better, look at generic HTTP headers config. |
|
Thanks @roidelapluie, looking forward. |
|
The config does say but honestly I don't know what those headers are that Prometheus sets itself. At least in the and |
Various headers are set by RoundTrip functions that defined on the http client. prometheus/storage/remote/client.go Lines 182 to 187 in aaf5d64 prometheus/storage/remote/azuread/azuread.go Lines 182 to 192 in aaf5d64 Other less specific RoundTrip are defined in prometheus/common After looking a bit deeper in the code, I feel it make more sense to add a dedicated |
|
Superseded by prometheus/common#549 |
This PR allow to overwrite the HTTP Host header via
headers