def metric_allowed(self, metric):
        """
        Check metric against whitelist & blacklist. Metric is any string, a
        name or a full path. Returns bool allowed or not
        """
        inwhitelist = False
        for wregx in self.config['metrics_whitelist']:
            if wregx.match(metric):
                inwhitelist = True
                break
        # if path isn't in *any* of the whitelists, it fails
        # as long as whitelist isn't an empty list
        if not inwhitelist and len(self.config['metrics_whitelist']) > 0:
            return False

        # if path is in *any* of the blacklists, it fails
        for bregx in self.config['metrics_blacklist']:
            if bregx.match(metric):
                return False

        return True

        Check metric against whitelist & blacklist. Metric is any string, a
        name or a full path. Returns bool allowed or not
        
src/diamond/collector.py