static MetricsConfig loadFirst(String prefix, String... fileNames) {
        for (String fname : fileNames) {
            try {
                Configuration cf = new PropertiesConfiguration(fname).interpolatedConfiguration();
                LOG.info("loaded properties from " + fname);
                return new MetricsConfig(cf, prefix);
            } catch (ConfigurationException e) {
                if (e.getMessage().startsWith("Cannot locate configuration")) {
                    continue;
                }
                throw new MetricsConfigException(e);
            }
        }
        throw new MetricsConfigException("Cannot locate configuration: tried " + StringUtils.join(fileNames, ", "));
    }