@Configuration @ServletComponentScan(basePackages="io.opns.otl.web.filter") @Import(value=io.opns.otl.spring.client.SpringWebConfig.class) public class OTLSpringBootConfig extends Object
TracingWebFilter includes the WebFilter annotation, and
today most of the web server/application server can recognize this annotation
and accordingly load the filter. However, spring boot uses the embedded web
server (Apache Tomcat). Due to the fact that embedded containers do not support
WebServlet, WebFilter and WebListener annotations, Spring Boot, relying greatly
on embedded containers, introduced this new annotation @ServletComponentScan to
support some dependent jars that use these 3 annotations.
Here we use the ServletComponentScan annotation as a hint to the embedded
web container to facilitate the loading of the OTL filter.
This annotation will scan the specified package to find and load the OTL filter.
It will be initialized with default configuration, which includes the default
FilterSpanDecorator and no skip pattern. The url pattern will be
set by spring boot, which is [/*], which means this filter will be invoked for
all possible urls.Copyright © 2020. All rights reserved.