diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ConditionalOnEnabledMetricsExport.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ConditionalOnEnabledMetricsExport.java index 041f3db2fc..6ae494c64d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ConditionalOnEnabledMetricsExport.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ConditionalOnEnabledMetricsExport.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,9 +26,9 @@ import org.springframework.context.annotation.Conditional; /** * {@link Conditional @Conditional} that checks whether or not a metrics exporter is - * enabled. If the {@code management.metrics.export..enabled} property is configured + * enabled. If the {@code management..metrics.export.enabled} property is configured * then its value is used to determine if it matches. Otherwise, matches if the value of - * the {@code management.metrics.export.defaults.enabled} property is {@code true} or if + * the {@code management.defaults.metrics.export.enabled} property is {@code true} or if * it is not configured. * * @author Chris Bono diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/OnMetricsExportEnabledCondition.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/OnMetricsExportEnabledCondition.java index 52dcf35130..ad568a4998 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/OnMetricsExportEnabledCondition.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/OnMetricsExportEnabledCondition.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,18 +16,61 @@ package org.springframework.boot.actuate.autoconfigure.metrics.export; -import org.springframework.boot.actuate.autoconfigure.OnEndpointElementCondition; +import org.springframework.boot.autoconfigure.condition.ConditionMessage; +import org.springframework.boot.autoconfigure.condition.ConditionOutcome; +import org.springframework.boot.autoconfigure.condition.SpringBootCondition; import org.springframework.context.annotation.Condition; +import org.springframework.context.annotation.ConditionContext; +import org.springframework.core.annotation.AnnotationAttributes; +import org.springframework.core.env.Environment; +import org.springframework.core.type.AnnotatedTypeMetadata; /** * {@link Condition} that checks if a metrics exporter is enabled. * * @author Chris Bono + * @author Moritz Halbritter */ -class OnMetricsExportEnabledCondition extends OnEndpointElementCondition { +class OnMetricsExportEnabledCondition extends SpringBootCondition { - protected OnMetricsExportEnabledCondition() { - super("management.metrics.export.", ConditionalOnEnabledMetricsExport.class); + private static final String PROPERTY_TEMPLATE = "management.%s.metrics.export.enabled"; + + private static final String DEFAULT_PROPERTY_NAME = "management.defaults.metrics.export.enabled"; + + @Override + public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) { + AnnotationAttributes annotationAttributes = AnnotationAttributes + .fromMap(metadata.getAnnotationAttributes(ConditionalOnEnabledMetricsExport.class.getName())); + String endpointName = annotationAttributes.getString("value"); + ConditionOutcome outcome = getProductOutcome(context, endpointName); + if (outcome != null) { + return outcome; + } + return getDefaultOutcome(context); + } + + private ConditionOutcome getProductOutcome(ConditionContext context, String productName) { + Environment environment = context.getEnvironment(); + String enabledProperty = PROPERTY_TEMPLATE.formatted(productName); + if (environment.containsProperty(enabledProperty)) { + boolean match = environment.getProperty(enabledProperty, Boolean.class, true); + return new ConditionOutcome(match, ConditionMessage.forCondition(ConditionalOnEnabledMetricsExport.class) + .because(enabledProperty + " is " + match)); + } + return null; + } + + /** + * Return the default outcome that should be used if property is not set. By default + * this method will use the {@link #DEFAULT_PROPERTY_NAME} property, matching if it is + * {@code true} or if it is not configured. + * @param context the condition context + * @return the default outcome + */ + private ConditionOutcome getDefaultOutcome(ConditionContext context) { + boolean match = Boolean.parseBoolean(context.getEnvironment().getProperty(DEFAULT_PROPERTY_NAME, "true")); + return new ConditionOutcome(match, ConditionMessage.forCondition(ConditionalOnEnabledMetricsExport.class) + .because(DEFAULT_PROPERTY_NAME + " is considered " + match)); } } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsProperties.java index 991e733d9c..90367e5e24 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Stephane Nicoll * @since 2.1.0 */ -@ConfigurationProperties(prefix = "management.metrics.export.appoptics") +@ConfigurationProperties(prefix = "management.appoptics.metrics.export") public class AppOpticsProperties extends StepRegistryProperties { /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsPropertiesConfigAdapter.java index 5f7077e58d..90637d0ceb 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsPropertiesConfigAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ class AppOpticsPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapt @Override public String prefix() { - return "management.metrics.export.appoptics"; + return "management.appoptics.metrics.export"; } @Override diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasProperties.java index 55ca220957..f6fcfcce35 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Stephane Nicoll * @since 2.0.0 */ -@ConfigurationProperties(prefix = "management.metrics.export.atlas") +@ConfigurationProperties(prefix = "management.atlas.metrics.export") public class AtlasProperties { /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java index 139c16fd98..ea3a159ec6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Stephane Nicoll * @since 2.0.0 */ -@ConfigurationProperties(prefix = "management.metrics.export.datadog") +@ConfigurationProperties(prefix = "management.datadog.metrics.export") public class DatadogProperties extends StepRegistryProperties { /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogPropertiesConfigAdapter.java index d84d562f7d..0e61031309 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogPropertiesConfigAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,7 @@ class DatadogPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter @Override public String prefix() { - return "management.metrics.export.datadog"; + return "management.datadog.metrics.export"; } @Override diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceProperties.java index 4b70cc3a8c..10a837b889 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ import org.springframework.boot.context.properties.DeprecatedConfigurationProper * @author Georg Pirklbauer * @since 2.1.0 */ -@ConfigurationProperties(prefix = "management.metrics.export.dynatrace") +@ConfigurationProperties(prefix = "management.dynatrace.metrics.export") public class DynatraceProperties extends StepRegistryProperties { private final V1 v1 = new V1(); @@ -57,7 +57,7 @@ public class DynatraceProperties extends StepRegistryProperties { } @Deprecated - @DeprecatedConfigurationProperty(replacement = "management.metrics.export.dynatrace.v1.device-id") + @DeprecatedConfigurationProperty(replacement = "management.dynatrace.metrics.export.v1.device-id") public String getDeviceId() { return this.v1.getDeviceId(); } @@ -68,7 +68,7 @@ public class DynatraceProperties extends StepRegistryProperties { } @Deprecated - @DeprecatedConfigurationProperty(replacement = "management.metrics.export.dynatrace.v1.technology-type") + @DeprecatedConfigurationProperty(replacement = "management.dynatrace.metrics.export.v1.technology-type") public String getTechnologyType() { return this.v1.getTechnologyType(); } @@ -87,7 +87,7 @@ public class DynatraceProperties extends StepRegistryProperties { } @Deprecated - @DeprecatedConfigurationProperty(replacement = "management.metrics.export.dynatrace.v1.group") + @DeprecatedConfigurationProperty(replacement = "management.dynatrace.metrics.export.v1.group") public String getGroup() { return this.v1.getGroup(); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesConfigAdapter.java index f073267516..6bcb21b9de 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesConfigAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ class DynatracePropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapt @Override public String prefix() { - return "management.metrics.export.dynatrace"; + return "management.dynatrace.metrics.export"; } @Override diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticProperties.java index f3d0455c85..11278d1bfa 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Andy Wilkinson * @since 2.1.0 */ -@ConfigurationProperties(prefix = "management.metrics.export.elastic") +@ConfigurationProperties(prefix = "management.elastic.metrics.export") public class ElasticProperties extends StepRegistryProperties { /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticPropertiesConfigAdapter.java index 8c265aa67a..082cf58f6d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticPropertiesConfigAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ class ElasticPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter @Override public String prefix() { - return "management.metrics.export.elastic"; + return "management.elastic.metrics.export"; } @Override diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaProperties.java index 4eda7ce843..444ed30958 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaProperties.java @@ -31,7 +31,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Stephane Nicoll * @since 2.0.0 */ -@ConfigurationProperties(prefix = "management.metrics.export.ganglia") +@ConfigurationProperties(prefix = "management.ganglia.metrics.export") public class GangliaProperties { /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaPropertiesConfigAdapter.java index fd40daaf01..54a8c92775 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaPropertiesConfigAdapter.java @@ -38,7 +38,7 @@ class GangliaPropertiesConfigAdapter extends PropertiesConfigAdapter @Override public String prefix() { - return "management.metrics.export.jmx"; + return "management.jmx.metrics.export"; } @Override diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosProperties.java index f0770a40b3..2206ad973d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Stephane Nicoll * @since 2.1.0 */ -@ConfigurationProperties(prefix = "management.metrics.export.kairos") +@ConfigurationProperties(prefix = "management.kairos.metrics.export") public class KairosProperties extends StepRegistryProperties { /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosPropertiesConfigAdapter.java index 13f63c58f7..3c9d618f32 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosPropertiesConfigAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ class KairosPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter< @Override public String prefix() { - return "management.metrics.export.kairos"; + return "management.kairos.metrics.export"; } @Override diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicProperties.java index 62d0075e72..965bc5b17a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Neil Powell * @since 2.0.0 */ -@ConfigurationProperties(prefix = "management.metrics.export.newrelic") +@ConfigurationProperties(prefix = "management.newrelic.metrics.export") public class NewRelicProperties extends StepRegistryProperties { /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicPropertiesConfigAdapter.java index 60e0a33625..8da73dd35e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicPropertiesConfigAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ public class NewRelicPropertiesConfigAdapter extends StepRegistryPropertiesConfi @Override public String prefix() { - return "management.metrics.export.newrelic"; + return "management.newrelic.metrics.export"; } @Override diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java index 784da3e5d8..b5a520d1c0 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java @@ -104,7 +104,7 @@ public class PrometheusMetricsExportAutoConfiguration { */ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(PushGateway.class) - @ConditionalOnProperty(prefix = "management.metrics.export.prometheus.pushgateway", name = "enabled") + @ConditionalOnProperty(prefix = "management.prometheus.metrics.export.pushgateway", name = "enabled") public static class PrometheusPushGatewayConfiguration { private static final Log logger = LogFactory.getLog(PrometheusPushGatewayConfiguration.class); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusProperties.java index 41b7845f62..7ed888cbed 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusProperties.java @@ -33,7 +33,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; * @author Stephane Nicoll * @since 2.0.0 */ -@ConfigurationProperties(prefix = "management.metrics.export.prometheus") +@ConfigurationProperties(prefix = "management.prometheus.metrics.export") public class PrometheusProperties { /** diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusPropertiesConfigAdapter.java index f44f766891..5e2b4f42f3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusPropertiesConfigAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ class PrometheusPropertiesConfigAdapter extends PropertiesConfigAdapter", - "defaultValue": [ - "." - ] + "name": "management.metrics.export.datadog.host-tag", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.datadog.metrics.export.host-tag" + } }, { - "name": "management.metrics.web.client.request.autotime.enabled", - "description": "Whether to automatically time web client requests.", - "defaultValue": true + "name": "management.metrics.export.datadog.num-threads", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } }, { - "name": "management.metrics.web.client.request.autotime.percentiles", - "description": "Computed non-aggregable percentiles to publish." + "name": "management.metrics.export.datadog.read-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.datadog.metrics.export.read-timeout" + } }, { - "name": "management.metrics.web.client.request.autotime.percentiles-histogram", - "description": "Whether percentile histograms should be published.", - "defaultValue": false + "name": "management.metrics.export.datadog.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.datadog.metrics.export.step" + } }, { - "name": "management.metrics.web.client.requests-metric-name", + "name": "management.metrics.export.datadog.uri", "type": "java.lang.String", "deprecation": { - "replacement": "management.metrics.web.client.request.metric-name", - "level": "error" + "level": "error", + "replacement": "management.datadog.metrics.export.uri" } }, { - "name": "management.metrics.web.server.auto-time-requests", + "name": "management.metrics.export.defaults.enabled", "type": "java.lang.Boolean", "deprecation": { - "replacement": "management.metrics.web.server.request.autotime.enabled", - "level": "error" + "level": "error", + "replacement": "management.defaults.metrics.export.enabled" } }, { - "name": "management.metrics.web.server.request.autotime.enabled", - "description": "Whether to automatically time web server requests.", - "defaultValue": true + "name": "management.metrics.export.dynatrace.api-token", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.api-token" + } }, { - "name": "management.metrics.web.server.request.autotime.percentiles", - "description": "Computed non-aggregable percentiles to publish." + "name": "management.metrics.export.dynatrace.batch-size", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.batch-size" + } }, { - "name": "management.metrics.web.server.request.autotime.percentiles-histogram", - "description": "Whether percentile histograms should be published.", - "defaultValue": false + "name": "management.metrics.export.dynatrace.connect-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.connect-timeout" + } }, { - "name": "management.metrics.web.server.requests-metric-name", + "name": "management.metrics.export.dynatrace.device-id", "type": "java.lang.String", "deprecation": { - "replacement": "management.metrics.web.server.request.metric-name", - "level": "error" + "level": "error", + "replacement": "management.dynatrace.metrics.export.device-id" } }, { - "name": "management.server.add-application-context-header", + "name": "management.metrics.export.dynatrace.enabled", "type": "java.lang.Boolean", - "description": "Add the \"X-Application-Context\" HTTP header in each response.", - "defaultValue": false + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.enabled" + } }, { - "name": "management.server.servlet.context-path", + "name": "management.metrics.export.dynatrace.group", "type": "java.lang.String", "deprecation": { - "replacement": "management.server.base-path", - "level": "error" + "level": "error", + "replacement": "management.dynatrace.metrics.export.group" } }, { - "name": "management.server.ssl.ciphers", + "name": "management.metrics.export.dynatrace.num-threads", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.dynatrace.read-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.read-timeout" + } + }, + { + "name": "management.metrics.export.dynatrace.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.step" + } + }, + { + "name": "management.metrics.export.dynatrace.technology-type", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.technology-type" + } + }, + { + "name": "management.metrics.export.dynatrace.uri", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.uri" + } + }, + { + "name": "management.metrics.export.dynatrace.v1.device-id", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.v1.device-id" + } + }, + { + "name": "management.metrics.export.dynatrace.v1.group", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.v1.group" + } + }, + { + "name": "management.metrics.export.dynatrace.v1.technology-type", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.v1.technology-type" + } + }, + { + "name": "management.metrics.export.dynatrace.v2.default-dimensions", + "type": "java.util.Map", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.v2.default-dimensions" + } + }, + { + "name": "management.metrics.export.dynatrace.v2.enrich-with-dynatrace-metadata", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.v2.enrich-with-dynatrace-metadata" + } + }, + { + "name": "management.metrics.export.dynatrace.v2.metric-key-prefix", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.dynatrace.metrics.export.v2.metric-key-prefix" + } + }, + { + "name": "management.metrics.export.elastic.api-key-credentials", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.api-key-credentials" + } + }, + { + "name": "management.metrics.export.elastic.auto-create-index", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.auto-create-index" + } + }, + { + "name": "management.metrics.export.elastic.batch-size", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.batch-size" + } + }, + { + "name": "management.metrics.export.elastic.connect-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.connect-timeout" + } + }, + { + "name": "management.metrics.export.elastic.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.elastic.host", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.host" + } + }, + { + "name": "management.metrics.export.elastic.index", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.index" + } + }, + { + "name": "management.metrics.export.elastic.index-date-format", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.index-date-format" + } + }, + { + "name": "management.metrics.export.elastic.index-date-separator", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.index-date-separator" + } + }, + { + "name": "management.metrics.export.elastic.num-threads", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.elastic.password", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.password" + } + }, + { + "name": "management.metrics.export.elastic.pipeline", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.pipeline" + } + }, + { + "name": "management.metrics.export.elastic.read-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.read-timeout" + } + }, + { + "name": "management.metrics.export.elastic.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.step" + } + }, + { + "name": "management.metrics.export.elastic.timestamp-field-name", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.timestamp-field-name" + } + }, + { + "name": "management.metrics.export.elastic.user-name", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.elastic.metrics.export.user-name" + } + }, + { + "name": "management.metrics.export.ganglia.addressing-mode", + "type": "info.ganglia.gmetric4j.gmetric.GMetric$UDPAddressingMode", + "deprecation": { + "level": "error", + "replacement": "management.ganglia.metrics.export.addressing-mode" + } + }, + { + "name": "management.metrics.export.ganglia.duration-units", + "type": "java.util.concurrent.TimeUnit", + "deprecation": { + "level": "error", + "replacement": "management.ganglia.metrics.export.duration-units" + } + }, + { + "name": "management.metrics.export.ganglia.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.ganglia.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.ganglia.host", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.ganglia.metrics.export.host" + } + }, + { + "name": "management.metrics.export.ganglia.port", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.ganglia.metrics.export.port" + } + }, + { + "name": "management.metrics.export.ganglia.rate-units", + "type": "java.util.concurrent.TimeUnit", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.ganglia.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.ganglia.metrics.export.step" + } + }, + { + "name": "management.metrics.export.ganglia.time-to-live", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.ganglia.metrics.export.time-to-live" + } + }, + { + "name": "management.metrics.export.graphite.duration-units", + "type": "java.util.concurrent.TimeUnit", + "deprecation": { + "level": "error", + "replacement": "management.graphite.metrics.export.duration-units" + } + }, + { + "name": "management.metrics.export.graphite.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.graphite.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.graphite.graphite-tags-enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.graphite.metrics.export.graphite-tags-enabled" + } + }, + { + "name": "management.metrics.export.graphite.host", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.graphite.metrics.export.host" + } + }, + { + "name": "management.metrics.export.graphite.port", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.graphite.metrics.export.port" + } + }, + { + "name": "management.metrics.export.graphite.protocol", + "type": "io.micrometer.graphite.GraphiteProtocol", + "deprecation": { + "level": "error", + "replacement": "management.graphite.metrics.export.protocol" + } + }, + { + "name": "management.metrics.export.graphite.rate-units", + "type": "java.util.concurrent.TimeUnit", + "deprecation": { + "level": "error", + "replacement": "management.graphite.metrics.export.rate-units" + } + }, + { + "name": "management.metrics.export.graphite.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.graphite.metrics.export.step" + } + }, + { + "name": "management.metrics.export.graphite.tags-as-prefix", + "type": "java.lang.String[]", + "deprecation": { + "level": "error", + "replacement": "management.graphite.metrics.export.tags-as-prefix" + } + }, + { + "name": "management.metrics.export.humio.api-token", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.humio.metrics.export.api-token" + } + }, + { + "name": "management.metrics.export.humio.batch-size", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.humio.metrics.export.batch-size" + } + }, + { + "name": "management.metrics.export.humio.connect-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.humio.metrics.export.connect-timeout" + } + }, + { + "name": "management.metrics.export.humio.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.humio.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.humio.num-threads", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.humio.read-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.humio.metrics.export.read-timeout" + } + }, + { + "name": "management.metrics.export.humio.repository", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.humio.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.humio.metrics.export.step" + } + }, + { + "name": "management.metrics.export.humio.tags", + "type": "java.util.Map", + "deprecation": { + "level": "error", + "replacement": "management.humio.metrics.export.tags" + } + }, + { + "name": "management.metrics.export.humio.uri", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.humio.metrics.export.uri" + } + }, + { + "name": "management.metrics.export.influx.api-version", + "type": "io.micrometer.influx.InfluxApiVersion", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.api-version" + } + }, + { + "name": "management.metrics.export.influx.auto-create-db", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.auto-create-db" + } + }, + { + "name": "management.metrics.export.influx.batch-size", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.batch-size" + } + }, + { + "name": "management.metrics.export.influx.bucket", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.bucket" + } + }, + { + "name": "management.metrics.export.influx.compressed", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.compressed" + } + }, + { + "name": "management.metrics.export.influx.connect-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.connect-timeout" + } + }, + { + "name": "management.metrics.export.influx.consistency", + "type": "io.micrometer.influx.InfluxConsistency", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.consistency" + } + }, + { + "name": "management.metrics.export.influx.db", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.db" + } + }, + { + "name": "management.metrics.export.influx.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.influx.num-threads", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.influx.org", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.org" + } + }, + { + "name": "management.metrics.export.influx.password", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.password" + } + }, + { + "name": "management.metrics.export.influx.read-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.read-timeout" + } + }, + { + "name": "management.metrics.export.influx.retention-duration", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.retention-duration" + } + }, + { + "name": "management.metrics.export.influx.retention-policy", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.retention-policy" + } + }, + { + "name": "management.metrics.export.influx.retention-replication-factor", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.retention-replication-factor" + } + }, + { + "name": "management.metrics.export.influx.retention-shard-duration", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.retention-shard-duration" + } + }, + { + "name": "management.metrics.export.influx.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.step" + } + }, + { + "name": "management.metrics.export.influx.token", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.token" + } + }, + { + "name": "management.metrics.export.influx.uri", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.uri" + } + }, + { + "name": "management.metrics.export.influx.user-name", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.influx.metrics.export.user-name" + } + }, + { + "name": "management.metrics.export.jmx.domain", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.jmx.metrics.export.domain" + } + }, + { + "name": "management.metrics.export.jmx.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.jmx.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.jmx.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.jmx.metrics.export.step" + } + }, + { + "name": "management.metrics.export.kairos.batch-size", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.kairos.metrics.export.batch-size" + } + }, + { + "name": "management.metrics.export.kairos.connect-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.kairos.metrics.export.connect-timeout" + } + }, + { + "name": "management.metrics.export.kairos.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.kairos.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.kairos.num-threads", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.kairos.password", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.kairos.metrics.export.password" + } + }, + { + "name": "management.metrics.export.kairos.read-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.kairos.metrics.export.read-timeout" + } + }, + { + "name": "management.metrics.export.kairos.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.kairos.metrics.export.step" + } + }, + { + "name": "management.metrics.export.kairos.uri", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.kairos.metrics.export.uri" + } + }, + { + "name": "management.metrics.export.kairos.user-name", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.kairos.metrics.export.user-name" + } + }, + { + "name": "management.metrics.export.newrelic.account-id", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.newrelic.metrics.export.account-id" + } + }, + { + "name": "management.metrics.export.newrelic.api-key", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.newrelic.metrics.export.api-key" + } + }, + { + "name": "management.metrics.export.newrelic.batch-size", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.newrelic.metrics.export.batch-size" + } + }, + { + "name": "management.metrics.export.newrelic.client-provider-type", + "type": "io.micrometer.newrelic.ClientProviderType", + "deprecation": { + "level": "error", + "replacement": "management.newrelic.metrics.export.client-provider-type" + } + }, + { + "name": "management.metrics.export.newrelic.connect-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.newrelic.metrics.export.connect-timeout" + } + }, + { + "name": "management.metrics.export.newrelic.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.newrelic.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.newrelic.event-type", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.newrelic.metrics.export.event-type" + } + }, + { + "name": "management.metrics.export.newrelic.meter-name-event-type-enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.newrelic.metrics.export.meter-name-event-type-enabled" + } + }, + { + "name": "management.metrics.export.newrelic.num-threads", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.newrelic.read-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.newrelic.metrics.export.read-timeout" + } + }, + { + "name": "management.metrics.export.newrelic.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.newrelic.metrics.export.step" + } + }, + { + "name": "management.metrics.export.newrelic.uri", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.newrelic.metrics.export.uri" + } + }, + { + "name": "management.metrics.export.prometheus.descriptions", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.descriptions" + } + }, + { + "name": "management.metrics.export.prometheus.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.prometheus.histogram-flavor", + "type": "io.micrometer.prometheus.HistogramFlavor", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.histogram-flavor" + } + }, + { + "name": "management.metrics.export.prometheus.pushgateway.base-url", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.pushgateway.base-url" + } + }, + { + "name": "management.metrics.export.prometheus.pushgateway.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.pushgateway.enabled" + } + }, + { + "name": "management.metrics.export.prometheus.pushgateway.grouping-key", + "type": "java.util.Map", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.pushgateway.grouping-key" + } + }, + { + "name": "management.metrics.export.prometheus.pushgateway.job", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.pushgateway.job" + } + }, + { + "name": "management.metrics.export.prometheus.pushgateway.password", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.pushgateway.password" + } + }, + { + "name": "management.metrics.export.prometheus.pushgateway.push-rate", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.pushgateway.push-rate" + } + }, + { + "name": "management.metrics.export.prometheus.pushgateway.shutdown-operation", + "type": "org.springframework.boot.actuate.metrics.export.prometheus.PrometheusPushGatewayManager$ShutdownOperation", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.pushgateway.shutdown-operation" + } + }, + { + "name": "management.metrics.export.prometheus.pushgateway.username", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.pushgateway.username" + } + }, + { + "name": "management.metrics.export.prometheus.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.prometheus.metrics.export.step" + } + }, + { + "name": "management.metrics.export.signalfx.access-token", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.signalfx.metrics.export.access-token" + } + }, + { + "name": "management.metrics.export.signalfx.batch-size", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.signalfx.metrics.export.batch-size" + } + }, + { + "name": "management.metrics.export.signalfx.connect-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.signalfx.metrics.export.connect-timeout" + } + }, + { + "name": "management.metrics.export.signalfx.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.signalfx.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.signalfx.num-threads", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.signalfx.read-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.signalfx.metrics.export.read-timeout" + } + }, + { + "name": "management.metrics.export.signalfx.source", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.signalfx.metrics.export.source" + } + }, + { + "name": "management.metrics.export.signalfx.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.signalfx.metrics.export.step" + } + }, + { + "name": "management.metrics.export.signalfx.uri", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.signalfx.metrics.export.uri" + } + }, + { + "name": "management.metrics.export.simple.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.simple.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.simple.mode", + "type": "io.micrometer.core.instrument.simple.CountingMode", + "deprecation": { + "level": "error", + "replacement": "management.simple.metrics.export.mode" + } + }, + { + "name": "management.metrics.export.simple.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.simple.metrics.export.step" + } + }, + { + "name": "management.metrics.export.stackdriver.batch-size", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.stackdriver.metrics.export.batch-size" + } + }, + { + "name": "management.metrics.export.stackdriver.connect-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.stackdriver.metrics.export.connect-timeout" + } + }, + { + "name": "management.metrics.export.stackdriver.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.stackdriver.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.stackdriver.num-threads", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.stackdriver.project-id", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.stackdriver.metrics.export.project-id" + } + }, + { + "name": "management.metrics.export.stackdriver.read-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.stackdriver.metrics.export.read-timeout" + } + }, + { + "name": "management.metrics.export.stackdriver.resource-labels", + "type": "java.util.Map", + "deprecation": { + "level": "error", + "replacement": "management.stackdriver.metrics.export.resource-labels" + } + }, + { + "name": "management.metrics.export.stackdriver.resource-type", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.stackdriver.metrics.export.resource-type" + } + }, + { + "name": "management.metrics.export.stackdriver.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.stackdriver.metrics.export.step" + } + }, + { + "name": "management.metrics.export.stackdriver.use-semantic-metric-types", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.stackdriver.metrics.export.use-semantic-metric-types" + } + }, + { + "name": "management.metrics.export.statsd.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.statsd.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.statsd.flavor", + "type": "io.micrometer.statsd.StatsdFlavor", + "deprecation": { + "level": "error", + "replacement": "management.statsd.metrics.export.flavor" + } + }, + { + "name": "management.metrics.export.statsd.host", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.statsd.metrics.export.host" + } + }, + { + "name": "management.metrics.export.statsd.max-packet-length", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.statsd.metrics.export.max-packet-length" + } + }, + { + "name": "management.metrics.export.statsd.polling-frequency", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.statsd.metrics.export.polling-frequency" + } + }, + { + "name": "management.metrics.export.statsd.port", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.statsd.metrics.export.port" + } + }, + { + "name": "management.metrics.export.statsd.protocol", + "type": "io.micrometer.statsd.StatsdProtocol", + "deprecation": { + "level": "error", + "replacement": "management.statsd.metrics.export.protocol" + } + }, + { + "name": "management.metrics.export.statsd.publish-unchanged-meters", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.statsd.metrics.export.publish-unchanged-meters" + } + }, + { + "name": "management.metrics.export.statsd.queue-size", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.wavefront.api-token", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.wavefront.metrics.export.api-token" + } + }, + { + "name": "management.metrics.export.wavefront.batch-size", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.wavefront.metrics.export.batch-size" + } + }, + { + "name": "management.metrics.export.wavefront.connect-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.wavefront.enabled", + "type": "java.lang.Boolean", + "deprecation": { + "level": "error", + "replacement": "management.wavefront.metrics.export.enabled" + } + }, + { + "name": "management.metrics.export.wavefront.global-prefix", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.wavefront.metrics.export.global-prefix" + } + }, + { + "name": "management.metrics.export.wavefront.num-threads", + "type": "java.lang.Integer", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.wavefront.read-timeout", + "type": "java.time.Duration", + "deprecation": { + "level": "error" + } + }, + { + "name": "management.metrics.export.wavefront.sender.flush-interval", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.wavefront.metrics.export.sender.flush-interval" + } + }, + { + "name": "management.metrics.export.wavefront.sender.max-queue-size", + "type": "java.lang.Integer", + "deprecation": { + "level": "error", + "replacement": "management.wavefront.metrics.export.sender.max-queue-size" + } + }, + { + "name": "management.metrics.export.wavefront.sender.message-size", + "type": "org.springframework.util.unit.DataSize", + "deprecation": { + "level": "error", + "replacement": "management.wavefront.metrics.export.sender.message-size" + } + }, + { + "name": "management.metrics.export.wavefront.source", + "type": "java.lang.String", + "deprecation": { + "level": "error", + "replacement": "management.wavefront.metrics.export.source" + } + }, + { + "name": "management.metrics.export.wavefront.step", + "type": "java.time.Duration", + "deprecation": { + "level": "error", + "replacement": "management.wavefront.metrics.export.step" + } + }, + { + "name": "management.metrics.export.wavefront.uri", + "type": "java.net.URI", + "deprecation": { + "level": "error", + "replacement": "management.wavefront.metrics.export.uri" + } + }, + { + "name": "management.metrics.mongo.command.enabled", + "description": "Whether to enable Mongo client command metrics.", + "defaultValue": true + }, + { + "name": "management.metrics.mongo.connectionpool.enabled", + "description": "Whether to enable Mongo connection pool metrics.", + "defaultValue": true + }, + { + "name": "management.metrics.system.diskspace.paths", + "type": "java.util.List", + "defaultValue": [ + "." + ] + }, + { + "name": "management.metrics.web.client.request.autotime.enabled", + "description": "Whether to automatically time web client requests.", + "defaultValue": true + }, + { + "name": "management.metrics.web.client.request.autotime.percentiles", + "description": "Computed non-aggregable percentiles to publish." + }, + { + "name": "management.metrics.web.client.request.autotime.percentiles-histogram", + "description": "Whether percentile histograms should be published.", + "defaultValue": false + }, + { + "name": "management.metrics.web.client.requests-metric-name", + "type": "java.lang.String", + "deprecation": { + "replacement": "management.metrics.web.client.request.metric-name", + "level": "error" + } + }, + { + "name": "management.metrics.web.server.auto-time-requests", + "type": "java.lang.Boolean", + "deprecation": { + "replacement": "management.metrics.web.server.request.autotime.enabled", + "level": "error" + } + }, + { + "name": "management.metrics.web.server.request.autotime.enabled", + "description": "Whether to automatically time web server requests.", + "defaultValue": true + }, + { + "name": "management.metrics.web.server.request.autotime.percentiles", + "description": "Computed non-aggregable percentiles to publish." + }, + { + "name": "management.metrics.web.server.request.autotime.percentiles-histogram", + "description": "Whether percentile histograms should be published.", + "defaultValue": false + }, + { + "name": "management.metrics.web.server.requests-metric-name", + "type": "java.lang.String", + "deprecation": { + "replacement": "management.metrics.web.server.request.metric-name", + "level": "error" + } + }, + { + "name": "management.prometheus.metrics.export.histogram-flavor", + "defaultValue": "prometheus" + }, + { + "name": "management.prometheus.metrics.export.pushgateway.shutdown-operation", + "defaultValue": "none" + }, + { + "name": "management.server.add-application-context-header", + "type": "java.lang.Boolean", + "description": "Add the \"X-Application-Context\" HTTP header in each response.", + "defaultValue": false + }, + { + "name": "management.server.servlet.context-path", + "type": "java.lang.String", + "deprecation": { + "replacement": "management.server.base-path", + "level": "error" + } + }, + { + "name": "management.server.ssl.ciphers", "description": "Supported SSL ciphers." }, { @@ -661,6 +2075,18 @@ "name": "management.server.ssl.trust-store-type", "description": "Type of the trust store." }, + { + "name": "management.simple.metrics.export.mode", + "defaultValue": "cumulative" + }, + { + "name": "management.statsd.metrics.export.flavor", + "defaultValue": "datadog" + }, + { + "name": "management.statsd.metrics.export.protocol", + "defaultValue": "udp" + }, { "name": "management.trace.http.enabled", "type": "java.lang.Boolean", diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/ValidationFailureAnalyzerTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/ValidationFailureAnalyzerTests.java index 804748c5fc..4a8f4e0d6b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/ValidationFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/ValidationFailureAnalyzerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,10 +44,10 @@ class ValidationFailureAnalyzerTests { FailureAnalysis analysis = new ValidationFailureAnalyzer() .analyze(createFailure(MissingAccountIdAndApiKeyConfiguration.class)); assertThat(analysis).isNotNull(); - assertThat(analysis.getCause().getMessage()).contains("management.metrics.export.newrelic.apiKey was 'null'"); + assertThat(analysis.getCause().getMessage()).contains("management.newrelic.metrics.export.apiKey was 'null'"); assertThat(analysis.getDescription()).isEqualTo(String.format("Invalid Micrometer configuration detected:%n%n" - + " - management.metrics.export.newrelic.apiKey was 'null' but it is required when publishing to Insights API%n" - + " - management.metrics.export.newrelic.accountId was 'null' but it is required when publishing to Insights API")); + + " - management.newrelic.metrics.export.apiKey was 'null' but it is required when publishing to Insights API%n" + + " - management.newrelic.metrics.export.accountId was 'null' but it is required when publishing to Insights API")); } private Exception createFailure(Class configuration) { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ConditionalOnEnabledMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ConditionalOnEnabledMetricsExportAutoConfigurationTests.java index f00365ab08..f5af6d67cc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ConditionalOnEnabledMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ConditionalOnEnabledMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,21 +39,21 @@ class ConditionalOnEnabledMetricsExportAutoConfigurationTests { @Test void exporterCanBeSpecificallyDisabled() { - this.contextRunner.withPropertyValues("management.metrics.export.simple.enabled=false") + this.contextRunner.withPropertyValues("management.simple.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean("simpleMeterRegistry")); } @Test void exporterCanBeGloballyDisabled() { - this.contextRunner.withPropertyValues("management.metrics.export.defaults.enabled=false") + this.contextRunner.withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean("simpleMeterRegistry")); } @Test void exporterCanBeGloballyDisabledWithSpecificOverride() { this.contextRunner - .withPropertyValues("management.metrics.export.defaults.enabled=false", - "management.metrics.export.simple.enabled=true") + .withPropertyValues("management.defaults.metrics.export.enabled=false", + "management.simple.metrics.export.enabled=true") .run((context) -> assertThat(context).hasBean("simpleMeterRegistry")); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsMetricsExportAutoConfigurationTests.java index c40f213733..05a14b771f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,7 +46,7 @@ class AppOpticsMetricsExportAutoConfigurationTests { @Test void autoConfiguresItsConfigAndMeterRegistry() { - this.contextRunner.withPropertyValues("management.metrics.export.appoptics.api-token=abcde") + this.contextRunner.withPropertyValues("management.appoptics.metrics.export.api-token=abcde") .withUserConfiguration(BaseConfiguration.class).run((context) -> assertThat(context) .hasSingleBean(AppOpticsMeterRegistry.class).hasSingleBean(AppOpticsConfig.class)); } @@ -54,7 +54,7 @@ class AppOpticsMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(AppOpticsMeterRegistry.class) .doesNotHaveBean(AppOpticsConfig.class)); } @@ -62,7 +62,7 @@ class AppOpticsMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.appoptics.enabled=false") + .withPropertyValues("management.appoptics.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(AppOpticsMeterRegistry.class) .doesNotHaveBean(AppOpticsConfig.class)); } @@ -76,7 +76,7 @@ class AppOpticsMetricsExportAutoConfigurationTests { @Test void allowsCustomRegistryToBeUsed() { - this.contextRunner.withPropertyValues("management.metrics.export.appoptics.api-token=abcde") + this.contextRunner.withPropertyValues("management.appoptics.metrics.export.api-token=abcde") .withUserConfiguration(CustomRegistryConfiguration.class) .run((context) -> assertThat(context).hasSingleBean(AppOpticsMeterRegistry.class) .hasBean("customRegistry").hasSingleBean(AppOpticsConfig.class)); @@ -84,7 +84,7 @@ class AppOpticsMetricsExportAutoConfigurationTests { @Test void stopsMeterRegistryWhenContextIsClosed() { - this.contextRunner.withPropertyValues("management.metrics.export.appoptics.api-token=abcde") + this.contextRunner.withPropertyValues("management.appoptics.metrics.export.api-token=abcde") .withUserConfiguration(BaseConfiguration.class).run((context) -> { AppOpticsMeterRegistry registry = context.getBean(AppOpticsMeterRegistry.class); assertThat(registry.isClosed()).isFalse(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasMetricsExportAutoConfigurationTests.java index f0fdf313f1..6d24e0cc17 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class AtlasMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(AtlasMeterRegistry.class) .doesNotHaveBean(AtlasConfig.class)); } @@ -61,7 +61,7 @@ class AtlasMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.atlas.enabled=false") + .withPropertyValues("management.atlas.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(AtlasMeterRegistry.class) .doesNotHaveBean(AtlasConfig.class)); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogMetricsExportAutoConfigurationTests.java index abb6192b06..50202cb474 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/datadog/DatadogMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class DatadogMetricsExportAutoConfigurationTests { @Test void autoConfiguresConfigAndMeterRegistry() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.datadog.api-key=abcde") + .withPropertyValues("management.datadog.metrics.export.api-key=abcde") .run((context) -> assertThat(context).hasSingleBean(DatadogMeterRegistry.class) .hasSingleBean(DatadogConfig.class)); } @@ -61,7 +61,7 @@ class DatadogMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(DatadogMeterRegistry.class) .doesNotHaveBean(DatadogConfig.class)); } @@ -69,7 +69,7 @@ class DatadogMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.datadog.enabled=false") + .withPropertyValues("management.datadog.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(DatadogMeterRegistry.class) .doesNotHaveBean(DatadogConfig.class)); } @@ -83,7 +83,7 @@ class DatadogMetricsExportAutoConfigurationTests { @Test void allowsCustomRegistryToBeUsed() { this.contextRunner.withUserConfiguration(CustomRegistryConfiguration.class) - .withPropertyValues("management.metrics.export.datadog.api-key=abcde") + .withPropertyValues("management.datadog.metrics.export.api-key=abcde") .run((context) -> assertThat(context).hasSingleBean(DatadogMeterRegistry.class) .hasBean("customRegistry").hasSingleBean(DatadogConfig.class)); } @@ -91,7 +91,7 @@ class DatadogMetricsExportAutoConfigurationTests { @Test void stopsMeterRegistryWhenContextIsClosed() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.datadog.api-key=abcde").run((context) -> { + .withPropertyValues("management.datadog.metrics.export.api-key=abcde").run((context) -> { DatadogMeterRegistry registry = context.getBean(DatadogMeterRegistry.class); assertThat(registry.isClosed()).isFalse(); context.close(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceMetricsExportAutoConfigurationTests.java index dfd6dc6ffc..7b24f2857f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,7 @@ class DynatraceMetricsExportAutoConfigurationTests { @Test void failsWithADeviceIdWithoutAUri() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.dynatrace.device-id:dev-1") + .withPropertyValues("management.dynatrace.metrics.export.device-id:dev-1") .run((context) -> assertThat(context).hasFailed()); } @@ -64,7 +64,7 @@ class DynatraceMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(DynatraceMeterRegistry.class) .doesNotHaveBean(DynatraceConfig.class)); } @@ -72,7 +72,7 @@ class DynatraceMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.dynatrace.enabled=false") + .withPropertyValues("management.dynatrace.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(DynatraceMeterRegistry.class) .doesNotHaveBean(DynatraceConfig.class)); } @@ -114,9 +114,9 @@ class DynatraceMetricsExportAutoConfigurationTests { private Function v1MandatoryProperties() { return (runner) -> runner.withPropertyValues( - "management.metrics.export.dynatrace.uri=https://dynatrace.example.com", - "management.metrics.export.dynatrace.api-token=abcde", - "management.metrics.export.dynatrace.device-id=test"); + "management.dynatrace.metrics.export.uri=https://dynatrace.example.com", + "management.dynatrace.metrics.export.api-token=abcde", + "management.dynatrace.metrics.export.device-id=test"); } @Configuration(proxyBeanMethods = false) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticMetricsExportAutoConfigurationTests.java index 5cc9071bbf..1d92541165 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ class ElasticMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(ElasticMeterRegistry.class) .doesNotHaveBean(ElasticConfig.class)); } @@ -62,7 +62,7 @@ class ElasticMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.elastic.enabled=false") + .withPropertyValues("management.elastic.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(ElasticMeterRegistry.class) .doesNotHaveBean(ElasticConfig.class)); } @@ -94,8 +94,8 @@ class ElasticMetricsExportAutoConfigurationTests { @Test void apiKeyCredentialsIsMutuallyExclusiveWithUserName() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.elastic.api-key-credentials:secret", - "management.metrics.export.elastic.user-name:alice") + .withPropertyValues("management.elastic.metrics.export.api-key-credentials:secret", + "management.elastic.metrics.export.user-name:alice") .run((context) -> assertThat(context).hasFailed().getFailure().getRootCause() .isInstanceOf(MutuallyExclusiveConfigurationPropertiesException.class)); } @@ -103,8 +103,8 @@ class ElasticMetricsExportAutoConfigurationTests { @Test void apiKeyCredentialsIsMutuallyExclusiveWithPassword() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.elastic.api-key-credentials:secret", - "management.metrics.export.elastic.password:secret") + .withPropertyValues("management.elastic.metrics.export.api-key-credentials:secret", + "management.elastic.metrics.export.password:secret") .run((context) -> assertThat(context).hasFailed().getFailure().getRootCause() .isInstanceOf(MutuallyExclusiveConfigurationPropertiesException.class)); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaMetricsExportAutoConfigurationTests.java index 8dad0fbfac..d7485f1554 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/ganglia/GangliaMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class GangliaMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(GangliaMeterRegistry.class) .doesNotHaveBean(GangliaConfig.class)); } @@ -61,7 +61,7 @@ class GangliaMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.ganglia.enabled=false") + .withPropertyValues("management.ganglia.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(GangliaMeterRegistry.class) .doesNotHaveBean(GangliaConfig.class)); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/graphite/GraphiteMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/graphite/GraphiteMetricsExportAutoConfigurationTests.java index d2c0bdb55b..8bcf7e996f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/graphite/GraphiteMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/graphite/GraphiteMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ class GraphiteMetricsExportAutoConfigurationTests { @Test void autoConfiguresUseTagsAsPrefix() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.graphite.tags-as-prefix=app").run((context) -> { + .withPropertyValues("management.graphite.metrics.export.tags-as-prefix=app").run((context) -> { assertThat(context).hasSingleBean(GraphiteMeterRegistry.class); GraphiteMeterRegistry registry = context.getBean(GraphiteMeterRegistry.class); registry.counter("test.count", Tags.of("app", "myapp")); @@ -60,8 +60,8 @@ class GraphiteMetricsExportAutoConfigurationTests { @Test void autoConfiguresWithTagsAsPrefixCanBeDisabled() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.graphite.tags-as-prefix=app", - "management.metrics.export.graphite.graphite-tags-enabled=true") + .withPropertyValues("management.graphite.metrics.export.tags-as-prefix=app", + "management.graphite.metrics.export.graphite-tags-enabled=true") .run((context) -> { assertThat(context).hasSingleBean(GraphiteMeterRegistry.class); GraphiteMeterRegistry registry = context.getBean(GraphiteMeterRegistry.class); @@ -79,7 +79,7 @@ class GraphiteMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(GraphiteMeterRegistry.class) .doesNotHaveBean(GraphiteConfig.class)); } @@ -87,7 +87,7 @@ class GraphiteMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.graphite.enabled=false") + .withPropertyValues("management.graphite.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(GraphiteMeterRegistry.class) .doesNotHaveBean(GraphiteConfig.class)); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/humio/HumioMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/humio/HumioMetricsExportAutoConfigurationTests.java index 48e993f495..d96bcd3508 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/humio/HumioMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/humio/HumioMetricsExportAutoConfigurationTests.java @@ -54,7 +54,7 @@ class HumioMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(HumioMeterRegistry.class) .doesNotHaveBean(HumioConfig.class)); } @@ -62,7 +62,7 @@ class HumioMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.humio.enabled=false") + .withPropertyValues("management.humio.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(HumioMeterRegistry.class) .doesNotHaveBean(HumioConfig.class)); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxMetricsExportAutoConfigurationTests.java index 5b306b7f61..b9a7e09555 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class InfluxMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(InfluxMeterRegistry.class) .doesNotHaveBean(InfluxConfig.class)); } @@ -61,7 +61,7 @@ class InfluxMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.influx.enabled=false") + .withPropertyValues("management.influx.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(InfluxMeterRegistry.class) .doesNotHaveBean(InfluxConfig.class)); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/jmx/JmxMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/jmx/JmxMetricsExportAutoConfigurationTests.java index fc303d940b..79eaecb3fb 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/jmx/JmxMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/jmx/JmxMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class JmxMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(JmxMeterRegistry.class) .doesNotHaveBean(JmxConfig.class)); } @@ -61,7 +61,7 @@ class JmxMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.jmx.enabled=false").run((context) -> assertThat(context) + .withPropertyValues("management.jmx.metrics.export.enabled=false").run((context) -> assertThat(context) .doesNotHaveBean(JmxMeterRegistry.class).doesNotHaveBean(JmxConfig.class)); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosMetricsExportAutoConfigurationTests.java index 44d73ac432..2e30390154 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/kairos/KairosMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class KairosMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(KairosMeterRegistry.class) .doesNotHaveBean(KairosConfig.class)); } @@ -61,7 +61,7 @@ class KairosMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.kairos.enabled=false") + .withPropertyValues("management.kairos.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(KairosMeterRegistry.class) .doesNotHaveBean(KairosConfig.class)); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicMetricsExportAutoConfigurationTests.java index e0f063cc63..e38feddb9d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/newrelic/NewRelicMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,32 +51,32 @@ class NewRelicMetricsExportAutoConfigurationTests { @Test void failsWithoutAnApiKey() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.newrelic.account-id=12345") + .withPropertyValues("management.newrelic.metrics.export.account-id=12345") .run((context) -> assertThat(context).hasFailed()); } @Test void failsWithoutAnAccountId() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.newrelic.api-key=abcde") + .withPropertyValues("management.newrelic.metrics.export.api-key=abcde") .run((context) -> assertThat(context).hasFailed()); } @Test void failsToAutoConfigureWithoutEventType() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.newrelic.api-key=abcde", - "management.metrics.export.newrelic.account-id=12345", - "management.metrics.export.newrelic.event-type=") + .withPropertyValues("management.newrelic.metrics.export.api-key=abcde", + "management.newrelic.metrics.export.account-id=12345", + "management.newrelic.metrics.export.event-type=") .run((context) -> assertThat(context).hasFailed()); } @Test void autoConfiguresWithEventTypeOverridden() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.newrelic.api-key=abcde", - "management.metrics.export.newrelic.account-id=12345", - "management.metrics.export.newrelic.event-type=wxyz") + .withPropertyValues("management.newrelic.metrics.export.api-key=abcde", + "management.newrelic.metrics.export.account-id=12345", + "management.newrelic.metrics.export.event-type=wxyz") .run((context) -> assertThat(context).hasSingleBean(NewRelicMeterRegistry.class) .hasSingleBean(Clock.class).hasSingleBean(NewRelicConfig.class)); } @@ -84,10 +84,10 @@ class NewRelicMetricsExportAutoConfigurationTests { @Test void autoConfiguresWithMeterNameEventTypeEnabledAndWithoutEventType() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.newrelic.api-key=abcde", - "management.metrics.export.newrelic.account-id=12345", - "management.metrics.export.newrelic.event-type=", - "management.metrics.export.newrelic.meter-name-event-type-enabled=true") + .withPropertyValues("management.newrelic.metrics.export.api-key=abcde", + "management.newrelic.metrics.export.account-id=12345", + "management.newrelic.metrics.export.event-type=", + "management.newrelic.metrics.export.meter-name-event-type-enabled=true") .run((context) -> assertThat(context).hasSingleBean(NewRelicMeterRegistry.class) .hasSingleBean(Clock.class).hasSingleBean(NewRelicConfig.class)); } @@ -95,8 +95,8 @@ class NewRelicMetricsExportAutoConfigurationTests { @Test void autoConfiguresWithAccountIdAndApiKey() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.newrelic.api-key=abcde", - "management.metrics.export.newrelic.account-id=12345") + .withPropertyValues("management.newrelic.metrics.export.api-key=abcde", + "management.newrelic.metrics.export.account-id=12345") .run((context) -> assertThat(context).hasSingleBean(NewRelicMeterRegistry.class) .hasSingleBean(Clock.class).hasSingleBean(NewRelicConfig.class)); } @@ -104,7 +104,7 @@ class NewRelicMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(NewRelicMeterRegistry.class) .doesNotHaveBean(NewRelicConfig.class)); } @@ -112,7 +112,7 @@ class NewRelicMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.newrelic.enabled=false") + .withPropertyValues("management.newrelic.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(NewRelicMeterRegistry.class) .doesNotHaveBean(NewRelicConfig.class)); } @@ -120,16 +120,16 @@ class NewRelicMetricsExportAutoConfigurationTests { @Test void allowsConfigToBeCustomized() { this.contextRunner.withUserConfiguration(CustomConfigConfiguration.class) - .withPropertyValues("management.metrics.export.newrelic.api-key=abcde", - "management.metrics.export.newrelic.account-id=12345") + .withPropertyValues("management.newrelic.metrics.export.api-key=abcde", + "management.newrelic.metrics.export.account-id=12345") .run((context) -> assertThat(context).hasSingleBean(NewRelicConfig.class).hasBean("customConfig")); } @Test void allowsRegistryToBeCustomized() { this.contextRunner.withUserConfiguration(CustomRegistryConfiguration.class) - .withPropertyValues("management.metrics.export.newrelic.api-key=abcde", - "management.metrics.export.newrelic.account-id=12345") + .withPropertyValues("management.newrelic.metrics.export.api-key=abcde", + "management.newrelic.metrics.export.account-id=12345") .run((context) -> assertThat(context).hasSingleBean(NewRelicMeterRegistry.class) .hasBean("customRegistry")); } @@ -137,8 +137,8 @@ class NewRelicMetricsExportAutoConfigurationTests { @Test void allowsClientProviderToBeCustomized() { this.contextRunner.withUserConfiguration(CustomClientProviderConfiguration.class) - .withPropertyValues("management.metrics.export.newrelic.api-key=abcde", - "management.metrics.export.newrelic.account-id=12345") + .withPropertyValues("management.newrelic.metrics.export.api-key=abcde", + "management.newrelic.metrics.export.account-id=12345") .run((context) -> { assertThat(context).hasSingleBean(NewRelicMeterRegistry.class); assertThat(context.getBean(NewRelicMeterRegistry.class)) @@ -149,8 +149,8 @@ class NewRelicMetricsExportAutoConfigurationTests { @Test void stopsMeterRegistryWhenContextIsClosed() { this.contextRunner - .withPropertyValues("management.metrics.export.newrelic.api-key=abcde", - "management.metrics.export.newrelic.account-id=abcde") + .withPropertyValues("management.newrelic.metrics.export.api-key=abcde", + "management.newrelic.metrics.export.account-id=abcde") .withUserConfiguration(BaseConfiguration.class).run((context) -> { NewRelicMeterRegistry registry = context.getBean(NewRelicMeterRegistry.class); assertThat(registry.isClosed()).isFalse(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java index ddd2848f0a..344273288a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java @@ -71,7 +71,7 @@ class PrometheusMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(PrometheusMeterRegistry.class) .doesNotHaveBean(CollectorRegistry.class).doesNotHaveBean(PrometheusConfig.class)); } @@ -79,7 +79,7 @@ class PrometheusMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.prometheus.enabled=false") + .withPropertyValues("management.prometheus.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(PrometheusMeterRegistry.class) .doesNotHaveBean(CollectorRegistry.class).doesNotHaveBean(PrometheusConfig.class)); } @@ -148,7 +148,7 @@ class PrometheusMetricsExportAutoConfigurationTests { @Test void withPushGatewayEnabled(CapturedOutput output) { this.contextRunner.withConfiguration(AutoConfigurations.of(ManagementContextAutoConfiguration.class)) - .withPropertyValues("management.metrics.export.prometheus.pushgateway.enabled=true") + .withPropertyValues("management.prometheus.metrics.export.pushgateway.enabled=true") .withUserConfiguration(BaseConfiguration.class).run((context) -> { assertThat(output).doesNotContain("Invalid PushGateway base url"); hasGatewayURL(context, "http://localhost:9091/metrics/"); @@ -158,7 +158,7 @@ class PrometheusMetricsExportAutoConfigurationTests { @Test void withPushGatewayNoBasicAuth() { this.contextRunner.withConfiguration(AutoConfigurations.of(ManagementContextAutoConfiguration.class)) - .withPropertyValues("management.metrics.export.prometheus.pushgateway.enabled=true") + .withPropertyValues("management.prometheus.metrics.export.pushgateway.enabled=true") .withUserConfiguration(BaseConfiguration.class) .run(hasHttpConnectionFactory((httpConnectionFactory) -> assertThat(httpConnectionFactory) .isInstanceOf(DefaultHttpConnectionFactory.class))); @@ -168,8 +168,8 @@ class PrometheusMetricsExportAutoConfigurationTests { @Deprecated void withCustomLegacyPushGatewayURL(CapturedOutput output) { this.contextRunner.withConfiguration(AutoConfigurations.of(ManagementContextAutoConfiguration.class)) - .withPropertyValues("management.metrics.export.prometheus.pushgateway.enabled=true", - "management.metrics.export.prometheus.pushgateway.base-url=localhost:9090") + .withPropertyValues("management.prometheus.metrics.export.pushgateway.enabled=true", + "management.prometheus.metrics.export.pushgateway.base-url=localhost:9090") .withUserConfiguration(BaseConfiguration.class).run((context) -> { assertThat(output).contains("Invalid PushGateway base url").contains("localhost:9090"); hasGatewayURL(context, "http://localhost:9090/metrics/"); @@ -179,8 +179,8 @@ class PrometheusMetricsExportAutoConfigurationTests { @Test void withCustomPushGatewayURL() { this.contextRunner.withConfiguration(AutoConfigurations.of(ManagementContextAutoConfiguration.class)) - .withPropertyValues("management.metrics.export.prometheus.pushgateway.enabled=true", - "management.metrics.export.prometheus.pushgateway.base-url=https://example.com:8080") + .withPropertyValues("management.prometheus.metrics.export.pushgateway.enabled=true", + "management.prometheus.metrics.export.pushgateway.base-url=https://example.com:8080") .withUserConfiguration(BaseConfiguration.class) .run((context) -> hasGatewayURL(context, "https://example.com:8080/metrics/")); } @@ -188,9 +188,9 @@ class PrometheusMetricsExportAutoConfigurationTests { @Test void withPushGatewayBasicAuth() { this.contextRunner.withConfiguration(AutoConfigurations.of(ManagementContextAutoConfiguration.class)) - .withPropertyValues("management.metrics.export.prometheus.pushgateway.enabled=true", - "management.metrics.export.prometheus.pushgateway.username=admin", - "management.metrics.export.prometheus.pushgateway.password=secret") + .withPropertyValues("management.prometheus.metrics.export.pushgateway.enabled=true", + "management.prometheus.metrics.export.pushgateway.username=admin", + "management.prometheus.metrics.export.pushgateway.password=secret") .withUserConfiguration(BaseConfiguration.class) .run(hasHttpConnectionFactory((httpConnectionFactory) -> assertThat(httpConnectionFactory) .isInstanceOf(BasicAuthHttpConnectionFactory.class))); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java index c444ab0909..675ad4e2a4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class SignalFxMetricsExportAutoConfigurationTests { @Test void autoConfiguresWithAnAccessToken() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.signalfx.access-token=abcde") + .withPropertyValues("management.signalfx.metrics.export.access-token=abcde") .run((context) -> assertThat(context).hasSingleBean(SignalFxMeterRegistry.class) .hasSingleBean(Clock.class).hasSingleBean(SignalFxConfig.class)); } @@ -61,7 +61,7 @@ class SignalFxMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(SignalFxMeterRegistry.class) .doesNotHaveBean(SignalFxConfig.class)); } @@ -69,14 +69,14 @@ class SignalFxMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.signalfx.enabled=false") + .withPropertyValues("management.signalfx.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(SignalFxMeterRegistry.class) .doesNotHaveBean(SignalFxConfig.class)); } @Test void allowsConfigToBeCustomized() { - this.contextRunner.withPropertyValues("management.metrics.export.signalfx.access-token=abcde") + this.contextRunner.withPropertyValues("management.signalfx.metrics.export.access-token=abcde") .withUserConfiguration(CustomConfigConfiguration.class) .run((context) -> assertThat(context).hasSingleBean(Clock.class) .hasSingleBean(SignalFxMeterRegistry.class).hasSingleBean(SignalFxConfig.class) @@ -85,7 +85,7 @@ class SignalFxMetricsExportAutoConfigurationTests { @Test void allowsRegistryToBeCustomized() { - this.contextRunner.withPropertyValues("management.metrics.export.signalfx.access-token=abcde") + this.contextRunner.withPropertyValues("management.signalfx.metrics.export.access-token=abcde") .withUserConfiguration(CustomRegistryConfiguration.class) .run((context) -> assertThat(context).hasSingleBean(Clock.class).hasSingleBean(SignalFxConfig.class) .hasSingleBean(SignalFxMeterRegistry.class).hasBean("customRegistry")); @@ -93,7 +93,7 @@ class SignalFxMetricsExportAutoConfigurationTests { @Test void stopsMeterRegistryWhenContextIsClosed() { - this.contextRunner.withPropertyValues("management.metrics.export.signalfx.access-token=abcde") + this.contextRunner.withPropertyValues("management.signalfx.metrics.export.access-token=abcde") .withUserConfiguration(BaseConfiguration.class).run((context) -> { SignalFxMeterRegistry registry = context.getBean(SignalFxMeterRegistry.class); assertThat(registry.isClosed()).isFalse(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleMetricsExportAutoConfigurationTests.java index 45f37037d0..6ca17f61c1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimpleMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ class SimpleMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(SimpleMeterRegistry.class) .doesNotHaveBean(SimpleConfig.class)); } @@ -59,7 +59,7 @@ class SimpleMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.simple.enabled=false") + .withPropertyValues("management.simple.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(SimpleMeterRegistry.class) .doesNotHaveBean(SimpleConfig.class)); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/stackdriver/StackdriverMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/stackdriver/StackdriverMetricsExportAutoConfigurationTests.java index fceeebab81..9db4d27b3d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/stackdriver/StackdriverMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/stackdriver/StackdriverMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ class StackdriverMetricsExportAutoConfigurationTests { @Test void autoConfiguresConfigAndMeterRegistry() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.stackdriver.project-id=test-project") + .withPropertyValues("management.stackdriver.metrics.export.project-id=test-project") .run((context) -> assertThat(context).hasSingleBean(StackdriverMeterRegistry.class) .hasSingleBean(StackdriverConfig.class)); } @@ -61,7 +61,7 @@ class StackdriverMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(StackdriverMeterRegistry.class) .doesNotHaveBean(StackdriverConfig.class)); } @@ -69,7 +69,7 @@ class StackdriverMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.stackdriver.enabled=false") + .withPropertyValues("management.stackdriver.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(StackdriverMeterRegistry.class) .doesNotHaveBean(StackdriverConfig.class)); } @@ -84,7 +84,7 @@ class StackdriverMetricsExportAutoConfigurationTests { @Test void allowsCustomRegistryToBeUsed() { this.contextRunner.withUserConfiguration(CustomRegistryConfiguration.class) - .withPropertyValues("management.metrics.export.stackdriver.project-id=test-project") + .withPropertyValues("management.stackdriver.metrics.export.project-id=test-project") .run((context) -> assertThat(context).hasSingleBean(StackdriverMeterRegistry.class) .hasBean("customRegistry").hasSingleBean(StackdriverConfig.class)); } @@ -92,7 +92,7 @@ class StackdriverMetricsExportAutoConfigurationTests { @Test void stopsMeterRegistryWhenContextIsClosed() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.stackdriver.project-id=test-project").run((context) -> { + .withPropertyValues("management.stackdriver.metrics.export.project-id=test-project").run((context) -> { StackdriverMeterRegistry registry = context.getBean(StackdriverMeterRegistry.class); assertThat(registry.isClosed()).isFalse(); context.close(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdMetricsExportAutoConfigurationTests.java index 59d2495491..d004803683 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,14 +52,14 @@ class StatsdMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { - this.contextRunner.withPropertyValues("management.metrics.export.defaults.enabled=false") + this.contextRunner.withPropertyValues("management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(StatsdMeterRegistry.class) .doesNotHaveBean(StatsdConfig.class)); } @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { - this.contextRunner.withPropertyValues("management.metrics.export.statsd.enabled=false") + this.contextRunner.withPropertyValues("management.statsd.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(StatsdMeterRegistry.class) .doesNotHaveBean(StatsdConfig.class)); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/wavefront/WavefrontMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/wavefront/WavefrontMetricsExportAutoConfigurationTests.java index da870c8446..f00a07d514 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/wavefront/WavefrontMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/wavefront/WavefrontMetricsExportAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,8 +60,8 @@ class WavefrontMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithDefaultsEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.wavefront.api-token=abcde", - "management.metrics.export.defaults.enabled=false") + .withPropertyValues("management.wavefront.metrics.export.api-token=abcde", + "management.defaults.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(WavefrontMeterRegistry.class) .doesNotHaveBean(WavefrontConfig.class).doesNotHaveBean(WavefrontSender.class)); } @@ -69,8 +69,8 @@ class WavefrontMetricsExportAutoConfigurationTests { @Test void autoConfigurationCanBeDisabledWithSpecificEnabledProperty() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.wavefront.api-token=abcde", - "management.metrics.export.wavefront.enabled=false") + .withPropertyValues("management.wavefront.metrics.export.api-token=abcde", + "management.wavefront.metrics.export.enabled=false") .run((context) -> assertThat(context).doesNotHaveBean(WavefrontMeterRegistry.class) .doesNotHaveBean(WavefrontConfig.class).doesNotHaveBean(WavefrontSender.class)); } @@ -86,7 +86,7 @@ class WavefrontMetricsExportAutoConfigurationTests { @Test void defaultWavefrontSenderSettingsAreConsistent() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.wavefront.api-token=abcde").run((context) -> { + .withPropertyValues("management.wavefront.metrics.export.api-token=abcde").run((context) -> { WavefrontProperties properties = new WavefrontProperties(); WavefrontSender sender = context.getBean(WavefrontSender.class); assertThat(sender) @@ -102,10 +102,10 @@ class WavefrontMetricsExportAutoConfigurationTests { @Test void configureWavefrontSender() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.wavefront.api-token=abcde", - "management.metrics.export.wavefront.batch-size=50", - "management.metrics.export.wavefront.sender.max-queue-size=100", - "management.metrics.export.wavefront.sender.message-size=1KB") + .withPropertyValues("management.wavefront.metrics.export.api-token=abcde", + "management.wavefront.metrics.export.batch-size=50", + "management.wavefront.metrics.export.sender.max-queue-size=100", + "management.wavefront.metrics.export.sender.message-size=1KB") .run((context) -> { WavefrontSender sender = context.getBean(WavefrontSender.class); assertThat(sender).hasFieldOrPropertyWithValue("batchSize", 50); @@ -127,7 +127,7 @@ class WavefrontMetricsExportAutoConfigurationTests { @Test void allowsRegistryToBeCustomized() { this.contextRunner.withUserConfiguration(CustomRegistryConfiguration.class) - .withPropertyValues("management.metrics.export.wavefront.api-token=abcde") + .withPropertyValues("management.wavefront.metrics.export.api-token=abcde") .run((context) -> assertThat(context).hasSingleBean(Clock.class).hasSingleBean(WavefrontConfig.class) .hasSingleBean(WavefrontMeterRegistry.class).hasBean("customRegistry")); } @@ -135,7 +135,7 @@ class WavefrontMetricsExportAutoConfigurationTests { @Test void stopsMeterRegistryWhenContextIsClosed() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.metrics.export.wavefront.api-token=abcde").run((context) -> { + .withPropertyValues("management.wavefront.metrics.export.api-token=abcde").run((context) -> { WavefrontMeterRegistry registry = context.getBean(WavefrontMeterRegistry.class); assertThat(registry.isClosed()).isFalse(); context.close(); diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc index 719e861ba3..11ccd895d2 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/metrics.adoc @@ -37,10 +37,10 @@ The following example disables Datadog: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - datadog: - enabled: false + datadog: + metrics: + export: + enabled: false ---- You can also disable all registries unless stated otherwise by the registry-specific property, as the following example shows: @@ -48,9 +48,9 @@ You can also disable all registries unless stated otherwise by the registry-spec [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - defaults: + defaults: + metrics: + export: enabled: false ---- @@ -89,9 +89,9 @@ To export metrics to SaaS {micrometer-registry-docs}/appOptics[AppOptics], your [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - appoptics: + appoptics: + metrics: + export: api-token: "YOUR_TOKEN" ---- @@ -105,9 +105,9 @@ You can provide the location of the https://github.com/Netflix/atlas[Atlas serve [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - atlas: + atlas: + metrics: + export: uri: "https://atlas.example.com:7101/api/v1/publish" ---- @@ -121,9 +121,9 @@ To export metrics to {micrometer-registry-docs}/datadog[Datadog], you must provi [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - datadog: + datadog: + metrics: + export: api-key: "YOUR_KEY" ---- @@ -132,9 +132,9 @@ You can also change the interval at which metrics are sent to Datadog: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - datadog: + datadog: + metrics: + export: step: "30s" ---- @@ -174,9 +174,9 @@ The example below configures metrics export using the `example` environment id: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - dynatrace: + dynatrace: + metrics: + export: uri: "https://example.live.dynatrace.com/api/v2/metrics/ingest" api-token: "YOUR_TOKEN" ---- @@ -194,9 +194,9 @@ In this scenario, the local OneAgent endpoint is used: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - dynatrace: + dynatrace: + metrics: + export: # Specify uri and api-token here if not using the local OneAgent endpoint. v2: metric-key-prefix: "your.key.prefix" @@ -217,9 +217,9 @@ To export metrics to {micrometer-registry-docs}/dynatrace[Dynatrace], your API t [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - dynatrace: + dynatrace: + metrics: + export: uri: "https://{your-environment-id}.live.dynatrace.com" api-token: "YOUR_TOKEN" v1: @@ -239,9 +239,9 @@ The following example sets the export interval to 30 seconds: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - dynatrace: + dynatrace: + metrics: + export: step: "30s" ---- @@ -257,9 +257,9 @@ You can provide the location of the Elastic server to use by using the following [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - elastic: + elastic: + metrics: + export: host: "https://elastic.example.com:8086" ---- @@ -271,9 +271,9 @@ You can provide the http://ganglia.sourceforge.net[Ganglia server] host and port [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - ganglia: + ganglia: + metrics: + export: host: "ganglia.example.com" port: 9649 ---- @@ -288,9 +288,9 @@ You can provide the https://graphiteapp.org[Graphite server] host and port, as t [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - graphite: + graphite: + metrics: + export: host: "graphite.example.com" port: 9004 ---- @@ -315,9 +315,9 @@ To export metrics to SaaS {micrometer-registry-docs}/humio[Humio], you must prov [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - humio: + humio: + metrics: + export: api-token: "YOUR_TOKEN" ---- @@ -326,9 +326,9 @@ You should also configure one or more tags to identify the data source to which [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - humio: + humio: + metrics: + export: tags: alpha: "a" bravo: "b" @@ -345,9 +345,9 @@ You can provide the location of the https://www.influxdata.com[Influx server] to [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - influx: + influx: + metrics: + export: uri: "https://influx.example.com:8086" ---- @@ -362,9 +362,9 @@ You can provide the domain to use by using: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - jmx: + jmx: + metrics: + export: domain: "com.example.app.metrics" ---- @@ -388,9 +388,9 @@ You can provide the location of the https://kairosdb.github.io/[KairosDB server] [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - kairos: + kairos: + metrics: + export: uri: "https://kairosdb.example.com:8080/api/v1/datapoints" ---- @@ -404,9 +404,9 @@ To export metrics to https://newrelic.com[New Relic], you must provide your API [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - newrelic: + newrelic: + metrics: + export: api-key: "YOUR_KEY" account-id: "YOUR_ACCOUNT_ID" ---- @@ -416,9 +416,9 @@ You can also change the interval at which metrics are sent to New Relic: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - newrelic: + newrelic: + metrics: + export: step: "30s" ---- @@ -427,9 +427,9 @@ By default, metrics are published through REST calls, but you can also use the J [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - newrelic: + newrelic: + metrics: + export: client-provider-type: "insights-agent" ---- @@ -466,10 +466,10 @@ To enable Prometheus Pushgateway support, add the following dependency to your p ---- -When the Prometheus Pushgateway dependency is present on the classpath and the configprop:management.metrics.export.prometheus.pushgateway.enabled[] property is set to `true`, a `PrometheusPushGatewayManager` bean is auto-configured. +When the Prometheus Pushgateway dependency is present on the classpath and the configprop:management.prometheus.metrics.export.pushgateway.enabled[] property is set to `true`, a `PrometheusPushGatewayManager` bean is auto-configured. This manages the pushing of metrics to a Prometheus Pushgateway. -You can tune the `PrometheusPushGatewayManager` by using properties under `management.metrics.export.prometheus.pushgateway`. +You can tune the `PrometheusPushGatewayManager` by using properties under `management.prometheus.metrics.export.pushgateway`. For advanced configuration, you can also provide your own `PrometheusPushGatewayManager` bean. @@ -482,9 +482,9 @@ To export metrics to https://www.signalfx.com[SignalFx], you must provide your a [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - signalfx: + signalfx: + metrics: + export: access-token: "YOUR_ACCESS_TOKEN" ---- @@ -493,9 +493,9 @@ You can also change the interval at which metrics are sent to SignalFx: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - signalfx: + signalfx: + metrics: + export: step: "30s" ---- @@ -512,10 +512,10 @@ You can also disable it explicitly: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - simple: - enabled: false + simple: + metrics: + export: + enabled: false ---- @@ -528,9 +528,9 @@ To export metrics to SaaS {micrometer-registry-docs}/stackdriver[Stackdriver], y [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - stackdriver: + stackdriver: + metrics: + export: project-id: "my-project" ---- @@ -539,9 +539,9 @@ You can also change the interval at which metrics are sent to Stackdriver: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - stackdriver: + stackdriver: + metrics: + export: step: "30s" ---- @@ -556,9 +556,9 @@ You can provide the StatsD agent host, port, and protocol to use by using: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - statsd: + statsd: + metrics: + export: host: "statsd.example.com" port: 9125 protocol: "udp" @@ -569,9 +569,9 @@ You can also change the StatsD line protocol to use (it defaults to Datadog): [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - statsd: + statsd: + metrics: + export: flavor: "etsy" ---- @@ -585,9 +585,9 @@ If you are exporting metrics to https://www.wavefront.com/[Wavefront] directly, [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - wavefront: + wavefront: + metrics: + export: api-token: "YOUR_API_TOKEN" ---- @@ -596,9 +596,9 @@ Alternatively, you can use a Wavefront sidecar or an internal proxy in your envi [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - wavefront: + wavefront: + metrics: + export: uri: "proxy://localhost:2878" ---- @@ -609,9 +609,9 @@ You can also change the interval at which metrics are sent to Wavefront: [source,yaml,indent=0,subs="verbatim",configprops,configblocks] ---- management: - metrics: - export: - wavefront: + wavefront: + metrics: + export: step: "30s" ---- diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/actuate/metrics/MetricsExportContextCustomizerFactory.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/actuate/metrics/MetricsExportContextCustomizerFactory.java index 01cf079e9b..597ea3168c 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/actuate/metrics/MetricsExportContextCustomizerFactory.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/actuate/metrics/MetricsExportContextCustomizerFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,8 +47,8 @@ class MetricsExportContextCustomizerFactory implements ContextCustomizerFactory @Override public void customizeContext(ConfigurableApplicationContext context, MergedContextConfiguration mergedContextConfiguration) { - TestPropertyValues.of("management.metrics.export.defaults.enabled=false", - "management.metrics.export.simple.enabled=true").applyTo(context); + TestPropertyValues.of("management.defaults.metrics.export.enabled=false", + "management.simple.metrics.export.enabled=true").applyTo(context); } @Override diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsMissingIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsMissingIntegrationTests.java index 3ac20e6bc1..ff4e924a99 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsMissingIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsMissingIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,8 +46,8 @@ class AutoConfigureMetricsMissingIntegrationTests { @Test void customizerRunsAndSetsExclusionPropertiesWhenNoAnnotationPresent(@Autowired Environment environment) { - assertThat(environment.getProperty("management.metrics.export.defaults.enabled")).isEqualTo("false"); - assertThat(environment.getProperty("management.metrics.export.simple.enabled")).isEqualTo("true"); + assertThat(environment.getProperty("management.defaults.metrics.export.enabled")).isEqualTo("false"); + assertThat(environment.getProperty("management.simple.metrics.export.enabled")).isEqualTo("true"); } } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsPresentIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsPresentIntegrationTests.java index 5767a07350..ff77d29f27 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsPresentIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsPresentIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,8 +44,8 @@ class AutoConfigureMetricsPresentIntegrationTests { @Test void customizerDoesNotSetExclusionPropertiesWhenAnnotationPresent(@Autowired Environment environment) { - assertThat(environment.containsProperty("management.metrics.export.enabled")).isFalse(); - assertThat(environment.containsProperty("management.metrics.export.simple.enabled")).isFalse(); + assertThat(environment.containsProperty("management.defaults.metrics.export.enabled")).isFalse(); + assertThat(environment.containsProperty("management.simple.metrics.export.enabled")).isFalse(); } } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/MetricsExportContextCustomizerFactoryTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/MetricsExportContextCustomizerFactoryTests.java index 000753cce0..573b6366d8 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/MetricsExportContextCustomizerFactoryTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/MetricsExportContextCustomizerFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,9 +43,9 @@ class MetricsExportContextCustomizerFactoryTests { assertThat(customizer).isNotNull(); ConfigurableApplicationContext context = new GenericApplicationContext(); customizer.customizeContext(context, null); - assertThat(context.getEnvironment().getProperty("management.metrics.export.defaults.enabled")) + assertThat(context.getEnvironment().getProperty("management.defaults.metrics.export.enabled")) .isEqualTo("false"); - assertThat(context.getEnvironment().getProperty("management.metrics.export.simple.enabled")).isEqualTo("true"); + assertThat(context.getEnvironment().getProperty("management.simple.metrics.export.enabled")).isEqualTo("true"); } @Test