Although @rdbury's answer is essentially correct, it is worth pointing out that the association to the verb could be closer than the standard etymology suggests, and that the etymology is (almost always) difficult.
Sternwarte "Observatorium" appears 18th century according to Pfeifer (DWDS: Stern).
Earlier Middle High German had stërne-warter, stërn-warte ammended with glosses sternseher (seebalso feminine -in), sternewarter, i.e. astronomer (Lexer, BMZ).
Old High German precursors are not found (AWB, koeblergerhard), though that's not a reliable verdict.
This implies absent proof to the opposite that the modern noun looks to be a backformation from the agent noun, and the noun was probably understood as agentive to a verb warten—which is begging the question.
It is not warten in the modern sense, so much is clear a-priori, although the waiter waits (viz. server observes) is barely meaningful.
As Pfeifer summarizes, vb. warten and n. die Warte are thought to be probably related to adj. wahr and a noun stem that is attested in Old High German wara, Middle High German war(e) "Wahrnehmung, Beobachtung, Aufmerksamkeit, Obhut" (DWDS: wahren; cf. BMZ s.v. war) corresponding to Old High German warta "das Ausschauen, Posten, Wache, Obacht".
However, Pfeifer is slightly contradictory. Wirt is included in the comparison (DWDS: wahren). On the other hand, the dedicated lemma expresses doubts about the comparison, separating wahr, gewahr from Warte, warten (DWDS: Wirt). This would leave the latter without etymology.
So we probably should consider it uncertain.
That is is not an easy going topic since we have material evidence of stone old observatories, which served cultic functions. The comparative evidence shows that Stern can be derived from a reconstructed root, which is approximately as old. That part, presumably the Bezugswort, is almost more important.
The usual comparison involves Latin stella, Greek astra, Hittite hašter-, Middle Irish ser and more than anyone could count. Pfeifer for one is uncertain about the exact derivation of the apparent suffix "ie. -no-(unter Einfluß entsprechender Bildungsweisen von Mond und Sonne?, s. d.)" (DWDS: stern). Old High German has sterro beside sterno, stern, continued into Middle High German (BMZ: stërn, stërne, stërre). Sonne is believed to be fossilized in the oblique casus (DWDS, en.WT), eg. Sonnenschein "sunshine", cp. Latin rectus sol.
This is to imply that compounds with Stern' should be of some importance to this development.
An exciting option ...