0

I'm trying to integrate sleuth into a Spring Boot application so that it will talk to a zipkin server for tracing, but I'm not having much luck. I've followed a few tutorials (link to tutorial) and have no problems getting them to talk to zipkin, but it's not translating well to my application, and I'm not sure where to look.

essentially, in the build.gradle file, to the dependencies section, I added:

compile('org.springframework.cloud:spring-cloud-starter-sleuth')
compile("org.springframework.cloud:spring-cloud-sleuth-zipkin")

In the controller, I added these two beans:

@Bean
public RestTemplate getRestTemplate() {
  return new RestTemplate();
}
@Bean
public AlwaysSampler defaultSampler() {
  return new AlwaysSampler();
}

and, I added these to the application.properties file:

spring.application.name=pie2-lcp-endpoints
logging.level.org.springframework.web.servlet.DispatcherServlet=DEBUG

When I do all that in the demos, they send traces to my Zipkin host at localhost:4911 just fine (For the time being, I'm just running the quickstart jar file). When I do all that in my application, I see that I have sleuth log entries with strings like:

[pie2-partner-integration,768070516213fc75,768070516213fc75,true]

so, I know that Sleuth is working.

When I run a demo app with the zipkin server application shut off, the application looks like it's working fine, but, reasonably enough, the log files show a big old ConnectionRefused stack trace. When I try the same experiment with my application, I see no stack trace in my application logs, and the application also ran just fine.

Outside of my larger application, I can't reproduce my problem, and I don't know what else to share with you. Anyone have any suggestions about where to start?

Daniel Puiu
  • 962
  • 6
  • 21
  • 29
ReganJohnson
  • 35
  • 1
  • 1
  • 9
  • Maybe try adding the --debug flag to startup to see if there are any differences between the auto-configuration which is being applied for your application and the demo. – Patrick Bray Jun 19 '17 at 09:23

1 Answers1

0

*sigh, so it turns out, that someone had turned off zipking tracing in a properties file, for no good reason. *sigh

ReganJohnson
  • 35
  • 1
  • 1
  • 9