I am using spring Boot Version 1.5.14.RELEASE with spring cloud sleuth zipkin. If I return a ResponseEntity setting its HttpStatus as BAD_REQUEST then I see the trace highlighted in Blue color. Is there a way to highlight the trace in Red color for a bad request with ResponseEntity object?
I explicitly threw a custom Exception for bad requests and saw the zipkin trace highlighted in Red color in Zipkin UI. But I don't want to do this as I am returning a body in ResponseEntity.
public ResponseEntity<ResponseDto> saveRecord(Employee employee) {
if(isValidated(employee)) {
return new ResponseEntity<ResponseDto>(repo.save(employee), HttpStatus.OK);
} else {
return new ResponseEntity<ResponseDto>(service.handleErrorResponse(employee), HttpStatus.BAD_REQUEST);
}
}
I expect the Zipkin trace to be highlighted in Red color as it is a bad request but the actual color is Blue.