From 54ea96b933584109876f93cbb687ec5551620c99 Mon Sep 17 00:00:00 2001 From: Ulrike Klusik <40604083+ulikl@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:37:37 +0200 Subject: [PATCH] Fixed condition, when local dns lookup should happen. Bug was introduced with option proy_from_enviroment with release V0.24. Signed-off-by: Ulrike Klusik <40604083+ulikl@users.noreply.github.com> --- prober/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prober/http.go b/prober/http.go index d79e8e1c..5ec1d2d1 100644 --- a/prober/http.go +++ b/prober/http.go @@ -328,7 +328,7 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr targetPort := targetURL.Port() var ip *net.IPAddr - if !module.HTTP.SkipResolvePhaseWithProxy || module.HTTP.HTTPClientConfig.ProxyConfig.ProxyURL.URL == nil || module.HTTP.HTTPClientConfig.ProxyConfig.ProxyFromEnvironment { + if !module.HTTP.SkipResolvePhaseWithProxy || (module.HTTP.HTTPClientConfig.ProxyConfig.ProxyURL.URL == nil && !module.HTTP.HTTPClientConfig.ProxyConfig.ProxyFromEnvironment) { var lookupTime float64 ip, lookupTime, err = chooseProtocol(ctx, module.HTTP.IPProtocol, module.HTTP.IPProtocolFallback, targetHost, registry, logger) durationGaugeVec.WithLabelValues("resolve").Add(lookupTime)