def remove_metric()

in src/worker/exporters/node_exporter.py [0:0]


    def remove_metric(self, field_name, Mapping):
        if 'cpu' in field_name:
            for id in range(self.config['num_cores']):
                numa_domain = self.config['cpu_numa_map'][id]
                self.gauges[field_name].remove(self.config['job_id'], str(id), numa_domain)
        elif 'xid' in field_name or 'link_flap' in field_name:
            for dev_id in self.config['counter'][field_name].keys():
                for time_stamp in self.config['counter'][field_name][dev_id]:
                    label_values = [self.config['job_id'], dev_id, Mapping[dev_id], time_stamp] if 'xid' in \
                        field_name else [self.config['job_id'], Mapping[dev_id], time_stamp]
                    metric = self.gauges[field_name]
                    labels = {k: v for k, v in zip(metric._labelnames, label_values)}
                    metric_exists = metric.labels(**labels) is not None
                    if metric_exists:
                        self.gauges[field_name].remove(*label_values)
                self.config['counter'][field_name][dev_id].clear()
        else:
            self.gauges[field_name].remove(self.config['job_id'])