Hystrix Dashboard graphical configuration and monitoring

In addition to the isolation dependent services electrophoresis, Hystrix also provides on-time call monitoring (Hystrix Dashboard), Hystrix will continue to record execution information for all by Hystrix initiated the request, and presented to the user in the form of statistical reports and graphs, including each how many seconds to perform the requested much success, how many failures and so on. Netflix to achieve the above indicators for monitoring .SpringCloud also provides integrated hystrix Dashboard, and monitoring content into visual interface through hystrix-metrics-event-stream projects.

Configuration

Its dependencies

 <dependencies>

        <!-- hystrix dashboard 图形化监控依赖 -->
        <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>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

Master boot class plus @EnableHystrixDashboard open dashboard monitor

Its dependencies

Each monitored service must have hystrix porcupine and master classes open @EnableCircuitBreaker start fuse

        <!-- hystrix -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
        </dependency>
        <!-- actuator -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

Also!

Because springcloud upgrade pit --- SerlvetRegistrationBean because the default path springboot not "/hystrix.stream" need to look at the following configuration servlet class master boot monitored projects

    @Bean
    public ServletRegistrationBean getServlet()
    {
        HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet();
        ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet);
        registrationBean.setLoadOnStartup(1);
        registrationBean.addUrlMappings("/hystrix.stream");
        registrationBean.setName("HystrixMetricsStreamServlet");
        return registrationBean;
    }

Illustrating

The frequency of requests for the service request frequency

Percentile delay statistics delay statistics for the last minute percentile

Guess you like

Origin www.cnblogs.com/nineberg/p/12655861.html