Map<String, MetricsConfig> getInstanceConfigs(String type) {
        HashMap<String, MetricsConfig> map = new HashMap<String, MetricsConfig>();
        MetricsConfig sub = subset(type);

        for (String key : sub.keys()) {
            Matcher matcher = INSTANCE_REGEX.matcher(key);
            if (matcher.matches()) {
                String instance = matcher.group(1);
                if (!map.containsKey(instance)) {
                    map.put(instance, sub.subset(instance));
                }
            }
        }
        return map;
    }