InstrumentedThreadFactory
A ThreadFactory decorator that instruments thread lifecycle with Prometheus metrics.
Tracks the number of threads created (counter), currently running (gauge), and terminated (counter). The exposed series are <name>_threads_created_total, <name>_threads_running and <name>_threads_terminated_total. In the Prometheus text format the counter families are also named with _total; in OpenMetrics they are named <name>_threads_created and <name>_threads_terminated. The counters' _created timestamp series are written only when the exporter enables created timestamps (io.prometheus.exporter.include_created_timestamps), which is off by default.
Parameters
the underlying ThreadFactory to delegate thread creation to.
the base name for the Prometheus metrics (see above for the series names).
the base help text for the Prometheus metrics.
the registry to register the metrics with. Defaults to PrometheusRegistry.defaultRegistry; factories with the same name need separate registries.
Throws
if one of the metric names is already registered in registry. None of the three metrics is left registered in that case.