Sentinel Dashboard中的链路不对

来源:8-5 流控规则

JustryDeng

2020-02-14

软硬件环境:
      1、IDEA
      2、JDK1.8
      3、Sentinel 1.7.0
      4、Spring Boot 2.1.1.RELEASE
      5、Spring Cloud Greenwich.SR3
      6、Spring Cloud Alibaba 2.1.1.RELEASE


  • 问题描述:Sentinel Dashboard中的链路,与代码中的配置不相符
    1. 代码是这样的:
      import com.alibaba.csp.sentinel.annotation.SentinelResource;
      import lombok.RequiredArgsConstructor;
      import org.springframework.stereotype.Component;
      import org.springframework.web.bind.annotation.GetMapping;
      import org.springframework.web.bind.annotation.RestController;
      
      /**
       * 流控
       *
       * @author JustryDeng
       * @date 2020/2/14 17:01
       */
      @RestController
      @RequiredArgsConstructor
      public class FlowControlController {
      
          private final TmpService tmpService;
      
          @GetMapping("/hello")
          public String ds() {
              return "hello DengShuai";
          }
      
          @GetMapping("/hi")
          public String jd() {
              return "hi JustryDeng";
          }
      
          @GetMapping("/abc")
          public String abc() {
              return "DengShuai invoke " + tmpService.commonLogic();
          }
      
          @GetMapping("/xyz")
          public String xyz() {
              return "JustryDeng invoke " + tmpService.commonLogic();
          }
      
          @Component
          public static class TmpService {
      
              @SentinelResource(value = "common")
              public String commonLogic() {
                  return "i am service logic";
              }
          }
      }
      
    2. Sentinel Dashboard中是这样的:
      图片描述

  • 问题:
    在看了其它的issue后,我怀疑这可能是版本的问题;但是由于我在学习前面的内容的时候,就是采用的上述软硬件环境,为了保持一致,我不想把Sentinel这块儿的版本调低。所以,
    1. 上述问题是版本的问题吗?
    2. 如果是版本的问题的话,有没有什么好的解决方式呢?(因为我准备找到一个相对较稳定的版本,应用于生产,如果上述问题能比较好的解决的话,我觉得当前用的Spring Cloud Alibaba 2.1.1.RELEASE版本就可以考虑)
写回答

1回答

大目

2020-02-14

这是sentinel 1.7.0带来的bug,目前还没有解决。 可以降级到1.6或更低版本
0
2
大目
回复
JustryDeng
alibaba得降到0.9.0哈
2020-02-15
共2条回复

Spring Cloud Alibaba微服务从入门到进阶

面向未来微服务:熟练掌握Spring Cloud Alibaba

2979 学习 · 1299 问题

查看课程