简体   繁体   中英

how to migrate usage of TracingClientHttpRequestInterceptor with RestTemplate to springboot 3 with Micrometer Tracing?

I started the migration of a service to SpringBoot 3 and now I have a problem code that used org.springframework.cloud.sleuth.instrument.web.mvc.TracingInterceptor

 restTemplate.getInterceptors().add(0,tracingInterceptor);

I didn't find the analogy of org.springframework.cloud.sleuth.instrument.web.mvc.TracingInterceptor in the new Micrometer Tracing API. How to propagate traceId and spanId during calls to other services with restTemplate ?

RestTemplate is natively using micrometer observation api. You don't need to add anything on RestTemplate to have observability

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM