public void setExtraMetrics(List<MetricsPacket.Builder> externalPackets) {
        // TODO: Metrics filtering per consumer is not yet implemented.
        //       Split each packet per metric, and re-aggregate based on the metrics each consumer wants.
        //       Then filter out all packages with no consumers.
        log.log(FINE, () -> "Setting new external metrics with " + externalPackets.size() + " metrics packets.");
        externalPackets.forEach(packet -> packet.addConsumers(consumers.getAllConsumers())
                .retainMetrics(metricsToRetain())
                .applyOutputNames(outputNamesById()));
        metrics = List.copyOf(externalPackets);
    }
Handling of metrics received from external processes.

@author gjoranv
metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/ExternalMetrics.java