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

influxdb http client (and thus telegraf) does not respect http(s)_proxy env variables #7157

Closed
rhruiz opened this issue Aug 15, 2016 · 1 comment

Comments

@rhruiz
Copy link

rhruiz commented Aug 15, 2016

Bug report

The influx http client v2 (that is used by telegraf as well) 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 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:

  1. configure your influxdb http endpoint in telegraf.conf that is directly accessible by the telegraf machine
  2. set the appropriate proxy environment variable (http_proxy or https_proxy)
  3. check that metrics are not pushed to influxdb

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)

More

The golang http itself provides some helper functions to use those variables: https://golang.org/pkg/net/http/#ProxyFromEnvironment

Moved from influxdata/telegraf#1588

@jsternberg
Copy link
Contributor

Telegraf issues should be created in influxdata/telegraf rather than here.

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

No branches or pull requests

2 participants