Skip to content

Commit

Permalink
Use roundRobin balancing even if only one hostname (jaegertracing#1329)
Browse files Browse the repository at this point in the history
If you run jaeger-agent with `--reporter.grpc.host-port
dns:///jaeger-collector-hostname:14250` (note the `dns:///` part!),
the GRPC client resolves the given hostname to one or more IPs and can
load balance among the backend addresses it finds.  It even looks up
and obeys SRV records, if they exist.  This change makes jaeger-agent
use round-robin load balancing in that situation, rather than the
default of `pick_first`.  If there is only one backend, or the user
doesn't explicitly put `dns:///` before the hostname, this will
have no effect.

Signed-off-by: Benjamin Staffin <[email protected]>
  • Loading branch information
benley authored and iori-yja committed Feb 15, 2019
1 parent 97b09cd commit 3bf7764
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/agent/app/reporter/grpc/collector_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func NewCollectorProxy(o *Options, mFactory metrics.Factory, logger *zap.Logger)
conn, _ = grpc.Dial(r.Scheme()+":///round_robin", grpc.WithInsecure(), grpc.WithBalancerName(roundrobin.Name))
} else {
// It does not return error if the collector is not running
conn, _ = grpc.Dial(o.CollectorHostPort[0], grpc.WithInsecure())
conn, _ = grpc.Dial(o.CollectorHostPort[0], grpc.WithInsecure(), grpc.WithBalancerName(roundrobin.Name))
}
grpcMetrics := mFactory.Namespace(metrics.NSOptions{Name: "", Tags: map[string]string{"protocol": "grpc"}})
return &ProxyBuilder{
Expand Down

0 comments on commit 3bf7764

Please sign in to comment.