-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
telegraf does not respect http(s)_proxy env variables #1588
Comments
can you provide a link to documentation of the environment variable? is it an issue that should be opened on the influxdb repo? |
The golang http itself provides some helper functions to use those variables: https://golang.org/pkg/net/http/#ProxyFromEnvironment And I open this in the influxdb if it makes more sense Thanks |
I have created a related issue on the influx repo. Closing this one. Thanks. |
Reopening as the comment on influxdata/influxdb#7157 says: "Telegraf issues should be created in influxdata/telegraf rather than here." |
i need this to! is there a workaround? |
Any update/workaround on this? |
Anywork around for this ? I am stuck here too |
I am facing the same issue. Most corporate environments do not allow unfettered access to the internet from any server. They are tightly controlled so egress out is through a single source i.e. a web proxy. From the doc's DefaultTransport is the default implementation of Transport and is used by DefaultClient. It establishes network connections as needed and caches them for reuse by subsequent calls. It uses HTTP proxies as directed by the $HTTP_PROXY and $NO_PROXY (or $http_proxy and $no_proxy) environment variables. https://golang.org/pkg/net/http/#ProxyFromEnvironment The datadog output uses the following from your code
I think should be something similar to the below.
I think at this point as you overide the default client you need to set the transport to be proxy and provide the proxy url which should be picked up from the environment variables one of HTTP_PROXY, HTTPS_PROXY,http_proxy or https_proxy. Does this make sense ? I am not a coder so I suggest somone look over what I am saying |
Ok My mistake I think it is using the proxy. setting the following |
Doesn't work for me, InfluxDB output does not respect environment proxy settings. declare -x http_proxy="http://172.21.8.35:3128" telegraf /etc/telegraf/telegraf.conf --debug Post http://xxx:8086/query?db=&q=CREATE+DATABASE+%22cem%22: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) |
I have tried with both the http_proxy and https_proxy as mentioned by @Integrative . But it does not work.
|
Any update/workaround on this? |
Any chance this gets into a 1.4.x release? This bug/missing feature renders the |
Bug report
The influx http client (v2) that telegraf uses does not uses the defined http_proxy, https_proxy, no_proxy environment variables and always tries to connect directly to the endpoint configured in telegraf.conf
Relevant telegraf.conf:
None
System info:
Telegraf - Version 0.10.4.1
Linux valar0003 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29) x86_64 GNU/Linux
Debian 8.3
Steps to reproduce:
Expected behavior:
Connections to influxdb are proxyed
Actual behavior:
Connections are either refused or blocked pending on your firewall configuration and the following is logged:
016/08/05 14:55:54 Database creation failed: Get http://influxdb.****************/query?db=&q=CREATE+DATABASE+IF+NOT+EXISTS+%22*********%22: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
2016/08/05 14:55:54 Starting Telegraf (version 1.0.0-beta1)
The text was updated successfully, but these errors were encountered: