public void stop() {
        metrics.close();
        LOG.debug("Unregistering Connect metrics with JMX for worker '{}'", workerId);
        AppInfoParser.unregisterAppInfo(JMX_PREFIX, workerId, metrics);
    }
Stop and unregister the metrics from any reporters.
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/ConnectMetrics.java