@@ -0,0 +1,1139 @@
+package de.jeha.j7.request.tracing;%0A%0Aimport org.slf4j.MDC;%0A%0Aimport javax.servlet.*;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport java.io.IOException;%0Aimport java.util.Optional;%0Aimport java.util.UUID;%0Aimport java.util.function.Supplier;%0A%0A/**%0A * @author jenshadlich@googlemail.com%0A */%0Apublic class RequestTracingServletFilter implements Filter %7B%0A%0A    private final static String X_TRACE_ID = %22X-Trace-Id%22;%0A    private final static Supplier%3CString%3E TRACE_ID_SUPPLIER = () -%3E UUID.randomUUID().toString();%0A%0A    @Override%0A    public void init(FilterConfig filterConfig) throws ServletException %7B%0A    %7D%0A%0A    @Override%0A    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)%0A            throws IOException, ServletException %7B%0A        final Optional%3CString%3E traceIdFromRequest =%0A                Optional.ofNullable(HttpServletRequest.class.cast(request).getHeader(X_TRACE_ID));%0A        final String traceId = traceIdFromRequest.orElse(TRACE_ID_SUPPLIER.get());%0A%0A        MDC.put(X_TRACE_ID, traceId);%0A%0A        chain.doFilter(request, response);%0A    %7D%0A%0A    @Override%0A    public void destroy() %7B%0A    %7D%0A%0A%7D

add servlet filter to trace requests