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 Counter
create()
Return the constructed collector.Counter.Builder
withExemplars()
Allow this counter to load exemplars from aCounterExemplarSampler
.Counter.Builder
withExemplarSampler(CounterExemplarSampler exemplarSampler)
Enable exemplars and provide a customCounterExemplarSampler
.Counter.Builder
withoutExemplars()
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.Builder
Return the constructed collector.Abstract due to generics limitations.
- Specified by:
create
in 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 fromExemplarConfig
is 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...)
.
-
-