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
,Enumeration.Builder
,Gauge.Builder
,Histogram.Builder
,Info.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.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract C
create()
Return the constructed collector.B
help(String help)
Set the help string of the metric.B
labelNames(String... labelNames)
Set the labelNames of the metric.B
name(String name)
Set the name of the metric.B
namespace(String namespace)
Set the namespace of the metric.C
register()
Create and register the Collector with the default registry.C
register(CollectorRegistry registry)
Create and register the Collector with the given registry.B
subsystem(String subsystem)
Set the subsystem of the metric.B
unit(String unit)
Set the unit of the metric.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
-
Method Detail
-
labelNames
public B labelNames(String... labelNames)
Set the labelNames of the metric. Optional, defaults to no labels.
-
create
public abstract C create()
Return the constructed collector.Abstract due to generics limitations.
-
register
public C register(CollectorRegistry registry)
Create and register the Collector with the given registry.
-
-