-
Notifications
You must be signed in to change notification settings - Fork 88
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 Setting Proxy without Using HTTP_PROXY, etc. #180
Conversation
* The dogapi now allows setting env variables such as DOGAPI_HTTP_PROXY instead of only allow HTTP_PROXY and the like
This reverts commit 1a75c67.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
I assume this has been automatically closed due to inactivity? If not, an explanation would be nice as my team would love to see this or something similar get merged in so we don't have to continue maintaining a fork to use this gem. |
Indeed, apologies for that. We've now updated the closing issue/PR settings with a much longer timeframe so that it does not happen in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left notes (thanks for adding tests by the way), let me know if I've understood your use case, thanks!
I've gone ahead and made your suggested changes. The variables are now of the form I think you got the gist of the use case; the idea was just to have some way of setting the proxies without having to set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to keep the HTTP(S)_PROXY
name and only add a DD_
prefix.
@@ -211,6 +210,12 @@ def Dogapi.find_localhost | |||
@@hostname = Addrinfo.getaddrinfo(Socket.gethostname, nil, nil, nil, nil, Socket::AI_CANONNAME).first.canonname | |||
end | |||
|
|||
def Dogapi.find_proxy | |||
ENV['DD_PROXY_HTTPS'] || ENV['dd_proxy_https'] || | |||
ENV['DD_PROXY_HTTP'] || ENV['dd_proxy_http'] || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ENV['DD_PROXY_HTTP'] || ENV['dd_proxy_http'] || | |
ENV['DD_PROXY_HTTP'] || ENV['dd_proxy_http'] || |
def Dogapi.find_proxy | ||
ENV['DD_PROXY_HTTPS'] || ENV['dd_proxy_https'] || | ||
ENV['DD_PROXY_HTTP'] || ENV['dd_proxy_http'] || | ||
ENV['HTTPS_PROXY'] || ENV['https_proxy'] || ENV['HTTP_PROXY'] || ENV['http_proxy'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ENV['HTTPS_PROXY'] || ENV['https_proxy'] || ENV['HTTP_PROXY'] || ENV['http_proxy'] | |
ENV['HTTPS_PROXY'] || ENV['https_proxy'] || ENV['HTTP_PROXY'] || ENV['http_proxy'] |
Right now, the only way to use a proxy to send stuff up to Datadog is to set the
http_proxy
environment variable. For my use case, I'd rather not run my application using this library with that variable set, so this PR allows setting a different environment variable,dd_proxy_http
for configuring a proxy specifically for hitting the Datadog api.