diff --git a/metrics.go b/metrics.go
index <HASH>..<HASH> 100644
--- a/metrics.go
+++ b/metrics.go
@@ -144,7 +144,7 @@ func (m *metrics) registerInstance() {
 		m.err(err)
 		return
 	}
-	resp.Body.Close()
+	defer resp.Body.Close()
 
 	if resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusMultipleChoices {
 		m.warn(fmt.Errorf("%s return %d", u.String(), resp.StatusCode))
@@ -173,7 +173,7 @@ func (m *metrics) sendMetrics() {
 		m.err(err)
 		return
 	}
-	resp.Body.Close()
+	defer resp.Body.Close()
 
 	if resp.StatusCode == http.StatusNotFound {
 		m.warn(fmt.Errorf("%s return 404, stopping metrics", u.String()))
metrics: defer closing http response bodies

In order to avoid potential surprises if the response bodies are read, defer the closing of the body.