Edit: According to the comment of Prof. Bryant we revise the question as follows:
Assume that $X$ is a smooth vector field on an open manifold $M$, for exmple $\mathbb{R}^2$. Is there a non degenerate pseudo Riemannian metric on $M$ such that $X$ is a gradient vector field? If not what type of obstructions would appear?