Skip to content

Commit

Permalink
Fix logging of IP addresseses in resolve code. (#548)
Browse files Browse the repository at this point in the history
Also add logging missing from one code path.

Signed-off-by: Brian Brazil <[email protected]>
  • Loading branch information
brian-brazil authored Nov 7, 2019
1 parent 2e7c8cd commit 9935abb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prober/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func chooseProtocol(ctx context.Context, IPProtocol string, fallbackIPProtocol b
switch IPProtocol {
case "ip4":
if ip.IP.To4() != nil {
level.Info(logger).Log("msg", "Resolved target address", "ip", ip)
level.Info(logger).Log("msg", "Resolved target address", "ip", ip.String())
probeIPProtocolGauge.Set(4)
return &ip, lookupTime, nil
}
Expand All @@ -78,9 +78,8 @@ func chooseProtocol(ctx context.Context, IPProtocol string, fallbackIPProtocol b
fallback = &ip

case "ip6":

if ip.IP.To4() == nil {
level.Info(logger).Log("msg", "Resolved target address", "ip", ip)
level.Info(logger).Log("msg", "Resolved target address", "ip", ip.String())
probeIPProtocolGauge.Set(6)
return &ip, lookupTime, nil
}
Expand All @@ -101,5 +100,6 @@ func chooseProtocol(ctx context.Context, IPProtocol string, fallbackIPProtocol b
} else {
probeIPProtocolGauge.Set(6)
}
level.Info(logger).Log("msg", "Resolved target address", "ip", fallback.String())
return fallback, lookupTime, nil
}

0 comments on commit 9935abb

Please sign in to comment.