def METHOD_NAME(kubelet_url, cadvisor_port):
    """
    Tries to connect to the cadvisor endpoint, with given params
    :return: url if OK, raises exception if NOK
    """
    if cadvisor_port == 0:
        raise ValueError("cAdvisor port set to 0 in configuration")
    kubelet_hostname = urlparse(kubelet_url).hostname
    if not kubelet_hostname:
        raise ValueError("kubelet hostname empty")
    url = "http://{}:{}{}".format(kubelet_hostname, cadvisor_port, LEGACY_CADVISOR_METRICS_PATH)
    # Test the endpoint is present
    r = requests.head(url, timeout=1)  # SKIP_HTTP_VALIDATION
    r.raise_for_status()
    return url