However, this approach would, in theory, give the answer to the OP's literal question.
One might want to interpret the question as asking how one could 'generate' all of the metrics that satisfy this diagonalizability property, at least locally.