依赖

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>

最新版本是2.2.0.RELEASE

配置

spring:
  cloud:
    sentinel:
      transport:
        dashboard: 192.168.1.6:8850
        client-ip: 192.168.1.7

主要是配置spring.cloud.sentinel.transport.dashboard=192.168.1.6:8850

此时就接入了sentinel-dashboard

sentinel-dashboard是懒加载,只有当有流量的时候才会显示.多请求几次

WARNING

注意:

如果是基于 URL 的格式,形如/sentinel/echo是不会在sentinel-dashboard中显示的.

必须是 /sentinel 才行.