(self, metric, scraper_config)
Phase a pod is in.
Phase a pod is in.
Phase a pod is in .
def kube_pod_status_phase(self, metric, scraper_config):
        """Phase a pod is in."""
        metric_name = scraper_config['namespace'] + '.pod.status_phase'
        status_phase_counter = Counter()

        for sample in metric.samples:
            # Counts aggregated cluster-wide to avoid no-data issues on pod churn,
            # pod granularity available in the service checks
            tags = (
                self._label_to_tags('namespace', sample[self.SAMPLE_LABELS], scraper_config)
                + self._label_to_tags('phase', sample[self.SAMPLE_LABELS], scraper_config)
                + scraper_config['custom_tags']
            )
            status_phase_counter[tuple(sorted(tags))] += sample[self.SAMPLE_VALUE]

        for tags, count in iteritems(status_phase_counter):
            self.gauge(metric_name, count, tags=list(tags))
def kube_pod_status_phase ( self , metric , scraper_config ) : metric_name = scraper_config [ 'namespace' ] + '.pod.status_phase' status_phase_counter = Counter ( ) for sample in metric . samples : # Counts aggregated cluster-wide to avoid no-data issues on pod churn, # pod granularity available in the service checks tags = ( self . _label_to_tags ( 'namespace' , sample [ self . SAMPLE_LABELS ] , scraper_config ) + self . _label_to_tags ( 'phase' , sample [ self . SAMPLE_LABELS ] , scraper_config ) + scraper_config [ 'custom_tags' ] ) status_phase_counter [ tuple ( sorted ( tags ) ) ] += sample [ self . SAMPLE_VALUE ] for tags , count in iteritems ( status_phase_counter ) : self . gauge ( metric_name , count , tags = list ( tags ) )