public List<MetricsPacket> fetch(String requestedConsumer) throws JsonRenderingException {
        ConsumerId consumer = getConsumerOrDefault(requestedConsumer, metricsConsumers);

        return metricsManager.getMetrics(vespaServices.getVespaServices(), Instant.now(), consumer)
                .stream()
                .filter(metricsPacket -> metricsPacket.consumers().contains(consumer))
                .toList();
    }
Generates metrics values in json format for the metrics/v1 rest api.

@author gjoranv
metrics-proxy/src/main/java/ai/vespa/metricsproxy/http/ValuesFetcher.java