Class VertxPrometheusOptions


  • public class VertxPrometheusOptions
    extends Object
    Options for Prometheus metrics backend.
    Author:
    Joel Takvorian
    • Field Detail

      • DEFAULT_ENABLED

        public static final boolean DEFAULT_ENABLED
        Default value for enabled = false.
        See Also:
        Constant Field Values
      • DEFAULT_START_EMBEDDED_SERVER

        public static final boolean DEFAULT_START_EMBEDDED_SERVER
        Default value for starting an embedded server = false.
        See Also:
        Constant Field Values
      • DEFAULT_EMBEDDED_SERVER_ENDPOINT

        public static final String DEFAULT_EMBEDDED_SERVER_ENDPOINT
        The default metrics endpoint = /metrics when using an embedded server.
        See Also:
        Constant Field Values
      • DEFAULT_PUBLISH_QUANTILES

        public static final boolean DEFAULT_PUBLISH_QUANTILES
        Default value for publishing histogram quantiles = false.
        See Also:
        Constant Field Values
    • Constructor Detail

      • VertxPrometheusOptions

        public VertxPrometheusOptions()
        Default constructor
      • VertxPrometheusOptions

        public VertxPrometheusOptions​(JsonObject json)
        Create an instance from a JsonObject
        Parameters:
        json - the JsonObject to create it from
    • Method Detail

      • toJson

        public JsonObject toJson()
        Returns:
        a JSON representation of these options
      • isEnabled

        public boolean isEnabled()
        Will Prometheus reporting be enabled?
        Returns:
        true if enabled, false if not.
      • setEnabled

        public VertxPrometheusOptions setEnabled​(boolean enabled)
        Set true to enable Prometheus reporting
      • isStartEmbeddedServer

        public boolean isStartEmbeddedServer()
        Returns true if it is configured to init an embedded web server to expose Prometheus metrics
      • setStartEmbeddedServer

        public VertxPrometheusOptions setStartEmbeddedServer​(boolean startEmbeddedServer)
        When true, an embedded server will init to expose metrics with Prometheus format.
      • getEmbeddedServerOptions

        public HttpServerOptions getEmbeddedServerOptions()
        Get the HTTP server options of the embedded server, if any
      • setEmbeddedServerOptions

        public VertxPrometheusOptions setEmbeddedServerOptions​(HttpServerOptions embeddedServerOptions)
        HTTP server options for the embedded server
        Parameters:
        embeddedServerOptions - the server options
      • setEmbeddedServerEndpoint

        public VertxPrometheusOptions setEmbeddedServerEndpoint​(String embeddedServerEndpoint)
        Set metrics endpoint. Use conjointly with the embedded server options. Defaults to /metrics.
        Parameters:
        embeddedServerEndpoint - metrics endpoint
      • getEmbeddedServerEndpoint

        public String getEmbeddedServerEndpoint()
        Get the HTTP endpoint used if an embedded server is configured
      • isPublishQuantiles

        public boolean isPublishQuantiles()
        Returns:
        true if quantile stats are published
      • setPublishQuantiles

        public VertxPrometheusOptions setPublishQuantiles​(boolean publishQuantiles)
        Set true to publish histogram stats, necessary to compute quantiles. Note that it generates many new timeseries for stats, which is why it is deactivated by default.
        Parameters:
        publishQuantiles - the publishing quantiles flag
        Returns:
        a reference to this, so the API can be used fluently