diff --git a/config/configgrpc/configgrpc.go b/config/configgrpc/configgrpc.go index 574a9def2ce..ef71e61bc96 100644 --- a/config/configgrpc/configgrpc.go +++ b/config/configgrpc/configgrpc.go @@ -388,7 +388,5 @@ func GetGRPCCompressionKey(compressionType string) string { } func RegisterClientDialOptionHandlers(handlers ...ClientDialOptionHandler) { - for _, handler := range handlers { - clientOptionHandlerList = append(clientOptionHandlerList, handler) - } + clientOptionHandlerList = append(clientOptionHandlerList, handlers...) } diff --git a/config/configgrpc/configgrpc_test.go b/config/configgrpc/configgrpc_test.go index 92c06538568..3a599fb3744 100644 --- a/config/configgrpc/configgrpc_test.go +++ b/config/configgrpc/configgrpc_test.go @@ -553,7 +553,8 @@ func TestRegisterClientDialOptionHandler(t *testing.T) { }) }) gcs := &GRPCClientSettings{} - opts, err := gcs.ToDialOptions() + opts, err := gcs.ToDialOptions(map[config.ComponentID]component.Extension{}) assert.NoError(t, err) - assert.Len(t, opts, 2) + // Also count opentelemetry's observability plugin interceptors + assert.Len(t, opts, 4) }