I am trying to use the 128 bit Sleuth generated TraceId as a unique identifier for request hitting my controller. I understand that the default traceId is 64 and to change it, I have to add the following to the application.properties:
spring.sleuth.trace-id128=true
This works on my local but when I deploy it to PCF,the trace ID is 64 bits. I have created a sample project that only has a simple controller to demonstrate this.
@RestController
public class Controller {
private Logger logger = LoggerFactory.getLogger(Controller.class);
@Autowired
private Tracer tracer;
@GetMapping("/")
public void test(){
logger.info("LOGGED +["+tracer.currentSpan().context().traceIdString()+"]");
}
}
In my local, it will print:
com.example.demo.Controller: LOGGED + [5bfcb33c9d564481479f2c212ec08143]
In PCF, it prints:
om.example.demo.Controller : LOGGED + [97a1168857dc7088]
Is PCF overwriting this configuration?
Updates
Included "X-B3-TraceId" and "X-B3-SpanId" in my request and the traceId is now 128bit but not the same string as what was passed in the request header.