private HttpResponse valuesResponse(String consumer) {
        try {
            List<MetricsPacket> metrics = processAndBuild(valuesFetcher.fetchMetricsAsBuilders(consumer),
                                                          new ServiceIdDimensionProcessor(),
                                                          new ClusterIdDimensionProcessor(),
                                                          new PublicDimensionsProcessor());

            Node localNode = new Node(nodeInfoConfig.role(), nodeInfoConfig.hostname(), 0, "");
            Map<Node, List<MetricsPacket>> metricsByNode = Map.of(localNode, metrics);
            return new MetricsJsonResponse(OK, toGenericApplicationModel(metricsByNode)::serialize);
        } catch (Exception e) {
            log.log(Level.WARNING, "Got exception when rendering metrics:", e);
            return new ErrorResponse(INTERNAL_SERVER_ERROR, e.getMessage());
        }
    }
Http handler for the metrics/v2 rest api.

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