QubitProducts / exporter_exporter

A reverse proxy designed for Prometheus exporters
Apache License 2.0
332 stars 55 forks source link

Allow override of HTTP header "host" #76

Closed theredcat closed 2 years ago

theredcat commented 2 years ago

As a devops I'd like to use exporter_exporter to get metrics from an application that is available on localhost (127.0.0.1) but only answer with a specific Host header that is not the same as exporter_exporter

This also allow the query of SaaS because every SaaS product expect a specific host header to be set : you have to call aws-azure-gcp.cloud/api/prom/metrics with the right host header not w.x.y.z/api/prom/metrics

Go documentation for header override https://cs.opensource.google/go/go/+/refs/tags/go1.18.1:src/net/http/request.go;l=235

theredcat commented 2 years ago

@tcolgate I finally took the time to finish this. This is ready for review. I've already deployed it to my prom infrastructure :)

tcolgate commented 2 years ago

Thanks for the PR