(self, label_name, label_value, scraper_config, hostname=None)
return tags
Build a list of formatted tags from `label_name` parameter. It also depend of the
        check configuration ('keep_ksm_labels' parameter)
Build a list of formatted tags from `label_name` parameter. It also depend of the
        check configuration ('keep_ksm_labels' parameter)
Build a list of formatted tags from label_name parameter . It also depend of the check configuration ( keep_ksm_labels parameter )
def _build_tags(self, label_name, label_value, scraper_config, hostname=None):
        """
        Build a list of formatted tags from `label_name` parameter. It also depend of the
        check configuration ('keep_ksm_labels' parameter)
        """
        tags = []
        # first use the labels_mapper
        tag_name = scraper_config['labels_mapper'].get(label_name, label_name)
        # then try to use the kube_labels_mapper
        kube_tag_name = kube_labels_mapper.get(tag_name, tag_name)
        label_value = to_string(label_value).lower()
        tags.append('{}:{}'.format(to_string(kube_tag_name), label_value))
        if self.keep_ksm_labels and (kube_tag_name != tag_name):
            tags.append('{}:{}'.format(to_string(tag_name), label_value))
        return tags
def _build_tags ( self , label_name , label_value , scraper_config , hostname = None ) : tags = [ ] # first use the labels_mapper tag_name = scraper_config [ 'labels_mapper' ] . get ( label_name , label_name ) # then try to use the kube_labels_mapper kube_tag_name = kube_labels_mapper . get ( tag_name , tag_name ) label_value = to_string ( label_value ) . lower ( ) tags . append ( '{}:{}' . format ( to_string ( kube_tag_name ) , label_value ) ) if self . keep_ksm_labels and ( kube_tag_name != tag_name ) : tags . append ( '{}:{}' . format ( to_string ( tag_name ) , label_value ) ) return tags