(labels)
return False
Return whether a metric is about a pod or not.
        It can be about containers, pods, or higher levels in the cgroup hierarchy
        and we don't want to report on that.
        :param metric
        :return bool
Return whether a metric is about a pod or not.
        It can be about containers, pods, or higher levels in the cgroup hierarchy
        and we don't want to report on that.
        :param metric
        :return bool
Return whether a metric is about a pod or not . It can be about containers pods or higher levels in the cgroup hierarchy and we don t want to report on that . : param metric : return bool
def _is_pod_metric(labels):
        """
        Return whether a metric is about a pod or not.
        It can be about containers, pods, or higher levels in the cgroup hierarchy
        and we don't want to report on that.
        :param metric
        :return bool
        """
        # k8s >= 1.16
        # docker reports container==POD (first case), containerd does not (second case)
        if labels.get('container') == 'POD' or (labels.get('container') == '' and labels.get('pod', False)):
            return True
        # k8s < 1.16 && > 1.8
        if labels.get('container_name') == 'POD' or (
            labels.get('container_name') == '' and labels.get('pod_name', False)
        ):
            return True
        # k8s < 1.8
        # container_cpu_usage_seconds_total has an id label that is a cgroup path
        # eg: /kubepods/burstable/pod531c80d9-9fc4-11e7-ba8b-42010af002bb
        # FIXME: this was needed because of a bug:
        # https://github.com/kubernetes/kubernetes/pull/51473
        if labels.get('id', '').split('/')[-1].startswith('pod'):
            return True
        return False
def _is_pod_metric ( labels ) : # k8s >= 1.16 # docker reports container==POD (first case), containerd does not (second case) if labels . get ( 'container' ) == 'POD' or ( labels . get ( 'container' ) == '' and labels . get ( 'pod' , False ) ) : return True # k8s < 1.16 && > 1.8 if labels . get ( 'container_name' ) == 'POD' or ( labels . get ( 'container_name' ) == '' and labels . get ( 'pod_name' , False ) ) : return True # k8s < 1.8 # container_cpu_usage_seconds_total has an id label that is a cgroup path # eg: /kubepods/burstable/pod531c80d9-9fc4-11e7-ba8b-42010af002bb # FIXME: this was needed because of a bug: # https://github.com/kubernetes/kubernetes/pull/51473 if labels . get ( 'id' , '' ) . split ( '/' ) [ - 1 ] . startswith ( 'pod' ) : return True return False