Class MeterRegistry.Config

  • Enclosing class:
    MeterRegistry

    public class MeterRegistry.Config
    extends java.lang.Object
    Access to configuration options for this registry.
    • Constructor Detail

      • Config

        public Config()
    • Method Detail

      • commonTags

        public MeterRegistry.Config commonTags​(java.lang.Iterable<Tag> tags)
        Append a list of common tags to apply to all metrics reported to the monitoring system.
        Parameters:
        tags - Tags to add to every metric.
        Returns:
        This configuration instance.
      • commonTags

        public MeterRegistry.Config commonTags​(java.lang.String... tags)
        Append a list of common tags to apply to all metrics reported to the monitoring system. Must be an even number of arguments representing key/value pairs of tags.
        Parameters:
        tags - MUST be an even number of arguments representing key/value pairs of tags.
        Returns:
        This configuration instance.
      • meterFilter

        public MeterRegistry.Config meterFilter​(MeterFilter filter)
        Add a meter filter to the registry. Filters are applied in the order in which they are added.
        Parameters:
        filter - The filter to add to the registry.
        Returns:
        This configuration instance.
      • onMeterAdded

        public MeterRegistry.Config onMeterAdded​(java.util.function.Consumer<Meter> meter)
        Register an event listener for each meter added to the registry.
        Parameters:
        meter - The meter that has just been added
        Returns:
        This configuration instance.
      • onMeterRemoved

        @Incubating(since="1.1.0")
        public MeterRegistry.Config onMeterRemoved​(java.util.function.Consumer<Meter> meter)
        Register an event listener for each meter removed from the registry.
        Parameters:
        meter - The meter that has just been added
        Returns:
        This configuration instance.
        Since:
        1.1.0
      • namingConvention

        public MeterRegistry.Config namingConvention​(NamingConvention convention)
        Use the provided naming convention, overriding the default for your monitoring system.
        Parameters:
        convention - The naming convention to use.
        Returns:
        This configuration instance.
      • namingConvention

        public NamingConvention namingConvention()
        Returns:
        The naming convention currently in use on this registry.
      • clock

        public Clock clock()
        Returns:
        The clock used to measure durations of timers and long task timers (and sometimes influences publishing behavior).
      • pauseDetector

        public PauseDetector pauseDetector()
        Returns:
        The pause detector that is currently in effect.