public static Map<String, MonitorConfig> getMonitorConfigs(Config config) {
    Map<String, MonitorConfig> monitorConfigMap = new HashMap<>();
    Config monitorConfig = config.subset(MONITOR_PREFIX);
    for (String monitorName : getMonitorNames(monitorConfig)) {
      monitorConfigMap.put(monitorName,
                           new MonitorConfig(monitorConfig.subset(monitorName + MONITOR_CONFIG_KEY_SEPARATOR)));
    }
    return monitorConfigMap;
  }
Groups configuration defined in the config object for each of the monitors into a MonitorConfig object
@param config contains the entire configuration defined for all the monitors.
@return a map of monitorName, {@link MonitorConfig}, where each MonitorConfig object
contains all the configuration defined for the monitor named monitorName.
samza-rest/src/main/java/org/apache/samza/monitor/MonitorConfig.java