def METHOD_NAME():
    # type: () -> str
    """Return the Agent URL computed from the environment.
    Raises a ``ValueError`` if the URL is not supported by the Agent.
    """
    user_supplied_host = get_trace_hostname(None) is not None
    user_supplied_port = get_trace_port(None) is not None
    url = os.environ.get("DD_TRACE_AGENT_URL")
    if not url:
        if user_supplied_host or user_supplied_port:
            url = "http://%s:%s" % (get_trace_hostname(), get_trace_port())
        elif os.path.exists("/var/run/datadog/apm.socket"):
            url = "unix://%s" % (DEFAULT_UNIX_TRACE_PATH)
        else:
            url = DEFAULT_TRACE_URL
    return url