prometheus-community / prom-label-proxy

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

How to use in a corporate environment with a security proxy? #183

Open amrap030 opened 5 months ago

amrap030 commented 5 months ago

Hello,

I would like to use this in a corporate environment, but for some reason, the container proxies the request to our internal security proxy and doesn't address the thanos query endpoint directly. I don't know why it is using the security proxy, because I actually specified the upstream as http://thanos-query.thanos.svc.cluster.local:9090.

I also tried to set the environment variables no_proxy, NO_PROXY, http_proxy, HTTP_PROXY, https_proxy and HTTPS_PROXY with no success.

Do you have any idea how to fix this?

simonpasquier commented 2 weeks ago

Hmm, I'm quite surprised that prom-label-proxy didn't honor the proxy env variables because it doesn't specify any Transport meaning that it uses [http.DefaultTransport](https://pkg.go.dev/net/http@go1.22.4#DefaultTransport:

It uses HTTP proxies as directed by the environment variables HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions thereof).