Package io.prometheus.client
Class SimpleCollector.Builder<B extends SimpleCollector.Builder<B,C>,C extends SimpleCollector>
java.lang.Object
io.prometheus.client.SimpleCollector.Builder<B,C>
- Direct Known Subclasses:
Counter.Builder
,Gauge.Builder
,Histogram.Builder
,Summary.Builder
- Enclosing class:
SimpleCollector<Child>
public abstract static class SimpleCollector.Builder<B extends SimpleCollector.Builder<B,C>,C extends SimpleCollector>
extends Object
Builders let you configure and then create collectors.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract C
create()
Return the constructed collector.Set the help string of the metric.labelNames
(String... labelNames) Set the labelNames of the metric.Set the name of the metric.Set the namespace of the metric.register()
Create and register the Collector with the default registry.register
(CollectorRegistry registry) Create and register the Collector with the given registry.Set the subsystem of the metric.
-
Field Details
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Set the name of the metric. Required. -
subsystem
Set the subsystem of the metric. Optional. -
namespace
Set the namespace of the metric. Optional. -
help
Set the help string of the metric. Required. -
labelNames
Set the labelNames of the metric. Optional, defaults to no labels. -
create
Return the constructed collector.Abstract due to generics limitations.
-
register
Create and register the Collector with the default registry. -
register
Create and register the Collector with the given registry.
-