15234 switch to micrometer metrics

This commit is contained in:
Sebastian Schuster 2022-10-31 17:09:06 +01:00 committed by Pedro Igor
parent b7d7268744
commit 3c6e2c3c1e
8 changed files with 16 additions and 16 deletions

View file

@ -76,7 +76,11 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-metrics-deployment</artifactId>
<artifactId>quarkus-micrometer-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer-registry-prometheus-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>

View file

@ -77,7 +77,11 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-metrics</artifactId>
<artifactId>quarkus-micrometer</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>

View file

@ -33,8 +33,6 @@ import liquibase.Scope;
import org.hibernate.cfg.AvailableSettings;
import org.infinispan.manager.DefaultCacheManager;
import io.quarkus.smallrye.metrics.runtime.SmallRyeMetricsHandler;
import io.vertx.core.Handler;
import io.vertx.ext.web.RoutingContext;
import org.keycloak.Config;
@ -116,12 +114,6 @@ public class KeycloakRecorder {
});
}
public Handler<RoutingContext> createMetricsHandler(String path) {
SmallRyeMetricsHandler metricsHandler = new SmallRyeMetricsHandler();
metricsHandler.setMetricsPath(path);
return metricsHandler;
}
public HibernateOrmIntegrationRuntimeInitListener createUserDefinedUnitListener(String name) {
return new HibernateOrmIntegrationRuntimeInitListener() {
@Override

View file

@ -12,7 +12,7 @@ final class MetricsPropertyMappers {
public static PropertyMapper[] getMetricsPropertyMappers() {
return new PropertyMapper[] {
fromOption(MetricsOptions.METRICS_ENABLED)
.to("quarkus.smallrye-metrics.extensions.enabled")
.to("quarkus.micrometer.enabled")
.paramLabel(Boolean.TRUE + "|" + Boolean.FALSE)
.build()
};

View file

@ -10,7 +10,7 @@ quarkus.health.extensions.enabled=false
quarkus.datasource.health.enabled=false
# Enables metrics from other extensions if metrics is enabled
quarkus.datasource.metrics.enabled=${quarkus.smallrye-metrics.extensions.enabled}
quarkus.datasource.metrics.enabled=${quarkus.micrometer.enabled}
# Default transaction timeout
quarkus.transaction-manager.default-transaction-timeout=300

View file

@ -46,7 +46,7 @@ public class MetricsDistTest {
void testMetricsEndpoint() {
when().get("/metrics").then()
.statusCode(200)
.body(containsString("base_gc_total"));
.body(containsString("jvm_gc_"));
}
@Test
@ -54,7 +54,7 @@ public class MetricsDistTest {
void testMetricsEndpointUsingRelativePath() {
when().get("/auth/metrics").then()
.statusCode(200)
.body(containsString("base_gc_total"));
.body(containsString("jvm_gc_"));
}
@Test

View file

@ -167,7 +167,7 @@ public class QuarkusPropertiesAutoBuildDistTest {
@Override
public void accept(KeycloakDistribution distribution) {
distribution.setManualStop(true);
distribution.setQuarkusProperty("quarkus.smallrye-metrics.extensions.enabled","true");
distribution.setQuarkusProperty("quarkus.micrometer.enabled","true");
}
}
}

View file

@ -126,7 +126,7 @@ public class QuarkusPropertiesDistTest {
CLIResult cliResult = (CLIResult) result;
cliResult.assertNoBuild();
when().get("/metrics").then().statusCode(200)
.body(containsString("vendor_hibernate_cache_query_plan_total"));
.body(containsString("jvm_gc_"));
}
public static class UpdateConsoleLogLevelToWarnFromQuarkusProps implements Consumer<KeycloakDistribution> {