public Set<ThreadMetadata> metadataForLocalThreads() {
        final Set<ThreadMetadata> threadMetadata = new HashSet<>();
        processStreamThread(thread -> {
            synchronized (thread.getStateLock()) {
                if (thread.state() != StreamThread.State.DEAD) {
                    threadMetadata.add(thread.threadMetadata());
                }
            }
        });
        return threadMetadata;
    }
Returns runtime information about the local threads of this {@link KafkaStreams} instance.

@return the set of {@link ThreadMetadata}.
streams/src/main/java/org/apache/kafka/streams/KafkaStreams.java