Skip to content

Commit

Permalink
Add support for standard proxy env vars in outputs. (influxdata#3212)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson authored Sep 8, 2017
1 parent d0b690f commit 7b08f9d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/outputs/amon/amon.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func (a *Amon) Connect() error {
return fmt.Errorf("serverkey and amon_instance are required fields for amon output")
}
a.client = &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
},
Timeout: a.Timeout.Duration,
}
return nil
Expand Down
4 changes: 4 additions & 0 deletions plugins/outputs/datadog/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ func (d *Datadog) Connect() error {
if d.Apikey == "" {
return fmt.Errorf("apikey is a required field for datadog output")
}

d.client = &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
},
Timeout: d.Timeout.Duration,
}
return nil
Expand Down
1 change: 1 addition & 0 deletions plugins/outputs/influxdb/client/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func NewHTTP(config HTTPConfig, defaultWP WriteParams) (Client, error) {
}
} else {
transport = http.Transport{
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: config.TLSConfig,
}
}
Expand Down
3 changes: 3 additions & 0 deletions plugins/outputs/librato/librato.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ func (l *Librato) Connect() error {
"api_user and api_token are required fields for librato output")
}
l.client = &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
},
Timeout: l.Timeout.Duration,
}
return nil
Expand Down

0 comments on commit 7b08f9d

Please sign in to comment.