CheckResult ensureIndexTemplatesAndClusterReady(String index) {
    try {
      version(); // ensure the version is available (even if we already cached it)
      ensureIndexTemplates(); // called only once, so we have to double-check health
      AggregatedHttpRequest request = AggregatedHttpRequest.of(GET, "/_cluster/health/" + index);
      CheckResult result = http().newCall(request, READ_STATUS, "get-cluster-health").execute();
      if (result == null) throw new IllegalArgumentException("No content reading cluster health");
      return result;
    } catch (Throwable e) {
      Call.propagateIfFatal(e);
      // Wrapping interferes with humans intended to read this message:
      //
      // Unwrap the marker exception as the health check is not relevant for the throttle component.
      // Unwrap any IOException from the first call to ensureIndexTemplates()
      if (e instanceof RejectedExecutionException || e instanceof UncheckedIOException) {
        return CheckResult.failed(e.getCause());
      }
      return CheckResult.failed(e);
    }
  }
This allows the health check to display problems, such as access, installing the index
template. It also helps reduce traffic sent to nodes still initializing (when guarded on the
check result). Finally, this reads the cluster health of the index as it can go down after the
one-time initialization passes.
zipkin-storage/elasticsearch/src/main/java/zipkin2/elasticsearch/ElasticsearchStorage.java