opentracing-contrib / java-spring-web

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

FilterRegistrationBean not defined in non spring boot application #71

Closed abhsinh2 closed 6 years ago

abhsinh2 commented 6 years ago

I have not spring mvc application NOT spring boot. In readme, example to extend WebMvcConfigurerAdapter shows use of FilterRegistrationBean which is spring boot class. What should I use for non spring boot application?

is below code fix the problem? @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new TracingHandlerInterceptor(tracer)).addPathPatterns("/*"); }

pavolloffay commented 6 years ago

@abhsinh2 maybe you can use ServletContextListener to register the filter there

pavolloffay commented 6 years ago

Here is an example https://github.com/opentracing-contrib/java-spring-web/blob/master/opentracing-spring-web-itest/mvc/src/test/java/io/opentracing/contrib/spring/web/interceptor/itest/mvc/SpringMVCConfiguration.java

pavolloffay commented 6 years ago

@abhsinh2 I will close the issue. If you have more questions feel free to re-open/comment.

The mvc configuration can be found in opentracing-spring-web-itest/mvc module