public static Map<String, String> getTags(String... keyValue) {
        if ((keyValue.length % 2) != 0)
            throw new IllegalArgumentException("keyValue needs to be specified in pairs");
        Map<String, String> tags = new LinkedHashMap<>(keyValue.length / 2);

        for (int i = 0; i < keyValue.length; i += 2)
            tags.put(keyValue[i], keyValue[i + 1]);
        return tags;
    }
Create a set of tags using the supplied key and value pairs. The order of the tags will be kept.

@param keyValue the key and value pairs for the tags; must be an even number
@return the map of tags that can be supplied to the {@link Metrics} methods; never null
clients/src/main/java/org/apache/kafka/common/metrics/internals/MetricsUtils.java