private Optional<MetricsPacket.Builder> getSystemMetrics(VespaService service) {
        Metrics systemMetrics = service.getSystemMetrics();
        if (systemMetrics.size() == 0) return Optional.empty();

        MetricsPacket.Builder builder = new MetricsPacket.Builder(service.getMonitoringName());
        setMetaInfo(builder, systemMetrics.getTimeStamp());

        builder.putDimension(METRIC_TYPE_DIMENSION_ID, "system")
                .putDimension(INSTANCE_DIMENSION_ID, service.getInstanceName())
                .putDimensions(service.getDimensions())
                .putMetrics(systemMetrics.list());

        builder.addConsumers(metricsConsumers.getAllConsumers());
        return Optional.of(builder);
    }
Returns the metrics to output for the given service, with updated timestamp
In order to include a metric, it must exist in the given map of metric to consumers.
Each returned metric will contain a collection of consumers that it should be routed to.
metrics-proxy/src/main/java/ai/vespa/metricsproxy/core/VespaMetrics.java