def _service_and_endpoint_labels_from_method(method_name):
    """Get normalized service_label, endpoint_label tuple from method name"""
    name_parts = method_name.split("/")
    if len(name_parts) != 3 or name_parts[0] != "" or name_parts[1] == "" or name_parts[2] == "":
        raise AssertionError("Invalid method name: {}".format(method_name))

    service_label = name_parts[1].replace(".", "_")
    endpoint_label = name_parts[2].replace(".", "_")
    return service_label, endpoint_label