Add procedure to handle saving metrics