Backport metrics to 2.0.0-BETA18