@SpringBootApplication
@EnableZuulProxy
@EnableDiscoveryClient
@EnableResourceServer
public class Application {
private static final Logger LOGGER = LoggerFactory.getLogger(Application.class);
public static void main(String[] args) {
// TODO Auto-generated method stub
//SpringApplication.run(Application.class, args);
new SpringApplicationBuilder(Application.class).web(true).run(args);
}

zuul---->auth-server is missing, why?
thanks very much for your help !
Is AuthServer using Sleuth too ?
@marcingrzejszczak
yes
pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</dependency>
conf:
spring.rabbitmq.host = ${RABBITMQ_SERVER_HOST}
spring.rabbitmq.port = ${RABBITMQ_PORT}
spring.rabbitmq.username = ${RABBITMQ_USER}
spring.rabbitmq.password = ${RABBITMQ_PASSWORD}`
and the data in mysql:

but the traceid is new , not pass from zuul
You have the wrong dependency...
Change spring-cloud-sleuth-zipkin-stream to spring-cloud-sleuth-stream. I understand that you are sending spans via messaging? The first one is the Zipkin collector and you want to send spans to Zipkin. If you send spans via HTTP change spring-cloud-sleuth-zipkin-stream to spring-cloud-starter-zipkin.
@marcingrzejszczak
you mean the zipkin-server use: spring-cloud-sleuth-zipkin-stream
but the client use: spring-cloud-sleuth-stream ?
Yes, as described in the documentation.
http://cloud.spring.io/spring-cloud-sleuth/spring-cloud-sleuth.html#_sleuth_with_zipkin_via_spring_cloud_stream - client
http://cloud.spring.io/spring-cloud-sleuth/spring-cloud-sleuth.html#_spring_cloud_sleuth_stream_zipkin_collector - server
thanks, i have try the above solution, but it not works yet, seems not this reason.
because:
zuul-server log: traceId: 11c0211bcd23189c

then, the auth-server log:

doesn't search the traceId
the auth-server create new traceId ,not pass from the zuul-server
and the auth-server could send message to zipkin-server normal:

Could you please start pasting the logs instead of screenshots? Could you also upload your sample applications somewhere? It will be difficult for me to analyze the problem without the real apps
@marcingrzejszczak
code: https://github.com/junneyang/xxproject
auth-server zuul-server and zipkin-server all in:
xxproject/support/ fold
thnaks
Ok, one more question. Could you please run the sample again but turn on the Sleuth's logs to DEBUG in Auth server. Then please upload it here as a file. I'd like to see if the headers are there.
Also can you please try it out with the latest Dalston snapshots? I have a hunch that it's related to OAuth2 template that we have only fixed in the latest snapshots.
ok, thanks, i will feedback tomorrow,time to sleep,^_^
a low-level question, how to find the latest Dalston snapshots? thanks
Just pick the Dalston.BUILD-SNAPSHOT version here http://projects.spring.io/spring-cloud/ and copy it to your project
@marcingrzejszczak
the auth-server log
you mean the Finchley M1?

No, I mean a snapshot version. Any snapshot version.
still not work
the snapshot auth-server log:
snapshot-app.log.txt
Did you put snapshot versions in all applications? Can you post the logs or the client app too?

thanks for your help
I'm trying to go through this sample but it's so gigantic that it's difficult to work with. Is there an option to prepare just 2 applications. Zuul and Authentication server and a simple script how to run these things together? I'd like to debug how Zuul is sending a request to the Authentication server. Cause it seems that it's not passing the tracing information for some reason. Thanks!
@marcingrzejszczak
mvn package
thanks for your kindly help!
@marcingrzejszczak
when i refer this issue: https://github.com/spring-cloud/spring-cloud-sleuth/issues/581
add this
@Bean
public UserInfoRestTemplateCustomizer userInfoRestTemplateCustomizer(
TraceRestTemplateInterceptor traceRestTemplateInterceptor) {
return restTemplate -> {
List<ClientHttpRequestInterceptor> interceptors = new ArrayList<>(
restTemplate.getInterceptors());
interceptors.add(traceRestTemplateInterceptor);
restTemplate.setInterceptors(interceptors);
};
}
to zuul, product-api-service it works!

Yeah so the thing is that it should work out of the box... :| Can you ensure that you're using latest snapshots, and check if this line https://github.com/spring-cloud/spring-cloud-sleuth/blob/253b34b1cf5627c61e8e4cb8e75fcc00d22e5664/spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/client/TraceWebClientAutoConfiguration.java#L117 is executed?
Ha! Actually I know why it's not working. I've created a Bean Post Processor and I'm wrapping a UserInfoRestTemplateCustomizer with a trace representation. But what if there's not a single one defined? Then nothing happens. That's why if there's no UserInfoRestTemplateCustomizer defined then one should be applied. I'll add a fix in a second
Ok it's fixed. Can you check against latest snapshots? And ensure that you don't have the manual UserInfoRestTemplateCustomizer set
I'm sorry, I tried to run the sample locally but I didn't manage to do it. With the latest changes things should work fine so I'll close the issue and if you find out that there are still some problems just feel free to reopen it.
fixed by https://github.com/spring-cloud/spring-cloud-sleuth/commit/6d25738ec41aab2d2ebe3c152be7271a3dc57649
Most helpful comment
ok, thanks, i will feedback tomorrow,time to sleep,^_^