def METHOD_NAME(self, metric_name):
    # The metric reports a 1 if connected, and 0 if not. The mapping used here:
    # OK if connected || OK if metric value is `1`
    # Critical if not connected || Critical if value is '0'
    # Unknown for everything else
    status_map = defaultdict(lambda: ServiceCheck.UNKNOWN)
    status_map[0], status_map[1] = ServiceCheck.CRITICAL, ServiceCheck.OK
    service_check_method = self.service_check
    def argocd_cluster_connection_status_transformer(_metric, sample_data, _runtime_data):
        for sample, tags, hostname in sample_data:
            service_check_method(metric_name, status_map[int(sample.value)], hostname=hostname, tags=tags)
    return argocd_cluster_connection_status_transformer