@@ -17,7 +17,7 @@ import (
17
17
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
18
18
"go.opentelemetry.io/otel"
19
19
"google.golang.org/grpc"
20
- "google.golang.org/grpc/balancer/roundrobin "
20
+ "google.golang.org/grpc/balancer"
21
21
"google.golang.org/grpc/credentials"
22
22
"google.golang.org/grpc/credentials/insecure"
23
23
"google.golang.org/grpc/encoding/gzip"
@@ -38,9 +38,6 @@ import (
38
38
39
39
var errMetadataNotFound = errors .New ("no request metadata found" )
40
40
41
- // Allowed balancer names to be set in grpclb_policy to discover the servers.
42
- var allowedBalancerNames = []string {roundrobin .Name , grpc .PickFirstBalancerName }
43
-
44
41
// KeepaliveClientConfig exposes the keepalive.ClientParameters to be used by the exporter.
45
42
// Refer to the original data-structure for the meaning of each parameter:
46
43
// https://godoc.org/google.golang.org/grpc/keepalive#ClientParameters
@@ -269,12 +266,7 @@ func (gcs *GRPCClientSettings) toDialOptions(host component.Host, settings compo
269
266
}
270
267
271
268
func validateBalancerName (balancerName string ) bool {
272
- for _ , item := range allowedBalancerNames {
273
- if item == balancerName {
274
- return true
275
- }
276
- }
277
- return false
269
+ return balancer .Get (balancerName ) != nil
278
270
}
279
271
280
272
// ToListener returns the net.Listener constructed from the settings.
0 commit comments