Package io.vertx.micrometer
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 Summary
Constructors Constructor Description MicrometerMetricsFactory()MicrometerMetricsFactory(io.micrometer.core.instrument.MeterRegistry micrometerRegistry)Build a factory passing the Micrometer MeterRegistry to be used by Vert.x.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VertxMetricsmetrics(VertxOptions vertxOptions)Create a newVertxMetricsobject.MetricsOptionsnewOptions()Create an empty metrics options.MetricsOptionsnewOptions(JsonObject jsonObject)Create metrics options from the providedjsonObject.MetricsOptionsnewOptions(MetricsOptions options)Create metrics options from the providedoptions.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.vertx.core.spi.VertxMetricsFactory
init
-
-
-
-
Constructor Detail
-
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
- Parameters:
micrometerRegistry- the registry to use
-
-
Method Detail
-
metrics
public VertxMetrics metrics(VertxOptions vertxOptions)
Description copied from interface:VertxMetricsFactoryCreate a newVertxMetricsobject. No specific thread and context can be expected when this method is called.- Specified by:
metricsin interfaceVertxMetricsFactory- Parameters:
vertxOptions- the metrics configuration option- Returns:
- the metrics implementation
-
newOptions
public MetricsOptions newOptions(MetricsOptions options)
Description copied from interface:VertxMetricsFactoryCreate metrics options from the providedoptions.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
MetricsOptionsinstance.- Specified by:
newOptionsin interfaceVertxMetricsFactory- Parameters:
options- new metrics options- Returns:
- new metrics options
-
newOptions
public MetricsOptions newOptions()
Description copied from interface:VertxMetricsFactoryCreate an empty metrics options. Providers can override this method to provide a custom metrics options subclass that exposes custom configuration.- Specified by:
newOptionsin interfaceVertxMetricsFactory- Returns:
- new metrics options
-
newOptions
public MetricsOptions newOptions(JsonObject jsonObject)
Description copied from interface:VertxMetricsFactoryCreate metrics options from the providedjsonObject.Providers can override this method to provide a custom metrics options subclass that exposes custom configuration.
- Specified by:
newOptionsin interfaceVertxMetricsFactory- Parameters:
jsonObject- json provided by the user- Returns:
- new metrics options
-
-