Brave has a feature called joint spans that was enabled by default with Spring Cloud Sleuth (and Boot 2.x). This has changed with Micrometer Tracing and Boot 3.x. In order to make migration simpler, joint spans should be set through a property. This is a Brave+B3-only feature, OTel does not have this capability.
See gh-34803
Comment From: fer1979
With sprint boot 3.1.5 in two microservices, one using FeignClient to request to the other microservice , I have this properties configuration in both microservices:
management:
tracing:
propagation:
produce: b3
consume: b3
brave:
span-joining-supported: true
logging:
pattern:
level: "%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-},%X{parentId:-}]"
```
I have next library in both poms:
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
<version>1.1.6</version>
</dependency>
I have this FeignConfiguration lets called in microservice A to get the context propagated to the microservice B:
@Configuration public class FeignConfiguration {
@Bean
public Capability capability(final MeterRegistry registry) {
return new MicrometerCapability(registry);
}
}
I have this in order to log PARENT_ID in both microservices and is working fine:
@Configuration public class BraveTracerConfig {
@Bean
CorrelationScopeCustomizer parentIdCorrelationScopeCustomizer() {
return builder -> builder.add(SingleCorrelationField.create(BaggageFields.PARENT_ID));
}
} ```
When microservice A calls microservice B, traceId is propagated but I dont see in microservice B in the logs the spanId or parentId logged in the feignClient from the microservice A, they are different except for traceId
First of all, I read about Spring Boot 3.x does not allow joining of spans. But with the brave configuration is supposed I can get it, right?
Thanks!
Comment From: philwebb
@fer1979 this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it).