io.vertx.micrometer

## Class MicrometerMetricsOptions

- java.lang.Object
- - io.vertx.core.metrics.MetricsOptions
  - - io.vertx.micrometer.MicrometerMetricsOptions

-     public class MicrometerMetricsOptions
      extends MetricsOptions

  Vert.x micrometer configuration.
  It is required to set either `influxDbOptions`, `prometheusOptions` or {@code jmxMetricsOptions] in order to actually report metrics.
  Author:
    Joel Takvorian

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Match` | `DEFAULT_HTTP_SERVER_MATCH` Default label match for public http server: exclude remote label
    `static List<Match>` | `DEFAULT_LABEL_MATCHES` The default label matches: empty by default
    `static Match` | `DEFAULT_NET_SERVER_MATCH` Default label match for public net server: exclude remote label
    `static String` | `DEFAULT_REGISTRY_NAME` Default registry name is 'default'

    - ### Fields inherited from class io.vertx.core.metrics.MetricsOptions

      `DEFAULT_METRICS_ENABLED`

  - ### Constructor Summary

    Constructors
    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`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.
    `Set<MetricsDomain>` | `getDisabledMetricsCategories()`
    `VertxInfluxDbOptions` | `getInfluxDbOptions()` Get the specific options for InfluxDB reporting.
    `VertxJmxMetricsOptions` | `getJmxMetricsOptions()` Get the specific options for JMX reporting.
    `List<Match>` | `getLabelMatchs()`
    `VertxPrometheusOptions` | `getPrometheusOptions()` Get the specific options for Prometheus reporting.
    `String` | `getRegistryName()` Get the metrics registry name set in these options
    `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` | `setInfluxDbOptions(VertxInfluxDbOptions influxDbOptions)` Set InfluxDB options.
    `MicrometerMetricsOptions` | `setJmxMetricsOptions(VertxJmxMetricsOptions jmxMetricsOptions)` Set JMX metrics options.
    `MicrometerMetricsOptions` | `setLabelMatchs(List<Match> matches)` Set a list of rules for label matching.
    `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.

    - ### Methods inherited from class io.vertx.core.metrics.MetricsOptions

      `equals, getFactory, hashCode, isEnabled, setFactory, toJson, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_REGISTRY_NAME

          public static final String DEFAULT_REGISTRY_NAME

      Default registry name is 'default'
      See Also:
        Constant Field Values

    - #### DEFAULT_HTTP_SERVER_MATCH

          public static final Match DEFAULT_HTTP_SERVER_MATCH

      Default label match for public http server: exclude remote label

    - #### DEFAULT_NET_SERVER_MATCH

          public static final Match DEFAULT_NET_SERVER_MATCH

      Default label match for public net server: exclude remote label

    - #### DEFAULT_LABEL_MATCHES

          public static final List<Match> DEFAULT_LABEL_MATCHES

      The default label matches: empty by default

  - ### Constructor Detail

    - #### MicrometerMetricsOptions

          public MicrometerMetricsOptions()

      Creates default options for Micrometer metrics.

    - #### MicrometerMetricsOptions

          public MicrometerMetricsOptions(MicrometerMetricsOptions other)

      Creates new options object for Micrometer metrics, which is a copy of `other`.

    - #### MicrometerMetricsOptions

          public MicrometerMetricsOptions(JsonObject json)

      Creates new options object for Micrometer metrics from `json` input.

  - ### Method Detail

    - #### setEnabled

          public MicrometerMetricsOptions setEnabled(boolean enable)

      Set whether metrics will be enabled on the Vert.x instance. Metrics are not enabled by default.
      Overrides:
        `setEnabled` in class `MetricsOptions`
      Parameters:
        `enable` - true if metrics enabled, or false if not.
      Returns:
        a reference to this, so the API can be used fluently

    - #### getDisabledMetricsCategories

          public Set<MetricsDomain> getDisabledMetricsCategories()

      Returns:
        the disabled metrics types.

    - #### setDisabledMetricsCategories

          public MicrometerMetricsOptions setDisabledMetricsCategories(Set<MetricsDomain> disabledMetricsCategories)

      Sets metrics types that are disabled.
      Parameters:
        `disabledMetricsCategories` - to specify the set of metrics types to be disabled.
      Returns:
        a reference to this, so that the API can be used fluently

    - #### addDisabledMetricsCategory

          public MicrometerMetricsOptions addDisabledMetricsCategory(MetricsDomain metricsDomain)

      Set metric that will not be registered. Schedulers will check the set `disabledMetricsCategories` when registering metrics suppliers
      Parameters:
        `metricsDomain` - the type of metrics
      Returns:
        a reference to this, so that the API can be used fluently

    - #### isMetricsCategoryDisabled

          public boolean isMetricsCategoryDisabled(MetricsDomain metricsDomain)

      Is the given metrics category disabled?
      Returns:
        true if it is disabled

    - #### getRegistryName

          public String getRegistryName()

      Get the metrics registry name set in these options

    - #### setRegistryName

          public MicrometerMetricsOptions setRegistryName(String registryName)

      Set a name for the metrics registry, so that a new registry will be created and associated with this name. If `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.
      Parameters:
        `registryName` - a name to uniquely identify this registry

    - #### getLabelMatchs

          public List<Match> getLabelMatchs()

      Returns:
        the list of label matching rules

    - #### setLabelMatchs

          public MicrometerMetricsOptions setLabelMatchs(List<Match> matches)

      Set a list of rules for label matching.
      Parameters:
        `matches` - the new list of rules
      Returns:
        a reference to this, so the API can be used fluently

    - #### addLabelMatch

          public MicrometerMetricsOptions addLabelMatch(Match match)

      Add a rule for label matching.
      Parameters:
        `match` - the label match
      Returns:
        a reference to this, so the API can be used fluently

    - #### getInfluxDbOptions

          public VertxInfluxDbOptions getInfluxDbOptions()

      Get the specific options for InfluxDB reporting.

    - #### setInfluxDbOptions

          public MicrometerMetricsOptions setInfluxDbOptions(VertxInfluxDbOptions influxDbOptions)

      Set InfluxDB options. Setting a registry backend option is mandatory in order to effectively report metrics.
      Parameters:
        `influxDbOptions` - backend options for InfluxDB

    - #### getPrometheusOptions

          public VertxPrometheusOptions getPrometheusOptions()

      Get the specific options for Prometheus reporting.

    - #### setPrometheusOptions

          public MicrometerMetricsOptions setPrometheusOptions(VertxPrometheusOptions prometheusOptions)

      Set Prometheus options. Setting a registry backend option is mandatory in order to effectively report metrics.
      Parameters:
        `prometheusOptions` - backend options for Prometheus

    - #### getJmxMetricsOptions

          public VertxJmxMetricsOptions getJmxMetricsOptions()

      Get the specific options for JMX reporting.

    - #### setJmxMetricsOptions

          public MicrometerMetricsOptions setJmxMetricsOptions(VertxJmxMetricsOptions jmxMetricsOptions)

      Set JMX metrics options. Setting a registry backend option is mandatory in order to effectively report metrics.
      Parameters:
        `jmxMetricsOptions` - backend options for JMX reporting

Copyright © 2018 Eclipse. All rights reserved.