(self, cid, pod_uid=None)
return excluded
Queries the agent6 container filter interface. It retrieves container
        name + image from the podlist, so static pod filtering is not supported.

        Result is cached between calls to avoid the python-go switching cost for
        prometheus metrics (will be called once per metric)
        :param cid: container id
        :param pod_uid: pod UID for static pod detection
        :return: bool
Queries the agent6 container filter interface. It retrieves container
        name + image from the podlist, so static pod filtering is not supported.
Queries the agent6 container filter interface . It retrieves container name + image from the podlist so static pod filtering is not supported .
def is_excluded(self, cid, pod_uid=None):
        """
        Queries the agent6 container filter interface. It retrieves container
        name + image from the podlist, so static pod filtering is not supported.

        Result is cached between calls to avoid the python-go switching cost for
        prometheus metrics (will be called once per metric)
        :param cid: container id
        :param pod_uid: pod UID for static pod detection
        :return: bool
        """
        if not cid:
            return True

        if cid in self.cache:
            return self.cache[cid]

        if pod_uid and pod_uid in self.static_pod_uids:
            self.cache[cid] = False
            return False

        if cid not in self.containers:
            # Filter out metrics not coming from a container (system slices)
            self.cache[cid] = True
            return True
        ctr = self.containers[cid]
        if not ("name" in ctr and "image" in ctr):
            # Filter out invalid containers
            self.cache[cid] = True
            return True

        excluded = c_is_excluded(ctr.get("name"), ctr.get("image"), self.container_id_to_namespace.get(cid, ""))
        self.cache[cid] = excluded
        return excluded
def is_excluded ( self , cid , pod_uid = None ) : if not cid : return True if cid in self . cache : return self . cache [ cid ] if pod_uid and pod_uid in self . static_pod_uids : self . cache [ cid ] = False return False if cid not in self . containers : # Filter out metrics not coming from a container (system slices) self . cache [ cid ] = True return True ctr = self . containers [ cid ] if not ( "name" in ctr and "image" in ctr ) : # Filter out invalid containers self . cache [ cid ] = True return True excluded = c_is_excluded ( ctr . get ( "name" ) , ctr . get ( "image" ) , self . container_id_to_namespace . get ( cid , "" ) ) self . cache [ cid ] = excluded return excluded