You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/05/16 03:46:24 UTC

[GitHub] [skywalking] huangpang opened a new issue #2688: Ignore AntPathMatcher Matching does not meet expectations

huangpang opened a new issue #2688: Ignore AntPathMatcher Matching does not meet expectations
URL: https://github.com/apache/skywalking/issues/2688
 
 
   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Bug
   
   
   ___
   ### Bug
   - Which version of SkyWalking, OS and JRE?
   apache-skywalking-apm-6.1.0
   
   
   - What happen?
   apm-trace-ignore-plugin-6.1.0  
   
   org.apache.skywalking.apm.plugin.trace.ignore.matcher.AntPathMatcher(IgnoreAntPathMatcher)
   org.springframework.util.AntPathMatcher (SpringAntPathMatcher)
   
   IgnoreAntPathMatcher and  SpringAntPathMatcher show inconsistent performance
   
   I copied the IgnoreAntPathMatcher source code and tested it.
   cod:
    ```
   private static IgnoreAntPathMatcher MpathMatcher = new IgnoreAntPathMatcher();
       private static AntPathMatcher antPathMatcher = new AntPathMatcher();
       public static void main(String str[])
       {
           String operationName ="/rtp/topic/findPage";
           String pattens = "/**/svn/**";
            if (!StringUtil.isEmpty(pattens)) {
               String path = operationName;
               if (!StringUtil.isEmpty(path) && path.length() > 1 && path.endsWith("/")) {
                   path = path.substring(0, path.length() - 1);
               }
   
               for (String pattern : pattens.split(",")) {
                   if (antPathMatcher.match(pattern, path)) {  //false
                      log.info("antPathMatcher operationName : " + operationName + " Ignore tracking");
                   }
               }
                for (String pattern : pattens.split(",")) {
                    if (MpathMatcher.match(pattern, path)) {   // true
                        log.info("MpathMatcher operationName : " + operationName + " Ignore tracking"); // 11:30:37.189 [main] INFO IgnorePathTest - MpathMatcher operationName : /rtp/topic/findPage Ignore tracking
                    }
                }
           }
       }
   ```
   I think SpringAntPathMatcher meets my matching requirements better.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services