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

 

相关文章:

  • 2021-06-17
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-08-07
  • 2021-07-30
  • 2022-12-23
  • 2021-04-22
猜你喜欢
  • 2022-02-25
  • 2022-12-23
  • 2021-07-04
  • 2021-05-31
  • 2022-02-27
  • 2022-12-23
  • 2021-11-12
相关资源
相似解决方案