Skip to content

Commit

Permalink
Merge pull request #35455 from be-hase
Browse files Browse the repository at this point in the history
* pr/35455:
  Polish "Fix invalid Zipkin Reporter back-off behavior"
  Fix invalid Zipkin Reporter back-off behavior

Closes gh-35455
  • Loading branch information
philwebb committed May 17, 2023
2 parents 9245f3c + 4072588 commit d6a1a3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ ZipkinWebClientSender webClientSender(ZipkinProperties properties,
static class ReporterConfiguration {

@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean(Reporter.class)
@ConditionalOnBean(Sender.class)
AsyncReporter<Span> spanReporter(Sender sender, BytesEncoder<Span> encoder) {
return AsyncReporter.builder(sender).build(encoder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ void shouldNotSupplyReporterIfSenderIsMissing() {

@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)
Expand Down

0 comments on commit d6a1a3d

Please sign in to comment.