Interface MetricsFactoryProvider

All Known Implementing Classes:
MicrometerMetricsFactoryProvider

public interface MetricsFactoryProvider
Creates new instances of MetricsFactory.
  • Method Details

    • create

      MetricsFactory create(Config rootConfig, MetricsConfig metricsConfig, Collection<MetersProvider> metersProviders)
      Creates a new MetricsFactory from which the caller can obtain MeterRegistry and Meter.Builder instances.

      The metricsConfig parameter will have been derived from the rootConfig. In many cases the new factory will only need to know the metrics configuration so that object is provided as a convenience. The root config node allows the factory to use information from elsewhere in the config tree if needed.

      API Note: the default method implementation is provided for backward compatibility and will be removed in the next major version

      Parameters:
      rootConfig - root Config node
      metricsConfig - MetricsConfig settings
      metersProviders - group of MetersProvider which can furnish Meter.Builder instances
      Returns:
      new metrics factory
      Since:
      4.4.0
    • create

      default MetricsFactory create(Config rootConfig, MetricsConfig metricsConfig, Collection<MetersProvider> metersProviders, ServiceRegistry serviceRegistry)
      Creates a new metrics factory using services from the registry which owns the factory.
      Parameters:
      rootConfig - root config node
      metricsConfig - metrics settings
      metersProviders - providers of built-in meters
      serviceRegistry - service registry which owns the new factory
      Returns:
      new metrics factory
    • close

      @Deprecated(since="27.0.0", forRemoval=true) default void close()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 27.0.0, for removal. Metrics factory lifecycle is managed by the service registry.
      No-op retained for compatibility. Service registries own and close the metrics factories they create.