static private void handleValue(JsonParser parser, Instant timestamp, Collector consumer,
                                    Map<Set<Dimension>, Map<DimensionId, String>> uniqueDimensions) throws IOException {
        String name = "";
        String description = "";
        Map<DimensionId, String> dim = Map.of();
        List<Map.Entry<String, Number>> values = List.of();
        for (parser.nextToken(); parser.currentToken() != JsonToken.END_OBJECT; parser.nextToken()) {
            String fieldName = parser.currentName();
            JsonToken token = parser.nextToken();
            switch (fieldName) {
                case "name" -> name = parser.getText();
                case "description" -> description = parser.getText();
                case "dimensions" -> dim = parseDimensions(parser, uniqueDimensions);
                case "values" -> values = parseValues(parser);
                default -> {
                    if (token == JsonToken.START_OBJECT || token == JsonToken.START_ARRAY) {
                        parser.skipChildren();
                    }
                }
            }
        }
        if (name.isEmpty()) {
            throw new IOException("missing name for entry in 'values' array");
        }
        for (Map.Entry<String, Number> value : values) {
            consumer.accept(new Metric(MetricId.toMetricId(name+"."+value.getKey()), value.getValue(), timestamp, dim, description));
        }
    }
Fetch metrics for a given vespa service

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