Zeta function for curves in a manifold

Motivation

In the analogy between prime numbers and knots, the prime number is thought sometimes as the circle of length $l([p]) = \text{log}\,p$. This is so you can express the zeta function as $$\zeta(s) = \sum_{D\ge0} e^{-l(D)s}$$

where the sum goes over effective divisors on $\text{Spec}\,\mathbb Z$ and length is extended there by additivity. Similarly, you can do it to rewrite Dedekind zeta function for other number fields.

Question

I wonder, what is the right analogue of above formula for a manifold with metric? Perhaps:

1. integration over all closed curves of the expression $e^{-l(D)s}$
2. summation over positive sums of classes of closed geodesics.

I think I've heard something about definition 2, but I suspect if the two above are defined correctly they will be the same. Is it possible to formalize this definition? Do different formalizations lead to the same zeta-function?

Yes, I think this should be related to Laplacians, Selberg trace formula and dynamical system zetas. What I said I've heard about definition 2 was probably the Selberg zeta, but I can't say it clearly, hence questions.

-
That sum looks a little bit like the McShane identity. en.wikipedia.org/wiki/McShane%27s_identity – Sam Nead Jan 1 '10 at 20:59
Not exactly, because the sum there is alternating. But it should be in this terminology $L_T(-1, \chi) = 1/2$ where $L$ is a suitable analogue of $L$-function for torus $T$ and a "character" $\chi$. – Ilya Nikokoshev Jan 1 '10 at 21:09
Does not really qualify for an answer, but perhaps the zeta-function for a Laplacian could be a good strating point? see e.g. here: books.google.com/books?id=gzJ6Vn0y7XQC&pg=PA144 – mathphysicist Jan 2 '10 at 4:00
I think that zeta-function of a Laplacian should be related, thanks. – Ilya Nikokoshev Jan 2 '10 at 10:32