def process_metric(self, metric, scraper_config, metric_transformers=None):
    "\n        Handle a Prometheus metric according to the following flow:\n        - search `scraper_config['metrics_mapper']` for a prometheus.metric to datadog.metric mapping\n        - call check method with the same name as the metric\n        - log info if none of the above worked\n\n        `metric_transformers` is a dict of `<metric name>:<function to run when the metric name is encountered>`\n        "
    self._store_labels(metric, scraper_config)
    if scraper_config['ignore_metrics']:
        if (metric.name in scraper_config['_ignored_metrics']):
            self._send_telemetry_counter(self.TELEMETRY_COUNTER_METRICS_IGNORE_COUNT, len(metric.samples), scraper_config)
            return
        if (scraper_config['_ignored_re'] and scraper_config['_ignored_re'].search(metric.name)):
            scraper_config['_ignored_metrics'].add(metric.name)
            self._send_telemetry_counter(self.TELEMETRY_COUNTER_METRICS_IGNORE_COUNT, len(metric.samples), scraper_config)
            return
    self._send_telemetry_counter(self.TELEMETRY_COUNTER_METRICS_PROCESS_COUNT, len(metric.samples), scraper_config)
    if self._filter_metric(metric, scraper_config):
        return
    self._join_labels(metric, scraper_config)
    if scraper_config['_dry_run']:
        return
    try:
        self.submit_openmetric(scraper_config['metrics_mapper'][metric.name], metric, scraper_config)
    except KeyError:
        if ((metric_transformers is not None) and (metric.name in metric_transformers)):
            try:
                transformer = metric_transformers[metric.name]
                transformer(metric, scraper_config)
            except Exception as err:
                self.log.warning('Error handling metric: %s - error: %s', metric.name, err)
            return
        for (transformer_name, transformer) in iteritems(metric_transformers):
            if (transformer_name.endswith('*') and metric.name.startswith(transformer_name[:(- 1)])):
                transformer(metric, scraper_config, transformer_name)
        if (scraper_config['_wildcards_re'] and scraper_config['_wildcards_re'].search(metric.name)):
            self.submit_openmetric(metric.name, metric, scraper_config)
            return
        self.log.debug('Skipping metric `%s` as it is not defined in the metrics mapper, has no transformer function, nor does it match any wildcards.', metric.name)
Handle a Prometheus metric according to the following flow:
- search `scraper_config['metrics_mapper']` for a prometheus.metric to datadog.metric mapping
- call check method with the same name as the metric
- log info if none of the above worked

`metric_transformers` is a dict of `<metric name>:<function to run when the metric name is encountered>`
def process_metric(self, metric, scraper_config, metric_transformers=None):
    "\n        Handle a Prometheus metric according to the following flow:\n        - search `scraper_config['metrics_mapper']` for a prometheus.metric to datadog.metric mapping\n        - call check method with the same name as the metric\n        - log info if none of the above worked\n\n        `metric_transformers` is a dict of `<metric name>:<function to run when the metric name is encountered>`\n        "
    self._store_labels(metric, scraper_config)
    if scraper_config['ignore_metrics']:
        if (metric.name in scraper_config['_ignored_metrics']):
            self._send_telemetry_counter(self.TELEMETRY_COUNTER_METRICS_IGNORE_COUNT, len(metric.samples), scraper_config)
            return
        if (scraper_config['_ignored_re'] and scraper_config['_ignored_re'].search(metric.name)):
            scraper_config['_ignored_metrics'].add(metric.name)
            self._send_telemetry_counter(self.TELEMETRY_COUNTER_METRICS_IGNORE_COUNT, len(metric.samples), scraper_config)
            return
    self._send_telemetry_counter(self.TELEMETRY_COUNTER_METRICS_PROCESS_COUNT, len(metric.samples), scraper_config)
    if self._filter_metric(metric, scraper_config):
        return
    self._join_labels(metric, scraper_config)
    if scraper_config['_dry_run']:
        return
    try:
        self.submit_openmetric(scraper_config['metrics_mapper'][metric.name], metric, scraper_config)
    except KeyError:
        if ((metric_transformers is not None) and (metric.name in metric_transformers)):
            try:
                transformer = metric_transformers[metric.name]
                transformer(metric, scraper_config)
            except Exception as err:
                self.log.warning('Error handling metric: %s - error: %s', metric.name, err)
            return
        for (transformer_name, transformer) in iteritems(metric_transformers):
            if (transformer_name.endswith('*') and metric.name.startswith(transformer_name[:(- 1)])):
                transformer(metric, scraper_config, transformer_name)
        if (scraper_config['_wildcards_re'] and scraper_config['_wildcards_re'].search(metric.name)):
            self.submit_openmetric(metric.name, metric, scraper_config)
            return
        self.log.debug('Skipping metric `%s` as it is not defined in the metrics mapper, has no transformer function, nor does it match any wildcards.', metric.name)