Hystrix Metrics Stream

You can also enable the Hystrix Metrics Stream by adding a dependency on spring-boot-starter-actuator. Hystrix will expose the metrics stream by using /hystrix.stream as a management endpoint:

<dependency> 
   <groupId>org.springframework.boot</groupId> 
   <artifactId>spring-boot-starter-actuator</artifactId> 
</dependency> 

Also add the following configurations to the application property file (application.propeties):

management.endpoint.health.enabled=true 
management.endpoints.jmx.exposure.include=* 
management.endpoints.web.exposure.include=* 
management.endpoints.web.base-path=/actuator 
management.endpoints.web.cors.allowed-origins=true 
management.endpoint.health.show-details=always 

These configurations are required to expose the Hystrix Metrics Stream in Spring Boot 2.0.

Let's access the /hystrix.stream endpoint on the browser to see the Hystrix Metrics Stream. The http://localhost:6161/actuator/hystrix.stream URI represents a continuous stream that Hystrix generates. This stream is generated by Hystrix to monitor health and all the service calls that are being monitored. Let's see the sample output in the screenshot:

You can see in the preceding screenshot which JSON data represents the status for the health checkup of the services and the monitoring data stream for the service calls. It is very difficult to monitor because it looks like a very complex JSON format. Hystrix provides a Hystrix Dashboard for the Hystrix Metrics Stream and it will render the same data in GUI format in a very simple way. In the next section, we will explore Hystrix Dashboard.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.185.87