opentracing-contrib / java-spring-web

OpenTracing Spring Web instrumentation
Apache License 2.0
107 stars 59 forks source link

TracingHandlerInterceptor order cannot be changed and even overridden #131

Open kohegen opened 4 years ago

kohegen commented 4 years ago

TracingHandlerInterceptor is created in that way there is no possibility of changing order of that interceptor like it's done for TracingFilter. (both beans are configured in ServerTracingAutoConfiguration)

IMO it should be registered using InterceptorRegistration in similar way to TracingFilter. Also those configuration should be separated because if I want to register just filter then interceptor will be registered automatically. In my case for example I would want to be able to register TracingHandlerInterceptor by myself to change order, but I can't do that because if I turn opentracing.spring.web.enabled off then also TracingFilter wont be registered.