After upgrading to Spring Boot 2.4 and Spring Cloud 2020.0, the trace id correlation doesn't work as before. Probably the logback's AmqpAppender provided by Spring is working differently.
I don't think this is a bug in Spring; I was taking advantage of getting the same traceId values in the RabbitMQ messages consumed by the centralized logger, but this implementation was quite fragile.
What I'm doing now is simpler and more robust. Instead of getting the Sleuth metadata in the logs microservice, I'm just propagating it in the messages as they get produced. This way, I don't even need Sleuth in the centralized logger, which implementation should be kept as dumb as possible.
After upgrading to Spring Boot 2.4 and Spring Cloud 2020.0, the trace id correlation doesn't work as before. Probably the logback's
AmqpAppender
provided by Spring is working differently.I don't think this is a bug in Spring; I was taking advantage of getting the same
traceId
values in the RabbitMQ messages consumed by the centralized logger, but this implementation was quite fragile.What I'm doing now is simpler and more robust. Instead of getting the Sleuth metadata in the
logs
microservice, I'm just propagating it in the messages as they get produced. This way, I don't even need Sleuth in the centralized logger, which implementation should be kept as dumb as possible.