Energy integrals and metric embedding theory