Because reactive streams usually operate on different reactor schedulers, it may be beneficial to track fine-grained metrics regarding their operation. In some cases, it is plausible to use a custom ScheduledThreadPoolExecutor with a manual metric instrumentation. For example, let's assume we have the following class:
public class MeteredScheduledThreadPoolExecutor extends ScheduledThreadPoolExecutor { // (1) public MeteredScheduledThreadPoolExecutorShort( int corePoolSize, MeterRegistry registry // (2) ) { super(corePoolSize); registry.gauge("pool.core.size", this.getCorePoolSize()); // (3) registry.gauge("pool.active.tasks", this.getActiveCount()); // registry.gauge("pool.queue.size", this.getQueue().size ...