public static ImmutableMap<String, SampleFamily> convertPromMetricToSampleFamily(Stream<Metric> metricStream) {
        return metricStream
            .peek(metric -> log.debug("Prom metric to be convert to SampleFamily: {}", metric))
            .flatMap(PrometheusMetricConverter::convertMetric)
            .filter(t -> t != NIL && t._2.samples.length > 0)
            .peek(t -> log.debug("SampleFamily: {}", t))
            .collect(toImmutableMap(Tuple2::_1, Tuple2::_2, (a, b) -> {
                log.debug("merge {} {}", a, b);
                Sample[] m = new Sample[a.samples.length + b.samples.length];
                System.arraycopy(a.samples, 0, m, 0, a.samples.length);
                System.arraycopy(b.samples, 0, m, a.samples.length, b.samples.length);
                return SampleFamilyBuilder.newBuilder(m).build();
            }));
    }
PrometheusMetricConverter converts prometheus metrics to meter-system metrics, then store them to backend storage.
oap-server/analyzer/meter-analyzer/src/main/java/org/apache/skywalking/oap/meter/analyzer/prometheus/PrometheusMetricConverter.java