Comparison
Correlation IDvsInterceptor
Correlation ID
you generate one id at the edge and stamp it on every log line the request produces anywhere in the system.
A single identifier propagated through every component handling a request, so logs across services can be joined. It is the cheapest possible observability investment and the one most often retrofitted during an incident. It must survive queue hops, or the async half of the request becomes unattributable.
Full entry →Interceptor
logging appeared around every method in the service and there is no line of your code that calls it.
A hook that a framework runs around a call, letting cross-cutting behaviour be attached without editing the target — the mechanism behind aspect-oriented programming, servlet filters, gRPC interceptors and most annotation-driven transactions. It is a decorator that you did not write and cannot see at the call site, which is both the appeal and the cost. Debugging is where the bill arrives: the stack trace names classes nobody wrote.
Full entry →