diff --git a/testsuite/integration/microprofile/src/test/java/org/wildfly/test/integration/observability/micrometer/MicrometerOtelIntegrationTestCase.java b/testsuite/integration/microprofile/src/test/java/org/wildfly/test/integration/observability/micrometer/MicrometerOtelIntegrationTestCase.java index 9fd5b1d5894a..3cfd567b6015 100644 --- a/testsuite/integration/microprofile/src/test/java/org/wildfly/test/integration/observability/micrometer/MicrometerOtelIntegrationTestCase.java +++ b/testsuite/integration/microprofile/src/test/java/org/wildfly/test/integration/observability/micrometer/MicrometerOtelIntegrationTestCase.java @@ -97,14 +97,13 @@ public void getMetrics() throws InterruptedException { final List metrics = otelCollector.fetchMetrics(metricsToTest.get(0)); metricsToTest.forEach(n -> Assert.assertTrue("Missing metric: " + n, metrics.stream().anyMatch(m -> m.getKey().startsWith(n)))); + } - Map appMetrics = - metrics.stream().filter(m -> m.getTags().entrySet().stream() - .anyMatch(t -> "app".equals(t.getKey()) && DEPLOYMENT_NAME.equals(t.getValue())) - ) - .collect(Collectors.toMap(PrometheusMetric::getKey, i -> i)); - - List.of( + @Test + @RunAsClient + @InSequence(5) + public void testApplicationModelMetrics() throws InterruptedException { + List metricsToTest = List.of( "undertow_active_sessions", "undertow_expired_sessions_total", "undertow_highest_session_count", @@ -116,9 +115,20 @@ public void getMetrics() throws InterruptedException { "undertow_session_avg_alive_time_seconds", "undertow_session_max_alive_time_seconds", "undertow_sessions_created_total" - ).forEach(appMetrics::containsKey); + ); + final List metrics = otelCollector.fetchMetrics(metricsToTest.get(0)); + + Map appMetrics = + metrics.stream().filter(m -> m.getTags().entrySet().stream() + .anyMatch(t -> "app".equals(t.getKey()) && DEPLOYMENT_NAME.equals(t.getValue())) + ) + .collect(Collectors.toMap(PrometheusMetric::getKey, i -> i)); + + metricsToTest.forEach(m -> Assert.assertTrue("Missing app metric: " + m, appMetrics.containsKey(m))); } + + @Test @InSequence(5) public void testJmxMetrics() throws InterruptedException {