(self, instance)
return instance
Set up coredns instance so it can be used in OpenMetricsBaseCheck
Set up coredns instance so it can be used in OpenMetricsBaseCheck
Set up coredns instance so it can be used in OpenMetricsBaseCheck
def _create_core_dns_instance(self, instance):
        """
        Set up coredns instance so it can be used in OpenMetricsBaseCheck
        """
        endpoint = instance.get('prometheus_url')
        if endpoint is None:
            raise ConfigurationError("Unable to find prometheus endpoint in config file.")

        metrics = [DEFAULT_METRICS, GO_METRICS]
        metrics.extend(instance.get('metrics', []))

        instance.update({'prometheus_url': endpoint, 'namespace': 'coredns', 'metrics': metrics})

        return instance
def _create_core_dns_instance ( self , instance ) : endpoint = instance . get ( 'prometheus_url' ) if endpoint is None : raise ConfigurationError ( "Unable to find prometheus endpoint in config file." ) metrics = [ DEFAULT_METRICS , GO_METRICS ] metrics . extend ( instance . get ( 'metrics' , [ ] ) ) instance . update ( { 'prometheus_url' : endpoint , 'namespace' : 'coredns' , 'metrics' : metrics } ) return instance