public Pair<String, String[]> toStringArray() {
    List<String> allNames = new ArrayList<>();
    tags.forEach(
        (k, v) -> {
          allNames.add(k);
          allNames.add(v);
        });
    return new Pair<>(name, allNames.toArray(new String[0]));
  }
Convert the metric name and tag into pair.
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/utils/MetricInfo.java