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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double[]
private HistogramExemplarSampler
private Boolean
Fields inherited from class io.prometheus.client.SimpleCollector.Builder
dontInitializeNoLabelsChild, fullname, help, labelNames, name, namespace, subsystem, unit
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuckets
(double... buckets) Set the upper bounds of buckets for the histogram.create()
Return the constructed collector.exponentialBuckets
(double start, double factor, int count) Set the upper bounds of buckets for the histogram with an exponential sequence.linearBuckets
(double start, double width, int count) Set the upper bounds of buckets for the histogram with a linear sequence.Allow this histogram to load exemplars from aHistogramExemplarSampler
.withExemplarSampler
(HistogramExemplarSampler exemplarSampler) Enable exemplars and provide a customHistogramExemplarSampler
.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
-
Field Details
-
exemplarsEnabled
-
exemplarSampler
-
buckets
private double[] buckets
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
Set the upper bounds of buckets for the histogram. -
linearBuckets
Set the upper bounds of buckets for the histogram with a linear sequence. -
exponentialBuckets
Set the upper bounds of buckets for the histogram with an exponential sequence. -
withExemplarSampler
Enable exemplars and provide a customHistogramExemplarSampler
. -
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
Prevent this histogram from loading exemplars from aHistogramExemplarSampler
.You can still provide exemplars for explicitly individual observations, e.g. using
Histogram.observeWithExemplar(double, String...)
.
-