Fix issue with metric recording introduced in 68f885b