void doClose() {
        try {
            close();
        } catch (Throwable t) {
            log.error("{} Task threw an uncaught and unrecoverable exception during shutdown", this, t);
            throw t;
        } finally {
            Utils.closeQuietly(transformationChain, "transformation chain");
            Utils.closeQuietly(retryWithToleranceOperator, "retry operator");
        }
    }
Remove all metrics published by this task.
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java