sentinel 控制台接入

SpringBoot  Web应用==

1. 引入sentinel依赖(你可以在maven仓库查找最新版,点击直接查看)

sentinel别的依赖不用引入了,这个依赖基本全部引入了。

<!--接入ali sentinel 控制台的包-->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-alibaba-sentinel</artifactId>
    <version>0.2.0.RELEASE</version>
</dependency>

2. 在application.yml中配置 

spring:
  application:
    name: cf-coupon-service
  #该应用注册到 sentinel 控制台
cloud:
  sentinel:
    transport:
      dashboard: localhost:8080  # 控制台地址

3. Controller中

@Controller
public class TController {
    @GetMapping("/test")
    public void test() {
        
    }
}

4. 启动控制台(下载地址在这里)

java -jar sentinel-dashboard.jar

5. 访问控制台

打开浏览器   http://localhost:8080

6. 浏览器访问 /test ,不停的刷新访问。

7. 刷新控制台,看实时监控。

OK

原文地址:https://www.cnblogs.com/selfchange/p/9933972.html