private String getPropertyValueByNameAndConfigType(String propertyName, String configType, Cluster cluster, String hostname){
    String result = null;
    if (configType != null && propertyName != null) {
      try {
        Map<String, Map<String, String>> configTags =
                amc.findConfigurationTagsWithOverrides(cluster, hostname, null);
        if (configTags.containsKey(configType)) {
          Map<String, Map<String, String>> properties = amc.getConfigHelper().getEffectiveConfigProperties(cluster,
                  Collections.singletonMap(configType, configTags.get(configType)));
          Map<String, String> config = properties.get(configType);
          if (config != null && config.containsKey(propertyName)) {
            result = config.get(propertyName);
          }
        }
      } catch (AmbariException e) {
        String message = String.format("Can not extract configs for " +
                        "component = %s, hostname = %s, config type = %s, property name = %s", componentName,
                hostname, configType, propertyName);
        LOG.warn(message, e);
      }
      if (result == null) {
        String message = String.format(
                "Can not extract property for " +
                        "component %s from configurations. " +
                        "Config tag = %s, config key name = %s, " +
                        "hostname = %s. Probably metrics.json file for " +
                        "service is misspelled.",
                componentName, configType,
                propertyName, hostname);
        LOG.debug(message);
      }
    }
    return result;
  }
Tries to get propertyName property from configType config for specified cluster and hostname
@param propertyName
@param configType
@param cluster
@param hostname
@return
ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/RestMetricsPropertyProvider.java