SamplerGaugeCollector
class SamplerGaugeCollector(name: String, help: String, labelNames: List<String> = emptyList(), labelValues: List<String> = emptyList(), data: () -> Double) : Collector
A Prometheus Collector that exposes a gauge metric whose value is obtained by invoking a sampling function on each collection cycle.
The collector automatically registers itself with the default collector registry upon construction.
Parameters
name
the metric name.
help
the help/description text for the metric.
labelNames
the label names for the metric. Defaults to empty.
labelValues
the label values corresponding to labelNames. Defaults to empty.
data
a lambda that returns the current gauge value as a Double.