public static String toJson(List<MetricsPacket> metrics, boolean addStatus) {
        try (ByteArrayOutputStream output = new ByteArrayOutputStream()) {
            toJson(metrics, output, addStatus);
            output.flush();
            return output.toString();
        } catch (IOException e) {
            return "{}";
        }
    }
Converts the given json formatted string to a list of metrics packet builders.
Note that this method returns an empty list if an IOException occurs,
and logs a warning as a side effect.
metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/json/YamasJsonUtil.java