  We consider perturbations of Minkowski space as well as more general
spacetimes on which the wave operator $\square_g$ is known to be essentially
self-adjoint. We define complex powers $(\square_g-i\varepsilon)^{-\alpha}$ by
functional calculus, and show that the trace density exists as a meromorphic
function of $\alpha$. We relate its poles to geometric quantities, in
particular to the scalar curvature. The results allow us to formulate a
spectral action principle which serves as a simple Lorentzian model for the
bosonic part of the Chamseddine-Connes action. Our proof combines microlocal
resolvent estimates, including radial propagation estimates, with uniform
estimates for the Hadamard parametrix. The arguments operate in Lorentzian
signature directly and do not rely on a transition from the Euclidean setting.
The results hold also true in the case of ultrastatic spacetimes.
