public synchronized boolean hasMetrics() {
        return !metrics.isEmpty();
    }
Return if metrics were registered with this sensor.

@return true if metrics were registered, false otherwise
clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java