io.vertx.ext.hawkular

## Class VertxHawkularOptions

- java.lang.Object
- - io.vertx.core.metrics.MetricsOptions
  - - io.vertx.ext.hawkular.VertxHawkularOptions

-     public class VertxHawkularOptions
      extends MetricsOptions

  Vert.x Hawkular monitoring configuration.
  Author:
    Thomas Segismont

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_BATCH_DELAY` Default value for the maximum delay between two consecutive batches (in seconds) = 1.
    `static int` | `DEFAULT_BATCH_SIZE` Default value for the maximum number of metrics in a batch = 50.
    `static String` | `DEFAULT_HOST` The default Hawkular server host = localhost.
    `static String` | `DEFAULT_METRICS_BRIDGE_ADDRESS` Default event bus address where applications can send business-related metrics.
    `static boolean` | `DEFAULT_METRICS_BRIDGE_ENABLED` The default value to enable / disable the metrics bridge.
    `static String` | `DEFAULT_METRICS_URI` The default Hawkular Metrics service URI = /hawkular/metrics.
    `static int` | `DEFAULT_PORT` The default Hawkular server port = 8080.
    `static String` | `DEFAULT_PREFIX` The default metric name prefix (empty).
    `static int` | `DEFAULT_SCHEDULE` Default value for metric collection interval (in seconds) = 1.
    `static String` | `DEFAULT_TENANT` The default Hawkular tenant = default.

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

      `DEFAULT_METRICS_ENABLED`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VertxHawkularOptions()`
    `VertxHawkularOptions(JsonObject json)`
    `VertxHawkularOptions(VertxHawkularOptions other)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `VertxHawkularOptions` | `addDisabledMetricsType(MetricsType metricsType)` Set metric that will not be registered.
    `AuthenticationOptions` | `getAuthenticationOptions()`
    `int` | `getBatchDelay()`
    `int` | `getBatchSize()`
    `Set<MetricsType>` | `getDisabledMetricsTypes()`
    `String` | `getHost()`
    `JsonObject` | `getHttpHeaders()`
    `HttpClientOptions` | `getHttpOptions()`
    `String` | `getMetricsBridgeAddress()`
    `String` | `getMetricsServiceUri()`
    `int` | `getPort()`
    `String` | `getPrefix()`
    `int` | `getSchedule()`
    `String` | `getTenant()`
    `boolean` | `isMetricsBridgeEnabled()` Checks whether or not the metrics bridge is enabled.
    `boolean` | `isMetricsTypeDisabled(MetricsType metricsType)`
    `boolean` | `isSendTenantHeader()`
    `VertxHawkularOptions` | `setAuthenticationOptions(AuthenticationOptions authenticationOptions)` Set the options for authentication.
    `VertxHawkularOptions` | `setBatchDelay(int batchDelay)` Set the maximum delay between two consecutive batches (in seconds).
    `VertxHawkularOptions` | `setBatchSize(int batchSize)` Set the maximum number of metrics in a batch.
    `void` | `setDisabledMetricsTypes(Set<MetricsType> disabledMetricsTypes)` Sets metrics types that are disabled.
    `VertxHawkularOptions` | `setEnabled(boolean enable)` Set whether metrics will be enabled on the Vert.x instance.
    `VertxHawkularOptions` | `setHost(String host)` Set the Hawkular Metrics service host.
    `VertxHawkularOptions` | `setHttpHeaders(JsonObject httpHeaders)` Set specific headers to include in HTTP requests.
    `VertxHawkularOptions` | `setHttpOptions(HttpClientOptions httpOptions)` Set the configuration of the Hawkular Metrics HTTP client.
    `VertxHawkularOptions` | `setMetricsBridgeAddress(String metricsBridgeAddress)` Sets the metric bridge address on which the application is sending the custom metrics.
    `VertxHawkularOptions` | `setMetricsBridgeEnabled(boolean metricsBridgeEnabled)` Sets whether or not the metrics bridge should be enabled.
    `VertxHawkularOptions` | `setMetricsServiceUri(String metricsServiceUri)` Set the Hawkular Metrics service URI.
    `VertxHawkularOptions` | `setPort(int port)` Set the Hawkular Metrics service port.
    `VertxHawkularOptions` | `setPrefix(String prefix)` Set the metric name prefix.
    `VertxHawkularOptions` | `setSchedule(int schedule)` Set the metric collection interval (in seconds).
    `VertxHawkularOptions` | `setSendTenantHeader(boolean sendTenantHeader)` Set whether Hawkular tenant header should be sent.
    `VertxHawkularOptions` | `setTenant(String tenant)` Set the Hawkular tenant.

    - ### 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_HOST

          public static final String DEFAULT_HOST

      The default Hawkular server host = localhost.
      See Also:
        Constant Field Values

    - #### DEFAULT_PORT

          public static final int DEFAULT_PORT

      The default Hawkular server port = 8080.
      See Also:
        Constant Field Values

    - #### DEFAULT_METRICS_URI

          public static final String DEFAULT_METRICS_URI

      The default Hawkular Metrics service URI = /hawkular/metrics.
      See Also:
        Constant Field Values

    - #### DEFAULT_TENANT

          public static final String DEFAULT_TENANT

      The default Hawkular tenant = default.
      See Also:
        Constant Field Values

    - #### DEFAULT_SCHEDULE

          public static final int DEFAULT_SCHEDULE

      Default value for metric collection interval (in seconds) = 1.
      See Also:
        Constant Field Values

    - #### DEFAULT_PREFIX

          public static final String DEFAULT_PREFIX

      The default metric name prefix (empty).
      See Also:
        Constant Field Values

    - #### DEFAULT_BATCH_SIZE

          public static final int DEFAULT_BATCH_SIZE

      Default value for the maximum number of metrics in a batch = 50.
      See Also:
        Constant Field Values

    - #### DEFAULT_BATCH_DELAY

          public static final int DEFAULT_BATCH_DELAY

      Default value for the maximum delay between two consecutive batches (in seconds) = 1.
      See Also:
        Constant Field Values

    - #### DEFAULT_METRICS_BRIDGE_ADDRESS

          public static final String DEFAULT_METRICS_BRIDGE_ADDRESS

      Default event bus address where applications can send business-related metrics. The metrics are sent as JSON message containing at least the `source` and `value` (double) fields.
      See Also:
        Constant Field Values

    - #### DEFAULT_METRICS_BRIDGE_ENABLED

          public static final boolean DEFAULT_METRICS_BRIDGE_ENABLED

      The default value to enable / disable the metrics bridge. Disable by default.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### VertxHawkularOptions

          public VertxHawkularOptions()

    - #### VertxHawkularOptions

          public VertxHawkularOptions(VertxHawkularOptions other)

    - #### VertxHawkularOptions

          public VertxHawkularOptions(JsonObject json)

  - ### Method Detail

    - #### getHost

          public String getHost()

      Returns:
        the Hawkular Metrics service host

    - #### setHost

          public VertxHawkularOptions setHost(String host)

      Set the Hawkular Metrics service host. Defaults to `localhost`.

    - #### getPort

          public int getPort()

      Returns:
        the Hawkular Metrics service port.

    - #### setPort

          public VertxHawkularOptions setPort(int port)

      Set the Hawkular Metrics service port. Defaults to `8080`.

    - #### getHttpOptions

          public HttpClientOptions getHttpOptions()

      Returns:
        the configuration of the Hawkular Metrics HTTP client

    - #### setHttpOptions

          public VertxHawkularOptions setHttpOptions(HttpClientOptions httpOptions)

      Set the configuration of the Hawkular Metrics HTTP client.

    - #### getMetricsServiceUri

          public String getMetricsServiceUri()

      Returns:
        the Hawkular Metrics service URI

    - #### setMetricsServiceUri

          public VertxHawkularOptions setMetricsServiceUri(String metricsServiceUri)

      Set the Hawkular Metrics service URI. Defaults to `/hawkular/metrics`. This can be useful if you host the Hawkular server behind a proxy and manipulate the default service URI.

    - #### getTenant

          public String getTenant()

      Returns:
        the Hawkular tenant

    - #### setTenant

          public VertxHawkularOptions setTenant(String tenant)

      Set the Hawkular tenant. Defaults to `default`.

    - #### isSendTenantHeader

          public boolean isSendTenantHeader()

      Returns:
        true if tenant header should be sent

    - #### setSendTenantHeader

          public VertxHawkularOptions setSendTenantHeader(boolean sendTenantHeader)

      Set whether Hawkular tenant header should be sent. Defaults to `true`. Must be set to `false` when working with pre-Alpha13 Hawkular servers.

    - #### getAuthenticationOptions

          public AuthenticationOptions getAuthenticationOptions()

      Returns:
        the authentication options

    - #### setAuthenticationOptions

          public VertxHawkularOptions setAuthenticationOptions(AuthenticationOptions authenticationOptions)

      Set the options for authentication.

    - #### getHttpHeaders

          public JsonObject getHttpHeaders()

      Returns:
        specific headers to include in HTTP requests

    - #### setHttpHeaders

          public VertxHawkularOptions setHttpHeaders(JsonObject httpHeaders)

      Set specific headers to include in HTTP requests.

    - #### getSchedule

          public int getSchedule()

      Returns:
        the metric collection interval (in seconds)

    - #### setSchedule

          public VertxHawkularOptions setSchedule(int schedule)

      Set the metric collection interval (in seconds). Defaults to `1`.

    - #### getPrefix

          public String getPrefix()

      Returns:
        the metric name prefix

    - #### setPrefix

          public VertxHawkularOptions setPrefix(String prefix)

      Set the metric name prefix. Metric names are not prefixed by default. Prefixing metric names is required to distinguish data sent by different Vert.x instances.

    - #### getBatchSize

          public int getBatchSize()

      Returns:
        the maximum number of metrics in a batch

    - #### setBatchSize

          public VertxHawkularOptions setBatchSize(int batchSize)

      Set the maximum number of metrics in a batch. To reduce the number of HTTP exchanges, metric data is sent to the Hawkular server in batches. A batch is sent as soon as the number of metrics collected reaches the configured `batchSize`, or after the `batchDelay` expires. Defaults to `50`.

    - #### getBatchDelay

          public int getBatchDelay()

      Returns:
        the maximum delay between two consecutive batches

    - #### setBatchDelay

          public VertxHawkularOptions setBatchDelay(int batchDelay)

      Set the maximum delay between two consecutive batches (in seconds). To reduce the number of HTTP exchanges, metric data is sent to the Hawkular server in batches. A batch is sent as soon as the number of metrics collected reaches the configured `batchSize`, or after the `batchDelay` expires. Defaults to `1` second.

    - #### setEnabled

          public VertxHawkularOptions 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

    - #### getMetricsBridgeAddress

          public String getMetricsBridgeAddress()

      Returns:
        the metric bridge address. If enabled the metric bridge transfers metrics collected from the event bus to the Hawkular server. The metrics are sent as message on the event bus to the return address. The message is a JSON object specifying at least the `source` and `value` fields (`value` is a double).

    - #### setMetricsBridgeAddress

          public VertxHawkularOptions setMetricsBridgeAddress(String metricsBridgeAddress)

      Sets the metric bridge address on which the application is sending the custom metrics. Application can send metrics to this event bus address. The message is a JSON object specifying at least the `id` and `value` fields.

      Don't forget to also enable the bridge with `metricsBridgeEnabled`.
      Parameters:
        `metricsBridgeAddress` - the address
      Returns:
        the current `VertxHawkularOptions` instance

    - #### isMetricsBridgeEnabled

          public boolean isMetricsBridgeEnabled()

      Checks whether or not the metrics bridge is enabled.
      Returns:
        `true` if the metrics bridge is enabled, `false` otherwise.

    - #### setMetricsBridgeEnabled

          public VertxHawkularOptions setMetricsBridgeEnabled(boolean metricsBridgeEnabled)

      Sets whether or not the metrics bridge should be enabled. The metrics bridge is disabled by default.
      Parameters:
        `metricsBridgeEnabled` - `true` to enable the bridge, `false` to disable it.
      Returns:
        the current `VertxHawkularOptions` instance

    - #### getDisabledMetricsTypes

          public Set<MetricsType> getDisabledMetricsTypes()

      Returns:
        the disabled metrics types.

    - #### setDisabledMetricsTypes

          public void setDisabledMetricsTypes(Set<MetricsType> disabledMetricsTypes)

      Sets metrics types that are disabled.
      Parameters:
        `disabledMetricsTypes` - to specify the set of metrics types to be disabled.

    - #### addDisabledMetricsType

          public VertxHawkularOptions addDisabledMetricsType(MetricsType metricsType)

      Set metric that will not be registered. Schedulers will check the set `disabledMetricsTypes` when registering metrics suppliers
      Parameters:
        `metricsType` - the type of metrics
      Returns:
        the current `VertxHawkularOptions` instance

    - #### isMetricsTypeDisabled

          public boolean isMetricsTypeDisabled(MetricsType metricsType)

Copyright © 2017. All rights reserved.