I have seen this question about generalising divergence to infinity in a direction, but I believe the discussion is unclear as one would have to describe what to describe what diverging to infinity means in general even means.
A comment by Sangchul Lee on a previous post of mine gives a hint,
The notion of divergence to ±∞ requires more than merely metric space structure. Recall that this notion is equivalent to convergence to +∞ or to −∞ in the extended real number line. Analogously, to define divergence to a point of infinity on any metric space M , we need a choice of compactification of M
With this hint, my question becomes, why is compactification of a metric space the required to generalize divergence to infinity?