This module contains tracing interceptors for Spring RestTemplate.
TracingClientHttpRequestInterceptor
and TracingAsyncClientHttpRequestInterceptor
add trace
headers to outgoing requests. They then report to Zipkin how long each request took, along with
relevant tags like the http url.
Tracing always needs a bean of type HttpTracing
configured. Make sure
it is in place before proceeding. Here's an example in XML and Java.
Then, wire TracingClientHttpRequestInterceptor
and add it with the
RestTemplate.setInterceptors
method. If you are using AsyncRestTemplate
and Spring 4.3+, you can
wire AsyncTracingClientHttpRequestInterceptor
and add it via AsyncRestTemplate.setInterceptors
.