Class ExemplarConfig


  • public class ExemplarConfig
    extends java.lang.Object
    Static configuration for Exemplar behavior.
    • Field Detail

      • enabled

        private static volatile boolean enabled
    • Constructor Detail

      • ExemplarConfig

        public ExemplarConfig()
    • 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 an ExemplarSampler by default.

        You can still enable individual metrics to load exemplars from an ExemplarSampler by calling the metric builder's withExemplars() 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 an ExemplarSampler by default.

        You can still disallow individual metrics to load exemplars from an ExemplarSampler by calling the metric builder's withoutExemplars() method.

        Exemplars are enabled by default. This method is here so that you can temporarily disableExemplars() and then enableExemplars() again.

      • isExemplarsEnabled

        public static boolean isExemplarsEnabled()
        Returns:
        true by default, false if disableExemplars() was called.