private boolean metricsIsInAwsDimensionSelect(MetricRule rule, Metric metric) {
    Set<String> dimensionSelectKeys = rule.awsDimensionSelect.keySet();
    for (Dimension dimension : metric.dimensions()) {
      String dimensionName = dimension.name();
      String dimensionValue = dimension.value();
      if (dimensionSelectKeys.contains(dimensionName)) {
        List<String> allowedDimensionValues = rule.awsDimensionSelect.get(dimensionName);
        if (!allowedDimensionValues.contains(dimensionValue)) {
          return false;
        }
      }
    }
    return true;
  }
Check if a metric is matched in `aws_dimension_select`
src/main/java/io/prometheus/cloudwatch/DefaultDimensionSource.java