PrometheusDsl
Provides a Kotlin DSL for building and registering Prometheus metric collectors.
Each factory function builds the metric with X.builder(), applies the configuration lambda to that Prometheus Java client 1.x builder, and registers the metric with the given PrometheusRegistry, which defaults to PrometheusRegistry.defaultRegistry.
The receivers are the 1.x builders from io.prometheus.metrics.core.metrics: label names are declared with labelNames(...) and a labelled child is reached with labelValues(...) on the returned metric. The builders have no namespace() or subsystem(), so put the full name in name(...). A counter is exposed as <name>_total whether or not name already ends in _total.
Registration fails with IllegalArgumentException when the registry already holds a metric whose exposed series names collide with the new one (for example the same name and label names, or a counter x and a gauge x_total).