@Override
    public void metricRemoval(KafkaMetric metric) {
        synchronized (LOCK) {
            MetricName metricName = metric.metricName();
            String mBeanName = getMBeanName(prefix, metricName);
            KafkaMbean mbean = removeAttribute(metric, mBeanName);
            if (mbean != null) {
                if (mbean.metrics.isEmpty()) {
                    unregister(mbean);
                    mbeans.remove(mBeanName);
                } else if (mbeanPredicate.test(mBeanName))
                    reregister(mbean);
            }
        }
    }
Create a JMX reporter that prefixes all metrics with the given string.
 @deprecated Since 2.6.0. Use {@link JmxReporter#JmxReporter()}
 Initialize JmxReporter with {@link JmxReporter#contextChange(MetricsContext)}
 Populate prefix by adding _namespace/prefix key value pair to {@link MetricsContext}
clients/src/main/java/org/apache/kafka/common/metrics/JmxReporter.java