Class BackendRegistries
java.lang.Object
io.vertx.micrometer.backends.BackendRegistries
BackendRegistries is responsible for managing registries related to particular micrometer backends (influxdb, prometheus...)
It contains a store of BackendRegistry objects, each of whose encapsulating a micrometer's MeterRegistry- Author:
- Joel Takvorian
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.micrometer.core.instrument.MeterRegistryGet the default micrometer registry.static io.micrometer.core.instrument.MeterRegistryGet 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 (unregister) the backend registry of the given name.
-
Method Details
-
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
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
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
-
registerMatchers
-