Stop auto-configuring a StatsdMetrics bean

StatsD no longer publishes metrics about itself and StatsDMetrics is
deprecated as a result. This commit removes the auto-configuration of
it.

Closes gh-20836
pull/20874/head
Stephane Nicoll 5 years ago
parent 30201a40e0
commit 333ac279c3

@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 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.
@ -19,7 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.metrics.export.statsd;
import io.micrometer.core.instrument.Clock;
import io.micrometer.statsd.StatsdConfig;
import io.micrometer.statsd.StatsdMeterRegistry;
import io.micrometer.statsd.StatsdMetrics;
import org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration;
@ -63,9 +62,4 @@ public class StatsdMetricsExportAutoConfiguration {
return new StatsdMeterRegistry(statsdConfig, clock);
}
@Bean
public StatsdMetrics statsdMetrics() {
return new StatsdMetrics();
}
}

@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 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.
@ -19,7 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.metrics.export.statsd;
import io.micrometer.core.instrument.Clock;
import io.micrometer.statsd.StatsdConfig;
import io.micrometer.statsd.StatsdMeterRegistry;
import io.micrometer.statsd.StatsdMetrics;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
@ -47,9 +46,8 @@ class StatsdMetricsExportAutoConfigurationTests {
@Test
void autoConfiguresItsConfigMeterRegistryAndMetrics() {
this.contextRunner.withUserConfiguration(BaseConfiguration.class)
.run((context) -> assertThat(context).hasSingleBean(StatsdMeterRegistry.class)
.hasSingleBean(StatsdConfig.class).hasSingleBean(StatsdMetrics.class));
this.contextRunner.withUserConfiguration(BaseConfiguration.class).run((context) -> assertThat(context)
.hasSingleBean(StatsdMeterRegistry.class).hasSingleBean(StatsdConfig.class));
}
@Test

Loading…
Cancel
Save