late 14c., "an observer of the stars," from astrology + -er (1). It drove out French import astrologein, which, had it survived, probably would have yielded *astrologian, as in Chaucer's "The wise Astrologen." Also in Middle English in reference to cocks as announcers of sunrise.
Narrowed meaning "one who professes to determine the influence of planets on persons and events" is from c. 1600, however during the early Modern English period when astrologer and astronomer began to be differentiated, "the relation between them was at first the converse of the present usage" [OED]. Shakespeare used astronomer where we would write astrologer.