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 2020/12/30 07:30:02 UTC

[GitHub] [skywalking] evilester opened a new issue #6104: Sample rate configuration failure

evilester opened a new issue #6104:
URL: https://github.com/apache/skywalking/issues/6104


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [x] Bug
   - [ ] Requirement
   - [ ] Feature or performance improvement
   
   ___
   ### Question
   - What do you want to know?
   Sample rate configuration failure
   ___
   ### Bug
   - Which version of SkyWalking, OS, and JRE?
   v8.3.0
   - Which company or project?
    XiaoMai
   - What happened?
   Traceignoreextendservice inherits from contextmanagerextendservice to samplingservice. When servicemanger manages class loadallservices, this will conflict with the default sampling rate configuration samplingservice. The keys of both are the same,so the SamplingService whil not boot
   
   ```
    private Map<Class, BootService> loadAllServices() {
           Map<Class, BootService> bootedServices = new LinkedHashMap<>();
           List<BootService> allServices = new LinkedList<>();
           load(allServices);
        // plugin TraceIgnoreExtendService and SamplingService has the same key
           for (final BootService bootService : allServices) {
               Class<? extends BootService> bootServiceClass = bootService.getClass();
               boolean isDefaultImplementor = bootServiceClass.isAnnotationPresent(DefaultImplementor.class);
               if (isDefaultImplementor) {
                   if (!bootedServices.containsKey(bootServiceClass)) {
                       bootedServices.put(bootServiceClass, bootService);
                   } else {
                       //ignore the default service
                   }
               } else {
                   OverrideImplementor overrideImplementor = bootServiceClass.getAnnotation(OverrideImplementor.class);
                   if (overrideImplementor == null) {
                       if (!bootedServices.containsKey(bootServiceClass)) {
                           bootedServices.put(bootServiceClass, bootService);
                       } else {
                           throw new ServiceConflictException("Duplicate service define for :" + bootServiceClass);
                       }
                   } else {
                       Class<? extends BootService> targetService = overrideImplementor.value();
                       if (bootedServices.containsKey(targetService)) {
                           boolean presentDefault = bootedServices.get(targetService)
                                                                  .getClass()
                                                                  .isAnnotationPresent(DefaultImplementor.class);
                           if (presentDefault) {
                               bootedServices.put(targetService, bootService);
                           } else {
                               throw new ServiceConflictException(
                                   "Service " + bootServiceClass + " overrides conflict, " + "exist more than one service want to override :" + targetService);
                           }
                       } else {
                           bootedServices.put(targetService, bootService);
                       }
                   }
               }
   
           }
           return bootedServices;
       }
   ```
   :class org.apache.skywalking.apm.agent.core.sampling.SamplingService=org.apache.skywalking.apm.plugin.trace.ignore.TraceIgnoreExtendService@6622fc65
   
   ![image](https://user-images.githubusercontent.com/4954490/103336240-6f7c8e00-4ab2-11eb-8672-8909a4faaf25.png)
    
   ___
   


----------------------------------------------------------------
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



[GitHub] [skywalking] evilester commented on issue #6104: Sample rate configuration failure

Posted by GitBox <gi...@apache.org>.
evilester commented on issue #6104:
URL: https://github.com/apache/skywalking/issues/6104#issuecomment-752819451


   > You mean `TraceIgnoreExtendService` will override and disable `SamplingService`, right?
   
   yes


----------------------------------------------------------------
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



[GitHub] [skywalking] evilester commented on issue #6104: Sample rate configuration failure

Posted by GitBox <gi...@apache.org>.
evilester commented on issue #6104:
URL: https://github.com/apache/skywalking/issues/6104#issuecomment-752821028


   > Currently, yes. They are alternative. Do you want `TraceIgnoreExtendService` including `SamplingService`'s capabilities?
   > If so, we are welcome the pull request. This is not hard. Just call `super.*` at the right places in the `TraceIgnoreExtendService` .
   
   OK, I'll try


----------------------------------------------------------------
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



[GitHub] [skywalking] wu-sheng commented on issue #6104: Sample rate configuration failure

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6104:
URL: https://github.com/apache/skywalking/issues/6104#issuecomment-752819964


   Currently, yes. They are alternative. Do you want `TraceIgnoreExtendService` including `SamplingService`'s capabilities?
   If so, we are welcome the pull request. This is not hard. Just call `super.*` at the right places in the `TraceIgnoreExtendService` .


----------------------------------------------------------------
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



[GitHub] [skywalking] wu-sheng closed issue #6104: Sample rate configuration failure

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #6104:
URL: https://github.com/apache/skywalking/issues/6104


   


----------------------------------------------------------------
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



[GitHub] [skywalking] evilester edited a comment on issue #6104: Sample rate configuration failure

Posted by GitBox <gi...@apache.org>.
evilester edited a comment on issue #6104:
URL: https://github.com/apache/skywalking/issues/6104#issuecomment-752819451


   > You mean `TraceIgnoreExtendService` will override and disable `SamplingService`, right?
   
   yes,when we remove apm-trace-ignore-plugin-8.2.0.jar it works
   
   


----------------------------------------------------------------
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



[GitHub] [skywalking] wu-sheng commented on issue #6104: Sample rate configuration failure

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #6104:
URL: https://github.com/apache/skywalking/issues/6104#issuecomment-752367741


   You mean `TraceIgnoreExtendService` will override and disable `SamplingService`, right?


----------------------------------------------------------------
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