synchronized MetricsSource registerSource(String name, String desc, MetricsSource source) {
        Contracts.checkNotNull(config, "config");
        MetricsSourceAdapter sa = sources.get(name);
        if (sa != null) {
            LOG.warn("Source name " + name + " already exists!");
            return sa.source();
        }
        MetricsConfig conf = sourceConfigs.get(name);
        sa = conf != null ? new MetricsSourceAdapter(prefix, name, desc, source, injectedTags, period, conf) : new MetricsSourceAdapter(
                                                                                                                                        prefix,
                                                                                                                                        name,
                                                                                                                                        desc,
                                                                                                                                        source,
                                                                                                                                        injectedTags,
                                                                                                                                        period,
                                                                                                                                        config.subset(MetricsConfig.SOURCE_KEY));
        sources.put(name, sa);
        sa.start();
        LOG.debug("Registered source " + name);
        return sa.source();
    }