Manchester City defender Vincent Kompany has been ruled out for up to four weeks due to a thigh injury.