Interface MetricsObserverConfig

All Superinterfaces:
ObserverConfigBase, Prototype.Api, Prototype.Factory<MetricsObserver>
All Known Implementing Classes:
MetricsObserverConfig.BuilderBase.MetricsObserverConfigImpl

public interface MetricsObserverConfig extends Prototype.Api, ObserverConfigBase
Metrics Observer configuration.
See Also:
  • Method Details

    • builder

      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static MetricsObserverConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static MetricsObserverConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • endpoint

      String endpoint()
    • name

      String name()
    • metricsConfig

      MetricsConfig metricsConfig()
      Assigns MetricsSettings which will be used in creating the MetricsSupport instance at build-time.
      Returns:
      the metrics settings to assign for use in building the MetricsSupport instance
    • meterRegistry

      Optional<MeterRegistry> meterRegistry()
      If you want to have multiple meter registries with different endpoints, you may create them using
           MeterRegistry meterRegistry = MetricsFactory.getInstance()
                   .createMeterRegistry(metricsConfig);
           MetricsFeature.builder()
                   .meterRegistry(meterRegistry) // further settings on the feature builder, etc.
      
      where metricsConfig in each case has different settings.

      If this method is not called, MetricsFeature would use the shared instance as provided by MetricsFactory.globalRegistry().

      Returns:
      meterRegistry to use in this metric support
    • enabled

      boolean enabled()
      Whether this observer is enabled.
      Returns:
      false to disable observer