Package io.vertx.micrometer.backends
Class BackendRegistries
- java.lang.Object
-
- io.vertx.micrometer.backends.BackendRegistries
-
public final class BackendRegistries extends Object
BackendRegistriesis responsible for managing registries related to particular micrometer backends (influxdb, prometheus...) It contains a store ofBackendRegistryobjects, each of whose encapsulating a micrometer'sMeterRegistry- Author:
- Joel Takvorian
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.micrometer.core.instrument.MeterRegistrygetDefaultNow()Get the default micrometer registry.static io.micrometer.core.instrument.MeterRegistrygetNow(String registryName)Get the micrometer registry of the given name.static voidregisterMatchers(io.micrometer.core.instrument.MeterRegistry registry, List<Match> matches)static BackendRegistrysetupBackend(MicrometerMetricsOptions options, io.micrometer.core.instrument.MeterRegistry meterRegistry)Create a new backend registry, containing a micrometer registry, initialized with the provided options.static voidstop(String registryName)Stop (unregister) the backend registry of the given name.
-
-
-
Method Detail
-
setupBackend
public static BackendRegistry setupBackend(MicrometerMetricsOptions options, io.micrometer.core.instrument.MeterRegistry meterRegistry)
Create a new backend registry, containing a micrometer registry, initialized with the provided options. If a registry already exists with the associated name, it is just returned without any effect.- Parameters:
options- micrometer options, including configuration related to the backend. Should be a subclass ofMicrometerMetricsOptions(ex:VertxInfluxDbOptions,VertxPrometheusOptions). If the class is not recognized, aNoopBackendRegistrywill be returned.- Returns:
- the created (or existing)
BackendRegistry
-
getDefaultNow
public static io.micrometer.core.instrument.MeterRegistry getDefaultNow()
Get the default micrometer registry. May returnnullif it hasn't been registered yet or if it has been stopped.- Returns:
- the micrometer registry or
null
-
getNow
public static io.micrometer.core.instrument.MeterRegistry getNow(String registryName)
Get the micrometer registry of the given name. May returnnullif it hasn't been registered yet or if it has been stopped.- Parameters:
registryName- the name associated with this registry in Micrometer options- Returns:
- the micrometer registry or
null
-
stop
public static void stop(String registryName)
Stop (unregister) the backend registry of the given name. Any resource started by this backend registry will be released (like running HTTP server)- Parameters:
registryName- the name associated with this registry in Micrometer options
-
-