code: public String exportToJson(boolean pretty) {
          Map<String, Object> result = new HashMap<String, Object>();
          Map<String, List<Map<String, Object>>> services = new HashMap<String, List<Map<String, Object>>>();
  
          for (EndpointHealth h : endpoints) {
              String type = serviceTypeFromEnum(h.type());
              if (!services.containsKey(type)) {
                  services.put(type, new ArrayList<Map<String, Object>>());
              }
              List<Map<String, Object>> eps = services.get(type);
              eps.add(h.toMap());
          }
  
          result.put("version", version);
          result.put("services", services);
          result.put("sdk", sdk);
          result.put("id", id);
  
          try {
              if (pretty) {
                  return DefaultObjectMapper.prettyWriter().writeValueAsString(result);
              } else {
                  return DefaultObjectMapper.writeValueAsString(result);
              }
          } catch (JsonProcessingException e) {
              throw new IllegalStateException("Could not encode as JSON string.", e);
          }
      }
docs: Exports this report into the standard JSON format which is consistent
  across different language SDKs.
  
  @return the encoded JSON string.