PrometheusDsl

Provides a Kotlin DSL for building and registering Prometheus metric collectors.

Each factory function accepts a configuration lambda for the metric's builder and automatically registers the metric with the default Prometheus io.prometheus.client.CollectorRegistry.

Functions

Link copied to clipboard
fun counter(block: Counter.Builder.() -> Unit): Counter

Creates, configures, and registers a Prometheus Counter.

Link copied to clipboard
fun gauge(block: Gauge.Builder.() -> Unit): Gauge

Creates, configures, and registers a Prometheus Gauge.

Link copied to clipboard
fun histogram(block: Histogram.Builder.() -> Unit): Histogram

Creates, configures, and registers a Prometheus Histogram.

Link copied to clipboard
fun summary(block: Summary.Builder.() -> Unit): Summary

Creates, configures, and registers a Prometheus Summary.