小D课堂
筆記
7、斷路器Dashboard監控儀表盤實戰
簡介:講解斷路器Dashboard基礎使用和查看
1、加入依賴
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
2、啟動類增加注解
@EnableHystrixDashboard
3、配置文件增加endpoint
management:
endpoints:
web:
exposure:
include: "*"
4、訪問入口
http://localhost:8781/hystrix
Hystrix Dashboard輸入: http://localhost:8781/actuator/hystrix.stream
參考資料
默認開啟監控配置
https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-security-actuator
配置文件類:
spring-configuration-metadata.json
開始
一般加上報警器就可以了 短信報等
這是儀表盤的界面
加入兩個依賴在OrderService里面
啟動類里面加入注解
不能連接源數據信息
先把超時時間都改為1秒。feign和hytrix都改成1秒
星號表示暴露全部端點
重啟應用
啟動日志里面以為actuator開頭的
這里就編程了Loading
訪問幾次接口。因為把超時時間設置為1秒了所以這里肯定就報錯了。
總結
- 上一篇: 卖油翁欧阳修原文及翻译
- 下一篇: 拽的句子短句 拽句霸气的句子131个