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 ClassesModifier and TypeClassDescriptionprivate static final classprivate static final classNested 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
FieldsModifier and TypeFieldDescriptionprivate final MetricReaderprivate static final Stringprivate final MetricReaderprivate static final Stringprivate static final Loggerprivate final Stringprivate static final TracerFields inherited from class io.prometheus.client.Collector
MILLISECONDS_PER_SECOND, NANOSECONDS_PER_SECOND -
Constructor Summary
ConstructorsConstructorDescriptionPrometheusStatsCollector(MetricProducerManager metricProducerManager, String namespace) -
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()private static StringMethods inherited from class io.prometheus.client.Collector
checkMetricLabelName, checkMetricName, collect, doubleToGoString, register, register, sanitizeMetricName
-
Field Details
-
logger
-
tracer
-
DESCRIBE_METRICS_FOR_PROMETHEUS
- See Also:
-
EXPORT_METRICS_TO_PROMETHEUS
- See Also:
-
collectMetricReader
-
describeMetricReader
-
namespace
-
-
Constructor Details
-
PrometheusStatsCollector
PrometheusStatsCollector(MetricProducerManager metricProducerManager, String namespace)
-
-
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
-
exceptionMessage
-