microservices-patterns / ftgo-application

Example code for the book Microservice patterns
Other
3.35k stars 1.29k forks source link

Zipkin - is spammed by api-gateway's healthcheck and other services are not reporting to Zipkin #74

Open asn25 opened 4 years ago

asn25 commented 4 years ago

Hi Chris,

there are some issues with Zipkin tracing config on my opinion:

1) ftgo-api-gateway is spamming to Zipkin with healthcheck spans. If I remove this line in api-gateway's application.properties: spring.sleuth.web.skipPattern=(^health.*) then health-check spamm is stopped and all is OK.

I guess that this filter is unnecessary. Here is excerpt from Spring Cloud Sleuth docs: == "By default, all the spring boot actuator endpoints are automatically added to the skip pattern." == So this filter line, when is active, overrides/cancels standard Sleuth filters, which filter actuator endpoints by default.

2) Other business services (Consumer, Restaurant, Kitchen, Accounting, OrderHistory) are not reporting to Zipkin. If to add these lines below to docker-compose.yml to "environment"-section of all these services, analogously with OrderService, then all is OK and every service starts reporting to Zipkin: SPRING_SLEUTH_SAMPLER_PROBABILITY: 1 SPRING_ZIPKIN_BASE_URL: http://zipkin:9411/

Thanks.

cer commented 4 years ago

@asn25 Interesting. When I first looked in Zipkin I don't actually see the API gateway - I had to uncomment some dependencies in Ftgo-api-gateway/build.gradle