public static List<MetricsPacket.Builder> toMetricsPackets(String jsonString) {
        try {
            GenericJsonModel jsonModel = objectMapper().readValue(jsonString, GenericJsonModel.class);
            return toMetricsPackets(jsonModel);
        } catch (IOException e) {
            log.log(WARNING, "Could not create metrics packet from string:\n" + jsonString, e);
            return List.of();
        }
    }
Utilities for converting between metrics packets and the generic json format.

@author gjoranv
metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/model/json/GenericJsonUtil.java