public boolean isMatch(Map<String, Pattern> patterns) {
        if (!patterns.isEmpty()) {
            return matchPatterns(patterns);
        }
        // Empty pattern is still considered as a match.
        return true;
    }
Information from the client's metadata is gathered from the client's request.
server/src/main/java/org/apache/kafka/server/metrics/ClientMetricsInstanceMetadata.java