Package io.prometheus.client
Class Histogram.Builder
- java.lang.Object
-
- io.prometheus.client.SimpleCollector.Builder<Histogram.Builder,Histogram>
-
- io.prometheus.client.Histogram.Builder
-
- Enclosing class:
- Histogram
public static class Histogram.Builder extends SimpleCollector.Builder<Histogram.Builder,Histogram>
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Histogram.Builder
buckets(double... buckets)
Set the upper bounds of buckets for the histogram.Histogram
create()
Return the constructed collector.Histogram.Builder
exponentialBuckets(double start, double factor, int count)
Set the upper bounds of buckets for the histogram with an exponential sequence.Histogram.Builder
linearBuckets(double start, double width, int count)
Set the upper bounds of buckets for the histogram with a linear sequence.Histogram.Builder
withExemplars()
Allow this histogram to load exemplars from aHistogramExemplarSampler
.Histogram.Builder
withExemplarSampler(HistogramExemplarSampler exemplarSampler)
Enable exemplars and provide a customHistogramExemplarSampler
.Histogram.Builder
withoutExemplars()
Prevent this histogram from loading exemplars from aHistogramExemplarSampler
.-
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 Histogram create()
Description copied from class:SimpleCollector.Builder
Return the constructed collector.Abstract due to generics limitations.
- Specified by:
create
in classSimpleCollector.Builder<Histogram.Builder,Histogram>
-
buckets
public Histogram.Builder buckets(double... buckets)
Set the upper bounds of buckets for the histogram.
-
linearBuckets
public Histogram.Builder linearBuckets(double start, double width, int count)
Set the upper bounds of buckets for the histogram with a linear sequence.
-
exponentialBuckets
public Histogram.Builder exponentialBuckets(double start, double factor, int count)
Set the upper bounds of buckets for the histogram with an exponential sequence.
-
withExemplarSampler
public Histogram.Builder withExemplarSampler(HistogramExemplarSampler exemplarSampler)
Enable exemplars and provide a customHistogramExemplarSampler
.
-
withExemplars
public Histogram.Builder withExemplars()
Allow this histogram to load exemplars from aHistogramExemplarSampler
.If a specific exemplar sampler is configured for this histogram that exemplar sampler is used (see
withExemplarSampler(HistogramExemplarSampler)
). Otherwise the default fromExemplarConfig
is used.
-
withoutExemplars
public Histogram.Builder withoutExemplars()
Prevent this histogram from loading exemplars from aHistogramExemplarSampler
.You can still provide exemplars for explicitly individual observations, e.g. using
Histogram.observeWithExemplar(double, String...)
.
-
-