- revert 'connect' phase duration
authorkgersen <kgersen@hotmail.com>
Tue, 16 Mar 2021 12:23:12 +0000 (13:23 +0100)
committerkgersen <kgersen@hotmail.com>
Tue, 16 Mar 2021 12:24:34 +0000 (13:24 +0100)
Signed-off-by: kgersen <kgersen@hotmail.com>
prober/http.go

index c1f3433679b542b4bffd63319050112a2625e61d..95832a6465d8a6e6fe77eed29f9d725d0e901bca 100644 (file)
@@ -549,12 +549,13 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr
                        continue
                }
                if trace.tls {
+                       // dnsDone must be set if gotConn was set.
+                       durationGaugeVec.WithLabelValues("connect").Add(trace.connectDone.Sub(trace.dnsDone).Seconds())
                        durationGaugeVec.WithLabelValues("tls").Add(trace.tlsDone.Sub(trace.tlsStart).Seconds())
+               } else {
+                       durationGaugeVec.WithLabelValues("connect").Add(trace.gotConn.Sub(trace.dnsDone).Seconds())
                }
 
-               // actual connection - we could add a new phase between connectDone and gotConn
-               durationGaugeVec.WithLabelValues("connect").Add(trace.gotConn.Sub(trace.dnsDone).Seconds())
-
                // Continue here if we never got a response from the server.
                if trace.responseStart.IsZero() {
                        continue