Fix invalid Zipkin Reporter back-off behavior
Update `ReporterConfiguration` so that `spanReporter` back off if a `Reporter` bean is defined. Prior to this commit, only `AsyncReporter` beans would be considered. See gh-35455
This commit is contained in:
committed by
Phillip Webb
parent
9245f3c25e
commit
903e19854d
@@ -120,7 +120,7 @@ class ZipkinConfigurations {
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
@ConditionalOnBean(Sender.class)
|
||||
AsyncReporter<Span> spanReporter(Sender sender, BytesEncoder<Span> encoder) {
|
||||
Reporter<Span> spanReporter(Sender sender, BytesEncoder<Span> encoder) {
|
||||
return AsyncReporter.builder(sender).build(encoder);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,10 +56,11 @@ class ZipkinConfigurationsReporterConfigurationTests {
|
||||
|
||||
@Test
|
||||
void shouldBackOffOnCustomBeans() {
|
||||
this.contextRunner.withUserConfiguration(CustomConfiguration.class).run((context) -> {
|
||||
assertThat(context).hasBean("customReporter");
|
||||
assertThat(context).hasSingleBean(Reporter.class);
|
||||
});
|
||||
this.contextRunner.withUserConfiguration(SenderConfiguration.class, CustomConfiguration.class)
|
||||
.run((context) -> {
|
||||
assertThat(context).hasBean("customReporter");
|
||||
assertThat(context).hasSingleBean(Reporter.class);
|
||||
});
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
|
||||
Reference in New Issue
Block a user