Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow usage of HTTP_PROXY and HTTPS_PROXY. #216

Merged
merged 1 commit into from
Oct 29, 2021
Merged

Allow usage of HTTP_PROXY and HTTPS_PROXY. #216

merged 1 commit into from
Oct 29, 2021

Conversation

stevesg
Copy link
Contributor

@stevesg stevesg commented Oct 29, 2021

These variables are supported if the default http.Client and http.Transport
are used, but due to custom instances being used, the support is lost. This
commit manually adds it back.

To validate, I tried setting the variables to bogus values to see if the requests would fail:

Before fix, the proxy setting is ignored:

HTTPS_PROXY=http://localhost:9999/ ./cmd/cortextool/cortextool rules print --address=https://www.example.com/ --id=1
INFO[0000] no rule groups currently exist for this user 

After fix, it is not ignored:

HTTPS_PROXY=http://localhost:9999/ ./cmd/cortextool/cortextool rules print --address=https://www.example.com/ --id=1
ERRO[0000] error during request to cortex api            error="Get \"https://www.example.com/api/v1/rules\": proxyconnect tcp: dial tcp 127.0.0.1:9999: connect: connection refused" method=GET url="https://www.example.com/api/v1/rules"
FATA[0000] unable to read rules from cortex, Get "https://www.example.com/api/v1/rules": proxyconnect tcp: dial tcp 127.0.0.1:9999: connect: connection refused 

@stevesg stevesg requested a review from a team as a code owner October 29, 2021 07:52
These variables are supported if the default `http.Client` and `http.Transport`
are used, but due to custom instances being used, the support is lost. This
commit manually adds it back.
@stevesg stevesg merged commit 76c9ead into main Oct 29, 2021
@stevesg stevesg deleted the http-proxy branch October 29, 2021 08:52
simonswine pushed a commit to grafana/mimir that referenced this pull request Jan 12, 2022
These variables are supported if the default `http.Client` and `http.Transport`
are used, but due to custom instances being used, the support is lost. This
commit manually adds it back.
friedrichg pushed a commit to cortexproject/cortex-tools that referenced this pull request Aug 1, 2023
* add service monitors extraEndpointSpec support

Signed-off-by: Dan Constantinescu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants