Package io.prometheus.client
Class Counter.Builder
- java.lang.Object
-
- io.prometheus.client.SimpleCollector.Builder<Counter.Builder,Counter>
-
- io.prometheus.client.Counter.Builder
-
- Enclosing class:
- Counter
public static class Counter.Builder extends SimpleCollector.Builder<Counter.Builder,Counter>
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Countercreate()Return the constructed collector.Counter.BuilderwithExemplars()Allow this counter to load exemplars from aCounterExemplarSampler.Counter.BuilderwithExemplarSampler(CounterExemplarSampler exemplarSampler)Enable exemplars and provide a customCounterExemplarSampler.Counter.BuilderwithoutExemplars()Prevent this counter from loading exemplars from aCounterExemplarSampler.-
Methods inherited from class io.prometheus.client.SimpleCollector.Builder
help, labelNames, name, namespace, register, register, subsystem, unit
-
-
-
-
Constructor Detail
-
Builder
public Builder()
-
-
Method Detail
-
create
public Counter create()
Description copied from class:SimpleCollector.BuilderReturn the constructed collector.Abstract due to generics limitations.
- Specified by:
createin classSimpleCollector.Builder<Counter.Builder,Counter>
-
withExemplarSampler
public Counter.Builder withExemplarSampler(CounterExemplarSampler exemplarSampler)
Enable exemplars and provide a customCounterExemplarSampler.
-
withExemplars
public Counter.Builder withExemplars()
Allow this counter to load exemplars from aCounterExemplarSampler.If a specific exemplar sampler is configured for this counter that exemplar sampler is used (see
withExemplarSampler(CounterExemplarSampler)). Otherwise the default fromExemplarConfigis used.
-
withoutExemplars
public Counter.Builder withoutExemplars()
Prevent this counter from loading exemplars from aCounterExemplarSampler.You can still provide exemplars for explicitly individual observations, e.g. using
Counter.incWithExemplar(double, String...).
-
-