public final class PrometheusStatsCollector
extends io.prometheus.client.Collector
implements io.prometheus.client.Collector.Describable
Collector for Prometheus.| Modifier and Type | Method and Description |
|---|---|
List<io.prometheus.client.Collector.MetricFamilySamples> |
collect() |
static void |
createAndRegister()
Creates a
PrometheusStatsCollector and registers it to Prometheus CollectorRegistry.defaultRegistry. |
static void |
createAndRegister(PrometheusStatsConfiguration configuration)
Creates a
PrometheusStatsCollector and registers it to the given Prometheus CollectorRegistry in the PrometheusStatsConfiguration. |
List<io.prometheus.client.Collector.MetricFamilySamples> |
describe() |
public static void createAndRegister()
PrometheusStatsCollector and registers it to Prometheus CollectorRegistry.defaultRegistry.
This is equivalent with:
PrometheusStatsCollector.createAndRegister(PrometheusStatsConfiguration.builder().build());
IllegalArgumentException - if a PrometheusStatsCollector has already been created
and registered.public static void createAndRegister(PrometheusStatsConfiguration configuration)
PrometheusStatsCollector and registers it to the given Prometheus CollectorRegistry in the PrometheusStatsConfiguration.
If CollectorRegistry of the configuration is not set, the collector will use CollectorRegistry.defaultRegistry.
IllegalArgumentException - if a PrometheusStatsCollector has already been created
and registered.public List<io.prometheus.client.Collector.MetricFamilySamples> collect()
collect in class io.prometheus.client.Collectorpublic List<io.prometheus.client.Collector.MetricFamilySamples> describe()
describe in interface io.prometheus.client.Collector.Describable