(self, instance)
return kubelet_instance
Create a copy of the instance and set default values.
        This is so the base class can create a scraper_config with the proper values.
Create a copy of the instance and set default values.
        This is so the base class can create a scraper_config with the proper values.
Create a copy of the instance and set default values . This is so the base class can create a scraper_config with the proper values .
def _create_kubelet_prometheus_instance(self, instance):
        """
        Create a copy of the instance and set default values.
        This is so the base class can create a scraper_config with the proper values.
        """
        kubelet_instance = deepcopy(instance)
        kubelet_instance.update(
            {
                'namespace': self.NAMESPACE,
                # We need to specify a prometheus_url so the base class can use it as the key for our config_map,
                # we specify a dummy url that will be replaced in the `check()` function. We append it with "kubelet"
                # so the key is different than the cadvisor scraper.
                'prometheus_url': instance.get('kubelet_metrics_endpoint', 'dummy_url/kubelet'),
                'metrics': [
                    DEFAULT_GAUGES,
                    DEPRECATED_GAUGES,
                    NEW_1_14_GAUGES,
                    DEFAULT_HISTOGRAMS,
                    DEPRECATED_HISTOGRAMS,
                    NEW_1_14_HISTOGRAMS,
                    DEFAULT_SUMMARIES,
                    DEPRECATED_SUMMARIES,
                    NEW_1_14_SUMMARIES,
                ],
                # Defaults that were set when the Kubelet scraper was based on PrometheusScraper
                'send_monotonic_counter': instance.get('send_monotonic_counter', False),
                'health_service_check': instance.get('health_service_check', False),
            }
        )
        return kubelet_instance
def _create_kubelet_prometheus_instance ( self , instance ) : kubelet_instance = deepcopy ( instance ) kubelet_instance . update ( { 'namespace' : self . NAMESPACE , # We need to specify a prometheus_url so the base class can use it as the key for our config_map, # we specify a dummy url that will be replaced in the `check()` function. We append it with "kubelet" # so the key is different than the cadvisor scraper. 'prometheus_url' : instance . get ( 'kubelet_metrics_endpoint' , 'dummy_url/kubelet' ) , 'metrics' : [ DEFAULT_GAUGES , DEPRECATED_GAUGES , NEW_1_14_GAUGES , DEFAULT_HISTOGRAMS , DEPRECATED_HISTOGRAMS , NEW_1_14_HISTOGRAMS , DEFAULT_SUMMARIES , DEPRECATED_SUMMARIES , NEW_1_14_SUMMARIES , ] , # Defaults that were set when the Kubelet scraper was based on PrometheusScraper 'send_monotonic_counter' : instance . get ( 'send_monotonic_counter' , False ) , 'health_service_check' : instance . get ( 'health_service_check' , False ) , } ) return kubelet_instance