Metric character of Hamilton-Jacobi equations