Class MicrometerMetricsFactory

java.lang.Object
io.vertx.micrometer.MicrometerMetricsFactory
All Implemented Interfaces:
VertxMetricsFactory, VertxServiceProvider

public class MicrometerMetricsFactory extends Object implements VertxMetricsFactory
The micrometer metrics registry.
Author:
Joel Takvorian
  • Constructor Details

    • MicrometerMetricsFactory

      public MicrometerMetricsFactory()
    • MicrometerMetricsFactory

      public MicrometerMetricsFactory(io.micrometer.core.instrument.MeterRegistry micrometerRegistry)
      Build a factory passing the Micrometer MeterRegistry to be used by Vert.x. This is useful in several scenarios, such as:
      • if there is already a MeterRegistry used in the application that should be used by Vert.x as well.
      • to define some backend configuration that is not covered in this module (example: reporting to non-covered backends such as New Relic)
      • to use Micrometer's CompositeRegistry
      This setter is mutually exclusive with setInfluxDbOptions/setPrometheusOptions/setJmxMetricsOptions and takes precedence over them.
      Parameters:
      micrometerRegistry - the registry to use
  • Method Details

    • metrics

      public VertxMetrics metrics(VertxOptions vertxOptions)
      Description copied from interface: VertxMetricsFactory
      Create a new VertxMetrics object.

      No specific thread and context can be expected when this method is called.

      Specified by:
      metrics in interface VertxMetricsFactory
      Parameters:
      vertxOptions - the metrics configuration option
      Returns:
      the metrics implementation
    • newOptions

      public MetricsOptions newOptions(MetricsOptions options)
      Description copied from interface: VertxMetricsFactory
      Create metrics options from the provided options.

      Providers can override this method to provide a custom metrics options subclass that exposes custom configuration.

      It is used when a Vert.x instance is created with a MetricsOptions instance.

      Specified by:
      newOptions in interface VertxMetricsFactory
      Parameters:
      options - new metrics options
      Returns:
      new metrics options
    • newOptions

      public MetricsOptions newOptions()
      Description copied from interface: VertxMetricsFactory
      Create an empty metrics options. Providers can override this method to provide a custom metrics options subclass that exposes custom configuration.
      Specified by:
      newOptions in interface VertxMetricsFactory
      Returns:
      new metrics options
    • newOptions

      public MetricsOptions newOptions(JsonObject jsonObject)
      Description copied from interface: VertxMetricsFactory
      Create metrics options from the provided jsonObject.

      Providers can override this method to provide a custom metrics options subclass that exposes custom configuration.

      Specified by:
      newOptions in interface VertxMetricsFactory
      Parameters:
      jsonObject - json provided by the user
      Returns:
      new metrics options