server/src/main/java/org/elasticsearch/health/node/DiskHealthIndicatorService.java
}
            List<Diagnosis> diagnosisList = new ArrayList<>();
            if (hasBlockedIndices() || hasUnhealthyDataNodes()) {
                Set<String> affectedIndices = Sets.union(blockedIndices, indicesAtRisk);
                List<Diagnosis.Resource> affectedResources = new ArrayList<>();
                if (dataNodes.size() > 0) {
                    Diagnosis.Resource nodeResources = new Diagnosis.Resource(dataNodes);
                    affectedResources.add(nodeResources);
                }
                if (affectedIndices.size() > 0) {
                    Diagnosis.Resource indexResources = new Diagnosis.Resource(
                        Diagnosis.Resource.Type.INDEX,
                        affectedIndices.stream()
                            .sorted(indicesComparatorByPriorityAndName(clusterState.metadata()))
                            .collect(Collectors.toList())
                    );
                    affectedResources.add(indexResources);
                }
                diagnosisList.add(
                    new Diagnosis(
                        new Diagnosis.Definition(
                            NAME,
                            "add_disk_capacity_data_nodes",
                            String.format(
                                Locale.ROOT,
                                "%d %s %s on nodes that have run or are likely to run out of disk space, "
                                    + "this can temporarily disable writing on %s %s.",
                                affectedIndices.size(),
                                indices(affectedIndices.size()),
                                regularVerb("reside", affectedIndices.size()),