Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring.zipkin.discoveryClientEnabled ignored when the traced app is webflux #2339

Closed
codefromthecrypt opened this issue Feb 7, 2024 · 1 comment
Labels
Milestone

Comments

@codefromthecrypt
Copy link
Contributor

Describe the bug

Documentation says to use spring.zipkin.discoveryClientEnabled to report spans to Zipkin discovered (likely in Eureka). Technically, ZipkinUrlExtractor will do the work, to subsitute the application name encoded as the hostname in spring.zipkin.baseUrl for a usable instance.

However, if ConditionalOnWebApplication.Type.REACTIVE triggers, then none of this happens and reporting to zipkin fails, as the fake hostname wasn't substituted.

Sample

Make an app like this and it triggers reactive reporting.. Since the async reporter buffers actual work from the production requests, onto a separate thread, there really should be no reason to restrict Eureka depending on which frontend is in use.

  @GetMapping("/api")
  public Mono<String> printDate(@RequestHeader("user_name") Optional<String> username) {
    return Mono.fromSupplier(() -> {
      String date = LocalDate.now().toString();
      return username.map(u -> date + " " + u).orElse(date);
    });
  }
@codefromthecrypt
Copy link
Contributor Author

thanks and verified manually and going forward automatically that this works. Thanks @marcingrzejszczak! openzipkin/brave-example#113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants