def _ignore_metrics_by_label(self, scraper_config, metric_name, sample):
    ignore_metrics_by_label = scraper_config['ignore_metrics_by_labels']
    sample_labels = sample[self.SAMPLE_LABELS]
    for (label_key, label_values) in ignore_metrics_by_label.items():
        if (not label_values):
            self.log.debug("Skipping filter label `%s` with an empty values list, did you mean to use '*' wildcard?", label_key)
        elif ('*' in label_values):
            self.log.debug('Detected wildcard for label `%s`', label_key)
            if (label_key in sample_labels.keys()):
                self.log.debug('Skipping metric `%s` due to label key matching: %s', metric_name, label_key)
                return True
        else:
            for val in label_values:
                if ((label_key in sample_labels) and (sample_labels[label_key] == val)):
                    self.log.debug('Skipping metric `%s` due to label `%s` value matching: %s', metric_name, label_key, val)
                    return True
    return False
def _ignore_metrics_by_label(self, scraper_config, metric_name, sample):
    ignore_metrics_by_label = scraper_config['ignore_metrics_by_labels']
    sample_labels = sample[self.SAMPLE_LABELS]
    for (label_key, label_values) in ignore_metrics_by_label.items():
        if (not label_values):
            self.log.debug("Skipping filter label `%s` with an empty values list, did you mean to use '*' wildcard?", label_key)
        elif ('*' in label_values):
            self.log.debug('Detected wildcard for label `%s`', label_key)
            if (label_key in sample_labels.keys()):
                self.log.debug('Skipping metric `%s` due to label key matching: %s', metric_name, label_key)
                return True
        else:
            for val in label_values:
                if ((label_key in sample_labels) and (sample_labels[label_key] == val)):
                    self.log.debug('Skipping metric `%s` due to label `%s` value matching: %s', metric_name, label_key, val)
                    return True
    return False