Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions extensions/agroal/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<runOrder>alphabetical</runOrder>
<systemPropertyVariables>
<quarkus.smallrye-metrics.deprecated.enabled>true</quarkus.smallrye-metrics.deprecated.enabled>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
Expand Down
5 changes: 5 additions & 0 deletions extensions/hibernate-orm/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<quarkus.smallrye-metrics.deprecated.enabled>true</quarkus.smallrye-metrics.deprecated.enabled>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<id>default-test</id>
Expand Down
8 changes: 8 additions & 0 deletions extensions/quartz/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<quarkus.smallrye-metrics.deprecated.enabled>true</quarkus.smallrye-metrics.deprecated.enabled>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</project>
3 changes: 3 additions & 0 deletions extensions/smallrye-graphql/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
true, some as false, so we need to create a separate JVM per test to run the initializer each time separately.
This is reported as https://github.com/smallrye/smallrye-graphql/issues/2039 -->
<reuseForks>false</reuseForks>
<systemPropertyVariables>
<quarkus.smallrye-metrics.deprecated.enabled>true</quarkus.smallrye-metrics.deprecated.enabled>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
Expand Down
8 changes: 8 additions & 0 deletions extensions/smallrye-metrics/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<quarkus.smallrye-metrics.deprecated.enabled>true</quarkus.smallrye-metrics.deprecated.enabled>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ public interface SmallRyeMetricsConfig {
@WithDefault("metrics")
String path();

/**
* If the extension should be enabled even if deprecated and scheduled for removal.
*/
@WithName("deprecated.enabled")
@WithDefault("false")
boolean deprecatedEnabled();

/**
* Whether metrics published by Quarkus extensions should be enabled.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import io.quarkus.arc.processor.BuiltinScope;
import io.quarkus.arc.processor.DotNames;
import io.quarkus.arc.processor.InterceptorInfo;
import io.quarkus.builder.BuildException;
import io.quarkus.deployment.Feature;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
Expand Down Expand Up @@ -97,7 +98,19 @@ MetricsConfigurationBuildItem metricsConfigurationBuildItem() {
}

@BuildStep
MetricsCapabilityBuildItem metricsCapabilityBuildItem(NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem) {
MetricsCapabilityBuildItem metricsCapabilityBuildItem(NonApplicationRootPathBuildItem nonApplicationRootPathBuildItem)
throws BuildException {
if (!metrics.deprecatedEnabled()) {
throw new BuildException("""
The Quarkus SmallRye Metrics is deprecated and will be removed in the near future. Please \
check our announcement at https://quarkus.io/blog/quarkus-observability-roadmap-2023/. Our \
recommendation is to migrate to Quarkus Micrometer Metrics \
https://quarkus.io/guides/telemetry-micrometer. If you wish to keep using Quarkus SmallRye \
Metrics, please reenable it with the configuration \
"quarkus.smallrye-metrics.deprecated.enabled=true".
""");
}

if (metrics.extensionsEnabled()) {
return new MetricsCapabilityBuildItem(MetricsFactory.MP_METRICS::equals,
nonApplicationRootPathBuildItem.resolvePath(metrics.path()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
quarkus.smallrye-metrics.deprecated.enabled=true

quarkus.datasource.db-kind=h2
quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test
quarkus.datasource.jdbc.max-size=8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
quarkus.smallrye-metrics.deprecated.enabled=true

quarkus.datasource.db-kind=h2
quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test
quarkus.datasource.jdbc.max-size=8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
quarkus.smallrye-metrics.deprecated.enabled=true

quarkus.datasource.db-kind=h2
quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:test
quarkus.datasource.jdbc.max-size=8
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
quarkus.smallrye-metrics.deprecated.enabled=true
quarkus.log.metrics.enabled=true
1 change: 1 addition & 0 deletions tcks/microprofile-fault-tolerance/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<quarkus.arc.remove-unused-beans>false</quarkus.arc.remove-unused-beans>
<smallrye.faulttolerance.mp-compatibility>true</smallrye.faulttolerance.mp-compatibility>
<quarkus.otel.metrics.enabled>true</quarkus.otel.metrics.enabled>
<quarkus.smallrye-metrics.deprecated.enabled>true</quarkus.smallrye-metrics.deprecated.enabled>
</systemPropertyVariables>
<!-- This workaround allows us to run a single test using
the "test" system property -->
Expand Down
1 change: 1 addition & 0 deletions tcks/microprofile-metrics/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<systemPropertyVariables>
<!-- Disable quarkus optimization -->
<quarkus.arc.remove-unused-beans>false</quarkus.arc.remove-unused-beans>
<quarkus.smallrye-metrics.deprecated.enabled>true</quarkus.smallrye-metrics.deprecated.enabled>
</systemPropertyVariables>
<!-- This workaround allows us to run a single test using
the "test" system property -->
Expand Down
1 change: 1 addition & 0 deletions tcks/microprofile-metrics/optional/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<!-- Change metrics endpoint to be /metrics -->
<quarkus.http.non-application-root-path>/</quarkus.http.non-application-root-path>
<context.root/>
<quarkus.smallrye-metrics.deprecated.enabled>true</quarkus.smallrye-metrics.deprecated.enabled>
</systemPropertyVariables>
<!-- This workaround allows us to run a single test using
the "test" system property -->
Expand Down
1 change: 1 addition & 0 deletions tcks/microprofile-metrics/rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<quarkus.arc.remove-unused-beans>false</quarkus.arc.remove-unused-beans>
<!-- Change metrics endpoint to be /metrics -->
<quarkus.http.non-application-root-path>/</quarkus.http.non-application-root-path>
<quarkus.smallrye-metrics.deprecated.enabled>true</quarkus.smallrye-metrics.deprecated.enabled>
</systemPropertyVariables>
<!-- This workaround allows us to run a single test using
the "test" system property -->
Expand Down
Loading