Open petewall opened 12 months ago
OpenCost also uses Golang's http.ProxyFromEnvironment
:
// ProxyFromEnvironment returns the URL of the proxy to use for a
// given request, as indicated by the environment variables
// HTTP_PROXY, HTTPS_PROXY and NO_PROXY (or the lowercase versions
// thereof). Requests use the proxy from the environment variable
// matching their scheme, unless excluded by NO_PROXY.
//
// The environment values may be either a complete URL or a
// "host[:port]", in which case the "http" scheme is assumed.
// The schemes "http", "https", and "socks5" are supported.
// An error is returned if the value is a different form.
//
// A nil URL and nil error are returned if no proxy is defined in the
// environment, or a proxy should not be used for the given request,
// as defined by NO_PROXY.
//
// As a special case, if req.URL.Host is "localhost" (with or without
// a port number), then a nil URL and nil error will be returned.
func ProxyFromEnvironment(req *Request) (*url.URL, error) {
return envProxyFunc()(req.URL)
}
The nice thing w.r.t. OpenCost, is that it shouldn't interfere with Grafana Agent connections.
Original slack thread
Tempo
Proxy configuration appears to be done via the *nix environment variables (such as
HTTPS_PROXY
), according to the docs: https://grafana.com/docs/agent/latest/flow/reference/components/otelcol.exporter.otlp/To maintain compatibility with k8s service discovery,
NO_PROXY
should be used to exclude the API server, e.g.: