Typically, Shape Length is used. One counterexample might be if you are looking for the shortest path through an underground system.
You might prefer a longer path via duct banks, versus a shorter path through a trench that requires excavation, since the excavation might be more costly.
In this case, you would set up a network attribute that represents these costs.