All Implemented Interfaces:
HttpFeature, ServerLifecycle, FeatureSupport, Supplier<HttpFeature>

public class MicrometerFeature extends HelidonFeatureSupport
Implements simple Micrometer support.

Developers create Micrometer MeterRegistry objects and enroll them with MicrometerFeature.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 Details

    • builder

      public static MicrometerFeature.Builder builder()
      Fluid builder for MicrometerSupport.
    • create

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

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

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

      protected void postSetup(HttpRouting.Builder defaultRouting, HttpRouting.Builder featureRouting)
      Description copied from class: HelidonFeatureSupport
      This can be used to register services, filters etc. on either the default rules (usually the main routing of the web server) and the feature routing (may be the same instance). If FeatureSupport.service() provides an instance, that instance will be correctly registered with the context root on feature routing.
      postSetup in class HelidonFeatureSupport
      defaultRouting - default HttpRules to be updated
      featureRouting - actual rules (if different from the default ones) to be updated for the service endpoint
    • beforeStart

      public void beforeStart()
      Description copied from interface: ServerLifecycle
      Before server start.