In this post, I’ll show you how to implement correlation ids in a Spring Boot application, how to propagate them to downstream services (optionally, with FeignClient), and how to log them using Logback.

What Are Correlation IDs?

In modern microservices architectures, a single user request often traverses multiple services before a response is returned. When something goes wrong, or when you want to trace the flow of a request, it can be challenging to follow its journey across service boundaries. This is where correlation IDs come in.