def poll(self, scraper_config, headers=None):
    "\n        Returns a valid `requests.Response`, otherwise raise requests.HTTPError if the status code of the\n        response isn't valid - see `response.raise_for_status()`\n\n        The caller needs to close the requests.Response.\n\n        Custom headers can be added to the default headers.\n        "
    endpoint = scraper_config.get('prometheus_url')
    health_service_check = scraper_config['health_service_check']
    service_check_name = self._metric_name_with_namespace('prometheus.health', scraper_config)
    service_check_tags = ['endpoint:{}'.format(endpoint)]
    service_check_tags.extend(scraper_config['custom_tags'])
    try:
        response = self.send_request(endpoint, scraper_config, headers)
    except requests.exceptions.SSLError:
        self.log.error('Invalid SSL settings for requesting %s endpoint', endpoint)
        raise
    except IOError:
        if health_service_check:
            self.service_check(service_check_name, AgentCheck.CRITICAL, tags=service_check_tags)
        raise
    try:
        response.raise_for_status()
        if health_service_check:
            self.service_check(service_check_name, AgentCheck.OK, tags=service_check_tags)
        return response
    except requests.HTTPError:
        response.close()
        if health_service_check:
            self.service_check(service_check_name, AgentCheck.CRITICAL, tags=service_check_tags)
        raise
Returns a valid `requests.Response`, otherwise raise requests.HTTPError if the status code of the
response isn't valid - see `response.raise_for_status()`

The caller needs to close the requests.Response.

Custom headers can be added to the default headers.
def poll(self, scraper_config, headers=None):
    "\n        Returns a valid `requests.Response`, otherwise raise requests.HTTPError if the status code of the\n        response isn't valid - see `response.raise_for_status()`\n\n        The caller needs to close the requests.Response.\n\n        Custom headers can be added to the default headers.\n        "
    endpoint = scraper_config.get('prometheus_url')
    health_service_check = scraper_config['health_service_check']
    service_check_name = self._metric_name_with_namespace('prometheus.health', scraper_config)
    service_check_tags = ['endpoint:{}'.format(endpoint)]
    service_check_tags.extend(scraper_config['custom_tags'])
    try:
        response = self.send_request(endpoint, scraper_config, headers)
    except requests.exceptions.SSLError:
        self.log.error('Invalid SSL settings for requesting %s endpoint', endpoint)
        raise
    except IOError:
        if health_service_check:
            self.service_check(service_check_name, AgentCheck.CRITICAL, tags=service_check_tags)
        raise
    try:
        response.raise_for_status()
        if health_service_check:
            self.service_check(service_check_name, AgentCheck.OK, tags=service_check_tags)
        return response
    except requests.HTTPError:
        response.close()
        if health_service_check:
            self.service_check(service_check_name, AgentCheck.CRITICAL, tags=service_check_tags)
        raise