public static Map<DimensionId, String> extractConfigserverDimensions(Collection<MetricsPacket.Builder> packets) {
        Map<DimensionId, String> dimensions = new HashMap<>();
        for (MetricsPacket.Builder packet : packets) {
            dimensions.putAll(packet.build().dimensions());
        }
        dimensions.keySet().retainAll(Set.of(ROLE_DIMENSION, STATE_DIMENSION));
        return dimensions;
    }
Extracts the node repository dimensions (role, state etc.) from the given packets.
If the same dimension exists in multiple packets, this implementation gives no guarantees
about which value is returned.
metrics-proxy/src/main/java/ai/vespa/metricsproxy/metric/ExternalMetrics.java