2

I have a Spring Cloud Sleuth + Stream app working and sending to my local OpenZipkin (docker) when the app uses maven, however when I try to run an gradle spring boot app then Zipkin doesn't display the traces. The interesting thing is that the Spring logs seem to show the proper trace information..so the app itself is recognizing Sleuth but for some reason Zipkin either isn't receiving the info or it's not displaying. I went into the zipkin container and can't find any logs. How can this be troubleshot? Is there something that needs to be set when using gradle that isn't needed with maven?

Config info:

In the build.gradle file I have included sleuth as so: implementation 'org.springframework.cloud:spring-cloud-starter-sleuth'

Version info:

  • set('springCloudVersion', "2020.0.4")
  • id 'org.springframework.boot' version '2.5.4'
  • id 'io.spring.dependency-management' version '1.0.11.RELEASE'

The only thing I am configuring in my application.yaml is below and it's the same in both the gradle and maven app. So I'm not pointing to some other address for zipkin or anything like that:

spring:
  application:
    name: OrchestratorService
  sleuth:
    sampler:
      probability: 1.0

And app logs recognize Sleuth and include the app name, and trace info in each log entry, for example: [2m2021-10-06 10:42:22.508[0;39m [32m INFO [OrchestratorService,9b22b40072a8931c,3f954b3ab81e4e7d][0;39m [35m21261[0;39m [2m---[0;39m [2m[pool-6-thread-1][0;39m [36ms.s.d.f.O.OrchestratorServiceApplication[0;39m [2m:[0;39m No further outbound event for card block service required. (No fraud was detected.)

1 Answer 1

3

Please do as the docs says: Use spring-cloud-starter-sleuth which should add Sleuth support with log correlation and spring-cloud-sleuth-zipkin if you also want to send spans to Zipkin.

Here's an example from the docs: https://docs.spring.io/spring-cloud-sleuth/docs/current/reference/htmlsingle/#how-to-set-up-sleuth-with-brave-zipkin-http

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${releaseTrainVersion}"
    }
}

dependencies {
    implementation "org.springframework.cloud:spring-cloud-starter-sleuth"
    implementation "org.springframework.cloud:spring-cloud-sleuth-zipkin"
}
1
  • thanks Jonatan. I feel like an idiot - completely missed the zipkin dependency somehow.
    – Mrc0113
    Oct 6, 2021 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.