Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 5 additions & 3 deletions collector/exporter/otelarrowexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ import (
"go.opentelemetry.io/collector/config/configgrpc"
"go.opentelemetry.io/collector/config/configopaque"
"go.opentelemetry.io/collector/config/configtls"
"go.opentelemetry.io/collector/confmap"
"go.opentelemetry.io/collector/confmap/confmaptest"
"go.opentelemetry.io/collector/exporter/exporterhelper"
)

func TestUnmarshalDefaultConfig(t *testing.T) {
cm, err := confmaptest.LoadConf(filepath.Join("testdata", "default.yaml"))
require.NoError(t, err)
factory := NewFactory()
cfg := factory.CreateDefaultConfig()
assert.NoError(t, component.UnmarshalConfig(confmap.New(), cfg))
assert.NoError(t, component.UnmarshalConfig(cm, cfg))
assert.Equal(t, factory.CreateDefaultConfig(), cfg)
assert.Equal(t, "round_robin", cfg.(*Config).GRPCClientSettings.BalancerName)
}

func TestUnmarshalConfig(t *testing.T) {
Expand Down Expand Up @@ -75,7 +77,7 @@ func TestUnmarshalConfig(t *testing.T) {
Timeout: 30 * time.Second,
},
WriteBufferSize: 512 * 1024,
BalancerName: "round_robin",
BalancerName: "experimental",
Auth: &configauth.Authentication{AuthenticatorID: component.NewID("nop")},
},
Arrow: ArrowSettings{
Expand Down
5 changes: 5 additions & 0 deletions collector/exporter/otelarrowexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ func createDefaultConfig() component.Config {
Compression: configcompression.Zstd,
// We almost read 0 bytes, so no need to tune ReadBufferSize.
WriteBufferSize: 512 * 1024,
// The `configgrpc` default is pick_first,
// which is not great for OTel Arrow exporters
// because it concentrates load at a single
// destination.
BalancerName: "round_robin",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual change. When the empty string is passed for BalancerName, gRPC ends up deciding pick_first in current collector builds, which ends up creating a bunch of streams to the same destination. I'll look into whether there are any popular client-side load balancers we should consider.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
Arrow: ArrowSettings{
NumStreams: runtime.NumCPU(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ keepalive:
time: 20s
timeout: 30s
permit_without_stream: true
balancer_name: "round_robin"
balancer_name: "experimental"
arrow:
num_streams: 2
disabled: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# when nothing is set