InstrumentedThreadFactory

A ThreadFactory decorator that instruments thread lifecycle with Prometheus metrics.

Tracks the number of threads created (counter), currently running (gauge), and terminated (counter).

Parameters

delegate

the underlying ThreadFactory to delegate thread creation to.

name

the base name for the Prometheus metrics (suffixed with _threads_created, _threads_running, _threads_terminated).

help

the base help text for the Prometheus metrics.

Constructors

Link copied to clipboard
constructor(delegate: ThreadFactory, name: String, help: String)

Functions

Link copied to clipboard
open override fun newThread(runnable: Runnable): Thread