Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .chloggen/load-balancer-round-robin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: grpcconfig

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Update default pick_first to round_robin load balancer

# One or more tracking issues or pull requests related to the change
issues: [10319]

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
change_logs: [user]
12 changes: 9 additions & 3 deletions config/configgrpc/configgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ func NewDefaultKeepaliveClientConfig() *KeepaliveClientConfig {
}
}

// NewDefaultBalancernameClientConfig returns a new instance of BalancernameClientConfig with default values.
func NewDefaultBalancernameClientConfig() string {
return "round_robin"
}

// ClientConfig defines common settings for a gRPC client configuration.
type ClientConfig struct {
// The target to which the exporter is going to send traces or metrics,
Expand Down Expand Up @@ -102,9 +107,10 @@ type ClientConfig struct {
// NewDefaultClientConfig returns a new instance of ClientConfig with default values.
func NewDefaultClientConfig() *ClientConfig {
return &ClientConfig{
TLSSetting: configtls.NewDefaultClientConfig(),
Keepalive: NewDefaultKeepaliveClientConfig(),
Auth: configauth.NewDefaultAuthentication(),
TLSSetting: configtls.NewDefaultClientConfig(),
Keepalive: NewDefaultKeepaliveClientConfig(),
Auth: configauth.NewDefaultAuthentication(),
BalancerName: NewDefaultBalancernameClientConfig(),
}
}

Expand Down
9 changes: 5 additions & 4 deletions config/configgrpc/configgrpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ func TestNewDefaultKeepaliveClientConfig(t *testing.T) {

func TestNewDefaultClientConfig(t *testing.T) {
expected := &ClientConfig{
TLSSetting: configtls.NewDefaultClientConfig(),
Keepalive: NewDefaultKeepaliveClientConfig(),
Auth: configauth.NewDefaultAuthentication(),
TLSSetting: configtls.NewDefaultClientConfig(),
Keepalive: NewDefaultKeepaliveClientConfig(),
Auth: configauth.NewDefaultAuthentication(),
BalancerName: NewDefaultBalancernameClientConfig(),
}

result := NewDefaultClientConfig()
Expand Down Expand Up @@ -213,7 +214,7 @@ func TestAllGrpcClientSettings(t *testing.T) {
ReadBufferSize: 1024,
WriteBufferSize: 1024,
WaitForReady: true,
BalancerName: "configgrpc_balancer_test",
BalancerName: "round_robin",
Authority: "pseudo-authority",
Auth: &configauth.Authentication{AuthenticatorID: testAuthID},
},
Expand Down