(self)
Creates a scraper configuration for each instance.
Creates a scraper configuration for each instance.
Creates a scraper configuration for each instance .
def configure_scrapers(self):
        """
        Creates a scraper configuration for each instance.
        """

        scrapers = {}

        for config in self.scraper_configs:
            endpoint = config.get('openmetrics_endpoint', '')
            if not isinstance(endpoint, str):
                raise ConfigurationError('The setting `openmetrics_endpoint` must be a string')
            elif not endpoint:
                raise ConfigurationError('The setting `openmetrics_endpoint` is required')

            scrapers[endpoint] = self.create_scraper(config)

        self.scrapers.clear()
        self.scrapers.update(scrapers)
def configure_scrapers ( self ) : scrapers = { } for config in self . scraper_configs : endpoint = config . get ( 'openmetrics_endpoint' , '' ) if not isinstance ( endpoint , str ) : raise ConfigurationError ( 'The setting `openmetrics_endpoint` must be a string' ) elif not endpoint : raise ConfigurationError ( 'The setting `openmetrics_endpoint` is required' ) scrapers [ endpoint ] = self . create_scraper ( config ) self . scrapers . clear ( ) self . scrapers . update ( scrapers )