Skip to content

Commit 7b08f9d

Browse files
authored
Add support for standard proxy env vars in outputs. (#3212)
1 parent d0b690f commit 7b08f9d

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

plugins/outputs/amon/amon.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ func (a *Amon) Connect() error {
4848
return fmt.Errorf("serverkey and amon_instance are required fields for amon output")
4949
}
5050
a.client = &http.Client{
51+
Transport: &http.Transport{
52+
Proxy: http.ProxyFromEnvironment,
53+
},
5154
Timeout: a.Timeout.Duration,
5255
}
5356
return nil

plugins/outputs/datadog/datadog.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ func (d *Datadog) Connect() error {
5555
if d.Apikey == "" {
5656
return fmt.Errorf("apikey is a required field for datadog output")
5757
}
58+
5859
d.client = &http.Client{
60+
Transport: &http.Transport{
61+
Proxy: http.ProxyFromEnvironment,
62+
},
5963
Timeout: d.Timeout.Duration,
6064
}
6165
return nil

plugins/outputs/influxdb/client/http.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func NewHTTP(config HTTPConfig, defaultWP WriteParams) (Client, error) {
5353
}
5454
} else {
5555
transport = http.Transport{
56+
Proxy: http.ProxyFromEnvironment,
5657
TLSClientConfig: config.TLSConfig,
5758
}
5859
}

plugins/outputs/librato/librato.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ func (l *Librato) Connect() error {
8080
"api_user and api_token are required fields for librato output")
8181
}
8282
l.client = &http.Client{
83+
Transport: &http.Transport{
84+
Proxy: http.ProxyFromEnvironment,
85+
},
8386
Timeout: l.Timeout.Duration,
8487
}
8588
return nil

0 commit comments

Comments
 (0)