Class VertxPrometheusOptions
java.lang.Object
io.vertx.micrometer.VertxPrometheusOptions
Options for Prometheus metrics backend.
- Author:
- Joel Takvorian
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default metrics endpoint = /metrics when using an embedded server.static final booleanDefault value for enabled = false.static final booleanDefault value for publishing histogram quantiles = false.static final booleanDefault value for starting an embedded server = false. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the HTTP endpoint used if an embedded server is configuredGet the HTTP server options of the embedded server, if anybooleanWill Prometheus reporting be enabled?booleanbooleanReturns true if it is configured to init an embedded web server to expose Prometheus metricssetEmbeddedServerEndpoint(String embeddedServerEndpoint) Set metrics endpoint.setEmbeddedServerOptions(HttpServerOptions embeddedServerOptions) HTTP server options for the embedded serversetEnabled(boolean enabled) Set true to enable Prometheus reportingsetPublishQuantiles(boolean publishQuantiles) Set true to publish histogram stats, necessary to compute quantiles.setStartEmbeddedServer(boolean startEmbeddedServer) When true, an embedded server will init to expose metrics with Prometheus format.toJson()
-
Field Details
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDDefault value for enabled = false.- See Also:
-
DEFAULT_START_EMBEDDED_SERVER
public static final boolean DEFAULT_START_EMBEDDED_SERVERDefault value for starting an embedded server = false.- See Also:
-
DEFAULT_EMBEDDED_SERVER_ENDPOINT
The default metrics endpoint = /metrics when using an embedded server.- See Also:
-
DEFAULT_PUBLISH_QUANTILES
public static final boolean DEFAULT_PUBLISH_QUANTILESDefault value for publishing histogram quantiles = false.- See Also:
-
-
Constructor Details
-
VertxPrometheusOptions
public VertxPrometheusOptions()Default constructor -
VertxPrometheusOptions
Copy constructor- Parameters:
other- The otherVertxPrometheusOptionsto copy when creating this
-
VertxPrometheusOptions
Create an instance from aJsonObject- Parameters:
json- the JsonObject to create it from
-
-
Method Details
-
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
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
When true, an embedded server will init to expose metrics with Prometheus format. -
getEmbeddedServerOptions
Get the HTTP server options of the embedded server, if any -
setEmbeddedServerOptions
HTTP server options for the embedded server- Parameters:
embeddedServerOptions- the server options
-
setEmbeddedServerEndpoint
Set metrics endpoint. Use conjointly with the embedded server options. Defaults to /metrics.- Parameters:
embeddedServerEndpoint- metrics endpoint
-
getEmbeddedServerEndpoint
Get the HTTP endpoint used if an embedded server is configured -
isPublishQuantiles
public boolean isPublishQuantiles()- Returns:
- true if quantile stats are published
-
setPublishQuantiles
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
-