diff --git a/internal/servicecheck/httptrace.go b/internal/servicecheck/httptrace.go index 20d9786..f47ef82 100644 --- a/internal/servicecheck/httptrace.go +++ b/internal/servicecheck/httptrace.go @@ -78,10 +78,10 @@ func withHttptrace(registry *prometheus.Registry, next http.RoundTripper, durati // Add tracing hooks trace := &httptrace.ClientTrace{ - GotConn: func(info httptrace.GotConnInfo) { + GotConn: func(_ httptrace.GotConnInfo) { collectMetric("got_conn", start, r, nil) }, - DNSStart: func(info httptrace.DNSStartInfo) { + DNSStart: func(_ httptrace.DNSStartInfo) { collectMetric("dns_start", start, r, nil) }, DNSDone: func(info httptrace.DNSDoneInfo) { @@ -96,7 +96,7 @@ func withHttptrace(registry *prometheus.Registry, next http.RoundTripper, durati TLSHandshakeStart: func() { collectMetric("tls_handshake_start", start, r, nil) }, - TLSHandshakeDone: func(_ tls.ConnectionState, err error) { + TLSHandshakeDone: func(_ tls.ConnectionState, _ error) { collectMetric("tls_handshake_done", start, r, nil) }, WroteRequest: func(info httptrace.WroteRequestInfo) { @@ -118,6 +118,7 @@ func withHttptrace(registry *prometheus.Registry, next http.RoundTripper, durati rt := next // variable pinning :) essential, to prevent always re-instrumenting the original variable rt = promhttp.InstrumentRoundTripperCounter(httpclientReqTotal, rt) rt = promhttp.InstrumentRoundTripperDuration(httpclientReqDuration, rt) + return rt.RoundTrip(r) }) } diff --git a/internal/servicecheck/neighbours.go b/internal/servicecheck/neighbours.go index bbcd876..e2d57f2 100644 --- a/internal/servicecheck/neighbours.go +++ b/internal/servicecheck/neighbours.go @@ -85,8 +85,6 @@ func (c *Checker) checkNeighbours(nh []*Neighbour) { } for _, neighbour := range nh { - neighbour := neighbour // pin - check := func(ctx context.Context) (string, error) { if c.UseTLS { return c.doRequest(ctx, "https://"+neighbour.PodIP+":8443/alwayshappy")