Skip to content

Commit

Permalink
use ctx for chooseProtocol
Browse files Browse the repository at this point in the history
Signed-off-by: Thor <[email protected]>
  • Loading branch information
Thor committed Apr 10, 2019
1 parent 80a1218 commit 561b4f3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion prober/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func ProbeDNS(ctx context.Context, target string, module config.Module, registry
port = "53"
targetAddr = target
}
ip, _, err = chooseProtocol(module.DNS.IPProtocol, module.DNS.IPProtocolFallback, targetAddr, registry, logger)
ip, _, err = chooseProtocol(ctx, module.DNS.IPProtocol, module.DNS.IPProtocolFallback, targetAddr, registry, logger)
if err != nil {
level.Error(logger).Log("msg", "Error resolving address", "err", err)
return false
Expand Down
2 changes: 1 addition & 1 deletion prober/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr
targetHost = targetURL.Host
}

ip, lookupTime, err := chooseProtocol(module.HTTP.IPProtocol, module.HTTP.IPProtocolFallback, targetHost, registry, logger)
ip, lookupTime, err := chooseProtocol(ctx, module.HTTP.IPProtocol, module.HTTP.IPProtocolFallback, targetHost, registry, logger)
if err != nil {
level.Error(logger).Log("msg", "Error resolving address", "err", err)
return false
Expand Down
2 changes: 1 addition & 1 deletion prober/icmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func ProbeICMP(ctx context.Context, target string, module config.Module, registr

registry.MustRegister(durationGaugeVec)

ip, lookupTime, err := chooseProtocol(module.ICMP.IPProtocol, module.ICMP.IPProtocolFallback, target, registry, logger)
ip, lookupTime, err := chooseProtocol(ctx, module.ICMP.IPProtocol, module.ICMP.IPProtocolFallback, target, registry, logger)
if err != nil {
level.Warn(logger).Log("msg", "Error resolving address", "err", err)
return false
Expand Down
2 changes: 1 addition & 1 deletion prober/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func dialTCP(ctx context.Context, target string, module config.Module, registry
return nil, err
}

ip, _, err := chooseProtocol(module.TCP.IPProtocol, module.TCP.IPProtocolFallback, targetAddress, registry, logger)
ip, _, err := chooseProtocol(ctx, module.TCP.IPProtocol, module.TCP.IPProtocolFallback, targetAddress, registry, logger)
if err != nil {
level.Error(logger).Log("msg", "Error resolving address", "err", err)
return nil, err
Expand Down

0 comments on commit 561b4f3

Please sign in to comment.