From 79ff11cb2bc23bf8c773683ba66ecdbecd018c5c Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 9 Nov 2022 18:03:09 -0800 Subject: [PATCH] Rename and relocate ExemplarsAutoConfiguration Rename `ExemplarsAutoConfiguration` and relocate it to a diffent package to make it clear that it is for Prometheus. --- .../PrometheusExemplarsAutoConfiguration.java} | 4 ++-- .../{exemplars => prometheus}/package-info.java | 2 +- ...ork.boot.autoconfigure.AutoConfiguration.imports | 2 +- .../PrometheusExemplarsAutoConfigurationTests.java} | 13 +++++++------ 4 files changed, 11 insertions(+), 10 deletions(-) rename spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/{exemplars/ExemplarsAutoConfiguration.java => prometheus/PrometheusExemplarsAutoConfiguration.java} (96%) rename spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/{exemplars => prometheus}/package-info.java (90%) rename spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/{exemplars/ExemplarsAutoConfigurationTests.java => prometheus/PrometheusExemplarsAutoConfigurationTests.java} (91%) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/exemplars/ExemplarsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/PrometheusExemplarsAutoConfiguration.java similarity index 96% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/exemplars/ExemplarsAutoConfiguration.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/PrometheusExemplarsAutoConfiguration.java index b48aaf4891..e579160d11 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/exemplars/ExemplarsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/PrometheusExemplarsAutoConfiguration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.tracing.exemplars; +package org.springframework.boot.actuate.autoconfigure.tracing.prometheus; import io.micrometer.tracing.Span; import io.micrometer.tracing.Tracer; @@ -44,7 +44,7 @@ import org.springframework.util.function.SingletonSupplier; @ConditionalOnBean(Tracer.class) @ConditionalOnClass({ Tracer.class, SpanContextSupplier.class }) @ConditionalOnEnabledTracing -public class ExemplarsAutoConfiguration { +public class PrometheusExemplarsAutoConfiguration { @Bean @ConditionalOnMissingBean diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/exemplars/package-info.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/package-info.java similarity index 90% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/exemplars/package-info.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/package-info.java index 4fde3ff674..9d83ad5151 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/exemplars/package-info.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/package-info.java @@ -17,4 +17,4 @@ /** * Auto-configuration for Prometheus Exemplars with Micrometer Tracing. */ -package org.springframework.boot.actuate.autoconfigure.tracing.exemplars; +package org.springframework.boot.actuate.autoconfigure.tracing.prometheus; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 2da89f0835..99d0c2fb35 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -99,7 +99,7 @@ org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthContributor org.springframework.boot.actuate.autoconfigure.tracing.BraveAutoConfiguration org.springframework.boot.actuate.autoconfigure.tracing.MicrometerTracingAutoConfiguration org.springframework.boot.actuate.autoconfigure.tracing.OpenTelemetryAutoConfiguration -org.springframework.boot.actuate.autoconfigure.tracing.exemplars.ExemplarsAutoConfiguration +org.springframework.boot.actuate.autoconfigure.tracing.prometheus.PrometheusExemplarsAutoConfiguration org.springframework.boot.actuate.autoconfigure.tracing.wavefront.WavefrontTracingAutoConfiguration org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinAutoConfiguration org.springframework.boot.actuate.autoconfigure.web.exchanges.HttpExchangesAutoConfiguration diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/exemplars/ExemplarsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/PrometheusExemplarsAutoConfigurationTests.java similarity index 91% rename from spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/exemplars/ExemplarsAutoConfigurationTests.java rename to spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/PrometheusExemplarsAutoConfigurationTests.java index 5eb67e3f6b..7ffe8e2361 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/exemplars/ExemplarsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/tracing/prometheus/PrometheusExemplarsAutoConfigurationTests.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.boot.actuate.autoconfigure.tracing.exemplars; +package org.springframework.boot.actuate.autoconfigure.tracing.prometheus; import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationRegistry; @@ -38,18 +38,19 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; /** - * Tests for {@link ExemplarsAutoConfiguration}. + * Tests for {@link PrometheusExemplarsAutoConfiguration}. * * * @author Jonatan Ivanov */ -class ExemplarsAutoConfigurationTests { +class PrometheusExemplarsAutoConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() .withPropertyValues("management.tracing.sampling.probability=1.0", "management.metrics.distribution.percentiles-histogram.all=true") - .with(MetricsRun.limitedTo(PrometheusMetricsExportAutoConfiguration.class)).withConfiguration( - AutoConfigurations.of(ExemplarsAutoConfiguration.class, ObservationAutoConfiguration.class, - BraveAutoConfiguration.class, MicrometerTracingAutoConfiguration.class)); + .with(MetricsRun.limitedTo(PrometheusMetricsExportAutoConfiguration.class)) + .withConfiguration(AutoConfigurations.of(PrometheusExemplarsAutoConfiguration.class, + ObservationAutoConfiguration.class, BraveAutoConfiguration.class, + MicrometerTracingAutoConfiguration.class)); @Test void shouldNotSupplyBeansIfTracingIsDisabled() {