private HttpResponse applicationPrometheusResponse(String requestedConsumer) {
        ConsumerId consumer = getConsumerOrDefault(requestedConsumer, metricsConsumers);
        var metricsByNode = metricsRetriever.getMetrics(consumer);


        List<GenericJsonModel> genericNodes = toGenericApplicationModel(metricsByNode).nodes;
        List<MetricsPacket> metricsForAllNodes = genericNodes.stream()
                .flatMap(element -> toMetricsPackets(element)
                        .stream()
                        .map(builder -> builder.putDimension(DimensionId.toDimensionId("hostname"), element.hostname))
                        .map(MetricsPacket.Builder::build))
                .toList();
        return new PrometheusResponse(200, toPrometheusModel(metricsForAllNodes, applicationDimensions, nodeDimensions));
    }
Http handler that returns metrics for all nodes in the Vespa application.

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