Springdoc/Swagger: Micrometer Tracing not passing to downstream. Require solution without RestTemplate

95 views Asked by At

Similar to the problem here: Micrometer Tracing traceId not passing into downstream

I am on Spring boot 3.1 and my downstream is on 2.7.x. We use openapi generator for our business logic and do not have a rest template. We do not use spring MVC. We were able to use Sleuth before we made the upgrade to Spring 3. Please assist as to how to use the interceptor in this case, without using RestTemplate? Thank you.

1

There are 1 answers

0
Jonatan Ivanov On

In case of RestTemplate, you can enable instrumentation like this:

@Bean
RestTemplate restTemplate(RestTemplateBuilder builder) {
    return builder.build();
}

See the docs: https://docs.spring.io/spring-framework/reference/integration/observability.html#observability.http-client.resttemplate