1

Below is the configuration I have in the project:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-sleuth</artifactId>
    <version>3.1.5</version>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-zipkin</artifactId>
    <version>2.2.8.RELEASE</version>
</dependency>

There are many other dependencies added in the project.

Here's the application.properties file:

spring.application.name=order-service
server.port=9192
spring.h2.console.enable=true
eureka.client.service-url.defaultzone=http://localhost:8761/eureka
eureka.instance.hostname=localhost

management.health.circuitbreakers.enabled=true
#actuator settings
management.endpoints.web.exposure.include=health
management.endpoint.health.show-details=always

resilience4j.circuitbreaker.instances.BillingServiceCapture.registerHealthIndicator=true
resilience4j.circuitbreaker.instances.BillingServiceCapture.eventConsumerBufferSize=10
resilience4j.circuitbreaker.instances.BillingServiceCapture.failureRateThreshold=20
resilience4j.circuitbreaker.instances.BillingServiceCapture.minimumNumberOfCalls=5
resilience4j.circuitbreaker.instances.BillingServiceCapture.automaticTransitionFromOpenToHalfOpenEnabled=true
resilience4j.circuitbreaker.instances.BillingServiceCapture.waitDurationInOpenState=5s
resilience4j.circuitbreaker.instances.BillingServiceCapture.permittedNumberOfCallsInHalfOpenState=3
resilience4j.circuitbreaker.instances.BillingServiceCapture.slidingWindowSize=10
resilience4j.circuitbreaker.instances.BillingServiceCapture.slidingWindowType=COUNT_BASED
resilience4j.retry.instances.BillingServiceCapture.maxRetryAttempts=5
resilience4j.retry.instances.BillingServiceCapture.waitDuration=10s

spring.zipkin.baseUrl=http://localhost:9411/
spring.sleuth.sampler.probability=1.0
spring.zipkin.sender.type=web
spring.zipkin.collector.http.enabled=true

When I send the request to the microservices - Order Service and Billing Service, I cannot see the Zipkin traces on localhost:9411. If I select servicename, I cannot see the microservice name in the dropdown. Any insights are useful.

Thanks.

Toni
  • 3,296
  • 2
  • 13
  • 34
Khushboo
  • 3,095
  • 2
  • 23
  • 24

1 Answers1

1

Referring to Jonatan's answer:

spring-cloud-starter-zipkin is deprecated, you should not use it anymore. You can use spring-cloud-starter-sleuth and spring-cloud-sleuth-zipkin (3.x).

Toni
  • 3,296
  • 2
  • 13
  • 34
  • Hi @birca, thanks for the reply. Can you please point me to the documentation? I could not find Zipkin's documentation on Spring boot guide page. It does have Sleuth integration but not specifically ZIpkin. I'm aware about this: https://spring.io/projects/spring-cloud-sleuth – Khushboo Jan 06 '23 at 09:11
  • Hi @Khushboo, check [Sending Spans to Zipkin](https://docs.spring.io/spring-cloud-sleuth/docs/current/reference/htmlsingle/spring-cloud-sleuth.html#features-zipkin) and [How to Set Up Sleuth with Brave & Zipkin via HTTP?](https://docs.spring.io/spring-cloud-sleuth/docs/current/reference/htmlsingle/spring-cloud-sleuth.html#how-to-set-up-sleuth-with-brave-zipkin-http). – Toni Jan 06 '23 at 09:16
  • Hi @birca123 - Thanks for sharing the documentation. I updated the dependency in the POM file however I still do not see the spans in the Zipkin. I also noted that the IDE logs doesn't show TRUE value when the Rest API is hit. Any more insights? – Khushboo Jan 09 '23 at 18:24
  • There is a problem related to sampling, check [the docs](https://cloud.spring.io/spring-cloud-sleuth/2.1.x/multi/multi__sampling.html) and try to define a bean Sampler.ALWAYS_SAMPLE. If this doesn't work then check if you're suddenly sending spanFlags or X-B3-Flags headers which overrides sampling decision. – Toni Jan 09 '23 at 20:43