Germs of analytic varieties in algebraic varieties: canonical metrics and arithmetic algebraization theorems