Package io.prometheus.client.exemplars
Class ExemplarConfig
- java.lang.Object
-
- io.prometheus.client.exemplars.ExemplarConfig
-
public class ExemplarConfig extends java.lang.ObjectStatic configuration for Exemplar behavior.
-
-
Field Summary
Fields Modifier and Type Field Description private static CounterExemplarSamplercounterExemplarSamplerprivate static booleanenabledprivate static HistogramExemplarSamplerhistogramExemplarSampler
-
Constructor Summary
Constructors Constructor Description ExemplarConfig()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddisableExemplars()Prevent metrics from loading exemplars from anExemplarSamplerby default.static voidenableExemplars()Allow metrics to load exemplars from anExemplarSamplerby default.static CounterExemplarSamplergetCounterExemplarSampler()static HistogramExemplarSamplergetHistogramExemplarSampler()static booleanisExemplarsEnabled()static voidsetCounterExemplarSampler(CounterExemplarSampler counterExemplarSampler)Set the default exemplar sampler for Counters.static voidsetHistogramExemplarSampler(HistogramExemplarSampler histogramExemplarSampler)Set the default exemplar sampler for Histograms.
-
-
-
Field Detail
-
enabled
private static volatile boolean enabled
-
histogramExemplarSampler
private static volatile HistogramExemplarSampler histogramExemplarSampler
-
counterExemplarSampler
private static volatile CounterExemplarSampler counterExemplarSampler
-
-
Method Detail
-
setCounterExemplarSampler
public static void setCounterExemplarSampler(CounterExemplarSampler counterExemplarSampler)
Set the default exemplar sampler for Counters.
-
setHistogramExemplarSampler
public static void setHistogramExemplarSampler(HistogramExemplarSampler histogramExemplarSampler)
Set the default exemplar sampler for Histograms.
-
disableExemplars
public static void disableExemplars()
Prevent metrics from loading exemplars from anExemplarSamplerby default.You can still enable individual metrics to load exemplars from an
ExemplarSamplerby calling the metric builder'swithExemplars()method, and you can still provide single exemplars explicitly for individual observations with the...withExemplar()methods.
-
enableExemplars
public static void enableExemplars()
Allow metrics to load exemplars from anExemplarSamplerby default.You can still disallow individual metrics to load exemplars from an
ExemplarSamplerby calling the metric builder'swithoutExemplars()method.Exemplars are enabled by default. This method is here so that you can temporarily
disableExemplars()and thenenableExemplars()again.
-
getCounterExemplarSampler
public static CounterExemplarSampler getCounterExemplarSampler()
- Returns:
- the
CounterExemplarSamplerthat is used by default inCountermetrics.
-
getHistogramExemplarSampler
public static HistogramExemplarSampler getHistogramExemplarSampler()
- Returns:
- the
HistogramExemplarSamplerthat is used by default inHistogrammetrics.
-
isExemplarsEnabled
public static boolean isExemplarsEnabled()
- Returns:
- true by default, false if
disableExemplars()was called.
-
-