private void checkAndAddExternalCollectorHosts(String clusterName) throws SystemException {
    try {
      // try to get vip properties from cluster-env
      String configType = "cluster-env";
      String currentConfigVersion = getDesiredConfigVersion(clusterName, configType);
      String oldConfigVersion = serviceConfigVersions.get(configType);
      if (!currentConfigVersion.equals(oldConfigVersion)) {
        serviceConfigVersions.put(configType, currentConfigVersion);
        Map<String, String> configProperties = getDesiredConfigMap
          (clusterName, currentConfigVersion, configType,
            Collections.singletonMap("METRICS_COLLECTOR",
              new String[]{"metrics_collector_external_hosts"}));

        if (!configProperties.isEmpty()) {
          clusterMetricserverVipHost = configProperties.get("METRICS_COLLECTOR");
          if (StringUtils.isNotEmpty(clusterMetricserverVipHost)) {
            for (String collectorHost : StringUtils.split(clusterMetricserverVipHost, ",")) {
              metricsCollectorHAManager.addExternalMetricsCollectorHost(clusterName, collectorHost);
            }
            LOG.info("Setting Metrics Collector External Host : " + clusterMetricserverVipHost);
          }
        }
        // updating the port value, because both vip properties are stored in
        // cluster-env
        configProperties = getDesiredConfigMap
          (clusterName, currentConfigVersion, configType,
            Collections.singletonMap("METRICS_COLLECTOR",
              new String[]{"metrics_collector_external_port"}));

        if (!configProperties.isEmpty()) {
          clusterMetricServerVipPort = configProperties.getOrDefault("METRICS_COLLECTOR", "6188");
        }
      }
    } catch (NoSuchParentResourceException | UnsupportedPropertyException e) {
      LOG.warn("Failed to retrieve collector hostname.", e);
    }
  }
Get type of Metrics system installed.
@return @MetricsService, null if none found.
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java