v3.0.0-M4 - Make the constant TRACING_FILTER_ORDER publicly accessible
Is your feature request related to a problem? Please describe.
With Spring Cloud Sleuth v2.x we were able to import TraceWebServletAutoConfiguration.TRACING_FILTER_ORDER but since 3.x there is no way to access it because the class was made non-public.
Describe the solution you'd like
That constant is actually defined in TraceHttpAutoConfiguration but for some reason it has package-private access only. It was also previously accessible through TraceWebFilter but the class is not public in v3 anymore.
Maybe TraceHttpAutoConfiguration.TRACING_FILTER_ORDER could be made public?
Describe alternatives you've considered
The alternative is to duplicate the value as it is defined in TraceHttpAutoConfiguration when registering a web filter but that's not ideal if it was to change in the future.
Additional context
We have a custom filter that we need to register ahead of the TraceWebFilter.
Done via https://github.com/spring-cloud/spring-cloud-sleuth/commit/76ad931b4298b18389d0a4ea739316c14682888b
You can access it through https://github.com/spring-cloud/spring-cloud-sleuth/blob/master/spring-cloud-sleuth-autoconfigure/src/main/java/org/springframework/cloud/sleuth/autoconfig/instrument/web/SleuthWebProperties.java#L38
By the way, this official documentation is obsolete: https://cloud.spring.io/spring-cloud-sleuth/reference/html/#tracingfilter
It says:
@Component
@Order(TraceWebServletAutoConfiguration.TRACING_FILTER_ORDER + 1)
class MyFilter extends GenericFilterBean {
...
}
But we do not have that TraceWebServletAutoConfiguration.TRACING_FILTER_ORDER anymore. Now imho it should be like@Order(SleuthWebProperties.TRACING_FILTER_ORDER + 1)
The official documentation lives here https://docs.spring.io/spring-cloud-sleuth/docs/3.0.0/reference/html/
Hello,
I using import org.springframework.cloud.sleuth.autoconfig.instrument.web.SleuthWebProperties; to access SleuthWebProperties.TRACING_FILTER_ORDER.
However, since migrating to Micrometer, i encountered difficulties in accessing that property. Is there a solution available?
See: https://github.com/micrometer-metrics/micrometer/issues/3884#issuecomment-1582702912