class NamedDaemonThreadFactory implements ThreadFactory {

    private static final AtomicInteger POOL_NUMBER = new AtomicInteger(1);
    private final int poolNumber = POOL_NUMBER.getAndIncrement();
    private final AtomicInteger threadNumber = new AtomicInteger(1);
    private final ThreadFactory delegate;
    private final boolean daemon;

    NamedDaemonThreadFactory(ThreadFactory delegate, boolean daemon) {
        this.delegate = delegate;
        this.daemon = daemon;
    }

    @Override
    public Thread newThread(Runnable r) {<FILL_FUNCTION_BODY>}

    static ThreadFactory defaultThreadFactory(boolean daemon) {
        return new NamedDaemonThreadFactory(Executors.defaultThreadFactory(), daemon);
    }
}

        Thread t = delegate.newThread(r);
        t.setName(String.format("prometheus-http-%d-%d", poolNumber, threadNumber.getAndIncrement()));
        t.setDaemon(daemon);
        return t;
    
<no_super_class>