(self, labels)
return self.pod_list_utils.get_cid_by_name_tuple((namespace, pod_name, container_name))
Should only be called on a container-scoped metric
        It gets the container id from the podlist using the metrics labels

        :param labels
        :return str or None
Should only be called on a container-scoped metric
        It gets the container id from the podlist using the metrics labels
Should only be called on a container - scoped metric It gets the container id from the podlist using the metrics labels
def _get_container_id(self, labels):
        """
        Should only be called on a container-scoped metric
        It gets the container id from the podlist using the metrics labels

        :param labels
        :return str or None
        """
        namespace = CadvisorPrometheusScraperMixin._get_container_label(labels, "namespace")
        # k8s >= 1.16
        pod_name = CadvisorPrometheusScraperMixin._get_container_label(labels, "pod")
        container_name = CadvisorPrometheusScraperMixin._get_container_label(labels, "container")
        # k8s < 1.16
        if not pod_name:
            pod_name = CadvisorPrometheusScraperMixin._get_container_label(labels, "pod_name")
        if not container_name:
            container_name = CadvisorPrometheusScraperMixin._get_container_label(labels, "container_name")
        return self.pod_list_utils.get_cid_by_name_tuple((namespace, pod_name, container_name))
def _get_container_id ( self , labels ) : namespace = CadvisorPrometheusScraperMixin . _get_container_label ( labels , "namespace" ) # k8s >= 1.16 pod_name = CadvisorPrometheusScraperMixin . _get_container_label ( labels , "pod" ) container_name = CadvisorPrometheusScraperMixin . _get_container_label ( labels , "container" ) # k8s < 1.16 if not pod_name : pod_name = CadvisorPrometheusScraperMixin . _get_container_label ( labels , "pod_name" ) if not container_name : container_name = CadvisorPrometheusScraperMixin . _get_container_label ( labels , "container_name" ) return self . pod_list_utils . get_cid_by_name_tuple ( ( namespace , pod_name , container_name ) )