private List<UpstreamInstance> getInstances(final String selectorId, final String contextPath, final boolean enabled) {
        List<UpstreamInstance> allInstances = null;
        List<DiscoveryUpstreamData> discoveryUpstreamDataList = discoveryUpstreamService.findBySelectorId(selectorId);
        // Get service instance.
        if (CollectionUtils.isNotEmpty(discoveryUpstreamDataList)) {
            allInstances = new ArrayList<>();
            try {
                allInstances = discoveryUpstreamDataList.stream().map(discoveryUpstreamData -> {
                    String[] upstreamUrlArr = discoveryUpstreamData.getUrl().split(":");
                    UpstreamInstance instance = new UpstreamInstance();
                    instance.setContextPath(contextPath);
                    instance.setEnabled(enabled);
                    instance.setIp(upstreamUrlArr[0]);
                    instance.setPort(upstreamUrlArr.length == 1 ? 80 : Integer.parseInt(upstreamUrlArr[1]));
                    instance.setHealthy(true);
                    Long startupTime = Optional.ofNullable(discoveryUpstreamData.getDateCreated()).map(Timestamp::getTime).orElse(System.currentTimeMillis());
                    instance.setStartupTime(startupTime);
                    return instance;
                }).collect(Collectors.toList());
            } catch (Exception e) {
                LOG.error("Error getting cluster instance list. contextPath={} error", contextPath, e);
                return Collections.emptyList();
            }
        }
        return allInstances;
    }
Get the last started healthy instance of each cluster.

@return List
shenyu-admin/src/main/java/org/apache/shenyu/admin/service/manager/impl/LoadServiceDocEntryImpl.java