})
)
- for _, lv := range []string{"resolve", "connect", "tls", "processing", "transfer"} {
- durationGaugeVec.WithLabelValues(lv)
- }
-
registry.MustRegister(durationGaugeVec)
registry.MustRegister(contentLengthGauge)
registry.MustRegister(bodyUncompressedLengthGauge)
targetPort := targetURL.Port()
ip, lookupTime, err := chooseProtocol(ctx, module.HTTP.IPProtocol, module.HTTP.IPProtocolFallback, targetHost, registry, logger)
+ durationGaugeVec.WithLabelValues("resolve").Add(lookupTime)
if err != nil {
level.Error(logger).Log("msg", "Error resolving address", "err", err)
return false
}
- durationGaugeVec.WithLabelValues("resolve").Add(lookupTime)
httpClientConfig := module.HTTP.HTTPClientConfig
if len(httpClientConfig.TLSConfig.ServerName) == 0 {
}
request = request.WithContext(httptrace.WithClientTrace(request.Context(), trace))
+ for _, lv := range []string{"connect", "tls", "processing", "transfer"} {
+ durationGaugeVec.WithLabelValues(lv)
+ }
+
resp, err := client.Do(request)
// This is different from the usual err != nil you'd expect here because err won't be nil if redirects were
// turned off. See https://github.com/golang/go/issues/3795