Search in sources :

Example 6 with VertxPrometheusOptions

use of io.vertx.micrometer.VertxPrometheusOptions in project vertx-micrometer-metrics by vert-x3.

the class PrometheusMetricsITest method shouldExcludeCategory.

@Test
public void shouldExcludeCategory(TestContext context) {
    vertx = Vertx.vertx(new VertxOptions().setMetricsOptions(new MicrometerMetricsOptions().setPrometheusOptions(new VertxPrometheusOptions().setEnabled(true).setStartEmbeddedServer(true).setEmbeddedServerOptions(new HttpServerOptions().setPort(9090))).addDisabledMetricsCategory(MetricsDomain.HTTP_SERVER).setEnabled(true)));
    Async async = context.async();
    tryConnect(vertx, context, 9090, "localhost", "/metrics", body -> {
        context.verify(v -> assertThat(body).contains("vertx_http_client_connections{local=\"?\",remote=\"localhost:9090\",} 1.0").doesNotContain("vertx_http_server_connections{local=\"0.0.0.0:9090\",remote=\"_\",} 1.0"));
        async.complete();
    }, 0);
    async.awaitSuccess(10000);
}
Also used : VertxPrometheusOptions(io.vertx.micrometer.VertxPrometheusOptions) Async(io.vertx.ext.unit.Async) HttpServerOptions(io.vertx.core.http.HttpServerOptions) VertxOptions(io.vertx.core.VertxOptions) MicrometerMetricsOptions(io.vertx.micrometer.MicrometerMetricsOptions) Test(org.junit.Test)

Aggregations

VertxOptions (io.vertx.core.VertxOptions)6 MicrometerMetricsOptions (io.vertx.micrometer.MicrometerMetricsOptions)6 VertxPrometheusOptions (io.vertx.micrometer.VertxPrometheusOptions)6 Async (io.vertx.ext.unit.Async)5 Test (org.junit.Test)5 HttpServerOptions (io.vertx.core.http.HttpServerOptions)3 PrometheusMeterRegistry (io.micrometer.prometheus.PrometheusMeterRegistry)2 Vertx (io.vertx.core.Vertx)2 HttpClientRequest (io.vertx.core.http.HttpClientRequest)2 Router (io.vertx.ext.web.Router)2 HttpClient (io.vertx.core.http.HttpClient)1 HttpServer (io.vertx.core.http.HttpServer)1 JsonArray (io.vertx.core.json.JsonArray)1 JsonObject (io.vertx.core.json.JsonObject)1 TestContext (io.vertx.ext.unit.TestContext)1 VertxUnitRunner (io.vertx.ext.unit.junit.VertxUnitRunner)1 MetricsService (io.vertx.micrometer.MetricsService)1 List (java.util.List)1 Map (java.util.Map)1 UUID (java.util.UUID)1