I've just learnt in this Unique factorisation of prime geodesics? question that there is an analogy between prime geodesics and prime ideals in number fields. You can read more about it here: https://ncatlab.org/nlab/show/prime+geodesic or just open the paper that @Meow mentions(https://www.math.upenn.edu/~ted/620F09/References/Sunada/0.pdf). Moreover, this analogy deeply relies on the analogy between extensions of number fields and Riemannian coverings and you can learn a striking result of the paper that says that zeta functions of number fields are related to zeta functions constructed by the use of eigenvalues of Laplace operator. Of course, one can suspect that this is all not accidental. My question is: is there any functor from Riemannian manifolds to number fields and a functor from (I don't know which category) to $Aff$(affine schemes) which sends a space of prime geodesics on a Riemannian manifold up to metric-preserving homotopy to the spectrum of a ring of integers in a field which explains this analogy?