Class MicrometerSupport

  • All Implemented Interfaces:
    RestServiceSupport, Service

    public class MicrometerSupport
    extends HelidonRestServiceSupport
    Implements simple Micrometer support.

    Developers create Micrometer MeterRegistry objects and enroll them with MicrometerSupport.Builder, providing with each enrollment a Helidon Handler for expressing the registry's data in an HTTP response.

    Alternatively, developers can enroll any of the built-in registries represented by the MeterRegistryFactory.BuiltInRegistryType enum.

    Having enrolled Micrometer meter registries with MicrometerSupport.Builder and built the MicrometerSupport object, developers can invoke the registry() method and use the returned MeterRegistry to create or locate meters.

    • Method Detail

      • create

        public static MicrometerSupport create()
        Creates a new MicrometerSupport using default settings.
        Returns:
        default MicrometerSupport
      • create

        public static MicrometerSupport create​(Config config)
        Creates a new MicrometerSupport using the provided Config (anchored at the "metrics.micrometer" node).
        Parameters:
        config - Config settings for Micrometer set-up
        Returns:
        newly-created MicrometerSupport
      • registry

        public io.micrometer.core.instrument.MeterRegistry registry()
        Returns the composite registry so apps can create and register meters on it.
        Returns:
        the composite registry
      • update

        public void update​(Routing.Rules rules)
        Description copied from interface: Service
        Updates Routing.Rules with handlers representing this service.
        Parameters:
        rules - a routing rules to update
      • postConfigureEndpoint

        protected void postConfigureEndpoint​(Routing.Rules defaultRules,
                                             Routing.Rules serviceEndpointRoutingRules)
        Description copied from class: HelidonRestServiceSupport
        Concrete implementations override this method to perform any service-specific routing set-up.
        Specified by:
        postConfigureEndpoint in class HelidonRestServiceSupport
        Parameters:
        defaultRules - default Routing.Rules to be updated
        serviceEndpointRoutingRules - actual rules (if different from the default ones) to be updated for the service endpoint