spring cloud hystrix dashboard 单机监控
***************************
单体监控:监控单个微服务应用
***************************
监控的消费端
@FeignClient(name = "hello-provider",fallback = HelloServiceImpl.class)
public interface HelloService {
@RequestMapping("/hello")
String hello();
@RequestMapping("/hello2")
String hello2(@RequestParam("name")String name);
}
***************************
新建hystrix dashboard应用
*************
导入jar 包
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>
*************
主类上加注解
@SpringBootApplication
@EnableHystrixDashboard
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
***************************
访问http://localhost:8080/hystrix
单机监控