Rename and relocate ExemplarsAutoConfiguration

Rename `ExemplarsAutoConfiguration` and relocate it to a diffent
package to make it clear that it is for Prometheus.
pull/33098/head
Phillip Webb 2 years ago
parent a53141f8a4
commit 79ff11cb2b

@ -14,7 +14,7 @@
* limitations under the License. * 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.Span;
import io.micrometer.tracing.Tracer; import io.micrometer.tracing.Tracer;
@ -44,7 +44,7 @@ import org.springframework.util.function.SingletonSupplier;
@ConditionalOnBean(Tracer.class) @ConditionalOnBean(Tracer.class)
@ConditionalOnClass({ Tracer.class, SpanContextSupplier.class }) @ConditionalOnClass({ Tracer.class, SpanContextSupplier.class })
@ConditionalOnEnabledTracing @ConditionalOnEnabledTracing
public class ExemplarsAutoConfiguration { public class PrometheusExemplarsAutoConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean

@ -17,4 +17,4 @@
/** /**
* Auto-configuration for Prometheus Exemplars with Micrometer Tracing. * Auto-configuration for Prometheus Exemplars with Micrometer Tracing.
*/ */
package org.springframework.boot.actuate.autoconfigure.tracing.exemplars; package org.springframework.boot.actuate.autoconfigure.tracing.prometheus;

@ -99,7 +99,7 @@ org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthContributor
org.springframework.boot.actuate.autoconfigure.tracing.BraveAutoConfiguration org.springframework.boot.actuate.autoconfigure.tracing.BraveAutoConfiguration
org.springframework.boot.actuate.autoconfigure.tracing.MicrometerTracingAutoConfiguration org.springframework.boot.actuate.autoconfigure.tracing.MicrometerTracingAutoConfiguration
org.springframework.boot.actuate.autoconfigure.tracing.OpenTelemetryAutoConfiguration 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.wavefront.WavefrontTracingAutoConfiguration
org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinAutoConfiguration org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinAutoConfiguration
org.springframework.boot.actuate.autoconfigure.web.exchanges.HttpExchangesAutoConfiguration org.springframework.boot.actuate.autoconfigure.web.exchanges.HttpExchangesAutoConfiguration

@ -14,7 +14,7 @@
* limitations under the License. * 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.Observation;
import io.micrometer.observation.ObservationRegistry; import io.micrometer.observation.ObservationRegistry;
@ -38,18 +38,19 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
/** /**
* Tests for {@link ExemplarsAutoConfiguration}. * Tests for {@link PrometheusExemplarsAutoConfiguration}.
* *
* * @author Jonatan Ivanov * * @author Jonatan Ivanov
*/ */
class ExemplarsAutoConfigurationTests { class PrometheusExemplarsAutoConfigurationTests {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withPropertyValues("management.tracing.sampling.probability=1.0", .withPropertyValues("management.tracing.sampling.probability=1.0",
"management.metrics.distribution.percentiles-histogram.all=true") "management.metrics.distribution.percentiles-histogram.all=true")
.with(MetricsRun.limitedTo(PrometheusMetricsExportAutoConfiguration.class)).withConfiguration( .with(MetricsRun.limitedTo(PrometheusMetricsExportAutoConfiguration.class))
AutoConfigurations.of(ExemplarsAutoConfiguration.class, ObservationAutoConfiguration.class, .withConfiguration(AutoConfigurations.of(PrometheusExemplarsAutoConfiguration.class,
BraveAutoConfiguration.class, MicrometerTracingAutoConfiguration.class)); ObservationAutoConfiguration.class, BraveAutoConfiguration.class,
MicrometerTracingAutoConfiguration.class));
@Test @Test
void shouldNotSupplyBeansIfTracingIsDisabled() { void shouldNotSupplyBeansIfTracingIsDisabled() {
Loading…
Cancel
Save