This has been as consistent as the sun coming up over the years.
"over the years" is used in the correct place, yes, but a native speaker might think this sentence sounds weird. As a native speaker, I would probably say:
This is as consistent as the sun rising.
Since the sun has been around for millions of years, many English speakers associate qualities of the sun with longer periods of time such as decades or centuries, not merely over the span of a few years. You'd sound a bit more natural if you omitted 'sun' and simply stated:
This has been consistent over the years.
Hope this helps.