### Description

The health API response can become a few MBs (2-3MB if 50K indices are affected).

In less extreme situations the response can be in the 10s/100s of KB. 

It might be worthwhile looking into chunking its response (this might provide clients with a better experience too)
server/src/main/java/org/elasticsearch/health/Diagnosis.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.health;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.core.Nullable;
import org.elasticsearch.xcontent.ToXContentFragment;
import org.elasticsearch.xcontent.ToXContentObject;
import org.elasticsearch.xcontent.XContentBuilder;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import static org.elasticsearch.health.HealthService.HEALTH_API_ID_PREFIX;
/**
 * Details a potential issue that was diagnosed by a {@link HealthService}.
 *
 * @param definition The definition of the diagnosis (e.g. message, helpURL)
 * @param affectedResources Optional list of "things" that are affected by this condition (e.g. shards, indices, or policies).
 */
public record Diagnosis(Definition definition, @Nullable List<Resource> affectedResources) implements ToXContentObject {
    /**
     * Represents a type of affected resource, together with the resources/abstractions that
     * are affected.
     */
    public static class Resource implements ToXContentFragment {