Skip to content

Commit

Permalink
Merge pull request #19496 from gsmet/fix-19480
Browse files Browse the repository at this point in the history
Properly deprecate quarkus.resteasy.metrics.enabled
  • Loading branch information
gsmet authored Aug 19, 2021
2 parents 4b76f8e + 6b70e67 commit d67f466
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,12 @@ static final class ResteasyConfig {
* See <a href=
* "https://github.com/eclipse/microprofile-metrics/blob/2.3.x/spec/src/main/asciidoc/required-metrics.adoc#optional-rest">MicroProfile
* Metrics: Optional REST metrics</a>.
* <p>
* Deprecated. Use {@code quarkus.smallrye-metrics.jaxrs.enabled}.
*
* @deprecated Use {@code quarkus.smallrye-metrics.jaxrs.enabled} instead.
*/
@ConfigItem(name = "metrics.enabled", defaultValue = "false")
public boolean metricsEnabled;
@Deprecated(forRemoval = true)
@ConfigItem(name = "metrics.enabled")
public Optional<Boolean> metricsEnabled;

/**
* Ignore all explicit JAX-RS {@link Application} classes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static class RestMetricsEnabled implements BooleanSupplier {
SmallRyeMetricsProcessor.SmallRyeMetricsConfig smConfig;

public boolean getAsBoolean() {
boolean resteasyConfigEnabled = ConfigProvider.getConfig().getOptionalValue(RESTEASY_CONFIG_PROPERTY, boolean.class)
boolean resteasyConfigEnabled = ConfigProvider.getConfig().getOptionalValue(RESTEASY_CONFIG_PROPERTY, Boolean.class)
.orElse(false);
return smConfig.extensionsEnabled && (smConfig.jaxrsEnabled || resteasyConfigEnabled);
}
Expand Down Expand Up @@ -73,7 +73,7 @@ void enableMetrics(Optional<MetricsCapabilityBuildItem> metricsCapabilityBuildIt
}

private void warnIfDeprecatedResteasyPropertiesPresent() {
if (ConfigProvider.getConfig().getOptionalValue(RESTEASY_CONFIG_PROPERTY, boolean.class).isPresent()) {
if (ConfigProvider.getConfig().getOptionalValue(RESTEASY_CONFIG_PROPERTY, Boolean.class).isPresent()) {
SmallRyeMetricsProcessor.LOGGER.warn(
"`quarkus.resteasy.metrics.enabled` is deprecated and will be removed in a future version. "
+ "Use `quarkus.smallrye-metrics.jaxrs.enabled` to enable metrics for REST endpoints "
Expand Down

0 comments on commit d67f466

Please sign in to comment.