Close connection to scrape target after retrieving data (#39)
This commit is contained in:
parent
46ec972162
commit
db8ccea9da
@ -1,4 +1,4 @@
|
||||
FROM golang:1.10.0 as builder
|
||||
FROM golang:1.13.11 as builder
|
||||
RUN mkdir -p /go/src/github.com/cloudposse/prometheus-to-cloudwatch
|
||||
WORKDIR /go/src/github.com/cloudposse/prometheus-to-cloudwatch
|
||||
COPY . .
|
||||
|
||||
@ -514,6 +514,7 @@ func fetchMetricFamilies(
|
||||
}
|
||||
client := &http.Client{Transport: transport}
|
||||
decodeContent(client, url, ch)
|
||||
client.CloseIdleConnections()
|
||||
}
|
||||
|
||||
func decodeContent(client *http.Client, url string, ch chan<- *dto.MetricFamily) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user