public Builder filter(final MetricFilter filter) {
            this.filter = filter;
            return this;
        }
Only report metrics which match the given filter.

@param filter a {@link MetricFilter}
@return {@code this}
jraft-core/src/main/java/com/alipay/sofa/jraft/util/MetricReporter.java