Package io.vertx.micrometer.backends
Class BackendRegistries
- java.lang.Object
-
- io.vertx.micrometer.backends.BackendRegistries
-
public final class BackendRegistries extends Object
BackendRegistries
is responsible for managing registries related to particular micrometer backends (influxdb, prometheus...) It contains a store ofBackendRegistry
objects, 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.MeterRegistry
getDefaultNow()
Get the default micrometer registry.static io.micrometer.core.instrument.MeterRegistry
getNow(String registryName)
Get the micrometer registry of the given name.static void
registerMatchers(io.micrometer.core.instrument.MeterRegistry registry, List<Match> matches)
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.static void
stop(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, aNoopBackendRegistry
will be returned.- Returns:
- the created (or existing)
BackendRegistry
-
getDefaultNow
public static io.micrometer.core.instrument.MeterRegistry getDefaultNow()
Get the default micrometer registry. May returnnull
if 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 returnnull
if 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
-
-