public class MicrometerMetricsOptions extends MetricsOptions
It is required to set either influxDbOptions
, prometheusOptions
or jmxMetricsOptions
(or, programmatically, micrometerRegistry
) in order to actually report metrics.
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_JVM_METRICS_ENABLED
Whether JVM metrics should be collected by default = false.
|
static List<Label> |
DEFAULT_LABELS
Default label match for public http server: exclude remote label
|
static String |
DEFAULT_REGISTRY_NAME
Default registry name is 'default'
|
DEFAULT_METRICS_ENABLED
Constructor and Description |
---|
MicrometerMetricsOptions()
Creates default options for Micrometer metrics.
|
MicrometerMetricsOptions(JsonObject json)
Creates new options object for Micrometer metrics from
json input. |
MicrometerMetricsOptions(MicrometerMetricsOptions other)
Creates new options object for Micrometer metrics, which is a copy of
other . |
Modifier and Type | Method and Description |
---|---|
MicrometerMetricsOptions |
addDisabledMetricsCategory(MetricsDomain metricsDomain)
Set metric that will not be registered.
|
MicrometerMetricsOptions |
addLabelMatch(Match match)
Add a rule for label matching.
|
MicrometerMetricsOptions |
addLabels(Label... labels)
Add a labels to enable.
|
Set<MetricsDomain> |
getDisabledMetricsCategories() |
VertxInfluxDbOptions |
getInfluxDbOptions()
Get the specific options for InfluxDB reporting.
|
VertxJmxMetricsOptions |
getJmxMetricsOptions()
Get the specific options for JMX reporting.
|
List<Match> |
getLabelMatches() |
Set<Label> |
getLabels() |
io.micrometer.core.instrument.MeterRegistry |
getMicrometerRegistry()
Get the Micrometer MeterRegistry to be used by Vert.x, that has been previously set programmatically
|
VertxPrometheusOptions |
getPrometheusOptions()
Get the specific options for Prometheus reporting.
|
String |
getRegistryName()
Get the metrics registry name set in these options
|
boolean |
isJvmMetricsEnabled() |
boolean |
isMetricsCategoryDisabled(MetricsDomain metricsDomain)
Is the given metrics category disabled?
|
MicrometerMetricsOptions |
setDisabledMetricsCategories(Set<MetricsDomain> disabledMetricsCategories)
Sets metrics types that are disabled.
|
MicrometerMetricsOptions |
setEnabled(boolean enable)
Set whether metrics will be enabled on the Vert.x instance.
|
MicrometerMetricsOptions |
setFactory(VertxMetricsFactory factory)
Programmatically set the metrics factory to be used when metrics are enabled.
|
MicrometerMetricsOptions |
setInfluxDbOptions(VertxInfluxDbOptions influxDbOptions)
Set InfluxDB options.
|
MicrometerMetricsOptions |
setJmxMetricsOptions(VertxJmxMetricsOptions jmxMetricsOptions)
Set JMX metrics options.
|
MicrometerMetricsOptions |
setJvmMetricsEnabled(boolean jvmMetricsEnabled)
Whether JVM metrics should be collected.
|
MicrometerMetricsOptions |
setLabelMatches(List<Match> matches)
Set a list of rules for label matching.
|
MicrometerMetricsOptions |
setLabels(Set<Label> labels)
Sets enabled labels.
|
MicrometerMetricsOptions |
setMicrometerRegistry(io.micrometer.core.instrument.MeterRegistry micrometerRegistry)
Programmatically set the Micrometer MeterRegistry to be used by Vert.x.
|
MicrometerMetricsOptions |
setPrometheusOptions(VertxPrometheusOptions prometheusOptions)
Set Prometheus options.
|
MicrometerMetricsOptions |
setRegistryName(String registryName)
Set a name for the metrics registry, so that a new registry will be created and associated with this name.
|
JsonObject |
toJson() |
equals, getFactory, hashCode, isEnabled, toString
public static final String DEFAULT_REGISTRY_NAME
public static final List<Label> DEFAULT_LABELS
public static final boolean DEFAULT_JVM_METRICS_ENABLED
public MicrometerMetricsOptions()
public MicrometerMetricsOptions(MicrometerMetricsOptions other)
other
.public MicrometerMetricsOptions(JsonObject json)
json
input.public JsonObject toJson()
toJson
in class MetricsOptions
public MicrometerMetricsOptions setEnabled(boolean enable)
setEnabled
in class MetricsOptions
enable
- true if metrics enabled, or false if not.public MicrometerMetricsOptions setFactory(VertxMetricsFactory factory)
MetricsOptions
Only valid if MetricsOptions.isEnabled()
= true.
Normally Vert.x will look on the classpath for a metrics factory implementation, but if you want to set one programmatically you can use this method.
setFactory
in class MetricsOptions
factory
- the metrics factorypublic Set<MetricsDomain> getDisabledMetricsCategories()
public MicrometerMetricsOptions setDisabledMetricsCategories(Set<MetricsDomain> disabledMetricsCategories)
disabledMetricsCategories
- to specify the set of metrics types to be disabled.public MicrometerMetricsOptions addDisabledMetricsCategory(MetricsDomain metricsDomain)
disabledMetricsCategories
when
registering metrics suppliersmetricsDomain
- the type of metricspublic boolean isMetricsCategoryDisabled(MetricsDomain metricsDomain)
public String getRegistryName()
public MicrometerMetricsOptions setRegistryName(String registryName)
registryName
is not provided (or null), a default registry will be used.
If the same name is given to several Vert.x instances (within the same JVM), they will share the same registry.registryName
- a name to uniquely identify this registrypublic MicrometerMetricsOptions setLabels(Set<Label> labels)
labels
- the set of enabled labels - this set will replace any previously enabled labels, including the default onespublic MicrometerMetricsOptions addLabels(Label... labels)
labels
- the labels to enablepublic MicrometerMetricsOptions setLabelMatches(List<Match> matches)
matches
- the new list of rulespublic MicrometerMetricsOptions addLabelMatch(Match match)
match
- the label matchpublic io.micrometer.core.instrument.MeterRegistry getMicrometerRegistry()
public MicrometerMetricsOptions setMicrometerRegistry(io.micrometer.core.instrument.MeterRegistry micrometerRegistry)
micrometerRegistry
- the registry to usepublic VertxInfluxDbOptions getInfluxDbOptions()
public MicrometerMetricsOptions setInfluxDbOptions(VertxInfluxDbOptions influxDbOptions)
influxDbOptions
- backend options for InfluxDBpublic VertxPrometheusOptions getPrometheusOptions()
public MicrometerMetricsOptions setPrometheusOptions(VertxPrometheusOptions prometheusOptions)
prometheusOptions
- backend options for Prometheuspublic VertxJmxMetricsOptions getJmxMetricsOptions()
public MicrometerMetricsOptions setJmxMetricsOptions(VertxJmxMetricsOptions jmxMetricsOptions)
jmxMetricsOptions
- backend options for JMX reportingpublic boolean isJvmMetricsEnabled()
public MicrometerMetricsOptions setJvmMetricsEnabled(boolean jvmMetricsEnabled)
false
.jvmMetricsEnabled
- true to collect JVM metrics, false otherwise. Defaults to false
.Copyright © 2023 Eclipse. All rights reserved.