INNER CODE UNIT · Python

IndicesAliasesCollector

braedon/prometheus-es-exporter · prometheus_es_exporter/__init__.py:100

class IndicesAliasesCollector(object):
    def __init__(self, es_client, timeout):
        self.metric_name_list = ['es', 'indices_aliases']
        self.description = 'Indices Aliases'

        self.es_client = es_client
        self.timeout = timeout

    def collect(self):
        try:
            response = self.es_client.indices.get_alias(request_timeout=self.timeout)

            metrics = indices_aliases_parser.parse_response(response, self.metric_name_list)
            metric_dict = group_metrics(metrics)
        except ConnectionTimeout:
            log.warning('Timeout while fetching %(description)s (timeout %(timeout_s)ss).',
                        {'description': self.description, 'timeout_s': self.timeout})
            yield collector_up_gauge(self.metric_name_list, self.description, succeeded=False)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…