Class PrometheusStatsCollector
java.lang.Object
io.prometheus.client.Collector
io.opencensus.exporter.stats.prometheus.PrometheusStatsCollector
- All Implemented Interfaces:
io.prometheus.client.Collector.Describable
public final class PrometheusStatsCollector
extends io.prometheus.client.Collector
implements io.prometheus.client.Collector.Describable
OpenCensus Metrics
Collector for Prometheus.- Since:
- 0.12
-
Nested Class Summary
Nested classes/interfaces inherited from class io.prometheus.client.Collector
io.prometheus.client.Collector.Describable, io.prometheus.client.Collector.MetricFamilySamples, io.prometheus.client.Collector.Type -
Field Summary
Fields inherited from class io.prometheus.client.Collector
MILLISECONDS_PER_SECOND, NANOSECONDS_PER_SECOND -
Method Summary
Modifier and TypeMethodDescriptionList<io.prometheus.client.Collector.MetricFamilySamples> collect()static voidCreates aPrometheusStatsCollectorand registers it to PrometheusCollectorRegistry.defaultRegistry.static voidcreateAndRegister(PrometheusStatsConfiguration configuration) Creates aPrometheusStatsCollectorand registers it to the given PrometheusCollectorRegistryin thePrometheusStatsConfiguration.List<io.prometheus.client.Collector.MetricFamilySamples> describe()Methods inherited from class io.prometheus.client.Collector
checkMetricLabelName, checkMetricName, collect, doubleToGoString, register, register, sanitizeMetricName
-
Method Details
-
createAndRegister
public static void createAndRegister()Creates aPrometheusStatsCollectorand registers it to PrometheusCollectorRegistry.defaultRegistry.This is equivalent with:
PrometheusStatsCollector.createAndRegister(PrometheusStatsConfiguration.builder().build());- Throws:
IllegalArgumentException- if aPrometheusStatsCollectorhas already been created and registered.- Since:
- 0.12
-
createAndRegister
Creates aPrometheusStatsCollectorand registers it to the given PrometheusCollectorRegistryin thePrometheusStatsConfiguration.If
CollectorRegistryof the configuration is not set, the collector will useCollectorRegistry.defaultRegistry.- Throws:
IllegalArgumentException- if aPrometheusStatsCollectorhas already been created and registered.- Since:
- 0.13
-
collect
- Specified by:
collectin classio.prometheus.client.Collector
-
describe
- Specified by:
describein interfaceio.prometheus.client.Collector.Describable
-