However, our upcoming election is this year. It certainly does not surprise me that Trudeau is stepping down from leader of the Liberal party in light of the polling, since the polls are predicting that if an election were called today, the conservatives would win in such a landslide that I don't think many countries have even seen that before. Of course polling and actual election results are two very different things... but I think the Liberal party sees the writing on the wall. If they hope to have any shot of getting re-elected, they can't do it with Trudeau at the head.
... but that doesn't necessarily mean that we all saw him resigning as PM incumbent coming. He's also proroguing parliament until March. This is probably a move to get the other parties to step back and "STFU"; to not pass any motions during the party shift (particularly related to calling an early election etc).
Lastly, as others have said, the PM position is usually held for an average of 9-10 years (and that's multiple terms .. most incumbents just get re-elected into second and third terms). Trudeau was elected in 2015 so he's about due to exit anyway if we go by averages (though some have served longer).