public synchronized void close() {
            for (String sensorName : sensorNames) {
                metrics.removeSensor(sensorName);
            }
            sensorNames.clear();
            for (MetricName metricName : new HashSet<>(metrics.metrics().keySet())) {
                if (groupId.includes(metricName)) {
                    metrics.removeMetric(metricName);
                }
            }
        }
Remove all sensors and metrics associated with this group.
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/ConnectMetrics.java