In Spring boot 3.1.5 with Java 17 I'm using micrometer but some of my services still using spring boot 2+ versions with java 8 and sleuth.
Now the question is some of services in spring boot 3.1.5 are able to generate 16 length traceId but some are generating 32 length traceId all services having same config and dependency as below.
pom.xml
<!-- Logging -->
<dependency>
<groupId>io.github.openfeign</groupId>
<artifactId>feign-micrometer</artifactId>
</dependency>
<dependency>
<groupId>.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
config class
@Configuration
@EnableConfigurationProperties(TracingProperties.class)
public class BraveAutoConfig {
@Bean
public Tracing braveTracing(Environment environment, TracingProperties properties, List<SpanHandler> spanHandlers,
List<TracingCustomizer> tracingCustomizers, CurrentTraceContext currentTraceContext,
Propagation.Factory propagationFactory, Sampler sampler) {
Tracing.Builder builder = Tracing.newBuilder()
.currentTraceContext(currentTraceContext)
.traceId128Bit(false)
.supportsJoin(properties.getBrave().isSpanJoiningSupported())
.propagationFactory(propagationFactory)
.sampler(sampler);
spanHandlers.forEach(builder::addSpanHandler);
for (TracingCustomizer tracingCustomizer : tracingCustomizers) {
tracingCustomizer.customize(builder);
}
return builder.build();
}
}
.traceId128Bit(false) is in all the spring boot 3 services and all the service in local machine generating 16 length
but some of the services generating 32 length traceId on cloud watch AWS
requirement is to generate 16 length traceId for all the services.