Microservices – Hystrix Dashboard

Hystrix Dashboard

Steps to Configure Hystrix Dashboard
Step 1: Add below starter dependencies in your microservice

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
</dependency>

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

Step 2: Add @EnableHystrixDashboard annotation in your main class

@package org.techlearnings;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableEurekaClient
@EnableCircuitBreaker
@EnableHystrixDashboard
public class UserDetailsServiceApplication {

	public static void main(String[] args) {
		SpringApplication.run(MovieCatalogServiceApplication.class, args);
	}
	
	@Bean
	@LoadBalanced
	public RestTemplate getRestTemplate() {
		return new RestTemplate();
	}

}

Step 3: Add below property in your application.properties file

management.endpoints.web.base-path=/
management.endpoints.web.exposure.include=hystrix.stream

Step 4: Accessing Hystrix Dashboard
To access Hystrix dashboard access hit below URL

http(s)://<hystrix-app>:<port>/hystrix.stream

That’s it!!!

Author: Mahesh

Technical Lead with 10 plus years of experience in developing web applications using Java/J2EE and web technologies. Strong in design and integration problem solving skills. Ability to learn, unlearn and relearn with strong written and verbal communications.