-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LogFilter is not compatible with spring-cloud-sleuth #9
Comments
thanks @sabertiger. sleuth had the function to echo trace-id in response headers, and it was removed due to security concerns. see spring-cloud/spring-cloud-sleuth#424
|
If we decide to do this, sleuth documents how to include headers in response: |
The functionality to generate trace and span ids has been removed from the latest release. OpenTracing/Brave now defines three separate standards for tracing headers, so it's best to rely on their standard libraries for detection/generation of these values. We've also removed the functionality to echo trace ids in response headers for the same reason - |
An application with both
spring-cloud-sleuth
andspring-log-filter
generates two trace ids for the same request when no/invalidX-B3-TraceId
is passed in an incoming http request. Thespring-cloud-sleuth
trace id is present the application'sRestTemplate
requests to external web services and some portions of the application log. Thespring-log-filter
trace id is passed in the application to client response header and other portions of the application log.Verified that sleuth filter always runs first, and predix-log-filter runs second.
org.springframework.cloud.sleuth.instrument.web.TraceFilter
has very high precedence:Ordered.HIGHEST_PRECEDENCE + 5
.com.ge.predix.log.filter.LogFilter
has no set precedence, and thus run as the defaultOrdered.LOWEST_PRECEDENCE
.When the incoming http request contains a valid
X-B3-TraceId
, the outgoing RestTemplate request, logged trace id, and response trace id all correspond to the request value.However, when the
X-B3-TraceId
is missing or invalid, LogFilter generates its own value instead of reusing the value generated by spring-cloud-sleuth resulting in two distint trace ids for the same request:The text was updated successfully, but these errors were encountered: