private static List<Map.Entry<String, Number>> parseValues(JsonParser parser) throws IOException {
        List<Map.Entry<String, Number>> metrics = new ArrayList<>();
        for (parser.nextToken(); parser.currentToken() != JsonToken.END_OBJECT; parser.nextToken()) {
            String metricName = parser.currentName();
            JsonToken token = parser.nextToken();
            if (token == JsonToken.VALUE_NUMBER_INT) {
                metrics.add(Map.entry(metricName, parser.getLongValue()));
            } else if (token == JsonToken.VALUE_NUMBER_FLOAT) {
                double value = parser.getValueAsDouble();
                metrics.add(Map.entry(metricName, value == ZERO_DOUBLE ? ZERO_DOUBLE : value));
            } else {
                throw new IllegalArgumentException("Value for aggregator '" + metricName + "' is not a number");
            }
        }
        return metrics;
    }
Fetch metrics for a given vespa service

@author Jo Kristian Bergum
metrics-proxy/src/main/java/ai/vespa/metricsproxy/service/MetricsParser.java