File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -128,27 +128,27 @@ func main() {
128
128
// returns nil if not provided and falls back to simple TCP.
129
129
tlsConfig := createTLSConfig (* esCA , * esClientCert , * esClientPrivateKey , * esInsecureSkipVerify )
130
130
131
- httpTransport := & http.Transport {
131
+ var httpTransport http.RoundTripper
132
+
133
+ httpTransport = & http.Transport {
132
134
TLSClientConfig : tlsConfig ,
133
135
Proxy : http .ProxyFromEnvironment ,
134
136
}
135
137
136
- httpClient := & http.Client {
137
- Timeout : * esTimeout ,
138
- Transport : httpTransport ,
139
- }
140
-
141
138
if * esApiKey != "" {
142
139
apiKey := * esApiKey
143
- httpClient = & http.Client {
144
- Timeout : * esTimeout ,
145
- Transport : & transportWithApiKey {
146
- underlyingTransport : httpTransport ,
147
- apiKey : apiKey ,
148
- },
140
+
141
+ httpTransport = & transportWithApiKey {
142
+ underlyingTransport : httpTransport ,
143
+ apiKey : apiKey ,
149
144
}
150
145
}
151
146
147
+ httpClient := & http.Client {
148
+ Timeout : * esTimeout ,
149
+ Transport : httpTransport ,
150
+ }
151
+
152
152
// version metric
153
153
versionMetric := version .NewCollector (Name )
154
154
prometheus .MustRegister (versionMetric )
You can’t perform that action at this time.
0 commit comments