Text this: Obtaining the spacetime metric from cosmological observations