private boolean isValidMetric(MetricDefine define) {
    boolean nameIsValid = NAME_PATTERN.matcher(define.getName()).matches();
    boolean labelIsValid = true;
    for (String tag : define.getTags()) {
      if (!LABEL_PATTERN.matcher(tag).matches()) {
        labelIsValid = false;
        break;
      }
    }
    boolean valid = nameIsValid && labelIsValid;
    if (!valid) {
      LOGGER.warn("Metric {} is not a valid prometheus metric.", define);
    }
    return valid;
  }
Metric type converter for prometheus api
amoro-metrics/amoro-metrics-prometheus/src/main/java/org/apache/amoro/metrics/promethues/MetricsCollector.java