From 7aac7e0ec18f496488f9234147614064199ecb29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Nussbaumer?= Date: Mon, 11 Mar 2024 16:00:33 +0100 Subject: [PATCH] chore: linting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Clément Nussbaumer --- internal/servicecheck/httptrace.go | 7 ++++--- internal/servicecheck/neighbours.go | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/servicecheck/httptrace.go b/internal/servicecheck/httptrace.go index 20d9786b..f47ef82f 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 bbcd8769..e2d57f29 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")