filter metrics in Generate function