public SampleFamily filter(Closure<Boolean> filter) {
        if (this == EMPTY) {
            return EMPTY;
        }
        final Sample[] filtered = Arrays.stream(samples)
                                        .filter(it -> filter.call(it.labels))
                                        .toArray(Sample[]::new);
        if (filtered.length == 0) {
            return EMPTY;
        }
        return SampleFamily.build(context, filtered);
    }
Following operations are used in DSL
oap-server/analyzer/meter-analyzer/src/main/java/org/apache/skywalking/oap/meter/analyzer/dsl/SampleFamily.java