private boolean useMetric(MetricRule rule, List<String> tagBasedResourceIds, Metric metric) {
    if (rule.awsDimensionSelect != null && !metricsIsInAwsDimensionSelect(rule, metric)) {
      return false;
    }
    if (rule.awsDimensionSelectRegex != null && !metricIsInAwsDimensionSelectRegex(rule, metric)) {
      return false;
    }
    if (rule.awsTagSelect != null && !metricIsInAwsTagSelect(rule, tagBasedResourceIds, metric)) {
      return false;
    }
    return true;
  }
Check if a metric should be used according to `aws_dimension_select`,
`aws_dimension_select_regex` and dynamic `aws_tag_select`
src/main/java/io/prometheus/cloudwatch/DefaultDimensionSource.java